CN105808333B - Method for allocating tasks and system - Google Patents

Method for allocating tasks and system Download PDF

Info

Publication number
CN105808333B
CN105808333B CN201610121630.3A CN201610121630A CN105808333B CN 105808333 B CN105808333 B CN 105808333B CN 201610121630 A CN201610121630 A CN 201610121630A CN 105808333 B CN105808333 B CN 105808333B
Authority
CN
China
Prior art keywords
task
distribution
executor
task distribution
allocation rule
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610121630.3A
Other languages
Chinese (zh)
Other versions
CN105808333A (en
Inventor
张先锋
张钰山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Ctrip Business Co Ltd
Original Assignee
Shanghai Ctrip Business Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Ctrip Business Co Ltd filed Critical Shanghai Ctrip Business Co Ltd
Priority to CN201610121630.3A priority Critical patent/CN105808333B/en
Publication of CN105808333A publication Critical patent/CN105808333A/en
Application granted granted Critical
Publication of CN105808333B publication Critical patent/CN105808333B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Abstract

The present invention provides a kind of method for allocating tasks and system, it is stored with expansible distribution information, which includes distribution type, allocation rule and executor, the corresponding at least allocation rule of each distribution type, the corresponding at least executor of each allocation rule comprising: S1, obtain a task distribution request, which includes task to be allocated and unique ID number;S2, the distribution type in the distribution information matched according to the task to be allocated;S3, the task to be allocated allocation rule corresponding with the distribution type that this is matched matched, S is entered step if successful match4;S4, the task distribution request is sent to the corresponding executor of the matched allocation rule of Mission Success to be allocated.With versatility, task to be allocated can be distributed into corresponding executor according to distribution type and allocation rule.

Description

Method for allocating tasks and system
Technical field
The present invention relates to a kind of method for allocating tasks and systems.
Background technique
Refer to that assigning the task to specified main body according to the attribute value of task goes to complete containing semantic task distribution.Than If task T distributes to main body S1 as P1=1 with attribute P1 and P2, main body S2 is distributed to as P2=2.There is currently Task distribution system such as Microsoft ASP.NET MVC the (ASP.NET based on MVC pattern that official, Microsoft provides Web application frame, wherein MVC is one of three kinds of ASP.NET programming modes) used in Route (routing) be exactly Different task requests are distributed to specific executor to go to execute.
Currently, the realization of task is distributed mostly with corresponding business model close-coupled, and allocation rule is too simple and not Can or it be difficult to change, usually allocation rule is fixed, if necessary to new allocation rule, then new distribution program is needed, Behavior when distribution cannot be changed, the functions such as allocation strategy, viscous distribution and associated allocation are unreliable.As it can be seen that current Task distribution system cannot or be difficult change allocation rule, cannot or be difficult add or modify distribution type, cannot or be difficult Change assigning process.
Summary of the invention
The technical problem to be solved by the present invention is to the distribution rule in order to overcome task distribution system in the prior art to use Then too simple and allocation rule is fixed to lead to that existing system flexibility is poor, defect without versatility, provides a kind of Distribution method of being engaged in and system.
The present invention is to solve above-mentioned technical problem by following technical proposals:
The present invention provides a kind of method for allocating tasks, it is characterized in that, it is stored with expansible distribution information, the distribution Information includes distribution type, allocation rule and executor, the corresponding at least allocation rule of each distribution type, each allocation rule A corresponding at least executor comprising following steps:
S1, obtain a task distribution request, which includes that (identity is known by task to be allocated and unique ID Not) number;
S2, the distribution type in the distribution information matched according to the task to be allocated;
S3, the task to be allocated allocation rule corresponding with the distribution type matched matched, if successful match Then enter step S4
S4, the task distribution request is sent to the corresponding executor of the matched allocation rule of Mission Success to be allocated.
In the present solution, user can update allocation rule, addition or reduction distribution type and executor's main body at any time, that is, divide It is expansible with type, allocation rule and executor.
Preferably, entering step S if it fails to match5: task of the display one containing the task distribution request distributes failure Information.
Preferably, set the corresponding allocation rule of the distribution type matched to be N number of, i=1, step S3Include:
S31, an assignment expression generated according to the task to be allocated and i-th allocation rule;
S32, judge the assignment expression calculated result whether be it is true, if if true, entering step S4, otherwise enter step S33
S33, judge whether i < N, if then i=i+1, and execute S again31
Preferably, the distribution information further includes allocation strategy, the corresponding allocation strategy of each distribution type, in step S4 In, be sent to the task distribution request according to the allocation strategy in the corresponding executor one.
Preferably, in step S1Include: later
Judge whether the task distribution request was once assigned, was once assigned if being then sent to the task distribution request Executor, otherwise enter step S2
Preferably, the task distribution request further includes relating attribute, in step S1Include: later
Judge whether the relating attribute is identical as the relating attribute in a certain task distribution request distributed before, if then The corresponding executor of the task distribution request distributed before the task distribution request is sent to, otherwise enters step S2
The present invention also provides a kind of task distribution systems, it is characterized in that, it is stored with expansible distribution information, this point It include distribution type, allocation rule and executor, the corresponding at least allocation rule of each distribution type, each distribution rule with information Then a corresponding at least executor, the task distribution system include:
One obtains module, and for obtaining a task distribution request, which includes task to be allocated and unique ID number;
One first matching module, for matching the distribution type in the distribution information according to the task to be allocated;
One second matching module, for carrying out the task to be allocated allocation rule corresponding with the distribution type matched One first sending module is called in matching in successful match;
First sending module is used to for the task distribution request being sent to the matched distribution of Mission Success to be allocated and advises Then corresponding executor.
Preferably, the task distribution system further includes a display module, the display module when it fails to match for showing One task containing the task distribution request distributes failure information.
Preferably, set the corresponding allocation rule of the distribution type matched to be N number of, and i=1, the second matching module packet Include a generation unit, one first judging unit and a second judgment unit;
The generation unit is used to generate an assignment expression according to the task to be allocated and i-th of allocation rule;
First judging unit be used to judge the assignment expression calculated result whether be it is true, called when to be true this Otherwise one sending module calls second judgment module to judge whether i < N, if then i=i+1, and the generation list is called again Member.
Preferably, the distribution information further includes allocation strategy, and the corresponding allocation strategy of each distribution type, first transmission One for being sent to the task distribution request according to the allocation strategy in the corresponding executor of module.
Preferably, the task distribution system further includes a third judgment module and one second sending module;
The third judgment module is for judging whether the task distribution request was once assigned, if then calling second hair It send module that the task distribution request is sent to once assigned executor, otherwise calls first matching module.
Preferably, the task distribution request further includes relating attribute, which further includes one the 4th judging mould Block and a third sending module;
4th judgment module be used to judge the relating attribute whether in a certain task distribution request distributed before Relating attribute is identical, if task distributed before then calling the third sending module to be sent to the task distribution request point With corresponding executor is requested, first matching module is otherwise called.
On the basis of common knowledge of the art, above-mentioned each optimum condition, can any combination to get each preferable reality of the present invention Example.
The positive effect of the present invention is that:
Method for allocating tasks and system of the invention has versatility, can will be to according to distribution type and allocation rule Distribution task distributes to corresponding executor.
Detailed description of the invention
Fig. 1 is the flow chart of the method for allocating tasks of present pre-ferred embodiments.
Fig. 2 is the structural block diagram of the task distribution system of present pre-ferred embodiments.
Specific embodiment
The present invention is further illustrated below by the mode of embodiment, but does not therefore limit the present invention to the reality It applies among a range.
The present embodiment provides a kind of method for allocating tasks, are stored with expansible distribution information, which includes Distribution type, allocation rule, executor and allocation strategy, i.e. distribution type, allocation rule, executor and allocation strategy are can Extension, wherein the corresponding allocation strategy of each distribution type, the corresponding at least allocation rule of each distribution type, Mei Yifen With the corresponding at least executor of rule.
As shown in Figure 1, the method for allocating tasks the following steps are included:
Step 101 obtains a task distribution request, the task distribution request include task to be allocated, unique ID number and Relating attribute;
Step 102 matches the distribution type in the distribution information according to the task to be allocated;
Step 103 matches the task to be allocated allocation rule corresponding with the distribution type matched, if matching It is successful then enter step 104,105 are entered step if it fails to match;
The task distribution request is sent to this matched point of Mission Success to be allocated according to the allocation strategy by step 104 With one in the corresponding executor of rule, terminate process;
The task of step 105, display one containing the task distribution request distributes failure information, terminates process.
Wherein, if the corresponding allocation rule of the distribution type matched is N number of, i=1, step 103 includes:
S31, an assignment expression generated according to the task to be allocated and i-th allocation rule,;
S32, judge whether the calculated result of the assignment expression is true, if otherwise entering step if true, enter step 104 Rapid S33
S33, judge whether i < N, if then i=i+1, and execute S again31
In addition, the method for allocating tasks further includes viscous assigning process and associated allocation process, wherein viscous assigning process Including judging whether the task distribution request was once assigned, if the task distribution request is then sent to once assigned hold Otherwise passerby enters step 102.
Associated allocation process include judge the relating attribute whether with the pass in a certain task distribution request distributed before It is attribute identical, if the corresponding executor of the task distribution request distributed before being then sent to the task distribution request, Otherwise 102 are entered step.
The present embodiment also provides a kind of task distribution system, is stored with expansible distribution information, the distribution packet Include distribution type, allocation rule, executor and allocation strategy, the corresponding allocation strategy of each distribution type, each distribution type A corresponding at least allocation rule, the corresponding at least executor of each allocation rule.
As shown in Fig. 2, the task distribution system includes an acquisition module 1, one first matching module 2, one second matching mould Block 3, one first sending module 4, a display module 5, a third judgment module 6, one second sending module 7, one the 4th judge mould Block 8 and a third sending module 9.
For the acquisition module 1 for obtaining a task distribution request, which includes task to be allocated, unique ID number and relating attribute.
First matching module 2 is used to match the distribution type in the distribution information according to the task to be allocated.
Second matching module 3 is used to carry out the task to be allocated allocation rule corresponding with the distribution type matched Matching, first sending module 4 is called in successful match.
First sending module 4 be used for according to the allocation strategy by the task distribution request be sent to the task to be allocated at One in the corresponding executor of the matched allocation rule of function.
The display module 5 is for showing that a task distribution containing the task distribution request is unsuccessfully believed when it fails to match Breath.
The third judgment module 6 for judging whether the task distribution request was once assigned, if then call this second The task distribution request is sent to once assigned executor by sending module 7, otherwise calls first matching module.
4th judgment module 8 be used to judge the relating attribute whether in a certain task distribution request distributed before Relating attribute is identical, if the task distributed before then calling the third sending module 9 to be sent to the task distribution request Otherwise the corresponding executor of distribution request calls first matching module.
Wherein, if the corresponding allocation rule of the distribution type matched is N number of, i=1, which includes One generation unit, one first judging unit and a second judgment unit.
The generation unit is used to generate an assignment expression according to the task to be allocated and i-th of allocation rule;This first Judging unit is used to judge whether the calculated result of the assignment expression to be very, first sending module to be called when to be true, no Second judgment module is then called to judge whether i < N, if then i=i+1, and the generation unit is called again.
In order to enable those skilled in the art to more fully understand the present embodiment, name for a specific example It is bright:
If distribution type includes air ticket, train ticket and hotel, distribution type " air ticket " is corresponding with 5 allocation rules, wherein First allocation rule is that (p1=1) && (p2=3), second allocation rule are (p1=2) && (p2=4), wherein " p1 " table Show domestic/world, numerical value " 1 " indicates the country, and numerical value " 2 " indicates international, and p2 expression is urgent/not urgent, and numerical value " 3 " indicates to add Anxious, numerical value " 4 " indicates not urgent.
A task distribution request is obtained, which includes task to be allocated (i.e. the international not urgent air ticket of purchase) It is air ticket according to the task to be allocated distribution type with unique ID number;By the task to be allocated and distribution type " machine The corresponding allocation rule of ticket " (i.e. above-mentioned 5 allocation rules) is matched, due to the task to be allocated be it is international, not urgent, then P1=2, p2=4, the assignment expression thus generated be (2=1) && (4=3), the calculated result of the assignment expression be it is false, Second allocation rule is then used, the assignment expression of generation is (1=1) && (3=3), the calculated result of the assignment expression It is very, then the task distribution request to be sent to the corresponding executor of second allocation rule.
Although specific embodiments of the present invention have been described above, it will be appreciated by those of skill in the art that these It is merely illustrative of, protection scope of the present invention is defined by the appended claims.Those skilled in the art is not carrying on the back Under the premise of from the principle and substance of the present invention, many changes and modifications may be made, but these are changed Protection scope of the present invention is each fallen with modification.

Claims (12)

1. a kind of method for allocating tasks, which is characterized in that it is stored with expansible distribution information, which includes distribution Type, allocation rule and executor;
The expansible allocation information table shows that the allocation rule can update at any time, and the distribution type and the executor can Addition is reduced;
The corresponding at least allocation rule of each distribution type, the corresponding at least executor of each allocation rule comprising following step It is rapid:
S1, obtain a task distribution request, which includes task to be allocated and unique ID number;
S2, the distribution type in the distribution information matched according to the task to be allocated;
S3, the task to be allocated allocation rule corresponding with the distribution type matched matched, enter if successful match Step S4
S4, the task distribution request is sent to the corresponding executor of the matched allocation rule of Mission Success to be allocated.
2. method for allocating tasks as described in claim 1, which is characterized in that enter step S if it fails to match5: display one contains There is the task distribution failure information of the task distribution request.
3. method for allocating tasks as described in claim 1, which is characterized in that set the corresponding distribution of the distribution type matched Rule is N number of, i=1, step S3Include:
S31, an assignment expression generated according to the task to be allocated and i-th allocation rule;
S32, judge the assignment expression calculated result whether be it is true, if if true, entering step S4, otherwise enter step S33
S33, judge whether i < N, if then i=i+1, and execute S again31
4. method for allocating tasks as described in claim 1, which is characterized in that the distribution information further includes allocation strategy, each Distribution type corresponds to an allocation strategy, in step S4In, which is sent to by the correspondence according to the allocation strategy Executor in one.
5. method for allocating tasks as described in claim 1, which is characterized in that in step S1Include: later
Judge whether the task distribution request was once assigned, if the task distribution request is then sent to once assigned hold Otherwise passerby enters step S2
6. method for allocating tasks as described in claim 1, which is characterized in that the task distribution request further includes relating attribute, In step S1Include: later
Judge whether the relating attribute is identical as the relating attribute in a certain task distribution request distributed before, if then should The corresponding executor of the task distribution request that task distribution request is distributed before being sent to, otherwise enters step S2
7. a kind of task distribution system, which is characterized in that it is stored with expansible distribution information, which includes distribution Type, allocation rule and executor;
The expansible allocation information table shows that the allocation rule can update at any time, and the distribution type and the executor can Addition is reduced;
The corresponding at least allocation rule of each distribution type, the corresponding at least executor of each allocation rule, task distribution system System includes:
One obtains module, and for obtaining a task distribution request, which includes task to be allocated and unique ID Number;
One first matching module, for matching the distribution type in the distribution information according to the task to be allocated;
One second matching module, for carrying out corresponding with the distribution type matched the allocation rule of the task to be allocated Match, one first sending module is called in successful match;
First sending module is used to the task distribution request being sent to the matched allocation rule pair of Mission Success to be allocated The executor answered.
8. task distribution system as claimed in claim 7, which is characterized in that the task distribution system further includes a display mould Block, the display module is for task distribution failure information of the display one containing the task distribution request when it fails to match.
9. task distribution system as claimed in claim 7, which is characterized in that set the corresponding distribution of the distribution type matched Rule is N number of, i=1, which includes a generation unit, one first judging unit and a second judgment unit;
The generation unit is used to generate an assignment expression according to the task to be allocated and i-th of allocation rule;
First judging unit is used to judge whether the calculated result of the assignment expression to be very, first hair to be called when to be true Module is sent, the second judgment unit is otherwise called to judge whether i < N, if then i=i+1, and the generation unit is called again.
10. task distribution system as claimed in claim 7, which is characterized in that the distribution information further includes allocation strategy, each Distribution type corresponds to an allocation strategy, and the task distribution request for being sent to by first sending module according to the allocation strategy One in the corresponding executor.
11. task distribution system as claimed in claim 7, which is characterized in that the task distribution system further includes that a third is sentenced Disconnected module and one second sending module;
The third judgment module is for judging whether the task distribution request was once assigned, if then calling the second transmission mould The task distribution request is sent to once assigned executor by block, otherwise calls first matching module.
12. task distribution system as claimed in claim 7, which is characterized in that the task distribution request further includes relating attribute, The task distribution system further includes one the 4th judgment module and a third sending module;
4th judgment module for judge the relating attribute whether with being associated in a certain task distribution request distributed before Attribute is identical, if the task distribution distributed before then calling the third sending module to be sent to the task distribution request is asked Corresponding executor is asked, first matching module is otherwise called.
CN201610121630.3A 2016-03-04 2016-03-04 Method for allocating tasks and system Active CN105808333B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610121630.3A CN105808333B (en) 2016-03-04 2016-03-04 Method for allocating tasks and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610121630.3A CN105808333B (en) 2016-03-04 2016-03-04 Method for allocating tasks and system

Publications (2)

Publication Number Publication Date
CN105808333A CN105808333A (en) 2016-07-27
CN105808333B true CN105808333B (en) 2019-07-26

Family

ID=56466393

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610121630.3A Active CN105808333B (en) 2016-03-04 2016-03-04 Method for allocating tasks and system

Country Status (1)

Country Link
CN (1) CN105808333B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107767007A (en) * 2016-09-05 2018-03-06 北京三快在线科技有限公司 Method for allocating tasks and device
CN107784418B (en) * 2016-11-14 2020-11-03 平安科技(深圳)有限公司 List data distribution method and device
CN106601034B (en) * 2016-11-22 2019-08-02 成都民航空管科技发展有限公司 Flight runway assignment method and device based on ATC system
CN107067128A (en) * 2016-12-08 2017-08-18 阿里巴巴集团控股有限公司 Task quality detecting method, the method and device for determining dereferenced user
CN107169639A (en) * 2017-04-27 2017-09-15 北京云测信息技术有限公司 A kind of test assignment distribution method and device
CN107220750A (en) * 2017-05-15 2017-09-29 泰康保险集团股份有限公司 Document classifying method and device
CN107742178A (en) * 2017-09-18 2018-02-27 上海量明科技发展有限公司 Task quantifies method and device
CN107562546B (en) * 2017-09-18 2020-06-16 上海量明科技发展有限公司 Task allocation method and device and instant messaging tool
CN108197776A (en) * 2017-12-12 2018-06-22 链家网(北京)科技有限公司 A kind of method for allocating tasks and device
CN108197778A (en) * 2017-12-15 2018-06-22 远光软件股份有限公司 A kind of method for allocating tasks and device
CN108197808B (en) * 2017-12-29 2023-10-20 广东溢达纺织有限公司 Production task distribution method, device and system
CN109002355B (en) * 2018-06-06 2022-04-05 创新先进技术有限公司 Distribution method, device and equipment for processing requests
CN110162386B (en) * 2019-04-04 2021-05-18 口碑(上海)信息技术有限公司 Task issuing method and device
CN111190739B (en) * 2019-12-31 2023-09-01 西安翔腾微电子科技有限公司 Resource allocation method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104765641A (en) * 2014-01-02 2015-07-08 中国移动通信集团安徽有限公司 Job scheduling method and system
CN104765643A (en) * 2015-03-25 2015-07-08 华迪计算机集团有限公司 Method and system for achieving hybrid scheduling of cloud computing resources

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070129983A1 (en) * 2005-12-01 2007-06-07 Siemens Medical Solutions Health Services Corporation Task and Workflow Management System for Healthcare and other Applications
CN102541652A (en) * 2010-12-09 2012-07-04 上海杉达学院 Service dispatching method of cluster system
CN103795804A (en) * 2014-02-24 2014-05-14 华为技术有限公司 Storage resource scheduling method and storage calculation system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104765641A (en) * 2014-01-02 2015-07-08 中国移动通信集团安徽有限公司 Job scheduling method and system
CN104765643A (en) * 2015-03-25 2015-07-08 华迪计算机集团有限公司 Method and system for achieving hybrid scheduling of cloud computing resources

Also Published As

Publication number Publication date
CN105808333A (en) 2016-07-27

Similar Documents

Publication Publication Date Title
CN105808333B (en) Method for allocating tasks and system
CN103176790B (en) Application dissemination method and system
CN105677404B (en) A kind of configuration update method and device based on Zookeeper
CN106031116B (en) A kind of correlating method, the apparatus and system of NS and VNF
CN109391528A (en) Awakening method, device, equipment and the storage medium of speech-sound intelligent equipment
CN105429811B (en) network management system and method
CN105183543B (en) A kind of gunz based on mobile social networking calculates online method for allocating tasks
CN111478961A (en) Multi-tenant service calling method and device
CN104754013B (en) A kind of network resource control method of cloud computing platform, apparatus and system
CN107846313B (en) A kind of method and the network equipment of the generation of network service moulding plate
CN105357330A (en) Method and system for preventing IP address conflict of network devices
CN104731721B (en) A kind of display sharing method and device of memory
CN103841562B (en) A kind of time interval resource takes processing method and processing device
CN104639546B (en) The methods, devices and systems of multi-biological characteristic inclusive authentication
CN107168777A (en) The dispatching method and device of resource in distributed system
CN107832125A (en) Method for processing business and device under a kind of distributed environment
CN106201671A (en) Method for scheduling task and device in one cluster deployed environment
CN110275760A (en) Process based on fictitious host computer processor hangs up method and its relevant device
CN108280624A (en) A kind of node tracking method and device
CN105704010A (en) Message display method and apparatus
CN108445788A (en) A kind of hotel&#39;s scenery control method and relevant apparatus
CN108282526A (en) Server dynamic allocation method and system between double clusters
CN106612193A (en) Network deployment configuration method and device in virtualization technology
CN107133243A (en) A kind of data processing method and server
CN111400021B (en) Deep learning method, device and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant