CN111258591A - Program deployment task execution method and device, computer equipment and storage medium - Google Patents

Program deployment task execution method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111258591A
CN111258591A CN202010037244.2A CN202010037244A CN111258591A CN 111258591 A CN111258591 A CN 111258591A CN 202010037244 A CN202010037244 A CN 202010037244A CN 111258591 A CN111258591 A CN 111258591A
Authority
CN
China
Prior art keywords
deployment
task
result
program
flow
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010037244.2A
Other languages
Chinese (zh)
Other versions
CN111258591B (en
Inventor
刘舟
李奕臻
朱育华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Jisheng Network Technology Co Ltd
Original Assignee
Guangzhou Jisheng Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Jisheng Network Technology Co Ltd filed Critical Guangzhou Jisheng Network Technology Co Ltd
Priority to CN202010037244.2A priority Critical patent/CN111258591B/en
Publication of CN111258591A publication Critical patent/CN111258591A/en
Application granted granted Critical
Publication of CN111258591B publication Critical patent/CN111258591B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present application relates to the technical field of computer program deployment, and in particular, to a method and an apparatus for executing a program deployment task, a computer device, and a storage medium. The method comprises the following steps: responding to a program deployment instruction issued by a user, and determining a task to be deployed related to the program deployment instruction; acquiring deployment task description data of a task to be deployed; analyzing the deployment task description data to obtain an analysis result, wherein the analysis result comprises N deployment processes and the operation sequence of each deployment process, and N is a positive integer; running each deployment flow according to the running sequence of each deployment flow to obtain the running results of N deployment flows; and determining a program deployment result of the task to be deployed according to the operation results of the N deployment processes. According to the method and the device, the coupling degree of the program deployment task can be reduced, so that the whole deployment task cannot fail even if a certain deployment flow fails in the deployment process, and the deployment success rate of the program deployment task is improved.

Description

Program deployment task execution method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer program deployment technologies, and in particular, to a method and an apparatus for executing a program deployment task, a computer device, and a storage medium.
Background
At present, when a program is deployed on a server, the program can be deployed manually by operation and maintenance personnel, and the program can also be deployed by customizing an automatic deployment script.
Although the method of deploying programs by operation and maintenance personnel is flexible and has a high deployment success rate, the operation of program deployment is complex, the speed of manual deployment is slow, and when the number of servers and/or programs to be deployed is large, more operation and maintenance personnel need to be arranged to execute the deployment task, or more time needs to be invested to execute the deployment task, so that the deployment efficiency is low.
The speed of deploying the program by the customized automatic deployment script is much faster than that of manual work, however, the automatic deployment script is relatively stiff when deploying the program at present, and if a certain deployment link fails in the deployment process (for example, if the execution fails because the network problem exceeds the response time), the whole deployment task fails because the automatic deployment script cannot be flexibly adjusted like manual work, so that the deployment success rate of the program deployment task is not high.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a program deployment task execution method, a device, computer equipment and a storage medium.
The invention provides a program deployment task execution method according to a first aspect, which in one embodiment comprises the following steps:
responding to a program deployment instruction issued by a user, and determining a task to be deployed related to the program deployment instruction;
acquiring deployment task description data of a task to be deployed;
analyzing the deployment task description data to obtain an analysis result, wherein the analysis result comprises N deployment processes and the operation sequence of each deployment process, and N is a positive integer;
running each deployment flow according to the running sequence of each deployment flow to obtain the running results of N deployment flows;
and determining a program deployment result of the task to be deployed according to the operation results of the N deployment processes.
In one embodiment, running each deployment flow according to its running order includes:
after each deployment flow is operated according to the operation sequence of each deployment flow, the operation result of each deployment flow is obtained;
judging whether the operation result of each deployment flow is a preset operation result or not;
and if the operation result of each deployment flow is not the preset operation result, determining the deployment flow of the next operation sequence corresponding to each deployment flow, and operating the deployment flow of the next operation sequence.
In one embodiment, further comprising:
and if the operation result of each deployment flow is a preset operation result, determining that the program deployment result of the task to be deployed is a program deployment failure, and stopping running the deployment flow of the next operation sequence.
In one embodiment, running each deployment flow according to its running order includes:
judging whether the flow type corresponding to the currently running deployment flow is a custom script type;
if the flow type is the self-defined script type, extracting an execution script in the currently running deployment flow;
performing security inspection on the execution script to obtain an inspection result of the execution script;
and if the detection result is normal, continuing to operate the currently operated deployment process.
In one embodiment, performing a security check on the execution script to obtain a check result includes:
performing grammatical and lexical analysis on the execution script to obtain a plurality of script commands;
matching each script command with a plurality of preset script commands in a preset command library to obtain a matching result of each script command;
if the matching result of any script command in the plurality of script commands is a preset matching result, determining the detection result of the executed script as abnormal detection;
and if the matching result of any script command does not exist in the plurality of script commands is a preset matching result, determining that the test result of the executed script is normal.
In one embodiment, further comprising:
if the detection result is abnormal, determining that the operation result of the currently operated deployment process is operation failure;
sending preset alarm information to all alarm target users on a preset alarm list;
and generating a script inspection abnormal audit log according to the execution script, and storing the inspection abnormal audit log into a preset audit database.
In one embodiment, determining a program deployment result of a task to be deployed according to the running results of the N deployment processes includes:
determining that the running result is the quantity threshold of the successfully-run deployment flows in the N deployment flows, and if the quantity threshold exceeds a preset successful quantity threshold, determining that the program deployment result of the task to be deployed is the program deployment success; or the like, or, alternatively,
and determining a core deployment process identifier corresponding to the task to be deployed, and if the operation result of the deployment process corresponding to the core deployment process identifier is successful in the N deployment processes, determining the program deployment result of the task to be deployed as the program deployment success.
The present invention provides a program deployment task execution device according to a second aspect, which in one embodiment comprises:
the task determining module is used for responding to a program deployment instruction issued by a user and determining a task to be deployed related to the program deployment instruction;
the description data acquisition module is used for acquiring the deployment task description data of the task to be deployed;
the description data analysis module is used for analyzing the deployment task description data to obtain an analysis result, the analysis result comprises N deployment processes and the operation sequence of each deployment process, and N is a positive integer;
the deployment process operation module is used for operating each deployment process according to the operation sequence of each deployment process to obtain the operation results of the N deployment processes;
and the deployment result determining module is used for determining the program deployment result of the task to be deployed according to the operation results of the N deployment processes.
The present invention provides according to a third aspect a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of an embodiment of any of the methods described above when executing the computer program.
The present invention provides according to a fourth aspect a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the embodiments of the method of any one of the above.
In the embodiment of the invention, a deployment server responds to a program deployment instruction issued by a user and determines a task to be deployed related to the program deployment instruction; then acquiring deployment task description data of the task to be deployed, and analyzing the deployment task description data to obtain an analysis result, wherein the analysis result comprises N deployment processes and the running sequence of each deployment process; then, running each deployment flow according to the running sequence of each deployment flow to obtain the running results of the N deployment flows; finally, the program deployment result of the task to be deployed is determined according to the running results of the N deployment processes, the program deployment task is divided into the multiple deployment processes, the coupling degree of the program deployment task is reduced, the whole deployment task cannot fail even if a certain deployment process fails in the deployment process, and the deployment success rate of the program deployment task is improved.
Drawings
FIG. 1 is a flowchart illustrating a method for executing a program deployment task according to an embodiment;
FIG. 2 is a flowchart illustrating steps in a deployment server running various deployment flows in one embodiment;
FIG. 3 is a flowchart illustrating steps of a deployment server running various deployment procedures in another embodiment;
FIG. 4 is a block diagram of an embodiment of a task execution device for program deployment;
FIG. 5 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Fig. 1 shows a method for executing a program deployment task according to an embodiment of the present invention, and a deployment server for executing the program deployment task according to the method is taken as an example, where the deployment server may be implemented by an independent server or a server cluster composed of multiple servers. The method comprises the following steps:
s110: and responding to a program deployment instruction issued by a user, and determining a task to be deployed related to the program deployment instruction.
In this embodiment, when a user (e.g., an operation and maintenance person, a server manager, a developer, etc.) wants to deploy a program (which may also be some programs) to a certain server (which may also be some servers), that is, a program to be deployed, a program deployment instruction may be issued to the deployment server, and the deployment server automatically executes a program deployment task in response to the program deployment instruction.
Certainly, when a user wants to deploy the program to be deployed, the user needs to configure a program deployment task corresponding to the program to be deployed before issuing a program deployment instruction. It should be noted that, a developer summarizes the program deployment processes of various types of programs in advance to obtain a plurality of large-scale program deployment processes, divides the various types of program deployment processes into a plurality of relatively independent deployment processes, and writes each deployment process and a plurality of deployment task configuration templates of different types in advance, where the deployment processes and the deployment task configuration templates may be stored in a database. The user may access a web page provided by the deployment server through which the configuration of the program deployment task is performed. Specifically, a user selects a corresponding deployment task configuration template on the web page, the deployment task configuration template is composed of a plurality of deployment processes, and the configuration of the program deployment task can be completed after the user configures configuration items of each deployment process.
Different deployment processes have different functions, for example, some deployment processes are used for executing a common script configured by a user, some deployment processes are used for interfacing with a to-be-deployed server that needs to deploy the to-be-deployed program, such as a local server, an online cloud platform (e.g., an ari cloud, an enterprise private cloud), and the like, and some deployment processes are used for downloading the to-be-deployed program from an internal network or a public network.
S120: acquiring deployment task description data of a task to be deployed.
In this embodiment, after determining the task to be deployed associated with the program deployment instruction, the deployment server obtains deployment task description data of the task to be deployed. Specifically, the deployment server obtains user configuration data and deployment task configuration template metadata corresponding to the task to be deployed, and then assembles the user configuration data and the deployment task configuration template metadata to obtain deployment task description data of the task to be deployed.
After the user configures the configuration items of each deployment process on the web page, the deployment server records the relevant information configured for each configuration item by the user into the database, where the user configuration data refers to the relevant information configured for each configuration item by the user on the web page, such as a task identifier corresponding to a task to be deployed, a program identifier to be deployed, a server identifier to be deployed, and the like.
S130: and analyzing the deployment task description data to obtain an analysis result, wherein the analysis result comprises N deployment processes and the operation sequence of each deployment process, and N is a positive integer.
In this embodiment, after obtaining the deployment task description data, the deployment server analyzes the deployment task description data using an analyzer, and an analysis result obtained by the analysis includes N deployment flows and an operation sequence of each deployment flow.
For example, the analysis result obtains 4 deployment flows, which are respectively a flow a, a flow B, a flow C and a flow D, where the operation sequence of the flow a is a first sequence, the operation sequences of the flow B and the flow C are all a second sequence, and the operation sequence of the flow D is a third sequence, so that during operation, the deployment server operates the flow a belonging to the first operation sequence first, and then operates the flow B and the flow C belonging to the second sequence simultaneously or parallelly after the flow a is operated, and then operates the flow D of the third sequence after the flow B and the flow C are both operated.
It can be understood that some deployment flows include several deployment steps, and at this time, each deployment step also has a corresponding operation sequence, and different deployment steps may also belong to one operation sequence.
S140: and running each deployment flow according to the running sequence of each deployment flow to obtain the running results of the N deployment flows.
S150: and determining a program deployment result of the task to be deployed according to the operation results of the N deployment processes.
In this embodiment, the deployment server runs each deployment flow according to the running sequence, so as to obtain the running result of each deployment flow. And then determining a program deployment result of the task to be deployed according to the obtained deployment flow. Because each deployment flow is relatively independent, in the deployment flows, even if part of the N deployment flows fail to run successfully, the whole deployment flow does not need to be stopped, and the program deployment result of the current specified task to be deployed can be determined according to the running result of each deployment flow after all the deployment flows are run.
In one embodiment, the step of determining, by the deployment server, the program deployment result of the task to be deployed according to the operation results of the N deployment processes specifically includes:
determining that the running result is the quantity threshold of the successfully-run deployment flows in the N deployment flows, and if the quantity threshold exceeds a preset successful quantity threshold, determining that the program deployment result of the task to be deployed is the program deployment success; or the like, or, alternatively,
and determining a core deployment process identifier corresponding to the task to be deployed, and if the operation result of the deployment process corresponding to the core deployment process identifier is successful in the N deployment processes, determining the program deployment result of the task to be deployed as the program deployment success.
In the present embodiment, the operation result includes operation success and operation failure.
In an application scenario, the manner of determining the program deployment result of the task to be deployed by the deployment server is as follows: firstly, determining the quantity threshold of the deployment processes which are successfully operated in the operation results of all the deployment processes of the task to be deployed, and if the quantity threshold exceeds the preset successful quantity threshold, determining the program deployment result of the task to be deployed as the program deployment success; otherwise, if the number threshold does not exceed the preset successful number threshold, determining that the program deployment result of the task to be deployed is a program deployment failure.
In another application scenario, because the deployment flows are independent, a user can configure the deployment flows of a plurality of cores when configuring a program deployment task, the successful operation of the deployment flow of the core can meet the basic deployment requirement of the user, and a plurality of non-core deployment flows can be deployed on the basis of the deployment flow of the core, and the user can subsequently re-deploy the non-core deployment flows even if the operation of the non-core deployment flows fails. Therefore, in the application scenario, the manner of determining the program deployment result of the task to be deployed by the deployment server is as follows: the core deployment process identifier corresponding to the task to be deployed is determined, and as can be understood, the core deployment process identifier refers to a unique identifier corresponding to the core deployment process. The core deployment process refers to a deployment process which must be successfully operated in the task to be deployed. It should be noted that the core deployment flow identifier includes 1 or more core flow identifiers (the number of the core flow identifiers may be different in different scenarios), and each core flow identifier corresponds to one deployment flow, that is, the core deployment flow identifier corresponds to 1 or more deployment flows. If the operation results of all the deployment processes corresponding to the core deployment process identification are successful, determining that the program deployment result of the task to be deployed is successful in program deployment; otherwise, if the running result of any one deployment flow is running failure in all the deployment flows corresponding to the core deployment flow identification, determining that the program deployment result of the task to be deployed is the program deployment failure.
Furthermore, a user can configure a plurality of deployment processes of the same type belonging to the same operation sequence, so that the successful operation of the deployment processes can be determined as long as any one of the plurality of parallel deployment processes is successfully operated, and the success rate of program deployment can be improved.
According to the embodiment of the invention, the program deployment task is divided into a plurality of deployment processes, so that the coupling degree of the program deployment task is reduced, the failure of the whole deployment task can not be caused even if a certain deployment process is failed in the deployment process, and the deployment success rate of the program deployment task is improved.
In an embodiment, as shown in fig. 2, the step of the deployment server running each deployment flow according to the running sequence of each deployment flow specifically includes:
s210: and after each deployment flow is operated according to the operation sequence of each deployment flow, the operation result of each deployment flow is obtained.
S220: and judging whether the operation result of each deployment flow is a preset operation result.
S230: and if the operation result of each deployment flow is not the preset operation result, determining the deployment flow of the next operation sequence corresponding to each deployment flow, and operating the deployment flow of the next operation sequence.
In this embodiment, it is considered that some serious problems may occur during the program deployment process, for example, the running schedule of the deployment process is blocked due to a problem existing in the script of the deployment process itself and left during development, and if the deployment process continues to wait for execution, it is likely that computing resources are occupied for a long time, which affects the execution of other program deployment tasks. Therefore, when each (i.e. any) deployment flow is executed, the deployment server periodically obtains the operation information of the currently running deployment flow (it can be understood that if one operation sequence corresponds to X (positive integer) deployment flows, then the currently running deployment flows are also X deployment flows), including the information of the operation log data generated at the time of running, the running time length, the running state (including running completion or running), and the like, and then determines the operation result of the deployment flow according to the operation information of the deployment flow.
In one embodiment, the operation result of the deployment flow includes operation success, operation failure, and operation exception. And if the operation state in the operation information of the deployment process is determined to be operation completion, determining that the operation result of the deployment process is operation success. If the operation state in the operation information of the deployment process is determined to be in operation, determining an operation time length threshold value in the operation information of the deployment process, and if the operation time length threshold value does not exceed a preset operation time length threshold value corresponding to the deployment process, determining that the operation result of the deployment process is operation failure; and if the running time length threshold exceeds a preset running time length threshold corresponding to the deployment process, determining that the running result of the deployment process is abnormal in running.
The preset operation result is abnormal operation. The deployment server judges whether the operation result of the deployment flow is abnormal after determining the operation result of the deployment flow, if the operation result of the deployment flow is determined to be successful or failed, the deployment flow of the next operation sequence corresponding to the deployment flow is determined, and the deployment flow of the next operation sequence is operated; and if the operation result of the deployment flow is determined to be abnormal operation, determining that the program deployment result of the task to be deployed is program deployment failure, and stopping running the deployment flow of the next operation sequence, namely not continuing to execute the rest un-run deployment flows.
In an embodiment, as shown in fig. 3, the step of the deployment server running each deployment flow according to the running sequence of each deployment flow specifically includes:
s310: and judging whether the flow type corresponding to the currently running deployment flow is the custom script type.
S320: and if the flow type is the self-defined script type, extracting the execution script in the currently running deployment flow.
S330: and carrying out security inspection on the execution script to obtain an inspection result of the execution script.
S340: and if the detection result is normal, continuing to operate the currently operated deployment process.
In this embodiment, some deployment processes may need to execute some scripts written by users, and in order to ensure the security of the server to be deployed, security verification needs to be performed on the scripts written by the users themselves, so as to ensure that the custom scripts do not contain dangerous commands. Specifically, when each deployment flow is run by the deployment server, the flow type of the currently running deployment flow is determined, and if the flow type corresponding to the currently running deployment flow is the custom script type, an execution script (i.e., the script written by the user) is extracted from the currently running deployment flow, and the execution script is subjected to security check. If the verification result is determined to be normal, the deployment server continues to run the currently running deployment process; if the verification result is determined to be abnormal, the deployment server determines that the operation result of the currently operated deployment process is operation failure, then sends preset alarm information to all alarm target users on a preset alarm list, generates a script abnormal audit log according to the execution script, and stores the abnormal audit log to a preset audit database. The script inspection abnormal audit log can comprise running time of an execution script, all script commands and limiting script commands of the running, task identification to be deployed, deployment flow identification, information indicating users who deploy tasks to be deployed and IP addresses of the users, and the like, so that specific conditions can be quickly determined according to the inspection abnormal audit log.
The step of performing security check on the execution script by the deployment server to obtain a check result specifically includes:
performing grammatical and lexical analysis on the execution script to obtain a plurality of script commands;
matching each script command with a plurality of preset script commands in a preset command library to obtain a matching result of each script command;
if the matching result of any script command in the plurality of script commands is a preset matching result, determining that the detection result of the executed script is abnormal;
and if the matching result of any script command does not exist in the plurality of script commands is the preset matching result, determining that the test result of the executed script is normal.
In one application scenario, the execution script belongs to Linux commands (Linux is an operating system supporting multi-user, multi-task, multi-thread, and multi-CPU). And performing grammatical and lexical analysis on the execution script to obtain a plurality of script commands, and then matching each script command with a plurality of preset script commands in a preset command library to obtain a matching result of each script command. It should be noted that, in different scenarios, the types of the preset script commands included in the preset command library are different, for example, if the deployment server only allows the user to execute the preset secure script commands and the number of the preset secure script commands is small, the preset script commands in the preset command library may refer to the secure script commands that the user is allowed to execute, or the preset script commands in the preset command library may refer to the limited script commands that the user is not allowed to execute if the number of the secure script commands that the user is allowed to execute is large and the number of the limited script commands that the user is not allowed to execute is small.
If one limiting script command exists in a plurality of script commands corresponding to the deployment process, determining that the detection result of the executed script is abnormal; if the script commands corresponding to the deployment process are all safe script commands, the verification result of the executed script is determined to be normal.
In one embodiment, as shown in fig. 4, there is provided a program deployment task execution device, including the following modules:
the task determining module 110 is configured to determine, in response to a program deployment instruction issued by a user, a task to be deployed that is associated with the program deployment instruction;
a description data obtaining module 120, configured to obtain deployment task description data of a task to be deployed;
the description data analysis module 130 is configured to analyze the description data of the deployed tasks to obtain an analysis result, where the analysis result includes N deployment processes and an operation sequence of each deployment process, and N is a positive integer;
a deployment process running module 140, configured to run each deployment process according to the running sequence of each deployment process, so as to obtain running results of the N deployment processes;
and the deployment result determining module 150 is configured to determine a program deployment result of the task to be deployed according to the operation results of the N deployment processes.
In one embodiment, the deployment process runs a module comprising:
the operation result obtaining sub-module is used for obtaining the operation result of each deployment flow after each deployment flow is operated according to the operation sequence of each deployment flow;
the operation result judgment submodule is used for judging whether the operation result of each deployment process is a preset operation result or not;
and the first deployment flow operation sub-module is used for determining the deployment flow of the next operation sequence corresponding to each deployment flow and operating the deployment flow of the next operation sequence when the operation result of each deployment flow is not the preset operation result.
In one embodiment, the deployment process running module further includes:
and the deployment result determining submodule is used for determining that the program deployment result of the task to be deployed is a program deployment failure when the operation result of each deployment flow is a preset operation result, and stopping running the deployment flow of the next operation sequence.
In one embodiment, the deployment process runs a module comprising:
the flow type judgment submodule is used for judging whether the flow type corresponding to the currently running deployment flow is the custom script type;
the execution script extraction submodule is used for extracting the execution script in the currently running deployment flow when the flow type is the self-defined script type;
the script checking submodule is used for carrying out security check on the execution script to obtain a checking result of the execution script;
and the first deployment process operation sub-module is used for continuing to operate the currently operated deployment process when the detection result is normal.
In one embodiment, the script checking submodule includes:
the script command acquisition unit is used for carrying out syntactic and lexical analysis on the execution script to obtain a plurality of script commands;
the script command matching unit is used for matching each script command with a plurality of preset script commands in a preset command library to obtain a matching result of each script command;
the test result determining unit is used for determining the test result of the executed script as abnormal test when the matching result of any script command in the script commands is a preset matching result; and when the matching result of any script command does not exist in the plurality of script commands is a preset matching result, determining that the test result of the executed script is normal.
In one embodiment, the deployment process execution module further comprises: a second deployment process operation submodule;
a second deployment process run sub-module comprising:
the operation result determining unit is used for determining that the operation result of the currently operated deployment process is operation failure when the detection result is abnormal;
the warning information sending unit is used for sending preset warning information to all warning target users on a preset warning list;
and the audit log generating unit is used for generating a script inspection abnormal audit log according to the execution script and storing the inspection abnormal audit log into a preset audit database.
In one embodiment, the deployment result determining module is further configured to determine, in the N deployment flows, that an operation result is a number threshold of successfully operated deployment flows, and if the number threshold exceeds a preset successful number threshold, determine that a program deployment result of the task to be deployed is that program deployment is successful; or, the method is further configured to determine a core deployment process identifier corresponding to the task to be deployed, and if, in the N deployment processes, an operation result of the deployment process corresponding to the core deployment process identifier is successful in operation, determine a program deployment result of the task to be deployed as a program deployment success.
For specific limitations of the program deployment task execution device, reference may be made to the above limitations of the program deployment task execution method, which are not described herein again. The modules in the program deployment task execution device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, the internal structure of which may be as shown in FIG. 5. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing user configuration data, deployment task configuration templates and other data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a program deployment task execution method.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
responding to a program deployment instruction issued by a user, and determining a task to be deployed related to the program deployment instruction; acquiring deployment task description data of a task to be deployed; analyzing the deployment task description data to obtain an analysis result, wherein the analysis result comprises N deployment processes and the operation sequence of each deployment process, and N is a positive integer; running each deployment flow according to the running sequence of each deployment flow to obtain the running results of N deployment flows; and determining a program deployment result of the task to be deployed according to the operation results of the N deployment processes.
In one embodiment, when the processor executes the computer program to implement running each deployment flow according to the running sequence of each deployment flow, the following steps are further implemented:
after each deployment flow is operated according to the operation sequence of each deployment flow, the operation result of each deployment flow is obtained; judging whether the operation result of each deployment flow is a preset operation result or not; and if the operation result of each deployment flow is not the preset operation result, determining the deployment flow of the next operation sequence corresponding to each deployment flow, and operating the deployment flow of the next operation sequence.
In one embodiment, the processor executes the computer program, further implementing the steps of:
and if the operation result of each deployment flow is a preset operation result, determining that the program deployment result of the task to be deployed is a program deployment failure, and stopping running the deployment flow of the next operation sequence.
In one embodiment, when the processor executes the computer program to implement running each deployment flow according to the running sequence of each deployment flow, the following steps are further implemented:
judging whether the flow type corresponding to the currently running deployment flow is a custom script type; if the flow type is the self-defined script type, extracting an execution script in the currently running deployment flow; performing security inspection on the execution script to obtain an inspection result of the execution script; and if the detection result is normal, continuing to operate the currently operated deployment process.
In one embodiment, the processor executes the computer program to perform security check on the execution script, and when a check result is obtained, the following steps are further performed:
performing grammatical and lexical analysis on the execution script to obtain a plurality of script commands; matching each script command with a plurality of preset script commands in a preset command library to obtain a matching result of each script command; if the matching result of any script command in the plurality of script commands is a preset matching result, determining the detection result of the executed script as abnormal detection; and if the matching result of any script command does not exist in the plurality of script commands is the preset matching result, determining that the test result of the executed script is normal.
In one embodiment, the processor executes the computer program, further implementing the steps of:
if the detection result is abnormal, determining that the operation result of the currently operated deployment process is operation failure; sending preset alarm information to all alarm target users on a preset alarm list; and generating a script inspection abnormal audit log according to the execution script, and storing the inspection abnormal audit log into a preset audit database.
In one embodiment, when the processor executes the computer program, determining the program deployment result of the task to be deployed according to the operation results of the N deployment processes further includes:
determining that the running result is the quantity threshold of the successfully-run deployment flows in the N deployment flows, and if the quantity threshold exceeds a preset successful quantity threshold, determining that the program deployment result of the task to be deployed is the program deployment success; or determining a core deployment process identifier corresponding to the task to be deployed, and if the operation result of the deployment process corresponding to the core deployment process identifier is successful in the N deployment processes, determining the program deployment result of the task to be deployed as the program deployment success.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
responding to a program deployment instruction issued by a user, and determining a task to be deployed related to the program deployment instruction; acquiring deployment task description data of a task to be deployed; analyzing the deployment task description data to obtain an analysis result, wherein the analysis result comprises N deployment processes and the operation sequence of each deployment process, and N is a positive integer; running each deployment flow according to the running sequence of each deployment flow to obtain the running results of N deployment flows; and determining a program deployment result of the task to be deployed according to the operation results of the N deployment processes.
In one embodiment, the computer program is executed by a processor, and when the deployment processes are executed according to the running sequence of the deployment processes, the following steps are further implemented:
after each deployment flow is operated according to the operation sequence of each deployment flow, the operation result of each deployment flow is obtained; judging whether the operation result of each deployment flow is a preset operation result or not; and if the operation result of each deployment flow is not the preset operation result, determining the deployment flow of the next operation sequence corresponding to each deployment flow, and operating the deployment flow of the next operation sequence.
In one embodiment, the computer program is executed by a processor, further implementing the steps of:
and if the operation result of each deployment flow is a preset operation result, determining that the program deployment result of the task to be deployed is a program deployment failure, and stopping running the deployment flow of the next operation sequence.
In one embodiment, the computer program is executed by a processor, and when the deployment processes are executed according to the running sequence of the deployment processes, the following steps are further implemented:
judging whether the flow type corresponding to the currently running deployment flow is a custom script type; if the flow type is the self-defined script type, extracting an execution script in the currently running deployment flow; performing security inspection on the execution script to obtain an inspection result of the execution script; and if the detection result is normal, continuing to operate the currently operated deployment process.
In one embodiment, the computer program is executed by a processor, and performs a security check on the execution script, and when a check result is obtained, further performs the following steps:
performing grammatical and lexical analysis on the execution script to obtain a plurality of script commands; matching each script command with a plurality of preset script commands in a preset command library to obtain a matching result of each script command; if the matching result of any script command in the plurality of script commands is a preset matching result, determining the detection result of the executed script as abnormal detection; and if the matching result of any script command does not exist in the plurality of script commands is the preset matching result, determining that the test result of the executed script is normal.
In one embodiment, the computer program is executed by a processor, further implementing the steps of:
if the detection result is abnormal, determining that the operation result of the currently operated deployment process is operation failure; sending preset alarm information to all alarm target users on a preset alarm list; and generating a script inspection abnormal audit log according to the execution script, and storing the inspection abnormal audit log into a preset audit database.
In one embodiment, when the computer program is executed by the processor, determining the program deployment result of the task to be deployed according to the running results of the N deployment processes further implements the following steps:
determining that the running result is the quantity threshold of the successfully-run deployment flows in the N deployment flows, and if the quantity threshold exceeds a preset successful quantity threshold, determining that the program deployment result of the task to be deployed is the program deployment success; or determining a core deployment process identifier corresponding to the task to be deployed, and if the operation result of the deployment process corresponding to the core deployment process identifier is successful in the N deployment processes, determining the program deployment result of the task to be deployed as the program deployment success.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A program deployment task execution method is characterized by comprising the following steps:
responding to a program deployment instruction issued by a user, and determining a task to be deployed related to the program deployment instruction;
acquiring deployment task description data of the task to be deployed;
analyzing the deployment task description data to obtain an analysis result, wherein the analysis result comprises N deployment processes and the running sequence of each deployment process, and N is a positive integer;
running each deployment flow according to the running sequence of each deployment flow to obtain running results of N deployment flows;
and determining the program deployment result of the task to be deployed according to the running results of the N deployment processes.
2. The procedure deployment task execution method of claim 1,
the running of each deployment flow according to the running sequence of each deployment flow comprises:
after each deployment flow is operated according to the operation sequence of each deployment flow, obtaining the operation result of each deployment flow;
judging whether the operation result of each deployment flow is a preset operation result or not;
and if the operation result of each deployment flow is not the preset operation result, determining the deployment flow of the next operation sequence corresponding to each deployment flow, and operating the deployment flow of the next operation sequence.
3. The program deployment task execution method of claim 2, further comprising:
and if the operation result of each deployment flow is a preset operation result, determining that the program deployment result of the task to be deployed is a program deployment failure, and stopping running the deployment flow of the next operation sequence.
4. The procedure deployment task execution method of claim 1,
the running of each deployment flow according to the running sequence of each deployment flow comprises:
judging whether the flow type corresponding to the currently running deployment flow is a custom script type;
if the flow type is a custom script type, extracting an execution script in the currently running deployment flow;
performing security inspection on the execution script to obtain an inspection result of the execution script;
and if the detection result is normal, continuing to operate the currently operated deployment process.
5. The procedure deployment task execution method of claim 4,
the performing security inspection on the execution script to obtain an inspection result includes:
performing syntactic and lexical analysis on the execution script to obtain a plurality of script commands;
matching each script command with a plurality of preset script commands in a preset command library to obtain a matching result of each script command;
if the matching result of any script command in the script commands is a preset matching result, determining that the detection result of the executed script is abnormal;
and if the matching result of any script command does not exist in the script commands is a preset matching result, determining that the test result of the executed script is normal.
6. The program deployment task execution method of claim 4, further comprising:
if the inspection result is abnormal, determining that the operation result of the currently operated deployment process is operation failure;
sending preset alarm information to all alarm target users on a preset alarm list;
and generating a script inspection abnormal audit log according to the execution script, and storing the inspection abnormal audit log into a preset audit database.
7. The procedure deployment task execution method of claim 1,
determining the program deployment result of the task to be deployed according to the running results of the N deployment processes, wherein the determining the program deployment result of the task to be deployed according to the running results of the N deployment processes comprises:
determining that the running result is a quantity threshold of the deployment processes which are successfully run in the N deployment processes, and if the quantity threshold exceeds a preset successful quantity threshold, determining that the program deployment result of the task to be deployed is that the program deployment is successful; or the like, or, alternatively,
and determining a core deployment process identifier corresponding to the task to be deployed, and if the operation result of the deployment process corresponding to the core deployment process identifier is successful in the N deployment processes, determining the program deployment result of the task to be deployed as the program deployment success.
8. A program deployment task execution apparatus, comprising:
the task determining module is used for responding to a program deployment instruction issued by a user and determining a task to be deployed related to the program deployment instruction;
the description data acquisition module is used for acquiring the deployment task description data of the task to be deployed;
the description data analysis module is used for analyzing the deployment task description data to obtain an analysis result, wherein the analysis result comprises N deployment processes and the operation sequence of each deployment process, and N is a positive integer;
the deployment process operation module is used for operating each deployment process according to the operation sequence of each deployment process to obtain the operation results of the N deployment processes;
and the deployment result determining module is used for determining the program deployment result of the task to be deployed according to the running results of the N deployment processes.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202010037244.2A 2020-01-14 2020-01-14 Program deployment task execution method, device, computer equipment and storage medium Active CN111258591B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010037244.2A CN111258591B (en) 2020-01-14 2020-01-14 Program deployment task execution method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010037244.2A CN111258591B (en) 2020-01-14 2020-01-14 Program deployment task execution method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111258591A true CN111258591A (en) 2020-06-09
CN111258591B CN111258591B (en) 2023-07-25

Family

ID=70946951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010037244.2A Active CN111258591B (en) 2020-01-14 2020-01-14 Program deployment task execution method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111258591B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930290A (en) * 2020-09-18 2020-11-13 阿里云计算有限公司 Resource deployment method and device
CN112162756A (en) * 2020-09-17 2021-01-01 武汉联影医疗科技有限公司 Deployment method and device of software product, computer equipment and storage medium
CN112491607A (en) * 2020-11-21 2021-03-12 广州西麦科技股份有限公司 Method and system for managing application deployment
CN114879981A (en) * 2022-05-27 2022-08-09 北京百度网讯科技有限公司 Installation method and device of cloud operating system, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102207859A (en) * 2010-03-31 2011-10-05 国际商业机器公司 Method, device and system for deploying solution plan
US20170103100A1 (en) * 2015-10-13 2017-04-13 Bank Of America Corporation System for multidimensional database administration
CN106681930A (en) * 2017-01-23 2017-05-17 北京思特奇信息技术股份有限公司 Distributed automatic application operation abnormity detecting method and system
CN109901842A (en) * 2019-01-17 2019-06-18 深圳壹账通智能科技有限公司 Application deployment method, apparatus, computer equipment and storage medium
CN110275872A (en) * 2019-07-18 2019-09-24 中国银行股份有限公司 Version automatic deployment method, device, computer equipment and storage medium
WO2019232828A1 (en) * 2018-06-06 2019-12-12 平安科技(深圳)有限公司 Script deployment method and apparatus, and computer device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102207859A (en) * 2010-03-31 2011-10-05 国际商业机器公司 Method, device and system for deploying solution plan
US20110265087A1 (en) * 2010-03-31 2011-10-27 International Business Machines Corporation Apparatus, method, and computer program product for solution provisioning
US20170103100A1 (en) * 2015-10-13 2017-04-13 Bank Of America Corporation System for multidimensional database administration
CN106681930A (en) * 2017-01-23 2017-05-17 北京思特奇信息技术股份有限公司 Distributed automatic application operation abnormity detecting method and system
WO2019232828A1 (en) * 2018-06-06 2019-12-12 平安科技(深圳)有限公司 Script deployment method and apparatus, and computer device and storage medium
CN109901842A (en) * 2019-01-17 2019-06-18 深圳壹账通智能科技有限公司 Application deployment method, apparatus, computer equipment and storage medium
CN110275872A (en) * 2019-07-18 2019-09-24 中国银行股份有限公司 Version automatic deployment method, device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张伟;杨大龙;陈丽;高中纤;韩波;: "基于QLExpress规则引擎的自动化运维告警系统的设计与实现" *
高佳林;: "针对linux服务器交互式自动化脚本实现与研究" *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162756A (en) * 2020-09-17 2021-01-01 武汉联影医疗科技有限公司 Deployment method and device of software product, computer equipment and storage medium
CN112162756B (en) * 2020-09-17 2022-04-26 武汉联影医疗科技有限公司 Deployment method and device of software product, computer equipment and storage medium
CN111930290A (en) * 2020-09-18 2020-11-13 阿里云计算有限公司 Resource deployment method and device
CN111930290B (en) * 2020-09-18 2021-04-27 阿里云计算有限公司 Resource deployment method and device
CN112491607A (en) * 2020-11-21 2021-03-12 广州西麦科技股份有限公司 Method and system for managing application deployment
CN114879981A (en) * 2022-05-27 2022-08-09 北京百度网讯科技有限公司 Installation method and device of cloud operating system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111258591B (en) 2023-07-25

Similar Documents

Publication Publication Date Title
CN111258591A (en) Program deployment task execution method and device, computer equipment and storage medium
CN111831569A (en) Test method and device based on fault injection, computer equipment and storage medium
US10635473B2 (en) Setting support program, setting support method, and setting support device
CN107451040B (en) Method and device for positioning fault reason and computer readable storage medium
US20160132420A1 (en) Backup method, pre-testing method for environment updating and system thereof
CN111881014B (en) System test method, device, storage medium and electronic equipment
CN109255240B (en) Vulnerability processing method and device
CN111258913A (en) Automatic algorithm testing method and device, computer system and readable storage medium
CN113535532B (en) Fault injection system, method and device
CN112115005B (en) Test data acquisition method and device, computer equipment and storage medium
CN113726553A (en) Node fault recovery method and device, electronic equipment and readable storage medium
CN110908674A (en) Automatic deployment method and device of application program
CN112162931A (en) Extraction and detection method, system, electronic equipment and storage medium
EP3514680B1 (en) Identification of changes in functional behavior and runtime behavior of a system during maintenance cycles
CN110727575B (en) Information processing method, system, device and storage medium
CN110618853A (en) Detection method, device and equipment for zombie container
CN110990289B (en) Method and device for automatically submitting bug, electronic equipment and storage medium
CN114579473B (en) Application testing method, device, equipment and storage medium
CN116599881A (en) Cloud platform tenant modeling test method, device, equipment and storage medium
US20190073292A1 (en) State machine software tester
CN114880179A (en) Server virtualization pressure testing method, device, equipment and storage medium
CN115237441A (en) Upgrade test method, device and medium based on cloud platform
CN113485933A (en) Automatic testing method and distributed system
CN110188008B (en) Job scheduling master-slave switching method and device, computer equipment and storage medium
CN109672573B (en) Configuration file deployment method, configuration file determination method, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant