CN106569783B - Method and device for executing task script - Google Patents

Method and device for executing task script Download PDF

Info

Publication number
CN106569783B
CN106569783B CN201510646076.6A CN201510646076A CN106569783B CN 106569783 B CN106569783 B CN 106569783B CN 201510646076 A CN201510646076 A CN 201510646076A CN 106569783 B CN106569783 B CN 106569783B
Authority
CN
China
Prior art keywords
task
subtask
script
execution
target 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
CN201510646076.6A
Other languages
Chinese (zh)
Other versions
CN106569783A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201510646076.6A priority Critical patent/CN106569783B/en
Publication of CN106569783A publication Critical patent/CN106569783A/en
Application granted granted Critical
Publication of CN106569783B publication Critical patent/CN106569783B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the invention discloses a method and a device for executing a task script, and belongs to the technical field of computers. The method comprises the following steps: receiving an execution request of a target task; acquiring a total script of the target task, wherein at least one subtask contained in the target task and an execution sequence of each subtask are recorded in the total script of the target task; and executing the total script of the target task, and when any subtask in the at least one subtask is executed, acquiring and executing the script corresponding to the any subtask according to the corresponding relation between the pre-stored subtask and the script. By adopting the invention, the efficiency of executing the task can be improved.

Description

Method and device for executing task script
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for executing a task script.
Background
With the development of computer technology and internet technology, the development of network services is faster and faster, and each network service is provided with a respective service server on the network side. When updating and upgrading the functions of the network service, a technician needs to execute a corresponding task on a task execution server connected with the service server to implement corresponding operations on data in the service server.
In the prior art, when a technician executes a task on a task execution server, the task execution method is as follows: the technician writes a script of the task to be stored in the task execution server, and then the task execution server executes the script to realize the execution of the task. Each task has a complete and independent script.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
the content of general tasks is more, the number of related script statements is huge, the process of writing scripts is time-consuming, and the tasks can be executed only after the scripts are written, so that the efficiency of executing the tasks is low.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for executing a task script. The technical scheme is as follows:
in a first aspect, a method for executing a task script is provided, the method comprising:
receiving an execution request of a target task;
acquiring a total script of the target task, wherein at least one subtask contained in the target task and an execution sequence of each subtask are recorded in the total script of the target task;
and executing the total script of the target task, and when any subtask in the at least one subtask is executed, acquiring and executing the script corresponding to the any subtask according to the corresponding relation between the pre-stored subtask and the script.
Optionally, the method further includes:
and each time when one subtask is completely executed, acquiring the execution condition information of the executed subtask, and generating an execution log containing the execution condition information.
Optionally, after the obtaining the execution condition information of the executed subtask and generating the execution log including the execution condition information, the method further includes:
and displaying the execution log based on the execution sequence.
Optionally, the method further includes:
receiving a browsing request of the target task;
and displaying an execution sequence diagram of the target task, wherein the execution sequence diagram comprises icons of the at least one subtask arranged according to the execution sequence.
Optionally, the method further includes:
receiving a script modification request triggered by operating the execution sequence diagram of the target task, wherein the script modification request carries operation information and a subtask identifier;
and modifying the total script of the target task according to the operation information and the subtask identifier.
Optionally, the modifying the total script of the target task according to the operation information and the subtask identifier includes:
if the operation information comprises an adding identifier and an adding position, adding a subtask corresponding to the subtask identifier in the total script of the target task according to the adding position;
if the operation information comprises a deletion identifier, deleting the subtask corresponding to the subtask identifier in the total script of the target task;
and if the operation information comprises a mobile identifier and a mobile target position, modifying the position of the subtask corresponding to the subtask identifier in the execution sequence in the total script of the target task according to the mobile target position.
In a second aspect, an apparatus for executing a task script is provided, the apparatus comprising:
the first receiving module is used for receiving an execution request of a target task;
the acquisition module is used for acquiring a total script of the target task, wherein at least one subtask contained in the target task and the execution sequence of each subtask are recorded in the total script of the target task;
and the execution module is used for executing the total script of the target task, and acquiring and executing the script corresponding to any subtask according to the corresponding relation between the pre-stored subtask and the script when executing any subtask in the at least one subtask.
Optionally, the execution module is further configured to:
and each time when one subtask is completely executed, acquiring the execution condition information of the executed subtask, and generating an execution log containing the execution condition information.
Optionally, the apparatus further comprises:
and the display module is used for displaying the execution log based on the execution sequence.
Optionally, the first receiving module is further configured to: receiving a browsing request of the target task;
the displaying a block is further configured to: and displaying an execution sequence diagram of the target task, wherein the execution sequence diagram comprises icons of the at least one subtask arranged according to the execution sequence.
Optionally, the apparatus further includes a second receiving module and a modifying module, wherein:
the second receiving module is configured to receive a script modification request triggered by operating the execution sequence diagram of the target task, where the script modification request carries operation information and a subtask identifier;
and the modification module is used for modifying the total script of the target task according to the operation information and the subtask identifier.
Optionally, the modifying module includes: adding sub-modules, deleting sub-modules and modifying sub-modules, wherein:
the adding submodule is used for adding a subtask corresponding to the subtask identifier in the total script of the target task according to the adding position if the operation information comprises an adding identifier and an adding position;
the deleting submodule is used for deleting the subtask corresponding to the subtask identifier in the total script of the target task if the operation information comprises a deleting identifier;
and the modification submodule is used for modifying the position of the subtask corresponding to the subtask identifier in the execution sequence in the total script of the target task according to the mobile target position if the operation information comprises the mobile identifier and the mobile target position.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, an execution request of a target task is received, a total script of the target task is obtained, wherein at least one subtask included in the target task and an execution sequence of each subtask are recorded in the total script of the target task, the total script of the target task is executed, and when any subtask in the at least one subtask is executed, a script corresponding to the any subtask is obtained and executed according to a corresponding relation between the prestored subtask and the script. Therefore, when the tasks are executed in the background, scripts can be written in advance for subtasks which may occur repeatedly in different tasks, and when the task total script is written, only the script of the subtask which needs to be called needs to be recorded, but the script of the subtask does not need to be written repeatedly, so that the writing time of the task total script is shortened, and the efficiency of executing the tasks can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart of a method for executing a task script according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating operation of a script for executing tasks according to an embodiment of the present invention;
FIG. 3 is an operational diagram of executing a task script according to an embodiment of the present invention;
FIG. 4 is an operational diagram of executing a task script according to an embodiment of the present invention;
FIG. 5 is an operational diagram of executing a task script according to an embodiment of the present invention;
FIG. 6 is a flowchart of a method for executing a task script according to an embodiment of the present invention;
FIG. 7 is a block diagram of an apparatus for executing a task script according to an embodiment of the present invention;
FIG. 8 is a block diagram of an apparatus for executing a task script according to an embodiment of the present invention;
FIG. 9 is a block diagram of an apparatus for executing a task script according to an embodiment of the present invention;
FIG. 10 is a block diagram of an apparatus for executing a task script according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a task execution server according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Example one
An embodiment of the present invention provides a method for executing a task script, and as shown in fig. 1, a processing flow of the method may include the following steps:
step 101, receiving an execution request of a target task.
102, acquiring a total script of the target task, wherein at least one subtask included in the target task and an execution sequence of each subtask are recorded in the total script of the target task.
And 103, executing the total script of the target task, and acquiring and executing the script corresponding to any subtask according to the corresponding relation between the pre-stored subtask and the script when the total script of the target task is executed to any subtask in at least one subtask.
In the embodiment of the invention, an execution request of a target task is received, a total script of the target task is obtained, wherein at least one subtask included in the target task and an execution sequence of each subtask are recorded in the total script of the target task, the total script of the target task is executed, and when any subtask in the at least one subtask is executed, a script corresponding to the any subtask is obtained and executed according to a corresponding relation between the prestored subtask and the script. Therefore, when the tasks are executed in the background, scripts can be written in advance for subtasks which may occur repeatedly in different tasks, and when the task total script is written, only the script of the subtask which needs to be called needs to be recorded, but the script of the subtask does not need to be written repeatedly, so that the writing time of the task total script is shortened, and the efficiency of executing the tasks can be improved.
Example two
The embodiment of the invention provides a method for executing a task script, and an execution main body of the method can be a task execution server. The task execution server may be a server that manages the service server by executing a target task, and may be connected to a control terminal, where the target task may be a task that manages a network service. The task execution server may be provided with a processor, a memory, a transceiver, and the like. The processor may be used to perform the processing of the process of the task script, the memory may be used to store data required and generated during the processing, and the transceiver may be used to receive and transmit data. In this embodiment, the detailed description of the scheme is performed by taking the execution main body as the task execution server as an example, and other cases are similar to this, and the description of this embodiment is not repeated.
The process flow shown in fig. 1 will be described in detail below with reference to specific embodiments, and the contents may be as follows:
step 101, receiving an execution request of a target task.
The target task is a task executed by a technician when managing the network service, and can be a background task such as service online, service deployment, service capacity expansion and the like. The task execution server may store related information of the task, which may include a general script of the task, a label (ID) of the task, a name of the task, a type of the task, an updater, an update time, a remark, and the like.
In implementation, a technician may operate the terminal to access the task execution server through the browser, and a task selection key may be displayed in a main interface of the task server. The task selection button may be used to trigger the display of an interface for task selection. When a technician executes a certain target task, the task selection key can be clicked, an interface for displaying task selection is triggered, as shown in fig. 2, a list of tasks and a selection frame corresponding to each task are displayed in the interface for task selection, the technician can search the target task in the task list, then click the selection frame of the target task, and trigger the terminal to display a number matching mark in the selection frame, if the task is to be executed, the execution key can be clicked, the trigger terminal sends an execution request to the task execution server, and after the task execution server receives the execution request of the target task, the task server starts to acquire a total script of the target task.
In addition, when the task list does not include the target task, a technician can click a newly added key in the interface and can trigger the terminal to display the task script creation interface, at this time, the technician can edit the new task in the interface, and the task adding process will be described in detail later.
102, acquiring a total script of the target task, wherein at least one subtask included in the target task and an execution sequence of each subtask are recorded in the total script of the target task.
The subtasks may be used to perform a simple operation, such as uploading data to a server, changing a parameter format, and the like, and the scripts of the subtasks may be written using Python language (an object-oriented and transliterated computer programming language), and the scripts of the subtasks may include a statement (also referred to as an interface function) for the subtasks to call an input parameter, where the statement for calling the input parameter may be used to call an output parameter of an executed subtask in the total script of the target task or an initial parameter of the total script of the target task. The subtasks can be written in advance by technicians, a screwdriver task library is established, and related information of the subtasks can be stored in the subtask library and can comprise scripts of the subtasks, labels (ID) of the subtasks, names of the scripts, names of classes, names of functions, remarks and the like. The name of the subtask can be used for a technician to find the subtask more conveniently, the name of the subtask script, the name of the class to which the subtask belongs, and the name of the function contained in the subtask can be used for calling the script of the subtask through the information when the total script of the task is executed, and remarks can be used for marking the matters required to use the subtask by the technician.
In implementation, as shown in fig. 3, after receiving a target task execution request, the task execution server may obtain a total script of the target task, and record, in the total script, identifiers of sub tasks included in the total script according to an execution sequence, and may also record an input parameter (which may be referred to as an initial parameter) of a first sub task to be executed, where the input parameter of the sub task may be selected in a process of creating the total script of the target task and is recorded in the total script of the target task. After the total script of the target task is obtained, all the subtasks included in the total script of the target task can be further obtained, an execution sequence diagram is generated and sent to the terminal based on all the obtained subtasks, the execution sequence diagram includes the identifiers of the subtasks and the execution sequence of each subtask, the execution sequence is marked by sequence numbers 1, 2 and 3 … …, the subtask corresponding to the sequence number 1 is the first executed subtask, the subtask corresponding to the sequence number 2 is the second executed subtask, and so on, the execution sequence of each subtask is marked.
And 103, executing the total script of the target task, and acquiring and executing the script corresponding to any subtask according to the corresponding relation between the pre-stored subtask and the script when the total script of the target task is executed to any subtask in at least one subtask.
In implementation, as shown in fig. 3, the interface for executing the target task may include an execution sequence diagram of the target task and an execution status log display area. A pause execution key, a forced execution selected step key, a forced execution starting key from a selected step, and a task reset to a non-execution key may be displayed on the right side of the execution sequence diagram of the target task; and displaying a selection frame corresponding to each subtask on the left side of the execution sequence diagram. The pause execution key may be used to trigger pausing of the task being executed; the force selected step button may be used to trigger execution of the selected step; forcing the execute from selected step button can be used to trigger a general script that executes the task from selected step; resetting a task to an unexecuted key may be used to trigger deletion of the execution log. The execution log display area can display a task execution log key, and the task execution log key can be used for triggering and displaying the execution log.
After the total script of the task is obtained, the task engine controls the total script of the executed task, firstly, the subtask with the sequence number of 1 is executed, when the subtask with the sequence number of 1 is executed, the script of the subtask is dynamically called and executed by a dynamic calling statement in the task engine according to the identifier (such as a script class name and a script name) of the subtask, when the subtask with the sequence number of 1 is executed, the subtask with the sequence number of 2 is executed, and so on, all the subtasks are executed in sequence according to the execution sequence number, wherein when each subtask is executed, the input parameter of the subtask can be called by the calling parameter statement contained in the subtask, and the output parameter of the executed subtask in the total script of the target task and the input parameter (initial parameter) of the first subtask can be called according to the requirement.
In addition, if the technician requests the target task to be executed from a certain subtask, the technician may click on the selection box corresponding to the subtask, and after the number matching mark is displayed in the selection box, may click on the execution start button from the selected step, and then may start the target task from the selected subtask.
Optionally, in the process of executing the total script of the target task, the execution condition information of each sub-task may be recorded, and the corresponding processing manner is as follows: and when one subtask is completely executed, acquiring the execution condition information of the executed subtask, and generating an execution log containing the execution condition information.
In implementation, as shown in fig. 3, in order to facilitate a technician to view the execution condition of the target task, in the overall script process of executing the target task, the execution condition information of each sub-task may be recorded, or the execution condition information of the target task as a whole may be recorded, and after the execution condition information is obtained, a log including the execution condition information may be generated.
The execution condition information can be divided into three types, which are respectively: the parameter information, the warning information, and the error information may be generated as a parameter log (log including the parameter information), a warning log (log including the warning information), and an error log (log including the error information) corresponding to each other. The parameter information may be information of input parameters and return values of respective subtasks, and the warning information may be information that an error occurs during execution but execution can be continued; the error information may be information that an error occurs during execution and that execution is automatically terminated.
Alternatively, the execution log may be displayed based on the execution order.
In implementation, when a technician views all execution logs of a target task, all log types can be selected, then a task execution log key is clicked, a terminal is triggered to send a request for acquiring the execution logs to a task execution server, and then after the terminal receives the execution logs, the execution logs of all subtasks can be displayed in an execution situation log display area according to an execution sequence. If the technician only views a certain type of execution log, the technician can click on a selection box of the type of the log to be viewed and then click on a task execution log button, and at this time, the execution logs of the type are displayed in the execution case log display area according to the execution sequence.
In addition, the execution log of a certain subtask may be viewed in the task execution interface, and the subtask may be selected by clicking the selection box of the subtask, and then the task execution log button may be clicked to display the execution log of the subtask acquired from the task execution server in the execution log display area.
The embodiment also provides a process for creating the target task total script, and the processing mode of the creating process can be as follows:
in implementation, as shown in fig. 2, a technician may create a total script of a target task, and when the technician adds a total script of a new target task, the technician may open a task selection interface, in which a browse key, an add key, a delete key, and an inquiry key are displayed. The browsing key can be used for triggering and displaying an execution sequence diagram of a certain task, the newly-added key can be used for triggering and displaying an interface for creating a total script of the task, the deleting key can be used for triggering and deleting the selected task from the task list, and the inquiring key can be used for triggering and displaying the inquired task after inputting information such as the type, the label or the name of the task to be searched in the inquiring input box.
As shown in fig. 4, when creating the total script of the target task, the newly added key may be clicked in the selected task interface, and the basic information filling interface of the task is triggered and displayed, where an input frame of the task name, an input frame of the task type, an input frame of the task remark, a completion key, and a next key are displayed in the interface. Then, the name of the target task is input in the input box of the task name, the type of the target task is input in the input box of the task type, and the items required to be paid attention when the target task is executed are input in the input box of the task remark. And if all the input is finished, the finishing key can be clicked, the triggering terminal sends a storage request to the task execution server, the task execution server stores the basic information of the target task after receiving the storage request, and then the next key can be clicked to trigger and display an initial parameter selection interface of the task. The initial parameter is an input parameter of a first subtask to be executed in the total script of the target task, and the initial parameter may include multiple types, may be a constant, or may be a variable.
The selection interface of the initial parameters displays a stored initial parameter list, a newly added key, a modified key, a refreshed key, a deleted key, a parameter preview part, a previous step key, a completed key and a next step key. The stored initial parameter list may include a parameter label (ID), a parameter type, a parameter name, and a parameter tag (a subtask type to which the parameter applies) for identifying the parameter. The newly added key can be used for triggering and displaying an interface for inputting the initial parameters; the modification key can be used for triggering and displaying an interface for modifying the initial parameters; the refresh key can be used for triggering and displaying the modified initial parameter list; the parameter preview portion may be used to preview the initial parameters of the selection. The last step key can be used for triggering the current display interface to return to the interface for filling the basic information of the task, and the completion key can be used for triggering the storage of the selected initial parameters. The next step may be to trigger the display of a subtask selection interface.
When a certain stored initial parameter is selected, a selection box corresponding to the initial parameter can be clicked, and the terminal is triggered to display the selected parameter in the parameter preview area. If the parameter list does not have the needed initial parameters, the newly added key can be clicked, an interface for inputting the initial parameters is triggered and displayed, the initial parameters can be input, then the determined key is clicked, the input initial parameters are displayed in the parameter preview area, the finishing key can be clicked, the trigger terminal sends a storage request to the task execution server, the selected initial parameters are stored after the task execution server receives the storage request, then the next key is clicked, and a subtask selection interface is triggered and displayed.
As shown in fig. 5, a subtask list, a task total script preview area, an additional button, a refresh button, a delete button, a previous button, a complete button, and a next button are displayed in the subtask selection interface. The subtask selection list includes a task number (ID), a task name, a task step, operation 1, operation 2, and remarks of the selected subtask, and the total script preview area may be used to display the identifier of the selected subtask and the execution sequence of the subtask, where the execution sequence is marked by sequence numbers 1, 2, and 3 … …, that is, an execution sequence diagram. The newly added key can be used for triggering and displaying a subtask adding interface; the refresh key can be used for triggering and displaying the updated subtask list; the delete key can be used for triggering and displaying a dialog box containing the confirm key and the cancel key, the next key can be used for triggering and displaying a task script interface, and the operation 1 and the operation 2 correspond to the up-moving key and the down-moving key respectively.
When the total script of the target task is newly added, the newly added key can be clicked, a subtask adding interface is triggered and displayed, a selection box corresponding to the subtask to be selected can be clicked in the subtask adding interface, a dialog box for displaying the adding position is triggered, a corresponding sequence number can be input in the dialog box, then the determination key is clicked, and the selected subtask is displayed in the total script preview area and the subtask list according to the sequence number by the trigger terminal. If the position of the subtask is to be moved, the execution sequence of the subtask can be adjusted by clicking the up and down buttons displayed in the subtask list. If the subtask needs to be deleted, a selection box corresponding to the subtask to be deleted can be clicked, then a deletion key is clicked, a dialog box comprising a confirmation key and a cancel key is triggered and displayed, the confirmation key can be clicked, a trigger terminal sends a task deletion request to a task execution server, and the task execution server deletes the selected subtask from the total script according to the identifier of the subtask after receiving the task deletion request. After the selection of the subtask is completed, the next key can be clicked, and an interface for displaying the completed task script is triggered.
In addition, when the technician wants to execute a new target task, the technician may also modify the total script of the already stored task, replace a subtask whose total script of the already stored task is different from the total script of the target task, and change the subtask whose total script of the already stored task is different from the total script of the target task into the total script of the target task.
And displaying an execution sequence chart of the total script of the target task, a current execution key and a storage key in a script interface for completing the task. If the technician does not execute the total script of the target task, the storage button can be clicked, the terminal is triggered to send a storage request to the task execution server, and interfaces of all created task lists are displayed.
In this embodiment, the total script of the created target task can be browsed and modified. As shown in fig. 6, the corresponding processing may be as follows:
step 201, receiving a browsing request of the target task.
In implementation, if the technician wants to view the total script of the target task, the technician may first find the target task in the task list, click the selection box of the target task to select the target task, and then click the browse button, which may trigger the display of the total script of the target task.
Step 202, displaying an execution sequence diagram of the target task, wherein the execution sequence diagram comprises icons of at least one subtask arranged according to the execution sequence.
In implementation, after acquiring the total script of the target task, the task execution server generates and sends an execution sequence diagram to the terminal based on all subtasks recorded in the total script according to the execution sequence, after receiving the execution sequence diagram, the terminal displays the execution sequence diagram, and the execution sequence diagram displays the identifier and the corresponding sequence number of each subtask, where the sequence numbers 1, 2, and 3 … … mark the execution sequence of each subtask, the subtask corresponding to the sequence number 1 is the first executed subtask, the subtask corresponding to the sequence number 2 is the second executed subtask, and so on, mark the execution sequence of each subtask.
If the technician finds that the total script of the target task has an error in the process of browsing the target task, the total script of the target task can be modified, and the corresponding processing mode can be as follows:
step 203, receiving a script modification request triggered by the execution sequence diagram of the operation target task, where the script modification request carries operation information and a subtask identifier.
In implementation, if a technician finds that a certain subtask in the total script of a target task has an error in the process of browsing the target task, the technician can click a selection box for executing the subtask in a sequence diagram, trigger to display a number matching mark in the selection box, then click a corresponding modification operation key, trigger a terminal to send a script modification request to a task execution server, and after receiving the script modification request, the task execution server operates the corresponding subtask according to operation information and a subtask identifier carried in the script modification request.
And step 204, modifying the total script of the target task according to the operation information and the subtask identifier.
In implementation, after the task execution server receives the script modification request, the task execution server may modify the total script of the target task according to the operation information and the subtask identifier. The script modification request can be a newly added task request, a task deletion request and a task movement request, the newly added task request can be a request sent by clicking a newly added key, and the corresponding operation information is a newly added task; the task deleting request can be a request sent by clicking a deleting key, and the corresponding operation information is a deleting task; the mobile task request may be a request sent by clicking an up-shift or down-shift key, and the corresponding operation information is a mobile task.
Optionally, a modification operation may be performed on the total script of the target task according to the operation information and the sub-task identifier, and correspondingly, the processing in step 204 may be: if the operation information comprises the adding identification and the adding position, adding a subtask corresponding to the subtask identification in the total script of the target task according to the adding position; if the operation information comprises a deletion identifier, deleting the subtask corresponding to the subtask identifier in the total script of the target task; and if the operation information comprises the mobile identifier and the mobile target position, modifying the position of the subtask corresponding to the subtask identifier in the execution sequence in the total script of the target task according to the mobile target position.
In implementation, a technician may click a newly added key to trigger the terminal to display a subtask addition interface, then the technician may click a selection box corresponding to a subtask to be added to trigger a dialog box displaying an addition position of the subtask, the position to be added to the subtask may be selected in the dialog box, the addition position may be an input sequence number corresponding to the task, then a determination key is clicked, the trigger terminal sends a newly added task request to the task execution server, the task execution server receives the newly added task request, records the subtask selected by the technician in the total script according to the sequence number, updates an execution sequence therein, sends the updated execution sequence diagram to the terminal, and the terminal displays the updated execution sequence diagram.
The technical personnel can click a selection box corresponding to the subtask to be deleted, then click a deletion key, trigger the terminal to display a dialog box containing a confirmation key and a cancel key, click the confirmation key, trigger the terminal to send a task deletion request to the server, after the task execution server receives the task deletion request, delete the subtask selected by the technical personnel from the total script according to the identifier of the subtask, update the execution sequence in the subtask, send the updated execution sequence diagram to the terminal, and display the updated execution sequence diagram by the terminal.
If the technician moves the position of a certain subtask, the terminal can be triggered to send a moving task request to the server by clicking an upward moving key or a downward moving key corresponding to the subtask, after the task execution server receives the upward moving request or the downward moving request, the subtask selected by the technician is moved to a target position according to the identifier of the subtask, the execution sequence in the target position is updated, the updated execution sequence diagram is sent to the terminal, and the terminal displays the updated execution sequence diagram.
In the embodiment of the invention, an execution request of a target task is received, a total script of the target task is obtained, wherein at least one subtask included in the target task and an execution sequence of each subtask are recorded in the total script of the target task, the total script of the target task is executed, and when any subtask in the at least one subtask is executed, a script corresponding to the any subtask is obtained and executed according to a corresponding relation between the prestored subtask and the script. Therefore, when the tasks are executed in the background, scripts can be written in advance for subtasks which may occur repeatedly in different tasks, and when the task total script is written, only the script of the subtask which needs to be called needs to be recorded, but the script of the subtask does not need to be written repeatedly, so that the writing time of the task total script is shortened, and the efficiency of executing the tasks can be improved.
EXAMPLE III
Based on the same technical concept, an embodiment of the present invention further provides an apparatus for executing a task script, as shown in fig. 7, the apparatus includes:
a first receiving module 710, configured to receive an execution request of a target task;
an obtaining module 720, configured to obtain a total script of the target task, where the total script of the target task records at least one subtask included in the target task and an execution sequence of each subtask;
the execution module 730 is configured to execute the total script of the target task, and when any subtask in the at least one subtask is executed, obtain and execute a script corresponding to the any subtask according to a correspondence relationship between a pre-stored subtask and a script.
Optionally, the executing module 730 is further configured to:
and each time when one subtask is completely executed, acquiring the execution condition information of the executed subtask, and generating an execution log containing the execution condition information.
Optionally, as shown in fig. 8, the apparatus further includes:
a display module 740 for: and displaying the execution log based on the execution sequence.
Optionally, the first receiving module 710 is further configured to: receiving a browsing request of the target task;
the display block 740 is further configured to: and displaying an execution sequence diagram of the target task, wherein the execution sequence diagram comprises icons of the at least one subtask arranged according to the execution sequence.
Optionally, as shown in fig. 9, the apparatus further includes a second receiving module 750 and a modifying module 760, where:
the second receiving module 750 is configured to receive a script modification request triggered by operating the execution sequence diagram of the target task, where the script modification request carries operation information and a subtask identifier;
and the modifying module 760 is configured to modify the total script of the target task according to the operation information and the sub-task identifier.
Optionally, as shown in fig. 10, the modifying module 760 includes: add sub-module 761, delete sub-module 762, and modify sub-module 763, wherein:
the adding sub-module 761 is configured to add, according to an adding position, a sub-task corresponding to the sub-task identifier in the total script of the target task if the operation information includes the adding identifier and the adding position;
the delete sub-module 762 is configured to delete, if the operation information includes a delete identifier, a sub-task corresponding to the sub-task identifier in the total script of the target task;
the modifying submodule 763 is configured to, if the operation information includes a mobile identifier and a mobile target location, modify, according to the mobile target location, a location of a subtask corresponding to the subtask identifier in the execution sequence in the total script of the target task.
In the embodiment of the invention, an execution request of a target task is received, a total script of the target task is obtained, wherein at least one subtask included in the target task and an execution sequence of each subtask are recorded in the total script of the target task, the total script of the target task is executed, and when any subtask in the at least one subtask is executed, a script corresponding to the any subtask is obtained and executed according to a corresponding relation between the prestored subtask and the script. Therefore, when the tasks are executed in the background, scripts can be written in advance for subtasks which may occur repeatedly in different tasks, and when the task total script is written, only the script of the subtask which needs to be called needs to be recorded, but the script of the subtask does not need to be written repeatedly, so that the writing time of the task total script is shortened, and the efficiency of executing the tasks can be improved.
It should be noted that: in the device for executing a task script according to the above embodiment, when the task script is executed, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the functions described above. In addition, the device for executing the task script and the method embodiment for executing the task script provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Example four
Referring to fig. 11, a schematic structural diagram of a task execution server according to an embodiment of the present invention is shown, where the task execution server may be used to implement the method for executing a task script provided in the foregoing embodiment. Specifically, the method comprises the following steps:
the task execution server 1900 may vary widely in configuration or performance and may include one or more Central Processing Units (CPUs) 1922 (e.g., one or more processors) and memory 1932, one or more storage media 1930 (e.g., one or more mass storage devices) storing applications 1942 or data 1944. Memory 1932 and storage medium 1930 can be, among other things, transient or persistent storage. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a series of instruction operations in a task execution server. Further, the central processor 1922 may be configured to communicate with the storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the task execution server 1900.
The task execution server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input-output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
Task execution server 1900 may include memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for:
receiving an execution request of a target task;
acquiring a total script of the target task, wherein at least one subtask contained in the target task and an execution sequence of each subtask are recorded in the total script of the target task;
and executing the total script of the target task, and when any subtask in the at least one subtask is executed, acquiring and executing the script corresponding to the any subtask according to the corresponding relation between the pre-stored subtask and the script.
Optionally, the method further includes:
and each time when one subtask is completely executed, acquiring the execution condition information of the executed subtask, and generating an execution log containing the execution condition information.
Optionally, after the obtaining the execution condition information of the executed subtask and generating the execution log including the execution condition information, the method further includes:
and displaying the execution log based on the execution sequence.
Optionally, the method further includes:
receiving a browsing request of the target task;
and displaying an execution sequence diagram of the target task, wherein the execution sequence diagram comprises icons of the at least one subtask arranged according to the execution sequence.
Optionally, the method further includes:
receiving a script modification request triggered by operating the execution sequence diagram of the target task, wherein the script modification request carries operation information and a subtask identifier;
and modifying the total script of the target task according to the operation information and the subtask identifier.
Optionally, the modifying the total script of the target task according to the operation information and the subtask identifier includes:
if the operation information comprises an adding identifier and an adding position, adding a subtask corresponding to the subtask identifier in the total script of the target task according to the adding position;
if the operation information comprises a deletion identifier, deleting the subtask corresponding to the subtask identifier in the total script of the target task;
and if the operation information comprises a mobile identifier and a mobile target position, modifying the position of the subtask corresponding to the subtask identifier in the execution sequence in the total script of the target task according to the mobile target position.
In the embodiment of the invention, an execution request of a target task is received, a total script of the target task is obtained, wherein at least one subtask included in the target task and an execution sequence of each subtask are recorded in the total script of the target task, the total script of the target task is executed, and when any subtask in the at least one subtask is executed, a script corresponding to the any subtask is obtained and executed according to a corresponding relation between the prestored subtask and the script. Therefore, when the tasks are executed in the background, scripts can be written in advance for subtasks which may occur repeatedly in different tasks, and when the task total script is written, only the script of the subtask which needs to be called needs to be recorded, but the script of the subtask does not need to be written repeatedly, so that the writing time of the task total script is shortened, and the efficiency of executing the tasks can be improved.
It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The present invention is not limited to the above preferred embodiments, and any modifications, equivalent replacements, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (13)

1. A method of executing a task script, the method being performed by a task execution server, the method comprising:
receiving an execution request of a target task, wherein a terminal accesses the task execution server through a browser, displays a task selection interface, displays a task list in the task selection interface, inquires the target task in the task list, and triggers to send the execution request to the task execution server by selecting the target task; when the task list does not include the target task, the terminal displays a task script creating interface to create a total script of the target task, wherein at least one subtask included in the target task and an execution sequence of each subtask are recorded in the total script of the target task, and the creating of the total script of the target task includes: replacing different subtasks in the total script of the stored task and the total script of the target task to generate the total script of the target task;
acquiring a total script of the target task;
and executing the total script of the target task, and calling and executing the script corresponding to any subtask according to the corresponding relation between the pre-stored subtask and the script when executing any subtask in the at least one subtask.
2. The method of claim 1, further comprising:
and each time when one subtask is completely executed, acquiring the execution condition information of the executed subtask, and generating an execution log containing the execution condition information.
3. The method according to claim 2, wherein after the obtaining of the execution condition information of the executed subtask and the generating of the execution log including the execution condition information, the method further comprises:
and displaying the execution log based on the execution sequence.
4. The method of claim 1, further comprising:
receiving a browsing request of the target task;
and displaying an execution sequence diagram of the target task, wherein the execution sequence diagram comprises icons of the at least one subtask arranged according to the execution sequence.
5. The method of claim 4, further comprising:
receiving a script modification request triggered by operating the execution sequence diagram of the target task, wherein the script modification request carries operation information and a subtask identifier;
and modifying the total script of the target task according to the operation information and the subtask identifier.
6. The method of claim 5, wherein the modifying the total script of the target task according to the operation information and the subtask identifier comprises:
if the operation information comprises an adding identifier and an adding position, adding a subtask corresponding to the subtask identifier in the total script of the target task according to the adding position;
if the operation information comprises a deletion identifier, deleting the subtask corresponding to the subtask identifier in the total script of the target task;
and if the operation information comprises a mobile identifier and a mobile target position, modifying the position of the subtask corresponding to the subtask identifier in the execution sequence in the total script of the target task according to the mobile target position.
7. An apparatus for executing a task script, the apparatus comprising:
the system comprises a first receiving module, a first task execution module and a second receiving module, wherein the first receiving module is used for receiving an execution request of a target task, a terminal accesses a task execution server through a browser, the terminal displays a task selection interface, a task list is displayed in the task selection interface, the target task is inquired in the task list, and the execution request is triggered to be sent to the task execution server by selecting the target task; when the task list does not include the target task, the terminal displays a task script creating interface to create a total script of the target task, wherein at least one subtask included in the target task and an execution sequence of each subtask are recorded in the total script of the target task, and the creating of the total script of the target task includes: replacing different subtasks in the total script of the stored task and the total script of the target task to generate the total script of the target task;
the acquisition module is used for acquiring the total script of the target task;
and the execution module is used for executing the total script of the target task, and calling and executing the script corresponding to any subtask according to the corresponding relation between the pre-stored subtask and the script when executing any subtask in the at least one subtask.
8. The apparatus of claim 7, wherein the execution module is further configured to:
and each time when one subtask is completely executed, acquiring the execution condition information of the executed subtask, and generating an execution log containing the execution condition information.
9. The apparatus of claim 8, the apparatus further comprising:
and the display module is used for displaying the execution log based on the execution sequence.
10. The apparatus of claim 7, wherein the first receiving module is further configured to: receiving a browsing request of the target task;
the apparatus further comprises a display module configured to: and displaying an execution sequence diagram of the target task, wherein the execution sequence diagram comprises icons of the at least one subtask arranged according to the execution sequence.
11. The apparatus of claim 10, further comprising a second receiving module and a modifying module, wherein:
the second receiving module is configured to receive a script modification request triggered by operating the execution sequence diagram of the target task, where the script modification request carries operation information and a subtask identifier;
and the modification module is used for modifying the total script of the target task according to the operation information and the subtask identifier.
12. The apparatus of claim 11, wherein the modification module comprises: adding sub-modules, deleting sub-modules and modifying sub-modules, wherein:
the adding submodule is used for adding a subtask corresponding to the subtask identifier in the total script of the target task according to the adding position if the operation information comprises an adding identifier and an adding position;
the deleting submodule is used for deleting the subtask corresponding to the subtask identifier in the total script of the target task if the operation information comprises a deleting identifier;
and the modification submodule is used for modifying the position of the subtask corresponding to the subtask identifier in the execution sequence in the total script of the target task according to the mobile target position if the operation information comprises the mobile identifier and the mobile target position.
13. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program executable by a processor to implement the method of executing a task script of any one of claims 1-6.
CN201510646076.6A 2015-10-08 2015-10-08 Method and device for executing task script Active CN106569783B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510646076.6A CN106569783B (en) 2015-10-08 2015-10-08 Method and device for executing task script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510646076.6A CN106569783B (en) 2015-10-08 2015-10-08 Method and device for executing task script

Publications (2)

Publication Number Publication Date
CN106569783A CN106569783A (en) 2017-04-19
CN106569783B true CN106569783B (en) 2021-05-28

Family

ID=58506486

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510646076.6A Active CN106569783B (en) 2015-10-08 2015-10-08 Method and device for executing task script

Country Status (1)

Country Link
CN (1) CN106569783B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107147637B (en) * 2017-05-05 2019-01-08 腾讯科技(深圳)有限公司 A kind of task execution request processing method, device and computer storage medium
CN107608774A (en) * 2017-09-08 2018-01-19 新智云数据服务有限公司 A kind of method for scheduling task, device, equipment and storage medium
CN108170512A (en) * 2017-12-27 2018-06-15 德阳源创能源科技有限公司 Script drives analysis method and device
CN108776604A (en) * 2018-05-23 2018-11-09 网易(杭州)网络有限公司 The execution method and system of goal task
CN109189687A (en) * 2018-08-31 2019-01-11 成都品果科技有限公司 A kind of method and apparatus obtaining Android log
CN109492019B (en) * 2018-10-16 2024-03-08 平安科技(深圳)有限公司 Service request response method, device, computer equipment and storage medium
CN111474913B (en) * 2019-01-23 2021-07-20 北京新能源汽车股份有限公司 Program operation monitoring method and device and electric automobile
CN109918152A (en) * 2019-03-18 2019-06-21 中科麦迪人工智能研究院(苏州)有限公司 Task executing method, device, server and storage medium based on policy flow
CN110018860B (en) * 2019-04-04 2022-11-08 深圳市永兴元科技股份有限公司 Workflow management method, device, equipment and computer storage medium
CN110471718B (en) * 2019-07-04 2023-07-18 深圳市共进电子股份有限公司 Task processing method and device
CN110489170A (en) * 2019-09-06 2019-11-22 北京中亦安图科技股份有限公司 A kind of AIX system installation method and device
CN112181823A (en) * 2020-09-25 2021-01-05 建信金融科技有限责任公司 Test script execution method and device, server, electronic device and medium
CN112131247A (en) * 2020-09-30 2020-12-25 中国银行股份有限公司 Method and device for safety isolation of host data query
CN112835681A (en) * 2021-02-25 2021-05-25 北京顶象技术有限公司 Front-end script construction method and device and controller

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1749960A (en) * 2004-09-17 2006-03-22 微软公司 Active content wizard execution with improved conspicuity

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1713192A (en) * 2004-06-25 2005-12-28 国际商业机器公司 Method and device for processing logic mode establishment and carrying out
CN102867069A (en) * 2012-09-28 2013-01-09 浙江图讯科技有限公司 Method and system for executing database scripts based on SQL (structured query language)
CN103942099B (en) * 2014-04-30 2017-11-28 广州唯品会网络技术有限公司 Executing tasks parallelly method and device based on Hive

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1749960A (en) * 2004-09-17 2006-03-22 微软公司 Active content wizard execution with improved conspicuity

