Application deployment method, device, equipment, and computer-readable storage medium

By generating application and component instances and building a dynamic topology map, the application is automatically deployed, solving the low efficiency problem caused by manual resource allocation in existing technologies and improving deployment efficiency.

CN114840220BActive Publication Date: 2025-09-23TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110145948.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-02
Publication Date
2025-09-23
Estimated Expiration
2041-02-02

AI Technical Summary

Technical Problem

In the existing technology, when deploying an application, the person in charge of each component needs to manually allocate resources and deploy the application, resulting in a large workload and low efficiency.

Method used

By generating application instances and component instances, building a dynamic topology map, and using computer equipment to automatically deploy applications and components, deployment is based on description files and dependencies.

Benefits of technology

It reduces the workload of developers and improves the efficiency of application deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114840220B_ABST
    Figure CN114840220B_ABST
Patent Text Reader

Abstract

The present application provides an application deployment method, apparatus, device, and computer-readable storage medium. The method includes: in response to a deployment instruction for a target application, obtaining a description file of the target application and a description file of at least one component on which the target application depends; generating an application instance corresponding to the target application and a component instance corresponding to each component based on the description file of the target application and the description file of the component; constructing a dynamic topology map corresponding to the target application using the application instance and the component instance as nodes; and deploying the application instance and each component instance based on the dynamic topology map to complete the deployment of the target application. This application can improve the efficiency of application deployment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to computer technology, and in particular to an application deployment method, apparatus, device, and computer-readable storage medium. Background Art

[0002] Application deployment refers to deploying an application to a designated data processing environment, such as a private cloud, so that the application can run within that data processing environment and provide corresponding functions and services. Applications can span various fields, such as the Internet of Things, artificial intelligence, and gaming.

[0003] In related technologies, an application is usually divided into multiple components for deployment. When deploying an application, the person in charge of each component is required to help allocate resources, deploy components, and apply for cloud services, resulting in a heavy workload for the person in charge and low efficiency of application deployment. Summary of the Invention

[0004] The embodiments of the present application provide an application deployment method, apparatus, device, and computer-readable storage medium, which can improve the efficiency of application deployment.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] This embodiment of the present application provides an application deployment method, including:

[0007] In response to a deployment instruction for a target application, obtaining a description file of the target application and a description file of at least one component on which the target application depends;

[0008] Generate an application instance corresponding to the target application based on the description file of the target application, and generate a component instance corresponding to each component based on the description file of the component;

[0009] Using the application instances and component instances as nodes, construct a dynamic topology graph corresponding to the target application;

[0010] Based on the dynamic topology diagram, the application instance and each component instance are deployed respectively to complete the deployment of the target application.

[0011] The present invention provides an application deployment device, including:

[0012] an acquisition module, configured to acquire, in response to a deployment instruction for a target application, a description file of the target application and a description file of at least one component on which the target application depends;

[0013] A generating module, configured to generate an application instance corresponding to the target application and a component instance corresponding to each of the components based on the description file of the target application and the description file of the components;

[0014] A construction module, configured to construct a dynamic topology graph corresponding to the target application using the application instance and component instance as nodes;

[0015] A deployment module is used to deploy the application instance and each component instance respectively based on the dynamic topology diagram to complete the deployment of the target application.

[0016] In the above solution, the generating module is further configured to generate an application object corresponding to the target application based on the description file of the target application, and to generate a component object corresponding to each component based on the description file of the component;

[0017] Constructing a static topology graph corresponding to the target application using the application objects and component objects as nodes;

[0018] The static topology diagram is used to describe the dependency relationship between the application object and the component object, and the dependency relationship between the component objects;

[0019] An application instance corresponding to the target application and a component instance corresponding to each of the components are generated according to the static topology diagram.

[0020] In the above solution, the generation module is further used to create an empty object corresponding to the target application;

[0021] Recording the fields in the description file of the target application into an empty object corresponding to the target application to generate an application object corresponding to the target application;

[0022] Create an empty object corresponding to each of the components;

[0023] The fields in the description file of each component are recorded into the empty object of the corresponding component respectively, so as to generate an application object corresponding to the target application.

[0024] In the above solution, the generating module is further configured to use the application objects and component objects as nodes of the static topology graph;

[0025] Acquire, according to the description file of the target application, a first component that the target application directly depends on;

[0026] Constructing an edge from the application object to the component object corresponding to the first component;

[0027] When determining, based on the description file of each component, that there is a second component on which the component directly depends, obtaining the second component on which the component directly depends;

[0028] Construct an edge from the component object corresponding to the component to the component object corresponding to the second component to obtain a static topology graph corresponding to the target application.

[0029] In the above solution, the generating module is further used to traverse the static topology graph from top to bottom in a deep traversal manner, and

[0030] During the traversal process, corresponding instances are generated according to the traversed objects to obtain the application instance corresponding to the target application and the component instance corresponding to each of the components.

[0031] In the above solution, the generating module is further configured to create an instance corresponding to the root node when the traversed object is a root node;

[0032] Obtain the deployment parameters for the object itself carried by the object, and add the deployment parameters to the instance corresponding to the root node.

[0033] In the above solution, the generating module is further configured to create an instance corresponding to the non-root node when the traversed object is a non-root node;

[0034] Obtaining the deployment parameters for the object itself carried by the object and the deployment parameters for the object passed by the upper-layer object;

[0035] The acquired deployment parameters are added to the instance corresponding to the non-root node.

[0036] In the above solution, the generation module is further configured to, when the traversed object is not a root node, obtain the deployment parameters for the lower-layer objects of the object passed by the upper-layer object, and pass them to the lower-layer objects of the object;

[0037] Obtaining the deployment parameters for the lower-layer objects carried by the object and passing them to the lower-layer objects of the object;

[0038] The deployment parameters passed to the lower-layer object are used to be added to the instance corresponding to the lower-layer object when the instance corresponding to the lower-layer object is generated.

[0039] In the above solution, the generating module is further configured to, when the object carries an instance sharing group field, determine that the instance sharing group field corresponds to a shared instance in an instance sharing group;

[0040] generating an instance identifier corresponding to the shared instance;

[0041] Among them, the shared instance is an instance that the instance corresponding to the object and other instances depend on, and the instance identifier is used to no longer generate an instance of the object corresponding to the shared instance during the process of traversing the dynamic topology map and generating corresponding instances.

[0042] In the above solution, the deployment module is further used to deploy instances corresponding to each node layer by layer from bottom to top starting from the leaf nodes of the dynamic topology graph, and the instances are application instances or component instances.

[0043] In the above solution, the deployment module is further used to add the instance corresponding to the leaf node of the dynamic topology graph to the deployable sequence;

[0044] Loop through the following operations until the deployable sequence is empty:

[0045] Taking out a target number of instances from the deployable sequence for deployment;

[0046] When the target number of instances are deployed, adding identification information to the upper-layer instance of the instance, where the identification information is used to indicate that the instance has been deployed;

[0047] When it is determined according to the identification information that the instance on which the upper-layer instance depends has been deployed, the upper-layer instance is added to the deployable sequence.

[0048] In the above solution, the deployment module is further configured to extract a target number of instances from the deployable sequence and add them to the deployment sequence;

[0049] Concurrently deploy instances in the deployment sequence.

[0050] An embodiment of the present application provides a computer device, including:

[0051] a memory for storing executable instructions;

[0052] The processor is used to implement the application deployment method provided in the embodiment of the present application when executing the executable instructions stored in the memory.

[0053] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute and implement the application deployment method provided in the embodiment of the present application.

[0054] The embodiments of the present application have the following beneficial effects:

[0055] Applying the above embodiment, an application instance corresponding to the target application is generated based on the description file of the target application, and a component instance corresponding to each component is generated based on the description file of the component; a dynamic topology map corresponding to the target application is constructed with the application instance and the component instance as nodes; based on the dynamic topology map, the application instance and each component instance are deployed respectively to complete the deployment of the target application; in this way, since the dynamic topology map describes the relationship between the application instance and the component instance, and the relationship between the component instances, the computer device can process the relationship between the application instance and the component instance, and the relationship between the component instances. The developer only needs to trigger the deployment instruction for the target application, and the computer device can use the dynamic topology map to realize the automatic deployment of the target application, reducing the workload of the developer and improving the efficiency of application deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 1 is a schematic diagram of the architecture of an application deployment system 100 provided in an embodiment of the present application;

[0057] Figure 2 is a structural diagram of a computer device 500 provided in an embodiment of the present application;

[0058] Figure 3 This is a flow chart of a method for deploying an application provided in an embodiment of the present application;

[0059] Figure 4 This is a schematic diagram of the deployment interface of the target application provided in the embodiment of the present application;

[0060] Figure 5 is a schematic diagram of a static topology diagram provided in an embodiment of the present application;

[0061] Figure 6 is a schematic diagram of a dynamic topology diagram provided in an embodiment of the present application;

[0062] Figure 7 This is a schematic diagram of the software system architecture for deploying the application provided in the embodiment of the present application;

[0063] Figure 8 This is a flow chart of a method for deploying an application provided in an embodiment of the present application;

[0064] Figure 9 This is a schematic diagram of the process of generating a dynamic topology map provided in an embodiment of the present application;

[0065] Figure 10 This is a schematic diagram of the process of instance deployment provided by the embodiment of the present application;

[0066] Figure 11 This is a flow chart of a single instance deployment provided in an embodiment of the present application. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0068] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0069] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0070] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0071] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0072] 1) Components, including application components and cloud services. Application components are codes and products that complete a single function, deployed and run on the cloud platform, and provide services to callers on the network. Cloud services are cloud services provided by Software-as-a-Service (SaaS) platforms or Platform-as-a-Service (PAAS) platforms, including naming services, NoSQL services, relational database services, message queues, text recognition, etc. Application components can rely on cloud services.

[0073] 2) Application, which consists of multiple components and provides background services for one or more client applications;

[0074] 3) Instance. An abstract class is called an instance after being instantiated. The abstract class is static and does not occupy process memory, while the instance has dynamic memory.

[0075] 4) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be real-time or have a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.

[0076] To achieve application deployment, two solutions are provided in the related art, namely the Helm package management solution and the Open Application Model (OAM) solution.

[0077] Helm is the package management solution for the Kubernetes platform, an open-source platform for managing containerized applications across multiple hosts in a cloud platform. An application on the Kubernetes platform is typically deployed as multiple components, each with its own deployment method, service access method, and dependencies on other components and services. Each component dimension has a separate description file. In the Helm package management solution, all description files are packaged, and the variable fields in these files are exposed to users through templates. These packages are stored in a unified repository, and users can pull the corresponding packages as needed and deploy them on the Kubernetes platform using the Helm tool.

[0078] During the implementation of this application, the applicant discovered that the Helm package management solution simply packages all the description files required to deploy an application together, and then sets the user parameters to each component through template replacement. The application deployment process is complicated and it is only applicable to the Kubernetes platform.

[0079] The OAM solution separates the concerns of development, operation, and infrastructure roles by defining a cloud-native application model consisting of components, application deployment configuration, and operation and maintenance characteristics, and builds an application-centric platform.

[0080] During the implementation of this application, the applicant discovered that the OAM solution separates development and operation and maintenance into two separate roles, with developers responsible for components and operation and maintenance features and resources responsible for operation and maintenance personnel. It does not take into account the dependencies between client components and backend services, lacks implementation details such as end-to-end cloud integration, configuration connectivity, and topology management, and cannot achieve automatic deployment of applications.

[0081] Based on this, embodiments of the present application provide an application deployment method, apparatus, device, and computer-readable storage medium, which can improve the efficiency of application deployment.

[0082] See also Figure 1 , Figure 1This is a schematic diagram of the architecture of an application deployment system 100 provided in an embodiment of the present application. To support an exemplary application, application deployment system 100 includes a terminal 400, a container platform 200, and a database 500. Terminal 400 and container platform 200 are connected via a network 300, which can be a wide area network (WAN), a local area network (LAN), or a combination of the two. Here, applications and components are deployed in the container platform.

[0083] During actual implementation, developers write description files for the target application and its dependent components, and store the written description files in the code library;

[0084] When the target application needs to be deployed, the developer inputs a command line for triggering the deployment instruction for the target application through the terminal 400; after receiving the command line, the terminal 400 triggers the deployment instruction for the target application;

[0085] In response to a deployment instruction for a target application, terminal 400 obtains a description file of the target application and a description file of at least one component on which the target application depends from a code repository; generates an application instance corresponding to the target application based on the description file of the target application, and generates component instances corresponding to each component based on the description file of the component; constructs a dynamic topology map corresponding to the target application using the application instance and the component instance as nodes; and deploys the application instance and each component instance to the container platform 200 based on the dynamic topology map to complete the deployment of the target application;

[0086] In some embodiments, the terminal 400 may store the generated dynamic topology map in the database 500 for use during redeployment.

[0087] In some embodiments, the container platform 200 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, in-vehicle device, smart TV, etc., but is not limited thereto.

[0088] See also Figure 2 , Figure 2 The computer device 500 is a schematic diagram of the structure of the embodiment of the present application. In practical applications, the computer device 500 can be a terminal or a server. Figure 1 Taking the terminal shown as an example, the computer device for implementing the application deployment method of the embodiment of the present application is described. Figure 2 The computer device 500 shown includes: at least one processor 510, a memory 550, at least one network interface 520, and a user interface 530. The various components in the computer device 500 are coupled together via a bus system 540. It is understood that the bus system 540 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 540 is not described in detail. Figure 2 Various buses are labeled as bus system 540 .

[0089] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0090] The user interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0091] The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 550 may optionally include one or more storage devices that are physically remote from the processor 510.

[0092] The memory 550 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.

[0093] In some embodiments, the memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.

[0094] Operating system 551, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0095] A network communication module 552 for reaching other computing devices via one or more (wired or wireless) network interfaces 520 , exemplary network interfaces 520 including Bluetooth, WiFi, and USB;

[0096] a presentation module 553 for enabling presentation of information via one or more output devices 531 (e.g., a display screen, a speaker, etc.) associated with the user interface 530 (e.g., a user interface for operating peripheral devices and displaying content and information);

[0097] The input processing module 554 is configured to detect one or more user inputs or interactions from one of the one or more input devices 532 and to translate the detected inputs or interactions.

[0098] In some embodiments, the application deployment device provided in the embodiments of the present application can be implemented in software. Figure 2 A deployment device 555 of an application stored in a memory 550 is shown, which may be software in the form of a program and a plug-in, etc., and includes the following software modules: an acquisition module 5551, a generation module 5552, a construction module 5553 and a deployment module 5554. These modules are logical and can therefore be arbitrarily combined or further split according to the functions implemented.

[0099] The functions of each module will be described below.

[0100] In other embodiments, the conversation message processing device provided in the embodiments of the present application can be implemented in hardware. As an example, the conversation message processing device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the expression processing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0101] The deployment method of the application provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the terminal provided in the embodiment of the present application.

[0102] See also Figure 3 , Figure 3 This is a flow chart of the deployment method of the application provided in the embodiment of the present application, which will be combined with Figure 3 The steps shown are explained.

[0103] Step 301: In response to a deployment instruction for a target application, the terminal obtains a description file of the target application and a description file of at least one component that the target application depends on.

[0104] Here, a target application corresponds to a client's backend program, which is composed of at least one component, which may in turn depend on other components. The at least one component that the target application depends on includes components that the target application directly depends on and components that the target application indirectly depends on. Components that the target application directly depends on are components that constitute the target application, and components that the target application indirectly depends on are components that the components that constitute the target application depend on.

[0105] For example, the target application consists of component A and component D, where component A depends on component B and component C, component D depends on component E, and component E depends on component F. Then, the components that the target application directly depends on are component A and component D, and the components that the target application indirectly depends on are component B, component C, component E, and component F. Therefore, it is necessary to obtain the description file of the target application and the description files of components A, component D, component B, component C, component E, and component F.

[0106] It should be noted that the components here include application components and cloud services, among which application components are codes and products that complete a single function, which are deployed and run on the cloud platform to provide services to callers on the network; cloud services are cloud services provided by SaaS platforms or PAAS platforms, including naming services, NoSQL services, relational database services, message queues, text recognition, etc. Application components can rely on cloud services.

[0107] In actual applications, the description file of the target application and the description file of at least one component that the target application depends on are pre-written by the developer and stored in the code library. When the target application needs to be deployed, the developer triggers the deployment instruction for the target application, and the terminal obtains the description file of the target application and the description file of at least one component that the target application depends on from the code library.

[0108] Here, the deployment instruction for the target application may be triggered by a deployment control, or by a command line for deploying the application, or by other means.

[0109] Exemplarily, when the deployment instruction for the target application is triggered through a command line, the developer inputs a command line for deploying the target application through a command line deployment tool, such as inputting “fef d”.

[0110] In actual implementation, the description file describes the application or component. To solve the problem of automatic deployment and mutual communication of dependent components, this application uniformly models the application and components and standardizes the description file of the model. For example, the description file of this application can use YAML format, and the fields include: kind, name, platform, version, deploy, platform, configs, exports, imports, depends, containers.

[0111] Among them, kind is used to indicate the type, which includes Component, Application, XaaS, etc. Component indicates that the described object is a backend component; Application indicates that the described object is an application; XaaS indicates that the described object is a PaaS service or SaaS service. Name is used to indicate the name of the described object (application or component). Platform is used to indicate the application component, usually Cloud. Version is used to indicate the version number of the described object. DeployPlatform is used to indicate the deployment platform of the described object. Configs is used to define the external parameters required for the deployment of the described object, that is, deployment parameters, such as startup parameters, including environment variables and values ​​required for container startup. Exports is an export parameter that defines several variables for storing the return values ​​after the described object is deployed; common return values ​​include: intranet service name and external network access name. Imports describes the components that the current component or application depends on. Before deploying the current component or application, these dependent application components need to be deployed first. Depends: Describes the cloud service that the current application or component depends on. Containers: Describes the container images contained in the described object.

[0112] As an example, Figure 4 This is a schematic diagram of the deployment interface of the target application provided in the embodiment of the present application, see Figure 4 To deploy a target application, a developer writes a description file 401 for the target application. The description file includes fields such as kind, name, platform, version, and deploy. The developer then triggers a deployment instruction for the target application, causing the terminal to execute the corresponding deployment task. The deployment process 402 is presented, and after the deployment is complete, the deployment result 403 is presented.

[0113] Step 302: Generate an application instance corresponding to the target application and a component instance corresponding to each component based on the description file of the target application and the description file of the component.

[0114] In actual implementation, since the target application depends on other components, the application instance will call the component instances of other components it depends on. During the calling process, it will pass the parameters used in the call to the corresponding component instance; and for each component, if the component depends on other components, then the component instance will call the component instances of other components it depends on. During the calling process, the parameters used in the call need to be passed to the corresponding component instance.

[0115] Based on this, for components that are dependent on applications or components, when generating a component instance of the component, this application not only needs to be based on the description file of the component, but also needs to be based on the description file of the target application and component that depends on the component, and obtain the parameters required to generate the component instance from these description files to generate the component instance; and for the target application, when generating an application instance of the target application, this application only needs to be based on the description file of the target application to obtain the parameters required to generate the application instance, and then generate the application instance.

[0116] In some embodiments, the application instance corresponding to the target application and the component instance corresponding to each component can be generated in the following manner: based on the description file of the target application, the application object corresponding to the target application is generated, and based on the description file of the component, the component object corresponding to each component is generated; with the application object and the component object as nodes, a static topology map corresponding to the target application is constructed; wherein the static topology map is used to describe the dependency relationship between the application object and the component object, and the dependency relationship between the component objects; based on the static topology map, the application instance corresponding to the target application and the component instance corresponding to each component are generated.

[0117] In actual implementation, an application class can be abstracted from the target application's description file, serving as an application object. Furthermore, a component class can be abstracted from the component description files, serving as a component object. Each component corresponds to a component object. Application and component objects are static and do not occupy process memory. A static topology graph is constructed using application and component objects as nodes, and the dependencies between application and component objects, as well as the dependencies between component objects, as edges.

[0118] In this way, the terminal can determine the dependency between application objects and component objects, and the dependency between component objects based on the static topology map, and then generate corresponding application instances for application objects and corresponding component instances for component objects.

[0119] In some embodiments, the application object corresponding to the target application can be generated in the following manner: creating an empty object corresponding to the target application; recording the fields in the description file of the target application into the empty object corresponding to the target application to generate the application object corresponding to the target application; the component objects corresponding to each component can be generated in the following manner: creating an empty object corresponding to each component; recording the fields in the description file of each component into the empty object of the corresponding component to generate the component object corresponding to the component.

[0120] In actual implementation, an empty object corresponding to the target application is created, and then the fields in the description file of the target application are added to the empty object as variables defined in the object to generate an application object corresponding to the target application; for each component, an empty object is created, and then the fields in the description file of the component are added to the empty object as traversals defined in the object to generate a component object corresponding to the corresponding component.

[0121] In some embodiments, a static topology map of the corresponding target application can be constructed in the following manner, including: using application objects and component objects as nodes of the static topology map; obtaining the first component that the target application directly depends on according to the description file of the target application; constructing an edge from the application object to the component object corresponding to the first component; when determining, according to the description file of each component, that there is a second component that the component directly depends on, obtaining the second component that the component directly depends on; constructing an edge from the component object corresponding to the component to the component object corresponding to the second component, so as to obtain the static topology map of the corresponding target application.

[0122] In actual implementation, the static topology is a directed topology. The direction of the edges in the topology is the direction of the dependency, from the relying party to the dependent party. The description file records the dependency relationships, and the components that the described object depends on can be determined through the description file, including the dependent application components and cloud services. For example, the imports field in the description file is used to describe the other application components that the described object depends on, and the depends field describes the cloud services that the described object depends on.

[0123] In actual applications, you can recursively parse the description files one by one to obtain the components that the target application directly depends on, as well as the components that each component directly depends on. Here, the dependency relationship between the target application and the components is consistent with the dependency relationship between the application object and the component object; and the dependency relationship between components is consistent with the dependency relationship between component objects. For example, the target application directly depends on application component A and application component D, and the application object directly depends on application component object A and application component object D.

[0124] As an example, Figure 5 This is a schematic diagram of a static topology diagram provided in an embodiment of the present application, see Figure 5, when it is determined according to the description file that the target application directly depends on application component A and application component D, application component A directly depends on application component B, application component C and Redis cloud service, and application component D directly depends on application component C and Redis cloud service, you can build the following Figure 5 In the static topology diagram shown, there is an edge between the application object and the application component object A, which points from the application object to the application component object A.

[0125] In some embodiments, the application instance corresponding to the target application and the component instance corresponding to each component can be generated in the following manner: a deep traversal method is used to traverse the static topology graph from top to bottom, and during the traversal process, corresponding instances are generated based on the traversed objects to obtain the application instance corresponding to the target application and the component instance corresponding to each component.

[0126] The object is an application object corresponding to the target application or a component object corresponding to the component, and accordingly, the generated instance is an application instance corresponding to the target application or a component instance corresponding to the component.

[0127] In actual implementation, a depth traversal is performed from top to bottom according to the direction of the directed topology graph, that is, starting from the application object. It should be noted that for component objects that are dependent on multiple component objects, multiple traversals are required, and the number of traversals is determined by the number of component objects that depend on the component object.

