CN105808329A - Distributed overtime task scheduling method and device - Google Patents

Distributed overtime task scheduling method and device Download PDF

Info

Publication number
CN105808329A
CN105808329A CN201610105319.XA CN201610105319A CN105808329A CN 105808329 A CN105808329 A CN 105808329A CN 201610105319 A CN201610105319 A CN 201610105319A CN 105808329 A CN105808329 A CN 105808329A
Authority
CN
China
Prior art keywords
task
time
mission bit
time cycle
cycle quantity
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
Application number
CN201610105319.XA
Other languages
Chinese (zh)
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201610105319.XA priority Critical patent/CN105808329A/en
Publication of CN105808329A publication Critical patent/CN105808329A/en
Pending legal-status Critical Current

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
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • G06F9/4887Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues involving deadlines, e.g. rate based, periodic
    • 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
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a distributed overtime task scheduling method and device. One embodiment of the method comprises following steps of obtaining a time node to which the time pointer of a pre-established task management clock points currently, wherein the task management clock comprises multiple time nodes, and the time intervals of any two adjacent time nodes are equal; successively reading multiple pieces of task information in an array corresponding to the time node pointed currently by the time pointer, wherein the task information comprise time period quantity information; judging whether the time period quantity of any task information in the array satisfies a preset condition; determining that the task is an overtime task if the time period quantity of any task information in the array satisfies the preset condition; and pushing the task to a task processing center through a message queue. According to the embodiment, the detection thread of the overtime task is reduced, overtime task detection and overtime task processing are decoupled, and the overtime task detection and processing efficiencies are improved.

Description

Distributed overtime task dispatching method and device
Technical field
The application relates to field of computer technology, is specifically related to Internet technical field, particularly relates to distributed overtime task dispatching method and device.
Background technology
Simultaneously suffering multiple task in a lot of business scenarios, each task has a pre-determined process-time, arrived pre-determined process-time and task but without processed, namely think this task time-out.Task herein can be understood as a concrete pending business, such as, passes through electricity business's application when the commercial family of electricity and certain service has been initiated a complaint, then the process to this complaint is exactly a task.Need detected from multiple tasks and it is carried out special handling to the task of time-out.
At present, the detection of overtime task being had two kinds of methods at present, first method is to one time-out check thread of each task start.Then in a thread, whether continuous circular test task corresponding with this thread be overtime.When task time-out, then task is carried out timeout treatment by this thread.This method is when task amount is very big, and the number of threads of startup also can be a lot, occupy substantial amounts of processor resource, limits the quantity of the task that processor can detect and the quantity of manageable overtime task, reduces the operational efficiency of processor.Second method is to use timing control to start a public time-out check task, checks that whether all tasks are overtime every the set time, starts new thread new overtime task is processed after overtime task being detected.This method, owing to adopting regular check task whether overtime, can cause that task could check out after having timed, out.
Summary of the invention
The purpose of the application is in that to propose a kind of distributed overtime task dispatching method and device, solves the technical problem that background section above is mentioned.
First aspect, this application provides a kind of distributed overtime task dispatching method, described method includes: obtain the timing node that the time indicator of the task management clock pre-build currently points to, described task management clock includes multiple timing node, and wherein the interval between two timing nodes of arbitrary neighborhood is equal;Being successively read the multiple mission bit streams prestored in the array corresponding to the timing node that described time indicator currently points to, described mission bit stream includes time cycle quantity information, and wherein said time cycle quantity is the integer more than or equal to zero;Judge whether the described time cycle quantity of the arbitrary described mission bit stream in described array meets predetermined condition;If the described time cycle quantity of the arbitrary described mission bit stream in described array meets predetermined condition, then this task is overtime task, and by message queue, this task is pushed to task processing center.
In certain embodiments, the task management clock pre-build described in is set up by following steps: arrange a circulation time sequence node;Interval between two timing nodes of arbitrary neighborhood is set;Described task management clock is set up according to the interval between described circulation time sequence node and two timing nodes of described arbitrary neighborhood;Wherein, the time indicator of described task management clock interval between described adjacent two timing nodes is pointed to next timing node by a timing node.
In certain embodiments, described predetermined condition is: N=μ;Wherein, N is the described time cycle quantity of arbitrary described mission bit stream;μ is predetermined threshold, 0≤μ < N, and μ is integer.
In certain embodiments, described distributed overtime task dispatching method also includes: if the described time cycle quantity of the arbitrary mission bit stream in described array is unsatisfactory for described predetermined condition, then this task is for having not timed out task, and successively decrease predetermined value by described time cycle quantity.
In certain embodiments, the multiple mission bit streams prestored in described array through the following steps that storage: determine pre-determined process-time and corresponding timing node and the time cycle quantity in described task management clock of any one task according to below equation:
I=((T-t) %M)/U+C (1);
N=T/M (2);
Wherein, I is described timing node;T is described task pre-determined process-time;T is the current time of described task;% is complementation symbol;U is the interval between two timing nodes of described arbitrary neighborhood;The described time indicator that M is described task management clock rotates the time that a circle consumes;C is the timing node that described task clock currently points to;N is time cycle quantity;/ for the operator that rounds up of being divided by;Corresponding with described task for described task time cycle quantity is bound and stored to the array corresponding to timing node corresponding with described pre-determined process-time.
Second aspect, this application provides a kind of distributed overtime task dispatching device, described device includes: timing node acquisition module, configuration is for obtaining the timing node that the time indicator of the task management clock pre-build currently points to, described task management clock includes multiple timing node, and wherein the interval between two described timing nodes of arbitrary neighborhood is equal;Mission bit stream read module, configuration is for being successively read the multiple mission bit streams prestored in the array corresponding to the timing node that described time indicator currently points to, described mission bit stream includes time cycle quantity information, and wherein said time cycle quantity is the integer more than or equal to zero;Judge module, whether configuration meets predetermined condition for the described time cycle quantity judging the arbitrary described mission bit stream in described array;Processing module, if configuring the described time cycle quantity for the arbitrary described mission bit stream in described array to meet predetermined condition, then this task is overtime task, and by message queue, this task is pushed to task processing center.
In certain embodiments, described task scheduling apparatus also includes task clock and sets up module, and configuration is used for arranging a circulation time sequence node;Interval between two timing nodes of arbitrary neighborhood is set;Described task management clock is set up according to the interval between described circulation time sequence node and two timing nodes of described arbitrary neighborhood;Wherein, the time indicator of described task management clock interval between described adjacent two timing nodes is pointed to next timing node by a timing node.
In certain embodiments, described predetermined condition is: N=μ;Wherein, N is the described time cycle quantity of arbitrary described mission bit stream;μ is predetermined threshold, 0≤μ < N, and μ is integer.
In certain embodiments, if described processing module configures the described time cycle quantity for the arbitrary described mission bit stream in described array further and is unsatisfactory for described predetermined condition, successively decrease predetermined value by described time cycle quantity.
In certain embodiments, task scheduling apparatus also includes mission bit stream memory module, described mission bit stream memory module farther includes: timing node and time cycle quantity determine unit, and configuration for determining pre-determined process-time and corresponding timing node and the time cycle quantity in described task management clock of any one task according to below equation:
I=((T-t) %M)/U+C (1);
N=T/M (2);
Memory element, configuration is for binding corresponding with described task for described task time cycle quantity and store to the array corresponding to timing node corresponding with described pre-determined process-time.
The distributed overtime task dispatching method of the application offer and device, by obtaining the timing node that the time indicator of the task management clock pre-build currently points to, then the multiple mission bit streams being successively read in the array corresponding to the timing node that described time indicator currently points to prestore, described mission bit stream includes time cycle quantity information;And then judging whether the time cycle quantity of arbitrary mission bit stream meets predetermined condition, met predetermined condition, then this task has timed out;Finally will determine that the task of time-out is sent to task processing center by message queue.It is achieved thereby that use single-threaded whether time-out detects to multiple tasks, decrease the occupancy of processor resource, improve the operational efficiency of processor.Meanwhile, message queue is adopted to forward overtime task, the time-out detection of decoupling task and the process of overtime task, it is simple to task time-out end of probe and overtime task are processed the respective dilatation of end tackling increasing of task quantity.
Accompanying drawing explanation
By reading the detailed description that non-limiting example is made made with reference to the following drawings, other features, purpose and advantage will become more apparent upon:
Fig. 1 is that the application can apply to exemplary system architecture figure therein;
Fig. 2 is the flow chart of an embodiment of the distributed overtime task dispatching method according to the application;
Fig. 3 is the structural representation of the task management clock involved by the application;
Fig. 4 is the structural representation of an embodiment of the distributed overtime task dispatching device of the application;
Fig. 5 is the Organization Chart of the distributed overtime task dispatching patcher of the application;
Fig. 6 is adapted for the structural representation of the computer system of the server for realizing the embodiment of the present application.
Detailed description of the invention
Below in conjunction with drawings and Examples, the application is described in further detail.It is understood that specific embodiment described herein is used only for explaining related invention, but not the restriction to this invention.It also should be noted that, for the ease of describing, accompanying drawing illustrate only the part relevant to about invention.
It should be noted that when not conflicting, the embodiment in the application and the feature in embodiment can be mutually combined.Describe the application below with reference to the accompanying drawings and in conjunction with the embodiments in detail.
Fig. 1 illustrates the distributed overtime task dispatching method that can apply the application or the exemplary system architecture 100 of distributed overtime task dispatching device embodiment.
As it is shown in figure 1, system architecture 100 can include terminal unit 101,102,103, network 104,106,108, server 105,107, task processes node 109,110,111.Network 104,106,108 in order between terminal unit 101,102,103 and server 105, between server 105 and server 107 and task process the medium that communication link is provided between node 109,110,111 and server 107.Network 104,106 and 108 can include various connection type, for instance wired, wireless communication link or fiber optic cables etc..
User can use terminal unit 101,102,103 mutual with server 105 by network 104, to receive or to send message etc..Terminal unit 101,102,103 can be provided with various software, for instance various web browser applications, electricity business's Mobile solution etc..
Terminal unit 101,102,103 can be have display screen and support the various electronic equipments of various software, includes but not limited to panel computer, pocket computer on knee and desk computer, smart mobile phone etc..
The Business Processing that server 105 receives from terminal unit is asked, and the process limited of Business Processing request is managed, and namely judges which Business Processing request timed out.Server 107 can process node 109,110,111 to server 105 and task and provide service.Server 107 includes message queue, and message queue receives the Business Processing request of the time-out from server 105 in order.Server 107 obtains the running status of task process node 109,110 and 111 according to certain rule by network 108, and the running status according to each task process node obtained pushes overtime Business Processing request according to the order of FIFO to each task process node.
It can be the server asking Business Processing to automatically process that task processes node 109,110 and 111;Can also be by manually operated device task being processed and asking to process, for instance desk computer etc..
It should be noted that the distributed overtime task dispatching method that the embodiment of the present application provides is generally by the execution of server 105, correspondingly, distributed overtime task dispatching device is generally positioned in server 105.
It should be understood that the number that terminal unit in Fig. 1, network and server, task process node is merely schematic.According to realizing needs, it is possible to there is any number of terminal unit, network, server and task and process node.
With continued reference to Fig. 2, it is shown that the flow process 200 according to an embodiment of the distributed overtime task dispatching method of the application.Distributed overtime task dispatching method, comprises the following steps:
Step 201, obtains the timing node that the time indicator of the task management clock pre-build currently points to, and task management clock includes multiple timing node, and wherein the interval of two timing nodes of arbitrary neighborhood is equal.
In the present embodiment, distributed overtime task dispatching method runs on electronic equipment thereon (such as the server 105 shown in Fig. 1) and can receive Business Processing solicited message by wired connection mode or radio connection from user terminal (as shown in Figure 1 101,102,103).The process of each Business Processing solicited message be can serve as a task, meanwhile, to the corresponding pre-determined process-time of each task, being not fully complete within pre-determined process-time of task, overtime task will be taken as.Such as, the commercial family of electricity has initiated a complaint by user terminal to electronic equipment, to the process of this complaint just as a task.The regulation of the process of above-mentioned complaint has a pre-determined process-time, and this pre-determined process-time can be such as 30 minutes, if this complains not processed within 30 minutes after the receipt, to the process of this complaint just as overtime task.
Electronic equipment (such as the server 105 shown in Fig. 1) includes a task management clock pre-build.The task management clock pre-build for carrying out time-out management to above-mentioned task.
In some optional implementations of the present embodiment, task management clock to set up process as follows: a circulation time sequence node is set;Interval between two timing nodes of arbitrary neighborhood is set;A task management clock is set up according to the interval between above-mentioned circulation time sequence node and two timing nodes of arbitrary neighborhood.It is to say, circulation time sequence node can be the timing node sequence set manually, it is also possible to be according to the timing node sequence automatically arranged after the pre-determined process-time statistics to multiple tasks by certain statistical software;Interval between two timing nodes of arbitrary neighborhood can be the interval set manually, can also be that the interval between two timing nodes of arbitrary neighborhood is equal according to the interval automatically arranged after the pre-determined process-time statistics to multiple tasks by certain statistical software;That is circulation time sequence node is incremented by from small to large at equal intervals.
In the present embodiment, the interval between timing node sequence and two timing nodes of arbitrary neighborhood can be set according to the concrete multiple tasks processed.It is to say, the quantity of timing node sequence does not limit, the interval between two timing nodes of arbitrary neighborhood does not also limit, it is possible to be adjusted according to the pre-determined process-time of multiple tasks of concrete process.Wherein, the interval between two timing nodes of arbitrary neighborhood could be arranged to 1 millisecond, so can improve the degree of accuracy of task detection.Task management clock 31 as shown in Figure 3 includes a circulation time sequence node 1,2,3,4,5,6,7,8, and wherein, the interval between two timing nodes of the arbitrary neighborhood of this task management clock 31 is 1 second.
In the present embodiment, creating a probe thread while setting up task management clock, this probe thread interval between two timing nodes of an arbitrary neighborhood obtains the timing node pointed by time indicator of a task management clock automatically.
Step 202, the multiple mission bit streams being successively read in the array corresponding to the timing node that time indicator currently points to prestore.
In the present embodiment, based on the timing node pointed by the time indicator of the task management clock obtained in step 201, multiple mission bit streams that above-mentioned probe thread is successively read in the array corresponding to the timing node that time indicator currently points to prestore.It is to say, the corresponding array of each timing node of task management clock.Each array internal memory contains multiple mission bit stream.Optionally, it is possible to the multiple mission bit streams stored in array are set to the structure of FIFO.
In the present embodiment, each mission bit stream includes a pre-determined process-time, say, that each mission bit stream has a timeouts.
In some optional implementations of the present embodiment, by multiple tasks according to following rule store to in the array corresponding to each timing node of task management clock: first, determine the timing node in task management clock corresponding with the pre-determined process-time of any one task and time cycle quantity according to formula (1) and formula (2);
I=((T-t) %M)/U+C (1);
N=(T-t)/M (2);
Wherein, I is timing node;T is task pre-determined process-time;T is task current time;% is complementation symbol;U is the interval between two timing nodes of arbitrary neighborhood;M is that task management clock time pointer turns around the time consumed;The timing node that C task clock currently points to;N is time cycle quantity;/ for the operator that rounds up of being divided by.It is to say, to each task, it is possible to timing node and the time cycle quantity of task management clock corresponding to its time-out is calculated according to its pre-determined process-time.Such as, at task management clock 31 as shown in Figure 3, it is 8 seconds that time indicator rotates the time that a circle consumes, it is assumed that the timing node that time indicator is currently pointed at is 1, and now electronic equipment receives the task that pre-determined process-time is 20 seconds;It is known that this task current time namely have already been through 2 seconds to current time from receiving task.Then the timing node of the task management clock of its correspondence is ((20-2) %8)/1+1=3, and the time cycle quantity of this task is (20-2)/8=2.
Then this task and time cycle quantity thereof being bound and store to the array corresponding to timing node corresponding with this task, any one mission bit stream in array as shown in Figure 3, this mission bit stream includes task definition and time amount of cycles.
Also being just say have any task of pre-determined process-time, its time-out time can be split as corresponding with a task management clock timing node and time cycle quantity according to the timing node that task management clock currently points to.Wherein, time cycle quantity can store in array with mission bit stream binding.
Step 203, it is judged that whether the described time cycle quantity of the arbitrary described mission bit stream in described array meets predetermined condition.
In the present embodiment, based on the multiple mission bit streams in the array corresponding to the timing node that the time indicator of the task management clock read in step 202 is currently pointed at, whether the time cycle quantity that probe thread then judges in each mission bit stream meets predetermined condition.
Can in implementation in some of the present embodiment, above-mentioned predetermined condition can be N=μ;Wherein, N is the described time cycle quantity of arbitrary described mission bit stream;μ is predetermined threshold, 0≤μ < N, and μ is integer.It is to say, probe thread judge the time cycle quantity in each mission bit stream be with equal to a predetermined threshold.This predetermined threshold can be equal to zero, it is also possible to for more than zero and less than any positive integer of time cycle quantity.
Step 204, if the time cycle quantity of the arbitrary described mission bit stream in array meets predetermined condition, then this task is overtime task, and by message queue, overtime task is pushed to task processing center.
In the present embodiment, if time cycle quantity meets predetermined condition in probe thread judgement wherein any one mission bit stream, then the task in this mission bit stream is overtime task.Can in implementation in some of the present embodiment, if time cycle quantity is equal to predetermined threshold, then the task in this mission bit stream is overtime task.
In the present embodiment, overtime task is sent in message queue according to its timeout treatment event processing type generation corresponding, and in array, deletes the mission bit stream of this overtime task.The timeout treatment event that message queue storage has been received by, and according to the order of FIFO, the process event of time-out is pushed to task processing center.
In the present embodiment, message queue is stored in server 107, and wherein, the storage medium of message queue can be integrally fixed at the internal memory on server 107, the disk on server 107 can also be integrally fixed at, it is also possible to be the moveable magnetic disc being connected with server 107.
In some optional implementations of the present embodiment, task processing center can include multiple task and process node.Message queue obtains each task according to certain rule with cycle regular hour and processes the running status of node.Wherein, task processes the running status of node and includes the such as state such as idle, busy.Message queue processes the free time of node according to each task, the running status such as busy will be stored in process time of the time-out in message queue and is pushed to each task and processes node.Such as, if the running status of a task process node is busy, and the running status that another task processes node is idle, then the process time priority of the pending time-out that pointer is currently pointed to by message queue is pushed to the task that running status is idle and processes node.
In some optional implementations of the present embodiment, the time cycle quantity judged in any one mission bit stream in array when probe thread is unsatisfactory for above-mentioned predetermined condition, namely time cycle quantity is when being not equal to predetermined threshold, successively decrease predetermined value by time cycle quantity.Predetermined value such as can be equal to 1.
The method that above-described embodiment of the application provides is by being stored in the array corresponding with each timing node of task management clock by multiple tasks, achieve and use multiple tasks that the detection of small number of thread is stored in array whether overtime, decrease the occupancy of processor resource, improve processor operational efficiency.Meanwhile, message queue is adopted to forward the time-out detection of time out event decoupling task and the process of overtime task, it is simple to task time-out end of probe and overtime task are processed the dilatation of end to tackle increasing of task quantity.
With further reference to Fig. 4, as the realization to method shown in above-mentioned Fig. 2, this application provides an embodiment of a kind of distributed overtime task dispatching device, this device embodiment is corresponding with the embodiment of the method shown in Fig. 2, and this device specifically can apply in various electronic equipment.
As shown in Figure 4, the distributed overtime task dispatching device 400 of the present embodiment includes: timing node acquisition module 401, mission bit stream read module 402, judge module 403 and processing module.Wherein, timing node acquisition module 401 configuration is for obtaining the timing node that the time indicator of the task management clock pre-build currently points to, and task management clock includes multiple timing node, and the interval of the timing node that any two of which is adjacent is equal.Mission bit stream read module 402 configuration is for being successively read in the array corresponding to the timing node that time indicator currently points to the multiple mission bit streams prestored, and each mission bit stream includes time cycle quantity information.Whether judge module 403 configuration meets predetermined condition for the described time cycle quantity judging the arbitrary described mission bit stream in described array;If processing module 404 configuration meets predetermined condition for the described time cycle quantity of the arbitrary described mission bit stream in described array, then this task is overtime task, and by message queue, this task is pushed to task processing center.
In the present embodiment, task scheduling apparatus 400 can pass through the Business Processing request from user terminal reception user of wired connection mode or radio connection.The process that the Business Processing of each user is asked can as a task.The corresponding pre-determined process-time of each task.Task scheduling apparatus 400 can also be set up task management clock according to the pre-determined process-time of each task received and set up the array corresponding with each timing node of task management clock.Each mission bit stream is saved in the array corresponding with each timing node of task management clock by task scheduling apparatus 400 according to its pre-determined process-time.
In some optional implementations of the present embodiment, distributed overtime task dispatching device also includes task management clock and sets up module (not shown in FIG.), and configuration sets up task management clock for the interval of two timing nodes of arbitrary neighborhood according to the circulation time sequence node arranged and setting.It is to say, module set up by task management clock, set up task management clock according to the interval between an artificial circulation time sequence node and two timing nodes of arbitrary neighborhood set;Or set up task management clock by the interval between a circulation time sequence node and two timing nodes of arbitrary neighborhood of arranging after the pre-determined process-time statistical analysis to multiple tasks of the particular analysis module in device.
In some optional implementations of the present embodiment, task scheduling apparatus 400 also includes mission bit stream memory module (not shown in FIG.).Each task is analyzed and stores by mission bit stream memory module.
Mission bit stream memory module farther includes timing node and time cycle quantity determines unit and memory element.Wherein, timing node and time cycle quantity determine that cell location for determining pre-determined process-time timing node corresponding with task management clock and the time cycle quantity of any one task according to formula (1) and (2):
I=((T-t) %M)/U+C (1);
N=T/M (2);
Wherein, I is timing node;T is task pre-determined process-time;T is task current time;% is complementation symbol;U is the interval between two timing nodes of arbitrary neighborhood;M is that task management clock time pointer turns around the time consumed;The timing node that C task clock currently points to;N is time cycle quantity;/ for the operator that rounds up of being divided by.
Memory cell arrangements is for binding corresponding with this task for this task time cycle quantity and storing respectively to the array corresponding to timing node corresponding with this task.
It is to say, prestored multiple mission bit stream in array corresponding with each timing node of task management clock in task scheduling apparatus.Each of which mission bit stream all contains time cycle quantity.
In the present embodiment, it is judged that module 403 judges whether the amount of cycles of each mission bit stream in the array corresponding to timing node that the time indicator of the task management clock read by mission bit stream read module 402 currently points to meets predetermined condition.
Can in implementation in some of the present embodiment, above-mentioned predetermined condition can be N=μ;Wherein, N is the described time cycle quantity of arbitrary described mission bit stream;μ is predetermined threshold, 0≤μ < N, and μ is integer.It is to say, probe thread judge the time cycle quantity in each mission bit stream be with equal to a predetermined threshold.This predetermined threshold can be equal to zero, it is also possible to for more than zero and less than any positive integer of time cycle quantity.
In the present embodiment, when judge module 403 judges that the time cycle quantity of any one mission bit stream meets above-mentioned predetermined condition, then this task is overtime task, overtime task is processed type according to it and generates timeout treatment event by processing module, this timeout treatment event is sent in the message queue in server 107, and in array, deletes the mission bit stream of this overtime task.
In the present embodiment, the task that the timeout treatment event received is distributed to task processing center according to the order of FIFO is processed node by message queue.
In some optional implementations of the present embodiment, when the time cycle quantity that judge module judges in any one mission bit stream is unsatisfactory for above-mentioned predetermined condition, processing module configures further for the predetermined value that time cycle quantity successively decreased.Predetermined value such as can be equal to 1.
Below with reference to Fig. 5, it illustrates the Organization Chart of the distributed overtime task dispatching patcher of the application.As it is shown in figure 5, distributed overtime task dispatching patcher includes task management center 51, message queue 52 and task processing center 53.Include task in task management center 51 to add and removing module 511, task time-out detection module 512 and time out event process sending module 513.Above-mentioned distributed overtime task dispatching device is arranged in task management center.Wherein, task is added with removing module 511 is to being added in the array corresponding with each timing node of task management clock in task management center 51 and deleting mission bit stream.Task detection module 512 is whether each task in the array corresponding with each timing node of task management clock in task management center 51 is overtime.Time out event processes sending module 513 and the overtime task in array is generated timeout treatment event and timeout treatment event is sent in message queue 52.Message queue 52 receives the one or more timeout treatment events from task management center 51.Message queue 52 can obtain each task of task processing center 53 according to pre-defined rule every the scheduled time and process the running status of node 531, processes, according to each task, each task that timeout treatment event is pushed to task processing center 53 according to the order of FIFO by the running status of node 531 and processes node 531.From figure 5 it can be seen that task management center 51 and task processing center 53 are by message queue 52 decoupling.It is to say, the time-out detection of task is undertaken by task management center 51 and task processing center 53 respectively with processing.As such, it is possible to be extended tackling ever-increasing task quantity to task management center 51 and task processing center 53.
Below with reference to Fig. 6, it illustrates the structural representation of the computer system 600 being suitable to the server for realizing the embodiment of the present application.
As shown in Figure 6, computer system 600 includes CPU (CPU) 601, its can according to the program being stored in read only memory (ROM) 602 or from storage part 608 be loaded into the program random access storage device (RAM) 603 and perform various suitable action and process.In RAM603, also storage has system 600 to operate required various programs and data.CPU401, ROM602 and RAM603 are connected with each other by bus 604.Input/output (I/O) interface 605 is also connected to bus 604.
It is connected to I/O interface 604: include the importation 606 of keyboard, mouse etc. with lower component;Output part 607 including such as cathode ray tube (CRT), liquid crystal display (LCD) etc.;Storage part 608 including hard disk etc.;And include the communications portion 609 of the NIC of such as LAN card, modem etc..Communications portion 609 performs communication process via the network of such as the Internet.Driver 610 is connected to I/O interface 604 also according to needs.Detachable media 611, such as disk, CD, magneto-optic disk, semiconductor memory etc., be arranged in driver 610 as required, in order to the computer program read from it is mounted into storage part 608 as required.
Especially, according to embodiment of the disclosure, the process described above with reference to flow chart may be implemented as computer software programs.Such as, embodiment of the disclosure and include a kind of computer program, it includes the computer program being tangibly embodied on machine readable media, and described computer program comprises the program code for performing the method shown in flow chart.In such embodiments, this computer program can pass through communications portion 609 and be downloaded and installed from network, and/or is mounted from detachable media 611.
Flow chart in accompanying drawing and block diagram, it is illustrated that according to the system of the various embodiment of the application, the architectural framework in the cards of method and computer program product, function and operation.In this, flow chart or each square frame in block diagram can represent a part for a module, program segment or code, and a part for described module, program segment or code comprises the executable instruction of one or more logic function for realizing regulation.It should also be noted that at some as in the realization replaced, the function marked in square frame can also to be different from the order generation marked in accompanying drawing.Such as, two square frames succeedingly represented can essentially perform substantially in parallel, and they can also perform sometimes in the opposite order, and this determines according to involved function.It will also be noted that, the combination of the square frame in each square frame in block diagram and/or flow chart and block diagram and/or flow chart, can realize by the special hardware based system of the function or operation that perform regulation, or can realize with the combination of specialized hardware Yu computer instruction.
It is described in module involved in the embodiment of the present application to be realized by the mode of software, it is also possible to realized by the mode of hardware.Described module can also be arranged within a processor, for instance, it is possible to it is described as: a kind of processor includes timing node acquisition module, mission bit stream read module, judge module and processing module.Wherein, the title of these modules is not intended that the restriction to this module itself under certain conditions, for instance timing node acquisition module is also described as " obtaining the module of the timing node that task management clock time pointer currently points to ".
As on the other hand, present invention also provides a kind of nonvolatile computer storage media, this nonvolatile computer storage media can be the nonvolatile computer storage media comprised in device described in above-described embodiment;Can also be individualism, be unkitted the nonvolatile computer storage media allocating in terminal.Above-mentioned nonvolatile computer storage media storage has one or more program, when one or multiple program are performed by an equipment, make described equipment: obtain the timing node that the time indicator of the task management clock pre-build currently points to, described task management clock includes multiple timing node, and wherein the interval between two timing nodes of arbitrary neighborhood is equal;Being successively read the multiple mission bit streams prestored in the array corresponding to the timing node that described time indicator currently points to, described mission bit stream includes time cycle quantity information, and wherein said time cycle quantity is the integer more than or equal to zero;Whether the arbitrary described time cycle quantity judged in described array meets predetermined condition;If the described time cycle quantity of the arbitrary described mission bit stream in described array meets predetermined condition, then this task is overtime task, and by message queue, this task is pushed to task processing center.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Skilled artisan would appreciate that, invention scope involved in the application, it is not limited to the technical scheme of the particular combination of above-mentioned technical characteristic, when also should be encompassed in without departing from described inventive concept simultaneously, other technical scheme being carried out combination in any by above-mentioned technical characteristic or its equivalent feature and being formed.Such as features described above and (but not limited to) disclosed herein have the technical characteristic of similar functions and replace mutually and the technical scheme that formed.

Claims (10)

1. a distributed overtime task dispatching method, it is characterised in that described method includes:
Obtaining the timing node that the time indicator of the task management clock pre-build currently points to, described task management clock includes multiple timing node, and wherein the interval between two timing nodes of arbitrary neighborhood is equal;
Being successively read the multiple mission bit streams prestored in the array corresponding to the timing node that described time indicator currently points to, described mission bit stream includes time cycle quantity information, and wherein said time cycle quantity is the integer more than or equal to zero;
Judge whether the described time cycle quantity of the arbitrary described mission bit stream in described array meets predetermined condition;
If the described time cycle quantity of the arbitrary described mission bit stream in described array meets predetermined condition, then this task is overtime task, and by message queue, this task is pushed to task processing center.
2. distributed overtime task dispatching method according to claim 1, it is characterised in that described in the task management clock that pre-builds set up by following steps:
One circulation time sequence node is set;
Interval between two timing nodes of arbitrary neighborhood is set;
Described task management clock is set up according to the interval between described circulation time sequence node and two timing nodes of described arbitrary neighborhood;Wherein,
The time indicator of described task management clock interval between described adjacent two timing nodes is pointed to next timing node by a timing node.
3. distributed overtime task dispatching method according to claim 2, it is characterised in that described predetermined condition is: N=μ;Wherein, N is the described time cycle quantity of arbitrary described mission bit stream;μ is predetermined threshold, 0≤μ < N, and μ is integer.
4. distributed overtime task dispatching method according to claim 2, it is characterised in that described distributed overtime task dispatching method also includes:
If the described time cycle quantity of the arbitrary mission bit stream in described array is unsatisfactory for described predetermined condition, then this task is for having not timed out task, and successively decrease predetermined value by described time cycle quantity.
5. distributed overtime task dispatching method according to claim 2, it is characterised in that multiple mission bit streams prestored in described array are through the following steps that storage:
Pre-determined process-time and corresponding timing node and the time cycle quantity in described task management clock of any one task is determined according to below equation:
I=((T-t) %M)/U+C (1);
N=T/M (2);
Wherein, I is timing node;T is described task pre-determined process-time;T is the current time of described task;% is complementation symbol;U is the interval between two timing nodes of described arbitrary neighborhood;The described time indicator that M is described task management clock rotates the time that a circle consumes;C is the timing node that described task clock currently points to;N is time cycle quantity;/ for the operator that rounds up of being divided by;
Corresponding with described task for described task time cycle quantity is bound and stored to the array corresponding to timing node corresponding with described pre-determined process-time.
6. a distributed overtime task dispatching device, it is characterised in that described device includes:
Timing node acquisition module, configuration is for obtaining the timing node that the time indicator of the task management clock pre-build currently points to, and described task management clock includes multiple timing node, and wherein the interval between two described timing nodes of arbitrary neighborhood is equal;
Mission bit stream read module, configuration is for being successively read the multiple mission bit streams prestored in the array corresponding to the timing node that described time indicator currently points to, described mission bit stream includes time cycle quantity information, and wherein said time cycle quantity is the integer more than or equal to zero;
Judge module, whether configuration meets predetermined condition for the described time cycle quantity judging the arbitrary described mission bit stream in described array;
Processing module, if configuring the described time cycle quantity for the arbitrary described mission bit stream in described array to meet predetermined condition, then this task is overtime task, and by message queue, this task is pushed to task processing center.
7. distributed overtime task dispatching device according to claim 5, it is characterised in that described task scheduling apparatus also includes task clock and sets up module, and configuration is used for arranging a circulation time sequence node;Interval between two timing nodes of arbitrary neighborhood is set;Described task management clock is set up according to the interval between described circulation time sequence node and two timing nodes of described arbitrary neighborhood;Wherein, the time indicator of described task management clock interval between described adjacent two timing nodes is pointed to next timing node by a timing node.
8. distributed overtime task dispatching device according to claim 7, it is characterised in that described predetermined condition is: N=μ;Wherein, N is the described time cycle quantity of arbitrary described mission bit stream;μ is predetermined threshold, 0≤μ < N, and μ is integer.
9. distributed overtime task dispatching device according to claim 7, it is characterized in that, if described processing module configures the described time cycle quantity for the arbitrary described mission bit stream in described array further and is unsatisfactory for described predetermined condition, successively decrease predetermined value by described time cycle quantity.
10. distributed overtime task dispatching device according to claim 7, it is characterised in that task scheduling apparatus also includes mission bit stream memory module, and described mission bit stream memory module farther includes:
Timing node and time cycle quantity determine unit, and configuration for determining pre-determined process-time and corresponding timing node and the time cycle quantity in described task management clock of any one task according to below equation:
I=((T-t) %M)/U+C (1);
N=T/M (2);
Memory element, configuration is for binding corresponding with described task for described task time cycle quantity and store to the array corresponding to timing node corresponding with described pre-determined process-time.
CN201610105319.XA 2016-02-25 2016-02-25 Distributed overtime task scheduling method and device Pending CN105808329A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610105319.XA CN105808329A (en) 2016-02-25 2016-02-25 Distributed overtime task scheduling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610105319.XA CN105808329A (en) 2016-02-25 2016-02-25 Distributed overtime task scheduling method and device