Also Published As

Publication number Publication date
CN106569783A (en) 2017-04-19

Similar Documents

Publication Publication Date Title
CN106569783B (en) Method and device for executing task script
CN108304201B (en) Object updating method, device and equipment
US9003312B1 (en) Method and apparatus for updating a web-based user interface
US7316000B2 (en) Interactive agent for a topological multi-tier business application composer
CN109446570B (en) Business process display method, device, computer equipment and storage medium
US11093242B2 (en) Automatically mapping data while designing process flows
US11301366B2 (en) Test automation systems and methods using logical identifiers
CN111068328A (en) Game advertisement configuration table generation method, terminal device and medium
US11150919B2 (en) Logging of scripts executed in an information technology workflow orchestration system
EP3738047B1 (en) Interactive and non-interactive execution and rendering of templates to automate control and exploration across systems
CN113971037A (en) Application processing method and device, electronic equipment and storage medium
JP2021511572A (en) Recommendation of visual and execution templates to enable system-wide control and automation of data exploration
CN109814863A (en) A kind of processing method, device, computer equipment and computer storage medium for requesting returned data
JP2023070148A (en) Systems and methods for dynamically binding robotic process automation (RPA) robots to resources
EP2924565A1 (en) Web-application-launch application programming interface
CN116893807A (en) System and method for designing a robotic flow automation robot using a browser
CN111831320A (en) Plug-in management method and device, electronic equipment and storage medium
CN111796851A (en) Client base library updating method and device, electronic equipment and storage medium
CN114358742A (en) Workflow execution method, device, equipment and storage medium
CN111125205A (en) Signboard data display method, terminal and storage medium
CN113504898B (en) Front-end assembly rapid processing method, system and computer storage medium for realizing business arrangement
US10642629B2 (en) Web-application-launch application programming interfaces
CN110597549A (en) Searching method, device and equipment in code engineering and readable storage medium
CN111124386A (en) Unity-based animation event processing method, device, equipment and storage medium
CN110019034A (en) Formfile loading method and device

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