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

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

Info

Publication number
CN111258591B
CN111258591B CN202010037244.2A CN202010037244A CN111258591B CN 111258591 B CN111258591 B CN 111258591B CN 202010037244 A CN202010037244 A CN 202010037244A CN 111258591 B CN111258591 B CN 111258591B
Authority
CN
China
Prior art keywords
deployment
result
flow
script
task
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.)
Active
Application number
CN202010037244.2A
Other languages
Chinese (zh)
Other versions
CN111258591A (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

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 invention relates to the field of computer program deployment technologies, and in particular, to a program deployment task execution method, a device, 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 which is associated with 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 flows and the operation sequence of each deployment flow, and N is a positive integer; operating each deployment flow according to the operation sequence of each deployment flow to obtain the operation 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 flows. The embodiment can reduce the coupling degree of the program deployment task, so that the whole deployment task cannot fail even if a certain deployment flow is in a problem in the deployment process, and the deployment success rate of the program deployment task is improved.

Description

Program deployment task execution method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer program deployment technologies, and in particular, to a program deployment task execution method, apparatus, computer device, and storage medium.
Background
At present, when a program is deployed on a server, the program deployment can be performed manually by operation staff, and an automatic deployment script can be customized to perform the program deployment.
The method of program deployment by operation and maintenance personnel is flexible and high in deployment success rate, but the operation of program deployment is complex, the manual deployment speed is slow, and when the number of servers to be deployed and/or programs to be deployed is large, more operation and maintenance personnel are required to be arranged to execute deployment tasks, or more time is required to be input to execute the deployment tasks, 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 operation, however, the current automatic deployment script is relatively stiff when deploying the program, and if a certain deployment link fails in the deployment process (for example, the execution fails because the network problem exceeds the response time), flexible adjustment like manual operation cannot be performed, so that the whole deployment task fails, and the deployment success rate of the program deployment task is not too high.
Disclosure of Invention
Aiming at the defects of the prior art, the embodiment of the invention provides a program deployment task execution method, a device, computer equipment and a storage medium.
The present invention provides, according to a first aspect, a program deployment task execution method, which in one embodiment comprises:
responding to a program deployment instruction issued by a user, and determining a task to be deployed which is associated with 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 flows and the operation sequence of each deployment flow, and N is a positive integer;
operating each deployment flow according to the operation sequence of each deployment flow to obtain the operation 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 flows.
In one embodiment, running each deployment flow in the order of execution of each deployment flow includes:
after each deployment flow is operated according to the operation sequence of each deployment flow, an operation result of each deployment flow is obtained;
judging whether the operation result of each deployment flow is a preset operation result or not;
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:
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 program deployment failure, and stopping operating the deployment flow of the next operation sequence.
In one embodiment, running each deployment flow in the order of execution of each deployment flow includes:
judging whether the flow type corresponding to the currently operated deployment flow is a custom script type or not;
if the flow type is the 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;
if the test result is that the test is normal, continuing to operate the deployment flow currently operated.
In one embodiment, security checking the execution script to obtain a checking result includes:
performing grammar 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 checking result of the execution script is abnormal;
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 checking result of the execution script is normal.
In one embodiment, further comprising:
if the test result is abnormal, determining that the operation result of the currently operated deployment flow is operation failure;
sending preset alarm information to all alarm target users on a preset alarm list;
and generating a script checking abnormal audit log according to the execution script, and storing the checking abnormal audit log into a preset audit database.
In one embodiment, determining a program deployment result of the task to be deployed according to the running results of the N deployment flows includes:
determining the number threshold value of the deployment flows with successful operation as an operation result in the N deployment flows, and determining the program deployment result of the task to be deployed as program deployment success if the number threshold value exceeds a preset successful number threshold value; or alternatively, the first and second heat exchangers may be,
and determining a core deployment flow identifier corresponding to the task to be deployed, and if the operation result of the deployment flow corresponding to the core deployment flow identifier is successful in operation in the N deployment flows, determining the program deployment result of the task to be deployed as program deployment success.
The present invention provides, according to a second aspect, a program deployment task execution apparatus, 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 which is associated with the program deployment instruction;
the description data acquisition module is used for acquiring deployment task description data of a 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 flows and the operation sequence of each deployment flow, and N is a positive integer;
the deployment flow operation module is used for operating each deployment flow according to the operation sequence of each deployment flow to obtain the operation results of N deployment flows;
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 flows.
According to a third aspect the present invention provides 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 the computer program is executed.
According to a fourth aspect, the present invention provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of an embodiment of any of the methods described 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 which is associated with the program deployment instruction; then acquiring deployment task description data of a task to be deployed, and analyzing the deployment task description data to obtain an analysis result, wherein the analysis result comprises N deployment flows and the operation sequence of each deployment flow; then, each deployment flow is operated according to the operation sequence of each deployment flow, and operation results of N deployment flows are obtained; and finally, determining a program deployment result of the task to be deployed according to the operation results of the N deployment flows, dividing the program deployment task into a plurality of deployment flows, and reducing the coupling degree of the program deployment task, so that the whole deployment task is not failed even if a certain deployment flow is in a problem in the deployment process, and the deployment success rate of the program deployment task is improved.
Drawings
FIG. 1 is a flow chart of a method for executing a program deployment task in one embodiment;
FIG. 2 is a flow diagram of the steps of a deployment server running various deployment flows, in one embodiment;
FIG. 3 is a flow diagram of steps of a deployment server running various deployment flows in another embodiment;
FIG. 4 is a block diagram of a program deployment task execution device in one embodiment;
fig. 5 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
As shown in fig. 1, a method for executing a program deployment task according to an embodiment of the present invention is described below by taking a deployment server for executing a program deployment task as an example, where the deployment server may be implemented by using a separate server or a server cluster formed by a plurality of servers. The method comprises the following steps:
s110: and responding to the program deployment instruction issued by the user, and determining a task to be deployed which is associated with the program deployment instruction.
In this embodiment, when a user (for example, an operator, a server manager, a developer, or the like) wants to deploy a certain program (may also be a certain program) to a certain server (may also be a certain server), 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.
Of course, the user needs to deploy the program to be deployed, and 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 may summarize the program deployment processes of various types of programs in advance to obtain a plurality of large-class program deployment processes, divide each class of program deployment process into a plurality of relatively independent deployment processes, and pre-write each deployment process and a plurality of different types of deployment task configuration templates, where the deployment processes and the deployment task configuration templates may be stored in a database. The user can access a web page provided by the deployment server, and the configuration of the program deployment task is performed through the web page. Specifically, a user selects a corresponding deployment task configuration template from the web page, the deployment task configuration template is composed of a plurality of deployment flows, and the user can complete the configuration of the program deployment task after configuring the configuration items of each deployment flow.
Different deployment flows have different roles, for example, some deployment flows are used for executing common scripts configured by a user, some deployment flows are used for interfacing with servers to be deployed, such as a local server, an online cloud platform (such as an ali cloud, an enterprise internal private cloud) and the like, and some deployment flows are used for downloading the programs to be deployed from an intranet or a public network.
S120: and acquiring deployment task description data of the task to be deployed.
In this embodiment, after determining a task to be deployed associated with a program deployment instruction, the deployment server obtains deployment task description data of the task to be deployed. Specifically, the deployment server acquires 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 flow on the web page, the deployment server records the relevant information configured by the user for each configuration item into the database, wherein the user configuration data refers to the relevant information configured by the user for each configuration item 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: analyzing the deployment task description data to obtain an analysis result, wherein the analysis result comprises N deployment flows and the operation sequence of each deployment flow, and N is a positive integer.
In this embodiment, after the deployment server obtains the deployment task description data, the deployment task description data is parsed by using a parser, and a parsing result obtained by parsing includes N deployment flows and an operation sequence of each deployment flow.
The different deployment flows can belong to the same operation sequence, for example, the analysis result obtains 4 deployment flows, namely, a flow A, a flow B, a flow C and a flow D, wherein the operation sequence of the flow A is a first sequence, the operation sequence of the flow B and the operation sequence of the flow C are all a second sequence, and the operation sequence of the flow D is a third sequence.
It will be appreciated that in some deployment flows, a plurality of deployment steps are included, where each deployment step also has a corresponding operation sequence, and different deployment steps may also belong to the same operation sequence.
S140: and operating each deployment flow according to the operation sequence of each deployment flow to obtain the operation 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 flows.
In this embodiment, the deployment server operates each deployment flow according to the operation sequence, so as to obtain an operation 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, even if part of the N deployment flows cannot run successfully in the deployment flows, the whole deployment flow does not need to be stopped, and after all the deployment flows are run, the program deployment result of the appointed task to be deployed can be determined according to the running result of each deployment flow.
In one embodiment, the step of determining, by the deployment server, a program deployment result of the task to be deployed according to the running results of the N deployment flows specifically includes:
determining the number threshold value of the deployment flows with successful operation as an operation result in the N deployment flows, and determining the program deployment result of the task to be deployed as program deployment success if the number threshold value exceeds a preset successful number threshold value; or alternatively, the first and second heat exchangers may be,
and determining a core deployment flow identifier corresponding to the task to be deployed, and if the operation result of the deployment flow corresponding to the core deployment flow identifier is successful in operation in the N deployment flows, determining the program deployment result of the task to be deployed as program deployment success.
In the present embodiment, the operation result includes operation success and operation failure.
In an application scenario, the manner in which the deployment server determines the program deployment result of the task to be deployed is: firstly, determining that the running result is the quantity threshold of the successful running deployment process in all deployment processes of the task to be deployed, and if the quantity threshold exceeds the preset successful quantity threshold, determining that the program deployment result of the task to be deployed is program deployment success; otherwise, if the number threshold does not exceed the preset success number threshold, determining that the program deployment result of the task to be deployed is program deployment failure.
In another application scenario, since the deployment flows are independent of each other, a user can configure a plurality of core deployment flows when configuring a program deployment task, the core deployment flows can be successfully operated to meet the basic deployment requirements of the user, and a plurality of non-core deployment flows can be deployed on the basis of the core deployment flows, and even if the non-core deployment flows fail to operate, the user can be subsequently redeployed. Therefore, in the application scenario, the manner in which the deployment server determines the program deployment result of the task to be deployed is: firstly, determining a core deployment flow identifier corresponding to a task to be deployed, wherein the core deployment flow identifier is a unique identifier corresponding to the core deployment flow. The core deployment flow is the deployment flow which must run successfully in the task to be deployed at this time. It should be noted that, the core deployment flow identifier includes 1 or more core flow identifiers (the number of 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 flows corresponding to the core deployment flow identification are successful in operation, determining that the program deployment result of the task to be deployed is successful in program deployment; otherwise, if the operation result of any one of the deployment flows corresponding to the core deployment flow identification is the operation failure, then determining the program deployment result of the task to be deployed as the program deployment failure.
Further, the user can configure a plurality of deployment flows belonging to the same class in the same operation sequence, so that if any one of the parallel deployment flows is successfully operated, the successful operation of the deployment flows is determined, and the success rate of program deployment can be improved.
The embodiment of the invention divides the program deployment task into a plurality of deployment flows, reduces the coupling degree of the program deployment task, does not cause failure of the whole deployment task even if a certain deployment flow has problems in the deployment process, and improves the deployment success rate of the program deployment task.
In one embodiment, as shown in fig. 2, the deployment server runs the steps of each deployment procedure according to the running sequence of each deployment procedure, and specifically includes:
s210: and after each deployment flow is operated according to the operation sequence of each deployment flow, an operation result of each deployment flow is obtained.
S220: judging whether the operation result of each deployment flow is a preset operation result or not.
S230: 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, considering that some serious problems may occur in the program deployment process, for example, the running progress of the deployment process is blocked due to the problem that the script of the deployment process itself remains when being developed, if the execution is continued, the execution of other program deployment tasks is likely to be affected due to long-term occupation of computing resources. Thus, when each (i.e., any one) deployment flow is executed, the deployment server periodically obtains the running information of the currently executing deployment flow (it can be understood that if one running order corresponds to X (positive integer) deployment flows, the currently executing deployment flow is also X) and includes information such as running log data, running duration, running status (including running completion or running) generated by the runtime, and then determines the running result of the deployment flow according to the running information of the deployment flow.
In one embodiment, the operation results of the deployment procedure include operation success, operation failure, and operation abnormality. If the operation state in the operation information of the deployment flow is determined to be operation completion, the operation result of the deployment flow is determined to be operation success. If the operation state in the operation information of the deployment flow is determined to be in operation, determining an operation time length threshold in the operation information of the deployment flow, and if the operation time length threshold does not exceed a preset operation time length threshold corresponding to the deployment flow, determining an operation result of the deployment flow as operation failure; if the operation time length threshold exceeds the preset operation time length threshold corresponding to the deployment flow, determining that the operation result of the deployment flow is abnormal.
The preset operation result is abnormal operation. After determining the operation result of the deployment flow, the deployment server determines whether the operation result of the deployment flow is abnormal, if the operation result of the deployment flow is determined to be successful or failed, then determining the deployment flow of the next operation sequence corresponding to the deployment flow, and operating the deployment flow of the next operation sequence; if the operation result of the deployment flow is determined to be abnormal operation, the program deployment result of the task to be deployed is determined to be program deployment failure, and the deployment flow of the next operation sequence is stopped, namely the rest of non-operation deployment flows are not continued to be executed.
In one embodiment, as shown in fig. 3, the deployment server runs the steps of each deployment procedure according to the running sequence of each deployment procedure, and specifically includes:
s310: judging whether the flow type corresponding to the currently operated deployment flow is a custom script type or not.
S320: and if the flow type is the custom script type, extracting an 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: if the test result is that the test is normal, continuing to operate the deployment flow currently operated.
In this embodiment, some deployment flows may need to execute some scripts written by users, so that in order to ensure the security of the server to be deployed, security check needs to be performed on the scripts written by users by themselves, so as to ensure that the custom scripts do not contain dangerous commands. Specifically, when each deployment flow is operated, the deployment server determines the flow type of the currently operated deployment flow, and if the flow type corresponding to the currently operated deployment flow is a custom script type, an execution script (i.e. a script written by the user) is extracted from the currently operated deployment flow, and security inspection is performed on the execution script. If the test result is determined to be normal, the deployment server continues to operate the currently operated deployment flow; if the detection result is determined to be abnormal, the deployment server determines that the operation result of the currently operated deployment flow is failure operation, then sends preset alarm information to all alarm target users on a preset alarm list, generates a script detection abnormal audit log according to an execution script, and stores the detection abnormal audit log in a preset audit database. The script inspection abnormal audit log can comprise information such as running time of an execution script, all running script commands and limiting script commands, task identification to be deployed, deployment flow identification, user for indicating to deploy tasks to be deployed, IP addresses of the user, and the like, so that specific conditions can be rapidly determined according to the inspection abnormal audit log.
The step of the deployment server performing security inspection on the execution script to obtain an inspection result specifically comprises the following steps:
performing grammar 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 checking result of the execution script is abnormal;
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 checking result of the execution script is normal.
In one application scenario, the execution script belongs to Linux commands (Linux is an operating system that supports multiple users, multiple tasks, multiple threads, and multiple CPUs). And carrying out grammar 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 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 safety script command and the preset safety script command is fewer in number, the preset script command in the preset command library may refer to the safety script command that allows the user to execute, or the preset script command in the preset command library may refer to the limit script command that does not allow the user to execute if the safety script command that allows the user to execute is greater in number and the limit script command that does not allow the user to execute is fewer in number.
If one script limiting command exists in a plurality of script commands corresponding to the deployment flow, determining that the test result of the execution script is abnormal; if the plurality of script commands corresponding to the deployment flow are all security script commands, determining that the test result of the execution script is normal.
In one embodiment, as shown in fig. 4, there is provided a program deployment task execution apparatus, including the following modules:
a task determining module 110, configured to determine a task to be deployed associated with a program deployment instruction in response to the program deployment instruction issued by the user;
the description data acquisition module 120 is configured to acquire deployment task description data of a task to be deployed;
the description data analysis module 130 is configured to analyze the deployment task description data to obtain an analysis result, where the analysis result includes N deployment flows and an operation sequence of each deployment flow, and N is a positive integer;
the deployment flow operation module 140 is configured to operate each deployment flow according to an operation sequence of each deployment flow, so as to obtain operation results of N deployment flows;
the deployment result determining module 150 is configured to determine a program deployment result of the task to be deployed according to the running results of the N deployment flows.
In one embodiment, the deployment flow operation module includes:
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 judging sub-module is used for judging whether the operation result of each deployment flow is a preset operation result or not;
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 a preset operation result.
In one embodiment, the deployment procedure running module further comprises:
the deployment result determining submodule is used for determining that the program deployment result of the task to be deployed is program deployment failure when the operation result of each deployment flow is a preset operation result, and stopping operating the deployment flow of the next operation sequence.
In one embodiment, the deployment flow operation module includes:
the flow type judging sub-module is used for judging whether the flow type corresponding to the currently operated deployment flow is a custom script type or not;
the execution script extraction sub-module is used for extracting an execution script in the currently running deployment flow when the flow type is a custom script type;
The script checking sub-module is used for carrying out security check on the execution script to obtain a checking result of the execution script;
and the first deployment flow operation submodule is used for continuously operating the currently operated deployment flow when the test result is that the test is normal.
In one embodiment, the script checking sub-module comprises:
the script command obtaining unit is used for carrying out grammar 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 that the test result of the execution script is abnormal when the matching result of any one script command in the plurality of script commands is a preset matching result; 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 checking result of the execution script is normal.
In one embodiment, the deployment flow execution module further comprises: the second deployment flow operates the sub-module;
the second deployment flow operation sub-module includes:
The operation result determining unit is used for determining that the operation result of the currently operated deployment flow is operation failure when the inspection result is abnormal;
the alarm information sending unit is used for sending preset alarm information to all alarm target users on a preset alarm 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 that, among the N deployment flows, the running result is a number threshold of successful deployment flows, and if the number threshold exceeds a preset success number threshold, determine that the program deployment result of the task to be deployed is program deployment success; or, the method is further used for determining a core deployment flow identifier corresponding to the task to be deployed, and if the operation result of the deployment flow corresponding to the core deployment flow identifier is successful in operation in the N deployment flows, the program deployment result of the task to be deployed is determined to be successful in program deployment.
For specific limitations on the program deployment task execution apparatus, reference may be made to the above limitation on the program deployment task execution method, and no further description is given here. The above-described respective modules in the program deployment task execution device may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above 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 includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing user configuration data, deployment task configuration templates and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a program deployment task execution method.
It will be appreciated by those skilled in the art that the structure shown in fig. 5 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than 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 steps of when executing the computer program:
responding to a program deployment instruction issued by a user, and determining a task to be deployed which is associated with 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 flows and the operation sequence of each deployment flow, and N is a positive integer; operating each deployment flow according to the operation sequence of each deployment flow to obtain the operation 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 flows.
In one embodiment, when the processor executes the computer program to implement each deployment procedure according to the operation sequence of each deployment procedure, the following steps are further implemented:
after each deployment flow is operated according to the operation sequence of each deployment flow, an operation result of each deployment flow is obtained; judging whether the operation result of each deployment flow is a preset operation result or not; 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 a computer program, further implementing the steps of:
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 program deployment failure, and stopping operating the deployment flow of the next operation sequence.
In one embodiment, when the processor executes the computer program to implement each deployment procedure according to the operation sequence of each deployment procedure, the following steps are further implemented:
judging whether the flow type corresponding to the currently operated deployment flow is a custom script type or not; if the flow type is the 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; if the test result is that the test is normal, continuing to operate the deployment flow currently operated.
In one embodiment, the processor executes the computer program to perform security inspection on the execution script, and when the inspection result is obtained, the following steps are further performed:
performing grammar 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 checking result of the execution script is abnormal; 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 checking result of the execution script is normal.
In one embodiment, the processor executes a computer program, further implementing the steps of:
if the test result is abnormal, determining that the operation result of the currently operated deployment flow is operation failure; sending preset alarm information to all alarm target users on a preset alarm list; and generating a script checking abnormal audit log according to the execution script, and storing the checking abnormal audit log into a preset audit database.
In one embodiment, when the processor executes the computer program, the program deployment result for determining the task to be deployed according to the running results of the N deployment flows further includes the following steps:
determining the number threshold value of the deployment flows with successful operation as an operation result in the N deployment flows, and determining the program deployment result of the task to be deployed as program deployment success if the number threshold value exceeds a preset successful number threshold value; or determining a core deployment flow identifier corresponding to the task to be deployed, and if the operation result of the deployment flow corresponding to the core deployment flow identifier is successful in operation in the N deployment flows, determining the program deployment result of the task to be deployed as 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 which is associated with 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 flows and the operation sequence of each deployment flow, and N is a positive integer; operating each deployment flow according to the operation sequence of each deployment flow to obtain the operation 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 flows.
In one embodiment, when the computer program is executed by the processor to execute each deployment flow according to the operation 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, an operation result of each deployment flow is obtained; judging whether the operation result of each deployment flow is a preset operation result or not; 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:
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 program deployment failure, and stopping operating the deployment flow of the next operation sequence.
In one embodiment, when the computer program is executed by the processor to execute each deployment flow according to the operation sequence of each deployment flow, the following steps are further implemented:
judging whether the flow type corresponding to the currently operated deployment flow is a custom script type or not; if the flow type is the 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; if the test result is that the test is normal, continuing to operate the deployment flow currently operated.
In one embodiment, the computer program is executed by the processor, and performs security inspection on the execution script, and when the inspection result is obtained, the following steps are further implemented:
performing grammar 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 checking result of the execution script is abnormal; 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 checking result of the execution script is normal.
In one embodiment, the computer program is executed by a processor, further implementing the steps of:
if the test result is abnormal, determining that the operation result of the currently operated deployment flow is operation failure; sending preset alarm information to all alarm target users on a preset alarm list; and generating a script checking abnormal audit log according to the execution script, and storing the checking abnormal audit log into a preset audit database.
In one embodiment, when the computer program is executed by the processor, determining a program deployment result of the task to be deployed according to the running results of the N deployment flows further implements the following steps:
determining the number threshold value of the deployment flows with successful operation as an operation result in the N deployment flows, and determining the program deployment result of the task to be deployed as program deployment success if the number threshold value exceeds a preset successful number threshold value; or determining a core deployment flow identifier corresponding to the task to be deployed, and if the operation result of the deployment flow corresponding to the core deployment flow identifier is successful in operation in the N deployment flows, determining the program deployment result of the task to be deployed as program deployment success.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile 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), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (7)

1. A program deployment task execution method, characterized by comprising:
responding to a program deployment instruction issued by a user, and determining a task to be deployed which is associated with 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 flows and the operation sequence of each deployment flow, and N is a positive integer;
Operating each deployment flow according to the operation sequence of each deployment flow to obtain operation results of N deployment flows;
determining a program deployment result of the task to be deployed according to the operation results of the N deployment flows;
the operating each deployment flow according to the operation sequence of each deployment flow includes:
judging whether the flow type corresponding to the currently operated deployment flow is a custom script type or not;
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;
if the test result is that the test is normal, continuing to operate the deployment flow of the current operation;
the step of carrying out security inspection on the execution script to obtain an inspection result comprises the following steps:
performing grammar 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 test result of the execution script is abnormal;
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 checking result of the execution script is normal;
the determining the program deployment result of the task to be deployed according to the operation results of the N deployment flows includes:
determining the number threshold of the deployment flows with successful operation as an operation result in the N deployment flows, and determining the program deployment result of the task to be deployed as program deployment success if the number threshold exceeds a preset successful number threshold; or alternatively, the first and second heat exchangers may be,
determining a core deployment flow identifier corresponding to the task to be deployed, and if the operation result of the deployment flow corresponding to the core deployment flow identifier is successful in operation in the N deployment flows, determining the program deployment result of the task to be deployed as program deployment success.
2. The method for performing a program deployment task of claim 1,
the operating the deployment flows according to the operation sequence of the deployment flows includes:
after each deployment flow is operated according to the operation sequence of each deployment flow, an operation result of each deployment flow is obtained;
Judging whether the operation result of each deployment flow is a preset operation result or not;
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:
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 operating the deployment flow of the next operation sequence.
4. The program deployment task execution method of claim 1, further comprising:
if the inspection result is abnormal, determining that the operation result of the currently operated deployment flow 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.
5. 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 which is associated with 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 analysis results, wherein the analysis results comprise N deployment flows and the operation sequence of each deployment flow, and N is a positive integer;
the deployment flow operation module is used for operating each deployment flow according to the operation sequence of each deployment flow to obtain operation results of N deployment flows;
the deployment result determining module is used for determining a program deployment result of the task to be deployed according to the operation results of the N deployment flows;
the deployment flow operation module comprises:
the flow type judging sub-module is used for judging whether the flow type corresponding to the currently operated deployment flow is a custom script type or not;
the execution script extraction sub-module is used for extracting the execution script in the currently running deployment flow when the flow type is a custom script type;
the script checking sub-module is used for carrying out security check on the execution script to obtain a checking result of the execution script;
The first deployment flow operation submodule is used for continuously operating the currently operated deployment flow when the inspection result is that the inspection is normal;
the script checking sub-module comprises:
the script command obtaining unit is used for carrying out grammar 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 that the test result of the execution script is abnormal when the matching result of any script command in the plurality of script commands is a preset matching result; 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 checking result of the execution script is normal;
the deployment result determining module is further configured to:
determining the number threshold of the deployment flows with successful operation as an operation result in the N deployment flows, and determining the program deployment result of the task to be deployed as program deployment success if the number threshold exceeds a preset successful number threshold; or alternatively, the first and second heat exchangers may be,
Determining a core deployment flow identifier corresponding to the task to be deployed, and if the operation result of the deployment flow corresponding to the core deployment flow identifier is successful in operation in the N deployment flows, determining the program deployment result of the task to be deployed as program deployment success.
6. 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 processor implements the steps of the method according to any one of claims 1 to 4 when the computer program is executed.
7. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 4.
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 CN111258591A (en) 2020-06-09
CN111258591B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162756B (en) * 2020-09-17 2022-04-26 武汉联影医疗科技有限公司 Deployment method and device of software product, computer equipment and storage medium
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
CN114879981B (en) * 2022-05-27 2023-06-06 北京百度网讯科技有限公司 Cloud operating system installation method and device, electronic equipment and storage medium

Citations (5)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170103100A1 (en) * 2015-10-13 2017-04-13 Bank Of America Corporation System for multidimensional database administration

Patent Citations (5)

* 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
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规则引擎的自动化运维告警系统的设计与实现.信息通信技术.2019,(第S1期),全文. *
高佳林 ; .针对linux服务器交互式自动化脚本实现与研究.电子世界.2016,(第05期),全文. *

Also Published As

Publication number Publication date
CN111258591A (en) 2020-06-09

Similar Documents

Publication Publication Date Title
CN111258591B (en) Program deployment task execution method, device, computer equipment and storage medium
CN111831569A (en) Test method and device based on fault injection, computer equipment and storage medium
CN107451040B (en) Method and device for positioning fault reason and computer readable storage medium
US20170060546A1 (en) System and method for providing software build violation detection and self-healing
CN107660289B (en) Automatic network control
US20160132420A1 (en) Backup method, pre-testing method for environment updating and system thereof
US20150100832A1 (en) Method and system for selecting and executing test scripts
US20150100831A1 (en) Method and system for selecting and executing test scripts
CN111881014B (en) System test method, device, storage medium and electronic equipment
CN111258913A (en) Automatic algorithm testing method and device, computer system and readable storage medium
CN112650676A (en) Software testing method, device, equipment and storage medium
CN112115005B (en) Test data acquisition method and device, computer equipment and storage medium
EP3514680B1 (en) Identification of changes in functional behavior and runtime behavior of a system during maintenance cycles
CN114968272A (en) Algorithm operation method, device, equipment and storage medium
CN110727575B (en) Information processing method, system, device and storage medium
US20190073292A1 (en) State machine software tester
CN116230067A (en) Automatic testing method, system, equipment and medium for solid state disk
CN116599881A (en) Cloud platform tenant modeling test method, device, equipment and storage medium
CN113590494B (en) Automatic testing method for cloud native environment vulnerability
CN112256384B (en) Service set processing method and device based on container technology and computer equipment
CN110188008B (en) Job scheduling master-slave switching method and device, computer equipment and storage medium
CN111625330A (en) Cross-thread task processing method and device, server and storage medium
CN107577546B (en) Information processing method and device and electronic equipment
Deshpande et al. Test Automation and Continuous Integration using Jenkins for Smart Card OS
CN113094221B (en) Fault injection method, device, computer equipment and readable 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