Publications (1)

Publication Number Publication Date
CN105808329A true CN105808329A (en) 2016-07-27

Family

ID=56465880

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610105319.XA Pending CN105808329A (en) 2016-02-25 2016-02-25 Distributed overtime task scheduling method and device

Country Status (1)

Country Link
CN (1) CN105808329A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106775966A (en) * 2016-11-21 2017-05-31 青岛海信电器股份有限公司 A kind of user's operation task processing method and processing device
CN108021439A (en) * 2016-10-31 2018-05-11 阿里巴巴集团控股有限公司 A kind of task polling method, task arrangement method and relevant apparatus
CN108897854A (en) * 2018-06-29 2018-11-27 北京京东金融科技控股有限公司 A kind of monitoring method and device of overtime task
CN111245935A (en) * 2020-01-10 2020-06-05 深圳前海环融联易信息科技服务有限公司 Timeout request processing method and device, computer equipment and storage medium
CN111966505A (en) * 2020-10-26 2020-11-20 成都掌控者网络科技有限公司 Time-based trigger event control method and device and storage medium
CN113059562A (en) * 2021-03-22 2021-07-02 深圳市注能科技有限公司 Robot, thread adjusting method and thread synchronizing method
CN113157404A (en) * 2020-01-07 2021-07-23 北京沃东天骏信息技术有限公司 Task processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1645334A (en) * 2005-01-12 2005-07-27 宁波大学 Timer dispatching method for real-time multi-task operating system
US20070101316A1 (en) * 2005-09-12 2007-05-03 Don Berndt Software Architecture and Program for the Concurrent Execution of Finite State Machine-Encoded Processes, on Single or Multiple-Processor-Based Embedded Systems
CN101645024A (en) * 2009-08-21 2010-02-10 无锡威泰迅电力科技有限公司 Dispatching method of annular propulsion timer
CN103067258A (en) * 2012-12-14 2013-04-24 北京思特奇信息技术股份有限公司 Message overtime detection processing method
US20150347186A1 (en) * 2014-05-29 2015-12-03 Netapp, Inc. Method and system for scheduling repetitive tasks in o(1)

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1645334A (en) * 2005-01-12 2005-07-27 宁波大学 Timer dispatching method for real-time multi-task operating system
US20070101316A1 (en) * 2005-09-12 2007-05-03 Don Berndt Software Architecture and Program for the Concurrent Execution of Finite State Machine-Encoded Processes, on Single or Multiple-Processor-Based Embedded Systems
CN101645024A (en) * 2009-08-21 2010-02-10 无锡威泰迅电力科技有限公司 Dispatching method of annular propulsion timer
CN103067258A (en) * 2012-12-14 2013-04-24 北京思特奇信息技术股份有限公司 Message overtime detection processing method
US20150347186A1 (en) * 2014-05-29 2015-12-03 Netapp, Inc. Method and system for scheduling repetitive tasks in o(1)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108021439A (en) * 2016-10-31 2018-05-11 阿里巴巴集团控股有限公司 A kind of task polling method, task arrangement method and relevant apparatus
CN108021439B (en) * 2016-10-31 2022-07-15 阿里巴巴集团控股有限公司 Task polling method, task arrangement method and related device
CN106775966A (en) * 2016-11-21 2017-05-31 青岛海信电器股份有限公司 A kind of user's operation task processing method and processing device
CN108897854A (en) * 2018-06-29 2018-11-27 北京京东金融科技控股有限公司 A kind of monitoring method and device of overtime task
CN113157404A (en) * 2020-01-07 2021-07-23 北京沃东天骏信息技术有限公司 Task processing method and device
CN113157404B (en) * 2020-01-07 2024-04-16 北京沃东天骏信息技术有限公司 Task processing method and device
CN111245935A (en) * 2020-01-10 2020-06-05 深圳前海环融联易信息科技服务有限公司 Timeout request processing method and device, computer equipment and storage medium
CN111966505A (en) * 2020-10-26 2020-11-20 成都掌控者网络科技有限公司 Time-based trigger event control method and device and storage medium
CN113059562A (en) * 2021-03-22 2021-07-02 深圳市注能科技有限公司 Robot, thread adjusting method and thread synchronizing method