[0128] For example, see Figure 5 First, access the application object, then access application component objects A and D, and then access application component objects B, C, and the Redis cloud service object. Because application component objects B, C, and the Redis cloud service are dependent not only on application component object A but also on application component object D, they need to be accessed twice.

[0129] In some embodiments, a corresponding instance can be generated based on the traversed object in the following manner: when the traversed object is a root node, an instance of the corresponding root node is created; deployment parameters for the object itself are obtained, and the deployment parameters are added to the instance of the corresponding root node.

[0130] Here, when the traversed object is the root node, the parameters required to generate the instance only include the deployment parameters for the object itself carried by the object. The root node is usually a node in the static topology graph, and there is no edge pointing to it, such as Figure 5 The application object in .

[0131] In actual implementation, the root node is usually an application object, which usually depends on other components but is not depended on by other components. Based on this, when generating an application instance, it is only necessary to obtain the deployment parameters carried by the application object itself.

[0132] The deployment parameters here refer to the parameters required for deployment, which can be obtained through the config field in the object. They include parameters required to specify the deployment platform, parameters and values ​​required to apply for cloud platform resources, and environment variables and values ​​required to start the container.

[0133] In actual applications, a unique instance identifier, such as an instance ID (Identity Document), is assigned to the object. This identifier is inserted into a hash table with the current object as the key and the instance ID as the value. Here, the current object is the current object. An instance of the current object is then created and inserted into the hash table with the instance ID as the key. The deployment parameters from the current object are then applied to the instance of the current object.

[0134] In some embodiments, a corresponding instance can be generated based on the traversed object in the following manner: when the traversed object is a non-root node, an instance of the corresponding non-root node is created; the deployment parameters for the object itself carried by the object and the deployment parameters for the object passed by the upper-level object are obtained; and the obtained deployment parameters are added to the instance of the corresponding non-root node.

[0135] Here, when the traversed object is not a root node, the parameters required to generate the instance include not only the deployment parameters carried by the object for itself, but also the deployment parameters passed by its upper-level object. The upper-level object is an object that depends on the current object. In the static topology graph, the object is adjacent to the current object, and the edge between the object and the current object points to the current object. For example, see Figure 5 , when the current object is application component object A, the upper-level object is the application object.

[0136] In actual implementation, the upper-level object can carry the deployment parameters for the current object and then pass them to the current object; alternatively, the upper-level object can also pass the deployment parameters received by the upper-level object to the current object. Here, the process of passing deployment parameters is called the parameter input process.

[0137] In practice, a unique instance identifier is assigned to the object and inserted into a hash table using the current object's name as the key and the instance identifier as the value. Here, the current object is the current object. An instance of the current object is then created and inserted into the hash table using the instance identifier as the key. The deployment parameters of the current object are then applied to the instance of the current object, as are the deployment parameters passed from the upper-level object for the current object.

[0138] In some embodiments, after generating a corresponding instance based on the traversed object, if the traversed object is a root node, the deployment parameters for other objects carried by the object are obtained and passed to the object's lower-level objects. The deployment parameters for other objects here can be deployment parameters for lower-level objects, or deployment parameters for lower-level objects of lower-level objects, etc., that is, in the static topology diagram, the deployment parameters of any object located below the object can be used. The deployment parameters passed to the lower-level object are used to add to the instance corresponding to the lower-level object when the instance corresponding to the lower-level object is generated.

[0139] The lower-level object here is the object that the current object depends on. In the static topology graph, this object is adjacent to the current object, and the edge between the current object and this object points to this object. For example, see Figure 5 When the current object is application component object A, the lower-level objects are application component object B, application component object C, and the Redis cloud service object. When the current object is an application object, the objects at its lower level include all objects except the application object.

[0140] In actual implementation, the deployment parameters of lower-level objects are passed differently than those of other objects. This allows lower-level objects to directly use these parameters to generate instances. For example, the deployment parameters of lower-level objects are stored in a hash table using the key <this layer instance ID>.<lower layer object name>.params. The deployment parameters of other objects, excluding lower-level parameters, are stored in a hash table using the key <this layer instance ID>.<lower layer object name>.pass to implement the transmission of deployment parameters.

[0141] It should be noted that the "this layer instance" refers to the instance generated when traversing the current object. During the instance generation process, each instance is assigned a unique instance ID. Therefore, when deploying lower-level objects, you can use <this layer instance ID>.<lower-level object name>.params to find the corresponding deployment parameters.

[0142] In some embodiments, after generating a corresponding instance based on the traversed object, when the traversed object is a non-root node, the terminal can also obtain the deployment parameters for the lower-level object passed by the upper-level object and pass them to the lower-level object; obtain the deployment parameters for the lower-level object carried by the object and pass them to the lower-level object of the object; wherein the deployment parameters passed to the lower-level object are used to add to the instance corresponding to the lower-level object when generating the instance corresponding to the lower-level object.

[0143] In actual implementation, when the traversed object is not a root node, it is determined whether the object is a leaf node. If the object is not a leaf node, it indicates that there is a lower-level object of the object. Here, the deployment parameters for the lower-level object passed by the upper-level object have been stored in the Hash table with <upper-level instance ID>.<current object name>.pass as the key. If this deployment parameter is the deployment parameter of the lower-level object, it will be converted to <current instance ID>.<lower-level object name>.params as the key and stored in the Hash; if this deployment parameter is the deployment parameter of the lower-level object of the lower-level object, it will be converted to <current instance ID>.<lower-level object name>.pass as the key and stored in the Hash to realize the transmission of deployment parameters.

[0144] The deployment parameters for the lower-level objects carried by the current object can be passed in the manner described above, that is, stored in a hash table with <this layer instance ID>.<lower-level object name>.params as the key; the deployment parameters for other objects carried by the current object except the lower-level parameters are stored in the hash with <this layer instance ID>.<lower-level object name>.pass as the key to realize the transmission of deployment parameters.

[0145] In some embodiments, after generating a corresponding instance based on the traversed object, the method also includes: when the object carries an instance sharing group field, determining the shared instance in the instance sharing group corresponding to the instance sharing group field; generating an instance identifier corresponding to the shared instance; wherein the shared instance is an instance on which the instance corresponding to the object and other instances depend, and the instance identifier is used to no longer generate an instance of the object corresponding to the shared instance during the process of traversing the dynamic topology map and generating the corresponding instance.

[0146] In actual implementation, the instance sharing group field is used to define a shared instance. When the instance sharing group field exists, it indicates that a shared instance has been defined. For example, the instance sharing group field can define that component C, which A depends on, and component C, which D depends on, both depend on a single C instance. The instance sharing group field can then be used to determine the shared instance of the instance sharing group corresponding to the instance sharing group. For example, when the current object is A, the shared instance is instance C. When a shared instance is defined, an instance ID is pre-assigned to the shared instance. Thus, when traversing to the object corresponding to the shared instance, the instance is searched based on this pre-assigned instance ID to determine whether the instance already exists. If an instance object already exists, traversal of the object is skipped and no instance object is generated.

[0147] This application solves the problem of multiple components calling a component instance together by determining that the instance sharing group field corresponds to the shared instance of the instance sharing group when an object carries the instance sharing group field; and generating an instance identifier corresponding to the shared instance.

[0148] In practice, IDs are pre-assigned to shared instances and stored in a hash using <current-layer instance ID>.<lower-layer component name>[.<lower-layer component name>]* as the key. []* represents the string ".<lower-layer component name>" if there is a first-level lower-layer component, ".<lower-layer component name>" if there are two levels of lower-layer components, and ".<lower-layer component name>.<lower-layer component name>" if there are no lower-layer components.

[0149] Object-oriented Figure 5 For example, the key is <component A's ID>.<component C's name>. It should be noted that application component instance A and application component instance D share the same component instance C. Therefore, there are two keys in the hash table: <component A's ID>.<component C's name> and <component D's ID>.<component C's name>; their values ​​are both the pre-assigned component instance CID.

[0150] Step 303: Using application instances and component instances as nodes, construct a dynamic topology graph corresponding to the target application.

