CN103077085A - Method and system for distributing tasks - Google Patents
Method and system for distributing tasks Download PDFInfo
- Publication number
- CN103077085A CN103077085A CN2013100076487A CN201310007648A CN103077085A CN 103077085 A CN103077085 A CN 103077085A CN 2013100076487 A CN2013100076487 A CN 2013100076487A CN 201310007648 A CN201310007648 A CN 201310007648A CN 103077085 A CN103077085 A CN 103077085A
- Authority
- CN
- China
- Prior art keywords
- task
- dependence
- distributor
- free time
- comparisons
- 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
Links
Images
Landscapes
- Computer And Data Communications (AREA)
Abstract
The invention provides a method and a system for distributing tasks. The method comprises the following steps that a client submits the tasks to a task distributor; the task distributor puts the tasks with relying relation into a task queue, establishes a task relying reference list according to the relying relation between the tasks and synchronously maps the task relying reference list to a mapping relation server; the task distributor acquires the total idle time slice distribution number of each relied task according to the task relying reference list and a first policy and transmits the total idle time slice distribution number of each relied task to the mapping relation server; the mapping relation server determines the period corresponding to each relied task according to the received task relying reference list, the total idle time slice distribution number of each relied task and a second policy; and the task distributor processes the tasks with relying relation in the task queue according to the total idle time slice distribution number of each relied task and the period corresponding to each relied task.
Description
Technical field
The invention belongs to field of computer technology, relate in particular to the method and system that a kind of task is distributed.
Background technology
At present, in field of computer technology, can run into the calculation task model of a complexity by a plurality of situations about being formed by the calculation task of dependence.Wherein, dependence task can only just can calculate after being finished by dependence task, but and the calculation task parallel computation that does not have dependence.For this task model, how task is carried out resource and distribute, to obtain the optimum task processing time, be an important problem.
Summary of the invention
The invention provides the method and system that a kind of task is distributed, to address the above problem.
The invention provides the method that a kind of task is distributed.Said method may further comprise the steps: client with job invocation to task distributor; Task distributor will have the task of dependence and put into task queue, and set up the Task Dependent table of comparisons according to the dependence between the task, and with the Task Dependent table of comparisons synchronously to the mapping relations server; Task distributor obtains each free time sheet by dependence task and distributes sum, and distribute sum to be sent to the mapping relations server each free time sheet by dependence task according to the Task Dependent table of comparisons and the first strategy; The mapping relations server distributes sum and the second strategy according to the Task Dependent table of comparisons that receives, each free time sheet by dependence task, determine each by cycle corresponding to dependence task, and each is sent to task distributor by cycle corresponding to dependence task; Task distributor distributes sum and each by cycle corresponding to dependence task according to each free time sheet by dependence task, has the task of dependence in the Processing tasks formation.
The system that the present invention also provides a kind of task to distribute comprises client, task distributor and mapping relations server.Client connects task distributor, and task distributor connects the mapping relations server.Wherein, client with job invocation to task distributor.Task distributor will have the task of dependence and put into task queue, and set up the Task Dependent table of comparisons according to the dependence between the task, and with the Task Dependent table of comparisons synchronously to the mapping relations server.Task distributor obtains each free time sheet by dependence task and distributes sum, and distribute sum to be sent to the mapping relations server each free time sheet by dependence task according to the Task Dependent table of comparisons and the first strategy.The mapping relations server distributes sum and the second strategy according to the Task Dependent table of comparisons that receives, each free time sheet by dependence task, determine each by cycle corresponding to dependence task, and each is sent to task distributor by cycle corresponding to dependence task.Task distributor distributes sum and each by cycle corresponding to dependence task according to each free time sheet by dependence task, has the task of dependence in the Processing tasks formation.
Compared to prior art, method and system according to task distribution provided by the invention, task distributor is according to the Task Dependent table of comparisons and the first strategy, obtain each free time sheet by dependence task and distribute sum, and distribute sum to be sent to the mapping relations server each free time sheet by dependence task.In addition, the mapping relations server distributes sum and the second strategy according to the Task Dependent table of comparisons that receives, each free time sheet by dependence task, determine each by cycle corresponding to dependence task, and each is sent to task distributor by cycle corresponding to dependence task.Task distributor distributes sum and each by cycle corresponding to dependence task according to each free time sheet by dependence task, has the task of dependence in the Processing tasks formation.So, improve the allocation efficiency of resource of the task with dependence, obtained better execution so that have the task of dependence, improved efficient.
Description of drawings
Accompanying drawing described herein is used to provide a further understanding of the present invention, consists of the application's a part, and illustrative examples of the present invention and explanation thereof are used for explaining the present invention, do not consist of improper restriction of the present invention.In the accompanying drawings:
Figure 1 shows that the process flow diagram of the method for the task distribution that preferred embodiment according to the present invention provides;
Figure 2 shows that the synoptic diagram of the system of the task distribution that preferred embodiment according to the present invention provides.
Embodiment
Hereinafter also describe in conjunction with the embodiments the present invention in detail with reference to accompanying drawing.Need to prove that in the situation of not conflicting, embodiment and the feature among the embodiment among the application can make up mutually.
Figure 1 shows that the process flow diagram of the method for the task distribution that preferred embodiment according to the present invention provides.As shown in Figure 1, the preferred embodiment of the present invention task of the providing method of distributing comprises step 101 ~ 105.
In step 101, client with job invocation to task distributor.In this, task comprises task with dependence and separate task.Yet the present invention does not limit this.
In step 102, described task distributor will have the task of dependence and put into task queue, and set up the Task Dependent table of comparisons according to the dependence between the task, and with the described Task Dependent table of comparisons synchronously to the mapping relations server.In this, the task in the task queue according to the dependence ordering, preferentially is performed by dependence task.
In present embodiment, the Task Dependent table of comparisons example that task distributor is set up is as shown in table 1.Yet the present invention does not limit this.
By dependence task | Dependence task |
Task 1 | Task 4, task 5, task 6 |
Task 2 | Task 5, task 6 |
Task 3 | Task 6 |
Table 1
In step 103, described task distributor is according to the described Task Dependent table of comparisons and the first strategy, obtain each free time sheet by dependence task and distribute sum, and distribute sum to be sent to described mapping relations server each free time sheet by dependence task.
In this, described the first strategy is: described task distributor is calculated respectively each by dependence task accounting corresponding to dependence task according to the described Task Dependent table of comparisons,, calculated and obtain each free time sheet by dependence task and distribute sum by the total amount of system's free time sheet of dependence task accounting corresponding to dependence task and current time according to each.Wherein, each is accordingly by dependence task number corresponding to dependence task and the ratio of total task number by dependence task accounting corresponding to dependence task.Each free time sheet distribution by dependence task adds up to accordingly by the product of system's free time sheet total amount of the dependence task accounting of dependence task and current time.
In present embodiment, describe as an example of table 1 example, as shown in Table 1, current task adds up to 6.In addition, for example system's free time sheet total amount of current time is a, then by the dependence task accounting=3/6=0.5 of dependence task 1, and by the free time sheet distribution sum=0.5*a of dependence task 1; By the dependence task accounting=2/6=1/3 of dependence task 2, and by free time sheet distribution sum=(1/3) * a of dependence task 2; By the dependence task accounting of dependence task 3=1/6, and by free time sheet distribution sum=(1/6) * a of dependence task 3.In this, task distributor obtains will be distributed sum be sent to the mapping relations server by the free time sheet of dependence task 1 ~ 3 correspondence by behind the free time sheet distribution sum of dependence task 1 ~ 3 correspondence.
In step 104, described mapping relations server distributes sum and the second strategy according to the described Task Dependent table of comparisons that receives, each free time sheet by dependence task, determine each by cycle corresponding to dependence task, and each is sent to described task distributor by cycle corresponding to dependence task.
In this, described the second strategy is: each is distributed sum and each to be determined by dependence task number corresponding to dependence task by cycle corresponding to dependence task according to each free time sheet by dependence task.Particularly, each by cycle corresponding to dependence task equal corresponding free time sheet by dependence task distribute sum with corresponding by the ratio of dependence task number corresponding to dependence task.Yet the present invention does not limit this.In other embodiment, each can also be equaled the corresponding ratio that is distributed sum and default constant by the free time sheet of dependence task by cycle corresponding to dependence task.Wherein, the setting of described default constant can be set according to actual needs.
In present embodiment, still the table 1 in the step 102 describes as example.The mapping relations server receives the Task Dependent table of comparisons (namely from task distributor, table 1) and by the free time sheet of dependence task 1 ~ 3 correspondence distribute sum, according to the second strategy as can be known, by the cycle T 1=0.5*a/3=(1/6 of dependence task 1 correspondence) * a, by the cycle T 2=(1/3 of dependence task 2 correspondences) * a/2=(1/6) * a, by the cycle T 3=(1/6 of dependence task 3 correspondences) * a.
In step 105, described task distributor distributes sum and each by cycle corresponding to dependence task according to each free time sheet by dependence task, processes the task of having dependence in the described task queue.
Particularly, task distributor obtains each free time sheet by dependence task and distributes sum, and receives each by cycle corresponding to dependence task from the mapping relations server.Task distributor judges whether if can not process, then to continue dependence task in can the Processing tasks formation to wait for the result who is fed back by the dependence task next cycle according to the result who is fed back by the dependence task one-period, until till dependence task can process.
In present embodiment, still the table 1 in the step 102 describes as example.In this, task distributor judges whether can continue to process dependence task 4, dependence task 5 or dependence task 6 according to the result who is fed back by dependence task 1.If can not continue to process dependence task 4, dependence task 5 or dependence task 6, then task distributor is deleted the result who is fed back by dependence task 1, and task distributor judges according to by the result of dependence task 1 next cycle T1 feedback whether dependence task 4, dependence task 5 or dependence task 6 can be processed again.Said process is until till dependence task 4, dependence task 5 or dependence task 6 can process.If task distributor for example judges that according to the result who is fed back by dependence task 1 obtaining dependence task 5 can process, then begin the section processes of dependence task 5, at this moment, the temporary result who is fed back by dependence task 2 who receives of task distributor, and after the section processes of dependence task 5 is finished, judge that according to the result who is fed back by dependence task 2 can dependence task 5 continue to process, process if can continue, then task distributor continues to process dependence task 5, if can not continue to process dependence task 5 according to result's judgement of being fed back by dependence task 2, then task distributor is deleted the temporary result who is fed back by dependence task 2, wait is by the result of dependence task 2 next cycle T2 feedback, proceed again to judge, until till dependence task 5 can process.In addition, the processing procedure of dependence task 6 is with dependence task 5, so repeat no more in this.
For example: be updated data table a, b, c, d by dependence task 1; Be updated data table e, f, g, h by dependence task 2; Dependence task 5 is data query table a, g; If when first cycle T 1, finished the renewal of tables of data a by dependence task 1; By dependence task 2 when first cycle T 2, finish the renewal of tables of data e, then task distributor is according to the result who is fed back by dependence task 1 (renewal of tables of data a), judges that dependence task 5 can process, and (the data query table a) then to begin the section processes of task 5; At this moment, the temporary result who is fed back by dependence task 2 (renewal of tables of data e) who receives of task distributor.In the section processes of dependence task 5 (the data query table a) finish after, task distributor is according to the result who is fed back by dependence task 2 (renewal of tables of data e), judge that dependence task 5 can not continue to process, then task distributor is deleted the temporary result who is fed back by dependence task 2 (renewal of tables of data e), wait is by the result of dependence task 2 next cycle T2 feedback, proceed again to judge, until till dependence task 5 can process.
In addition, in present embodiment, if arbitrary in the task queue finished by dependence task, then the task distributor updating task relies on the table of comparisons, and the Task Dependent table of comparisons that upgrades is sent to the mapping relations server.Still the table 1 in the step 102 is as example, if finished by dependence task 3, then the task distributor updating form 1, and it is as shown in table 2 to obtain example.
By dependence task | Dependence task |
Task 1 | Task 4, task 5, task 6 |
Task 2 | Task 5, task 6 |
Table 2
At this moment, task distributor with the Task Dependent table of comparisons (that is, table 2) that upgrades synchronously to the mapping relations server.Task distributor is according to table 2 and the first strategy, regain each free time sheet by dependence task and distribute sum, and send to the mapping relations server, the mapping relations server distributes sum and the second strategy according to table 2, each free time sheet by dependence task, regain each by cycle corresponding to dependence task, and send to task distributor.Task distributor is distributed sum and corresponding cycle according to each the free time sheet by dependence task that upgrades, and has the task of dependence in the Processing tasks formation, until the task in the task queue is all processed.
Figure 2 shows that the synoptic diagram of the system of the task distribution that preferred embodiment according to the present invention provides.As shown in Figure 2, the system that distributes of the preferred embodiment of the present invention task of providing comprises client 10, task distributor 12 and mapping relations server 14.Wherein, client 10 connects task distributor 12, and task distributor 12 connects mapping relations server 14.
In present embodiment, client 10 with job invocation to task distributor 12.Task distributor 12 will have the task of dependence and put into task queue, and set up the Task Dependent table of comparisons according to the dependence between the task, and with the Task Dependent table of comparisons synchronously to mapping relations server 14.Task distributor 12 obtains each free time sheet by dependence task and distributes sum, and distribute sum to be sent to mapping relations server 14 each free time sheet by dependence task according to the Task Dependent table of comparisons and the first strategy.Mapping relations server 14 distributes sum and the second strategy according to the Task Dependent table of comparisons that receives, each free time sheet by dependence task, determine each by cycle corresponding to dependence task, and each is sent to task distributor 12 by cycle corresponding to dependence task.Task distributor 12 distributes sum and each by cycle corresponding to dependence task according to each free time sheet by dependence task, has the task of dependence in the Processing tasks formation.Specific operation process about said system is described with above-mentioned method, so repeat no more in this.
In sum, the method and system that the task that preferred embodiment provides according to the present invention is distributed, task distributor is according to the Task Dependent table of comparisons and the first strategy, obtain each free time sheet by dependence task and distribute sum, and distribute sum to be sent to the mapping relations server each free time sheet by dependence task.In addition, the mapping relations server distributes sum and the second strategy according to the Task Dependent table of comparisons that receives, each free time sheet by dependence task, determine each by cycle corresponding to dependence task, and each is sent to task distributor by cycle corresponding to dependence task.Task distributor distributes sum and each by cycle corresponding to dependence task according to each free time sheet by dependence task, has the task of dependence in the Processing tasks formation.So, improve the allocation efficiency of resource of the task with dependence, obtained better execution so that have the task of dependence, improved efficient.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (10)
1. the method that task is distributed is characterized in that, may further comprise the steps:
Client with job invocation to task distributor;
Described task distributor will have the task of dependence and put into task queue, and set up the Task Dependent table of comparisons according to the dependence between the task, and with the described Task Dependent table of comparisons synchronously to the mapping relations server;
Described task distributor obtains each free time sheet by dependence task and distributes sum, and distribute sum to be sent to described mapping relations server each free time sheet by dependence task according to the described Task Dependent table of comparisons and the first strategy;
Described mapping relations server distributes sum and the second strategy according to the described Task Dependent table of comparisons that receives, each free time sheet by dependence task, determine each by cycle corresponding to dependence task, and each is sent to described task distributor by cycle corresponding to dependence task;
Described task distributor distributes sum and each by cycle corresponding to dependence task according to each free time sheet by dependence task, processes the task of having dependence in the described task queue.
2. method according to claim 1, it is characterized in that, described the first strategy is: described task distributor is calculated respectively each by dependence task accounting corresponding to dependence task according to the described Task Dependent table of comparisons,, calculated and obtain each free time sheet by dependence task and distribute sum by the total amount of system's free time sheet of dependence task accounting corresponding to dependence task and current time according to each.
3. method according to claim 1 is characterized in that, described the second strategy is: each is distributed sum and each to be determined by dependence task number corresponding to dependence task by cycle corresponding to dependence task according to each free time sheet by dependence task.
4. method according to claim 1 is characterized in that, the task in the described task queue according to the dependence ordering, preferentially is performed by dependence task.
5. method according to claim 1, it is characterized in that, described task distributor judges whether to process dependence task in the described task queue according to the result who is fed back by the dependence task one-period, if can not process, then continue to wait for the described result who is fed back by the dependence task next cycle, until till described dependence task can process.
6. method according to claim 1, it is characterized in that, if arbitrary in the described task queue finished by dependence task, then described task distributor is upgraded the described Task Dependent table of comparisons, and the described Task Dependent table of comparisons that will upgrade is sent to described mapping relations server.
7. the system that task is distributed is characterized in that comprise client, task distributor and mapping relations server, described client connects described task distributor, and described task distributor connects described mapping relations server,
Wherein, described client with job invocation to described task distributor,
Described task distributor will have the task of dependence and put into task queue, and set up the Task Dependent table of comparisons according to the dependence between the task, and the described Task Dependent table of comparisons is synchronous to described mapping relations server,
Described task distributor obtains each free time sheet by dependence task and distributes sum, and distribute sum to be sent to described mapping relations server each free time sheet by dependence task according to the described Task Dependent table of comparisons and the first strategy,
Described mapping relations server distributes sum and the second strategy according to the described Task Dependent table of comparisons that receives, each free time sheet by dependence task, determine that each is by cycle corresponding to dependence task, and each is sent to described task distributor by cycle corresponding to dependence task
Described task distributor distributes sum and each by cycle corresponding to dependence task according to each free time sheet by dependence task, processes the task of having dependence in the described task queue.
8. system according to claim 7, it is characterized in that, described the first strategy is: described task distributor is calculated respectively each by dependence task accounting corresponding to dependence task according to the described Task Dependent table of comparisons,, calculated and obtain each free time sheet by dependence task and distribute sum by the total amount of system's free time sheet of dependence task accounting corresponding to dependence task and current time according to each.
9. system according to claim 7 is characterized in that, described the second strategy is: each is distributed sum and each to be determined by dependence task number corresponding to dependence task by cycle corresponding to dependence task according to each free time sheet by dependence task.
10. system according to claim 7 is characterized in that, the task in the described task queue according to the dependence ordering, preferentially is performed by dependence task.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013100076487A CN103077085A (en) | 2013-01-09 | 2013-01-09 | Method and system for distributing tasks |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013100076487A CN103077085A (en) | 2013-01-09 | 2013-01-09 | Method and system for distributing tasks |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103077085A true CN103077085A (en) | 2013-05-01 |
Family
ID=48153620
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2013100076487A Pending CN103077085A (en) | 2013-01-09 | 2013-01-09 | Method and system for distributing tasks |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103077085A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014108000A1 (en) * | 2013-01-09 | 2014-07-17 | 苏州亿倍信息技术有限公司 | Task allocation method and system |
CN107870949A (en) * | 2016-09-28 | 2018-04-03 | 腾讯科技(深圳)有限公司 | Data analysis job dependence relation generation method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101743534A (en) * | 2007-07-16 | 2010-06-16 | 微软公司 | By increasing and shrinking resources allocation and dispatch |
US20110099551A1 (en) * | 2009-10-26 | 2011-04-28 | Microsoft Corporation | Opportunistically Scheduling and Adjusting Time Slices |
CN102591712A (en) * | 2011-12-30 | 2012-07-18 | 大连理工大学 | Decoupling parallel scheduling method for rely tasks in cloud computing |
US20120246659A1 (en) * | 2011-03-25 | 2012-09-27 | Microsoft Corporation | Techniques to optimize upgrade tasks |
-
2013
- 2013-01-09 CN CN2013100076487A patent/CN103077085A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101743534A (en) * | 2007-07-16 | 2010-06-16 | 微软公司 | By increasing and shrinking resources allocation and dispatch |
US20110099551A1 (en) * | 2009-10-26 | 2011-04-28 | Microsoft Corporation | Opportunistically Scheduling and Adjusting Time Slices |
US20120246659A1 (en) * | 2011-03-25 | 2012-09-27 | Microsoft Corporation | Techniques to optimize upgrade tasks |
CN102591712A (en) * | 2011-12-30 | 2012-07-18 | 大连理工大学 | Decoupling parallel scheduling method for rely tasks in cloud computing |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014108000A1 (en) * | 2013-01-09 | 2014-07-17 | 苏州亿倍信息技术有限公司 | Task allocation method and system |
CN107870949A (en) * | 2016-09-28 | 2018-04-03 | 腾讯科技(深圳)有限公司 | Data analysis job dependence relation generation method and system |
CN107870949B (en) * | 2016-09-28 | 2021-09-07 | 腾讯科技(深圳)有限公司 | Data analysis job dependency relationship generation method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103064745B (en) | A kind of method and system of task matching process | |
CN103077083A (en) | Method and system for processing tasks | |
TWI547817B (en) | Method, system and apparatus of planning resources for cluster computing architecture | |
US20180025057A1 (en) | M x n dispatching in large scale distributed system | |
CN103680496B (en) | Acoustic training model method based on deep-neural-network, main frame and system | |
CN103617062B (en) | The render farm Dynamic Deployment System of a kind of flexibility and method | |
CN103077086A (en) | Method and system for controlling task distribution | |
CN109358881B (en) | Authority-controllable intelligent contract upgrading method based on intelligent contract | |
CN102521055B (en) | Virtual machine resource allocating method and virtual machine resource allocating system | |
CN109416646B (en) | Optimization method for container allocation and processing equipment | |
CN103401939A (en) | Load balancing method adopting mixing scheduling strategy | |
CN104346214B (en) | Asynchronous task managing device and method for distributed environment | |
CN102915248A (en) | Automatic deploying system and automatic deploying method of application system | |
CN103336722A (en) | Virtual machine CPU source monitoring and dynamic distributing method | |
CN104881322A (en) | Method and device for dispatching cluster resource based on packing model | |
CN103729257A (en) | Distributed parallel computing method and system | |
Zhang et al. | Asynchronous distributed semi-stochastic gradient optimization | |
CN108270805A (en) | For the resource allocation methods and device of data processing | |
Penmatsa et al. | Price-based user-optimal job allocation scheme for grid systems | |
CN103257896A (en) | Max-D job scheduling method under cloud environment | |
CN103077085A (en) | Method and system for distributing tasks | |
CN110084507B (en) | Scientific workflow scheduling optimization method based on hierarchical perception in cloud computing environment | |
CN103002053B (en) | The profit maximization dispatching method of cloud computing and system | |
CN103077084A (en) | Method and system for controlling tasks | |
CN106506594B (en) | Parallel computing resource allocation method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C53 | Correction of patent of invention or patent application | ||
CB02 | Change of applicant information |
Address after: Suzhou City, Jiangsu province 215021 Suzhou Industrial Park Road No. 8 only Weiting Technology Venture Building 7 floor Applicant after: Suzhou Yibei Information Technology Co., Ltd. Address before: Suzhou City, Jiangsu Province, Suzhou Industrial Park 215021 Xinghu Street No. 328 Chongwen Road, Guohua building A511 Applicant before: Suzhou Yibei Information Technology Co., Ltd. |
|
AD01 | Patent right deemed abandoned |
Effective date of abandoning: 20160601 |
|
C20 | Patent right or utility model deemed to be abandoned or is abandoned |