Product Visual Deployment Method, Device, System and Storage Medium
By generating product deployment instructions and parsing the deployment mode of target products and cluster nodes, obtaining configuration templates and node information, and determining the target component set, it solves the problems of low deployment efficiency and high error rate of microservice architecture products in different environments, and achieves rapid switching and efficient deployment.
Patent Information
- Application Number
- CN202210184967.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-02-28
AI Technical Summary
The existing technology cannot quickly deploy software products of multiple microservice architectures in different environments, resulting in low deployment efficiency and high error rates.
Provides a product visual deployment method, which generates product deployment instructions, parses the deployment mode of target products and cluster nodes, obtains product configuration templates and node configuration information, determines the target component set, and displays the deployment results on the control interface according to the deployment method.
It realizes rapid switching in different deployment modes, improves product deployment efficiency and reduces error rate.
Smart Images

Figure CN114610334B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of product deployment, and in particular, to a method, device, system and storage medium for visual product deployment. Background Art
[0002] Software products with a microservices architecture usually consist of many components and services, which are uniformly orchestrated and deployed through containers. The normal operation of these components and services involves various internal and external environments required. A software developer usually provides multiple products, which are targeted at different industries in a specific field.
[0003] Existing solutions implement product deployment through automated deployment tools, but the automated deployment tools are only limited to a single container technology and cannot support different types of containers simultaneously.
[0004] Currently, when deploying software products with a microservices architecture using Docker and Kubernetes containers, deployment personnel need to master various deployment scripts and configuration writing. The deployment process has the following problems: Multiple sets of products based on a unified platform need to write different deployment scripts and configurations in different environments, and cannot be quickly deployed according to different environments, resulting in low product deployment efficiency. Summary of the Invention
[0005] The present invention provides a method, device, system and storage medium for visual product deployment, which is used to improve the deployment efficiency of products and reduce the product deployment error rate at the same time.
[0006] The first aspect of the present invention provides a method for visual product deployment, including: generating a product deployment instruction in response to an operation on a control interface, where the product deployment instruction is used to deploy at least one target product to a target cluster node; parsing the product deployment instruction to obtain at least one target product and a target deployment mode corresponding to the target cluster node; obtaining at least one product configuration template and node configuration information of the target cluster node, where the at least one product configuration template corresponds to the at least one target product one by one, and the product configuration template is used to indicate the correspondence between the target product and the components; determining a corresponding target component set according to the at least one product configuration template; deploying the target component set to the target cluster node according to the target deployment method and the node configuration information of the target cluster node, and displaying the deployment result on the control interface.
[0007] Optionally, in the first implementation manner of the first aspect of the present invention, the parsing of the product deployment instruction to obtain at least one target product and the target deployment mode corresponding to the target cluster node includes: parsing the product deployment instruction to obtain product identification information and deployment mode information; determining at least one target product according to the product identification information; and determining that the target deployment mode corresponding to the target cluster node is a single-machine mode, a primary / standby mode, or a cluster mode according to the deployment mode information.
[0008] Optionally, in the second implementation manner of the first aspect of the present invention, the determining the corresponding target component set according to the at least one product configuration template includes: determining at least one component corresponding to each product configuration template in the at least one product configuration template; and merging the at least one component corresponding to each product configuration template into the corresponding target component set.
[0009] Optionally, in the third implementation manner of the first aspect of the present invention, the deploying the target component set to the target cluster node according to the target deployment method and the node configuration information of the target cluster node and displaying the deployment result on the control interface includes: determining the running configuration and deployment script corresponding to the target cluster node according to the target deployment method; creating an initial working directory of the target node according to the configuration information of the target cluster node; importing the mapping file and initialization script corresponding to the target component set into the initial working directory based on the running configuration and deployment script, and executing the initialization script to obtain a target working directory; deploying the component image or local component corresponding to the mapping file to the target cluster node according to the target working directory; and displaying the deployment result of each component in the target component set on the control interface.
[0010] Optionally, in the fourth implementation manner of the first aspect of the present invention, before responding to the operation on the control interface, the product visualization deployment method further includes: generating at least one product configuration template.
[0011] Optionally, in the fifth implementation manner of the first aspect of the present invention, the generating at least one product configuration template includes: obtaining the corresponding relationship between at least one target product and multiple components; obtaining the basic information of the multiple components, where the basic information includes component ID, component name, component image, and component version; and generating at least one product configuration template according to the corresponding relationship and the basic information of the multiple components.
[0012] Optionally, in the sixth implementation manner of the first aspect of the present invention, before responding to the operation on the control interface, the product visualization deployment method further includes: creating the target cluster node, where the target cluster node includes multiple nodes, and the nodes meet the running conditions of all components; setting the running configurations and deployment scripts corresponding to the target cluster node in each deployment mode.
[0013] Optionally, in the seventh implementation manner of the first aspect of the present invention, creating the target cluster node, where the target cluster node includes multiple nodes, and the nodes meet the running conditions of all components includes: obtaining the basic information of multiple preset nodes, where the basic information includes node names, IP addresses, SSH ports, and login user passwords; selecting multiple target nodes from the multiple preset nodes according to the basic information of the multiple preset nodes, and determining the multiple target nodes as the target cluster node.
[0014] Optionally, in the eighth implementation manner of the first aspect of the present invention, setting the running configurations and deployment scripts corresponding to the target cluster node in each deployment mode includes: when the target deployment mode of the target cluster node is the single-machine mode, setting the single-machine mode running policy according to a preset rule, and generating the running configuration and deployment script corresponding to the single-machine mode running policy; when the target deployment mode of the target cluster node is the primary-backup mode, setting the primary-backup mode running policy, and generating the running configuration and deployment script corresponding to the primary-backup mode running policy, where the primary-backup mode running policy includes the single-machine mode running policy, the synchronization policy, and the primary-backup switching policy; when the target deployment mode of the target cluster node is the cluster mode, setting the cluster mode running policy, and generating the running configuration and deployment script corresponding to the cluster mode running policy, where the cluster mode running policy includes the single-machine mode running policy, the server registration and discovery policy, and the server allocation policy.
[0015] The second aspect of the present invention provides a product visualization deployment device, including: a response module, configured to generate a product deployment instruction in response to an operation on a control interface, where the product deployment instruction is used to deploy at least one target product to a target cluster node; a parsing module, configured to parse the product deployment instruction to obtain at least one target product and a target deployment mode corresponding to the target cluster node; an acquisition module, configured to acquire at least one product configuration template and node configuration information of the target cluster node, where the at least one product configuration template corresponds to the at least one target product one by one, and the product configuration template is used to indicate the corresponding relationship between the target product and components; a determination module, configured to determine a corresponding target component set according to the at least one product configuration template; a deployment display module, configured to deploy the target component set to the target cluster node according to the target deployment method and the node configuration information of the target cluster node, and display a deployment result on the control interface.
[0016] Optionally, in the first implementation manner of the second aspect of the present invention, the parsing module is specifically configured to: parse the product deployment instruction to obtain product identification information and deployment mode information; determine at least one target product according to the product identification information; and determine that the target deployment mode corresponding to the target cluster node is a single-machine mode, a primary / standby mode, or a cluster mode according to the deployment mode information.
[0017] Optionally, in the second implementation manner of the second aspect of the present invention, the determination module is specifically configured to: determine at least one component corresponding to each product configuration template in the at least one product configuration template; and merge the at least one component corresponding to each product configuration template into the corresponding target component set.
[0018] Optionally, in the third implementation manner of the second aspect of the present invention, the deployment display module is specifically configured to: determine a running configuration and a deployment script corresponding to the target cluster node according to the target deployment method; create an initial working directory of the target node according to the configuration information of the target cluster node; import a mapping file and an initialization script corresponding to the target component set into the initial working directory based on the running configuration and the deployment script, and execute the initialization script to obtain a target working directory; deploy a component image or a local component corresponding to the mapping file to the target cluster node according to the target working directory; and display a deployment result of each component in the target component set on the control interface.
[0019] Optionally, in the fourth implementation manner of the second aspect of the present invention, the product visualization deployment device further includes: a configuration generation module, configured to generate at least one product configuration template.
[0020] Optionally, in the fifth implementation manner of the second aspect of the present invention, the configuration generation module is specifically configured to: obtain the correspondence between at least one target product and multiple components; obtain the basic information of the multiple components, where the basic information includes component ID, component name, component image, and component version; generate at least one product configuration template according to the correspondence and the basic information of the multiple components.
[0021] Optionally, in the sixth implementation manner of the second aspect of the present invention, the product visual deployment device further includes: a creation module, configured to create the target cluster nodes, where the target cluster nodes include multiple nodes, and the nodes meet the running conditions of all components; a setting module, configured to set the running configuration and deployment script corresponding to the target cluster nodes in each deployment mode.
[0022] Optionally, in the seventh implementation manner of the second aspect of the present invention, the creation module is specifically configured to: obtain the basic information of multiple preset nodes, where the basic information includes node name, IP address, SSH port, and login user password; select multiple target nodes from the multiple preset nodes according to the basic information of the multiple preset nodes, and determine the multiple target nodes as the target cluster nodes.
[0023] Optionally, in the eighth implementation manner of the second aspect of the present invention, the setting module is specifically configured to: when the target deployment mode of the target cluster nodes is the single-machine mode, set the single-machine mode operation policy according to a preset rule, and generate the running configuration and deployment script corresponding to the single-machine mode operation policy; when the target deployment mode of the target cluster nodes is the primary / standby mode, set the primary / standby mode operation policy, and generate the running configuration and deployment script corresponding to the primary / standby mode operation policy, where the primary / standby mode operation policy includes the single-machine mode operation policy, the synchronization policy, and the primary / standby switching policy; when the target deployment mode of the target cluster nodes is the cluster mode, set the cluster mode operation policy, and generate the running configuration and deployment script corresponding to the cluster mode operation policy, where the cluster mode operation policy includes the single-machine mode operation policy, the server registration and discovery policy, and the server allocation policy.
[0024] The third aspect of the present invention provides a product visual deployment system, including: multiple nodes and a controller, where the controller includes a memory and at least one processor, and instructions are stored in the memory; the at least one processor invokes the instructions in the memory to enable the product visual deployment system to execute the above product visual deployment method.
[0025] The fourth aspect of the present invention provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on a computer, the computer is enabled to execute the above product visual deployment method.
[0026] In the technical solution provided by the present invention, in response to an operation on a control interface, a product deployment instruction is generated, and the product deployment instruction is used to deploy at least one target product to a target cluster node; the product deployment instruction is parsed to obtain at least one target product and a target deployment mode corresponding to the target cluster node; at least one product configuration template and node configuration information of the target cluster node are obtained, and at least one product configuration template corresponds to at least one target product one by one, and the product configuration template is used to indicate the corresponding relationship between the target product and components; a corresponding target component set is determined according to at least one product configuration template; according to the target deployment method and the node configuration information of the target cluster node, the target component set is deployed to the target cluster node, and the deployment result is displayed on the control interface. According to the present invention, the corresponding running configuration and deployment script are set according to the deployment mode, which can quickly switch between different modes, improve the efficiency of product deployment, and reduce the error rate. Brief Description of the Drawings
[0027] Figure 1 Schematic diagram of the first embodiment of the product visualization deployment method in the present invention;
[0028] Figure 2 Schematic diagram of the second embodiment of the product visualization deployment method in the present invention;
[0029] Figure 3 Schematic diagram of the third embodiment of the product visualization deployment method in the present invention;
[0030] Figure 4 Schematic diagram of an embodiment of the product visualization deployment device in the present invention;
[0031] Figure 5 Schematic diagram of another embodiment of the product visualization deployment device in the present invention;
[0032] Figure 6 Schematic diagram of an embodiment of the product visualization deployment system in the present invention. Detailed Embodiment
[0033] The present invention provides a product visualization deployment method, device, system and storage medium for improving the deployment efficiency of products and reducing the error rate.
[0034] In the description of the present invention, the claims, and the above-mentioned drawings, the terms "first", "second", "third", "fourth", etc. (if any) are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the term "comprising" or "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or devices.
[0035] For ease of understanding, the specific process of the embodiments of the present invention will be described below. It can be understood that the execution subject of the present invention can be a product visualization deployment device, or a server, a terminal, or a controller, and specific limitations are not made here. The embodiments of the present invention will be described by taking the controller as the execution subject as an example.
[0036] Please refer to Figure 1 , the first embodiment of the product visualization deployment method in the present invention includes:
[0037] 101. Generate a product deployment instruction in response to an operation on the control interface, where the product deployment instruction is used to deploy at least one target product to a target cluster node;
[0038] When the operation performed by the user is to deploy a product, the user selects the deployment node, the product to be deployed, and the deployment mode on the display screen. The controller responds to the product deployment operation, generates a product deployment instruction, and deploys the target product to the target cluster node. The selected deployment nodes are merged into the target cluster node, and the selected deployed product is the target product. Among them, the user operates on the objects on the display screen by touching or using a mouse, and there can be multiple optional operations, specifically including: inputting the basic information of the component, inputting the basic information of the node, defining the relationship between the product and the component, and deploying the product; the basic information of the component, the basic information of the node, and defining the relationship between the product and the component can be set in advance or synchronously input when a product deployment instruction needs to be generated. For example, when the operation performed by the user is to input the basic information of the component, the controller responds to the operation of inputting the basic information of the component, generates a component information writing instruction, and writes the basic information of the component. The basic information of the component includes the component ID, component name, component image, and component version; when the operation performed by the user is to input the basic information of the node, the controller responds to the operation of inputting the basic information of the node, generates a node information writing instruction, and writes the basic information of the node. The basic information of the node includes the node name, IP address, SSH port, and login user password; when the operation performed by the user is to define the relationship between the product and the component, the controller responds to the operation of defining the relationship between the product and the component, generates a relationship definition instruction, binds the product and the component, and obtains a product configuration template. Each product corresponds to a product configuration template, and the product configuration template not only records the relationship between the product and the component but also includes the basic information of the component.
[0039] Based on the product deployment operation, the user can combine the above other optional operations as needed to achieve the purpose of deploying at least one target product to the target cluster node.
[0040] 102. Parse the product deployment instruction to obtain at least one target product and the target deployment mode corresponding to the target cluster node;
[0041] Among them, the controller decomposes the product deployment instruction to obtain the product information and deployment mode information therein. The product information is called product identification information, and the product identification information indicates at least one target product and is used to find the product configuration template corresponding to the product;
[0042] The deployment mode information is used to determine the deployment mode of the target cluster nodes. The deployment mode is the single - machine mode, the primary - standby mode, or the cluster mode. The single - machine mode is applied to some systems with relatively simple functions, where all components only need to be deployed on one server. The primary - standby mode is applied to some systems that require emergency scenarios. When the primary server fails, the standby server takes the place of the primary server. When the primary server is working properly, the main task of the standby server is to synchronize data. The cluster mode is applied to systems with high requirements for stability and performance, where each service or component runs on multiple servers to provide services simultaneously.
[0043] 103. Obtain at least one product configuration template and the node configuration information of the target cluster node. At least one product configuration template corresponds to at least one target product one by one. The product configuration template is used to indicate the corresponding relationship between the target product and the components.
[0044] Among them, the controller searches for the product configuration template corresponding to the product identification information according to the product identification information decomposed from the product deployment instruction. The product identification information indicates at least one target product, and at least one product configuration template is obtained.
[0045] Specifically, when the product configuration template corresponding to the product identification information cannot be found, the user performs an operation to define the relationship between the product and the components. The controller generates a definition relationship instruction in response to the operation of defining the relationship between the product and the components, and obtains the product configuration template corresponding to the product identification information.
[0046] When the product configuration template corresponding to the product identification information cannot be found and the component does not exist in the product visual deployment device, the user performs an operation to input the basic information of the component. The controller generates a write - component - information instruction in response to the operation of inputting the basic information of the component, writes the basic information of the component, and then the user performs an operation to define the relationship between the product and the components. The controller generates a definition relationship instruction in response to the operation of defining the relationship between the product and the components, and obtains the product configuration template corresponding to the product identification information.
[0047] Decompose the product deployment instruction to obtain the selected node information. The selected nodes are merged into the target cluster node, and the node configuration information of the target cluster node is obtained according to the information of the target cluster node.
[0048] 104. Determine the corresponding target component set according to at least one product configuration template.
[0049] Among them, the controller reads the product configuration template corresponding to each target product according to the product identification information. The product configuration template not only records the relationship between the product and the components but also includes the basic information of the components, identifies the components corresponding to each target product, and merges the components corresponding to all target products to obtain the target component set.
[0050] 105. Deploy the target component set to the target cluster nodes according to the target deployment method and the node configuration information of the target cluster nodes, and display the deployment result on the control interface.
[0051] Among them, the controller determines the running configuration and deployment script corresponding to the target cluster nodes according to the target deployment method, creates the initial working directory of the target nodes according to the configuration information of the target cluster nodes, imports the mapping file and initialization script corresponding to the target component set into the initial working directory based on the running configuration and deployment script, executes the initialization script to obtain the target working directory, deploys the component images or local components corresponding to the mapping file to the target cluster nodes according to the target working directory, and displays the deployment result of each component in the target component set on the control interface.
[0052] In the embodiment of the present invention, setting the corresponding running configuration and deployment script according to the deployment mode can quickly switch between different modes, improve the efficiency of product deployment, and reduce the error rate.
[0053] Please refer to Figure 2 , the second embodiment of the product visualization deployment method in the present invention includes:
[0054] 201. Obtain the corresponding relationship between at least one target product and multiple components;
[0055] Among them, the user performs an operation of defining the relationship between the product and the components, binds all the components required for the effective operation of each product, and the components can be resources shared by multiple products. When deploying multiple products on a cluster, the components can provide services to multiple products at the same time. One product can correspond to multiple components, and one component can correspond to multiple products.
[0056] When the components required for the effective operation of the product do not exist in the product visualization deployment device, the user performs an operation of inputting the basic information of the components. The controller responds to the operation of inputting the basic information of the components, generates a command for writing component information, writes the basic information of the components, and then the user performs an operation of defining the relationship between the product and the components to bind all the components required for the effective operation of the product; reads each target product and the bound components to obtain the corresponding relationship between at least one target product and multiple components.
[0057] 202. Obtain the basic information of multiple components, and the basic information includes component ID, component name, component image, and component version;
[0058] Among them, the user performs operations on the basic information of the input component. The controller responds to the operation on the basic information of the input component, generates a component information writing instruction, and writes the basic information of the component. The basic information of the component includes component ID, component name, component image, and component version. The components can be classified according to functional types, such as basic component type, business component type, etc. The components can be in a remote image repository or local server files, which are used for online deployment and offline deployment respectively, and reads the basic information of the components corresponding to the target product to obtain the basic information of multiple components.
[0059] 203. Generate at least one product configuration template according to the corresponding relationship and the basic information of multiple components.
[0060] Among them, the controller responds to the operation of defining the relationship between the product and the component, and generates a product configuration template corresponding to the target product according to the corresponding relationship between the target product and the component and the basic information of the component. One target product corresponds to one product configuration template, and at least one target product corresponds to at least one product configuration template. The product configuration template not only records the relationship between the product and the component but also includes the basic information of the component.
[0061] 204. Create target cluster nodes. The target cluster nodes include multiple nodes, and the nodes meet the running conditions of all components;
[0062] Among them, first prepare one or more container servers that already meet the conditions for running all components for the product to be deployed. One server is called a node in the embodiments of the present invention. The user performs operations on the basic information of the input node. The controller responds to the operation on the basic information of the input node, generates a node information writing instruction, and writes the basic information of the node. The basic information of the node includes node name, IP address, SSH port, and login user password. When the user performs the product deployment operation, the selected deployment nodes are merged into the target cluster nodes.
[0063] 205. Set the running configuration and deployment script corresponding to the target cluster nodes in each deployment mode.
[0064] Among them, when the user performs the product deployment operation, there are three selectable deployment methods: single machine mode, master-slave mode, and cluster mode. Each time of deployment, the user selects one of them as the target deployment mode for the target cluster nodes. The controller responds to the product deployment operation, generates a product deployment instruction, and generates the corresponding running configuration and deployment script according to the deployment mode information in the product deployment instruction.
[0065] When the target deployment mode is the single machine mode, set the single machine mode operation strategy according to the preset rules, and generate the running configuration and deployment script corresponding to the single machine mode operation strategy;
[0066] When the target deployment mode is the primary / standby mode, set the operation policy for the primary / standby mode, and generate the operation configuration and deployment script corresponding to the operation policy for the primary / standby mode. The operation policy for the primary / standby mode includes the operation policy for the single-machine mode, the synchronization policy, and the primary / standby switch policy.
[0067] When the target deployment mode is the cluster mode, set the operation policy for the cluster mode, and generate the operation configuration and deployment script corresponding to the operation policy for the cluster mode. The operation policy for the cluster mode includes the operation policy for the single-machine mode, the registration and discovery policy for the servers, and the allocation policy for the servers.
[0068] 206. In response to an operation on the control interface, generate a product deployment instruction for deploying at least one target product to a target cluster node.
[0069] When the operation performed by the user is to deploy a product, the user selects the deployment node, the product to be deployed, and the deployment mode on the display screen. The controller responds to the product deployment operation and generates a product deployment instruction to deploy the target product to the target cluster node. The selected deployment nodes are merged into the target cluster node, and the selected product to be deployed is the target product. Among them, the user can operate on the objects on the display screen by touching or using a mouse, and there are multiple optional operations, specifically including: inputting the basic information of the component, inputting the basic information of the node, defining the relationship between the product and the component, and deploying the product. The basic information of the component and the basic information of the node, and defining the relationship between the product and the component can be set in advance or synchronously input when a product deployment instruction needs to be generated. For example, when the operation performed by the user is to input the basic information of the component, the controller responds to the operation of inputting the basic information of the component and generates a write component information instruction to write the basic information of the component. The basic information of the component includes the component ID, component name, component image, and component version. When the operation performed by the user is to input the basic information of the node, the controller responds to the operation of inputting the basic information of the node and generates a write node information instruction to write the basic information of the node. The basic information of the node includes the node name, IP address, SSH port, and login user password. When the operation performed by the user is to define the relationship between the product and the component, the controller responds to the operation of defining the relationship between the product and the component and generates a define relationship instruction to bind the product and the component to obtain a product configuration template. Each product corresponds to a product configuration template, and the product configuration template not only records the relationship between the product and the component but also includes the basic information of the component.
[0070] Based on the product deployment operation, the user can combine the above other optional operations as needed to achieve the purpose of deploying at least one target product to the target cluster node.
[0071] 207. Parse the product deployment instruction to obtain at least one target product and the target deployment mode corresponding to the target cluster node.
[0072] Among them, the controller decomposes the product deployment instruction to obtain the product information and deployment mode information therein. The product information is called product identification information, and the product identification information indicates at least one target product, which is used to find the product configuration template corresponding to the product;
[0073] The deployment mode information is used to determine the deployment mode of the target cluster nodes. The deployment mode is single machine mode, primary / backup mode or cluster mode. The single machine mode is applied to some systems with relatively simple functions, and all components only need to be deployed on one server. The primary / backup mode is applied to some systems that require emergency scenarios. When the primary server fails, the backup server takes the place of the primary server. When the primary server is working properly, the main task of the backup server is to synchronize data. The cluster mode is applied to systems with high requirements for stability and performance, and each service or component runs on multiple servers to provide services simultaneously.
[0074] 208. Obtain at least one product configuration template and the node configuration information of the target cluster nodes. At least one product configuration template corresponds to at least one target product one by one, and the product configuration template is used to indicate the corresponding relationship between the target product and the components;
[0075] Among them, the controller searches for the product configuration template corresponding to the product identification information according to the product identification information decomposed from the product deployment instruction. The product identification information indicates at least one target product, and at least one product configuration template is obtained.
[0076] Specifically, when the product configuration template corresponding to the product identification information cannot be found, the user performs an operation to define the relationship between the product and the components. The controller generates a definition relationship instruction in response to the operation of defining the relationship between the product and the components, and obtains the product configuration template corresponding to the product identification information;
[0077] When the product configuration template corresponding to the product identification information cannot be found and the component does not exist in the product visualization deployment device, the user performs an operation to input the basic information of the component. The controller generates a write component information instruction in response to the operation of inputting the basic information of the component, writes the basic information of the component, and then the user performs an operation to define the relationship between the product and the components. The controller generates a definition relationship instruction in response to the operation of defining the relationship between the product and the components, and obtains the product configuration template corresponding to the product identification information.
[0078] Decompose the product deployment instruction to obtain the selected node information. The selected nodes are merged into the target cluster nodes, and the node configuration information of the target cluster nodes is obtained according to the information of the target cluster nodes.
[0079] 209. Determine the corresponding target component set according to at least one product configuration template;
[0080] Among them, the controller reads the product configuration template corresponding to each target product according to the product identification information. The product configuration template not only records the relationship between the product and the components but also includes the basic information of the components, identifies the components corresponding to each target product, and merges the components corresponding to all target products to obtain a target component set.
[0081] 210. According to the target deployment method and the node configuration information of the target cluster node, deploy the target component set to the target cluster node and display the deployment result on the control interface.
[0082] Among them, the controller determines the running configuration and deployment script corresponding to the target cluster node according to the target deployment method, creates the initial working directory of the target node according to the configuration information of the target cluster node, imports the mapping file and initialization script corresponding to the target component set into the initial working directory based on the running configuration and deployment script, executes the initialization script to obtain the target working directory, deploys the component image or local component corresponding to the mapping file to the target cluster node according to the target working directory, and displays the deployment result of each component in the target component set on the control interface.
[0083] In the embodiment of the present invention, by defining the relationship between the product and the components, unitizing the basic information of the components, setting the corresponding node cluster running policies for multiple deployment modes, and automatically generating the running configuration and deployment script corresponding to the policies, it can meet the rapid switching deployment requirements in multiple modes, improve the efficiency of product deployment, and reduce the error rate.
[0084] Please refer to Figure 3 , the third embodiment of the product visual deployment method in the present invention includes:
[0085] 301. In response to an operation on the control interface, generate a product deployment instruction for deploying at least one target product to a target cluster node.
[0086] When the operation performed by the user is to deploy a product, the user selects the deployment node, the product to be deployed, and the deployment mode on the display screen. The controller responds to the product deployment operation, generates a product deployment instruction, and deploys the target product to the target cluster node. The selected deployment nodes are merged into the target cluster node, and the selected product to be deployed is the target product. Among them, the user can operate on the objects on the display screen by touching or using a mouse, and there are multiple optional operations, specifically including: inputting the basic information of the component, inputting the basic information of the node, defining the relationship between the product and the component, and deploying the product; the basic information of the component, the basic information of the node, and defining the relationship between the product and the component can be set in advance or synchronously input when a product deployment instruction needs to be generated. For example, when the operation performed by the user is to input the basic information of the component, the controller responds to the operation of inputting the basic information of the component, generates a component information writing instruction, and writes the basic information of the component. The basic information of the component includes the component ID, component name, component image, and component version; when the operation performed by the user is to input the basic information of the node, the controller responds to the operation of inputting the basic information of the node, generates a node information writing instruction, and writes the basic information of the node. The basic information of the node includes the node name, IP address, SSH port, and login user password; when the operation performed by the user is to define the relationship between the product and the component, the controller responds to the operation of defining the relationship between the product and the component, generates a relationship definition instruction, binds the product and the component, and obtains a product configuration template. Each product corresponds to a product configuration template, and the product configuration template not only records the relationship between the product and the component but also includes the basic information of the component.
[0087] Based on the product deployment operation, the user can combine the above other optional operations as needed to achieve the purpose of deploying at least one target product to the target cluster node.
[0088] 302. Parse the product deployment instruction to obtain at least one target product and the target deployment mode corresponding to the target cluster node;
[0089] Among them, the controller decomposes the product deployment instruction to obtain the product information and deployment mode information therein. The product information is called product identification information, and the product identification information indicates at least one target product and is used to find the product configuration template corresponding to the product;
[0090] The deployment mode information is used to determine the deployment mode of the target cluster nodes. The deployment modes are single-machine mode, primary-secondary mode, or cluster mode. The single-machine mode is applied to some systems with relatively simple functions, where all components only need to be deployed on one server. The primary-secondary mode is applied to some systems that require emergency scenarios. When the primary server fails, the secondary server takes over the role of the primary server. When the primary server is working properly, the main task of the secondary server is to synchronize data. The cluster mode is applied to systems with high requirements for stability and performance, where each service or component runs on multiple servers to provide services simultaneously.
[0091] 303. Obtain at least one product configuration template and the node configuration information of the target cluster nodes. At least one product configuration template corresponds to at least one target product one by one. The product configuration template is used to indicate the corresponding relationship between the target product and the components.
[0092] Among them, the controller searches for the product configuration template corresponding to the product identification information according to the product identification information decomposed from the product deployment instruction. The product identification information indicates at least one target product, and at least one product configuration template is obtained.
[0093] Specifically, when the product configuration template corresponding to the product identification information cannot be found, the user performs an operation to define the relationship between the product and the components. The controller generates a definition relationship instruction in response to the operation of defining the relationship between the product and the components, and obtains the product configuration template corresponding to the product identification information.
[0094] When the product configuration template corresponding to the product identification information cannot be found and the component does not exist in the product visualization deployment device, the user performs an operation to input the basic information of the component. The controller generates a write component information instruction in response to the operation of inputting the basic information of the component, writes the basic information of the component, and then the user performs an operation to define the relationship between the product and the components. The controller generates a definition relationship instruction in response to the operation of defining the relationship between the product and the components, and obtains the product configuration template corresponding to the product identification information.
[0095] Decompose the product deployment instruction to obtain the selected node information. The selected nodes are merged into the target cluster nodes, and the node configuration information of the target cluster nodes is obtained according to the information of the target cluster nodes.
[0096] 304. Determine the corresponding target component set according to at least one product configuration template.
[0097] Among them, the controller reads the product configuration template corresponding to each target product according to the product identification information. The product configuration template not only records the relationship between the product and the components but also contains the basic information of the components, identifies the components corresponding to each target product, and merges the components corresponding to all target products to obtain the target component set.
[0098] 305. Determine the running configuration and deployment script corresponding to the target cluster node according to the target deployment method;
[0099] The controller determines the running configuration and deployment script corresponding to the target cluster node according to the target deployment method, where the running deployment script is used to create the running environment of the target node.
[0100] 306. Create the initial working directory of the target node according to the configuration information of the target cluster node;
[0101] Among them, the controller creates the initial working directory of the target node according to the configuration information of the target cluster node, which specifically includes the following steps:
[0102] 1. The controller obtains the file path constructor according to the product configuration template, obtains the configuration information and target path of the component through the file path constructor, parses the configuration information and target path and stores the parsing results in the configuration structure. At the same time, parameter substitution is performed on the working directory mounting information and host node constraint information in the configuration structure. Serialize the configuration structure with parameters replaced into a specific file structure, write the configuration of the component target path into the specific file structure, then deserialize the specific file structure, parse out the address information occupied by the component according to the predetermined rules, and write the address information occupied by the component into the configuration structure.
[0103] 2. The controller creates cluster and component startup tasks, hands the startup tasks to the scheduler. The scheduler judges the type of startup tasks, filters out invalid startup tasks, and at the same time the scheduler locks and tries to put the startup tasks into the buffer queue. If it times out, it means the buffer queue is full and an error is returned; if the startup tasks are successfully put into the buffer queue, record the unique identifier of the cluster task, which is composed of the cluster ID and the component ID. The scheduler reads the startup tasks from the cache queue, adds a related piece of data to the task concurrency control Channel, creates a coroutine to process the startup tasks. The scheduler obtains different component task executor factories from the component factory container according to the component type, creates the corresponding component task executor through the task executor factory, and passes the task information into the component task executor. The component task executor calls the startup method of the component in different modes according to the mode of the target cluster. The startup process mainly reads the corresponding running configuration and deployment script in various modes. Compared with the single-machine mode, the primary-backup mode also includes the primary-backup server synchronization configuration policy and the primary-backup switching policy, and the cluster mode also includes the registration discovery policy and allocation policy of all servers.
[0104] 3. The controller obtains the component configuration information in the configuration structure, confirms the deployment mode creation status and connection method of the target node. If it has not been created, it reads the configuration information of the node by the user. If it has been created, it creates the running environment of the node according to the deployment script and creates an initial working directory on the target node.
[0105] 307. Import the mapping file and initialization script corresponding to the target component set into the initial working directory based on the running configuration and deployment script, and execute the initialization script to obtain the target working directory;
[0106] The controller imports the mapping file and initialization script corresponding to the target component set into the initial working directory based on the running configuration and deployment script, and executes the initialization script to obtain the target working directory. Among them, the mapping file is used to reflect the corresponding component image or local component.
[0107] 308. Deploy the component image or local component corresponding to the mapping file to the target cluster node according to the target working directory;
[0108] Among them, obtain the working mount directory in the configuration structure. If there is no file on the target node, create a folder and send the component image or local component corresponding to the mapping file to the target node, and add node port occupancy information after the deployment is completed.
[0109] 309. Display the deployment result of each component in the target component set on the control interface.
[0110] Among them, the controller starts the component service according to the deployment file, locks the scheduler, deletes the task from the task concurrency control Channel, uniformly processes all uncaught errors, and notifies the deployment tool through WebSocket to display the deployment result on the display screen.
[0111] In the embodiment of the present invention, the controller automatically calls the startup method of the component in the corresponding deployment mode according to the relationship between the product and the component set by the user and the node cluster mode, reads the running configuration and deployment script in the corresponding deployment mode, deploys the component to the node based on the running configuration and deployment script, automatically detects and feedbacks the deployment result, realizes the purpose of product deployment, can meet the rapid switching deployment of multiple modes, improves the efficiency of product deployment, and reduces the error rate.
[0112] Please refer to Figure 4 , an embodiment of the product visualization deployment device in the present invention includes:
[0113] A response module 401, configured to generate a product deployment instruction in response to an operation on the control interface, where the product deployment instruction is used to deploy at least one target product to a target cluster node;
[0114] The parsing module 402 is configured to parse the product deployment instruction to obtain at least one target product and the target deployment mode corresponding to the target cluster node;
[0115] The obtaining module 403 is configured to obtain at least one product configuration template and the node configuration information of the target cluster node, where the at least one product configuration template corresponds to the at least one target product one by one, and the product configuration template is used to indicate the correspondence between the target product and the components;
[0116] The determining module 404 is configured to determine the corresponding target component set according to the at least one product configuration template;
[0117] The deployment display module 405 is configured to deploy the target component set to the target cluster node according to the target deployment method and the node configuration information of the target cluster node, and display the deployment result on the control interface.
[0118] In the embodiment of the present invention, by establishing a product configuration template based on the connection between the product and the components, and setting the corresponding running configuration and deployment script in different deployment modes, a solution for switching between multiple modes and simply and efficiently integrating and deploying products is provided, improving the efficiency of product deployment and reducing the error rate.
[0119] Please refer to Figure 5 , another embodiment of the product visual deployment device in the present invention includes:
[0120] The response module 401 is configured to generate a product deployment instruction in response to an operation on the control interface, where the product deployment instruction is used to deploy at least one target product to a target cluster node;
[0121] The parsing module 402 is configured to parse the product deployment instruction to obtain at least one target product and the target deployment mode corresponding to the target cluster node;
[0122] The obtaining module 403 is configured to obtain at least one product configuration template and the node configuration information of the target cluster node, where the at least one product configuration template corresponds to the at least one target product one by one, and the product configuration template is used to indicate the correspondence between the target product and the components;
[0123] The determining module 404 is configured to determine the corresponding target component set according to the at least one product configuration template;
[0124] The deployment display module 405 is configured to deploy the target component set to the target cluster node according to the target deployment method and the node configuration information of the target cluster node, and display the deployment result on the control interface.
[0125] Optionally, the parsing module 402 is specifically configured to:
[0126] Parse the product deployment instruction to obtain product identification information and deployment mode information;
[0127] Determine at least one target product according to the product identification information;
[0128] Determine that the target deployment mode corresponding to the target cluster node is a single machine mode, a primary / standby mode, or a cluster mode according to the deployment mode information.
[0129] Optionally, the determination module 404 is specifically configured to:
[0130] Determine at least one component corresponding to each product configuration template in the at least one product configuration template; merge the at least one component corresponding to each product configuration template into the corresponding target component set.
[0131] Optionally, the deployment display module 405 is specifically configured to:
[0132] Determine the running configuration and deployment script corresponding to the target cluster node according to the target deployment method;
[0133] Create an initial working directory for the target node according to the configuration information of the target cluster node;
[0134] Based on the running configuration and deployment script, import the mapping file and initialization script corresponding to the target component set into the initial working directory, and execute the initialization script to obtain a target working directory;
[0135] Deploy the component image or local component corresponding to the mapping file to the target cluster node according to the target working directory;
[0136] Display the deployment result of each component in the target component set on the control interface.
[0137] Optionally, the product visual deployment device further includes:
[0138] A configuration generation module 406, configured to generate at least one product configuration template.
[0139] Optionally, the configuration generation module 406 is specifically configured to:
[0140] Obtain the correspondence between at least one target product and multiple components;
[0141] Obtain the basic information of the multiple components, where the basic information includes component ID, component name, component image, and component version;
[0142] Generate at least one product configuration template according to the corresponding relationship and the basic information of the multiple components.
[0143] Optionally, the product visualization deployment device further includes:
[0144] A creation module 407, configured to create the target cluster nodes, where the target cluster nodes include multiple nodes, and the nodes meet the running conditions of all components;
[0145] A setting module 408, configured to set the running configuration and deployment script corresponding to the target cluster nodes in each deployment mode.
[0146] Optionally, the creation module 407 is specifically configured to:
[0147] Obtain the basic information of multiple preset nodes, where the basic information includes node name, IP address, SSH port, and login user password;
[0148] Select multiple target nodes from the multiple preset nodes according to the basic information of the multiple preset nodes, and determine the multiple target nodes as the target cluster nodes.
[0149] Optionally, the setting module 408 is specifically configured to:
[0150] When the target deployment mode of the target cluster nodes is the single-machine mode, set the single-machine mode operation policy according to a preset rule, and generate the running configuration and deployment script corresponding to the single-machine mode operation policy;
[0151] When the target deployment mode of the target cluster nodes is the primary / standby mode, set the primary / standby mode operation policy, and generate the running configuration and deployment script corresponding to the primary / standby mode operation policy, where the primary / standby mode operation policy includes the single-machine mode operation policy, the synchronization policy, and the primary / standby switching policy;
[0152] When the target deployment mode of the target cluster nodes is the cluster mode, set the cluster mode operation policy, and generate the running configuration and deployment script corresponding to the cluster mode operation policy, where the cluster mode operation policy includes the single-machine mode operation policy, the server registration and discovery policy, and the server allocation policy.
[0153] In the embodiments of the present invention, by defining the relationship between the product and the components, unitizing the basic information of the components, setting the corresponding node cluster operation policies for multiple deployment modes, and automatically generating the running configuration and deployment script corresponding to the policies, it can meet the rapid switching and deployment of multiple modes, improve the efficiency of product deployment, and reduce the error rate.
[0154] The present invention also provides a product visualization deployment system, please refer to Figure 6, the product visualization deployment system includes: a plurality of nodes and a controller, the controller includes a memory and a processor, and computer-readable instructions are stored in the memory. When the computer-readable instructions are executed by the processor, the processor is caused to execute the steps of the product visualization deployment method in the above embodiments.
[0155] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a computer, the computer is caused to execute the steps of the product visualization deployment method.
[0156] As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for visual deployment of a product, characterized in that, Including: In response to an operation on a control interface, generate a product deployment instruction for deploying at least one target product to target cluster nodes, where the target cluster nodes include at least two types of target containers, the target cluster nodes include multiple nodes, and the nodes are container servers that meet the operating conditions of all components; Parse the product deployment instruction to obtain at least one target product and a target deployment mode corresponding to the target cluster nodes; Obtain at least one product configuration template and node configuration information of the target cluster nodes, where the at least one product configuration template corresponds one-to-one with the at least one target product, and the product configuration template is used to indicate the correspondence between the target product and components; Determine a corresponding target component set according to the at least one product configuration template; Deploy the target component set to the target cluster nodes according to the target deployment mode and the node configuration information of the target cluster nodes, and display the deployment result on the control interface; The step of deploying the target component set to the target cluster nodes according to the target deployment mode and the node configuration information of the target cluster nodes and displaying the deployment result on the control interface includes: Determine the running configuration and deployment script corresponding to the target cluster nodes according to the target deployment mode; Create an initial working directory of the target node according to the node configuration information of the target cluster nodes; Import the mapping file and initialization script corresponding to the target component set into the initial working directory based on the running configuration and deployment script, and execute the initialization script to obtain a target working directory; Deploy the component image or local component corresponding to the mapping file to the target cluster nodes according to the target working directory; Display the deployment result of each component in the target component set on the control interface; The step of creating an initial working directory of the target node according to the node configuration information of the target cluster nodes includes: Call the startup method in different modes according to the target deployment mode of the target cluster nodes to read the corresponding running configuration and deployment script in various modes; Confirm the deployment mode creation status and connection method of the target node. If not created, read the node configuration information of the user. If already created, create the running environment of the node according to the deployment script and create an initial working directory on the target node.
2. The product visualization deployment method according to claim 1, wherein, The step of parsing the product deployment instruction to obtain at least one target product and a target deployment mode corresponding to the target cluster nodes includes: Parse the product deployment instruction to obtain product identification information and deployment mode information; Determine at least one target product according to the product identification information; Determine that the target deployment mode corresponding to the target cluster nodes is a single machine mode, a primary and standby mode, or a cluster mode according to the deployment mode information.
3. The product visualization deployment method according to claim 1, wherein The step of determining a corresponding target component set according to the at least one product configuration template includes: Determine at least one component corresponding to each product configuration template in the at least one product configuration template; Merge the at least one component corresponding to each product configuration template into the corresponding target component set.
4. The product visualization deployment method according to any one of claims 1-3, characterized in that Before the operation on the control interface is responded to, the product visualization deployment method further includes: Generating at least one product configuration template.
5. The product visualization deployment method according to claim 4, wherein The generating of at least one product configuration template includes: Obtaining the correspondence between at least one target product and multiple components; Obtaining the basic information of the multiple components, where the basic information includes component ID, component name, component image, and component version; Generating at least one product configuration template according to the correspondence and the basic information of the multiple components.
6. The product visualization deployment method according to any one of claims 1-3, characterized in that Before the operation on the control interface is responded to, the product visualization deployment method further includes: Creating the target cluster nodes, where the target cluster nodes include multiple nodes, and the nodes meet the running conditions of all components; Setting the corresponding running configurations and deployment scripts for the target cluster nodes in each deployment mode.
7. The product visualization deployment method according to claim 6, wherein The creating of the target cluster nodes, where the target cluster nodes include multiple nodes, and the nodes meet the running conditions of all components, includes: Obtaining the basic information of multiple preset nodes, where the basic information includes node name, IP address, SSH port, and login user password; Selecting multiple target nodes from the multiple preset nodes according to the basic information of the multiple preset nodes, and determining the multiple target nodes as the target cluster nodes.
8. The product visualization deployment method according to claim 6, characterized in that, The setting of the corresponding running configurations and deployment scripts for the target cluster nodes in each deployment mode includes: When the target deployment mode of the target cluster nodes is the single-machine mode, setting the single-machine mode running policy according to a preset rule, and generating the corresponding running configuration and deployment script for the single-machine mode running policy; When the target deployment mode of the target cluster nodes is the primary-backup mode, setting the primary-backup mode running policy, and generating the corresponding running configuration and deployment script for the primary-backup mode running policy, where the primary-backup mode running policy includes the single-machine mode running policy, the synchronization policy, and the primary-backup switching policy; When the target deployment mode of the target cluster nodes is the cluster mode, setting the cluster mode running policy, and generating the corresponding running configuration and deployment script for the cluster mode running policy, where the cluster mode running policy includes the single-machine mode running policy, the server registration and discovery policy, and the server allocation policy.
9. A product visualization deployment device, characterized in that, It includes: A response module, configured to generate a product deployment instruction in response to an operation on the control interface, where the product deployment instruction is used to deploy at least one target product to the target cluster nodes, and where the target cluster nodes include at least two target containers; A parsing module, configured to parse the product deployment instruction to obtain at least one target product and the target deployment mode corresponding to the target cluster nodes; An obtaining module, configured to obtain at least one product configuration template and the node configuration information of the target cluster nodes, where the at least one product configuration template corresponds to the at least one target product one by one, and the product configuration template is used to indicate the correspondence between the target product and the components; A determining module, configured to determine the corresponding target component set according to the at least one product configuration template; A deployment display module, which is used to deploy the target component set to the target cluster nodes according to the target deployment mode and the node configuration information of the target cluster nodes, and display the deployment result on the control interface; Specifically, the deployment display module is used to: determine the running configuration and deployment script corresponding to the target cluster nodes according to the target deployment mode; Create an initial working directory for the target node according to the node configuration information of the target cluster nodes; Based on the running configuration and deployment script, import the mapping file and initialization script corresponding to the target component set into the initial working directory, and execute the initialization script to obtain the target working directory; Deploy the component image or local component corresponding to the mapping file to the target cluster nodes according to the target working directory; Display the deployment result of each component in the target component set on the control interface; The creating an initial working directory for the target node according to the node configuration information of the target cluster nodes includes: Call the startup methods in different modes according to the target deployment mode of the target cluster nodes to read the corresponding running configuration and deployment script in various modes; Confirm the deployment mode creation status and connection method of the target node. If it has not been created, read the node configuration information of the user. If it has been created, create the running environment of the node according to the deployment script and create an initial working directory on the target node.
10. A product visualization deployment system, characterized in that, The product visual deployment system includes: multiple nodes and a controller, the controller includes a memory and at least one processor, and instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the product visual deployment system to execute the product visual deployment method according to any one of claims 1-8.
11. A computer-readable storage medium having instructions stored thereon, characterized in that, When the instructions are executed by a computer, the product visual deployment method according to any one of claims 1-8 is implemented.
Citation Information
Patent Citations
Application deployment method and device
CN110515628A