Software deployment method and device
By generating code base interactive instructions and automatically determining target containers, the full automation of software deployment is achieved, the problem of manual intervention in the existing technology is solved, efficiency is improved and process is simplified, and the problem of inefficiency in the deployment process is solved.
Patent Information
- Application Number
- CN202411230878.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-01-03
AI Technical Summary
The existing software deployment methods still require manual intervention during the deployment process, and cannot achieve complete automation, resulting in inefficiency and complex processes.
By generating code base interaction instructions and automatically determining the target container, the software deployment system is fully automated, including obtaining basic information of the software to be deployed, generating code base interaction instructions, compiling image files, determining the target container and executing the deployment orchestration process.
Fully automated software deployment is realized, the deployment efficiency is improved, the process is simplified, the labor force is liberated, manual intervention is avoided, and the deployment is improved.
Smart Images

Figure CN119248291A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for software deployment. Background Art
[0002] When releasing and deploying software with new version functions, the existing deployment method is mainly deployed through a continuous integration and continuous delivery automated deployment platform system (CICD). During deployment, the completed software code needs to be pulled to the CICD platform system for code compilation. When the compilation is completed and the deployment phase is in progress, it is necessary to select the target container for deployment from the container list, and then deploy the software code in the selected target container.
[0003] In the process of implementing the present invention, the inventors found that the prior art has the following problems:
[0004] Although existing software deployment provides an automated framework, in actual operation, key steps still need to be performed manually, such as pulling software code and selecting target containers during the deployment process. This is essentially a semi-automated deployment solution. Although it is more efficient than manual deployment, it still requires manual intervention and cannot achieve fully automated deployment. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method and device for software deployment, which realizes fully automated software deployment. Based on the ability to generate code library interaction instructions and the ability to automatically determine the target container, the problem of manual intervention required in existing software deployment is solved, which not only improves the software deployment efficiency, but also simplifies the software deployment process and liberates labor.
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for software deployment is provided, comprising:
[0007] Get basic information about the software to be deployed;
[0008] Generate a code base interaction instruction according to the basic information, so that the software deployment system uses the code base interaction instruction to obtain the software to be deployed, so that the software deployment system compiles the software to be deployed to obtain an image file corresponding to the software to be deployed;
[0009] Obtain resource configuration information of the software to be deployed, and determine a target container for deployment based on the resource configuration information, so that the software deployment system generates a deployment orchestration process for deploying the software to be deployed in the target container and executes the deployment orchestration process based on the image file.
[0010] Optionally, based on the basic information, code library interaction instructions are generated, including: obtaining the interaction instruction format of the code library; extracting the code branch information of the software to be deployed and the version information of the software to be deployed from the basic information; based on the code branch information and the version information, combined with the interaction instruction format, generating code library interaction instructions for obtaining the software to be deployed.
[0011] Optionally, determining the target container for deployment according to the resource configuration information includes: obtaining the maximum traffic threshold of each deployment container in the deployment container cluster; determining the actual traffic of the online application corresponding to the software to be deployed according to the resource configuration information; calculating the online batch according to the actual traffic and the maximum traffic threshold of each deployment container; and selecting the target container from each deployment container according to the online batch.
[0012] Optionally, before obtaining the resource configuration information of the software to be deployed, the method further includes: generating a software deployment application form according to the basic information of the software to be deployed, sending the software deployment application form to an approval system, and receiving information indicating that the software deployment application form has been approved.
[0013] Optionally, after determining the target container for deployment, the method further includes: sending the target container to the software deployment system, so that the software deployment system generates a rollback orchestration process for the target container and executes the rollback orchestration process when an exception occurs during the execution of the deployment orchestration process.
[0014] Optionally, the method further includes: in response to receiving exception information during the compilation process or in executing the deployment orchestration process, determining a log search range according to the exception information; and accessing a log platform according to the log search range to obtain log details corresponding to the exception information.
[0015] Optionally, the acquisition of the basic information of the software to be deployed is triggered by a software deployment task, and the software deployment task comes from the result of a speech recognition processing model identifying the deployment intention of a received user voice instruction; and based on the user's feedback information on the result of the deployment intention recognition, the speech recognition processing model is iteratively optimized and trained.
[0016] Optionally, before the speech recognition processing model recognizes the deployment intention of the received user voice command, the method also includes: performing voice biometric and token authentication on the user, and determining that the authentication is passed, and obtaining the user's deployment authority; determining the target container for deployment based on the resource configuration information, including: determining the target container that matches the user's deployment authority based on the deployment authority and the resource configuration information.
[0017] According to a second aspect of an embodiment of the present invention, a system for software deployment is provided, comprising: a robot module and a software deployment system; wherein:
[0018] The robot module performs deployment intention recognition on the user voice command received about software deployment, obtains basic information of the software to be deployed according to the result of deployment intention recognition; generates code base interaction instructions according to the basic information; then obtains resource configuration information of the software to be deployed, and determines the target container for deployment according to the resource configuration information; and when the software deployment system issues abnormal information, converts the abnormal information into voice information and sends it to the user, so as to interact with the user;
[0019] The software deployment system obtains the software to be deployed according to the code library interaction instructions received from the robot module, compiles the software to be deployed, and obtains the image file corresponding to the software to be deployed; in response to receiving the target container sent by the robot module, generates a deployment orchestration process for deploying the software to be deployed in the target container, and deploys the software to be deployed based on the image file by executing the deployment orchestration process.
[0020] According to a third aspect of an embodiment of the present invention, a software deployment device is provided, including:
[0021] Information acquisition module, used to obtain basic information of the software to be deployed;
[0022] A compiling module, configured to generate a code base interaction instruction according to the basic information, so that the software deployment system uses the code base interaction instruction to obtain the software to be deployed, thereby enabling the software deployment system to compile the software to be deployed and obtain an image file corresponding to the software to be deployed;
[0023] The deployment module is used to obtain resource configuration information of the software to be deployed, and determine the target container for deployment based on the resource configuration information, so that the software deployment system generates a deployment orchestration process for deploying the software to be deployed in the target container and executes the deployment orchestration process based on the image file.
[0024] According to a fourth aspect of an embodiment of the present invention, there is provided an electronic device for software deployment, including:
[0025] one or more processors;
[0026] a storage device for storing one or more programs,
[0027] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.
[0028] According to a fifth aspect of an embodiment of the present invention, there is provided a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method provided in the first aspect of the embodiment of the present invention is implemented.
[0029] According to a sixth aspect of an embodiment of the present invention, there is provided a computer program product, including a computer program, wherein when the computer program is executed by a processor, the method provided in the first aspect of the embodiment of the present invention is implemented.
[0030] An embodiment of the invention has the following advantages or beneficial effects: by obtaining basic information of the software to be deployed; generating code base interaction instructions based on the basic information, so that the software deployment system uses the code base interaction instructions to obtain the software to be deployed, so that the software deployment system compiles the software to be deployed and obtains the image file corresponding to the software to be deployed; obtaining resource configuration information of the software to be deployed, and determining the target container for deployment based on the resource configuration information, so that the software deployment system generates a deployment orchestration process for deploying the software to be deployed in the target container and executes the deployment orchestration process based on the image file. A technical solution realizes a fully automated software deployment method, which is based on the ability to generate code base interaction instructions and the ability to automatically determine the target container, solves the problem of manual intervention in existing software deployment, not only improves the efficiency of software deployment, but also simplifies the software deployment process and liberates labor. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0032] Figure 1 is a schematic diagram of the main process of the method for software deployment according to an embodiment of the present invention;
[0033] Figure 2 is a main flow chart of a method for software deployment according to a reference embodiment of the present invention;
[0034] Figure 3 It is a detailed flowchart of a method for generating a code base interaction instruction according to an embodiment of the present invention;
[0035] Figure 4 is a detailed flowchart of a method for determining a target container according to an embodiment of the present invention;
[0036] Figure 5 It is a schematic diagram of the overall process of software deployment in an embodiment of the present invention;
[0037] Figure 6 is a schematic diagram of main modules of a device for software deployment according to an embodiment of the present invention;
[0038] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0039] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0040] It should be noted that in the technical solution of the present invention, the collection / collection, update, analysis, use, transmission, storage and other aspects of user personal information involved are in compliance with the provisions of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside of these legal uses, and are subject to supervision and management by national regulatory authorities. Necessary measures should be taken for user personal information to selectively block the use or access to personal information data to prevent illegal access to such personal information data, ensure that persons who have access to personal information data comply with the provisions of relevant laws and regulations, and ensure the security of user personal information. In addition, once these user personal information data are no longer needed, the risks should be minimized by limiting or even prohibiting data collection and / or deleting data.
[0041] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0042] Although existing software deployment provides an automated framework, in actual operation, key steps still need to be performed manually, such as pulling software code and selecting target containers during the deployment process. This is essentially a semi-automated deployment solution. Although it is more efficient than manual deployment, it still requires manual intervention and cannot achieve fully automated deployment, and cannot meet actual needs well.
[0043] In order to solve the above problems existing in the prior art, the present invention proposes a method for software deployment, which generates a code base interaction instruction according to the basic information of the software to be deployed, so that the software deployment system uses the code base interaction instruction to automatically obtain the software to be deployed, and then compiles and generates an image file; then, according to the resource configuration information of the software to be deployed, the target container is automatically determined, so that the code deployment system completes the software deployment based on the target container, thereby realizing a fully automated software deployment method. Based on the ability to generate code base interaction instructions and the ability to automatically determine the target container, the problem of manual intervention required in the existing software deployment is solved, which not only improves the software deployment efficiency, but also simplifies the software deployment process and liberates labor.
[0044] Figure 1 is a schematic diagram of the main process of the method for software deployment according to an embodiment of the present invention, such as Figure 1 As shown, the software deployment method of the embodiment of the present invention includes the following steps S101 to S103.
[0045] Step S101: Obtain basic information of the software to be deployed.
[0046] Specifically, after completing the writing of software code, the software developer will upload the completed code to a pre-allocated location in the code library, and at the same time pass basic information such as the name of the code, the library name to which the code belongs, the class name, and the version of the code into the code library, or the code library will extract the basic information of the code from the received uploaded code, so that the code library can establish a correspondence between the basic information of the software and the stored software, thereby facilitating the management and query of the stored software.
[0047] Furthermore, the code base and the software deployment system (software deployment platform) of the embodiment of the present invention are independent of each other, that is, the software code to be deployed cannot be directly obtained in the software deployment system, so the requester of software deployment will package and encapsulate the basic information of the software to be deployed in the software deployment request or software deployment task. The embodiment of the present invention designs a deployment interaction module at the interface or module of the software deployment system and the external interaction. When receiving the software deployment request, the deployment interaction module first parses the software deployment request and obtains the basic information such as the name and version of the software to be deployed.
[0048] Step S102: Generate a code base interaction instruction according to the basic information, so that the software deployment system uses the code base interaction instruction to obtain the software to be deployed, thereby enabling the software deployment system to compile the software to be deployed to obtain an image file corresponding to the software to be deployed.
[0049] Specifically, in order to realize fully automatic software deployment, the embodiment of the present invention configures the corresponding code base interaction instructions in advance and constructs a code base interaction instruction set when the basic information of the software is determined according to the development plan of the software project during the development phase of the software project. When the deployment interaction module receives a deployment request for the completed software, it searches for a code base interaction instruction that matches the basic information of the software to be deployed obtained from the deployment request from the pre-constructed code base interaction instruction set.
[0050] Furthermore, the deployment interaction module sends the found code library interaction instructions to the software deployment system. After obtaining the code library interaction instructions, the software deployment system can directly use the code library interaction instructions to access the code library. The code library then parses the interaction instructions to obtain basic information about the software, and then locates the storage location of the software based on the basic information of the software, and sends the located software code to the software deployment system, so as to achieve the purpose of the software deployment system automatically obtaining the software to be deployed from the code library.
[0051] After the software deployment system obtains the software to be deployed, it compiles the software to be deployed and checks whether the compilation result meets the expected requirements. If not, it obtains the requester information of the deployment request by interacting with the management system, and sends the compilation failure information and the reason for the failure to the requester; if it meets the requirements, the compilation is successful, and the compilation result, that is, the image file, is uploaded to the image warehouse to prepare for subsequent deployment.
[0052] Step S103: Obtain resource configuration information of the software to be deployed, and determine a target container for deployment according to the resource configuration information, so that the software deployment system generates a deployment orchestration process for deploying the software to be deployed in the target container and executes the deployment orchestration process based on the image file.
[0053] Specifically, after completing the above-mentioned code base interaction instructions and receiving the message that the compilation is passed from the software deployment system, the deployment interaction module queries the upstream and downstream calling relationships of the software to be deployed, the various types of dependent middleware information and other resource configuration information according to the basic information of the software to be deployed, and sets multiple levels of deployment container allocation thresholds according to the complexity of the upstream and downstream calling relationships and the number of dependent middlewares according to the preset deployment container allocation rules, and queries which deployment container allocation threshold the complexity of the upstream and downstream calling relationships and the number of dependent middlewares of the current software to be deployed are within. If it is at level 1, that is, it is a general software to be deployed with a low complexity of the calling relationship and a small number of dependent middlewares, then half of the containers are randomly selected from the container cluster as target containers. For example, in a container cluster consisting of 10 containers, 5 of them are selected as target containers, and the target containers are transmitted to the software deployment system.
[0054] Furthermore, the software deployment system receives the target container and generates a deployment orchestration process for deploying the software to be deployed on the target container, such as first removing the traffic of the online application corresponding to the current software to be deployed, then deploying and releasing the software to be deployed to the target container, and finally mounting and restoring the removed traffic to the online application corresponding to the deployed software. Based on the deployment orchestration process, the software is deployed. After determining that the traffic removal is complete, the software deployment system sends an update instruction to the container management system k8s. K8s pulls the image file generated by the above compilation from the image warehouse through the scheduling of the internal system, and completes the deployment and release of the software to be deployed on the target container based on the image file. After the deployment and release is completed, continue to execute the mounting traffic step in the deployment orchestration process to complete the software deployment.
[0055] According to one embodiment of the present invention, after determining the target container for deployment, the method further includes: sending the target container to the software deployment system, so that the software deployment system generates a rollback orchestration process for the target container and executes the rollback orchestration process when an exception occurs during the execution of the deployment orchestration process.
[0056] Specifically, in order to ensure the reliability of software deployment, after the deployment interaction module determines the target container, the software deployment system receives the target container for this software deployment. In addition to generating a deployment orchestration process to deploy the software to be deployed in the target container, it also generates a corresponding rollback orchestration process. The rollback orchestration process is similar to the deployment orchestration process, except that the version of the rolled back software is the previous version of the current software version to be deployed, or a specified historical version. When an exception occurs during the execution of the deployment orchestration process for the software to be deployed, the software deployment system can quickly switch to the rollback orchestration process and execute the rollback orchestration process to ensure the normal operation of the online application.
[0057] According to another embodiment of the present invention, the method further includes: in response to receiving exception information during the compilation process or in executing the deployment orchestration process, determining a log search range based on the exception information; and accessing a log platform based on the log search range to obtain log details corresponding to the exception information.
[0058] In addition, in order to further improve the overall automation of software deployment, the deployment interaction module monitors the deployment process of the software to be deployed in the software deployment system in real time, and obtains exception information when an exception occurs during the compilation process or the execution of the deployment orchestration process. According to the exception information, the log search range such as the time and exception point of the log to be searched is determined. Then, according to the log search range, the log platform is accessed, and the log records that meet the log search range are searched on the log platform, and the found log records are sent to the software deployment system, so that the software deployment requester can directly see the corresponding log details when receiving the software deployment exception message sent by the software deployment system, realizing the automation of log viewing, without manual selection and search, improving the efficiency of solving abnormal problems, and allowing R&D personnel to focus on the development and optimization of software code.
[0059] Figure 2 1 is a main flow chart of a method for software deployment according to a reference embodiment of the present invention. As another embodiment of the present invention, Figure 2 As shown, the software deployment method may include:
[0060] Step S201: Obtain basic information of the software to be deployed.
[0061] According to one embodiment of the present invention, the acquisition of the basic information of the software to be deployed is triggered by a software deployment task, and the software deployment task comes from the result of a speech recognition processing model identifying the deployment intention of a received user voice instruction; and based on the user's feedback information on the result of the deployment intention recognition, the speech recognition processing model is iteratively optimized and trained.
[0062] Specifically, in order to facilitate the deployment requester to the greatest extent, the embodiment of the present invention integrates a speech recognition processing model in the deployment interaction module to provide the requester with a more convenient voice-based fully automatic software deployment service. The specific speech recognition processing model mainly includes two parts. The first part is a large speech conversion model, which can be implemented using ChatGPT to convert the software deployment task indicated by the requester's voice into text form; the second part is a natural language processing (NLP) model, which recognizes the deployment intention of the received software deployment task in text form and obtains the basic information of the software to be deployed, such as the name and version of the software to be deployed.
[0063] It can be understood that the embodiment of the present invention adopts an intelligent speech recognition processing model to not only achieve efficient and intelligent speech recognition and intent understanding, but also has the ability to continuously iterate and update. According to the user's feedback information on the results of deployment intention recognition, the training sample set is updated, and then the updated training sample set is used to update the iterative training speech recognition processing model, so as to continuously improve the accuracy of the model's speech recognition processing and adapt to more usage scenarios.
[0064] According to another embodiment of the present invention, before the speech recognition processing model recognizes the deployment intention of the received user voice instruction, the method further includes: performing voice biometric and token authentication on the user, and determining that the authentication is passed, and obtaining the deployment authority of the user.
[0065] Specifically, in order to facilitate the security management of software deployment, the embodiment of the present invention also performs security authentication before deployment. After the voice recognition processing model receives the voice command of the deployment requesting user, the user is first authenticated. The specific identity authentication can be token authentication such as user login information, authorization, such as OAuth token authentication, or it can be authentication based on user biometrics, such as fingerprint, face, etc., or the most convenient voice biometrics (sound) authentication. Of course, preferably, the embodiment of the present invention adopts a dual authentication method of voice biometrics and token authentication to ensure safe deployment. In addition, the embodiment of the present invention also considers the deployment rights of the deployment requesting user in a fine-grained manner. Different user levels correspond to different deployment rights. After confirming that the authentication is passed, the deployment rights of the currently deployed requesting user are obtained.
[0066] The embodiment of the present invention utilizes a speech recognition processing model to realize voice automation software deployment by recognizing and understanding the voice instructions of the requesting party, and adds a deployment security mechanism to ensure the security of deployment through the dual tasks of voice biometrics and token authentication. In addition, corresponding deployment permissions are allocated to users of different levels in a fine-grained manner to achieve efficient, orderly and secure software deployment.
[0067] Step S202: Generate a code base interaction instruction according to the basic information, so that the software deployment system uses the code base interaction instruction to obtain the software to be deployed, thereby enabling the software deployment system to compile the software to be deployed to obtain an image file corresponding to the software to be deployed.
[0068] Step S203: Generate a software deployment application form based on the basic information of the software to be deployed, send the software deployment application form to the approval system, and receive information indicating that the software deployment application form has been approved.
[0069] Specifically, in the actual software deployment business, in addition to the processing of the software code itself, it also involves the approval of the deployment timing. The deployment interaction module of the embodiment of the present invention also integrates this capability. According to the basic information of the software to be deployed, a corresponding software deployment application form is generated, which contains the unique number identification code of this application, the name, version, and planned deployment time of the software, etc. The software deployment application form is then sent to the approval system, which evaluates the risk of online deployment based on the application form, gives an approval result on whether to agree to the online deployment, and sends the approval result to the software deployment system. The software deployment system can only execute the subsequent deployment process after receiving the approval information that the deployment is allowed.
[0070] Step S204: Obtain resource configuration information of the software to be deployed, and determine a target container for deployment according to the resource configuration information, so that the software deployment system generates a deployment orchestration process for deploying the software to be deployed in the target container and executes the deployment orchestration process based on the image file.
[0071] According to an embodiment of the present invention, a target container matching the deployment authority of the user is determined according to the deployment authority and the resource configuration information.
[0072] Specifically, the embodiment of the present invention uses the target container determined according to the resource configuration information as the preliminary target container when determining the target container based on the deployment authority of the user obtained during the identity authentication of the requesting user, and then checks whether the preliminary target container meets the deployment authority of the user in combination with the deployment authority of the user. For example, if the deployment authority of the user is 2 containers and the preliminary target container is 3, then one preliminary target container needs to be deleted to match the deployment authority of the user.
[0073] Regarding the ability of deploying the interaction module to generate code base interaction instructions, the embodiment of the present invention also provides a method for generating code base interaction instructions. Figure 3 Detailed flow chart of the method for generating code base interaction instructions according to an embodiment of the present invention. As another embodiment of the present invention, Figure 3 As shown, the method for generating the code library interaction instruction may include:
[0074] Step S301: Obtain the interactive instruction format of the code library.
[0075] Specifically, considering that the code library's external interaction is implemented based on an agreed communication protocol, the interaction instructions between the code library and the outside world have a fixed format. By accessing the library information of the code library, or applying for access to the library information of the code library, the interaction instruction format of the code library storing the software to be deployed is obtained. The specific interaction instruction format may include the interaction operation code and operand of the code library.
[0076] Step S302: extract the code branch information of the software to be deployed and the version information of the software to be deployed from the basic information.
[0077] Specifically, usually the code size of software code is large, and each code developer is responsible for one or several branches. Correspondingly, the deployment and release of software code updates also usually involves some of the code branches. Therefore, when issuing software deployment tasks, the code developer will attach the code branch information of the code to be deployed. The deployment interaction module extracts the code branch information of the software to be deployed and the version information of the software code corresponding to this deployment from the basic information.
[0078] Step S303: Generate a code base interaction instruction for acquiring the software to be deployed according to the code branch information and the version information in combination with the interaction instruction format.
[0079] Specifically, based on the code branch information and version information obtained through the above analysis, combined with the interactive instruction format of the code library obtained above, the code branch information and version information are combined into operands, the interactive operation code of the code library operation is queried to obtain the target operation code corresponding to the operation, the target operation code and the operand are assembled and merged to generate a code library interactive instruction for obtaining the software to be deployed.
[0080] Regarding the ability of deploying the interaction module to determine the target container, an embodiment of the present invention further provides a method for determining the target container. Figure 4 FIG. 1 is a detailed flow chart of a method for determining a target container according to an embodiment of the present invention. As another embodiment of the present invention, Figure 4 As shown, the method for determining the target container may include:
[0081] Step S401: Obtain the maximum flow threshold of each deployment container in the deployment container cluster.
[0082] Specifically, considering that the containers involved in the deployment will have an impact on online services during the deployment phase, it is necessary to transfer the traffic of the online applications corresponding to the software to be deployed to other containers. Therefore, before selecting the target container from the deployment container cluster, it is necessary to first obtain the maximum traffic threshold of each deployment container, that is, the maximum online traffic that each deployment container can withstand under normal conditions. Usually, the maximum traffic threshold of each deployment container is the same. In order to ensure accuracy, it is preferred to count the maximum traffic threshold of each deployment container.
[0083] Step S402: Determine the actual flow of the online application corresponding to the software to be deployed according to the resource configuration information.
[0084] Specifically, the resource configuration information obtained also includes the actual traffic of the current online application corresponding to the software to be deployed. It can be understood that the software to be deployed is usually an upgrade software package of a current online application. Considering that these traffic need to be removed and switched to other deployment containers during deployment, it is necessary to clarify the current actual traffic of the online application corresponding to the software to be deployed.
[0085] Step S403: Calculate the online batch according to the actual flow and the maximum flow threshold of each deployment container.
[0086] Specifically, according to the above-mentioned acquisition of the current actual traffic and the maximum traffic threshold of each deployment container, the actual traffic transfer is switched to other deployment containers, and the traffic does not exceed the maximum traffic threshold of the deployment container to which the traffic is switched. The online deployment batch of the software to be deployed to all containers in the deployment container cluster is estimated. For example, if the actual traffic of the software to be deployed is 50, and the maximum traffic threshold of each deployment container is 100, then it is estimated that the minimum number of batches is two to complete the online deployment of the software to be deployed. In the embodiment of the present invention, the minimum batch can be used as the online batch, or the minimum batch can be used as the lower limit of the online batch to determine the online batch.
[0087] Step S404: Select a target container from each of the deployed containers according to the online batch.
[0088] Specifically, according to the online batches determined above, combined with the number of deployment containers contained in the deployment container cluster, the number of target containers corresponding to each batch is determined, and then the target containers that meet the number requirements are selected from each deployment container. For example, for the two batches estimated above, for a deployment container cluster consisting of 10 deployment containers, 5 deployment containers are selected as target containers for each batch, which can be randomly selected or selected according to a certain selection rule. Then, the software deployment system generates a deployment orchestration process for each batch based on the target containers of each batch, executes the corresponding deployment orchestration process according to the agreed batches, and completes all online deployments of the software to be deployed after traversing all batches. It can be understood that under normal circumstances, the steps of the deployment orchestration process for each batch are the same, and the difference lies in the deployment container.
[0089] The embodiment of the present invention determines the target container for deployment based on the actual traffic of the online application corresponding to the software to be deployed and the maximum traffic threshold of each deployment container. The determination method is more accurate and reasonable.
[0090] Based on the above-mentioned software deployment method, an embodiment of the present invention also proposes a software deployment system, including: a robot module and a software deployment system; wherein: the robot module performs deployment intention recognition on the user voice instruction received about software deployment, and obtains basic information of the software to be deployed according to the result of the deployment intention recognition; generates code library interaction instructions according to the basic information; then obtains the resource configuration information of the software to be deployed, and determines the target container for deployment according to the resource configuration information; and when the software deployment system issues an exception message, converts the exception message into voice information and sends it to the user to interact with the user; the software deployment system obtains the software to be deployed according to the code library interaction instruction received from the robot module, and compiles the software to be deployed to obtain the image file corresponding to the software to be deployed; in response to receiving the target container sent by the robot module, generates a deployment orchestration process for deploying the software to be deployed in the target container, and deploys the software to be deployed based on the image file by executing the deployment orchestration process.
[0091] It can be understood that the embodiment of the present invention concretizes the deployment interaction module as a robot module, uses the robot module to identify and understand the software deployment tasks issued by the deployment requesting user, and replaces the actions that require interaction with the requesting user with the robot module. By using the robot module between the user side and the deployment side, full automation of software deployment is achieved, which not only improves the software deployment efficiency, but also simplifies the software deployment process and liberates labor.
[0092] Figure 5 It is a schematic diagram of the overall process of software deployment in an embodiment of the present invention. The deployment requester (user) sends a software deployment task in the form of voice to the robot module. The voice conversion model in the robot module, such as ChatGPT, converts the voice instructions into text form, and submits it to the natural language processing (NLP) model for deployment intention recognition to obtain the basic information of the software to be deployed, and then generates a code base interaction instruction based on the basic information of the software to be deployed, and sends the code base interaction instruction to the software deployment system. The software deployment system uses the code base interaction instruction to obtain the software to be deployed from the code base, compiles the software to be deployed, obtains the image file corresponding to the software to be deployed, and stores the image file in the image warehouse. The robot module determines the target container for deployment based on the resource configuration information of the software to be deployed, and sends the determined target container to the software deployment system. The software deployment system generates a deployment orchestration process based on the target container, pulls the image file from the image warehouse through the container management system k8s according to the deployment orchestration process to perform software deployment, and finally returns the deployment result to the output end of the robot module that directly interacts with the user step by step, so that the robot module informs the deployment requester (user) of the deployment result.
[0093] In summary, the software deployment method provided by the embodiment of the present invention realizes fully automated software deployment, from automatic security authentication, automatic acquisition of the code to be deployed, automatic generation and approval of deployment applications, automatic determination of the target container for deployment, to the final automatic query of exception logs, achieving truly automated deployment, which not only improves the software deployment efficiency, but also simplifies the software deployment process and liberates labor.
[0094] Figure 6 Schematic diagram of the main modules of the device for software deployment according to an embodiment of the present invention. Figure 6 As shown, the software deployment device 600 mainly includes an information acquisition module 601 , a compilation module 602 and a deployment module 603 .
[0095] Information acquisition module 601, used to acquire basic information of the software to be deployed;
[0096] A compiling module 602 is used to generate a code base interaction instruction according to the basic information, so that the software deployment system uses the code base interaction instruction to obtain the software to be deployed, so that the software deployment system compiles the software to be deployed to obtain an image file corresponding to the software to be deployed;
[0097] The deployment module 603 is used to obtain the resource configuration information of the software to be deployed, and determine the target container for deployment based on the resource configuration information, so that the software deployment system generates a deployment orchestration process for deploying the software to be deployed in the target container and executes the deployment orchestration process based on the image file.
[0098] According to one embodiment of the present invention, the compilation module 602 is also used to: obtain the interactive instruction format of the code library; extract the code branch information of the software to be deployed and the version information of the software to be deployed from the basic information; and generate code library interactive instructions for obtaining the software to be deployed based on the code branch information and the version information in combination with the interactive instruction format.
[0099] According to another embodiment of the present invention, the deployment module 603 is further used to: obtain the maximum traffic threshold of each deployment container in the deployment container cluster; determine the actual traffic of the online application corresponding to the software to be deployed according to the resource configuration information; calculate the online batch according to the actual traffic and the maximum traffic threshold of each deployment container; and select the target container from each deployment container according to the online batch.
[0100] According to another embodiment of the present invention, the software deployment device 600 also includes an application module (not shown in the figure), which is used to: before obtaining the resource configuration information of the software to be deployed, generate a software deployment application form according to the basic information of the software to be deployed, send the software deployment application form to the approval system, and receive information that the software deployment application form is approved.
[0101] According to another embodiment of the present invention, the software deployment device 600 further includes a rollback module (not shown in the figure), which is used to: after determining the target container for deployment, send the target container to the software deployment system, so that the software deployment system generates a rollback orchestration process for the target container and executes the rollback orchestration process when an exception occurs during the execution of the deployment orchestration process.
[0102] According to another embodiment of the present invention, the software deployment device 600 also includes a log search module (not shown in the figure), which is used to: in response to receiving exception information during the compilation process or executing the deployment orchestration process, determine the log search range according to the exception information; according to the log search range, access the log platform to obtain log details corresponding to the exception information.
[0103] According to another embodiment of the present invention, the acquisition of the basic information of the software to be deployed is triggered by a software deployment task, and the software deployment task comes from the result of a speech recognition processing model identifying the deployment intention of a received user voice instruction; and based on the user's feedback information on the result of the deployment intention recognition, the speech recognition processing model is iteratively optimized and trained.
[0104] According to another embodiment of the present invention, the software deployment device 600 also includes a security deployment module (not shown in the figure), which is used to: before the speech recognition processing model recognizes the deployment intention of the received user voice command, perform voice biometric and token authentication on the user, and determine that the authentication is passed, and obtain the deployment permission of the user; the deployment module 603 is also used to: determine the target container that matches the deployment permission of the user based on the deployment permission and the resource configuration information.
[0105] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention can be applied.
[0106] like Figure 7As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0107] Users can use terminal devices 701, 702, 703 to interact with server 705 through network 704 to receive or send messages, etc. Various communication client applications, such as software deployment applications, etc., can be installed on terminal devices 701, 702, 703 (only as an example).
[0108] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0109] Server 705 may be a server that provides various services, such as a background management server (only an example) that supports software deployment performed by users using terminal devices 701, 702, and 703. The background management server may obtain basic information of the software to be deployed; generate code base interaction instructions based on the basic information, so that the software deployment system uses the code base interaction instructions to obtain the software to be deployed, so that the software deployment system compiles the software to be deployed and obtains the image file corresponding to the software to be deployed; obtain resource configuration information of the software to be deployed, and determine the target container for deployment based on the resource configuration information, so that the software deployment system generates a deployment orchestration process for deploying the software to be deployed in the target container and executes the deployment orchestration process based on the image file and other processing, and feeds back the processing results (such as deployment results, etc. - only an example) to the terminal device.
[0110] It should be noted that the software deployment method provided in the embodiment of the present invention is generally executed by the server 705 , and accordingly, the software deployment device is generally set in the server 705 .
[0111] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0112] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 8 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0113] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0114] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0115] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.
[0116] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination thereof.
[0117] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0118] The units involved in the embodiments of the present invention may be implemented in software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes: an information acquisition module, a compilation module and a deployment module.
[0119] The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the information acquisition module may also be described as a “module for acquiring basic information of the software to be deployed”.
[0120] On the other hand, the present invention also provides a computer-readable medium, which may be included in the device described in the embodiment; or it may exist independently without being assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by a device, the device includes: obtaining basic information of the software to be deployed; generating code base interaction instructions based on the basic information, so that the software deployment system uses the code base interaction instructions to obtain the software to be deployed, so that the software deployment system compiles the software to be deployed and obtains the image file corresponding to the software to be deployed; obtaining resource configuration information of the software to be deployed, and determining the target container for deployment based on the resource configuration information, so that the software deployment system generates a deployment orchestration process for deploying the software to be deployed in the target container and executes the deployment orchestration process based on the image file.
[0121] The technical solution according to the embodiment of the present invention has the following advantages or beneficial effects: by obtaining the basic information of the software to be deployed; generating a code base interaction instruction based on the basic information, so that the software deployment system uses the code base interaction instruction to obtain the software to be deployed, so that the software deployment system compiles the software to be deployed and obtains the image file corresponding to the software to be deployed; obtaining the resource configuration information of the software to be deployed, and determining the target container for deployment based on the resource configuration information, so that the software deployment system generates a deployment orchestration process for deploying the software to be deployed in the target container and executes the deployment orchestration process based on the image file. The technical solution realizes a fully automated software deployment method. Based on the ability to generate code base interaction instructions and the ability to automatically determine the target container, the problem of manual intervention required in the existing software deployment is solved, which not only improves the software deployment efficiency, but also simplifies the software deployment process and liberates labor.
[0122] The specific implementation methods described herein do not constitute limitations on the scope of protection of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.
Claims
1. A method for software deployment, characterized in that: include: Get basic information about the software to be deployed; Generate a code base interaction instruction according to the basic information, so that the software deployment system uses the code base interaction instruction to obtain the software to be deployed, so that the software deployment system compiles the software to be deployed to obtain an image file corresponding to the software to be deployed; Obtain resource configuration information of the software to be deployed, and determine a target container for deployment based on the resource configuration information, so that the software deployment system generates a deployment orchestration process for deploying the software to be deployed in the target container and executes the deployment orchestration process based on the image file.
2. The method according to claim 1, characterized in that Generate code base interaction instructions based on the basic information, including: Obtaining an interactive instruction format of the code library; Extracting the code branch information of the software to be deployed and the version information of the software to be deployed from the basic information; According to the code branch information and the version information, in combination with the interactive instruction format, a code base interactive instruction for obtaining the software to be deployed is generated.
3. The method according to claim 1, characterized in that Determining a target container for deployment according to the resource configuration information includes: Get the maximum flow threshold of each deployment container in the deployment container cluster; Determine the actual flow of the online application corresponding to the software to be deployed according to the resource configuration information; Calculate an online batch according to the actual flow and the maximum flow threshold of each deployment container; According to the online batch, a target container is selected from each of the deployed containers.
4. The method according to claim 1, characterized in that Before obtaining the resource configuration information of the software to be deployed, the method further includes: A software deployment application form is generated according to the basic information of the software to be deployed, the software deployment application form is sent to an approval system, and information indicating that the software deployment application form has been approved is received.
5. The method according to claim 1, characterized in that After determining the target container for deployment, the method further includes: The target container is sent to the software deployment system, so that the software deployment system generates a rollback orchestration process for the target container and executes the rollback orchestration process when an exception occurs during the execution of the deployment orchestration process.
6. The method according to claim 1, characterized in that The method further comprises: In response to receiving exception information during the compilation process or in executing the deployment orchestration process, determining a log search range according to the exception information; According to the log search scope, access the log platform to obtain the log details corresponding to the abnormal information.
7. The method according to claim 1, characterized in that The acquisition of the basic information of the software to be deployed is triggered by a software deployment task, and the software deployment task comes from the result of the speech recognition processing model performing deployment intention recognition on the received user voice instructions; and based on the user's feedback information on the result of the deployment intention recognition, the speech recognition processing model is iteratively optimized and trained.
8. The method according to claim 7, characterized in that Before the speech recognition processing model performs deployment intention recognition on the received user speech instruction, the method further includes: Perform voice biometric and token authentication on the user, determine if the authentication is successful, and obtain the deployment authority of the user; Determining a target container for deployment according to the resource configuration information includes: A target container matching the deployment permission of the user is determined according to the deployment permission and the resource configuration information.
9. A system for software deployment, characterized in that: include: A robot module and software deployment system; wherein: The robot module performs deployment intention recognition on the user voice command received about software deployment, obtains basic information of the software to be deployed according to the result of deployment intention recognition; generates code base interaction instructions according to the basic information; then obtains resource configuration information of the software to be deployed, and determines the target container for deployment according to the resource configuration information; When the software deployment system issues an abnormal message, the abnormal message is converted into a voice message and sent to the user to interact with the user; The software deployment system obtains the software to be deployed according to the code library interaction instructions received from the robot module, compiles the software to be deployed, and obtains the image file corresponding to the software to be deployed; in response to receiving the target container sent by the robot module, generates a deployment orchestration process for deploying the software to be deployed in the target container, and deploys the software to be deployed based on the image file by executing the deployment orchestration process.
10. A software deployment device, characterized in that: include: Information acquisition module, used to obtain basic information of the software to be deployed; A compiling module, configured to generate a code base interaction instruction according to the basic information, so that the software deployment system uses the code base interaction instruction to obtain the software to be deployed, thereby enabling the software deployment system to compile the software to be deployed and obtain an image file corresponding to the software to be deployed; The deployment module is used to obtain resource configuration information of the software to be deployed, and determine the target container for deployment based on the resource configuration information, so that the software deployment system generates a deployment orchestration process for deploying the software to be deployed in the target container and executes the deployment orchestration process based on the image file.
11. A mobile electronic device terminal, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
12. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Open source software network fingerprint generation method and system, electronic equipment and storage medium
CN119622644A
Low-code application platform supporting containerized deployment
CN119690595A