Deployment system and method of application program service
By introducing the wizard server and program deployment end in the automated operation and maintenance framework, using the deployment flowchart and service installation dependency adjacency table decoupling service deployment logic, combined with the deployment detection and compensation mechanism of the breadth-first algorithm, the problem of real-time monitoring and automatic completion of deployment status in the edge cloud computing environment is solved, and the maintenance of operation and maintenance deployment operations is improved.
Patent Information
- Application Number
- CN202411731178.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-05-02
AI Technical Summary
In an edge cloud computing environment, it is difficult for the automation operation and maintenance framework to perceive the deployment status of each service of the target deployment host in real time, and lacks an automated completion mechanism when node deployment fails, resulting in low maintainability of operation and maintenance deployment operations.
Through the wizard server, obtain the user's deployment node configuration instructions, build a deployment flowchart and generate a service installation dependency adjacency table, decouple the service deployment logic and scripts, and realize dynamic configuration. The program deployment side traverses the dependency adjacency table based on the breadth priority algorithm for deployment detection, and generates a target deployment queue based on the detection results to complete the installation of unsuccessful deployment services.
Real-time monitoring and automatic compensation of the application service deployment process are realized, improving the maintainability of operation and maintenance deployment operations and reducing maintenance costs.
Smart Images

Figure CN119917115A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of program service deployment, and in particular to a system and method for deploying application program services. Background Art
[0002] Automated operation and maintenance technology is an important part of modern software application development and operation and maintenance. Its purpose is to simplify, accelerate and standardize the software deployment process.
[0003] Currently, when adopting the automated operation and maintenance framework, with the increase of edge cloud computing functions, the service information maintained by the script is gradually increasing, and the related service relationships are becoming more and more complex. When one of the service roles or nodes is modified, the related service roles or nodes will also change accordingly. At the same time, it is impossible to perceive the status of each service deployment of the target deployment host in real time. Summary of the invention
[0004] In view of this, the present invention provides a deployment system and method for application service to solve the problem of how to ensure the decoupling of program service node change process and fixed script of automated operation and maintenance framework, thereby improving the maintainability of operation and maintenance deployment operations in application service.
[0005] In a first aspect, the present invention provides a deployment system for an application service, the system comprising: a wizard service end, a program deployment end, and a target deployment host;
[0006] The wizard server is used to obtain the user's deployment node configuration instruction, wherein the deployment node configuration instruction represents the deployment order adjustment instruction of the operation and maintenance user when deploying the application program, and the deployment node configuration instruction includes the input parameter information of the target deployment host and the deployment order of the deployment nodes; construct a deployment flowchart based on the deployment order of the deployment nodes; generate a service installation dependency adjacency table according to the deployment flowchart and the input parameter information of the target deployment host, and send it to the program deployment end;
[0007] The program deployment end is used to receive the service installation dependency adjacency list sent by the wizard server, and traverse the service installation dependency adjacency list based on the breadth-first algorithm to determine whether each target deployment node in the target deployment host is successfully deployed with the corresponding service and generate a deployment detection result, and send it to the wizard server;
[0008] The wizard server is further configured to receive a deployment detection result generated by the program deployment end based on the service installation dependency adjacency table, generate a target deployment queue according to the deployment detection result, and send the target deployment queue to the program deployment end;
[0009] The program deployment end is also used to receive the target deployment queue generated by the wizard server based on the deployment detection result, and traverse the target deployment queue based on the breadth-first algorithm to obtain the unsuccessfully deployed services, install the unsuccessfully deployed services to the target deployment host, and complete the application service deployment of the target deployment host.
[0010] In the embodiment of the present invention, the wizard server obtains the deployment order adjustment information of the deployment node through the user's deployment node configuration instruction, builds a deployment flowchart according to the sequence of the deployment nodes, and generates a service installation dependency adjacency table, that is, the wizard service expresses the dependency relationship between service roles through the deployment flowchart and the dependency adjacency table, thereby realizing the decoupling of service deployment. When a service role changes, only the corresponding dependency needs to be updated without directly modifying the script, thereby reducing the maintenance cost; the program deployment end traverses the service installation dependency adjacency table based on the breadth-first algorithm, generates deployment detection results and feeds back to the wizard server, providing real-time deployment feedback, and timely understanding which service nodes are deployed successfully and which fail. The wizard server generates a target deployment queue based on the deployment detection results and sends it to the program deployment end, and the program deployment end finally completes the installation of the unsuccessfully deployed service. The embodiments of the present invention avoid the situation in the prior art where "the deployment status of each service in the target deployment host cannot be perceived in real time, and when the deployment of some nodes fails, there is a lack of an automated completion mechanism". An adjacency list and a target deployment queue are generated by a wizard service, and the program deployment end performs detection and deployment separately. The interaction between the two ensures the decoupling of the program service node change process from the fixed scripts of the automated operation and maintenance framework, thereby improving the maintainability of the operation and maintenance deployment operations in the application service.
[0011] In a second aspect, the present invention provides a method for deploying an application service, which is applied to a wizard server, and the method comprises:
[0012] Obtaining a user's deployment node configuration instruction, wherein the deployment node configuration instruction represents an instruction for adjusting the deployment order of the deployment nodes when the operation and maintenance user deploys the application program, and the deployment node configuration instruction includes input parameter information of the target deployment host and the deployment order of the deployment nodes;
[0013] Constructing a deployment flow chart based on the deployment order of the deployment nodes;
[0014] Generate a service installation dependency adjacency table according to the deployment flowchart and input parameter information of the target deployment host, and send it to the program deployment end;
[0015] The deployment detection result generated by the program deployment end based on the service installation dependency adjacency table is received, and a target deployment queue is generated according to the deployment detection result, and sent to the program deployment end.
[0016] The embodiment of the present invention obtains the user's deployment node configuration instructions through the wizard server, builds a flowchart based on the deployment sequence and generates a dependency adjacency table, further solving the problem that it is difficult to flexibly adjust the deployment sequence in the traditional fixed script method, avoiding the tedious work of a large number of script modifications required by operation and maintenance personnel when modifying service nodes. By decoupling the deployment logic from the script, dynamic configuration of service deployment is achieved. At the same time, by receiving the detection results of the program deployment end and generating a deployment queue, the problem of difficulty in real-time monitoring of the deployment status is further solved, avoiding the situation where deployment failures cannot be discovered and processed in time, thereby improving the maintainability of the entire deployment process.
[0017] In an optional implementation, the input parameters of the target deployment host include a target deployment host address, target protocol information, and a target port number; before generating a service installation dependency adjacency table according to the deployment flowchart and the input parameter information of the target deployment host, the method further includes:
[0018] Performing a connectivity check on the target deployment host based on the target deployment host address and the target port number to determine whether the target deployment host is connected;
[0019] Performing an operation and maintenance user authority check on the target deployment host based on the target protocol information to determine whether the operation and maintenance user has deployment authority on the target deployment host;
[0020] If the target deployment host is connected and the operation and maintenance user has the deployment permission for the target deployment host, then the service medium corresponding to each service in the application is pulled from the object storage;
[0021] Distribute the service media corresponding to each service to each target deployment host.
[0022] The embodiment of the present invention further solves the problem of deployment failure caused by insufficient preparation before deployment by performing connectivity detection and permission detection on the target deployment host and pulling and distributing service media in advance, avoiding deployment interruptions caused by basic problems such as network disconnection and insufficient permissions. Through pre-checking and preparation, it is ensured that the deployment environment meets basic requirements, thereby improving the success rate of deployment. Pre-distributing service media also avoids delays caused by temporary downloads during the deployment process, improves deployment efficiency, and further improves the maintainability of the entire deployment process.
[0023] In an optional implementation, the input parameters of the target deployment host also include configuration information of each sub-node in the deployment node of the target deployment host; generating a service installation dependency adjacency table according to the deployment flowchart and the input parameter information of the target deployment host specifically includes:
[0024] Determine the dependency relationship between sub-nodes according to each sub-node configuration information in the target deployment host deployment node;
[0025] Dividing the levels of deployment nodes according to the deployment flowchart;
[0026] At each level, generate the adjacency order of all sub-nodes corresponding to the current level according to the dependencies between sub-nodes;
[0027] The adjacency order of sub-nodes at all levels is re-aggregated according to the deployment order of the deployment nodes to generate a service installation dependency adjacency table.
[0028] The embodiment of the present invention determines the dependency relationship by analyzing the sub-node configuration information and generates the adjacency order by level, thereby further solving the problem of changing the service nodes with complex dependencies. By dividing the nodes by level and determining the dependency order within the level, it not only ensures the correctness of dependencies at different levels, but also ensures flexible adjustments within the same level when the operation and maintenance personnel modify the service nodes, thereby making the management of all service dependencies more directly controllable and effectively improving the maintainability of the deployment process.
[0029] In a third aspect, the present invention provides a method for deploying an application service, which is applied to a program deployment end, and the method includes:
[0030] Receive the service installation dependency adjacency list sent by the wizard server, and traverse the service installation dependency adjacency list based on the breadth-first algorithm to determine whether each target deployment node in the target deployment host is successfully deployed with the corresponding service, and generate a deployment detection result and send it to the wizard server;
[0031] The target deployment queue generated by the receiving wizard server based on the deployment detection result is traversed through the target deployment queue based on the breadth-first algorithm to obtain unsuccessfully deployed services, and the unsuccessfully deployed services are installed to the target deployment host to complete the application service deployment of the target deployment host.
[0032] In the embodiment of the present invention, the program deployment end performs deployment detection by traversing the dependency adjacency list based on the breadth-first algorithm, thereby avoiding the situation where the deployment of some nodes fails and cannot be discovered in time. By receiving the deployment queue of the wizard server and executing the installation of unsuccessful services, automatic compensation installation for deployment failures is achieved, thereby improving the maintainability of the deployment.
[0033] In an optional implementation, the service installation dependency adjacency table includes a plurality of levels of sub-node adjacency order; the service installation dependency adjacency table is traversed based on a breadth-first algorithm to determine whether each target deployment node in the target deployment host is successfully deployed with the corresponding service, and to generate a deployment detection result, specifically including:
[0034] Based on the breadth-first algorithm, the adjacency order of the sub-nodes of each level is traversed, and the target deployment nodes of the corresponding level in the target deployment host are detected. When it is detected that any sub-node of the target deployment node has not successfully deployed the service, a mark is set for the sub-node that has not successfully deployed the service. The traversal is stopped until all the sub-nodes of all levels have been detected;
[0035] Generate deployment detection results based on all marked sub-nodes and the hierarchy of the sub-nodes corresponding to the target deployment nodes.
[0036] The embodiment of the present invention uses a breadth-first algorithm to hierarchically detect and mark unsuccessfully deployed nodes, thereby avoiding repeated deployment caused by inaccurate detection results. By setting marks for unsuccessful nodes and recording their hierarchical information, it is possible to accurately determine the deployment status of each node and provide accurate data support for subsequent compensatory deployment.
[0037] In an optional implementation, traversing the target deployment queue based on a breadth-first algorithm to obtain unsuccessfully deployed services, and installing the unsuccessfully deployed services to the target deployment host specifically includes:
[0038] According to the dependency relationship of the current node, determine whether the predecessor node of the current node has successfully deployed the service; if the predecessor node has successfully deployed the service, control the target deployment host to execute the service installation script of the current node; if the predecessor node has not successfully deployed the service, re-add the current node to the end of the target deployment queue, control the target deployment host to execute the service installation script of the predecessor node, and stop traversal until all the unsuccessfully deployed service nodes in the target deployment host have executed the service installation script.
[0039] The embodiment of the present invention determines the deployment strategy of the current node by checking the status of the predecessor node, further solving the problem of disordered deployment order of dependent nodes and avoiding chain failures caused by non-deployment of the predecessor service. By re-adding the nodes that do not meet the dependency conditions to the end of the queue and giving priority to their predecessor nodes, dynamic retry of the dependency relationship is achieved. At the same time, the integrity of the deployed nodes is ensured by looping until all nodes are deployed. By performing reasonable retries when deployment fails, the stability of service deployment is improved.
[0040] In a fourth aspect, the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for deploying an application service of the second aspect and the third aspect or any corresponding embodiment thereof by executing the computer instructions.
[0041] In a fifth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for deploying an application service of the second aspect and the third aspect or any corresponding embodiment thereof.
[0042] In a sixth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for deploying an application service of the second aspect and the third aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 is a schematic diagram of process interaction of a deployment system of an application service according to an embodiment of the present invention;
[0045] Figure 2 is a schematic diagram of a deployment node pipeline of a deployment system for an application service according to an embodiment of the present invention;
[0046] Figure 3 is a service installation dependency adjacency representation scheme of a deployment system for an application service according to an embodiment of the present invention;
[0047] Figure 4 is a schematic diagram of a deployment node pipeline of a deployment method for an application service according to an embodiment of the present invention;
[0048] Figure 5 is a flow chart of another method for deploying an application service according to an embodiment of the present invention;
[0049] Figure 6 is a flow chart of another method for deploying an application service according to an embodiment of the present invention;
[0050] Figure 7 It is an architectural diagram of the deployment of existing related technology application services;
[0051] Figure 8 is a deployment architecture diagram of a deployment system for an application service according to an embodiment of the present invention;
[0052] Fig. 9 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0054] With the rapid development of 5G and cloud computing technologies, service component products have shown explosive growth. Automated operation and maintenance technology is an important part of modern software development and operation and maintenance. Taking Ansible automated deployment tool as an example, it can configure, manage and execute deployment tasks to reduce manual intervention, reduce errors, and improve efficiency. It is widely used in service unit deployment scenarios. When deploying applications in Ansible, each application may depend on multiple services. Each associated service requires manual creation of a Roles role to maintain and bind the association relationship of the application.
[0055] For example, deploying an application A in Ansible consists of multiple services (database service, backend API service, cache service, etc.). Each service requires a corresponding Ansible Role (a service role name defined by Ansible) to complete its installation, configuration, and startup tasks. Ansible Playbook is a deployment script, which is represented by a yml file. The deployment script defines in detail the content and arrangement order of each Ansible Role. Ansible performs automated deployment based on the Ansible Playbook.
[0056] Among them, if the edge cloud computing functions are increased, new services may need to be added (new log services, etc.). Each new service requires the creation of a new Role. When modifying a Role, all other Roles that depend on the Role need to be manually checked and updated. However, Ansible itself does not have a global view and automated service association management. Each step requires manual query and modification, which increases the risk of errors and the complexity of operation and maintenance.
[0057] A deployment system for application services provided by the present invention can be applied to online deployment of program software or application operation and maintenance update scenarios. For example, by improving the general Ansible deployment solution, a new solution architecture for automated operation and maintenance online deployment is expanded. Under the new architecture, the pre-customized dependencies of Roles are decoupled. According to business requests, users create deployment processes under the guidance of a wizard service, and a dependency adjacency table is automatically generated in the background. The deployment is installed and deployed in sequence through BFS hierarchical search, thereby improving the maintainability of operation and maintenance deployment operations in application services.
[0058] According to an embodiment of the present invention, a deployment system for application service is provided, which can be referred to as Figure 1 ,The system includes: a wizard server 1, a program deployment terminal 2 and a target deployment host 3;
[0059] Among them, the wizard server 1 is used to obtain the user's deployment node configuration instructions, wherein the deployment node configuration instructions represent the deployment order adjustment instructions of the operation and maintenance user when deploying the application program, and the deployment node configuration instructions include the input parameter information of the target deployment host and the deployment order of the deployment nodes; build a deployment flowchart based on the deployment order of the deployment nodes; generate a service installation dependency adjacency table according to the deployment flowchart and the input parameter information of the target deployment host, and send it to the program deployment end;
[0060] Program deployment terminal 2 is used to receive the service installation dependency adjacency list sent by the wizard server, and traverse the service installation dependency adjacency list based on the breadth-first algorithm to determine whether each target deployment node in the target deployment host is successfully deployed with the corresponding service and generate a deployment detection result, and send it to the wizard server;
[0061] The wizard server 1 is also used to receive the deployment detection result generated by the program deployment end based on the service installation dependency adjacency table, generate a target deployment queue according to the deployment detection result, and send it to the program deployment end;
[0062] The program deployment end 2 is also used to receive the target deployment queue generated by the wizard server based on the deployment detection results, and traverse the target deployment queue based on the breadth-first algorithm to obtain the unsuccessfully deployed services, and install the unsuccessfully deployed services to the target deployment host 3 to complete the application service deployment of the target deployment host 3.
[0063] The embodiment of the present invention mainly includes a wizard server and a program deployment end. In the actual application process, the wizard server is represented in the form of a wizard service platform. The interactive page of the wizard service platform is used to guide users to configure deployment nodes (that is, each deployment process on the deployment pipeline), generate deployment flow charts and service installation dependency adjacency lists, receive deployment detection results and generate server components of target deployment queues. The program deployment end is independent of the other end of the wizard server, and is used to receive adjacency table target deployment queues, execute deployment tasks, generate deployment detection results, and complete the installation of unsuccessful deployment services.
[0064] It should be noted that the deployment node configuration instructions refer to the instructions entered by the user (for example, the deployment and installation pipeline based on the drag-and-drop module on the wizard server can be referred to Figure 2 , Figure 2 The pipeline built based on user drag and drop operations is as follows: Start->Host Configuration->Host Customization->Media Installation 1->Media Installation 2->End. In addition, the progress of each deployment node process on the pipeline can be displayed in the interactive page of the wizard service platform, such as execution success, execution failure, waiting for execution, executing, request execution failure). The deployment node configuration instruction can express the order of deployment nodes that the user wants to arrange and the input parameter information of the target deployment host.
[0065] The deployment flowchart is a graphical representation that can intuitively show the dependencies between services. Figure 2 assembly line.
[0066] Service installation dependency refers to the relationship between a service and other services. For example, the user login service needs to rely on the MySQL database service and the Redis cache service. Therefore, the node of the user login service should be deployed after the MySQL database service and the Redis cache service nodes are deployed. It can be understood that the service installation dependency adjacency table refers to a table showing the dependency relationship between services in the form of adjacency. For example, based on Figure 2 The adjacency table formed by the deployment pipeline can be referred to Figure 3 , Figure 3 The Role in the diagram represents each sub-node role, that is, service, that needs to be deployed under the deployment node, and the arrows between each Role represent the installation dependency relationship between the current service and the next service.
[0067] Breadth-first search (BFS) refers to a graph traversal algorithm that starts from the starting node of the graph and traverses all nodes layer by layer, ensuring that the nodes of each layer are completely traversed before entering the next layer. In an embodiment of the present invention, it is used to traverse the service installation dependency adjacency list to ensure that the services are checked and deployed in the order of dependencies, and to traverse the nodes of the tree and graph layer by layer in a breadth-first manner. The embodiment of the present invention adopts a breadth-first algorithm traversal method to ensure that starting from the starting node, its directly adjacent nodes can be processed first, and then the adjacent nodes of the adjacent nodes, and so on. Its characteristics are more suitable for the analysis and deployment of software dependencies, making the deployment efficiency of service nodes higher.
[0068] The target deployment host refers to the physical or virtual server that actually performs the service installation and configuration tasks, such as a server used to install and run a database, backend API, and cache service.
[0069] The deployment detection result refers to the result generated by the program deployment end after traversing the service installation dependency adjacency table, indicating whether each service is successfully deployed.
[0070] The target deployment queue refers to the list of services to be deployed generated based on the deployment detection results, which guides the program deployment end to perform subsequent deployment operations.
[0071] For example, based on the deployment tool Ansible, in the embodiment of the present invention, the user first logs in to the wizard service platform and enters the pipeline construction module. In this module, the user can drag and drop the Roles tags corresponding to each component to build a pipeline. Figure 2 The deployment pipelines at each level are shown. In the process of building the pipeline, users need to enter relevant configuration parameters for each level, such as the IP, port, SSH password, JDK version, application package version information, load balancing configuration parameters, etc. of the target deployment host. The wizard service automatically generates the corresponding dependency adjacency table and the Ansible execution entry YAML file of each level according to the pipeline built by the user. The program deployment end detects the installation status of each node of the target deployment host through the BFS algorithm. According to the detection results, users can selectively perform deployment operations. When the user triggers the deployment operation, the wizard service end will add the tasks of each level to the queue in turn according to the detection results, and the program deployment end will deploy step by step through the BFS method.
[0072] In addition, each level of deployment tasks will be monitored and executed by the Pipeline event service of the target deployment host, and the deployment log will be output. Moreover, after the deployment is completed, the wizard server will update the status information of each node in the adjacency table, and users can view the deployment progress and results in real time. Users do not need to manually write complex Ansible deployment scripts, but can quickly complete the automated deployment of applications through the visual process building function provided by the wizard service.
[0073] It is understandable that in Ansible, the deployment script (Role) and deployment sequence (Playbook) of each service are pre-defined in the yml file, and any changes require manual modification of these files. The embodiment of the present invention dynamically generates the service installation dependency adjacency table and the target deployment queue through the wizard server, avoiding direct modification of the yml file. The dependency relationship between services is managed through the adjacency table, rather than hard-coded in the script, thereby achieving the decoupling of the deployment script. Through the interface of the wizard server, the operation and maintenance personnel can view in real time which services have been successfully deployed and which need to be redeployed, and operate according to the prompts. That is to say, through the deployment flowchart and the service installation dependency adjacency table, the operation and maintenance personnel can intuitively understand the dependency relationship and deployment sequence between services.
[0074] In the embodiment of the present invention, the wizard server obtains the deployment order adjustment information of the deployment node through the user's deployment node configuration instruction, builds a deployment flowchart according to the sequence of the deployment nodes, and generates a service installation dependency adjacency table, that is, the wizard service expresses the dependency relationship between service roles through the deployment flowchart and the dependency adjacency table, thereby realizing the decoupling of service deployment. When a service role changes, only the corresponding dependency needs to be updated without directly modifying the script, thereby reducing the maintenance cost; the program deployment end traverses the service installation dependency adjacency table based on the breadth-first algorithm, generates deployment detection results and feeds back to the wizard server, providing real-time deployment feedback, and timely understanding which service nodes are deployed successfully and which fail. The wizard server generates a target deployment queue based on the deployment detection results and sends it to the program deployment end, and the program deployment end finally completes the installation of the unsuccessfully deployed service. The embodiments of the present invention avoid the situation in the prior art where "the deployment status of each service in the target deployment host cannot be perceived in real time, and when the deployment of some nodes fails, there is a lack of an automated completion mechanism". An adjacency list and a target deployment queue are generated by a wizard service, and the program deployment end performs detection and deployment separately. The interaction between the two ensures the decoupling of the program service node change process from the fixed scripts of the automated operation and maintenance framework, thereby improving the maintainability of the operation and maintenance deployment operations in the application service.
[0075] According to an embodiment of the present invention, an embodiment of a method for deploying an application service is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0076] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, scope of use, and usage scenarios of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner according to relevant laws and regulations. For example, in response to receiving an active request from the user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require the acquisition and use of the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message. As an optional but non-limiting implementation method, in response to receiving an active request from the user, the method of sending the prompt message to the user can be, for example, a pop-up window, and the prompt message can be presented in text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0077] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0078] In this embodiment, a method for deploying an application service is provided, which is applied to a wizard server. Figure 4 is a flow chart of a method for deploying an application service according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0079] Step S401, obtaining the user's deployment node configuration instruction, wherein the deployment node configuration instruction represents the deployment order adjustment instruction of the operation and maintenance user when deploying the application, and the deployment node configuration instruction includes the input parameter information of the target deployment host and the deployment order of the deployment nodes. For details, please refer to the description of the wizard server in the deployment system of an application service, which will not be repeated here.
[0080] Step S402: construct a deployment flow chart based on the deployment sequence of the deployment nodes. For details, please refer to the description of the wizard server in a deployment system for an application service, which will not be described in detail here.
[0081] Step S403: Generate a service installation dependency adjacency table according to the deployment flowchart and input parameter information of the target deployment host, and send it to the program deployment end.
[0082] In an optional implementation, the input parameters of the target deployment host further include configuration information of each sub-node in the deployment node of the target deployment host. Specifically, step S403 includes:
[0083] Step S4031, determining the dependency relationship between sub-nodes according to each sub-node configuration information in the target deployment host deployment node.
[0084] Specifically, by parsing the configuration parameters entered by the user on the wizard server, the configuration information of each sub-node is extracted, and the dependency relationship between the sub-nodes is determined based on the dependency tags (such as the dependent service name) in the configuration information using a graph algorithm or rule engine. Based on the dependency analysis in the graph, the dependency order between the sub-nodes is determined to provide data basis for the subsequent deployment process.
[0085] Step S4032, dividing the levels of deployment nodes according to the deployment flowchart.
[0086] Specifically, a graph hierarchical algorithm (i.e., hierarchical traversal) is used to divide the nodes in the deployment flowchart into different levels according to the dependency relationship. For example, an empty hierarchical structure is initialized to store the nodes of each level. Starting from the starting node, all nodes in the deployment flowchart are traversed, and the nodes are stored in the corresponding level according to the dependency relationship of the nodes. Among them, nodes without dependencies are placed in the first level, nodes that depend on the first level nodes are placed in the second level, and so on.
[0087] Step S4033: at each level, generate the adjacency order of all sub-nodes corresponding to the current level according to the dependency relationship between the sub-nodes.
[0088] It should be noted that the sub-node adjacency order refers to the order in which the sub-nodes are arranged according to the dependency relationship within the same level.
[0089] Specifically, all child nodes of the current level are extracted, and the dependency graph of the current level is constructed based on the dependency relationship between the child nodes. The dependency graph within the level is topologically sorted to generate the adjacency order of the child nodes. By determining the dependency order of each child node within the same level, it is ensured that each child node is deployed in the correct order during the deployment process.
[0090] For example, there are three child nodes X, Y, and Z in a certain level, where Y depends on X and Z depends on Y. By constructing a dependency graph and performing topological sorting, an adjacency order of X->Y->Z is generated.
[0091] Step S4034: re-aggregate the adjacency order of the sub-nodes of all levels according to the deployment order of the deployment nodes to generate a service installation dependency adjacency table.
[0092] Specifically, the data structure merging technology (such as list merging) is used to integrate the adjacency order of the sub-nodes at each level into a global adjacency table. The global adjacency table is converted into a file in a specific format (yml file) for use by the program deployment end.
[0093] The service installation dependency adjacency table content is converted into a data format of yml and stored in a yml file, as shown below:
[0094] hosts:a11
[0095] gather_facts:yes
[0096] become:true
[0097] vars_files:a11.yml
[0098] roles:
[0099] {role:Role10,tag:xxx}
[0100] {role:Rolell,tag:xxx}
[0101] {role:Role12,tag:xxx} .....
[0103] The service installation dependency adjacency table in the yml format above is a script automatically generated based on customized Roles and serves as the entry script executed by the Ansible deployment tool.
[0104] The embodiment of the present invention determines the dependency relationship by analyzing the sub-node configuration information and generates the adjacency order by level, thereby further solving the problem of changing the service nodes with complex dependencies. By dividing the nodes by level and determining the dependency order within the level, it not only ensures the correctness of dependencies at different levels, but also ensures flexible adjustments within the same level when the operation and maintenance personnel modify the service nodes, thereby making the management of all service dependencies more directly controllable and effectively improving the maintainability of the deployment process.
[0105] Step S404, receiving the deployment detection result generated by the program deployment end based on the service installation dependency adjacency table, generating a target deployment queue according to the deployment detection result, and sending it to the program deployment end. For details, please refer to the description of the wizard server in a deployment system for an application service, which will not be repeated here.
[0106] The embodiment of the present invention obtains the user's deployment node configuration instructions through the wizard server, builds a flowchart based on the deployment sequence and generates a dependency adjacency table, further solving the problem that it is difficult to flexibly adjust the deployment sequence in the traditional fixed script method, avoiding the tedious work of a large number of script modifications required by operation and maintenance personnel when modifying service nodes. By decoupling the deployment logic from the script, dynamic configuration of service deployment is achieved. At the same time, by receiving the detection results of the program deployment end and generating a deployment queue, the problem of difficulty in real-time monitoring of the deployment status is further solved, avoiding the situation where deployment failures cannot be discovered and processed in time, thereby improving the maintainability of the entire deployment process.
[0107] In this embodiment, a method for deploying an application service is provided, which is applied to a wizard server. Figure 5 is a flow chart of a method for deploying an application service according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:
[0108] Step S501, obtaining the user's deployment node configuration instruction, wherein the deployment node configuration instruction represents the deployment order adjustment instruction of the operation and maintenance user when deploying the application, and the deployment node configuration instruction includes the input parameter information of the target deployment host and the deployment order of the deployment nodes. For details, please refer to the description of the wizard server in the deployment system of an application service, which will not be repeated here.
[0109] Step S502: construct a deployment flow chart based on the deployment sequence of the deployment nodes. For details, please refer to the description of the wizard server in a deployment system for an application service, which will not be described in detail here.
[0110] Step S503: Perform connectivity detection on the target deployment host based on the target deployment host address and the target port number to determine whether the target deployment host is connected.
[0111] Specifically, a connectivity test is performed based on the target deployment host address (IP address) and target port number (SSH port) provided in the configuration. If any connection abnormality is found during the test, such as network timeout, port not open, or SSH service not started, a connection failure result is immediately returned.
[0112] Step S504: Perform an operation and maintenance user authority check on the target deployment host based on the target protocol information to determine whether the operation and maintenance user has deployment authority on the target deployment host.
[0113] Specifically, use the configured user credentials to establish an SSH connection, and then execute the sudo -l command to list the sudo permissions granted to the user, and check whether the user has the necessary permissions, including file system operation permissions (read and write permissions), service management permissions (start / stop services), package management permissions, etc.
[0114] Step S505: If the target deployment host is connected and the operation and maintenance user has the deployment authority for the target deployment host, the service medium corresponding to each service in the application is pulled from the object storage.
[0115] Specifically, service media refers to the type of software package media required for deploying nodes, including but not limited to KVM virtual machine image files, compressed packages, container images, etc. According to deployment requirements, these software package media files are pulled from object storage on demand. During the pulling process, file integrity checks are performed to ensure that the downloaded files are not damaged or tampered with. At the same time, a local cache mechanism is established to avoid repeated downloads of the same files.
[0116] Step S506: Distribute the service medium corresponding to each service to each target deployment host.
[0117] Specifically, after completing the pulling of the service media, these files are distributed to the corresponding target deployment hosts. Based on the specific configuration requirements of the target deployment hosts, including the network card information bound to the service monitor, disk size, CPU configuration and other parameters, the service media corresponding to each service is distributed to each target deployment host.
[0118] Step S507, generating a service installation dependency adjacency table according to the deployment flowchart and the input parameter information of the target deployment host, and sending it to the program deployment end; for details, please refer to the description of the wizard server in a deployment system for an application service, which will not be repeated here.
[0119] Step S508, receiving the deployment detection result generated by the program deployment end based on the service installation dependency adjacency table, generating a target deployment queue according to the deployment detection result, and sending it to the program deployment end. For details, please refer to the description of the wizard server in a deployment system for an application service, which will not be repeated here.
[0120] The embodiment of the present invention obtains the user's deployment node configuration instructions through the wizard server, builds a flowchart based on the deployment sequence and generates a dependency adjacency table, further solving the problem that it is difficult to flexibly adjust the deployment sequence in the traditional fixed script method, avoiding the tedious work of a large number of script modifications required by operation and maintenance personnel when modifying service nodes. By decoupling the deployment logic from the script, dynamic configuration of service deployment is achieved. At the same time, by receiving the detection results of the program deployment end and generating a deployment queue, the problem of difficulty in real-time monitoring of the deployment status is further solved, avoiding the situation where deployment failures cannot be discovered and processed in time, thereby improving the maintainability of the entire deployment process.
[0121] In this embodiment, a method for deploying an application service is provided, which is applied to a program deployment end. Figure 6 is a flow chart of a method for deploying an application service according to an embodiment of the present invention. Figure 6 As shown, the process includes the following steps:
[0122] Step S601, receiving the service installation dependency adjacency list sent by the wizard server, and traversing the service installation dependency adjacency list based on the breadth-first algorithm, determining whether each target deployment node in the target deployment host is successfully deployed with the corresponding service, and generating a deployment detection result, and sending it to the wizard server;
[0123] In an optional implementation, the service installation dependency adjacency table includes multiple levels of sub-node adjacency orders, and the above step S601 specifically includes:
[0124] Step S6011, based on the breadth-first algorithm, traverse the adjacency order of the sub-nodes of each level, and detect the target deployment nodes of the corresponding level in the target deployment host. When it is detected that any sub-node of the target deployment node has not successfully deployed the service, a mark is set for the sub-node that has not successfully deployed the service. The traversal is stopped until all the sub-nodes of all levels are detected.
[0125] Step S6012, generating a deployment detection result according to all marked sub-nodes and the hierarchy of the target deployment nodes corresponding to the sub-nodes.
[0126] Specifically, the BFS algorithm uses the level as a unit, first processing the nodes of the first level that have no dependencies, and then processing the nodes that depend on the previous level in turn. The child nodes in each level are detected one by one in the order of adjacency. If it is detected that the service of a node fails to be deployed successfully, the failure mark is set for the node. The deployment detection result includes a list of failed nodes, which is used to record all failed nodes and their levels.
[0127] The embodiment of the present invention uses a breadth-first algorithm to hierarchically detect and mark unsuccessfully deployed nodes, thereby avoiding repeated deployment caused by inaccurate detection results. By setting marks for unsuccessful nodes and recording their hierarchical information, it is possible to accurately determine the deployment status of each node and provide accurate data support for subsequent compensatory deployment.
[0128] Step S602, receiving the target deployment queue generated by the wizard server based on the deployment detection result, traversing the target deployment queue based on the breadth-first algorithm to obtain unsuccessfully deployed services, installing the unsuccessfully deployed services to the target deployment host, and completing the application service deployment of the target deployment host.
[0129] In an optional implementation, the above step S602 specifically includes:
[0130] Step S6021, determining whether the predecessor node of the current node has successfully deployed the service according to the dependency relationship of the current node;
[0131] Step S6022: If the service has been successfully deployed on the previous node, the target deployment host is controlled to execute the service installation script of the current node;
[0132] Step S6023, if the preceding node fails to deploy the service successfully, the current node is re-added to the end of the target deployment queue, and the target deployment host is controlled to execute the service installation script of the preceding node;
[0133] Step S6024, until all unsuccessfully deployed service nodes in the target deployment host have executed the service installation script, the traversal is stopped.
[0134] Specifically, the BFS algorithm will check the dependencies of the current node in the target deployment queue to determine whether its predecessor node has successfully deployed the service. If the deployment of the predecessor node is unsuccessful, the current node cannot be processed. When the predecessor node is detected to be successful, the service installation script of the current node is executed, which specifically includes: calling the deployment tool Ansible to run the installation script corresponding to the current node, and completing the installation of the service according to the input parameter information of the current node. If it is detected that the predecessor node of the current node is not successfully deployed, the current node will be re-added to the end of the target deployment queue, and the processing will be temporarily skipped. At the same time, the deployment of the predecessor node will be prioritized, and the installation script of the predecessor node will be re-executed until the predecessor node is successfully deployed.
[0135] The embodiment of the present invention determines the deployment strategy of the current node by checking the status of the predecessor node, further solving the problem of disordered deployment order of dependent nodes and avoiding chain failures caused by non-deployment of the predecessor service. By re-adding the nodes that do not meet the dependency conditions to the end of the queue and giving priority to their predecessor nodes, dynamic retry of the dependency relationship is achieved. At the same time, the integrity of the deployed nodes is ensured by looping until all nodes are deployed. By performing reasonable retries when deployment fails, the stability of service deployment is improved.
[0136] In the embodiment of the present invention, the program deployment end performs deployment detection by traversing the dependency adjacency list based on the breadth-first algorithm, thereby avoiding the situation where the deployment of some nodes fails and cannot be discovered in time. By receiving the deployment queue of the wizard server and executing the installation of unsuccessful services, automatic compensation installation for deployment failures is achieved, thereby improving the maintainability of the deployment.
[0137] In addition, it should be noted that before the application of the embodiment of the present invention, the deployment process of the automatic deployment tool can refer to Figure 7 , the local computer needs to reserve the dependencies of the software packages of various services (role1, role2, role3) and store them in yml, so as to deploy them to the target deployment host respectively. After the embodiment of the present invention is applied, the deployment process can refer to Figure 8 , the local computer is freely configured through the wizard service, the software package media installation association is built and generated through the wizard service, and the yml file that is pre-customized and maintained is decoupled. Each role is a module in a process. Through the wizard service, the configuration deployment pipeline standardizes the input and output of each stage, enhancing visibility and controllability.
[0138] The embodiment of the present invention also provides a computer device having the above Figure 1 Any one of the wizard server, program deployment terminal or target deployment host in the deployment system of the application service shown.
[0139] See also Fig. 9 , Fig. 9 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig. 9As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.
[0140] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0141] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0142] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0143] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0144] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0145] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0146] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0147] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the defined scope.
Claims
1. A deployment system for an application service, characterized in that: The system includes: a wizard server, a program deployment terminal and a target deployment host; The wizard server is used to obtain the user's deployment node configuration instruction, wherein the deployment node configuration instruction represents the deployment order adjustment instruction of the operation and maintenance user when deploying the application program, and the deployment node configuration instruction includes the input parameter information of the target deployment host and the deployment order of the deployment nodes; construct a deployment flowchart based on the deployment order of the deployment nodes; generate a service installation dependency adjacency table according to the deployment flowchart and the input parameter information of the target deployment host, and send it to the program deployment end; The program deployment end is used to receive the service installation dependency adjacency list sent by the wizard server, and traverse the service installation dependency adjacency list based on the breadth-first algorithm to determine whether each target deployment node in the target deployment host is successfully deployed with the corresponding service and generate a deployment detection result, and send it to the wizard server; The wizard server is further configured to receive a deployment detection result generated by the program deployment end based on the service installation dependency adjacency table, generate a target deployment queue according to the deployment detection result, and send the target deployment queue to the program deployment end; The program deployment end is also used to receive the target deployment queue generated by the wizard server based on the deployment detection result, and traverse the target deployment queue based on the breadth-first algorithm to obtain the unsuccessfully deployed services, install the unsuccessfully deployed services to the target deployment host, and complete the application service deployment of the target deployment host.
2. A method for deploying an application service, characterized in that: Applied to the guide server, the method includes: Obtaining a user's deployment node configuration instruction, wherein the deployment node configuration instruction represents an instruction for adjusting the deployment order of the deployment nodes when the operation and maintenance user deploys the application program, and the deployment node configuration instruction includes input parameter information of the target deployment host and the deployment order of the deployment nodes; Constructing a deployment flow chart based on the deployment order of the deployment nodes; Generate a service installation dependency adjacency table according to the deployment flowchart and input parameter information of the target deployment host, and send it to the program deployment end; The deployment detection result generated by the program deployment end based on the service installation dependency adjacency table is received, and a target deployment queue is generated according to the deployment detection result, and sent to the program deployment end.
3. The method according to claim 2, characterized in that The input parameters of the target deployment host include the target deployment host address, target protocol information and target port number; before generating the service installation dependency adjacency table according to the deployment flowchart and the input parameter information of the target deployment host, the method further includes: Performing a connectivity check on the target deployment host based on the target deployment host address and the target port number to determine whether the target deployment host is connected; Performing an operation and maintenance user authority check on the target deployment host based on the target protocol information to determine whether the operation and maintenance user has deployment authority on the target deployment host; If the target deployment host is connected and the operation and maintenance user has the deployment permission for the target deployment host, then the service medium corresponding to each service in the application is pulled from the object storage; Distribute the service media corresponding to each service to each target deployment host.
4. The method according to claim 3, characterized in that: The input parameters of the target deployment host also include configuration information of each sub-node in the deployment node of the target deployment host; generating a service installation dependency adjacency table according to the deployment flowchart and the input parameter information of the target deployment host specifically includes: Determine the dependency relationship between sub-nodes according to each sub-node configuration information in the target deployment host deployment node; Dividing the levels of deployment nodes according to the deployment flowchart; At each level, generate the adjacency order of all sub-nodes corresponding to the current level according to the dependencies between sub-nodes; The adjacency order of sub-nodes at all levels is re-aggregated according to the deployment order of the deployment nodes to generate a service installation dependency adjacency table.
5. A method for deploying an application service, characterized in that: Applied to the program deployment end, the method includes: Receive the service installation dependency adjacency list sent by the wizard server, and traverse the service installation dependency adjacency list based on the breadth-first algorithm to determine whether each target deployment node in the target deployment host is successfully deployed with the corresponding service, and generate a deployment detection result and send it to the wizard server; The target deployment queue generated by the receiving wizard server based on the deployment detection result is traversed through the target deployment queue based on the breadth-first algorithm to obtain unsuccessfully deployed services, and the unsuccessfully deployed services are installed to the target deployment host to complete the application service deployment of the target deployment host.
6. The method according to claim 5, characterized in that The service installation dependency adjacency table includes a plurality of levels of sub-node adjacency order; the service installation dependency adjacency table is traversed based on the breadth-first algorithm to determine whether each target deployment node in the target deployment host is successfully deployed with the corresponding service, and to generate a deployment detection result, specifically including: Based on the breadth-first algorithm, the adjacency order of the sub-nodes of each level is traversed, and the target deployment nodes of the corresponding level in the target deployment host are detected. When it is detected that any sub-node of the target deployment node has not successfully deployed the service, a mark is set for the sub-node that has not successfully deployed the service. The traversal is stopped until all the sub-nodes of all levels have been detected; Generate deployment detection results based on all marked sub-nodes and the hierarchy of the sub-nodes corresponding to the target deployment nodes.
7. The method according to claim 6, characterized in that The step of traversing the target deployment queue based on the breadth-first algorithm to obtain unsuccessfully deployed services and installing the unsuccessfully deployed services to the target deployment host specifically includes: According to the dependency relationship of the current node, determine whether the predecessor node of the current node has successfully deployed the service; if the predecessor node has successfully deployed the service, control the target deployment host to execute the service installation script of the current node; if the predecessor node has not successfully deployed the service, re-add the current node to the end of the target deployment queue, control the target deployment host to execute the service installation script of the predecessor node, and stop traversal until all the unsuccessfully deployed service nodes in the target deployment host have executed the service installation script.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for deploying the application service described in any one of claims 2-4 or 5-7 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for deploying an application service according to any one of claims 2-4 or 5-7.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method for deploying an application service according to any one of claims 2 to 4 or 5 to 7.