Service deployment method and device, equipment, storage medium and program product
By obtaining and utilizing the configuration information and deployment records of the target service and redeploying services, the problem of inefficient deployment in the existing technology is solved, and deployment exceptions are quickly identified and resolved, and deployment efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411722073.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-18
AI Technical Summary
In the prior art, the deployment process of software application services is complicated and the deployment efficiency is low. Especially when deployment exceptions are deployed, the cause of failure needs to be analyzed from the deployment log and redeployed, which is time-consuming and inefficient.
By obtaining the configuration information and deployment records of the target service, when the deployment status is abnormal, the target service is redeployed based on the configuration information and deployment records, determine and execute specific deployment instructions, update the deployment records, and avoid duplicate analysis of logs and deployment from the head.
Improve deployment efficiency, reduce manual analysis and repetitive operations during deployment, enable rapid identification and resolution of deployment exceptions, and improve overall deployment speed and accuracy.
Smart Images

Figure CN119645441A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a service deployment method, apparatus, device, storage medium and program product. Background Art
[0002] As software application services become more and more integrated, scalable, and highly available, their deployment becomes more and more complex.
[0003] In the prior art, during the deployment of software application services, deployment personnel need to execute deployment commands according to deployment configuration files. When there are deployment exceptions, it is necessary to analyze the reasons for deployment failure from the deployment log and redeploy the software application service, resulting in low deployment efficiency. Summary of the invention
[0004] Based on this, it is necessary to provide a service deployment method, device, equipment, storage medium and program product that can improve deployment efficiency in response to the above technical problems.
[0005] In a first aspect, the present application provides a service deployment method, comprising:
[0006] Obtain configuration information of the target service, which includes multiple deployment instructions that need to be executed to deploy the target service on the target deployment device; obtain the deployment record of the target service, which includes the deployment status of the target service and the execution status of each deployment instruction when the target service was last deployed; when the deployment status of the target service is abnormal, redeploy the target service according to the configuration information and deployment record.
[0007] In one of the embodiments, when the deployment status of the target service is abnormal, the target service is redeployed according to the deployment instructions and deployment records, including: determining the target deployment instruction according to the deployment instructions and deployment records; sending the target deployment instruction to the target deployment device so that the target deployment device executes the target deployment instruction and redeploys the target service; receiving the deployment result of the target service on the target deployment device, and updating the deployment record according to the deployment result of the target service.
[0008] In one embodiment, a target deployment instruction is determined based on each deployment instruction and deployment record, including: for each deployment instruction, if the deployment record corresponding to the deployment instruction is empty, or the execution status of the deployment instruction is an abnormal state, the deployment instruction is determined as the target deployment instruction.
[0009] In one of the embodiments, the configuration information also includes a deployment device identifier, a deployment file of the target service, and an environment check instruction. If the target service is deployed for the first time, before obtaining the deployment record of the target service, the service deployment also includes: determining the target deployment device according to the deployment device identifier, and sending the deployment file of the target service to the target deployment device; and checking the deployment environment of the target deployment device according to the environment check instruction to determine whether the deployment environment meets the deployment requirements of the target service.
[0010] In one of the embodiments, the configuration information also includes an available check instruction, and the service deployment method further includes: after determining that the target deployment device has completed deployment of the target service, executing the available check instruction to determine whether the target service can be used normally based on the execution result of the available check instruction.
[0011] In one of the embodiments, the deployment record is also used to store the number of execution exceptions of each deployment instruction. After obtaining the deployment record of the target service, the service deployment also includes: determining the number of execution exceptions of each deployment instruction based on the deployment record; if the number of execution exceptions of any deployment instruction is greater than a preset execution threshold, or the sum of the number of execution exceptions of each deployment instruction is greater than the preset execution threshold, an alarm message is sent to the deployment personnel.
[0012] In a second aspect, the present application also provides a service deployment device, including:
[0013] A first acquisition module is used to acquire configuration information of a target service, where the configuration information is used to store multiple deployment instructions that need to be executed to deploy the target service on a target deployment device;
[0014] The second acquisition module is used to acquire the deployment record of the target service, where the deployment record is used to store the deployment status of the target service and the execution status of each deployment instruction when the target service was last deployed;
[0015] The deployment module is used to redeploy the target service according to the deployment instructions and deployment records when the deployment status of the target service is abnormal.
[0016] In one of the embodiments, the deployment module is specifically used to determine the target deployment instruction based on the various deployment instructions and deployment records; send the target deployment instruction to the target deployment device so that the target deployment device executes the target deployment instruction and redeploys the target service; receive the deployment result of the target service on the target deployment device, and update the deployment record according to the deployment result of the target service.
[0017] In one of the embodiments, the deployment module is specifically configured to determine, for each deployment instruction, if the deployment record corresponding to the deployment instruction is empty, or the execution status of the deployment instruction is an abnormal status, the deployment instruction as a target deployment instruction.
[0018] In one of the embodiments, the configuration information also includes a deployment device identifier, a deployment file of a target service, and an environment check instruction. The deployment module is further used to determine a target deployment device according to the deployment device identifier, and send the deployment file of the target service to the target deployment device; and check the deployment environment of the target deployment device according to the environment check instruction to determine whether the deployment environment meets the deployment requirements of the target service.
[0019] In one of the embodiments, the configuration information also includes an available check instruction, and the deployment module is also used to execute the available check instruction after determining that the target deployment device has completed the deployment of the target service, so as to determine whether the target service can be used normally based on the execution result of the available check instruction.
[0020] In one of the embodiments, the deployment record is also used to store the number of abnormal executions of each deployment instruction, and the second acquisition module is also used to determine the number of abnormal executions of each deployment instruction based on the deployment record; if the number of abnormal executions of any deployment instruction is greater than a preset execution threshold, or the sum of the number of abnormal executions of each deployment instruction is greater than the preset execution threshold, an alarm message is sent to the deployment personnel.
[0021] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, any of the methods described in the first aspect is implemented.
[0022] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any of the methods described in the first aspect above.
[0023] In a fifth aspect, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements any of the methods described in the first aspect above.
[0024] The above-mentioned service deployment method, apparatus, device, storage medium and program product obtain the configuration information of the target service, the configuration information includes multiple deployment instructions that need to be executed to deploy the target service on the target deployment device; obtain the deployment record of the target service, the deployment record includes the deployment status of the target service and the execution status of each deployment instruction when the target service was last deployed; when the deployment status of the target service is abnormal, the target service is redeployed according to the configuration information and deployment record. In this way, the execution status of each instruction executed during the deployment process can be stored, and when there is an abnormality in the deployment status of the target service, the specific deployment instruction that caused the deployment abnormality can be determined. When the target service is redeployed, it can also be carried out according to the deployment instructions and deployment records, without the need to analyze the deployment log and deploy from scratch, which can effectively improve the deployment efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 A schematic diagram of a process flow of a service deployment method in an embodiment;
[0027] Figure 2 A schematic diagram of a process for redeploying a target service in one embodiment;
[0028] Figure 3 A flowchart of a service deployment method in another embodiment;
[0029] Figure 4 A flowchart of a service deployment method in another embodiment;
[0030] Figure 5 A flowchart of a service deployment method in another embodiment;
[0031] Figure 6 It is a structural block diagram of a service deployment device in one embodiment;
[0032] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0034] As software application services become more and more integrated, scalable, and highly available, their deployment becomes more and more complex.
[0035] In the prior art, during the deployment of software application services, deployment personnel need to execute deployment commands according to deployment configuration files. When there are deployment exceptions, it is necessary to analyze the reasons for deployment failure from the deployment log and redeploy the software application service, resulting in low deployment efficiency.
[0036] In view of this, the present application provides a service deployment method that can improve deployment efficiency. The service deployment method provided in the embodiment of the present application, its execution subject can be a service deployment device, and the service deployment device can be implemented by software, hardware, or a combination of software and hardware. It can be embedded in or independent of the processor in the computer device in the form of hardware, or it can be stored in the memory of the computer device in the form of software. In the following method embodiments, the execution subject is a computer device as an example for explanation, wherein the computer device can be a server, or a desktop computer or a laptop computer. The embodiment of the present application does not limit the specific type of the computer device.
[0037] In an exemplary embodiment, Figure 1 As shown, a service deployment method is provided, including the following steps 101 to 103. Among them:
[0038] S101, obtaining configuration information of a target service.
[0039] The configuration information includes a plurality of deployment instructions that need to be executed to deploy the target service on the target deployment device.
[0040] Optionally, the configuration information of the target service may be stored in a file format, and the configuration information corresponding to the target service may be obtained according to an identifier of the target service.
[0041] Optionally, the target service may be a service to be deployed, for example, the target service may be a Java application or other software application service such as a database, which is not limited in the embodiments of the present application.
[0042] Optionally, the deployment device of the target service is the target deployment device, and the target deployment device may be a server or a terminal, that is, the target service may be deployed in the target deployment device through the service deployment method in the embodiment of the present application.
[0043] It can be understood that the target deployment service may be at least one device, that is, the target service may be deployed on different devices to provide services.
[0044] Optionally, the deployment instruction can be a script or command sequence written in advance by the developer, and the deployment and basic configuration of the target service are completed by executing the deployment instruction.
[0045] Optionally, the deployment instruction can be executed by the computer device where the service deployment apparatus is located, or the deployment instruction can be sent to the target deployment device and executed by the target deployment device, or it can be executed partly by the computer device and partly by the target deployment device. This embodiment of the present application is not limited to this.
[0046] S102, obtaining the deployment record of the target service.
[0047] The deployment record includes the deployment status of the target service and the execution status of each deployment instruction when the target service was last deployed.
[0048] Optionally, the deployment record may be obtained according to the identifier of the target service. The deployment record may be stored in the form of a file or may be stored in a storage module of a computer device. The storage module may be a data storage system such as a database or Redis.
[0049] Optionally, by obtaining the deployment record of the target service, the deployment status of the target service and the execution status of each deployment instruction can be determined, wherein the deployment status of the target service may include deploying, successful deployment, or failed deployment, and the execution status of the deployment instruction may include executing, successful execution, or failed execution. It can be understood that when the target service is not deployed, the deployment record of the target service is empty, and when the deployment instruction is not executed, the execution status of the deployment instruction does not exist in the deployment record.
[0050] S103: When the deployment status of the target service is abnormal, redeploy the target service according to the configuration information and the deployment record.
[0051] Optionally, the deployment status of the target service may be determined by the deployment status of the target service in the deployment record. If the deployment status of the target service is failed or the deployment status continues to be executed within a preset time period, it may be determined that the deployment status of the target service is abnormal.
[0052] Optionally, when it is determined that the deployment state continues to be executed within a preset time period, a termination instruction may be executed to end the current deployment process, and then the target service is redeployed according to the configuration information and the deployment record.
[0053] In one possible implementation, the target service is redeployed based on the configuration information and deployment records. The deployment instructions can be executed from the beginning, and before executing each deployment instruction, the status of the deployment instruction is determined based on the deployment record. When the status of the deployment instruction is successful, the deployment instruction can be skipped to execute the next deployment instruction until the deployment is completed.
[0054] In another possible implementation, the target deployment instruction may be determined according to the configuration information and the deployment record, and only the target deployment instruction needs to be executed.
[0055] The above service deployment method obtains the configuration information of the target service, the configuration information includes multiple deployment instructions that need to be executed to deploy the target service on the target deployment device; obtains the deployment record of the target service, the deployment record includes the deployment status of the target service and the execution status of each deployment instruction when the target service was last deployed; when the deployment status of the target service is abnormal, the target service is redeployed according to the configuration information and deployment record. In this way, the execution status of each instruction executed during the deployment process can be stored, and when there is an abnormality in the deployment status of the target service, the specific deployment instruction that caused the deployment abnormality can be determined. When the target service is redeployed, it can also be carried out according to the deployment instructions and deployment records, without the need to analyze the deployment log and deploy from scratch, which can effectively improve the deployment efficiency.
[0056] In an exemplary embodiment, Figure 2 As shown, optionally, when the deployment state of the target service is abnormal, the target service is redeployed according to each deployment instruction and deployment record, including the following steps 202 to 203. Among them:
[0057] S201, determining a target deployment instruction according to each deployment instruction and deployment record.
[0058] Optionally, the target deployment instruction may include at least one deployment instruction.
[0059] In one possible implementation, each deployment instruction in the target service configuration information is searched in the deployment record in turn. For each deployment instruction, if the deployment record corresponding to the deployment instruction is empty, or the execution status of the deployment instruction is abnormal, the deployment instruction is determined as the target deployment instruction.
[0060] In one possible implementation, if the deployment instructions in the target service configuration information have an execution order, they can be searched in sequence from the deployment records according to the execution order corresponding to each deployment execution. If the execution status of a certain deployment instruction is an abnormal state, the search is stopped, and the deployment instruction and other deployment instructions after the deployment instruction are used as target deployment instructions.
[0061] It is understandable that if each deployment instruction is executed in a strict execution order, when a deployment instruction is not deployed successfully, other deployment instructions after the deployment instruction have not been executed, and the corresponding deployment record is also empty.
[0062] Optionally, the execution status of the deployment instruction is an abnormal state, which may be that the execution status is failed or the execution status continues to be executed within a preset time period.
[0063] S202: Send the target deployment instruction to the target deployment device, so that the target deployment device executes the target deployment instruction and redeploys the target service.
[0064] Optionally, after determining the target deployment instruction, the target deployment instruction may be sent to the target deployment device, and when the target service is redeployed, the deployment instruction that has been successfully executed may not need to be executed again.
[0065] Optionally, after the target deployment instruction is sent to the target deployment device, the execution status of the target deployment instruction in the deployment record may be modified to being executed.
[0066] S203, receiving a deployment result of the target service on the target deployment device, and updating a deployment record according to the deployment result of the target service.
[0067] Optionally, when the target deployment device executes the target deployment instruction, a deployment result of the target service may be received, the deployment result may include the execution status of the target deployment instruction and the deployment status of the target service, and the deployment record of the target service may be updated according to the deployment result.
[0068] The above method determines the target deployment instruction according to each deployment instruction and deployment record, sends the target deployment instruction to the target deployment device, so that the target deployment device executes the target deployment instruction, redeploys the target service, and finally receives the deployment result of the target service on the target deployment device, and updates the deployment record according to the deployment result of the target service. In this way, during the process of redeployment of the target service, the successfully executed deployment instruction does not need to be executed again, and the deployment can be continued reentrantly from the point where the last deployment was interrupted, avoiding repeated execution of the deployment instruction, and improving the deployment efficiency.
[0069] In an exemplary embodiment, Figure 3 As shown, optionally, the configuration information also includes a deployment device identifier, a deployment file of the target service, and an environment check instruction. If the target service is deployed for the first time, before obtaining the deployment record of the target service, the method further includes steps 301 to 302. Among them:
[0070] S301, determining a target deployment device according to a deployment device identifier, and sending a deployment file of a target service to the target deployment device.
[0071] Optionally, the target deployment device may be determined from the configuration information according to the deployment device identifier, where the target deployment device identifier may be an Internet Protocol (IP) address, a Media Access Control (MAC) address, or other identifier that can uniquely identify a deployment device.
[0072] Optionally, if the target deployment device is different from the computer device that executes the service deployment method, it is necessary to obtain the user login name and login password of the target deployment device from the configuration information according to the deployment device identifier, and it is also necessary to determine the IP connectivity between the target deployment device and the computer device that executes the service deployment method.
[0073] Optionally, the deployment file of the target service can be an installation package of the target service. For example, taking the target service as a Java application, the deployment file of the target service can be a jar package. The deployment file can also include components required by the target service, such as an installation package for a database or redis. It can be understood that the deployment instructions include deployment instructions for components required for the target service.
[0074] S302: Check the deployment environment of the target deployment device according to the environment check instruction to determine whether the deployment environment meets the deployment requirements of the target service.
[0075] Optionally, the environment check instruction may include checking computing resources, storage resources, operating system or port occupancy of the target deployment device to determine whether the deployment environment of the target deployment device meets the deployment requirements of the deployment target service.
[0076] Exemplarily, checking the computing resources of the target deployment device may include checking the CPU and memory to avoid insufficient computing resources to support the deployment and subsequent operation of the target service.
[0077] The target deployment device is determined according to the deployment device identifier, the deployment file of the target service is sent to the target deployment device, and the deployment environment of the target deployment device is checked according to the environment check instruction to determine whether the deployment environment meets the deployment requirements of the target service. When the target service is deployed for the first time, it can be determined whether the deployment environment of the target deployment device meets the deployment requirements, abnormal problems can be discovered in time, and deployment efficiency can be improved.
[0078] In an exemplary embodiment, optionally, the configuration information further includes an available inspection instruction, and the method further includes:
[0079] After it is determined that the target deployment device has completed deployment of the target service, an availability check instruction is executed to determine whether the target service can be used normally according to the execution result of the availability check instruction.
[0080] In a possible implementation, the deployment record of the target service may be queried periodically, and the deployment status of the target service may be determined according to the deployment record of the target service. When the deployment status of the target service is successfully deployed, it is determined that the target deployment device has completed the deployment of the target service.
[0081] In another possible implementation, a deployment result of the target service on the target deployment device may be received to determine the deployment status of the target service. When the deployment status of the target service is deployment success, it is determined that the target deployment device has completed deployment of the target service.
[0082] Optionally, executing the available check instruction may be to check whether the target service is running, or to monitor the port of the target service, or to test any function of the target service.
[0083] Exemplarily, taking the target service as a Java service, the available check instruction may be an interface test command of the Java service. By executing the available check instruction to test a certain function of the Java service, it can be determined whether the target service can be used normally based on the test feedback results.
[0084] By executing the availability check instruction after determining that the target deployment device has completed the deployment of the target service, whether the target service can be used normally can be determined according to the execution result of the availability check instruction, and the availability of the target service can be checked in time after the target service is deployed.
[0085] In an exemplary embodiment, Figure 4 As shown, optionally, the deployment record is also used to store the number of execution exceptions of each deployment instruction. After obtaining the deployment record of the target service, the method further includes the following steps 401 and 402. Among them:
[0086] S401, determining the number of execution exceptions of each deployment instruction according to the deployment record.
[0087] Optionally, during the deployment process of the target service, if the execution status of the deployment instruction is abnormal, when the execution status of the deployment instruction is updated, the number of execution exceptions corresponding to the deployment instruction is increased by 1, that is, an execution exception number field is stored in the deployment record, and the execution exception number of each deployment instruction can be determined according to the identifier of each deployment instruction.
[0088] In another possible implementation, the historical deployment record of the target service can be obtained from the storage module. The historical deployment record stores the execution process of each deployment instruction during the historical deployment process of the target service. The number of execution exceptions of each deployment instruction is counted based on the historical deployment record and the previous deployment record.
[0089] S402: If the number of execution exceptions of any deployment instruction is greater than a preset execution threshold, or the sum of the number of execution exceptions of all deployment instructions is greater than the preset execution threshold, an alarm message is sent to the deployment personnel.
[0090] Optionally, the preset execution threshold may be the number of retries, and an alarm message may be sent to the deployment personnel after the deployment instruction is retried a certain number of times.
[0091] Optionally, the alarm information may include deployment instructions and reasons for deployment exceptions, so that the deployment personnel can solve the problem causing the deployment exception according to the alarm information and redeploy the target service.
[0092] Optionally, the warning information may be sent to the deployment personnel through communication warning or sound warning.
[0093] As an optional implementation, Figure 5 As shown, the service deployment method provided in the embodiment of the present application may include the following specific steps:
[0094] S501, obtaining configuration information of a target service.
[0095] The configuration information includes a plurality of deployment instructions that need to be executed to deploy the target service on the target deployment device, and also includes the deployment device identifier, the deployment file of the target service and the environment check instruction.
[0096] S502: If the target service is deployed for the first time, determine the target deployment device according to the deployment device identifier, and send the deployment file of the target service to the target deployment device.
[0097] S503: Check the deployment environment of the target deployment device according to the environment check instruction to determine whether the deployment environment meets the deployment requirements of the target service.
[0098] S504: Obtain the deployment record of the target service.
[0099] The deployment record includes the deployment status of the target service and the execution status of each deployment instruction when the target service was last deployed.
[0100] S505: Determine the number of execution exceptions of each deployment instruction according to the deployment record.
[0101] S506: If the number of execution exceptions of any deployment instruction is greater than a preset execution threshold, or the sum of the number of execution exceptions of all deployment instructions is greater than the preset execution threshold, an alarm message is sent to the deployment personnel.
[0102] S507: For each deployment instruction, if the deployment record corresponding to the deployment instruction is empty, or the execution status of the deployment instruction is an abnormal state, the deployment instruction is determined as a target deployment instruction.
[0103] S508: Send the target deployment instruction to the target deployment device, so that the target deployment device executes the target deployment instruction and redeploys the target service.
[0104] S509, receiving the deployment result of the target service on the target deployment device, and updating the deployment record according to the deployment result of the target service.
[0105] S510: After determining that the target deployment device has completed deployment of the target service, executing an available inspection instruction to determine whether the target service can be used normally according to the execution result of the available inspection instruction.
[0106] Exemplarily, taking the target service as a Java service and the target deployment devices as two servers as an example, the configuration information may include the IP addresses of the two services and the database IP address, the deployment file of the target service may include a jar package and a database installation package, the deployment instructions may include database deployment instructions, database creation instructions, deployment file transfer instructions and java service deployment scripts, the environment check commands may include server IP connectivity tests and port occupancy tests, and the available check instructions may include Java service status check instructions and java service interface test instructions.
[0107] Exemplarily, during deployment, the deployment environment of the server is checked according to the environment check instructions, and then the database deployment instructions are executed. First, it is determined based on the deployment record whether the corresponding deployment instruction has been executed. If not, the deployment record is updated and the database is deployed. After the deployment is completed, the deployment record corresponding to the deployment instruction is updated, and then the database creation instruction is executed. It is also determined based on the deployment record whether the corresponding deployment instruction has been executed. If not, the deployment record is updated and the database is created. After the deployment is completed, the deployment record corresponding to the deployment instruction is updated. Since there are two servers that need to be deployed, the subsequent deployment operation steps are divided into four steps: transferring the deployment file to the first server, executing the Java service deployment script on the first server, transferring the deployment file to the second server, and executing the Java service deployment script on the second server. The java service deployment script also includes multiple deployment instructions. Before each step starts, it will check the deployment instructions and deployment records involved in each step to confirm whether the corresponding deployment instructions have been executed. The transfer step first checks whether the file already exists. If it needs to continue, the current deployment instruction process is updated in the deployment record, and then the corresponding file transfer instruction is executed. The application deployment step checks the java service status to determine whether the deployment is successful. If it needs to continue, the current deployment status is updated to the deployment record, and then the corresponding java service deployment script is executed. Finally, the available check instruction is executed. You can first determine the status information of the java service, and then run the java service interface test command.
[0108] Optionally, after each deployment instruction is successfully executed, continuous observation and verification can be performed. For some errors that do not affect subsequent deployment, the verification can be temporarily recorded in the deployment record without interrupting the current deployment process.
[0109] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0110] Based on the same inventive concept, the embodiment of the present application also provides a service deployment device for implementing the service deployment method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more service deployment device embodiments provided below can refer to the limitations on the service deployment method above, and will not be repeated here.
[0111] In an exemplary embodiment, Figure 6 As shown, a service deployment device 600 is provided, comprising: a first acquisition module 601, a second acquisition module 602 and a deployment module 603, wherein:
[0112] The first acquisition module 601 is used to acquire configuration information of a target service, where the configuration information is used to store multiple deployment instructions that need to be executed to deploy the target service on a target deployment device.
[0113] The second acquisition module 602 is used to acquire the deployment record of the target service. The deployment record is used to store the deployment status of the target service and the execution status of each deployment instruction when the target service was last deployed.
[0114] The deployment module 603 is used to redeploy the target service according to the deployment instructions and deployment records when the deployment status of the target service is abnormal.
[0115] In an exemplary embodiment, the deployment module 603 is specifically used to determine the target deployment instruction based on various deployment instructions and deployment records; send the target deployment instruction to the target deployment device so that the target deployment device executes the target deployment instruction and redeploys the target service; receive the deployment result of the target service on the target deployment device, and update the deployment record according to the deployment result of the target service.
[0116] In an exemplary embodiment, the deployment module 603 is specifically configured to determine, for each deployment instruction, if the deployment record corresponding to the deployment instruction is empty, or the execution status of the deployment instruction is an abnormal status, the deployment instruction as a target deployment instruction.
[0117] In an exemplary embodiment, the configuration information also includes a deployment device identifier, a deployment file of the target service, and an environment check instruction. The deployment module 603 is also used to determine the target deployment device according to the deployment device identifier, and send the deployment file of the target service to the target deployment device; and check the deployment environment of the target deployment device according to the environment check instruction to determine whether the deployment environment meets the deployment requirements of the target service.
[0118] In an exemplary embodiment, the configuration information also includes an available check instruction, and the deployment module 603 is also used to execute the available check instruction after determining that the target deployment device has completed the deployment of the target service, so as to determine whether the target service can be used normally according to the execution result of the available check instruction.
[0119] In an exemplary embodiment, the deployment record is also used to store the number of abnormal executions of each deployment instruction. The second acquisition module 602 is also used to determine the number of abnormal executions of each deployment instruction based on the deployment record; if the number of abnormal executions of any deployment instruction is greater than a preset execution threshold, or the sum of the number of abnormal executions of each deployment instruction is greater than the preset execution threshold, an alarm message is sent to the deployment personnel.
[0120] Each module in the above service deployment device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0121] In an exemplary embodiment, a computer device is provided. The computer device may be a server, a desktop computer or a notebook computer. The internal structure diagram thereof may be as follows: Figure 7As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a service deployment method is implemented.
[0122] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0123] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps described in any of the above method embodiments when executing the computer program.
[0124] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps described in any of the above method embodiments are implemented.
[0125] In one embodiment, a computer program product is provided, including a computer program, which implements the steps described in any of the above method embodiments when executed by a processor.
[0126] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0127] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0128] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A service deployment method, characterized in that: The method comprises: Acquire configuration information of a target service, wherein the configuration information includes a plurality of deployment instructions required to be executed to deploy the target service on a target deployment device; Obtaining a deployment record of the target service, the deployment record including a deployment status of the target service and an execution status of each deployment instruction when the target service was last deployed; When the deployment state of the target service is abnormal, the target service is redeployed according to the configuration information and the deployment record.
2. The method according to claim 1, characterized in that: When the deployment state of the target service is abnormal, redeploying the target service according to each of the deployment instructions and the deployment record includes: Determine a target deployment instruction according to each of the deployment instructions and the deployment record; Sending the target deployment instruction to the target deployment device so that the target deployment device executes the target deployment instruction and redeploys the target service; A deployment result of the target service on the target deployment device is received, and the deployment record is updated according to the deployment result of the target service.
3. The method according to claim 2, characterized in that The determining the target deployment instruction according to each of the deployment instructions and the deployment record includes: For each of the deployment instructions, if the deployment record corresponding to the deployment instruction is empty, or the execution status of the deployment instruction is an abnormal state, the deployment instruction is determined as the target deployment instruction.
4. The method according to claim 1, characterized in that The configuration information also includes a deployment device identifier, a deployment file of the target service, and an environment check instruction. If the target service is deployed for the first time, before obtaining the deployment record of the target service, the method also includes: Determine a target deployment device according to the deployment device identifier, and send the deployment file of the target service to the target deployment device; The deployment environment of the target deployment device is checked according to the environment check instruction to determine whether the deployment environment meets the deployment requirement of the target service.
5. The method according to claim 1, characterized in that The configuration information also includes available inspection instructions, and the method further includes: After it is determined that the target deployment device has completed deployment of the target service, the availability check instruction is executed to determine whether the target service can be used normally according to the execution result of the availability check instruction.
6. The method according to claim 1, characterized in that The deployment record is also used to store the number of execution exceptions of each deployment instruction. After obtaining the deployment record of the target service, the method further includes: Determining the number of execution exceptions of each of the deployment instructions according to the deployment record; If the number of execution exceptions of any one of the deployment instructions is greater than a preset execution threshold, or the sum of the number of execution exceptions of all the deployment instructions is greater than the preset execution threshold, an alarm message is sent to the deployment personnel.
7. A service deployment device, characterized in that: The device comprises: A first acquisition module, configured to acquire configuration information of a target service, wherein the configuration information includes a plurality of deployment instructions required to be executed to deploy the target service on a target deployment device; A second acquisition module is used to acquire a deployment record of the target service, wherein the deployment record includes a deployment status of the target service and an execution status of each deployment instruction when the target service was last deployed; A deployment module is used to redeploy the target service according to the configuration information and the deployment record when the deployment state of the target service is abnormal.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.