Embodiment
It is a task that Fig. 1, which is illustrated in a part of task in data warehouse, each frame, for example, a task can
To be the extraction program of data set or the generation program of a form.Wherein, the direction of arrow in Fig. 1 represents data warehouse
Each task between dependence, for example, some direction of arrow is points to task 4 by task 1, expression task 4 is relied on
In task 1, the output of task 1 will be used as the input of task 4.Dependence between task also represent the execution between task
Sequentially, if task 4 depends on task 1, task 1 is first carried out, then performs task 4, task 1 is properly termed as the upstream of task 4
Task, opposite, task 4 is properly termed as the Downstream Jobs of task 1.One task is only all run in its all upstream tasks
It could start to perform after end, in many cases, a task may need multiple inputs, such as, shown in Fig. 1,
The output of task 1 and task 2 is all as the input of task 4.
Each task connected by arrow line constitutes a task flow, " [appoints for example, illustrating a task flow in Fig. 1
Business 1, task 2]->Task 4->Task 8 ", also have another task flow " task 2->Task 5->Task 9 ", also has other
Several task flows, are no longer described in detail.Task scheduling system can successively be dispatched according to the dependence between the task in task flow
Each task is performed, for example, first carrying out task 2, then task 5 is performed, task 9 is then performed.Can be simultaneously between each task flow
Row is performed, while performing multiple tasks stream.
In addition, in the task scheduling system of data warehouse, attribute, the scheduling plan of task can be also set to each task
Slightly, the including but not limited to element such as triggering mode, run time, task dependence, task grade, task scheduling system can be with
Using the resource information of the attribute, scheduling strategy and system of task, determine how the calculating in orderly service data warehouse is appointed
Business.For example, when the multiple tasks stream in Fig. 1 is scheduled execution, task scheduling system can run multiple tasks simultaneously,
The plurality of task can belong to different task flows.Task scheduling system will extract which task enters operation queue in selection
When, can be according to the task grade of task, usual task higher grade, and corresponding task will dispatch system more by priority scheduling
The high priority of task of task grade can be put into operation queue, can also obtain higher system resource.General important appoints
Business can just set higher task grade.
The task grade of task is typically synchronously to be configured when the task of establishment, can also the task of establishment it
Manually it is adjusted afterwards.In the task of establishment, a kind of situation for being likely to occur is:In some task flow, the task of Downstream Jobs
Grade be higher than upstream task task grade, such case is probably that newly-increased Downstream Jobs are important, so there is provided compared with
High task grade, and upstream task has been set to relatively low task grade in initial create.For a Downstream Jobs
Higher than the task flow of the task grade of upstream task, if task scheduling system sequentially dispatches execution, upstream task may be by
It is low and cannot get enough resources in task grade, operation queue can not be preferentially entered, output delay in turn results in downstream and appointed
The output of business can also postpone, although that is, important Downstream Jobs are provided with higher task grade, also due to the shadow of upstream task
Sound causes delay output.
In order to reduce delayed impact of the above-mentioned situation middle and upper reaches task to Downstream Jobs, the embodiment of the present application provides one kind
Task management method, when the task grade for the Downstream Jobs that this method can be in task flow is higher than upstream task, appoints to upstream
The task dispatching level of business is adjusted, to reduce delayed impact of the upstream task to Downstream Jobs.Fig. 2 is the flow chart of this method,
As shown in Fig. 2 this method can include:
In step 201, compare the upstream task in a task flow and the task grade of Downstream Jobs, determine that downstream is appointed
The task grade of business is higher than the task grade of upstream task.
For example, the upstream task and Downstream Jobs in this step are in same task flow, upstream and downstream is one
Example in relative concept, such as Fig. 1, task 1 is the upstream task of task 4, and task 4 is the Downstream Jobs of task 1.
In this step, the size of the task grade between upstream task and Downstream Jobs can be compared, Downstream Jobs are judged
Task grade whether be higher than upstream task task grade.In this example, each task in task flow can be according to this
Method carries out the adjustment of task grade, when each task in task flow adjusts grade, can there is numerous embodiments.Example
Such as, grade that can be by the grade of a upstream task respectively with each of which Downstream Jobs is compared, if under when relatively
The grade height of trip task then improves the grade of current upstream task, then again enters the upstream task with next Downstream Jobs
Row grade compares.In another example, the comparison of task grade can also be first carried out between all Downstream Jobs of upstream task, then select
The grade for selecting maximum therein and current upstream task is compared.For another example can also be only by upstream task etc.
The grade of Downstream Jobs of the level with being increased newly in the task flow is compared.
If the task grade of all Downstream Jobs of the upstream task is lower than upstream task, can not be to upstream task
Task grade adjust., whereas if being higher than the Downstream Jobs of upstream task grade in task grade, then can continue
Step 202 is performed, the task grade of upstream task is improved, to reduce delayed impact of the upstream task to Downstream Jobs.
In step 202., the task grade of the upstream task is improved.
The amplitude that this example is improved to the task grade of upstream task is not limited, for example, it is assumed that task grade is included from 1
To 10 this ten grades, and the bigger expression task of numeral is more important, it is possible to assuming that what upstream task was set in the task of establishment
Task grade is 1, and the task grade of Downstream Jobs is 7, then when improving the task grade of upstream task, can appoint upstream
The task grade of business brings up to 5 by 1, or brings up to 7 by 1, etc. than current task higher grade in a word.
After the task grade of the upstream task is improved, after task scheduling system can just be improved according to upstream task
Task grade, the upstream task is scheduled.For the upstream task, the raising of task grade will cause this
Before upstream task is compared to level adjustment, operation queue will be entered faster, can be assigned to more system resources,
So that upstream task performs completion faster, and then performs Downstream Jobs as early as possible, upstream task is reduced to Downstream Jobs
Delayed impact.
In the task management method of this example, by when the task grade of Downstream Jobs is higher than upstream task, by upstream
The task grade of task is improved, then the task grade of upstream task of the task scheduling system after according to raising, and upstream is entered
During row scheduling, before level adjustment, upstream task will be put into operation queue faster, also can be upstream task point
With more system resources, so that upstream task performs completion faster, and then performs Downstream Jobs as early as possible, reduce
Delayed impact of the trip task to Downstream Jobs.
In one example, the task scheduling system of data warehouse can first determine each in each scheduler task
Pending task in business stream, then to the flow exemplified by these pending tasks carrying Fig. 3, carries out the tune of task grade
It is whole, it is scheduled again after adjustment grade.As shown in figure 3, can include:
In step 301, the task grade of all current pending tasks is obtained.
For example, task scheduling system can extract the current pending task in each task flow, such as, and Fig. 1
In a task flow gone to the position of task 4, i.e., what is currently run is task 4, then the task 4 is pending
Business;The position of task 6 is gone in another task flow, i.e., what is currently run is that task 6 (held by the task 3 of its upstream
Row terminates), then the task 6 is pending task.Task scheduling system can get the task grade of task 4 and task 6.
In step 302, the maximum in the task grade for all Downstream Jobs for counting the current task.
For example, the quantity of the pending task got in step 301 can be multiple, and treated for each
Execution task, can perform the step 302 in this example to the processing of step 306.In this step, it is pending with one of them
Exemplified by task, the maximum in the task grade of its all Downstream Jobs can be counted;For example, the task 6 in Fig. 1, under it
Trip task only has task 9, then can obtain the task grade of task 9;In other examples, it is assumed that some pending task
All Downstream Jobs quantity to be multiple, including task A, task B, task C then can be with statistics task A to task C tasks
The maximum of grade.
In step 303, the task grade of the upstream task and the maximum are compared, judge that maximum is
The no task grade higher than the current task.
If the determination result is YES, then step 304 is performed;Otherwise, step 305 is performed.
In step 304, the maximum is defined as to the adjustment grade of current upstream task.
For example, still by taking above-mentioned task 6 as an example, if the Downstream Jobs of task 6 be task 9 task it is higher ranked,
Can using the grade of task 9 as task 6 adjustment grade.In other examples, even if Downstream Jobs is higher ranked, on
The adjustment grade of trip task can also be not equal to the grade maximum of task downstream, as long as the task grade of upstream task is carried
High certain amplitude.
In step 305, keep task grade constant.
Within step 306, according to adjustment grade, current task is scheduled.
For example, task scheduling system to the task dispatching of each pending task level after being adjusted, can be according to adjustment
Rear adjustment grade carries out task scheduling, high preferential of grade is put into operation queue, preferential distribution operation resource so that grade
High task can be performed faster.
Below in conjunction with Fig. 4, the examples of implementation being adjusted the task dispatching level that describes to task.As shown in figure 4, each frame
In be the task grade that each task has been indicated in a task, and frame.For example, in task flow " [task 1, task
2]—>Task 4->In task 8 ", the task grade of task 1 and task 2 is 7, and the task grade of task 4 is 1, task 8
Task grade is 5.
As shown in figure 4, in this example, having increased task 11 newly, because the task 11 is extremely important, its task grade is set
It is highest ranking for 10.The task 11 depend on task 8, positioned at task flow " [task 1, task 2]->Task 4->Task
8—>In task 11 ".
Task scheduling system can perform the task management method shown in Fig. 3, and task dispatching level is adjusted.For example, with
Exemplified by task 4 in Fig. 4, it is assumed that the task 4 is current pending task, can be with all Downstream Jobs of statistics task 4
Maximum in task grade.The Downstream Jobs of task 4 include " task 8, task 11 ", wherein, the grade of task 8 is 5, task
11 grade is 10, then the maximum in the task grade of all Downstream Jobs is grade 10.Then can be by the task dispatching of task 4
Level is improved to grade 10 by original grade 1, i.e., identical with the task grade maximum of Downstream Jobs.In addition, for task flow
In each task, can according to figure flow carry out task grade adjustment.For example, the task grade of task 8 also will be by
Class 5 is adjusted to grade 10, and the task grade of task 1 and task 2 can be adjusted to grade 10 by grade 7.Task after adjustment
It may refer to Fig. 5 example.
In addition, the application is not limited to the execution time of task management method, task scheduling system can be daily
Routine performs this method when performing scheduler task, or can also be performed in other times.For each in task flow
Task, as long as before the task scheduling of distribution queue and resource is performed to it according to the task grade of the task, in advance to appointing
The task grade of business is adjusted according to the present processes.
In another example, it is assumed that be set to when each task flow increases task newly, to each in the task flow
The adjustment that business performs a task grade updates, then if task scheduling system performs a task scheduling, this day daily
Perhaps not all task flow has newly-increased task.For example, by taking Fig. 4 as an example, only task flow " [task 1, task 2]->
Task 4->Task 8->Increase task 11 in task 11 " newly, and other task flows do not increase task, such as, task newly
Stream " task 3->Task 7->Task 10 "., can be only including increasing task newly in order to improve the efficiency of task level adjustment
In task flow, the task dispatching level to each task in task flow is adjusted.As shown in fig. 6, the example can include:
In step 601, it is determined that including the task flow of newly-increased Downstream Jobs.
For example, by taking Fig. 4 as an example, the task flow of newly-increased task includes:" [task 1, task 2]->Task 4->Task 8->
Task 11 ".
In step 602, upstream task and the task dispatching level of a newly-increased Downstream Jobs are compared.
For example, it is assumed that increase a Downstream Jobs newly every time, can be by the upstream task and a newly-increased Downstream Jobs
Task dispatching level be compared size.When having increased multiple Downstream Jobs newly, can also by the upstream task respectively with it is therein
Each newly-increased task carries out grade comparison, or can also be as shown in Figure 3 example, by upstream task and these newly-increased tasks
Grade maximum be compared.
In step 603, if the task grade of the Downstream Jobs is higher than the task grade of the upstream task, by institute
The task grade for stating Downstream Jobs is defined as the adjustment grade.
Such as, task flow " [task 1, task 2]->Task 4->Task 8->In task 11 ", if newly-increased task
11 grade is 10, and the grade of current task 4 is 1, then can be grade 10 by the level adjustment of task 4.Equally, for this
Task 8 in task flow, is also compared its task grade with the grade of newly-increased task 11, the class 5 of task 8 is also below task
11 grade 10, then can also be adjusted to grade 10 by the grade of task 8.By above-mentioned processing, equivalent to by task 11 etc.
Level has carried out backpropagation, has increased newly after higher ranked task 11, to each task swum thereon, is somebody's turn to do if grade is less than
Newly-increased task, it is identical with the grade of the newly-increased task all to adjust grade.
Certainly, in other examples, newly-increased task can also whether be included, can be grading to the task dispatching of task
The judgement whether row adjusts, such as, can be by holding before task scheduling system will be scheduled execution to some task flow
The method of this example of row, the task dispatching level to each task in the task flow is made whether the judgement of adjustment, if meeting this
The condition of example is then adjusted, and otherwise can not be adjusted.
In another example, can not also by the task grade of current upstream task specifically be used for under some
Trip task or maximum carry out grade comparison, but the upstream task and the task grade of its all Downstream Jobs are constituted into one
Set, asks for the grade maximum of the set, is used as the adjustment grade of upstream task.As shown in fig. 7, can include:
In step 701, for current upstream task, the task grade of its all Downstream Jobs is obtained.
For example, so that the task 4 in Fig. 4 is current upstream task as an example, its all Downstream Jobs can include:Task
8 and task 11.
In a step 702, the maximum in the task grade of the upstream task and its all Downstream Jobs is counted.
For example, the task grade of task 4 is 1, the task grade of task 8 is 5, and the task grade of task 11 is 10.Can be with
The grade of task 4, task 8, task 11 is constituted into a set, the maximum of the task grade in the set is counted, can obtain
It is 10 to go out its maximum.
In step 703, by the task grade of upstream task, the maximum is adjusted to.
Maximum in step 702 can be defined as the adjustment grade of upstream task by this step, by the task dispatching of task 4
Level is changed to 10.Likewise, for task 8, it can be constituted in a set, task class set [5,10] with task 11
Maximum is 10, accordingly by the task grade of task 8 also more 10.
In the task management method of this example, by when the task grade of Downstream Jobs is higher than upstream task, by upstream
The task grade of task is improved to identical with the maximum of Downstream Jobs grade, then task scheduling system is after according to raising
The task grade of current task,, will faster will be upper before level adjustment when being scheduled to the current task
Trip task is put into operation queue, also more system resources can be distributed for upstream task, so that upstream task is held faster
Row is completed, and then performs Downstream Jobs as early as possible, reduces delayed impact of the upstream task to Downstream Jobs, ensure that downstream weight
Want the output on time of task.
The embodiment of the present application additionally provides a kind of task management device, can perform the task management of any of the above-described embodiment
Method.As shown in figure 8, the device can include:Level determination module 81 and level adjustment module 82.Wherein,
Level determination module 81, for the task dispatching level of the upstream task in a task flow and Downstream Jobs to be compared
Compared with, determine the Downstream Jobs task grade be higher than upstream task task grade;
Level adjustment module 82, the task grade for improving the upstream task.
In one example, level adjustment module 82, specifically for improving the task grade of the upstream task to institute
State the task grade of Downstream Jobs.
In one example, the task grade of the Downstream Jobs, including:All Downstream Jobs of the upstream task
Maximum in task grade.
In one example, in the task flow, including newly-increased Downstream Jobs.
In one example, as shown in figure 9, the task management device that the present invention is provided can include:
Grade acquisition module 91, for the maximum in the task grade for all Downstream Jobs for obtaining current task, institute
Task higher grade is stated, then corresponding task will be more by priority scheduling;
Level adjustment module 92, for the task grade of current task to be compared with the maximum, if the maximum
Higher than the task grade of current task, then the task grade of current task is adjusted to the maximum;
Schedule process module 93, for according to the task grade after adjustment, being scheduled to the current task.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention
God is with principle, and any modification, equivalent substitution and improvements done etc. should be included within the scope of protection of the invention.