[0151] Dynamic topology diagrams are used to describe the dependencies between application instances and component instances, as well as the dependencies between component instances. In actual application deployments, multiple component instances may depend on the same component instance, while the same component may be deployed as multiple instances, each of which may depend on different component instances. Figure 6 This is a schematic diagram of the dynamic topology provided in the embodiment of the present application, see Figure 5 and Figure 6, assuming that application component instance A and application component instance D depend on the same application component instance C and the same Redis cloud service instance, but depend on different application component instances B, then the following is generated Figure 6 Dynamic topology diagram.

[0152] Step 304: Based on the dynamic topology diagram, deploy the application instance and each component instance respectively to complete the deployment of the target application.

[0153] In some embodiments, the reference instance and each component instance can be deployed separately through the fruit picking algorithm, that is, the application instance and each component instance can be deployed separately in the following way: starting from the leaf node of the dynamic topology graph, the instances corresponding to each node are deployed layer by layer from bottom to top, and the instances are application instances or component instances.

[0154] In actual implementation, in order to follow the dependency relationship between instances, the embodiment of the present application deploys each instance in batches, that is, starting from the leaf node of the dynamic topology diagram, the instances corresponding to each node are deployed layer by layer from bottom to top to ensure that when the upper-level instance is deployed, the lower-level instances it depends on have all been deployed and will not affect the deployment of the upper-level instance.

[0155] For example, Figure 6 Taking the dynamic topology diagram in as an example, first deploy application component instance Bi, application component instance C, Redis service instance, and application component instance B-ii, ​​then deploy application component instance A and application component D; finally, deploy the application instance.

[0156] In some embodiments, the instances corresponding to each node can be deployed layer by layer from bottom to top in the following manner: add the instances corresponding to the leaf nodes of the dynamic topology to the deployable sequence; loop the following operations until the deployable sequence is empty: take out the target number of instances from the deployable sequence for deployment; when the target number of instances are deployed, add identification information to the upper-level instance of the instance, and the identification information is used to indicate that the instance has been deployed; when it is determined based on the identification information that the instance on which the upper-level instance depends has been deployed, the upper-level instance is added to the deployable sequence.

[0157] In practical applications, after an instance is deployed, you can add identification information to its parent instance to indicate that the instance is complete. For a parent instance, if the identification information in the parent instance indicates that all dependent instances have been deployed, then the parent instance is ready for deployment. Based on this, you can create a deployable sequence, in which all instances in the deployable sequence are ready for deployment. Instances can then be taken from the deployable sequence for deployment. When the deployable sequence is empty, it indicates that all instances have been deployed.

[0158] In some embodiments, a target number of instances can be taken from a deployable sequence for deployment in the following manner: a target number of instances are taken from a deployable sequence and added to a deployment sequence; when all instances in the deployment sequence are component instances, the component instances in the deployment sequence are deployed concurrently.

[0159] Here, multiple component instances can be deployed concurrently. Based on this, when all instances in the deployment sequence are component instances, the component instances in the deployment sequence are deployed concurrently; when not all instances in the deployment sequence are component instances, the component instances in the deployment sequence are deployed concurrently first, and then the other instances are deployed.

[0160] In some embodiments, when the instance is a component instance, during the deployment process, deployment can be achieved for each target instance in the deployment sequence in the following ways: adding the access method of the instance on which the target instance depends to the target instance; based on the access method, deploying the component instance to the specified cloud platform or applying for service; obtaining the access method of the target instance from the target instance; based on the access method, deploying the component instance to the specified cloud platform or applying for service.

[0161] The access method here refers to the network service name and external network access name. For instances that the target instance depends on, the target instance's access method is stored after deployment for use by upper-level instances during deployment. For example, the service name can be recorded in a hash using <instance ID>.<service name variable name> as the key.

[0162] Among them, the target instance will be stored after deployment. When the upper-level instance of the target instance is deployed, the access method of the stored target instance can be obtained. This process is the process of outgoing parameters, that is, the access method of the target instance is passed to the upper-level instance of the target instance.

[0163] Here, the access method for the target instance can be obtained through the exports field, which specifies the network service name and the external network access name.

[0164] In actual applications, when the dependent instance is an application component instance, the cloud platform's OpenAPI deploys the component instance based on the access method; when the dependent instance is a cloud service instance, the cloud service is applied to the cloud platform through OpenAPI.

[0165] Correspondingly, when the target instance is an application component instance, the cloud platform's OpenAPI deploys the application component instance based on the access method; when the dependent instance is a cloud service instance, the cloud service is applied to the cloud platform through OpenAPI.

[0166] When the instance is an application instance, since the Application instance is composed of several Component instances and XaaS instances, it does not require any deployment or application operations. Therefore, it only needs to expose the access method (access name) of the component instance to the customer. That is, extract the service name from the hash using <lower-level instance ID>.<service name variable name> as the key and return it to the command line tool.

[0167] By applying the above embodiment, an application instance corresponding to the target application is generated based on the description file of the target application, and a component instance corresponding to each component is generated based on the description file of the component; a dynamic topology diagram corresponding to the target application is constructed with the application instance and the component instance as nodes; based on the dynamic topology diagram, the application instance and each component instance are deployed respectively to complete the deployment of the target application; in this way, since the dynamic topology diagram describes the dependency relationship between the application instance and the component instance, and the dependency relationship between the component instances, the computer device can process the dependency relationship between the application instance and the component instance, and the dependency relationship between the component instances. The developer only needs to trigger the deployment instruction for the target application, and the computer device can use the dynamic topology diagram to realize the automatic deployment of the target application, reducing the workload of the developer and improving the efficiency of application deployment.

[0168] The following describes an exemplary application of the embodiments of the present application in a practical application scenario. Figure 7 This is a schematic diagram of the software system architecture for the deployment of the application provided in the embodiment of the present application, see Figure 7 The application deployment system includes: command line tool 701, deployment service 702, database 703, container platform 704, PaaS platform 705, and SaaS platform 706.

[0169] The command line tool 701 is provided by the deployment platform for use by application deployers. The input parameters are several description files of the application and its components. The tool sends deployment, upgrade, uninstallation and other commands to the deployment platform and displays the progress and results of command execution to the user.

[0170] Deployment service 702 is used to implement the background service of this application, open up the interface with the container platform, PaaS platform, and SaaS platform in advance; receive commands and several description files submitted by the command line tool; parse the description files according to the needs of different commands, and generate dependency topologies between applications and application components, application components and application components, and application components and cloud services; deploy application components on the container platform in the reverse order of dependencies, and apply for cloud services from the PaaS platform / SaaS platform; at the same time, pass the upstream preset deployment parameters downward to the specified components, and pass the access parameters of the downstream components after instantiation to the upstream components.

[0171] The database 703 is used to record the master state machine and slave state machine that drive application deployment, store the instance topology of application deployment, and the flow of application component deployment and cloud service application.

[0172] Container platform 704 refers to the Kubernetes container platform; applications and application components are deployed on the container platform to provide services.

[0173] PaaS platform 705 / SaaS platform 706 refers to a public cloud that provides PaaS / SaaS services; PaaS / SaaS services include naming services, NoSQL services, relational database services, message queues, text recognition, etc.; application components deployed by developers usually rely on or call these services.

[0174] Here, in order to solve the problem of automatic deployment and mutual communication of dependent components, this application defines the model of applications and components through a specification description file. Developers write description files according to the format requirements and submit them to the deployment platform through command line tools.

[0175] The following is a detailed description of the application description file. The application description file uses the YAML format and the main fields include:

[0176] kind: Currently supported types include Component, Application, Package, and XaaS. Component indicates that the object being described is an application component; Application indicates that the object being described is an application; and XaaS indicates that the object being described is a PaaS / SaaS service.

[0177] name: The name of the object being described (application, application component, service, etc.).

[0178] Platform: Backend component, usually Cloud.

[0179] version: The version number of the object being described.

[0180] deployPlatform: The deployment platform of the described object, such as a container platform.

[0181] configs: defines the external parameters required for the deployment of the described object. It is divided into three categories and defined in the three fields below: features, params, and envs.

[0182] Among them, features specifies the parameters required for the deployment platform. The share in Features defines an instance sharing group. For example, the C component that A depends on and the C component that D depends on share a C instance. params specifies the parameters and values ​​required to apply for cloud platform resources. envs specifies the environment variables and values ​​required for container startup.

[0183] exports: defines several variables to store the return values ​​after the component is deployed; common return values ​​include: intranet service name and external network access name, etc.

[0184] imports: describes other components that the described object depends on; before deploying this component, these dependent components need to be deployed first.

[0185] depends: Describes the cloud services that the described object depends on.

[0186] Containers: Describes the container images contained in the described object.

[0187] That is, the description file defined in this application includes description objects (applications, application components, etc.), product, operation and maintenance characteristics, and resources. For example, component product includes the component name, deployment platform, version number, image address, called service, and startup parameters; resources include resource application parameters and the name of the external service; operation and maintenance characteristics include the deployment area, whether horizontal scaling is enabled, log level, etc., among which the operation and maintenance characteristics are scattered in the parameters of components and resources.

[0188] Based on the above description of the software system architecture and description files, the following describes the deployment method of the application provided in the embodiment of the present application. Figure 8 This is a flow chart of the application deployment method provided in the embodiment of the present application, see Figure 8 , the application deployment method provided in the embodiment of the present application includes:

[0189] Step 801: The deployment service obtains the description file of the target application and the description files of multiple components that the target application depends on.

[0190] Here, the target application and the multiple components it depends on have their own description files. When the command line tool sends deployment, upgrade, downgrade and other commands to the deployment service, it will package these description files and send them to the deployment service.

[0191] In actual implementation, during the component development phase, developers write a description file for the component and place it in the root directory of the code repository. The description file records the component name, deployment platform, version number, image address, called services, startup parameters, resource application parameters, the name of the external service, etc.

[0192] During the application deployment phase, developers first create a description file for the target application and place it in the root directory of the code repository. This file contains the application's name, version number, directly dependent groups, and the names of external services. Developers then use command-line tools to perform one-click deployment by entering the "fef d" command. Upon receiving this command, the command-line tool sends the deployment instructions, the target application's description file, and the description files of the components it depends on to the deployment service. The deployment service then retrieves the description files of the target application and its dependent components.

[0193] Step 802: Generate corresponding objects according to the description file, and construct a static topology map corresponding to the target application based on the generated objects.

[0194] In actual implementation, the deployment service starts with the target application's description file and recursively parses each description file one by one. It abstracts classes from the description file to generate corresponding objects. These objects include application objects and component objects. The target application corresponds to the application object, and each component corresponds to a component object. Every field in the description file is recorded in the object.

[0195] After the object is generated, the generated object is used as a node and the dependency relationship between objects is used as an edge to build a static topology graph of the corresponding application. The dependency relationship here can be determined based on the imports field and depends field in the description file. Figure 5 , the target application directly depends on component A and component D, component A depends on component B, component C and Redis cloud service, and component D depends on component C and Redis cloud service.

[0196] Step 803: Traverse the static topology graph from top to bottom, generate a corresponding instance for each object, and build a dynamic topology graph corresponding to the target application based on the generated instance.

[0197] Here, the dynamic topology diagram is used to describe the dependency relationship between instances. In the actual deployment of applications, there are cases where the same component instance or cloud service instance is dependent on by multiple component instances, that is, multiple component instances call the same component instance or cloud service instance; there are also cases where the same component is deployed as multiple instances, each of which is dependent on different component instances. Among them, the share field in the description file is used to define the shared instance. The above two situations can be determined by the share field, see Figure 5 , assuming that application component instance A and application component instance D depend on the same application component instance C and the same Redis cloud service instance, but depend on different application component instances B, then the following is generated Figure 6 The dynamic topology diagram.

[0198] In actual implementation, Figure 9 This is a schematic diagram of the generation process of the dynamic topology diagram provided in the embodiment of the present application, see Figure 9 , step 803 in the embodiment of the present application can be implemented through steps 901 to 9015.

[0199] Step 901: Starting from the root node, the static topology graph is traversed using a depth traversal method.

[0200] Here, during the traversal process, for objects with multiple parent objects, it is necessary to traverse twice, for example, see Figure 5 ,for Figure 5 The application component object B in the application component object needs to be traversed twice, that is, a lower-level component instance B is created for the application component object A and the application component object C.

[0201] Step 902: Get the next object. If the next object exists, execute step 903; otherwise, end the process.

[0202] Step 903: Use [<upper layer instance ID>].<current layer object name> as the key to query the instance ID. If the instance ID exists, execute step 912; otherwise, execute step 904.

[0203] Here, if the instance ID exists, it means that the instance ID has been generated. For example, for a shared instance, an instance ID has been pre-assigned when traversing its upper-level instance.

[0204] Step 904: Assign a unique instance ID to the object, and insert it into the hash table using [<upper layer instance ID>].<current layer object name> as the key.

[0205] Step 905: Create an instance corresponding to the current object, use the instance ID as the key, and insert it into the hash table.

[0206] Step 906: Fill the deployment parameters in the object of this layer into the instance of the corresponding object of this layer.

[0207] Step 907: Using [<upper layer instance ID>].<current layer object name>.params as the key, read the deployment parameters of the current layer object specified by the upper layer object from the hash table and fill them into the instance of the corresponding current layer object.

[0208] Step 908: Determine whether the object at this layer is a leaf node. If so, execute step 915; otherwise, execute step 909.

[0209] Step 909: The deployment parameters of the lower-level object specified by the upper-level object are passed on to the lower level.

[0210] This involves upper-level objects, current-level objects, and lower-level objects. The deployment parameters for lower-level objects specified by an upper-level object are stored in a hash table using the key <upper-level instance ID>.<current-level object name>.pass. If this deployment parameter is for a lower-level object, it is converted to a hash table using the key <current-level instance ID>.<lower-level object name>.params. If this deployment parameter is for a lower-level object, it is converted to a hash table using the key <current-level instance ID>.<lower-level object name>.pass.

[0211] Step 910: The deployment parameters of the lower-layer objects specified by the current-layer objects are passed on to the lower layers.

[0212] Similar to step 909, if this deployment parameter is the deployment parameter of the lower-level component, it will be converted and stored in the Hash table with <this layer instance ID>.<lower-level object name>.params as the key; if this deployment parameter is the deployment parameter of the lower-level component of the lower-level component, it will be converted and stored in the Hash table with <this layer instance ID>.<lower-level object name>.pass as the key.

[0213] Step 911: When a shared instance is defined in the object of this layer, an instance ID is pre-allocated for the shared instance.

[0214] Here, the description of the current-layer object can define shared instances of lower-layer components. When defining a shared instance, you must pre-assign an ID to the shared instance and store the instance ID in a hash using <current-layer instance ID>.<lower-layer component name>[.<lower-layer component name>]* as the key. []* indicates that the string is filled in based on the actual hierarchy: if there is a first-level lower-layer component, then .<lower-layer component name>; if there are two levels of lower-layer components, then .<lower-layer component name>.<lower-layer component name>; if there is no lower-layer component, then this string is not present.

[0215] The object of this layer is Figure 4 For example, the key here is <component A's ID>.<component C's component name>. It should be noted that the component A instance and the component D instance share the same component C instance. Therefore, there are two keys in the hash table: <component A's ID>.<component C's component name> and <component D's ID>.<component C's component name>; their values ​​are both the pre-assigned component C instance ID.

[0216] Step 912: Use the instance ID as the key to query the instance. If the instance object exists, execute step 913; otherwise, execute step 905.

[0217] Step 913: Add a new upper-level instance ID to the upper-level instance list of the instance object.