Similar Documents

Publication Publication Date Title
CN105808329A (en) Distributed overtime task scheduling method and device
CN101981531B (en) Aggregating recurrent schedules to optimize resource consumption
JP6530462B2 (en) Determining and monitoring the performance capabilities of computer resource services
CN106547578B (en) Loading method and device of terminal application APP
CN102708050B (en) Method and system for testing mobile application
US20120254309A1 (en) Information processing apparatus and method, electronic device and control method thereof, and log collection system
CN105786600A (en) Task scheduling method and device
CN103270466A (en) Power management via coordination and selective operation of timer-elated tasks
CN103905778A (en) Scheduling method and device for video conference
CN103995735A (en) Device and method for scheduling working flow
CN111694646A (en) Resource scheduling method and device, electronic equipment and computer readable storage medium
CN105208125A (en) Message transmission method, device and system
CN110119307B (en) Data processing request processing method and device, storage medium and electronic device
Hirsch et al. DewSim: A trace‐driven toolkit for simulating mobile device clusters in Dew computing environments
CN106130810B (en) Website monitoring method and device
CN113672500A (en) Deep learning algorithm testing method and device, electronic device and storage medium
CN113127225A (en) Method, device and system for scheduling data processing tasks
CN114629960A (en) Resource scheduling method, device, system, device, medium, and program product
CN110113176B (en) Information synchronization method and device for configuration server
CN112653736B (en) Parallel source returning method and device and electronic equipment
CN114153609A (en) Resource control method and device, electronic equipment and computer readable storage medium
CN110022323A (en) A kind of method and system of the cross-terminal real-time, interactive based on WebSocket and Redux
CN110188258B (en) Method and device for acquiring external data by using crawler
CN109002381A (en) Process communication monitoring method, electronic device and computer readable storage medium
CN101551758B (en) System and method for implementing paralleling work of device management and tasks

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: 20160727