Method and device for deploying service, and computer storable medium
The standard deployment scheme is generated through the natural language processing model and automated deployment code generation, which solves the difficulty of the deployment personnel to obtain the parameter value, and improves deployment efficiency and platform security.
Patent Information
- Application Number
- CN202111271529.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-10-29
AI Technical Summary
In the prior art, deployment personnel need to obtain and understand the parameter values required for deployment services, resulting in high workload, low efficiency, and poor platform security of the target platform.
By receiving user deployment requests, the natural language processing model is used to generate standard deployment solutions based on computer language, and the deployment code corresponds to the target platform is generated to achieve automation of deployment services.
Reduced the workload of deployment personnel, improved the degree and efficiency of deployment services, and improved the security of the target platform.
Smart Images

Figure CN113986255B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method and device for deploying services, and a computer storable medium. Background Art
[0002] Automated deployment services are usually used in scenarios such as application cloud migration, automated integration in DevOps (Development and Operations) processes, and environment construction in software development and evaluation processes.
[0003] In the related art, the deployer stores the deployment script of the service in advance on the target platform. Based on the deployment request initiated by the deployer, the target platform obtains and executes the deployment script to deploy the corresponding service on the target platform. The deployment script is developed by the deployer using the parameter values required to deploy the service. Summary of the invention
[0004] In the related art, the deployer needs to obtain and understand the parameter values required for deploying the service, which results in a large workload for the deployer and a low efficiency of deploying the service. In addition, the parameter value is usually related to the target platform, and the deployer directly obtains the parameter value, which makes the platform security of the target platform poor.
[0005] In response to the above technical problems, the present disclosure proposes a solution that can not only automatically adapt the deployment process to the target platform and reduce the workload of deployment personnel, thereby improving the automation and efficiency of deployment services, but also improve the security of the platform.
[0006] According to a first aspect of the present disclosure, a method for deploying a service is provided, which is executed by a device for deploying a service, and includes: receiving a deployment request from a user, the deployment request including an original deployment plan based on a natural language description and an identifier of a target platform, the original deployment plan being used to deploy the service, the original deployment plan being based on information of operations for deploying the service described in natural language; generating a standard deployment plan based on a computer language using a natural language processing model according to the original deployment plan described in natural language, the standard deployment plan being based on information of operations for deploying the service described in computer language; generating a deployment code corresponding to the identifier of the target platform according to the standard deployment plan, the deployment code being used to deploy the service on the target platform; and executing the deployment code to deploy the service in the target platform.
[0007] In some embodiments, generating a standard deployment plan based on computer language includes: generating a standard deployment plan based on computer language and its confidence level using a natural language processing model according to the original deployment plan based on the natural language description; generating a deployment code corresponding to the identifier of the target platform according to the standard deployment plan includes: sending the standard deployment plan to the user when the confidence level is less than or equal to a confidence threshold; receiving the standard deployment plan adjusted by the user; and generating a deployment code corresponding to the identifier of the target platform according to the adjusted standard deployment plan.
[0008] In some embodiments, generating a deployment code corresponding to the identifier of the target platform includes: when the original deployment plan does not include a parameter name for deploying the service, obtaining a default parameter name for deploying the service and its parameter value corresponding to the operation from the target platform; when the original deployment plan also includes a parameter name for deploying the service, obtaining a corresponding parameter value from the target platform according to the parameter name; and generating the deployment code according to the obtained parameter value and information about the operation.
[0009] In some embodiments, the parameter name is one or more, the operation is one or more, the information of each operation includes the operation identifier of the operation, the deployment code includes a deployment code snippet corresponding to each operation, and generating the deployment code according to the obtained parameter value and the operation information includes: for each operation, obtaining a template of the deployment code snippet corresponding to the operation identifier and the identifier of the target platform, the template of the deployment code snippet including at least one of the one or more parameter names; generating the deployment code snippet corresponding to each operation according to the obtained parameter value and the obtained deployment code snippet template; and encapsulating the deployment code snippet of one or more operations to obtain the deployment code.
[0010] In some embodiments, generating a deployment code snippet corresponding to each operation based on the obtained parameter values and the obtained deployment code snippet template includes: for each operation, obtaining the parameter name in the template of the corresponding deployment code snippet; filtering parameter values corresponding to the parameter names in the template of the deployment code snippet from the obtained parameter values; and replacing the corresponding parameter names in the template of the deployment code snippet with the filtered parameter values to obtain the deployment code snippet corresponding to each operation.
[0011] In some embodiments, when there are multiple operations, the operation information also includes the execution order of the multiple operations, encapsulating the deployment code fragments of the one or more operations, and obtaining the deployment code includes: encapsulating the deployment code fragments of the multiple operations according to the execution order to obtain the deployment code.
[0012] In some embodiments, the template for deploying the code snippet is installed in the device in the form of a plug-in.
[0013] In some embodiments, the target platform pre-stores a correspondence between parameter names and parameter values, and obtaining corresponding parameter value information from the target platform includes: obtaining the parameter value corresponding to the parameter name according to the correspondence.
[0014] In some embodiments, the deployment code is an executable code or a script code. When the deployment code is an executable code, the executable code is directly executed; when the deployment code is a script code, a deployment tool corresponding to the identifier of the target platform is called to execute the script code.
[0015] In some embodiments, the method for deploying services further includes: storing the corresponding relationship between the solution identifier of the original deployment solution, the deployment status, and the deployment result.
[0016] In some embodiments, the method of deploying a service further includes: regularly training the natural language processing model.
[0017] According to a second aspect of the present disclosure, a device for deploying a service is provided, comprising: a receiving module, configured to receive a deployment request from a user, the deployment request comprising an original deployment plan based on a natural language description and an identifier of a target platform, the original deployment plan being used to deploy the service, the original deployment plan being based on information of operations for deploying the service described in natural language; a first generating module, configured to generate a standard deployment plan based on a computer language using a natural language processing model according to the original deployment plan described in natural language, the standard deployment plan being based on information of operations for deploying the service described in computer language; a second generating module, configured to generate a deployment code corresponding to the identifier of the target platform according to the standard deployment plan, the deployment code being used to deploy the service on the target platform; and an executing module, configured to execute the deployment code to deploy the service in the target platform.
[0018] According to a third aspect of the present disclosure, a device for deploying services is provided, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the method for deploying services described in any of the above embodiments based on instructions stored in the memory.
[0019] According to a fourth aspect of the present disclosure, a computer storable medium is provided, on which computer program instructions are stored, and when the instructions are executed by a processor, the method for deploying services described in any of the above embodiments is implemented.
[0020] In the above embodiment, not only can the deployment process be automatically adapted to the target platform, reducing the workload of deployment personnel, thereby improving the automation level and deployment efficiency of the deployment service, but also the security of the platform can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0022] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0023] Figure 1 is a flowchart illustrating a method of deploying a service according to some embodiments of the present disclosure;
[0024] Figure 2 is a flowchart illustrating generation of deployment code corresponding to an identification of a target platform according to some embodiments of the present disclosure;
[0025] Figure 3 is a block diagram illustrating an apparatus for deploying services according to some embodiments of the present disclosure;
[0026] Figure 4 is a block diagram showing an apparatus for deploying services according to other embodiments of the present disclosure;
[0027] Figure 5 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION
[0028] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0029] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0030] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0031] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0032] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0033] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0034] Figure 1 is a flowchart illustrating a method of deploying a service according to some embodiments of the present disclosure.
[0035] like Figure 1 As shown, the method for deploying services includes steps S1 to S4. The method for deploying services is executed by a device for deploying services.
[0036] In step S1, a deployment request is received from a user. The deployment request includes an original deployment plan based on a natural language description and an identifier of a target platform. The original deployment plan is used to deploy a service. The original deployment plan describes information about operations for deploying the service based on a natural language description. In some embodiments, the original deployment plan may include parameter names for deploying the service, or may not include parameter names for deploying the service. The target platform may pre-store default parameter names and parameter values for deploying the service corresponding to the operation. In this way, the fault tolerance of service deployment can be improved.
[0037] In some embodiments, the deployment request may be received through an HTTP (HyperText Transfer Protocol) service interface or a RESTful interface. A RESTful interface is an interface that complies with the REST (Representational State Transfer) principle. For example, the above services include but are not limited to applications and systems. For example, a deployment request from a user may also be received through a web page interface.
[0038] In some embodiments, the parameter name includes a parameter name corresponding to an IP (Internet Protocol) address (e.g., a parameter name hostip representing the host IP address of the target platform), a parameter name corresponding to an account name used to log in to the target platform (e.g., a parameter name nodeA_admin representing the account of node A on the target platform), and a parameter name corresponding to a file transfer address (e.g., a parameter name path representing the file transfer address). In some embodiments, the parameter name may also include a node name, a module name, etc.
[0039] In some embodiments, the operation includes an operation of transferring a file and an operation of executing a specified command. The specified command includes a command related to a precondition or a pre-dependency. Taking the parameter name including a node name and a module name as an example, the operation may also include building a connection relationship, an inclusion relationship, etc. between nodes or modules.
[0040] In some embodiments, the original deployment plan can be a text content based on natural language input by the user through voice or text. In other embodiments, the original deployment plan can also be a text content closely related to service deployment in a project document related to the service input by the user.
[0041] In step S2, a standard deployment solution based on computer language is generated using a natural language processing model according to the original deployment solution described in natural language. The standard deployment solution describes information for the operation of deploying the service based on computer language. In the case where the original deployment solution includes parameter names, the standard deployment solution also includes parameter names.
[0042] In some embodiments, the standard deployment solution can be expressed in a lightweight data exchange format. The lightweight data exchange format includes the JSON (JavaScript Object Notation) format. The lightweight data exchange format expresses the standard deployment solution, which can provide a structured and easy-to-understand standard deployment solution for the deployment personnel, so that the deployment personnel do not need to learn more development knowledge in depth when reviewing the standard deployment solution, further reducing the workload of the deployment personnel.
[0043] In some embodiments, the natural language processing model is mainly composed of a text processor, and its core is a text recognition model. For example, the natural language processing model can be composed of a neural network model, a Bayesian model, a decision tree model, etc., alone or in combination. The natural language processing model can be obtained through training, and the training data includes corpus and data in this field, data edited by experts, historical data of the system, etc. In some embodiments, the natural language processing model can also be trained regularly. In the process of deploying the service, the model is updated regularly through continuous supplementation of data to continuously improve accuracy and performance.
[0044] In some embodiments, the structure of a standard deployment solution in JSON format is as follows:
[0045] {
[0046] parameter:
[0047] {parameter 1: parameter name 1, parameter 2: parameter name 2}
[0048] operate:
[0049] {Operation 1: Operation name 1, Operation 2: Operation name 2}
[0050] }.
[0051] As shown in the structure of the standard deployment solution shown above, the "Parameter" item defines some parameter name keys "Parameter 1", "Parameter 2". The corresponding parameter names "Parameter Name 1", "Parameter Name 2" are filled after the colon of the key to form a complete key-value pair.
[0052] For example, part of a standard deployment solution in JSON format for a specific scenario is shown below:
[0053] {
[0054] "parameter":
[0055] {"IP_ADDR":"$(hostip)","username":"$(nodeA_admin)","servcie1":"nginx"},
[0056] “upload”:
[0057] {"nodetype":"master",files:"images.tar.gz"},
[0058] “command”:
[0059] {"0":"start servcie1","1":"connect service1","2":cmd},
[0060] …….
[0061] }.
[0062] As shown above, the "Parameters" item defines some parameter name keys, and the value part after the colon is the corresponding parameter name, forming a complete key-value pair. "IP_ADDR" means the IP address, and the colon is followed by the parameter name corresponding to the IP address. "username" means the admin account name of node A on the target platform, and the colon is followed by the parameter name corresponding to the admin account name of node A on the target platform. "servcie1" means the service type of node A, and the colon is followed by the service name nginx corresponding to the service type. Here, the service name nginx has been determined in the original deployment plan, and the parameter name and parameter value are the same.
[0063] The "upload" item defines an operation for transferring files, which specifically transfers files to a specific type of node on the target platform. "upload" is the name of the operation. The meaning of "nodetype" is the node type of the target platform receiving the transferred files, and the colon is followed by the node type (master is the master node) of the target platform receiving the transferred files. The meaning of "files" is the name of the file transferred to the target platform, and the colon is followed by the name of the file transferred to the target platform. The files transferred to the target platform can be pre-stored in the local memory of the device deploying the service, and obtained from the local memory of the device deploying the service according to the name of the file. In the above embodiment, the file upload operation indicates that the file name of the file transmitted to the master node is images.tar.gz.
[0064] The "command" item defines a series of operation instructions to be executed in the order of numbers 0, 1, and 2. For example, start, connect, cmd, etc. can be operations provided by the platform, or they can be a series of operations encapsulated into high-level instructions.
[0065] In some embodiments, based on the original deployment solution described in natural language, a natural language processing model can be used to generate not only a standard deployment solution based on computer language, but also a confidence level corresponding to the standard deployment solution. For example, the confidence level is a score for the accuracy of the standard deployment solution.
[0066] In step S3, according to the standard deployment scheme, a deployment code corresponding to the identifier of the target platform is generated. The deployment code is used to deploy services on the target platform. In some embodiments, the deployment code can be a binary executable code or a script code. For example, when the target platform is a Kubernetes-based platform, the deployment code corresponding to the target platform can be a script code in a chart format or a script code in a yaml format. For another example, when the target platform is an Openstack-based platform, the deployment code corresponding to the target platform can be a series of shell execution commands or a binary executable code, or a script code in a playbook format.
[0067] In some embodiments, taking a standard deployment solution corresponding to a confidence level as an example, when the confidence level is less than or equal to the confidence level threshold, the standard deployment solution is sent to the user. The user-adjusted standard deployment solution is received. According to the adjusted standard deployment solution, a deployment code corresponding to the identifier of the target platform is generated. In the above embodiment, by sending the standard deployment solution generated by the natural language processing model with a confidence level less than or equal to the confidence level threshold to the user for review and adjustment, the accuracy of the standard deployment solution can be guaranteed while improving the degree of automation, thereby ensuring the accuracy of the deployment service.
[0068] For example, by Figure 2 The above step S3 is implemented in the manner shown.
[0069] Figure 2 is a flowchart illustrating generating a deployment code corresponding to an identification of a target platform according to some embodiments of the present disclosure.
[0070] like Figure 2 As shown, generating the deployment code corresponding to the identifier of the target platform includes steps S31 and S32.
[0071] In step S31, corresponding parameter values are obtained from the target platform.
[0072] Taking the original deployment plan not including the parameter name for deploying the service as an example, the default parameter name for deploying the service and its parameter value corresponding to the operation are obtained from the target platform.
[0073] Taking the original deployment plan also including the parameter name for deploying the service as an example, the corresponding parameter value is obtained from the target platform according to the parameter name. For example, the device for deploying the service obtains the access address (port address, interface address or Internet protocol address, etc.) of the target platform according to the identifier of the target platform. The device for deploying the service sends a parameter value request to the target platform, and the parameter value request includes the parameter name. Thus, the device for deploying the service receives parameter value response information from the target platform. The parameter value response information is the response information generated by the target platform according to the parameter value request, including the parameter value corresponding to the parameter name.
[0074] In some embodiments, the target platform pre-stores a correspondence between parameter names and parameter values, and the parameter value corresponding to the parameter name can be obtained according to the correspondence.
[0075] In the above embodiment, the device for deploying the service obtains the parameter value from the target platform according to the parameter name, without exposing the parameter value information to the deployer, thereby improving the security of the platform.
[0076] In some embodiments, the original deployment plan may also include parameter values that are irrelevant to the security of the target platform and are used to deploy the service. Step S3 may also include obtaining corresponding parameter values from the original deployment plan.
[0077] In step S32, a deployment code is generated according to the acquired parameter values and operation information.
[0078] In some embodiments, the parameter name is one or more. The operation is one or more. The information of each operation includes the operation identifier of the operation. For example, the operation identifier is the operation name. The deployment code includes a deployment code snippet corresponding to each operation.
[0079] For example, the above step S32 may be implemented in the following manner.
[0080] First, for each operation, a template of a deployment code snippet corresponding to the operation identifier and the identifier of the target platform is obtained. The template of the deployment code snippet includes at least one of the one or more parameter names. In some embodiments, the template of the deployment code snippet can be installed in the device for deploying the service in the form of a plug-in. In this way, the scalability of the device for deploying the service can be improved.
[0081] Then, a deployment code snippet corresponding to each operation is generated according to the obtained parameter value and the obtained deployment code snippet template.
[0082] In some embodiments, for each operation, a parameter name in a template of a corresponding deployment code snippet is obtained. From the obtained parameter values, a parameter value corresponding to the parameter name in the template of the deployment code snippet is filtered. The filtered parameter value is used to replace the corresponding parameter name in the template of the deployment code snippet to obtain a deployment code snippet corresponding to each operation.
[0083] Finally, the deployment code snippets of one or more operations are encapsulated to obtain the deployment code. For example, in the case where there are multiple operations, the operation information also includes the execution order of the multiple operations. The deployment code snippets of the multiple operations can be encapsulated according to the execution order to obtain the deployment code.
[0084] return Figure 1 , in step S4, the deployment code is executed to deploy the service in the target platform. When the deployment code is an executable code, the executable code is executed directly. When the deployment code is a script code, the deployment tool corresponding to the identifier of the target platform is called to execute the script code. For example, when the target platform is a Kubernetes-based platform, the deployment tools corresponding to the target platform include Helm, Kubectl, etc. The deployment tool Helm is used to execute script code in chart format. The deployment tool Kubectl is used to execute script code in yaml format. For another example, when the target platform is an Openstack-based platform, the deployment tools corresponding to the target platform include Ansible, etc. The deployment tool Ansible is used to execute script code in playbook format.
[0085] In the above embodiment, the user only needs to provide an original deployment plan based on a natural language description, and only needs to understand the parameter name and the information of the operation including the parameter name to complete the service deployment, without having to learn more programming knowledge, thereby improving the efficiency of docking applications on the cloud. In addition, the device for deploying the service automatically generates a deployment code corresponding to the target platform, and automatically calls the deployment tool corresponding to the target platform to execute the generated deployment code. These steps enable the deployment process to automatically adapt to the target platform, reduce the workload of the deployment personnel, and thus improve the degree of automation and deployment efficiency of the deployment service. In addition, during the process of deploying the service, there is no need to expose the parameter value information related to the target platform to the deployment personnel, which can improve the security of the platform.
[0086] Using natural language to describe the deployment plan is in line with human habits and the plan expression is more accurate. Natural language recognition can adapt to the diversity of descriptions, thereby enhancing the adaptability of deployment services. Natural language recognition has a certain fault tolerance, which can improve the fault tolerance of deployment services. Service deployment based on the deployment plan described in natural language greatly reduces the requirements for deployment personnel. The device for deploying services automatically parses the standard deployment plan, automatically matches the correct operation method, and executes the correct instructions, which improves the degree of automation of service deployment. The device for deploying services encapsulates the functional details of the target platform, improves docking efficiency, and at the same time improves the security of the target platform. Functional extensions are provided through plug-ins to adapt to the different characteristics and requirements of different target platforms and are easy to expand.
[0087] In some embodiments, the device for deploying the service may be independent of the target platform. That is, the device for deploying the service may deploy the service to different target platforms, which may improve the versatility of the deployed service. In other embodiments, the device for deploying the service is located in the target platform. This may reduce the exposure of the target platform and further improve the security of the platform.
[0088] For example, the device for deploying the service may also store the scheme identifier of the original deployment scheme, the corresponding relationship between the deployment state and the deployment result. In this way, the deployment of the service can be easily monitored.
[0089] Figure 3 is a block diagram illustrating an apparatus for deploying services according to some embodiments of the present disclosure.
[0090] like Figure 3 As shown, the device 3 for deploying services includes a receiving module 31 , a first generating module 32 , a second generating module 33 and an executing module 34 .
[0091] The receiving module 31 is configured to receive a deployment request from a user, for example, Figure 1 Step S1 shown. The deployment request includes an original deployment plan based on a natural language description and an identifier of a target platform. The original deployment plan is used to deploy a service, and the original deployment plan describes information of an operation for deploying a service based on a natural language description.
[0092] The first generation module 32 is configured to generate a standard deployment solution based on computer language based on the original deployment solution described in natural language by using a natural language processing model, for example, Figure 1 Step S2 is shown. The standard deployment scheme describes information for deploying the operation of the service based on a computer language.
[0093] The second generation module 33 is configured to generate a deployment code corresponding to the identifier of the target platform according to the standard deployment scheme, for example, to execute Figure 1Step S3 shown: The deployment code is used to deploy the service on the target platform.
[0094] The execution module 34 is configured to execute the deployment code to deploy the service in the target platform, for example, Figure 1 Step S4 is shown.
[0095] Figure 4 is a block diagram illustrating an apparatus for deploying services according to some other embodiments of the present disclosure.
[0096] like Figure 4 As shown, the device 4 for deploying services includes a memory 41; and a processor 42 coupled to the memory 41. The memory 41 is used to store instructions for executing the method for deploying services corresponding to the embodiment. The processor 42 is configured to execute the method for deploying services in any of the embodiments of the present disclosure based on the instructions stored in the memory 41.
[0097] Figure 5 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.
[0098] like Figure 5 As shown, the computer system 50 may be embodied in the form of a general purpose computing device. The computer system 50 includes a memory 510, a processor 520, and a bus 500 that connects the various system components.
[0099] The memory 510 may include, for example, a system memory, a non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, and other programs. The system memory may include a volatile storage medium, such as a random access memory (RAM) and / or a cache memory. The non-volatile storage medium may store, for example, instructions for executing at least one of the corresponding embodiments of the method for deploying a service. The non-volatile storage medium may include, but is not limited to, a disk storage, an optical storage, a flash memory, etc.
[0100] The processor 520 can be implemented by a general processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistors, etc. Discrete hardware components. Accordingly, each module such as the judgment module and the determination module can be implemented by a central processing unit (CPU) running instructions in a memory that execute corresponding steps, or can be implemented by a dedicated circuit that executes corresponding steps.
[0101] The bus 500 may use any of a variety of bus architectures, including, but not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, and a Peripheral Component Interconnect (PCI) bus.
[0102] The computer system 50 may also include an input / output interface 530, a network interface 540, a storage interface 550, etc. These interfaces 530, 540, 550, the memory 510, and the processor 520 may be connected via a bus 500. The input / output interface 530 may provide a connection interface for input / output devices such as a display, a mouse, and a keyboard. The network interface 540 may provide a connection interface for various networked devices. The storage interface 550 may provide a connection interface for external storage devices such as a floppy disk, a USB flash drive, and an SD card.
[0103] Here, various aspects of the present disclosure are described with reference to flowcharts and / or block diagrams of methods, devices, and computer program products according to embodiments of the present disclosure. It should be understood that each frame of the flowchart and / or block diagram and the combination of frames can be implemented by computer-readable program instructions.
[0104] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable device to produce a machine, so that the processor executes the instructions to produce means for implementing the functions specified in one or more blocks in the flowchart and / or block diagram.
[0105] These computer-readable program instructions may also be stored in a computer-readable memory, which cause the computer to work in a specific manner to produce an article of manufacture, including instructions for implementing the functions specified in one or more blocks in the flowchart and / or block diagram.
[0106] The present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
[0107] Through the method and device for deploying services and the computer-storable medium in the above embodiments, not only can the deployment process be automatically adapted to the target platform, reducing the workload of deployment personnel, thereby improving the automation and efficiency of deployment services, but also the security of the platform can be improved.
[0108] So far, the method and device for deploying services according to the present disclosure, and the computer storable medium have been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solution disclosed here.
Claims
1. A method for deploying a service, performed by a device for deploying a service, comprising: Receiving a deployment request from a user, the deployment request including an original deployment plan based on a natural language description and an identifier of a target platform, the original deployment plan being used to deploy the service, the original deployment plan being based on a natural language description of information on operations for deploying the service; According to the original deployment solution based on the natural language description, a standard deployment solution based on a computer language is generated by using a natural language processing model, wherein the standard deployment solution is based on information of the operation for deploying the service described in the computer language; According to the standard deployment scheme, generating a deployment code corresponding to the identifier of the target platform, wherein the deployment code is used to deploy the service on the target platform; The deployment code is executed to deploy the service in the target platform.
2. The method for deploying services according to claim 1, wherein: Generate standard deployment scenarios based on computer languages including: According to the original deployment plan based on the natural language description, a standard deployment plan based on computer language and its confidence level are generated by using a natural language processing model; Generating a deployment code corresponding to the identifier of the target platform according to the standard deployment solution includes: When the confidence level is less than or equal to a confidence level threshold, sending the standard deployment solution to the user; receiving the standard deployment plan adjusted by the user; A deployment code corresponding to the identifier of the target platform is generated according to the adjusted standard deployment solution.
3. The method for deploying services according to claim 1, wherein: Generating a deployment code corresponding to the identifier of the target platform includes: In a case where the original deployment plan does not include a parameter name for deploying the service, acquiring, from the target platform, a default parameter name for deploying the service and a parameter value thereof corresponding to the operation; In a case where the original deployment solution further includes a parameter name for deploying the service, acquiring a corresponding parameter value from the target platform according to the parameter name; The deployment code is generated according to the acquired parameter values and the operation information.
4. The method for deploying services according to claim 3, wherein: The parameter name is one or more, the operation is one or more, the information of each operation includes the operation identifier of the operation, the deployment code includes a deployment code snippet corresponding to each operation, and generating the deployment code according to the acquired parameter value and the operation information includes: For each operation, obtaining a template of a deployment code snippet corresponding to the operation identifier and the identifier of the target platform, wherein the template of the deployment code snippet includes at least one of the one or more parameter names; Generate a deployment code snippet corresponding to each operation according to the obtained parameter value and the obtained deployment code snippet template; Encapsulate a deployment code snippet of one or more operations to obtain the deployment code.
5. The method for deploying services according to claim 4, wherein: Generating a deployment code snippet corresponding to each operation according to the acquired parameter value and the acquired deployment code snippet template includes: For each operation, obtain the parameter name in the template of the corresponding deployment code snippet; From the obtained parameter values, filter the parameter values corresponding to the parameter names in the template of the deployment code snippet; The filtered parameter values are used to replace corresponding parameter names in the template of the deployment code snippet to obtain a deployment code snippet corresponding to each operation.
6. The method for deploying services according to claim 4, wherein: In the case where there are multiple operations, the operation information also includes the execution order of the multiple operations, and the deployment code fragments encapsulating the one or more operations are obtained to include: According to the execution order, the deployment code fragments of the multiple operations are encapsulated to obtain the deployment code.
7. The method for deploying services according to claim 4, wherein: The template for deploying the code snippet is installed in the device in the form of a plug-in.
8. The method for deploying services according to claim 3, wherein: The target platform pre-stores a correspondence between parameter names and parameter values, and obtaining corresponding parameter value information from the target platform includes: According to the corresponding relationship, the parameter value corresponding to the parameter name is obtained.
9. The method for deploying services according to claim 1, wherein: The deployment code is an executable code or a script code. When the deployment code is an executable code, directly executing the executable code; In the case where the deployment code is a script code, a deployment tool corresponding to the identifier of the target platform is called to execute the script code.
10. The method for deploying services according to claim 1, further comprising: The corresponding relationship between the solution identifier, deployment status and deployment result of the original deployment solution is stored.
11. The method for deploying services according to claim 1, further comprising: The natural language processing model is trained periodically.
12. A device for deploying a service, comprising: A receiving module is configured to receive a deployment request from a user, wherein the deployment request includes an original deployment plan based on a natural language description and an identifier of a target platform, wherein the original deployment plan is used to deploy the service, and wherein the original deployment plan is based on natural language description information for an operation of deploying the service; A first generating module is configured to generate a standard deployment scheme based on a computer language by using a natural language processing model according to the original deployment scheme based on the natural language description, wherein the standard deployment scheme is based on information of the operation for deploying the service described in the computer language; A second generating module is configured to generate a deployment code corresponding to the identifier of the target platform according to the standard deployment solution, wherein the deployment code is used to deploy the service on the target platform; The execution module is configured to execute the deployment code to deploy the service in the target platform.
13. A device for deploying a service, comprising: Memory; as well as A processor coupled to the memory, wherein the processor is configured to execute the method for deploying services according to any one of claims 1 to 11 based on instructions stored in the memory.
14. A computer storable medium having computer program instructions stored thereon, which, when executed by a processor, implements the method for deploying services as claimed in any one of claims 1 to 11.
Citation Information
Patent Citations
Software deployment method and device, computer equipment and storage medium
CN112162753A