[0218] Here, by adding an upper-level instance ID, the ID of the upper-level instance is recorded in the current instance. For example, Figure 6 The application component instance C in the example has recorded the upper-level instance "application component instance A". Here, another upper-level instance ID is added, namely, application component instance D.

[0219] Step 914: Skip the objects in this layer.

[0220] Step 915: Add the instance of the corresponding object of this layer to the deployable sequence.

[0221] Step 804: Starting from the leaf nodes of the dynamic topology graph, deploy instances layer by layer from bottom to top.

[0222] Here, for component instances, they are deployed to the container platform, and for cloud service instances, services are requested from the corresponding service platform.

[0223] In actual implementation, Figure 10 This is a schematic diagram of the process of instance deployment provided by the embodiment of this application, see Figure 10 , step 804 in the embodiment of the present application can be implemented through steps 1001 to 1007.

[0224] Step 1001: Add instances corresponding to leaf nodes of a dynamic topology graph to a deployable sequence.

[0225] Step 1002: Determine whether the deployable sequence is empty or timed out. If so, end the process; otherwise, execute step 1003.

[0226] Step 1003: Take N instances from the deployable sequence and add them to the deployment sequence.

[0227] Step 1004: Concurrently deploy instances in the deployment sequence.

[0228] Step 1005: When the instance is deployed, it is marked in all upper-layer instances that the instance has been deployed.

[0229] Step 1006: Check whether the instances that these upper-layer instances depend on have all been deployed.

[0230] Step 1007: Add the upper-layer instance whose dependent instances have been deployed to the deployable sequence.

[0231] Here, when the instance is an application component (Component) instance or a cloud service (XaaS) instance, Figure 11 This is a flow chart of a single instance deployment provided by the embodiment of the present application, see Figure 11During the deployment process, for each target instance in the deployment sequence, a single instance can be deployed through steps 1101 to 1104.

[0232] Step 1101: Add the access method of the instance that the target instance depends on to the target instance.

[0233] Here, for each instance that the target instance depends on, the service name is extracted from the Hash using <lower-level instance ID>.<service name variable name> as the key and stored in the target instance.

[0234] Step 1102: Deploy component instances or apply for services to a designated cloud platform.

[0235] Here, when the dependent instance is a Component instance, the OpenAPI of the cloud platform deploys the component instance based on the access method; when the dependent instance is an XaaS instance, the cloud service is applied to the cloud platform through OpenAPI.

[0236] Step 1103: Obtain the access method of the target instance from the target instance, and deploy the component instance or apply for service to the designated cloud platform based on the access method.

[0237] The access method here can be obtained through the Exports field, which specifies the network service name and the external network access name.

[0238] Step 1104: Record the service name in the Hash using <instance ID>.<service name variable name> as the key.

[0239] Here, the stored service name will be used as a deployment parameter of the upper-level instance for use by the upper-level instance during deployment.

[0240] For application instances, since they are composed of several Component instances and XaaS instances, they do not require any deployment or application operations. Therefore, they only need to expose the access method (access name) of the component instance to the customer. That is, extract the service name from the hash using <lower-level instance ID>.<service name variable name> as the key and return it to the command line tool.

[0241] In actual applications, the deployment process can be displayed through the user interface during the target application process, and a prompt message of successful deployment can be displayed after the deployment is completed.

[0242] By applying the above-mentioned embodiments of the present application, application deployment can be completed in minutes, which greatly improves the application deployment efficiency and greatly reduces the workload during development and operation and maintenance.

[0243] The following continues to describe the exemplary structure of the application deployment device 555 provided in the embodiment of the present application implemented as a software module. In some embodiments, such as Figure 2 As shown, the software modules stored in the application deployment device 555 of the memory 550 may include:

[0244] An acquisition module 5551 is configured to acquire, in response to a deployment instruction for a target application, a description file of the target application and a description file of at least one component on which the target application depends;

[0245] A generating module 5552 is configured to generate an application instance corresponding to the target application and a component instance corresponding to each component based on the description file of the target application and the description file of the component;

[0246] A construction module 5553 is used to construct a dynamic topology graph corresponding to the target application using the application instance and component instance as nodes;

[0247] The deployment module 5554 is used to deploy the application instance and each component instance respectively based on the dynamic topology diagram to complete the deployment of the target application.

[0248] In some embodiments, the generating module 5552 is further configured to generate an application object corresponding to the target application based on the description file of the target application, and to generate a component object corresponding to each component based on the description file of the component;

[0249] Constructing a static topology graph corresponding to the target application using the application objects and component objects as nodes;

[0250] The static topology diagram is used to describe the dependency relationship between the application object and the component object, and the dependency relationship between the component objects;

[0251] An application instance corresponding to the target application and a component instance corresponding to each of the components are generated according to the static topology diagram.

[0252] In some embodiments, the generating module 5552 is further configured to create an empty object corresponding to the target application;

[0253] Recording the fields in the description file of the target application into an empty object corresponding to the target application to generate an application object corresponding to the target application;

[0254] Create an empty object corresponding to each of the components;

[0255] The fields in the description file of each component are recorded into the empty object of the corresponding component respectively, so as to generate an application object corresponding to the target application.

[0256] In some embodiments, the generating module 5552 is further configured to use the application objects and component objects as nodes of the static topology graph;

[0257] Acquire, according to the description file of the target application, a first component that the target application directly depends on;

[0258] Constructing an edge from the application object to the component object corresponding to the first component;

[0259] When determining, based on the description file of each component, that there is a second component on which the component directly depends, obtaining the second component on which the component directly depends;

[0260] Construct an edge from the component object corresponding to the component to the component object corresponding to the second component to obtain a static topology graph corresponding to the target application.

[0261] In some embodiments, the generating module 5552 is further configured to traverse the static topology graph from top to bottom using a depth traversal method, and

[0262] During the traversal process, corresponding instances are generated according to the traversed objects to obtain the application instance corresponding to the target application and the component instance corresponding to each of the components.

[0263] In some embodiments, the generating module is further configured to create an instance corresponding to the root node when the traversed object is a root node;

[0264] Obtain the deployment parameters for the object itself carried by the object, and add the deployment parameters to the instance corresponding to the root node.

[0265] In some embodiments, the generating module 5552 is further configured to create an instance corresponding to the non-root node when the traversed object is a non-root node;

[0266] Obtaining the deployment parameters for the object itself carried by the object and the deployment parameters for the object passed by the upper-layer object;

[0267] The acquired deployment parameters are added to the instance corresponding to the non-root node.

[0268] In some embodiments, the generating module 5552 is further configured to, when the traversed object is not a root node, obtain the deployment parameters for the lower-layer objects of the object passed by the upper-layer object, and pass them to the lower-layer objects of the object;

[0269] Obtaining the deployment parameters for the lower-layer objects carried by the object and passing them to the lower-layer objects of the object;

[0270] The deployment parameters passed to the lower-layer object are used to be added to the instance corresponding to the lower-layer object when the instance corresponding to the lower-layer object is generated.

[0271] In some embodiments, the generating module 5552 is further configured to, when the object carries an instance sharing group field, determine that the instance sharing group field corresponds to a shared instance in an instance sharing group;

[0272] generating an instance identifier corresponding to the shared instance;

[0273] Among them, the shared instance is an instance that the instance corresponding to the object and other instances depend on, and the instance identifier is used to no longer generate an instance of the object corresponding to the shared instance during the process of traversing the dynamic topology map and generating corresponding instances.

[0274] In some embodiments, the deployment module 5554 is further used to deploy instances corresponding to each node layer by layer from bottom to top, starting from the leaf nodes of the dynamic topology graph, where the instances are application instances or component instances.

[0275] In some embodiments, the deployment module 5554 is further configured to add instances corresponding to leaf nodes of the dynamic topology graph to a deployable sequence;

[0276] Loop through the following operations until the deployable sequence is empty:

[0277] Taking out a target number of instances from the deployable sequence for deployment;

[0278] When the target number of instances are deployed, adding identification information to the upper-layer instance of the instance, where the identification information is used to indicate that the instance has been deployed;

