A kind of distributed task dispatching method and device
Technical field
The present invention relates to task scheduling technique field more particularly to a kind of distributed task dispatching method and devices.
Background technology
In general, scheduling is exactly according to certain strategy, and task is reasonably assigned on processing unit and is performed, to reach
Deadline is most short, improves the purpose of system availability.Scheduling is one of key technology for realizing high-performance calculation.
With being growing for computer application scope, distributed system and cloud computing technology and network technology into one
Step development, there is the demand for more and more integrating multiple distributed systems and being managed collectively.At present, in network
Distributed system is mostly that all departments will be run constructed by one or more operating information systems, thus these are distributed
System is all mutual indepedent mostly, without what mutual incidence relation, because not got through between each distributed system, nothing
Method is compatible, can not integrate, thus can not be also managed collectively.
Therefore, either from the unified management and resource-sharing of system still from needing to carry out between each distributed system
Communication etc., if the different task global association run on different machines can be got through, realize a variety of of multiple-task cycle
The problem of support and overall scheduling that type relies on are one extremely important.But existing distributed system, to Hadoop,
Linux and/or various types of database are managed independently by covering scattered scheduling more, can not be got through,
One-stop task management is can not achieve, understanding difficulty and the work that can undoubtedly increase data analyst and data maintenance personnel are multiple
Miscellaneous degree, and then the operation and maintenance cost of system can be increased.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of distributed task dispatching method and device, to solve problem above.
The technical solution is as follows:
A kind of distributed task dispatching method, including:
Receive task execution device send task scheduling request, wherein the task scheduling request include task type with
The identification information of the task execution device;
It is asked according to the task scheduling, at least one subtask is verified according to check logic is issued, is led to
The subtask set of verification is crossed, wherein the attribute of the subtask includes:Subtask identifier, subtask type and affiliated times
The identifier of business, and the attribute of task includes:Task identifier, task type, the subtask type of subtask are appointed with the son
The task type of task belonging to business is identical;
Selection subtask is issued to the task execution device in gathering from the subtask;
The implementing result that the task execution device returns is received, according to the subtask issued described in implementing result modification
Attribute.
Same design according to the present invention, the present invention also provides a kind of distributed task dispatching device, including:
Scheduling request receiving unit, for receiving the task scheduling request of task execution device transmission, wherein the task
Scheduling request includes the identification information of task type and the task execution device;
Verification unit is issued, for being asked according to the task scheduling, at least one son is appointed according to check logic is issued
Business is verified, and is obtained and is gathered by the subtask verified, wherein the attribute of the subtask includes:Subtask identifier, son
The identifier of task type and affiliated task, and the attribute of task includes:Task identifier, task type, the son of subtask
Task type is identical with the task type of the task belonging to the subtask;
Issuance unit, for from the set of the subtask subtask being selected to be issued to the task execution device;
As a result feedback unit for receiving the implementing result that the task execution device returns, is repaiied according to implementing result
Change the attribute of the subtask issued.
Same design according to the present invention, the present invention also provides a kind of server, including:Display, one or one
A above processor;Memory;And one or more than one program, wherein the one or more programs
It is stored in the memory, and is configured to be performed by the one or more processor, it is one or one
A procedure above includes the instruction operated below:
Receive task execution device send task scheduling request, wherein the task scheduling request include task type with
The identification information of the task execution device;
It is asked according to the task scheduling, at least one subtask is verified according to check logic is issued, is led to
The subtask set of verification is crossed, wherein the attribute of the subtask includes:Subtask identifier, subtask type and affiliated times
The identifier of business, and the attribute of task includes:Task identifier, task type, the subtask type of subtask are appointed with the son
The task type of task belonging to business is identical;
Selection subtask is issued to the task execution device in gathering from the subtask;
The implementing result that the task execution device returns is received, according to the subtask issued described in implementing result modification
Attribute.
The advantageous effect that technical solution provided in an embodiment of the present invention is brought is:
Task scheduling apparatus is after the task scheduling request that task execution device is sent is received, according to issuing check logic pair
Subtask is verified, and will be issued to task execution device by the subtask of verification, is realized task scheduling apparatus and task
Statelessly communication between executive device can facilitate and carry out linear expansion to task execution device, can promote the execution energy of task
Power;By the way that the different task for being suitable for different task executive device is managed concentratedly and dispatched, can realize different task it
Between global association, can support the dependence between the different task suitable for different task executive device.
Description of the drawings
Fig. 1 is the distributed task dispatching method flow diagram described in the embodiment of the present invention one;
Fig. 2 is the task analytic approach flow chart described in the embodiment of the present invention one;
Fig. 3 is the distributed task dispatching method flow diagram described in the embodiment of the present invention two;
Fig. 4 is the distributed task dispatching schematic device described in the embodiment of the present invention three;
Fig. 5 is the distributed task dispatching apparatus structure block diagram described in the embodiment of the present invention three;
Fig. 6 is the task execution device schematic layout pattern described in the embodiment of the present invention three;
Fig. 7 is the distributed task dispatching apparatus structure block diagram described in the embodiment of the present invention four.
Specific embodiment
In order to make the object of the invention, technical solution and advantage clearer, below in conjunction with the accompanying drawings and pass through specific embodiment
Come the technical solution further illustrated the present invention.
Embodiment one
Fig. 1 is the distributed task dispatching method flow diagram described in the present embodiment, the main task in a distributed manner of the present embodiment
Task scheduling apparatus in scheduling system(The usually director server in distributed task dispatching system)And task execution device(Example
Such as Oracle storages function module, Linux data upload functions module, Hadoop accounting checking modules)Between carry out task scheduling
With the method for execution.As shown in Figure 1, the distributed task dispatching method described in the present embodiment includes:
S101, the task scheduling request that task execution device is sent is received.
Task scheduling apparatus receives the task scheduling request that task execution device is sent, wherein the task scheduling request bag
Include task type(Such as Oracle storages task, Linux data upload task, Hadoop MapReduce task dispatchings)With it is described
The identification information of task execution device.The identification information of wherein described task execution device is used to distinguish each task execution device
It comes.In the present embodiment, the identification information of the task execution device can be the ID number or title of task execution device.
S102, subtask is verified according to task scheduling request, obtains and gathered by the subtask verified.
Wherein, to how many subtask carry out verification viewing system scale and subtask number depending on.If subtask number school
Less or system scale school is small, it can be achieved that verified to all subtasks, obtains from all subtasks and is appointed by the son of verification
Business set;If subtask number is more or system scale school is big, it can be achieved that verified to part subtask, such as when being led to
It crosses and stops relatively testing other subtasks when the subtask number verified reaches preset value.
The subtask that selection is adapted with the task scheduling request that task execution device is sent from subtask, is passed through
The subtask set of verification.
Wherein, subtask is by carrying out Task-decomposing acquisition to task, and Fig. 2 is the task analytic approach stream of the present embodiment
Cheng Tu, as shown in Fig. 2, the task analytic approach described in the present embodiment includes:
S201, task is received and stored.
Task includes different task types, and the attribute of various types of tasks includes:Task identifier(Such as task name
Title or task ID number), task type may also include entry-into-force time, duty cycle, task execution device person liable etc..It is and different
The task of task type, attribute is different, carries out data transmission if some type of task is related between two machines(It such as will
Data Migration in HDFS is into MYSQL), then the task of the type is also comprising source server identifier(Such as IP address), target
Server identifier(Such as IP address)Etc. information.
Receive and store task mode can there are many, such as by providing dedicated subtask software or son can be submitted to appoint
Business submits webpage to realize.In a preferred embodiment of the present embodiment, webpage is submitted by providing dedicated subtask
User to be supplied to submit subtask.Due to different task types, it is necessary to which the mission bit stream difference that user provides, can lead on webpage
The form for crossing drop-down list lists all registered task types, when user selects to want the type of submitting for task, page
Face dynamic provides the list of the type task.
For example, user creates the data loading task that a type is " HDFS is put in storage to MYSQL ", user fills out writing task
Entitled " APP timesharing overviews model is put in storage MySQL ", which is used for the entitled * of suffix under the B file paths of A servers
.C E, F, G, H ... in D tables under file wait the data of row, and respectively according to f1, f2, f3, f4 ... etc., mapping relations are moved
E, f, g, the h ... moved on in the d tables of a services waits row.Duty cycle for it is per minute once, the entry-into-force time be " 2013-04-
0116:00:00 ", 00 divides when the time that task can be activated earliest daily is 00, performs 100000 datas every time.
For another example, user creates the task that a type is " Hadoop MapReduce calculating ", the task name that user fills in
Referred to as " APP timesharing overviews daily calculate ", for by the data file D of the entitled .C of suffix under HDFS cluster A upper pathways B, pressing
It is calculated according to the Map class F and Reduce classes G performed inside Jar bags E, and result is output under the path H on cluster A.Appoint
The cycle be engaged in as once a day, the entry-into-force time is " 2013-04-0100:00:00”.
S202, according to preset task decomposition rule by Task-decomposing into subtask.
According to task attribute, according to the Task-decomposing rule of default the type task by Task-decomposing into subtask.Example
Such as, can be sequentially generated according to the entry-into-force time of task as the initial time by Task-decomposing into subtask according to duty cycle
Subtask, will be in the subtask write-in subtask list of generation.
If carrying out Task-decomposing to certain task for the first time, the initial time of first subtask generated is set as appointing
The entry-into-force time of business, the deadline of first subtask add the time of a duty cycle for the entry-into-force time of task.
Task-decomposing is carried out to certain task if not first time, then the initial time of the subtask generated is set as the son
The generation ordinal number of task is multiplied by the time of a duty cycle after subtracting one, the deadline of the subtask of generation is set as the son
The generation ordinal number of task is multiplied by the time of a duty cycle.
When the system time of distributed task dispatching system reaches the deadline of some subtask, then the subtask is write
Enter in the list of subtask.It is later than distributed task dispatching system when the deadline there are a subtask in the subtask of certain task
The system time of system is later than the task out-of-service time, then pause carries out Task-decomposing to the task.
S203, the subtask of storage generation.
Subtask is included with properties:Subtask identifier(Such as subtask ID number), the affiliated task in subtask mark
Symbol(Such as task ID number), subtask type etc., wherein the task type of the subtask type and the affiliated task in the subtask
It is identical.
Every time behind generation subtask, subtask is stored, so that task scheduling apparatus is dispatched, such as the shape with list
Subtask is stored as subtask list by formula.
S103, in gathering from subtask subtask is selected to be issued to task execution device.
Selection is adapted with the task scheduling request that task execution device is sent from the set of the subtask that previous step obtains
Subtask be issued to the task execution device.
If for example, receiving the task scheduling request that a task execution device is sent, the mark of executive device is believed
It ceases for IP address(Such as 172.23.1.100), the task type of request is Hadoop MapReduce calculating, and request time is
2013-04-0116:01:15, then the subtask in sub- set of tasks according to the default check logic that issues is verified, sieved
The subtask being adapted with task scheduling request is selected, such as it is 2013- to select the initial time that task identifier is A
04-0100:00:The task execution device is handed down in 00 subtask.
S104, the implementing result that task execution device returns is received, changes the attribute of subtask.
The subtask can be removed subtask list and individually store or change subtask by the success of group tasks carrying
Attribute identifies the state of the subtask.If the latter, then the attribute of subtask may also include:It subtask state and retries time
The information such as number.When receiving the implementing result of task execution device return, believe according to the state for returning the result modification subtask
Breath.When running succeeded, the information that subtask runs succeeded is sent, when task scheduling apparatus receives what subtask ran succeeded
During information, subtask identifier is parsed, the state of the subtask in the list of subtask is changed to success status
(SUCCESSFUL).When performing failure, the information that subtask performs failure is sent, when task scheduling apparatus receives subtask
When performing the information of failure, subtask and identifier are parsed, the number of retries of the subtask in the list of subtask is added 1.
It, can also be to the number of retries of subtask in order to control the inefficiency for performing the excessive subtask of the frequency of failure and being directed at
It is limited, when the number of retries of subtask reaches default threshold value, then no longer issues the subtask.
In the technical solution of distributed task dispatching method described in the present embodiment, task scheduling apparatus is held in reception task
After luggage puts the task scheduling request of transmission, subtask is verified according to check logic is issued, will be appointed by the son of verification
Business is issued to task execution device, realizes the statelessly communication between task scheduling apparatus and task execution device, can facilitate
Linear expansion is carried out to task execution device, the executive capability of task can be promoted;By to being suitable for different task executive device
Different task managed concentratedly and dispatched, can realize the global association between different task, can support to be suitable for different appoint
Dependence between the different task for executive device of being engaged in.
Embodiment two
Fig. 3 is the distributed task dispatching method flow diagram described in the present embodiment, the main task in a distributed manner of the present embodiment
Task scheduling apparatus in scheduling system(The usually director server in distributed task dispatching system)And task execution device(Example
Such as Oracle storages function module, Linux data upload functions module, Hadoop accounting checking modules)Between carry out task scheduling
With the method for execution.As shown in figure 3, the distributed task dispatching method described in the present embodiment includes:
S301, the task scheduling request that task execution device is sent is received.
Task scheduling apparatus receives the task scheduling request that task execution device is sent, wherein the task scheduling request bag
Include task type(Such as Oracle storages task, Linux data upload task, Hadoop MapReduce task dispatchings)With it is described
The identification information of task execution device.The identification information of wherein described task execution device is used to distinguish each task execution device
It comes.In the present embodiment, the identification information of the task execution device can be the ID number or title of task execution device.
S302, subtask is verified according to issuing check logic, is obtained by verifying according to task scheduling request
Gather subtask.
Wherein, to how many subtask carry out verification viewing system scale and subtask number depending on.If subtask number school
Less or system scale school is small, it can be achieved that verified to all subtasks, obtains from all subtasks and is appointed by the son of verification
Business set;If subtask number is more or system scale school is big, it can be achieved that verified to part subtask, such as when being led to
It crosses and stops relatively testing other subtasks when the subtask number verified reaches preset value.
The subtask that selection is adapted with the task scheduling request that task execution device is sent from subtask, is passed through
The subtask set of verification.
Wherein, subtask is by carrying out Task-decomposing acquisition to task, and concrete mode is as shown in embodiment one, herein
It does not repeat.
In a preferred embodiment of the present embodiment, the check logic that issues includes:According to preset order antithetical phrase
Task carries out task verification, subtask verification, executive device verification and/or dependence verification.
Task verification includes, and according to the attribute of the affiliated task in subtask, judges whether subtask meets task scheduling request.
Specifically, task verification may include:
(1)Verify the affiliated task in subtask task type with task execution device request task type whether one
It causes.
(2)It is whether restricted to task execution device to verify the affiliated task in subtask, for example whether limitation tasks carrying dress
The identification information put(Such as IP address)Whether within the scope of limitation.Such as the attribute of subtask further includes tasks carrying dress
Confidence ceases, including:Allow all task execution devices, only allow some or more than one identification information appointing for particular value
Business executive device.
(3)Whether the state of verification task is effective, i.e., whether the affiliated task in subtask that verification can be issued, which is in, has
Effect state.Such as effectively whether the attribute information of task further include, when being verified to subtask,
Obtain the affiliated task of the subtask, judge it is described belonging to task whether effective attribute is effective, if not
Effectively then to show that the subtask cannot pass through verification.
(4)Verification the affiliated task in subtask priority whether belong to send task requests task execution device registration
Within priority limit.Such as the attribute information of task further includes priority, task execution device is in task scheduling apparatus
Log-on message includes the identification information and priority limit of task execution device, the tasks carrying dress in being asked by task scheduling
The identification information put obtains the priority limit of the task execution device, when being verified to subtask, obtains the subtask
Whether affiliated task judges the priority of the affiliated task within the priority limit of the task execution device.
For example, the task execution device X being located at respectively on machine A, B, C can perform the task that task type is Y, in order to
The task execution device on machine A is made only to be absorbed in and does the high task of priority, then can limit the task execution device on machine A
The priority limit of X is 8-10, then when the task execution device X request subtask on machine A, priority limit is 1-7's
Task type is that the task of Y will not issue.
(5)Whether the verification affiliated task in subtask meets the dependence limitation between the task and other tasks.
Subtask verification includes, and judges whether each subtask meets the condition of issuing according to the information of subtask.Specifically, it is sub
Task verification may include:
(1)Verify whether subtask is that can force the subtask issued.
For example, a kind of subtask type can be set, for belonging to the different subtasks of same task, make the subtask class
The subtask of type, which has, highest issues priority.
(2)Whether the state for verifying subtask is the state that can be issued.For example, ready state(READY)Subtask
It can be issued, and task status is success status(SUCCESSFUL)Subtask can not be issued.
(3)Whether verification subtask deadline is later than the request time of task scheduling apparatus.If it can just be issued.
(4)Whether verification subtask meets time delay.
Such as, it is desirable that current time is later than the deadline of subtask plus time delay, can just be issued.
(5)Whether verification subtask, which meets, starts the time.
Such as, it is desirable that the same day that current time is later than subtask starts the time, can just be issued.
(6)Whether verification subtask meets the dependence between the subtask and other subtasks.
(7)Whether verification subtask meets default number of attempt limitation.
It, can also be to the number of retries of subtask in order to control the inefficiency for performing the excessive subtask of the frequency of failure and being directed at
It is limited, when the number of retries of subtask reaches default threshold value,
(8)Whether the subtask that verification retries, which reaches, retries the stand-by period.Such as the attribute of subtask is further included and retried
It treats the time, it is described to retry the stand-by period for limiting the minimum time also needed to wait for when subtask issues unsuccessfully.
Executive device verification includes, and according to the log-on message for the task execution device for sending task requests, obtains described appoint
The trustship machine information for executive device of being engaged in, judges whether the trustship machine information meets qualifications of the subtask to trustship machine.Tool
Body, executive device verification includes:
(1)Whether the identification information for verifying the task execution device for sending task requests meets the restriction of subtask.Such as
The attribute of subtask further includes the identification information of task execution device, for being carried out to the task execution device for performing the subtask
It limits.
(2)Whether the current state for verifying the task execution device for sending task requests is effective.
(3)Verification is sent on the task execution device of task requests while whether the subtask of operation meets the limit of subtask
System.
(4)Whether the priority of verification subtask meets the task execution device for sending task requests to the preferential of subtask
The qualifications of grade.
(5)Whether the number that verification sends the subtask being carrying out on the task execution device of task requests meets by school
The restriction for the subtask tested.
In a preferred embodiment of the present embodiment, dependence verification is appointed for obtaining the preposition son of subtask
Business, according to the dependence between the subtask and the preposition subtask, judges whether the subtask meets lower clockwork spring
Part.
It should be noted that specifically issue in check logic, the order of various verifications is simultaneously non-critical unalterable
Sequentially, all within the spirit and principle of present embodiment, the increasing of any step is deleted and/or exchanged, and is all contained in the present embodiment
Within the method.
S303, in gathering from subtask subtask is selected to be issued to task execution device.
By it is above-mentioned issue check logic verification after, the subtask met is ranked up according to preset algorithm, by first
A sub- mission dispatching to it is described transmission task requests task execution device.
Specifically, sequence includes:To each subtask in the set of the subtask according to number of attempt Bit-reversed, according to excellent
First grade carry out order sequence is ranked up according to period type number sequence or is ranked up according to run time order.
S304, the implementing result that task execution device returns is received, changes the attribute of subtask.
The subtask can be removed subtask list and individually store or change subtask by the success of group tasks carrying
Attribute identifies the state of the subtask.If the latter, then the attribute of subtask may also include:It subtask state and retries time
The information such as number.When receiving the implementing result of task execution device return, believe according to the state for returning the result modification subtask
Breath.When running succeeded, the information that subtask runs succeeded is sent, when task scheduling apparatus receives what subtask ran succeeded
During information, subtask identifier is parsed, the state of the subtask in the list of subtask is changed to success status
(SUCCESSFUL).When performing failure, the information that subtask performs failure is sent, when task scheduling apparatus receives subtask
When performing the information of failure, subtask and identifier are parsed, the number of retries of the subtask in the list of subtask is added 1.
It, can also be to the number of retries of subtask in order to control the inefficiency for performing the excessive subtask of the frequency of failure and being directed at
It is limited, when the number of retries of subtask reaches default threshold value, then no longer issues the subtask.
In the technical solution of distributed task dispatching method described in the present embodiment, by issuing verification sieve volume to subtask
It is verified, obtains and gathered by the subtask verified, it can be to being carried out to the different task for being suitable for different task executive device
Finer centralized management and scheduling, can realize the global association between different task, can support that being suitable for different task performs
Dependence between the different task of device.
Embodiment three
The present embodiment proposes a kind of distributed task dispatching device, and Fig. 4 is the distributed task scheduling tune described in the present embodiment
Schematic device is spent, as described in Figure 4, the distributed task dispatching device described in the present embodiment can cover all data analysis systems
System, including Postgre, TDW, Linux, Hadoop, Oracle, Mysql etc..
Fig. 5 is the distributed task dispatching apparatus structure block diagram described in the present embodiment, as shown in figure 5, described in the present embodiment
Distributed task dispatching device 501 for receiving and respond task execution device 1, task execution device 2, task execution device
The task scheduling request of N etc..
The distributed task dispatching device 501 includes:Scheduling request receiving unit 5011 issues verification unit
5012nd, issuance unit 5013 and result feedback unit 5014.
Scheduling request receiving unit 5011, for receiving the task scheduling request of task execution device transmission, wherein described
Task scheduling asks the identification information for including task type and the task execution device.
Wherein described task scheduling request includes task type(Such as Oracle storages task, Linux data are uploaded and appointed
Business, Hadoop MapReduce task dispatchings)With the identification information of the task execution device.Wherein described task execution device
Identification information is used to each task execution device being distinguished.In the present embodiment, the identification information of the task execution device
Can be the ID number or title of task execution device.
Verification unit 5012 is issued, for being asked according to the task scheduling, according to issuing check logic at least one
Subtask is verified, and is obtained and is gathered by the subtask verified, wherein the attribute of the subtask includes:Subtask identifies
The identifier of symbol, subtask type and affiliated task, and the attribute of task includes:Task identifier, task type, subtask
Subtask type it is identical with the task type of the task belonging to the subtask.
Wherein, to how many subtask carry out verification viewing system scale and subtask number depending on.If subtask number school
Less or system scale school is small, it can be achieved that verified to all subtasks, obtains from all subtasks and is appointed by the son of verification
Business set;If subtask number is more or system scale school is big, it can be achieved that verified to part subtask, such as when being led to
It crosses and stops relatively testing other subtasks when the subtask number verified reaches preset value.
The subtask that selection is adapted with the task scheduling request that task execution device is sent from subtask, is passed through
The subtask set of verification.
Wherein, subtask is by carrying out Task-decomposing acquisition to task, and concrete mode is as described in embodiment one, herein
It does not repeat.
Issuance unit 5013 is issued to the sending task scheduling request of the task for selection subtask in gathering from subtask
Executive device.
It is issued by above-mentioned after verification unit 5012 issue check logic verification, to the subtask that meets according to default
Algorithm is ranked up, by first sub- mission dispatching to the task execution device of the transmission task requests.
Specifically, sequence includes:To each subtask in the set of the subtask according to number of attempt Bit-reversed, according to excellent
First grade carry out order sequence is ranked up according to period type number sequence or is ranked up according to run time order.
As a result feedback unit 5014, for receiving the implementing result that the task execution device returns, foundation performs knot
The attribute of the subtask issued described in fruit modification.
The subtask can be removed subtask list and individually store or change subtask by the success of group tasks carrying
Attribute identifies the state of the subtask.If the latter, then the attribute of subtask may also include:It subtask state and retries time
The information such as number.When receiving the implementing result of task execution device return, believe according to the state for returning the result modification subtask
Breath.When running succeeded, the information that subtask runs succeeded is sent, when task scheduling apparatus receives what subtask ran succeeded
During information, subtask identifier is parsed, the state of the subtask in the list of subtask is changed to success status
(SUCCESSFUL).When performing failure, the information that subtask performs failure is sent, when task scheduling apparatus receives subtask
When performing the information of failure, subtask and identifier are parsed, the number of retries of the subtask in the list of subtask is added 1.
It, can also be to the number of retries of subtask in order to control the inefficiency for performing the excessive subtask of the frequency of failure and being directed at
It is limited, when the number of retries of subtask reaches default threshold value, then no longer issues the subtask.
The technical solution of distributed task dispatching device described in the present embodiment is using distributed architectural framework and ill-mannered
State communicates, and realizes the statelessly communication between task scheduling apparatus and task execution device, can facilitate to task execution device
Linear expansion is carried out, the executive capability of task can be promoted;By being carried out to the different task for being suitable for different task executive device
Centralized management and scheduling, can realize the global association between different task, can support to be suitable for different task executive device not
With the dependence between task.
Example IV
Fig. 7 is the distributed task dispatching apparatus structure block diagram described in the present embodiment, as shown in fig. 7, described in the present embodiment
Distributed task dispatching device 701 for receiving and respond task execution device 1, task execution device 2, task execution device
The task schedulings such as N are asked.
The distributed task dispatching device 701 includes:Scheduling request receiving unit 7011 issues verification unit
7012nd, issuance unit 7013 and result feedback unit 7014.
Scheduling request receiving unit 7011, for receiving the task scheduling request of task execution device transmission, wherein described
Task scheduling asks the identification information for including task type and the task execution device.
Wherein described task scheduling request includes task type(Such as Oracle storages task, Linux data are uploaded and appointed
Business, Hadoop MapReduce task dispatchings)With the identification information of the task execution device.Wherein described task execution device
Identification information is used to each task execution device being distinguished.In the present embodiment, the identification information of the task execution device
Can be the ID number or title of task execution device.
Verification unit 7012 is issued, for being asked according to the task scheduling, according to issuing check logic at least one
Subtask is verified, and is obtained and is gathered by the subtask verified.
Wherein, to how many subtask carry out verification viewing system scale and subtask number depending on.If subtask number school
Less or system scale school is small, it can be achieved that verified to all subtasks, obtains from all subtasks and is appointed by the son of verification
Business set;If subtask number is more or system scale school is big, it can be achieved that verified to part subtask, such as when being led to
It crosses and stops relatively testing other subtasks when the subtask number verified reaches preset value.
The subtask that selection is adapted with the task scheduling request that task execution device is sent from subtask, is passed through
The subtask set of verification.
Wherein, subtask is by carrying out Task-decomposing acquisition to task, and concrete mode is as shown in embodiment one, herein
It does not repeat.
In a preferred embodiment of the present embodiment, the hair verification unit 7012 includes task and verifies subelement
70121st, subtask verification subelement 70122, executive device verification subelement 70123 and dependence verification subelement 70124:
Subelement 70121 is verified by the task according to preset order, subtask verifies subelement 70122, performs dress
Verification subelement 70123 and dependence verification subelement 70124 are put, task verification, subtask verification are carried out to subtask, is held
Luggage puts verification and/or dependence verification.
Task verification subelement 70121 is used for:According to the attribute of the affiliated task in subtask, judge whether subtask meets and appoint
Business scheduling request.Specifically, task verification subelement 70121 can be used for:
(1)Verify the affiliated task in subtask task type with task execution device request task type whether one
It causes.
(2)It is whether restricted to task execution device to verify the affiliated task in subtask, for example whether limitation tasks carrying dress
The identification information put(Such as IP address)Whether within the scope of limitation.Such as the attribute of subtask further includes tasks carrying dress
Confidence ceases, including:Allow all task execution devices, only allow some or more than one identification information appointing for particular value
Business executive device.
(3)Whether the state of verification task is effective, i.e., whether the affiliated task in subtask that verification can be issued, which is in, has
Effect state.Such as effectively whether the attribute information of task further include, and when being verified to subtask, obtains the affiliated of the subtask
Task, judge it is described belonging to task whether effective attribute is effective, if not effectively then showing that the subtask cannot lead to
Cross verification.
(4)Verification the affiliated task in subtask priority whether belong to send task requests task execution device registration
Within priority limit.Such as the attribute information of task further includes priority, task execution device is in task scheduling apparatus
Log-on message includes the identification information and priority limit of task execution device, the tasks carrying dress in being asked by task scheduling
The identification information put obtains the priority limit of the task execution device, when being verified to subtask, obtains the subtask
Whether affiliated task judges the priority of the affiliated task within the priority limit of the task execution device.
For example, the task execution device X being located at respectively on machine A, B, C can perform the task that task type is Y, in order to
The task execution device on machine A is made only to be absorbed in and does the high task of priority, then can limit the task execution device on machine A
The priority limit of X is 8-10, then when the task execution device X request subtask on machine A, priority limit is 1-7's
Task type is that the task of Y will not issue.
(5)Whether the verification affiliated task in subtask meets the dependence limitation between the task and other tasks.
Subtask verification subelement 70122 is used for:Judge whether each subtask meets lower clockwork spring according to the information of subtask
Part.Specifically, verification subelement 70122 in subtask is used for:
(1)Verify whether subtask is that can force the subtask issued.
For example, a kind of subtask type can be set, for belonging to the different subtasks of same task, make the subtask class
The subtask of type, which has, highest issues priority.
(2)Whether the state for verifying subtask is the state that can be issued.For example, ready state(READY)Subtask
It can be issued, and task status is success status(SUCCESSFUL)Subtask can not be issued.
(3)Whether verification subtask deadline is later than the request time of task scheduling apparatus.If it can just be issued.
(4)Whether verification subtask meets time delay.
Such as, it is desirable that current time is later than the deadline of subtask plus time delay, can just be issued.
(5)Whether verification subtask, which meets, starts the time.
Such as, it is desirable that the same day that current time is later than subtask starts the time, can just be issued.
(6)Whether verification subtask meets the dependence between the subtask and other subtasks.
(7)Whether verification subtask meets default number of attempt limitation.
It, can also be to the number of retries of subtask in order to control the inefficiency for performing the excessive subtask of the frequency of failure and being directed at
It is limited, when the number of retries of subtask reaches default threshold value,
(8)Whether the subtask that verification retries, which reaches, retries the stand-by period.Such as the attribute of subtask is further included and retried
It treats the time, it is described to retry the stand-by period for limiting the minimum time also needed to wait for when subtask issues unsuccessfully.
Executive device verification subelement 70123 is used for:According to send task requests task execution device log-on message,
The trustship machine information of the task execution device is obtained, judges whether the trustship machine information meets limit of the subtask to trustship machine
Fixed condition.Specifically, executive device verification subelement 70123 can be used for:
(1)Whether the identification information for verifying the task execution device for sending task requests meets the restriction of subtask.Such as
The attribute of subtask further includes the identification information of task execution device, for being carried out to the task execution device for performing the subtask
It limits.
(2)Whether the current state for verifying the task execution device for sending task requests is effective.
(3)Verification is sent on the task execution device of task requests while whether the subtask of operation meets the limit of subtask
System.
(4)Whether the priority of verification subtask meets the task execution device for sending task requests to the preferential of subtask
The qualifications of grade.
(5)Whether the number that verification sends the subtask being carrying out on the task execution device of task requests meets by school
The restriction for the subtask tested.
In a preferred embodiment of the present embodiment, dependence verification is appointed for obtaining the preposition son of subtask
Business, according to the dependence between the subtask and the preposition subtask, judges whether the subtask meets lower clockwork spring
Part.
It should be noted that specifically issue in check logic, the order of various verifications is simultaneously non-critical unalterable
Sequentially, all within the spirit and principle of present embodiment, the increasing of any step is deleted and/or exchanged, and is all contained in the present embodiment
Within the method.
Issuance unit 7013 is issued to the task execution device for selection subtask in gathering from subtask.
By it is above-mentioned issue check logic verification after, the subtask met is ranked up according to preset algorithm, by first
A sub- mission dispatching to it is described transmission task requests task execution device.
Specifically, sequence includes:To each subtask in the set of the subtask according to number of attempt Bit-reversed, according to excellent
First grade carry out order sequence is ranked up according to period type number sequence or is ranked up according to run time order.
As a result feedback unit 7014, for receiving the implementing result that the task execution device returns, foundation performs knot
The attribute of the subtask issued described in fruit modification.
The subtask can be removed subtask list and individually store or change subtask by the success of group tasks carrying
Attribute identifies the state of the subtask.If the latter, then the attribute of subtask may also include:It subtask state and retries time
The information such as number.When receiving the implementing result of task execution device return, believe according to the state for returning the result modification subtask
Breath.When running succeeded, the information that subtask runs succeeded is sent, when task scheduling apparatus receives what subtask ran succeeded
During information, subtask identifier is parsed, the state of the subtask in the list of subtask is changed to success status
(SUCCESSFUL).When performing failure, the information that subtask performs failure is sent, when task scheduling apparatus receives subtask
When performing the information of failure, subtask and identifier are parsed, the number of retries of the subtask in the list of subtask is added 1.
It, can also be to the number of retries of subtask in order to control the inefficiency for performing the excessive subtask of the frequency of failure and being directed at
It is limited, when the number of retries of subtask reaches default threshold value, then no longer issues the subtask.
The present embodiment also proposed a kind of server, including:Display, one or more than one processor;Storage
Device;And one or more than one program, wherein the one or more programs are stored in the memory,
And be configured to be performed by the one or more processor, the one or more programs include for into
The instruction of the following operation of row:
Receive task execution device send task scheduling request, wherein the task scheduling request include task type with
The identification information of the task execution device;
It is asked according to the task scheduling, at least one subtask is verified according to check logic is issued, is led to
The subtask set of verification is crossed, wherein the attribute of the subtask includes:Subtask identifier, subtask type and affiliated times
The identifier of business, and the attribute of task includes:Task identifier, task type, the subtask type of subtask are appointed with the son
The task type of task belonging to business is identical;
Selection subtask is issued to the task execution device in gathering from the subtask;
The implementing result that the task execution device returns is received, according to the subtask issued described in implementing result modification
Attribute.
The present embodiment also proposed a kind of computer readable storage medium, and the computer-readable recording medium storage has one
A either more than one program the one or more programs are used for performing by one or more than one processor
One distributed task dispatching method, the described method includes:
Receive task execution device send task scheduling request, wherein the task scheduling request include task type with
The identification information of the task execution device;
It is asked according to the task scheduling, at least one subtask is verified according to check logic is issued, is led to
The subtask set of verification is crossed, wherein the attribute of the subtask includes:Subtask identifier, subtask type and affiliated times
The identifier of business, and the attribute of task includes:Task identifier, task type, the subtask type of subtask are appointed with the son
The task type of task belonging to business is identical;
Selection subtask is issued to the task execution device in gathering from the subtask;
The implementing result that the task execution device returns is received, according to the subtask issued described in implementing result modification
Attribute.
In the technical solution of distributed task dispatching device described in the present embodiment, by issuing verification sieve volume to subtask
It is verified, obtains and gathered by the subtask verified, it can be to being carried out to the different task for being suitable for different task executive device
Finer centralized management and scheduling, can realize the global association between different task, can support that being suitable for different task performs
Dependence between the different task of device.
Above example provide technical solution in all or part of content can be realized by software programming, software
Program storage is in the storage medium that can be read, and storage medium is for example:Hard disk, CD or floppy disk in computer.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and
Within principle, any modifications, equivalent replacements and improvements are made should all be included in the protection scope of the present invention.