CN112363814A - Task scheduling method and device, computer equipment and storage medium - Google Patents

Task scheduling method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112363814A
CN112363814A CN202011314173.2A CN202011314173A CN112363814A CN 112363814 A CN112363814 A CN 112363814A CN 202011314173 A CN202011314173 A CN 202011314173A CN 112363814 A CN112363814 A CN 112363814A
Authority
CN
China
Prior art keywords
task
reset
script
association
tree
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.)
Pending
Application number
CN202011314173.2A
Other languages
Chinese (zh)
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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202011314173.2A priority Critical patent/CN112363814A/en
Publication of CN112363814A publication Critical patent/CN112363814A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24564Applying rules; Deductive queries
    • G06F16/24566Recursive queries
    • 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
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution

Abstract

The embodiment of the application belongs to the field of research and development management, and relates to a task scheduling method, which comprises the steps of receiving a task resetting instruction, wherein the task resetting instruction comprises a task to be processed and task resetting information; performing recursive query on the task to be processed in a pre-established task association table to obtain a task association tree; acquiring a task script of each task in the task association tree; performing script analysis on the obtained task script, and determining a task to be reset from the task association tree according to the task resetting information; and issuing and executing the task to be reset. The application also provides a task scheduling device, computer equipment and a storage medium. In addition, the application also relates to a block chain technology, and the task association table can be stored in the block chain. The method and the device improve the accuracy of task scheduling.

Description