[0279] When it is determined according to the identification information that the instance on which the upper-layer instance depends has been deployed, the upper-layer instance is added to the deployable sequence.

[0280] In some embodiments, the deployment module 5554 is further configured to take a target number of instances from the deployable sequence and add them to the deployment sequence;

[0281] Concurrently deploy instances in the deployment sequence.

[0282] The present invention provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the application deployment method described above in the present invention.

[0283] The embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the method provided by the embodiment of the present application, for example, Figure 3 The method shown.

[0284] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or various devices including one or any combination of the above memories.

[0285] In some embodiments, executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0286] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0287] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0288] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.

Claims

1. A method for deploying an application, characterized in that: The method comprises: In response to a deployment instruction for a target application, obtaining a description file of the target application and a description file of at least one component on which the target application depends; Based on the description file of the target application, generate an application object corresponding to the target application, and based on the description file of the component, generate a component object corresponding to each of the components; Using the application object and the component object as nodes, construct a static topology graph corresponding to the target application; Generating, according to the static topology diagram, an application instance corresponding to the target application and a component instance corresponding to each of the components; Using the application instance and the component instance as nodes, construct a dynamic topology graph corresponding to the target application; Based on the dynamic topology diagram, deploy the application instance and each component instance respectively; During the deployment process, when the application instance calls the component instance on which the application instance depends, the parameters used in the call are passed to the corresponding component instance, and when the component instance calls the component instance of other components on which the component instance depends, the parameters used in the call are passed to the corresponding component instance of the other components to complete the deployment of the target application.

2. The method according to claim 1, wherein The generating, based on the description file of the target application, an application object corresponding to the target application, includes: Create an empty object corresponding to the target application; Recording the fields in the description file of the target application into an empty object corresponding to the target application to generate an application object corresponding to the target application; Generate component objects corresponding to each component based on the component description file: Create an empty object corresponding to each of the components; The fields in the description file of each component are recorded into the empty object of the corresponding component respectively, so as to generate an application object corresponding to the target application.

3. The method according to claim 1, wherein The step of constructing a static topology graph corresponding to the target application using the application object and the component object as nodes includes: Using the application objects and component objects as nodes of the static topology graph; Acquire, according to the description file of the target application, a first component that the target application directly depends on; Constructing an edge from the application object to the component object corresponding to the first component; When determining, based on the description file of each component, that there is a second component on which the component directly depends, obtaining the second component on which the component directly depends; Construct an edge from the component object corresponding to the component to the component object corresponding to the second component to obtain a static topology graph corresponding to the target application.

4. The method according to claim 1, wherein Generating, according to the static topology diagram, an application instance corresponding to the target application and a component instance corresponding to each of the components, includes: Use the depth traversal method to traverse the static topology graph from top to bottom, and During the traversal process, corresponding instances are generated according to the traversed objects to obtain the application instance corresponding to the target application and the component instance corresponding to each of the components.

5. The method according to claim 4, wherein The generating of corresponding instances according to the traversed objects includes: When the traversed object is a root node, create an instance corresponding to the root node; Obtain the deployment parameters for the object itself carried by the object, and add the deployment parameters to the instance corresponding to the root node.

6. The method according to claim 4, wherein The generating of corresponding instances according to the traversed objects includes: When the traversed object is a non-root node, create an instance corresponding to the non-root node; Obtaining the deployment parameters for the object itself carried by the object and the deployment parameters for the object passed by the upper-layer object; The acquired deployment parameters are added to the instance corresponding to the non-root node.

7. The method according to claim 4, wherein After generating a corresponding instance according to the traversed object, the method further includes: When the traversed object is not a root node, the deployment parameters for the lower-layer objects of the object passed by the upper-layer object are obtained and passed to the lower-layer objects of the object; Obtaining the deployment parameters for the lower-layer objects carried by the object and passing them to the lower-layer objects of the object; The deployment parameters passed to the lower-layer object are used to be added to the instance corresponding to the lower-layer object when the instance corresponding to the lower-layer object is generated.

8. The method according to claim 7, wherein After generating a corresponding instance according to the traversed object, the method further includes: When the object carries an instance sharing group field, determining that the instance sharing group field corresponds to a shared instance in the instance sharing group; generating an instance identifier corresponding to the shared instance; Among them, the shared instance is an instance that the instance corresponding to the object and other instances depend on, and the instance identifier is used to no longer generate an instance of the object corresponding to the shared instance during the process of traversing the dynamic topology map and generating corresponding instances.

9. The method according to claim 1, wherein The deploying the application instance and each component instance based on the dynamic topology graph includes: Starting from the leaf nodes of the dynamic topology graph, instances corresponding to each node are deployed layer by layer from bottom to top. The instances are application instances or component instances.

10. The method according to claim 9, wherein The example of deploying each node layer by layer from bottom to top includes: Adding instances corresponding to leaf nodes of the dynamic topology graph to a deployable sequence; Loop through the following operations until the deployable sequence is empty: Taking out a target number of instances from the deployable sequence for deployment; When the target number of instances are deployed, adding identification information to the upper-layer instance of the instance, where the identification information is used to indicate that the instance has been deployed; When it is determined according to the identification information that the instance on which the upper-layer instance depends has been deployed, the upper-layer instance is added to the deployable sequence.

11. The method according to claim 10, wherein The extracting a target number of instances from the deployable sequence for deployment includes: Taking out a target number of instances from the deployable sequence and adding them to the deployment sequence; When all instances in the deployment sequence are component instances, the component instances in the deployment sequence are deployed concurrently.

12. An application deployment device, characterized in that: include: an acquisition module, configured to acquire, in response to a deployment instruction for a target application, a description file of the target application and a description file of at least one component on which the target application depends; A generating module, configured to generate an application object corresponding to the target application based on the description file of the target application, and to generate a component object corresponding to each of the components based on the description file of the components; Using the application object and the component object as nodes, construct a static topology graph corresponding to the target application; Generating, according to the static topology diagram, an application instance corresponding to the target application and a component instance corresponding to each of the components; A construction module, configured to construct a dynamic topology graph corresponding to the target application using the application instance and the component instance as nodes; A deployment module, configured to deploy the application instance and each component instance respectively based on the dynamic topology map; During the deployment process, when the application instance calls the component instance on which the application instance depends, the parameters used in the call are passed to the corresponding component instance, and when the component instance calls the component instance of other components on which the component instance depends, the parameters used in the call are passed to the corresponding component instance of the other components to complete the deployment of the target application.

13. The device according to claim 12, characterized in that The device further comprises: The generation module is also used to, when the traversed object is not a root node, obtain the deployment parameters for the lower-level objects of the object passed by the upper-level object and pass them to the lower-level objects of the object; obtain the deployment parameters for the lower-level objects carried by the object and pass them to the lower-level objects of the object; wherein the deployment parameters passed to the lower-level object are used to add to the instance corresponding to the lower-level object when generating the instance corresponding to the lower-level object.

14. The device according to claim 12, characterized in that The device further comprises: The generation module is also used to determine the shared instance in the instance sharing group corresponding to the instance sharing group field when the object carries the instance sharing group field; generate an instance identifier corresponding to the shared instance; wherein the shared instance is an instance on which the instance corresponding to the object and other instances depend, and the instance identifier is used to no longer generate an instance of the object corresponding to the shared instance during the process of traversing the dynamic topology map and generating the corresponding instance.

15. A computer device, characterized in that: include: a memory for storing executable instructions; A processor, configured to implement the application deployment method according to any one of claims 1 to 11 when executing the executable instructions stored in the memory.

16. A computer-readable storage medium, characterized in that Executable instructions are stored, and when executed by a processor, the method for deploying the application described in any one of claims 1 to 11 is implemented.

17. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the application deployment method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Application deployment method, device, server and storage medium

    CN110413288A

  • Application arrangement and deployment method and device based on kubernetes

    CN110768833A