CN103929441A - Task allocation method and device - Google Patents
Task allocation method and device Download PDFInfo
- Publication number
- CN103929441A CN103929441A CN201410196002.2A CN201410196002A CN103929441A CN 103929441 A CN103929441 A CN 103929441A CN 201410196002 A CN201410196002 A CN 201410196002A CN 103929441 A CN103929441 A CN 103929441A
- Authority
- CN
- China
- Prior art keywords
- client
- server
- message
- operating state
- task
- 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
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the invention discloses a task allocation method which comprises the steps that a server determines any one task to be allocated, the server allocates the task to be allocated to any one idle client side according to the working states of all the pre-stored client sides and a notification message is generated; the server sends the notification message to the client side by establishing a connection channel with the client side. Compared with the prior art, the method has the advantages that due to the fact that task allocation is achieved in the mode that the server pushes the notification message to the client side proactively, a large amount of network interaction in the prior art is avoided, and meanwhile, network resource expenditure is saved, and the server can not be overpressed.
Description
Technical field
The present invention relates to technical field of data processing, be specifically related to a kind of method for allocating tasks and device.
Background technology
At present, according to existing Mechanism of Task Allocation, by client, regularly to server, initiate request, in Query Database, whether there is the task of this client, when there is the task of this client, server is sent to this client by feedback information, the distribution of finishing the work with this.
In prior art, due to client in the situation that do not know whether server end has existed the task of needing own processing, need to regularly go to inquire whether server has task of needing oneself to process, and in fact server may not have task that need to this client process at all, can cause the problem that resource occupying is large in this case, meanwhile, a large amount of clients send request and also can cause server stress excessive to server simultaneously.
Summary of the invention
The invention provides a kind of method for allocating tasks and device, take server initiatively to the distribution of finishing the work of the mode of client push notification message, avoided network interactions a large amount of in prior art, save network resource overhead simultaneously.
The invention provides a kind of method for allocating tasks, described method comprises:
Server is determined arbitrary task to be allocated;
Described server, according to the operating state of each client prestoring, is distributed to the client of arbitrary idle condition by described task to be allocated, and is produced notification message;
Described server, by the interface channel with described client foundation, is sent to described client by described notification message.
Preferably, described server, by the interface channel with described client foundation, before described notification message is sent to described client, also comprises:
Described server by utilizing udp protocol and the described client passage that connects.
Preferably, described method also comprises:
The operating state of the described client of described server storage is set to busy state.
Preferably, described method also comprises:
Described server receives the log-on message from client, and described log-on message comprises the operating state of described client;
The operating state of client described in described server stores.
Preferably, described reception is from the log-on message of client, and described log-on message comprises that the operating state of described client comprises:
Described server is every default special time and the described client passage that connects, and described interface channel is that described client utilizes udp protocol to set up;
Described server, by described interface channel, receives the log-on message from client, and described log-on message comprises the operating state of described client.
The present invention also provides a kind of task allocation apparatus, and described device comprises:
Determination module, for determining arbitrary task to be allocated;
Distribution module, for according to the operating state of each client prestoring, distributes to the client of arbitrary idle condition by described task to be allocated, and produces notification message;
Sending module, for by the interface channel with described client foundation, is sent to described client by described notification message.
Preferably, described device also comprises:
Set up module, for utilizing udp protocol and the described client passage that connects.
Preferably, described device also comprises:
Module is set, for the operating state of described client of storage, is set to busy state.
Preferably, described device also comprises:
Receiver module, for receiving the log-on message from client, described log-on message comprises the operating state of described client;
Memory module, for storing the operating state of described client.
Preferably, described receiver module comprises:
Set up submodule, for the special time every default and the described client passage that connects, described interface channel is that described client utilizes udp protocol to set up;
Receive submodule, for by described interface channel, receive the log-on message from client, described log-on message comprises the operating state of described client.
In method for allocating tasks provided by the invention, first server is determined arbitrary task to be allocated, secondly, server is according to the operating state of each client prestoring, described task to be allocated is distributed to the client of arbitrary idle condition, and produce notification message, last, server, by the interface channel with described client foundation, is sent to described client by described notification message.Compared with prior art, the present invention takes server initiatively to the distribution of finishing the work of the mode of client push notification message, has avoided network interactions a large amount of in prior art, saves network resource overhead simultaneously, also can not cause excessive pressure to server.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present application, below the accompanying drawing of required use during embodiment is described is briefly described, apparently, accompanying drawing in the following describes is only some embodiment of the application, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The method for allocating tasks flow chart that Fig. 1 provides for the embodiment of the present invention one;
The method for allocating tasks flow chart that Fig. 2 provides for the embodiment of the present invention two;
The task allocation apparatus structural representation that Fig. 3 provides for the embodiment of the present invention three;
The task allocation apparatus structural representation that Fig. 4 provides for the embodiment of the present invention three.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is clearly and completely described, obviously, described embodiment is only the application's part embodiment, rather than whole embodiment.Embodiment based in the application, those of ordinary skills are not making the every other embodiment obtaining under creative work prerequisite, all belong to the scope of the application's protection.
Embodiment mono-
With reference to figure 1, the method for allocating tasks flow chart that Fig. 1 provides for the present embodiment, described method comprises:
S101: server is determined arbitrary task to be allocated.
In the present embodiment, server is managed task to be allocated with queue mechanism, when server receives a task, first this task is put into task queue, and the task in described task queue is task to be allocated.Server can, according to the priority relationship of task, regularly be defined as the task to be allocated as task distribution object using a task in this task queue.
S102: described server, according to the operating state of each client prestoring, is distributed to the client of arbitrary idle condition by described task to be allocated, and produced notification message.
In the present embodiment, in order to keep being connected with server, client can utilize udp protocol and server to keep being connected.Concrete, client can be utilized every default special time udp protocol and the server passage that connects, and to server, sends log-on message by this interface channel.Wherein, the log-on message that each client sends comprises the operating state of this client, as idle condition, busy state etc.When server receives the log-on message from client, record the operating state of the client in described log-on message, so that the distribution that server can be finished the work according to the operating state of each client.
In practical operation, server can, by the operating state of each client of inquiry, be distributed to described task to be allocated the client of an idle condition.Meanwhile, described server distributes and produces notification message for this task, and wherein said notification message comprises the sign of described task to be allocated etc.
S103: described server, by the interface channel with described client foundation, is sent to described client by described notification message.
In the present embodiment, server can utilize udp protocol and the client passage that connects, when described server is dispensed to task to be allocated after the client of an idle condition, described server can, by the interface channel of setting up in advance, be sent to described client by the announcement information of generation.When described client is after the announcement information from described server, know that described task to be allocated is assigned to described client executing, described client can be executed the task according to the sign of the task to be allocated in notification message.
Owing to utilizing the short connection that is connected to of udp protocol foundation, so server can just be set up the interface channel with this client in the time need to sending message to client.When server need to send message to a plurality of clients, utilize udp protocol to set up short connection and can avoid causing server load excessive.Meanwhile, it is very fast that the short connection that utilizes udp protocol to set up also has transfer rate, transmits data volume little, to advantages such as network pressure are little.
First the method for allocating tasks that the present embodiment provides determines arbitrary task to be allocated, secondly, according to the operating state of each client prestoring, described task to be allocated is distributed to the client of arbitrary idle condition, and produce notification message, finally, the interface channel by with described client foundation, is sent to described client by described notification message.Compared with prior art, the present embodiment takes server initiatively to the distribution of finishing the work of the mode of client push notification message, avoided a large amount of network interaction being produced by client-requested task state in prior art, save network resource overhead simultaneously, also can not cause excessive pressure to server.
Embodiment bis-
With reference to figure 2, the method for allocating tasks flow chart that Fig. 2 provides for the present embodiment, described method comprises:
S201: each client is utilized udp protocol and the server passage that connects every default special time.
S202: utilize described interface channel, client sends log-on message to described server, and wherein, described log-on message comprises the operating state of described client.
In the present embodiment, in order to guarantee that server can accurately know the real-time working state of each client, so each client need to utilize udp protocol to send " heartbeat " to server, i.e. the log-on message of client etc.
In addition, server is after " heartbeat " of receiving client, to described client, send feedback response, if client can not get the response of server within the heartbeat number of times request of regulation, described client can reconnect described server, again obtain physical IP and the port of described server, re-establish the UDP interface channel between client and described server, again send heartbeat.
S203: the operating state of described each client of server stores.
S204: server, after determining a task to be allocated, is distributed to the client of an idle condition according to the operating state of each client by described task to be allocated, and produced notification message.
S205: described server by utilizing udp protocol and the described client passage that connects, and by described interface channel, described announcement information is sent to described client.
S206: the operating state of the described client of described server storage is set to busy state.
Concrete, described client is assigned with task, illustrates that described client is in running order, so, the present embodiment is after the distribution of finishing the work, and the operating state of the described client of storage is set to busy state, so that follow-up work temporarily can not given this client.
Compared with prior art, the present embodiment takes server initiatively to the distribution of finishing the work of the mode of client push notification message, has avoided a large amount of network interactions, saves network resource overhead simultaneously, also can not cause excessive pressure to server.Meanwhile, utilize the udp protocol passage that connects, can avoid causing server load excessive.
Embodiment tri-
With reference to figure 3, a kind of task allocation apparatus structural representation that Fig. 3 provides for the present embodiment, described device comprises:
Determination module 301, for determining arbitrary task to be allocated;
Distribution module 302, for according to the operating state of each client prestoring, distributes to the client of arbitrary idle condition by described task to be allocated, and produces notification message;
Sending module 303, for by the interface channel with described client foundation, is sent to described client by described notification message.
With reference to figure 4, the another kind of task allocation apparatus structural representation that Fig. 4 provides for the present embodiment, described device, except comprising the module in Fig. 3, can also comprise:
Set up module 401, for utilizing udp protocol and the described client passage that connects.
In addition, described device also comprises:
Module is set, for the operating state of described client of storage, is set to busy state.
Wherein, described device also comprises:
Receiver module, for receiving the log-on message from client, described log-on message comprises the operating state of described client;
Memory module, for storing the operating state of described client.
Wherein, described receiver module comprises:
Set up submodule, for the special time every default and the described client passage that connects, described interface channel is that described client utilizes udp protocol to set up;
Receive submodule, for by described interface channel, receive the log-on message from client, described log-on message comprises the operating state of described client.
The operation principle of the task allocation apparatus that the present embodiment provides is: determination module 301 is determined after arbitrary task to be allocated, distribution module 302 is according to the operating state of each client prestoring, described task to be allocated is distributed to the client of arbitrary idle condition, and produce notification message.Sending module 303, by the interface channel with described client foundation, the described notification message that distribution module 302 is produced is sent to described client, the distribution of finishing the work.
The task allocation apparatus that the present embodiment provides is determined arbitrary task to be allocated by determination module, by distribution module, described task to be allocated is distributed to the client of arbitrary idle condition, and produce notification message, and pass through sending module, utilize the interface channel of setting up with described client, described notification message is sent to described client.Compared with prior art, the present embodiment takes server initiatively to the distribution of finishing the work of the mode of client push notification message, has avoided a large amount of network interactions, saves network resource overhead simultaneously, also can not cause excessive pressure to server.Meanwhile, utilize the udp protocol passage that connects, can avoid causing server load excessive.
For system embodiment, because it corresponds essentially to embodiment of the method, so relevant part is referring to the part explanation of embodiment of the method.System embodiment described above is only schematic, the wherein said unit as separating component explanation can or can not be also physically to separate, the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed in a plurality of network element.Can select according to the actual needs some or all of module wherein to realize the object of the present embodiment scheme.Those of ordinary skills, in the situation that not paying creative work, are appreciated that and implement.
It should be noted that, in this article, relational terms such as the first and second grades is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply and between these entities or operation, have the relation of any this reality or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby the process, method, article or the equipment that make to comprise a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or be also included as the intrinsic key element of this process, method, article or equipment.The in the situation that of more restrictions not, the key element being limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
A kind of method for allocating tasks and the device that above the embodiment of the present invention are provided are described in detail, applied specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment is just for helping to understand method of the present invention and core concept thereof; , for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention meanwhile.
Claims (10)
1. a method for allocating tasks, is characterized in that, described method comprises:
Server is determined arbitrary task to be allocated;
Described server, according to the operating state of each client prestoring, is distributed to the client of arbitrary idle condition by described task to be allocated, and is produced notification message;
Described server, by the interface channel with described client foundation, is sent to described client by described notification message.
2. method according to claim 1, is characterized in that, described server, by the interface channel with described client foundation, before described notification message is sent to described client, also comprises:
Described server by utilizing udp protocol and the described client passage that connects.
3. method according to claim 1 and 2, is characterized in that, described method also comprises:
The operating state of the described client of described server storage is set to busy state.
4. method according to claim 1 and 2, is characterized in that, described method also comprises:
Described server receives the log-on message from client, and described log-on message comprises the operating state of described client;
The operating state of client described in described server stores.
5. method according to claim 4, is characterized in that, described reception is from the log-on message of client, and described log-on message comprises that the operating state of described client comprises:
Described server is every default special time and the described client passage that connects, and described interface channel is that described client utilizes udp protocol to set up;
Described server, by described interface channel, receives the log-on message from client, and described log-on message comprises the operating state of described client.
6. a task allocation apparatus, is characterized in that, described device comprises:
Determination module, for determining arbitrary task to be allocated;
Distribution module, for according to the operating state of each client prestoring, distributes to the client of arbitrary idle condition by described task to be allocated, and produces notification message;
Sending module, for by the interface channel with described client foundation, is sent to described client by described notification message.
7. device according to claim 6, is characterized in that, described device also comprises:
Set up module, for utilizing udp protocol and the described client passage that connects.
8. according to the device described in claim 6 or 7, it is characterized in that, described device also comprises:
Module is set, for the operating state of described client of storage, is set to busy state.
9. according to the device described in claim 6 or 7, it is characterized in that, described device also comprises:
Receiver module, for receiving the log-on message from client, described log-on message comprises the operating state of described client;
Memory module, for storing the operating state of described client.
10. device according to claim 9, is characterized in that, described receiver module comprises:
Set up submodule, for the special time every default and the described client passage that connects, described interface channel is that described client utilizes udp protocol to set up;
Receive submodule, for by described interface channel, receive the log-on message from client, described log-on message comprises the operating state of described client.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410196002.2A CN103929441A (en) | 2014-05-09 | 2014-05-09 | Task allocation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410196002.2A CN103929441A (en) | 2014-05-09 | 2014-05-09 | Task allocation method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103929441A true CN103929441A (en) | 2014-07-16 |
Family
ID=51147518
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410196002.2A Pending CN103929441A (en) | 2014-05-09 | 2014-05-09 | Task allocation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103929441A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104301423A (en) * | 2014-10-24 | 2015-01-21 | 北京奇虎科技有限公司 | Heartbeat message sending method, device and system |
CN104902002A (en) * | 2015-04-10 | 2015-09-09 | 深圳市金立通信设备有限公司 | Terminal and server |
WO2019019644A1 (en) * | 2017-07-24 | 2019-01-31 | 深圳壹账通智能科技有限公司 | Push server allocation method and apparatus, and computer device and storage medium |
CN111432082A (en) * | 2020-03-25 | 2020-07-17 | 中国银行股份有限公司 | Customer distribution method and device for customer service |
CN111510492A (en) * | 2020-04-15 | 2020-08-07 | 矩阵元技术(深圳)有限公司 | Data processing method, device, equipment and system for realizing disconnection reconnection |
CN112035231A (en) * | 2020-09-01 | 2020-12-04 | 中国银行股份有限公司 | Data processing system, method and server group |
CN112437144A (en) * | 2020-11-16 | 2021-03-02 | 成都渊数科技有限责任公司 | Method and system for increasing access number of single edge server iot equipment |
CN113590331A (en) * | 2021-08-05 | 2021-11-02 | 山东派盟网络科技有限公司 | Task processing method, control device and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101340331A (en) * | 2007-07-06 | 2009-01-07 | 中国电信股份有限公司 | Method for executing system task by idle terminal in P2P network |
CN101403982A (en) * | 2008-11-03 | 2009-04-08 | 华为技术有限公司 | Task distribution method, system and equipment for multi-core processor |
CN103426193A (en) * | 2012-05-25 | 2013-12-04 | 上海幻维数码创意科技有限公司 | Distributed animation rendering method and apparatus thereof |
-
2014
- 2014-05-09 CN CN201410196002.2A patent/CN103929441A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101340331A (en) * | 2007-07-06 | 2009-01-07 | 中国电信股份有限公司 | Method for executing system task by idle terminal in P2P network |
CN101403982A (en) * | 2008-11-03 | 2009-04-08 | 华为技术有限公司 | Task distribution method, system and equipment for multi-core processor |
CN103426193A (en) * | 2012-05-25 | 2013-12-04 | 上海幻维数码创意科技有限公司 | Distributed animation rendering method and apparatus thereof |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104301423A (en) * | 2014-10-24 | 2015-01-21 | 北京奇虎科技有限公司 | Heartbeat message sending method, device and system |
CN104301423B (en) * | 2014-10-24 | 2018-11-06 | 北京奇安信科技有限公司 | A kind of method, apparatus and system sending heartbeat message |
CN104902002A (en) * | 2015-04-10 | 2015-09-09 | 深圳市金立通信设备有限公司 | Terminal and server |
WO2019019644A1 (en) * | 2017-07-24 | 2019-01-31 | 深圳壹账通智能科技有限公司 | Push server allocation method and apparatus, and computer device and storage medium |
CN111432082A (en) * | 2020-03-25 | 2020-07-17 | 中国银行股份有限公司 | Customer distribution method and device for customer service |
CN111510492A (en) * | 2020-04-15 | 2020-08-07 | 矩阵元技术(深圳)有限公司 | Data processing method, device, equipment and system for realizing disconnection reconnection |
CN112035231A (en) * | 2020-09-01 | 2020-12-04 | 中国银行股份有限公司 | Data processing system, method and server group |
CN112437144A (en) * | 2020-11-16 | 2021-03-02 | 成都渊数科技有限责任公司 | Method and system for increasing access number of single edge server iot equipment |
CN113590331A (en) * | 2021-08-05 | 2021-11-02 | 山东派盟网络科技有限公司 | Task processing method, control device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103929441A (en) | Task allocation method and device | |
CN110019125B (en) | Database management method and device | |
CN102655503B (en) | Use the Resourse Distribute in shared resource pond | |
WO2016039963A3 (en) | Resource sharing between two resource allocation systems | |
CN106406905B (en) | Configuration method and system for SETUP option of BIOS of server | |
CN108920111B (en) | Data sharing method and distributed data sharing system | |
US10728050B2 (en) | Method of terminal-based conference load-balancing, and device and system utilizing same | |
CN106712981B (en) | Node change notification method and device | |
CN106648900B (en) | Supercomputing method and system based on smart television | |
CN104731663A (en) | Task processing method and system | |
CN103944769A (en) | RPC (Remote Procedure Call) protocol based cluster resource unified management system | |
CN109416646B (en) | Optimization method for container allocation and processing equipment | |
WO2016095524A1 (en) | Resource allocation method and apparatus | |
CN104537045A (en) | Service distribution method and device based on distributive system | |
US20160344582A1 (en) | Call home cluster | |
CN104750690A (en) | Query processing method, device and system | |
CN109902059B (en) | Data transmission method between CPU and GPU | |
CN103997523A (en) | Smart city service system based on cloud services and implementation method thereof | |
CN104410821A (en) | Large-scale intelligent video analysis operating system and method | |
CN109729115A (en) | Realize method, apparatus, the proxy server, terminal device of distributed computing | |
CN105279263A (en) | Database connection system and method capable of supporting multi-application sharing | |
JP2018511209A5 (en) | ||
CN114155026A (en) | Resource allocation method, device, server and storage medium | |
CN105786447A (en) | Method and apparatus for processing data by server and server | |
CN104184765A (en) | Request control method, client apparatus and server-side apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140716 |