Task scheduling method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of research and development management technologies, and in particular, to a task scheduling method and apparatus, a computer device, and a storage medium.
Background
Production activities can be divided in task units, and with the development of computer technology, the production activities are increasingly controlled by computers. For example, in projects such as big data projects, business intelligence projects, data mining projects, financial settlement and the like, a task management platform can be built according to actual scenes, and the task management platform performs relationship control and scheduling execution of tasks, including deployment and handover, deployment and online, timing execution, re-execution and the like of the tasks.
However, control and scheduling of conventional task management platforms is limited to a single task. When a certain task is modified or has an error, the downstream task associated with the task needs to be reset, i.e. re-issued. When the number of modified or error tasks is large, a large number of tasks are issued, errors or omissions of related tasks are easy to occur, and the accuracy of task scheduling is low.
Disclosure of Invention
An embodiment of the present application provides a task scheduling method, a task scheduling device, a computer device, and a storage medium, so as to solve the problem of low task scheduling accuracy.
In order to solve the above technical problem, an embodiment of the present application provides a task scheduling method, which adopts the following technical solutions:
receiving a task resetting instruction, wherein the task resetting instruction comprises a task to be processed and task resetting information;
performing recursive query on the task to be processed in a pre-established task association table to obtain a task association tree;
acquiring a task script of each task in the task association tree;
performing script analysis on the obtained task script, and determining a task to be reset from the task association tree according to the task resetting information;
and issuing and executing the task to be reset.
Further, before the step of performing recursive query on the task to be processed in the pre-established task association table to obtain the task association tree, the method further includes:
acquiring a task script deployed in a data management platform;
extracting task associated information from the obtained task script;
identifying a first task and a second task in the task association information, wherein the first task is an upstream task of the second task;
and obtaining a task association table according to the determined first task and the second task.
Further, the step of performing script analysis on the obtained task script and determining the task to be reset from the task association tree according to the task resetting information includes:
taking a root node in the task association tree as an initial node, and acquiring an association task pair of the initial node;
for each associated task pair, performing semantic recognition on a task script of the task in the associated task pair to determine an access statement in the task script;
determining whether a downstream task in the associated task pair is a task to be reset or not according to the access statement and the task reset information;
and when the downstream task is the task to be reset, continuously searching the task to be reset by taking the downstream task as an initial node until the searching of the associated task pair in the task associated tree is finished, and obtaining the task to be reset in the task associated tree.
Further, for each associated task pair, performing semantic recognition on a task script of a task in the associated task pair to determine an access statement in the task script includes:
for each associated task pair, extracting a task script of a downstream task in the associated task pair;
performing word segmentation on the task script;
performing semantic recognition on the participled task script according to a preset semantic library to determine an access key field from the task script;
and determining the access sentences in the task script according to the determined access key fields.
Further, after the step of performing script analysis on the obtained task script and determining the task to be reset from the task association tree according to the task resetting information, the method further includes:
sending the task association tree and the task to be reset to a preset terminal logged in by a task administrator account;
receiving a task adjusting instruction returned by the preset terminal according to the task association tree and the task to be reset;
and modifying the task to be reset according to the task adjusting instruction.
Further, the step of issuing and executing the task to be reset includes:
performing breadth traversal on each task to be reset in the task association tree, and adding each task to be reset into an execution queue according to a traversal sequence;
and issuing and executing the tasks to be reset according to the task arrangement sequence in the execution queue.
Further, the step of issuing and executing the tasks to be reset according to the task arrangement order in the execution queue includes:
for each task to be reset in the execution queue, when a trigger condition of the task to be reset is met, executing verification on an upstream task of the task to be reset, wherein the executing verification comprises data volume verification and data early warning verification;
and when the upstream task passes the execution verification, issuing and executing the task to be reset.
In order to solve the above technical problem, an embodiment of the present application further provides a task scheduling device, which adopts the following technical solutions:
the system comprises an instruction receiving module, a task resetting module and a task resetting module, wherein the instruction receiving module is used for receiving a task resetting instruction, and the task resetting instruction comprises a task to be processed and task resetting information;
the task query module is used for carrying out recursive query on the task to be processed in a pre-established task association table to obtain a task association tree;
the script acquisition module is used for acquiring the task script of each task in the task association tree;
the script analysis module is used for carrying out script analysis on the obtained task script and determining a task to be reset from the task association tree according to the task reset information;
and the task issuing module is used for issuing and executing the task to be reset.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
receiving a task resetting instruction, wherein the task resetting instruction comprises a task to be processed and task resetting information;
performing recursive query on the task to be processed in a pre-established task association table to obtain a task association tree;
acquiring a task script of each task in the task association tree;
performing script analysis on the obtained task script, and determining a task to be reset from the task association tree according to the task resetting information;
and issuing and executing the task to be reset.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
receiving a task resetting instruction, wherein the task resetting instruction comprises a task to be processed and task resetting information;
performing recursive query on the task to be processed in a pre-established task association table to obtain a task association tree;
acquiring a task script of each task in the task association tree;
performing script analysis on the obtained task script, and determining a task to be reset from the task association tree according to the task resetting information;
and issuing and executing the task to be reset.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects: after receiving a task resetting instruction, acquiring a task to be reset and corresponding task resetting information from the task resetting instruction; acquiring a pre-established task association table, performing recursive query on a task to be processed in the task association table, and primarily querying the task associated with the task to be processed to obtain a task association tree; and then acquiring a task script of each task in the task association tree, wherein the task script is used for executing the task, analyzing the task script, accurately determining the affected task according to the task resetting information, taking the determined task as the task to be reset and issuing the task again, automatically realizing task scheduling, and improving the accuracy of task scheduling.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram for one embodiment of a task scheduling method according to the present application;
FIG. 3 is a schematic block diagram illustrating an embodiment of a task scheduler according to the application;
FIG. 4 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the task scheduling method provided in the embodiments of the present application is generally executed by a server, and accordingly, the task scheduling device is generally disposed in the server.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continuing reference to FIG. 2, a flowchart of one embodiment of a task scheduling method according to the present application is shown. The task scheduling method comprises the following steps:
step S201, receiving a task resetting instruction, where the task resetting instruction includes a task to be processed and task resetting information.
In this embodiment, the electronic device (for example, the server shown in fig. 1) on which the task scheduling method operates may communicate with the terminal through a wired connection manner or a wireless connection manner. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
Specifically, a task management platform is deployed on the server, the task management platform is configured with a platform management page, and a platform user can perform task control on the platform management page. When a certain task is modified or wrong, a platform user can input the modified or wrong task, namely the task to be processed, and input modified or wrong information in the task, namely task resetting information, and the terminal generates a task resetting instruction according to the task to be processed and the task resetting information and sends the task resetting instruction to the server. The task management platform can also automatically detect the tasks, and when a certain task is detected to be modified or wrong, a task resetting instruction is automatically generated.
Step S202, performing recursion query on the task to be processed in the pre-established task association table to obtain a task association tree.
Specifically, a pre-established task association table is stored in the server, and the task association table records association information between tasks. And the server carries out recursive query on the tasks to be processed in the task association table based on a recursive algorithm.
Specifically, the server queries a downstream task associated with the task to be processed, and then queries a task associated with the downstream task as a main body until the queried task has no downstream task. All the inquired tasks form a task association tree.
The server can send the task association tree to the platform management page for displaying, and the task association tree displays the association between tasks in a tree structure mode. And the task to be processed in the task resetting instruction is a root node of the task association tree.
In step S203, a task script of each task in the task association tree is acquired.
Specifically, the task corresponds to a task script, and the task is executed by executing the task script corresponding to the task. And the server acquires the task name of each task in the task association tree, and queries the task script in the task script library according to the task name to obtain the task script of each task in the task association tree. The task script library stores task scripts of all tasks in the task management platform.
And step S204, performing script analysis on the acquired task script, and determining the task to be reset from the task association tree according to the task reset information.
The task to be reset may be a task that needs to be reissued and executed.
In particular, when two tasks are associated with each other, modifications or errors of an upstream task do not necessarily affect a downstream task. For example, a field in the upstream task needs to modify the calculation rule, but the downstream task does not use the field for calculation, and at this time, the downstream task is not really affected. Therefore, it is necessary to determine the tasks actually affected by the pending task from the task association tree.
The execution of the tasks is realized by executing the task script, and any association between the tasks is recorded in the script, so that the task script can be analyzed to determine whether the downstream tasks are influenced by the reset of the upstream tasks, and the tasks really influenced in the task reset at this time are determined in the task association tree.
For example, assuming that task a is faulty and task a and the task associated with task a need to be reissued, it is queried that task B and task C are associated with task a, and task D is associated with task B and task C. The task association tree includes task a, task B, task C and task D at the same time.
Assuming that field A1 in task A is faulty, task B is not substantially affected by the determination that task B is not associated with field A1 by script parsing. If field C1 in task C has a computational association with field A1 and field D1 in task D has a computational association with field C1, then both task C and task D are substantially affected by the task reset information, task B can be removed from the task association tree, and task A, task C, and task D will remain in the task association tree as tasks to be reset.
And step S205, issuing and executing the task to be reset.
Specifically, after the tasks to be reset in the task association tree are determined, each task to be reset is added into the execution queue, and each task script in the task queue is executed, so that the tasks are re-issued and re-executed.
In one embodiment, a server may manage a plurality of task execution nodes, each of which may execute a different type of task, through a task management platform. When a task to be reset is issued, task execution nodes capable of executing the task to be reset are inquired, load information of each task execution node is obtained, the task execution node with the lowest load is determined according to the load information, and the task execution node with the lowest load is indicated to execute the task to be reset, so that each task execution node is balanced, and running errors caused by the fact that a certain task execution node is too high in load are avoided. The load information may be a memory utilization rate of the task execution node; then, the task execution node with the lowest memory utilization rate is the task execution node with the lowest load.
In the embodiment, after receiving the task resetting instruction, the to-be-processed task to be reset and the corresponding task resetting information are acquired from the task resetting instruction; acquiring a pre-established task association table, performing recursive query on a task to be processed in the task association table, and primarily querying the task associated with the task to be processed to obtain a task association tree; and then acquiring a task script of each task in the task association tree, wherein the task script is used for executing the task, analyzing the task script, accurately determining the affected task according to the task resetting information, taking the determined task as the task to be reset and issuing the task again, automatically realizing task scheduling, and improving the accuracy of task scheduling.
Further, before step S202, the method may further include: acquiring a task script deployed in a data management platform; extracting task associated information from the obtained task script; identifying a first task and a second task in the task association information, wherein the first task is an upstream task of the second task; and obtaining a task association table according to the determined first task and the second task.
Specifically, in the development and deployment stage of the tasks, developers write task scripts, task association information exists in the task scripts, and the task association information records the dependency relationship among the tasks. Wherein the task related information can be written by a developer. For example, if it is recorded in the task association information of task B that task B is associated with task a, task B depends on task a, task a is an upstream task of task B, and task B is a downstream task of task a. After the server acquires the task association information, the task A is determined as a first task, and the task B is determined as a second task. It is understood that for a certain task, the task may depend on one task or a plurality of tasks; the task may be depended on by one task or by a plurality of tasks. And reading the task association information of all task scripts to automatically obtain a task association table.
The task association table may also be stored in a tree structure. It will be appreciated that the task association tree is a substructure derived from a task association table.
In the embodiment, the task association information is extracted from the task script, so that the association and dependency relationship between the tasks can be obtained, and the task association table can be accurately and quickly established.
Further, the step S204 may include: taking a root node in the task association tree as an initial node, and acquiring an association task pair of the initial node; for each associated task pair, performing semantic recognition on a task script of the task in the associated task pair to determine an access statement in the task script; determining whether a downstream task in the associated task pair is a task to be reset or not according to the access statement and the task reset information; and when the downstream task is the task to be reset, continuously searching the task to be reset by taking the downstream task as an initial node until the searching of the associated task pair in the task association tree is finished, and obtaining the task to be reset in the task association tree.
Specifically, the server searches for the really affected tasks in the task association tree starting from the root node of the task association tree. And forming an associated task pair by the two tasks which are associated with each other, and acquiring the associated task pair of the initial node by taking the root node as the initial node. And when a plurality of associated task pairs exist in the initial node, processing the associated task pairs one by one.
And the server acquires the task script of the task in the associated task pair. The task script has an access statement which has a preset expression form, and the access statement can be determined by finding which codes express access semantics based on the expression form of the codes in the script.
The task resetting information can indicate which fields in the task to be processed are in error or are modified, and whether the downstream task is really influenced by the task resetting information can be determined by combining the task resetting information and the access statement.
When the downstream task is affected by the task reset information, the downstream task is marked as a task to be reset. And taking the downstream task as a new initial node to continuously search the task to be reset until all the associated task pairs in the task associated tree are checked, and obtaining the task to be reset in the task associated tree.
After a new initial node is obtained, the task to be reset can be searched according to the task reset information, the affected fields in the initial node and the access statements of the new downstream task. For example, the field B1 in task B needs to be used for the calculation of the field a1 in task a to be processed, and the field a1 has an error according to the task reset information, so it can be known that the field B1 in task B needs to be recalculated, and that task B is affected by the task reset information. The task B is provided with a downstream task C, and when the task B is used as an initial node to search for a task to be reset, whether the task C is the task to be reset can be judged according to the task resetting information, the field B1 and the access statement of the task C.
In the embodiment, the task script is subjected to semantic recognition to determine the access statement in the task script, and the access statement can determine the data association among different tasks, so that the associated task pairs in the task association tree are checked one by one, and the task to be reset in the task association tree can be accurately found.
Further, for each associated task pair, performing semantic recognition on the task script of the task in the associated task pair to determine the access statement in the task script may include: for each associated task pair, extracting a task script of a downstream task in the associated task pair; performing word segmentation on the task script; performing semantic recognition on the participled task script according to a preset semantic library to determine an access key field from the task script; and determining the access sentences in the task scripts according to the determined access key fields.
Specifically, for each associated task pair, a task script of a downstream task in the associated task pair is obtained. And performing word segmentation on the task script to obtain a preset semantic library, wherein the semantic library defines the meanings of key fields which may appear in the script.
And inquiring each field obtained after word segmentation in a semantic library so as to determine an access key field related to access, and determining an access sentence according to a code structure in the script after identifying the access key field.
For example, the fetch statement is select A1 from form _ A where A1>1, where from is the fetch key field, where is the end field, and where is the reference field, when the three fields appear in the same statement, it can be said that the statement is a fetch statement.
In the embodiment, semantic recognition is performed after the task script is participled, the access key field in the task script can be determined, and the access sentence can be accurately searched from the task script.
Further, after the step S204, the method may further include: sending the task association tree and the task to be reset to a preset terminal logged in by a task administrator account; receiving a task adjusting instruction returned by a preset terminal according to the task association tree and the task to be reset; and modifying the task to be reset according to the task adjusting instruction.
Specifically, the server can automatically search the task to be reset from the task association tree, and can also send the task association tree and the task to be reset to a preset terminal logged in by a task manager account, and the task administrator checks the task association tree and the task to be reset at the preset terminal. The task manager can adjust the tasks to be reset through the preset terminal, for example, the tasks to be reset are increased or decreased according to the actual situation, and the task manager does not need to completely depend on the tasks to be reset screened by the server.
After the task manager adjusts the task to be reset, the preset terminal triggers a task adjusting instruction and sends the task adjusting instruction to the server. And after receiving the task resetting instruction, the server adjusts or modifies the task to be reset according to the task resetting instruction.
The task manager also can not adjust the task to be reset, and after sending a confirmation instruction through the preset terminal, the task manager instructs the server to issue and execute the task to be reset.
In the embodiment, the task association tree and the task to be reset are sent to the preset terminal logged in by the account of the task manager, the task to be reset can be adjusted manually, and the flexibility of task scheduling is improved.
Further, the step S205 may include: performing breadth traversal on each task to be reset in the task association tree, and adding each task to be reset into an execution queue according to a traversal sequence; and issuing and executing the tasks to be reset according to the task arrangement sequence in the execution queue.
Specifically, the tasks to be reset exist in the task association tree, the server can perform breadth traversal on each task to be reset in the task association tree, add the task scripts of each task to be reset into the execution queue according to the traversal sequence, and issue and execute each task script according to the task arrangement sequence of each task to be reset in the execution queue.
In the breadth traversal, the task to be reset that is traversed first is dependent on the other tasks to be reset to a higher degree, that is, is dependent on more tasks to be reset. The task to be reset which is traversed first can be executed first, so that the downstream task can be executed on the basis of the task to be reset, and the ordered execution of the tasks to be reset is ensured.
In the embodiment, the task association tree is subjected to breadth traversal, the tasks to be reset are added into the execution queue according to the traversal sequence, the task arrangement sequence in the execution queue conforms to the association relationship between the tasks, and the ordered execution of the tasks to be reset is guaranteed.
Further, the step of issuing and executing the tasks to be reset according to the task arrangement order in the execution queue may include: for each task to be reset in the execution queue, when a trigger condition of the task to be reset is met, executing verification on an upstream task of the task to be reset, wherein the executing verification comprises data volume verification and data early warning verification; and when the upstream task passes the execution verification, issuing and executing the task to be reset.
Specifically, for each task to be reset in the execution queue, when the trigger condition of the task to be reset is reached, the execution check is performed on the upstream task of the task to be reset first. The execution condition of the task to be reset may be that the task upstream of the task to be reset is completely executed, or the task execution time in the task script is reached.
In one embodiment, a directed acyclic graph can be generated according to the incidence relation of each task to be reset, and the execution of the tasks to be reset is scheduled and controlled through the directed acyclic graph.
In order to ensure the accuracy of task execution, the execution check may be performed on the task upstream of the task to be reset. And the execution verification comprises data quantity verification and data early warning verification. And under the conditions that the task is correct and the dimensionality of each field in the data table corresponding to the task is well constrained, the data volume of the data table corresponding to the task is determinable, the data volume of the data table of the upstream task can be detected, and if the data volume of the data table of the upstream task is within a preset data volume interval, the data volume passes verification. The task management platform can also provide a data early warning function, can call a data early warning interface, can perform early warning on data in the upstream task data table, and can check whether the data value in the upstream task data table is within a preset interval. And when the upstream task passes the data volume check and the data early warning check at the same time, issuing and executing the task to be reset.
In this embodiment, data volume verification and data early warning verification are performed on the upstream task of the task to be reset, so that whether the upstream task is executed correctly or not can be determined, and thus correct execution of the task to be reset is ensured.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a task scheduling apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 3, the task scheduling device 300 according to this embodiment includes: the task processing system comprises an instruction receiving module 301, a task query module 302, a script obtaining module 303, a script analyzing module 304 and a task issuing module 305, wherein:
the instruction receiving module 301 is configured to receive a task resetting instruction, where the task resetting instruction includes a task to be processed and task resetting information.
The task query module 302 is configured to perform recursive query on the task to be processed in a pre-established task association table to obtain a task association tree.
And the script acquiring module 303 is configured to acquire a task script of each task in the task association tree.
And the script analysis module 304 is configured to perform script analysis on the obtained task script, and determine the task to be reset from the task association tree according to the task resetting information.
And the task issuing module 305 is configured to issue and execute the task to be reset.
In the embodiment, after receiving the task resetting instruction, the to-be-processed task to be reset and the corresponding task resetting information are acquired from the task resetting instruction; acquiring a pre-established task association table, performing recursive query on a task to be processed in the task association table, and primarily querying the task associated with the task to be processed to obtain a task association tree; and then acquiring a task script of each task in the task association tree, wherein the task script is used for executing the task, analyzing the task script, accurately determining the affected task according to the task resetting information, taking the determined task as the task to be reset and issuing the task again, automatically realizing task scheduling, and improving the accuracy of task scheduling.
In some optional implementations of this embodiment, the task scheduling device 300 further includes: the system comprises an acquisition module, an information acquisition module, a task identification module and an association table determination module, wherein:
and the acquisition module is used for acquiring the task script deployed in the data management platform.
And the information acquisition module is used for extracting the task associated information from the acquired task script.
And the task identification module is used for identifying a first task and a second task in the task association information, wherein the first task is an upstream task of the second task.
And the association table determining module is used for obtaining a task association table according to the determined first task and the second task.
In the embodiment, the task association information is extracted from the task script, so that the association and dependency relationship between the tasks can be obtained, and the task association table can be accurately and quickly established.
In some optional implementations of this embodiment, the script parsing module 304 may include: the task pair acquisition submodule, the semantic recognition submodule, the task determination submodule and the task search submodule are connected, wherein:
and the task pair obtaining submodule is used for obtaining the associated task pair of the initial node by taking the root node in the task associated tree as the initial node.
And the semantic identification submodule is used for carrying out semantic identification on the task script of the task in the associated task pair so as to determine the access statement in the task script for each associated task pair.
And the task determination submodule is used for determining whether the downstream task in the associated task pair is the task to be reset or not according to the access statement and the task reset information.
And the task searching submodule is used for continuously searching the task to be reset by taking the downstream task as an initial node until the searching of the associated task pair in the task associated tree is finished to obtain the task to be reset in the task associated tree when the downstream task is the task to be reset.
In the embodiment, the task script is subjected to semantic recognition to determine the access statement in the task script, and the access statement can determine the data association among different tasks, so that the associated task pairs in the task association tree are checked one by one, and the task to be reset in the task association tree can be accurately found.
In some optional implementations of this embodiment, the semantic identifier module may include: script extraction element, script segmentation unit, semantic recognition unit and sentence confirm the unit, wherein:
and the script extraction unit is used for extracting the task script of the downstream task in each associated task pair.
And the script word segmentation unit is used for segmenting the task script.
And the semantic recognition unit is used for performing semantic recognition on the task script after word segmentation according to a preset semantic library so as to determine the access key field from the task script.
And the statement determining unit is used for determining the access statement in the task script according to the determined access key field.
In the embodiment, semantic recognition is performed after the task script is participled, the access key field in the task script can be determined, and the access sentence can be accurately searched from the task script.
In some optional implementations of this embodiment, the task scheduling device 300 further includes: the system comprises a sending module, an instruction receiving module and a task modifying module, wherein:
and the sending module is used for sending the task association tree and the task to be reset to a preset terminal logged in by a task administrator account.
And the instruction receiving module is used for receiving a task adjusting instruction returned by the preset terminal according to the task association tree and the task to be reset.
And the task modification module is used for modifying the task to be reset according to the task adjustment instruction.
In the embodiment, the task association tree and the task to be reset are sent to the preset terminal logged in by the account of the task manager, the task to be reset can be adjusted manually, and the flexibility of task scheduling is improved.
In some optional implementations of this embodiment, the task issuing module 305 may include: the task traversing submodule and the task executing submodule, wherein:
and the task traversing submodule is used for performing breadth traversal on each task to be reset in the task association tree and adding each task to be reset into the execution queue according to the traversal sequence.
And the task execution submodule is used for issuing and executing the tasks to be reset according to the task arrangement sequence in the execution queue.
In the embodiment, the task association tree is subjected to breadth traversal, the tasks to be reset are added into the execution queue according to the traversal sequence, the task arrangement sequence in the execution queue conforms to the association relationship between the tasks, and the ordered execution of the tasks to be reset is guaranteed.
In some optional implementations of this embodiment, the task execution submodule may include: the task verifying unit and the task issuing unit are provided, wherein:
and the task checking unit is used for performing execution checking on each task to be reset in the execution queue when a trigger condition of the task to be reset is met, wherein the execution checking comprises data volume checking and data early warning checking.
And the task issuing unit is used for issuing and executing the task to be reset when the upstream task passes the execution verification.
In this embodiment, data volume verification and data early warning verification are performed on the upstream task of the task to be reset, so that whether the upstream task is executed correctly or not can be determined, and thus correct execution of the task to be reset is ensured.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4, fig. 4 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 4 comprises a memory 41, a processor 42, a network interface 43 communicatively connected to each other via a system bus. It is noted that only computer device 4 having components 41-43 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 4. Of course, the memory 41 may also include both internal and external storage devices of the computer device 4. In this embodiment, the memory 41 is generally used for storing an operating system and various application software installed on the computer device 4, such as computer readable instructions of a task scheduling method. Further, the memory 41 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute computer readable instructions stored in the memory 41 or process data, for example, execute computer readable instructions of the task scheduling method.
The network interface 43 may comprise a wireless network interface or a wired network interface, and the network interface 43 is generally used for establishing communication connection between the computer device 4 and other electronic devices.
The computer device provided in this embodiment may perform the steps of the task scheduling method. Here, the steps of the task scheduling method may be steps in the task scheduling methods of the above embodiments.
In the embodiment, after receiving the task resetting instruction, the to-be-processed task to be reset and the corresponding task resetting information are acquired from the task resetting instruction; acquiring a pre-established task association table, performing recursive query on a task to be processed in the task association table, and primarily querying the task associated with the task to be processed to obtain a task association tree; and then acquiring a task script of each task in the task association tree, wherein the task script is used for executing the task, analyzing the task script, accurately determining the affected task according to the task resetting information, taking the determined task as the task to be reset and issuing the task again, automatically realizing task scheduling, and improving the accuracy of task scheduling.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the task scheduling method as described above.
In the embodiment, after receiving the task resetting instruction, the to-be-processed task to be reset and the corresponding task resetting information are acquired from the task resetting instruction; acquiring a pre-established task association table, performing recursive query on a task to be processed in the task association table, and primarily querying the task associated with the task to be processed to obtain a task association tree; and then acquiring a task script of each task in the task association tree, wherein the task script is used for executing the task, analyzing the task script, accurately determining the affected task according to the task resetting information, taking the determined task as the task to be reset and issuing the task again, automatically realizing task scheduling, and improving the accuracy of task scheduling.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A task scheduling method, comprising the steps of:
receiving a task resetting instruction, wherein the task resetting instruction comprises a task to be processed and task resetting information;
performing recursive query on the task to be processed in a pre-established task association table to obtain a task association tree;
acquiring a task script of each task in the task association tree;
performing script analysis on the obtained task script, and determining a task to be reset from the task association tree according to the task resetting information;
and issuing and executing the task to be reset.
2. The task scheduling method according to claim 1, wherein before the step of performing recursive query on the to-be-processed task in the pre-established task association table to obtain the task association tree, the method further comprises:
acquiring a task script deployed in a data management platform;
extracting task associated information from the obtained task script;
identifying a first task and a second task in the task association information, wherein the first task is an upstream task of the second task;
and obtaining a task association table according to the determined first task and the second task.
3. The task scheduling method according to claim 1, wherein the step of performing script analysis on the obtained task script and determining the task to be reset from the task association tree according to the task resetting information comprises:
taking a root node in the task association tree as an initial node, and acquiring an association task pair of the initial node;
for each associated task pair, performing semantic recognition on a task script of the task in the associated task pair to determine an access statement in the task script;
determining whether a downstream task in the associated task pair is a task to be reset or not according to the access statement and the task reset information;
and when the downstream task is the task to be reset, continuously searching the task to be reset by taking the downstream task as an initial node until the searching of the associated task pair in the task associated tree is finished, and obtaining the task to be reset in the task associated tree.
4. The task scheduling method according to claim 3, wherein the step of performing semantic recognition on the task script of the task in the associated task pair to determine the access statement in the task script for each associated task pair comprises:
for each associated task pair, extracting a task script of a downstream task in the associated task pair;
performing word segmentation on the task script;
performing semantic recognition on the participled task script according to a preset semantic library to determine an access key field from the task script;
and determining the access sentences in the task script according to the determined access key fields.
5. The task scheduling method according to claim 1, wherein after the step of performing script analysis on the obtained task script and determining the task to be reset from the task association tree according to the task reset information, the task scheduling method further comprises:
sending the task association tree and the task to be reset to a preset terminal logged in by a task administrator account;
receiving a task adjusting instruction returned by the preset terminal according to the task association tree and the task to be reset;
and modifying the task to be reset according to the task adjusting instruction.
6. The task scheduling method according to claim 1, wherein the step of issuing and executing the task to be reset comprises:
performing breadth traversal on each task to be reset in the task association tree, and adding each task to be reset into an execution queue according to a traversal sequence;
and issuing and executing the tasks to be reset according to the task arrangement sequence in the execution queue.
7. The task scheduling method according to claim 6, wherein the step of issuing and executing the tasks to be reset in the order of the tasks in the execution queue comprises:
for each task to be reset in the execution queue, when a trigger condition of the task to be reset is met, executing verification on an upstream task of the task to be reset, wherein the executing verification comprises data volume verification and data early warning verification;
and when the upstream task passes the execution verification, issuing and executing the task to be reset.
8. A task scheduling apparatus, comprising:
the system comprises an instruction receiving module, a task resetting module and a task resetting module, wherein the instruction receiving module is used for receiving a task resetting instruction, and the task resetting instruction comprises a task to be processed and task resetting information;
the task query module is used for carrying out recursive query on the task to be processed in a pre-established task association table to obtain a task association tree;
the script acquisition module is used for acquiring the task script of each task in the task association tree;
the script analysis module is used for carrying out script analysis on the obtained task script and determining a task to be reset from the task association tree according to the task reset information;
and the task issuing module is used for issuing and executing the task to be reset.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of a task scheduling method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, having computer-readable instructions stored thereon, which, when executed by a processor, implement the steps of the task scheduling method according to any one of claims 1 to 7.
CN202011314173.2A 2020-11-20 2020-11-20 Task scheduling method and device, computer equipment and storage medium Pending CN112363814A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011314173.2A CN112363814A (en) 2020-11-20 2020-11-20 Task scheduling method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011314173.2A CN112363814A (en) 2020-11-20 2020-11-20 Task scheduling method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112363814A true CN112363814A (en) 2021-02-12

Family

ID=74533763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011314173.2A Pending CN112363814A (en) 2020-11-20 2020-11-20 Task scheduling method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112363814A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615170A (en) * 2022-01-20 2022-06-10 北京华耀科技有限公司 Message processing method, message processing equipment and computer storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615170A (en) * 2022-01-20 2022-06-10 北京华耀科技有限公司 Message processing method, message processing equipment and computer storage medium
CN114615170B (en) * 2022-01-20 2023-08-04 北京华耀科技有限公司 Message processing method, device and computer storage medium

Similar Documents

Publication Publication Date Title
CN112052138A (en) Service data quality detection method and device, computer equipment and storage medium
CN107506256B (en) Method and device for monitoring crash data
CN112394908A (en) Method and device for automatically generating embedded point page, computer equipment and storage medium
CN115455058A (en) Cache data processing method and device, computer equipment and storage medium
CN111553556A (en) Business data analysis method and device, computer equipment and storage medium
CN112860662B (en) Automatic production data blood relationship establishment method, device, computer equipment and storage medium
CN113869789A (en) Risk monitoring method and device, computer equipment and storage medium
CN111221690B (en) Model determination method and device for integrated circuit design and terminal
CN112363814A (en) Task scheduling method and device, computer equipment and storage medium
CN111475388A (en) Data push test method and device, computer equipment and storage medium
CN116450723A (en) Data extraction method, device, computer equipment and storage medium
CN114968725A (en) Task dependency relationship correction method and device, computer equipment and storage medium
CN114637672A (en) Automatic data testing method and device, computer equipment and storage medium
CN110851346A (en) Method, device and equipment for detecting boundary problem of query statement and storage medium
CN116483735B (en) Method, device, storage medium and equipment for analyzing influence of code change
CN116028108B (en) Method, device, equipment and storage medium for analyzing dependent package installation time
CN114328214B (en) Efficiency improving method and device for interface test case of reporting software and computer equipment
CN113760765B (en) Code testing method and device, electronic equipment and storage medium
CN113239296B (en) Method, device, equipment and medium for displaying small program
CN111190818B (en) Front-end code analysis method, front-end code analysis device, computer equipment and storage medium
CN117827661A (en) Code grammar checking method, system, computer device and storage medium
CN115878460A (en) Regression testing method, device, computer equipment and storage medium
CN113504957A (en) Table data processing method and device, computer equipment and storage medium
CN116431639A (en) Data optimization method, device, computer equipment and medium based on graphics
CN116450724A (en) Data processing method, device, computer equipment and storage medium

Legal Events

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