CN109831520A - A kind of timed task dispatching method and relevant apparatus - Google Patents

A kind of timed task dispatching method and relevant apparatus Download PDF

Info

Publication number
CN109831520A
CN109831520A CN201910173430.6A CN201910173430A CN109831520A CN 109831520 A CN109831520 A CN 109831520A CN 201910173430 A CN201910173430 A CN 201910173430A CN 109831520 A CN109831520 A CN 109831520A
Authority
CN
China
Prior art keywords
task
timed task
actuator
dispatch server
timed
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
CN201910173430.6A
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.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and 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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN201910173430.6A priority Critical patent/CN109831520A/en
Publication of CN109831520A publication Critical patent/CN109831520A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The present embodiments relate to computer field, a kind of timed task dispatching method and relevant apparatus are disclosed.The timer-triggered scheduler method is applied to dispatch server, the dispatch server is connect with N number of actuator, N is the positive integer greater than 1, it include: to issue the execution signal of timed task to each actuator, wherein, the execution signal includes the identification code of the timed task and the execution time of the timed task;Each actuator is obtained respectively according to the task execution node for executing signal creation, wherein includes the identification code of the timed task and the information for being used to indicate creation sequence in each task execution node;According to the information for being used to indicate creation sequence, an actuator is selected from the actuator that creation has task execution node;The data of the timed task are transmitted to selected actuator.In the present invention, so that each timed task is executed by an actuator, solve the problems, such as that timed task is repeatedly executed.

Description

A kind of timed task dispatching method and relevant apparatus
Technical field
The present embodiments relate to field of computer technology, in particular to a kind of timed task dispatching method and related dress It sets.
Background technique
With the rapid development of the universal and internet industry of computer, Internet service system become more sophisticated and It is huge.In a distributed system, the utilization of timer-triggered scheduler task is able to solve the operational processing logic of large amount of complex, is interconnecting Network service field is widely used.
However, it is found by the inventors that at least there are the following problems in the prior art: distributed project is possible to dispose when disposing Be not same server, every service has the timed task respectively needed to be implemented, if not doing management and running may lead Different server is caused to be performed simultaneously timed task and lead to data problem.Such as: the flowing of access of analysis user daily, if point Cloth system does not control, and may result in the actuator of n platform equipment while starting, and causes only generate a access originally Flow increases n times.If there is doing the distributed control of actuator, but server time has differences, it is also possible to will lead to Equipment component repeats timed task.
It should be noted that information is only used for reinforcing the reason to the background of the disclosure disclosed in above-mentioned background technology part Solution, therefore may include the information not constituted to the prior art known to persons of ordinary skill in the art.
Summary of the invention
Embodiment of the present invention is designed to provide a kind of timed task dispatching method and relevant apparatus, so that each fixed When task executed by an actuator, solve the problems, such as that timed task is repeatedly executed.
To realize that above-mentioned technical purpose, embodiments of the present invention provide a kind of timed task dispatching method, apply In dispatch server, dispatch server is connect with N number of actuator, and N is the positive integer greater than 1, and timer-triggered scheduler method includes:
The execution signal of timed task is issued to each actuator, wherein execute the identification code that signal includes timed task With the execution time of timed task;
Each actuator is obtained respectively according to the task execution node for executing signal creation, wherein each task execution section It include the identification code of timed task and the information for being used to indicate creation sequence in point;
According to the information for being used to indicate creation sequence, one execution of selection from the actuator that creation has task execution node Device;
The data of timed task are transmitted to selected actuator.
Embodiments of the present invention additionally provide a kind of timed task dispatching method, are applied to actuator, actuator and tune Server connection is spent, which includes:
Obtain the execution signal of the timed task of dispatch server publication, wherein executing includes timed task in signal The execution time of identification code and timed task;
According to the execution time of timed task, task execution node is created in dispatch server, wherein task execution section Point includes the identification code of timed task and the information for being used to indicate creation sequence, and dispatch server is selected according to task execution node Execute the actuator of timed task;
It sends and executes querying command to dispatch server, judge whether to be adjusted according to the response message that dispatch server returns Spend server selection.
Embodiments of the present invention additionally provide a kind of dispatch server, comprising: at least one processor;And
The memory being connect at least one processor communication;And
With the communication component of actuator communication connection, communication component sends and receivees data under the control of a processor;
Wherein, memory is stored with the instruction that can be executed by least one processor, and instruction is held by least one processor Row, so that at least one processor is able to carry out the above-mentioned timed task dispatching method applied to dispatch server.
Embodiments of the present invention additionally provide a kind of actuator, comprising: at least one processor;And
The memory being connect at least one processor communication;And
With the communication component of dispatch server communication connection, communication component sends and receivees number under the control of a processor According to;
Wherein, memory is stored with the instruction that can be executed by least one processor, and instruction is held by least one processor Row, so that at least one processor is able to carry out the above-mentioned timed task dispatching method applied to actuator.
Embodiments of the present invention additionally provide a kind of timed task scheduling system, including above-mentioned dispatch server and hold Row device.
Embodiments of the present invention additionally provide a kind of computer readable storage medium, are stored with computer program, the meter Calculation machine program realizes the above-mentioned timed task dispatching method applied to dispatch server when being executed by processor.
Embodiments of the present invention additionally provide a kind of computer readable storage medium, are stored with computer program, the meter Calculation machine program realizes the above-mentioned timed task dispatching method applied to actuator when being executed by processor.
Embodiment of the present invention in terms of existing technologies, issued according to the execution time of timed task by dispatch server To actuator, actuator creates task after getting execution signal on dispatch server and holds the execution signal of timed task Row node guarantees a timed task by an actuator so that dispatch server selects actuator according to task execution node It is executed, is avoided because of the problem of timed task caused by each actuator Time Inconsistency is repeatedly executed.
In addition, selecting one from the actuator that creation has task execution node according to the information for being used to indicate creation sequence A actuator, specifically includes: according to the information for being used to indicate creation sequence, selecting first task execution node being created; Determine the corresponding actuator of first task node being created.
In the embodiment, select first task execution node being created for the actuator of timed task, wherein the The corresponding actuator processing speed of one task node being created is fast, facilitates dispatch server and quickly determines to execute timing The actuator of task.
In addition, after the data of timed task are transmitted to selected actuator, timed task dispatching method further include: Obtain the timeout action of actuator;Judged whether to re-execute timed task according to timeout action.
In the embodiment, dispatch server obtains the super of actuator after determining the actuator for executing timed task When movement ensure that the timed task executes completion.
In addition, judging whether that if re-executing timed activity includes: timeout action to abandon executing according to timeout action, really The state for determining timed task terminates for time-out;If timeout action is to re-execute, the task run number of timed task is obtained, is sentenced Whether disconnected task run number is greater than or equal to maximum number of run, if it is, timed task is issued again, if it has not, control Actuator re-executes timed task.
Querying command is executed to dispatch server in addition, sending, and the response message judgement returned according to dispatch server is No scheduled server selection, specifically includes: transmission execution querying command to dispatch server, and obtains dispatch server return Response message;If response message indicates that actuator is selected, the data of the timed task of dispatch server transmission are obtained;If ringing It answers information to indicate that actuator is unselected, sends the instruction for deleting task execution node to dispatch server.
In addition, timed task dispatching method also wraps before the execution signal of the timed task of acquisition dispatch server publication It includes: being respectively each timed task generation identification code on actuator;By the identification code of the data of timed task and timed task It is transmitted to dispatch server.
In addition, if response message indicate actuator selected, obtain dispatch server transmission timed task data it Afterwards, timed task dispatching method further include: increase task description information and task description information is transmitted to dispatch server.
In addition, when task description information includes: task locking time, task schedule end time, task status, time-out Between, at least one of timeout action, maximum number of run, task run number, mission bit stream.
Detailed description of the invention
One or more embodiments are illustrated by the picture in corresponding attached drawing, these exemplary theorys The bright restriction not constituted to embodiment, the element in attached drawing with same reference numbers label are expressed as similar element, remove Non- to have special statement, composition does not limit the figure in attached drawing.
Fig. 1 is the flow chart of timed task dispatching method in first embodiment of the invention;
Fig. 2 is the flow chart of timed task dispatching method in second embodiment of the invention;
Fig. 3 is the flow chart of timed task dispatching method in third embodiment of the invention;
Fig. 4 is the flow chart of timed task dispatching method in four embodiment of the invention;
Fig. 5 is the structure chart of dispatch server in fifth embodiment of the invention;
Fig. 6 is the structure chart of actuator in sixth embodiment of the invention;
Fig. 7 is the structure chart of timed task scheduling system in seventh embodiment of the invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention Each embodiment be explained in detail.However, it will be understood by those skilled in the art that in each embodiment party of the present invention In formula, in order to make the reader understand this application better, many technical details are proposed.But even if without these technical details And various changes and modifications based on the following respective embodiments, the application technical solution claimed also may be implemented.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.
The first embodiment of the present invention is related to a kind of timed task dispatching methods.Applied to dispatch server, scheduling clothes Business device is connect with N number of actuator, and N is the positive integer greater than 1, and detailed process is as shown in Figure 1, include that step is implemented as follows:
Step 101: issuing the execution signal of timed task to each actuator.
Wherein, executing signal includes the identification code of timed task and the execution time of timed task.
Specifically, dispatch server is for managing whole timed tasks, dispatch server can get each timing The identification code of the execution time and timed task of task.If each timed task is set on an actuator, in system After starting, actuator is that the timed task being disposed thereon generates identification code (Universally Unique Identifier, UUID), by the starting time tranfer of the identification code of generation and timed task to dispatch server.
One in the specific implementation, be provided with the timed task of data analysis, e.g., at 8 points in the daily morning on actuator Clock carries out data analysis task, and after the system starts, actuator generates the identification code of the data analysis task, such as JOB_ Analysis, by the starting time tranfer of identification code and timed task to dispatch server.
Specifically, it is also possible to be stored with database in dispatch server, the information of each timed task of data-base recording, The identification code of execution time and timed task including timed task.
It should be noted that scheduling actuator is the execution signal for executing time publication timed task according to timed task , it is executed with guaranteeing that the timed task only has an actuator.For example, before the execution time of timed task reaches Preset time issues the execution signal of timed task, if the execution time of a timed task is 1 point of morning, in morning zero The execution signal of the 58 distribution cloth timed tasks of point.It is merely illustrative herein, it is not specifically limited.
Step 102: obtaining each actuator respectively according to the task execution node for executing signal creation.
Wherein, the identification code in each task execution node including timed task and the information for being used to indicate creation sequence.
Specifically, obtaining each actuator according to execution after the execution signal of dispatch server publication timed task The task execution node of signal creation, wherein the task execution node of actuator creation indicates the actuator current state for sky The timed task can be performed in spare time.It should be noted that due to being not that each actuator connecting with dispatch server can be created Task execution node is built, each actuator is not each actuator connecting with dispatch server herein, and expression is each Create the actuator of task execution node.
One in the specific implementation, use a kind of ZooKeeper (reliable association of distributed system in a distributed manner for system Adjusting system) distributed lock based on, actuator creates task execution node under the lock node of ZooKeeper, name rule Then are as follows: the identification code of timed task _ timed task starting timestamp _ sequence number;Wherein, sequence number indicates actuator instruction wound Build the information of sequence.Such as: by taking the timed task for the data analysis that eight every morning starts as an example, the mark of the timed task Know code are as follows: the entitled JOB_analysis_ of the task execution node of first actuator of JOB_analysis creation 1543289797000-000001;The entitled JOB_analysis_ of the task execution node of second actuator creation 1543289797000-000002;The entitled JOB_analysis_ of the task execution node of third actuator creation 1543289797000-000003;And so on.It needs and illustrates, the timestamp in task execution node indicates that basis is appointed The sequence code for executing time generation of business, is only example herein, the rule of the timestamp specifically generated is not construed as limiting.
Specifically, the entitled JOB_analysis_ of whole under the lock of dispatch server acquisition ZooKeeper The task execution node of 1543289797000 beginnings, it may be determined that execute the quantity of the actuator of the timed task out.Wherein, respectively The information for being used to indicate creation sequence that actuator is generated when creating task execution node be sequence code, sequence code can be from 001, which is numbered, is also possible to be numbered from 000, is not specifically limited herein.
It is noted that dispatch server can basis when actuator creates task execution node in dispatch server The creation sequence of actuator is automatically generated for the information of instruction creation sequence, and the information of creation sequence also reflects actuator Processing speed, create task execution node speed it is faster indicate actuator processing speed it is faster, in the lock of ZooKeeper It is lower to lock the actuator for executing timed task faster, facilitate dispatch server and is held according to the selection of the processing speed of actuator Row device.
Step 103: according to the information for being used to indicate creation sequence, being selected from the actuator that creation has task execution node One actuator.
Specifically, dispatch server get each actuator creation task execution node title, according to appoint The title that business executes node selects an actuator, and the actuator is for executing pending timed task.
Specifically, dispatch server can be selected from the actuator of creation task execution node according to preset alternative condition An actuator is selected, e.g., preset alternative condition is to create sequential selection, selection wound according to the instruction in task execution node Build the actuator for being ordered as first in sequence.One specific implementation are as follows: according to the information for being used to indicate creation sequence, selection the One task execution node being created;Determine the corresponding actuator of first task node being created.
For example, with the entitled JOB_analysis_1543289797000 beginning of whole under the lock of above-mentioned ZooKeeper Task node for, dispatch server select task execution node in indicate creation sequence information in sequence number the smallest Business executes the corresponding actuator of node, as selected JOB_analysis_ in above-mentioned each task execution node The corresponding actuator of 1543289797000-000001 title.That is, under the lock of ZooKeeper in task execution node The smallest task execution node of sequence number robs the right of execution for accounting for the timed task.
It should be noted that understand for convenience in present embodiment and propose above-mentioned specific embodiment, actual implementation In can be selected the actuator for executing pending timed task to be only herein according to the selection rule of dispatch server Example is not specifically limited.
Step 104: the data of timed task are transmitted to selected actuator.
Specifically, the data of timed task are transmitted to the actuator after dispatch server selects an actuator. For example, including the database for being stored with the information of each timed task in dispatch server, dispatch server will be corresponding in database The data of timed task are transmitted to the actuator of selection.
It should be noted that being dispatched involved in first embodiment of the invention applied to the timed task of dispatch server Method, present embodiment mainly the improvement is that each implementation steps shown in FIG. 1, select one by dispatch server and hold Row device, actuator avoid the occurrence of a problem of timed task is by multiple actuators, originally for executing pending timed task Illustrating in embodiment is for facilitating the detailed technology details for understanding that each implementation steps provide, and above-mentioned is specific Realize to be a kind of implementation, be to understand the technical detail of present embodiment for convenience and provide, not this embodiment party Formula it is necessary.
Specifically, each actuator can be inquired respective after the actuator of dispatch server selection execution timed task State, such as whether being selected as executing the actuator of timed task.
One in the specific implementation, the actuator obtains timing if actuator is selected as executing the actuator of timed task The data of task, and the timed task is executed according to the execution time of the timed task;If actuator is not selected as executing The actuator of timed task, the actuator delete task execution node of the creation on dispatch server, and the timing is abandoned in expression The contention of task is abandoned executing the timed task, can be avoided a timing and is executed by multiple actuators.
It should be noted that the above is only limit for example, not constituting to technical solution of the present invention.
In terms of existing technologies, dispatch server issues the execution of timed task according to the execution time of timed task Signal is to actuator, and actuator creates task execution node after getting execution signal on dispatch server, to adjust It spends server and actuator is selected according to task execution node, guarantee that a timed task is executed by an actuator, avoid Because of the problem of timed task caused by each actuator Time Inconsistency is repeatedly executed.
Second embodiment of the present invention is related to a kind of timed task dispatching method, is applied to dispatch server, and second is real It is roughly the same with first embodiment to apply mode, is in place of the main distinction, specifically illustrates timing in this second embodiment The judgement and processing of timeout action in method for scheduling task.Its method flow is as shown in Fig. 2, specifically, in present embodiment Including step 201 to step 210, wherein step 201 to step 204 respectively with the step 101 in first embodiment to step 104 is identical, and details are not described herein again.Difference is mainly introduced below:
Step 205: obtaining the timeout action of actuator.
Step 206: being judged whether to re-execute timed task according to timeout action, if it has not, thening follow the steps 207;If It is yes, execution step 208- step 210.
Step 207: determining that timed task executes completion.
Step 208: judging whether the number of timeout action is greater than or equal to maximum number of run, if it is, executing step 209;If it has not, executing step 210.
Step 209: issuing timed task again.
Step 210: control actuator re-executes timed task.
Specifically, the timeout action of actuator indicates that actuator does not complete the timed task for the first time, there are time-out to hold Capable number.Present embodiment is specifically described primarily directed to timeout action, and above-mentioned steps 205 to step 210 are not The necessary step of real-time timed task dispatching method specifically can select to execute according to practical practice condition.
It is noted that dispatch server fails after selecting actuator, if actuator occur and executing timed task When content without updating task execution node, will lead to timed task execution the problem of being not carried out, in order to avoid occur because Actuator executes the problem of timed task caused by failure is not carried out, and the time-out for obtaining actuator here by dispatch server is dynamic It improves, in specific implementation, can also determine whether timed task is completed according to other action messages of actuator, herein It is merely illustrative, it is not particularly limited.
It should be noted that the above is only limit for example, not constituting to technical solution of the present invention.
Third embodiment of the present invention is related to a kind of timed task dispatching method, is applied to actuator, actuator and tune The connection of degree center, method flow is as shown in figure 3, include that step is implemented as follows:
Step 301: obtaining the execution signal of the timed task of dispatch server publication.
Wherein, the execution time of the identification code and timed task in signal including timed task is executed.
One in the specific implementation, be provided with the data of timed task in actuator, in system starting, respectively actuator On each timed task generate identification code;The identification code of the data of timed task and timed task is transmitted to dispatch service Device.
It should be noted that being only to be not used in limitation present embodiment for timed task is arranged on actuator herein.
Step 302: according to the execution time of timed task, task execution node is created in dispatch server.
Wherein, task execution node includes the identification code of timed task and the information for being used to indicate creation sequence, scheduling clothes Business device selects to execute the actuator of timed task according to task execution node.
Step 303: sending and execute querying command to dispatch server, judged according to the response message that dispatch server returns Whether scheduled server selects, if it is, executing step 304, otherwise, executes step 305.
Step 304: obtaining the data of the timed task of dispatch server transmission.
Step 305: the instruction of transmission deletion task execution node to dispatch server.
Specifically, dispatch server according to task execution node select an actuator, the actuator for execute to The timed task of execution can send each actuator and execute querying command to dispatch server, judge whether to be adjusted Spend server selection.
One in the specific implementation, dispatch server selects to execute according to the information of the instruction creation sequence executed in node Device, e.g., the smallest actuator of sequence number in the information of dispatch server selection instruction creation sequence, each actuator can be to Whether the information for the instruction creation sequence that dispatch server is inquired in the task execution node of oneself creation is minimum sequence, if It is then to confirm to execute the timed task, if it has not, then deleting the task execution node created.
Specifically, one of step 303 is implemented as, transmission execution querying command to dispatch server, and obtain The response message that dispatch server returns;If response message indicates that actuator is selected, the timing of dispatch server transmission is obtained The data of task;If response message indicates that actuator is unselected, the instruction for deleting task execution node is sent to dispatch service Device.
It should be noted that above-mentioned specific embodiment is only that citing is specific without limitation.
It is not difficult to find that the dispatch server connection in actuator and first embodiment in present embodiment, this implementation Mode can work in coordination implementation with first embodiment.The technical detail for the associated actuator mentioned in first embodiment exists In present embodiment still effectively, in order to reduce repetition, which is not described herein again.Correspondingly, the correlation mentioned in present embodiment Relevant technical details applied to dispatch server can also be applied in first embodiment.
4th embodiment of the invention is related to a kind of timed task dispatching method, is applied to actuator, the 4th embodiment party Formula is roughly the same with third embodiment, is in place of the main distinction, and it is fixed to illustrate that actuator executes in the fourth embodiment When task after actuator the information of timed task is described.Its method flow is as shown in figure 4, specifically, present embodiment In include step 401 to step 406, wherein step 401 to step 405 respectively with the step 301 in third embodiment to step Rapid 305 is identical, and details are not described herein again, mainly introduces difference below.
Step 406: increasing task description information and task description information is transmitted to dispatch server.
It is determined specifically, task description information facilitates dispatch server according to the increased task description information of actuator The state of actuator, in a concrete implementation, task description information include: task locking time, the task schedule end time, At least one of task status, time-out time, timeout action, maximum number of run, task run number, mission bit stream.
Wherein, task locking time indicates that actuator starts to execute the execution time of timed task;Task status includes: to appoint Business execute in, task execution terminate to terminate with task time-out, and indicated in task execution with digital " 0 ", task execution terminates to use Digital " 1 " indicates, task time-out terminates to be indicated with digital " 2 ";Time-out time indicates that actuator time-out executes timed task most Big time-out time, for example, time-out time is 120 seconds;Timeout action includes two states, re-executes and abandon to execute, again Execution indicates that abandoning executing is indicated with digital " 1 " with digital " 0 ", wherein it is then overtime that actuator execution timed task executes failure Movement is that " 0 " re-executes timed task, if timed task time-out is completed or timed task directly runs succeeded, timeout action For " 1 ";The numerical value such as task run number and maximum number of run can be arranged as the case may be, herein with no restrictions.
It should be noted that task description information is used to indicate the current state of timed task in actuator, it specifically can root According to the corresponding task description information of actual setting, it is only example herein, task description information can be increased or decreased in practice, specifically With no restrictions.
It should be noted that above each specific implementation is by way of example only, technical solution of the present invention is not constituted and limited It is fixed.
Above in connection in mode embodiment, the step of various methods, is divided, be intended merely to describe it is clear, can be with when realization It merges into a step or certain steps is split, be decomposed into multiple steps, as long as including identical logical relation, all In the protection scope of this patent;To adding inessential modification in algorithm or in process or introduce inessential set Meter, but do not change the core design of its algorithm and process all in the protection scope of the patent.
A kind of dispatch server involved in fifth embodiment of the invention, as described in Figure 5, comprising: at least one processor 501;And the memory 502 with the communication connection of at least one processor 501;And the communication group with actuator communication connection Part 503, communication part 503 send and receive data under the control of processor 501;Wherein, be stored with can be by extremely for memory 502 The instruction that a few processor 501 executes, instruction is executed by least one processor 501, so that at least one 501 energy of processor Enough execute timed task dispatching method.
In present embodiment, for processor 501 is with central processing unit (Central Processing Unit, CPU), For memory 502 is with readable and writable memory (Random Access Memory, RAM).Processor 501, memory 502 and Communication part 503 can be connected by bus or other modes, in Fig. 5 for being connected by bus.502 conduct of memory A kind of non-volatile computer readable storage medium storing program for executing, can be used for storing non-volatile software program, non-volatile computer can hold Line program and module, as realized in embodiment of the present invention, the program of timed task dispatching method is stored in memory 502 In.Non-volatile software program, instruction and the module that processor 501 is stored in memory 502 by operation, thereby executing The various function application and data processing of equipment realize above-mentioned timed task dispatching method.Communication part 503 is mainly used Communication connection between realization and actuator, without limitation for specific module composition etc..
Memory 502 may include storing program area and storage data area, wherein storing program area can store operation system Application program required for system, at least one function;It storage data area can the Save option list etc..In addition, memory can wrap High-speed random access memory is included, can also include nonvolatile memory, for example, at least disk memory, a flash memories Part or other non-volatile solid state memory parts.In some embodiments, it includes relative to processor that memory 502 is optional 501 remotely located memories, these remote memories can pass through network connection to external equipment.The example packet of above-mentioned network Include but be not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
One or more program module is stored in memory 502, is executed when by one or more processor 501 When, execute the timed task dispatching method in above-mentioned first or second method implementation.
Timed task dispatching method provided by embodiment of the present invention can be performed in the said goods, and it is corresponding to have execution method Functional module and beneficial effect, the not technical detail of detailed description in the present embodiment, reference can be made to embodiment of the present invention Provided timed task dispatching method.
Sixth embodiment of the invention is related to a kind of actuator, as described in Figure 6, comprising: at least one processor 601; And the memory 602 with the communication connection of at least one processor 601;And the communication group with dispatch server communication connection Part 603, communication part 603 send and receive data under the control of processor 601;Wherein, be stored with can be by extremely for memory 602 The instruction that a few processor 601 executes, instruction is executed by least one processor 601, so that at least one 601 energy of processor Enough execute the timed task dispatching method that above-mentioned third or the 4th embodiment are related to.
7th embodiment of the invention is related to a kind of timed task scheduling system, as shown in fig. 7, comprises the above-mentioned 5th is real Apply the dispatch server 701 in mode and the actuator in sixth embodiment 702.
Specifically, dispatch server can be connect with the actuator of at least one, dispatch server is also possible to by more than The cluster server of one server composition, is not particularly limited herein.
8th embodiment of the invention is related to a kind of computer readable storage medium, is stored with computer program, the meter Calculation machine program realizes the timed task for being applied to dispatch server in the above-mentioned first or second embodiment when being executed by processor Dispatching method.
Ninth embodiment of the invention is related to a kind of computer readable storage medium, is stored with computer program, the calculating Machine program realizes the timed task dispatching party for being applied to actuator in above-mentioned third or the 4th embodiment when being executed by processor Method.
That is, it will be understood by those skilled in the art that implement the method for the above embodiments be can be with Relevant hardware is instructed to complete by program, which is stored in a storage medium, including some instructions are to make It obtains an equipment (can be single-chip microcontroller, chip etc.) or processor (processor) executes side described in each embodiment of the application The all or part of the steps of method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey The medium of sequence code.
It will be understood by those skilled in the art that the respective embodiments described above are to realize specific embodiments of the present invention, And in practical applications, can to it, various changes can be made in the form and details, without departing from the spirit and scope of the present invention.

Claims (14)

1. a kind of timed task dispatching method, which is characterized in that be applied to dispatch server, the dispatch server is held with N number of The connection of row device, N are the positive integer greater than 1, and the timed task dispatching method includes:
The execution signal of timed task is issued to each actuator, wherein the execution signal includes the timed task Identification code and the timed task the execution time;
Each actuator is obtained respectively according to the task execution node for executing signal creation, wherein each described It includes the identification code of the timed task and the information for being used to indicate creation sequence in node that business, which executes,;
According to the information for being used to indicate creation sequence, one execution of selection from the actuator that creation has task execution node Device;
The data of the timed task are transmitted to selected actuator.
2. timed task dispatching method according to claim 1, which is characterized in that described to be used to indicate creation according to The information of sequence selects an actuator from the actuator that creation has task execution node, specifically includes:
According to the information for being used to indicate creation sequence, first task execution node being created is selected;
Determine the described first corresponding actuator of the task node being created.
3. timed task dispatching method according to claim 1 or 2, which is characterized in that described by the timed task Data are transmitted to after selected actuator, the timed task dispatching method further include:
Obtain the timeout action of the actuator;
Judged whether to re-execute the timed task according to the timeout action.
4. timed task dispatching method according to claim 3, which is characterized in that described to be judged according to the timeout action Whether re-executing the timed activity includes:
If the timeout action is to abandon executing, determine that the state of the timed task terminates for time-out;
If the timeout action is to re-execute, the task run number of the timed task is obtained, judges the task run Whether number is greater than or equal to maximum number of run, if it is, the timed task is issued again, if it has not, holding described in control Row device re-executes the timed task.
5. a kind of timed task dispatching method, which is characterized in that be applied to actuator, the actuator and dispatch server connect It connects, the timed task dispatching method includes:
Obtain the execution signal of the timed task of the dispatch server publication, wherein include described fixed in the execution signal When the identification code of the task and execution time of the timed task;
According to the execution time of the timed task, task execution node is created in the dispatch server, wherein described Business executes the identification code that node includes the timed task and is used to indicate the information of creation sequence, the dispatch server according to The task execution node selection executes the actuator of the timed task;
It sends and executes querying command to the dispatch server, judged whether according to the response message that the dispatch server returns It is selected by the dispatch server.
6. timed task dispatching method according to claim 5, which is characterized in that the transmission executes querying command to institute Dispatch server is stated, judges whether to be selected by the dispatch server according to the response message that the dispatch server returns, is had Body includes:
It sends and executes querying command to the dispatch server, and obtain the response message that the dispatch server returns;
If the response message indicates that the actuator is selected, the timed task of the dispatch server transmission is obtained Data;
If the response message indicates that the actuator is unselected, sends and delete the instruction of the task execution node to described Dispatch server.
7. timed task dispatching method according to claim 5 or 6, which is characterized in that described to obtain the dispatch service Before the execution signal of the timed task of device publication, the timed task dispatching method further include:
Each timed task on the respectively described actuator generates identification code;
The identification code of the data of the timed task and the timed task is transmitted to the dispatch server.
8. timed task dispatching method according to claim 6, which is characterized in that if the response message indicates institute Actuator is stated to be selected, after the data for obtaining the timed task of the dispatch server transmission, the timed task tune Degree method further include:
Increase task description information and the task description information is transmitted to the dispatch server.
9. timed task dispatching method according to claim 8, which is characterized in that the task description information includes: to appoint Business locking time, task schedule end time, task status, time-out time, timeout action, maximum number of run, task run At least one of number, mission bit stream.
10. a kind of dispatch server characterized by comprising at least one processor;And
The memory being connect at least one described processor communication;And
With the communication component of actuator communication connection, the communication component sends and receivees number under the control of the processor According to;
Wherein, the memory be stored with can by least one described processor execute instruction, described instruction by it is described at least One processor executes, so that at least one described processor is able to carry out the timed task as described in Claims 1-4 is any Dispatching method.
11. a kind of actuator characterized by comprising at least one processor;And
The memory being connect at least one described processor communication;And
With the communication component of dispatch server communication connection, the communication component sends and receivees under the control of the processor Data;
Wherein, the memory be stored with can by least one described processor execute instruction, described instruction by it is described at least One processor executes, so that at least one described processor is able to carry out the timed task as described in claim 5 to 9 is any Dispatching method.
12. a kind of timed task dispatches system characterized by comprising dispatch server described in any one of claim 10 and right It is required that actuator described in 11.
13. a kind of computer readable storage medium, is stored with computer program, which is characterized in that the computer program is located Reason device realizes timed task dispatching method described in any one of Claims 1-4 when executing.
14. a kind of computer readable storage medium, is stored with computer program, which is characterized in that the computer program is located It manages and realizes timed task dispatching method described in any one of claim 5 to 9 when device executes.
CN201910173430.6A 2019-03-07 2019-03-07 A kind of timed task dispatching method and relevant apparatus Pending CN109831520A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910173430.6A CN109831520A (en) 2019-03-07 2019-03-07 A kind of timed task dispatching method and relevant apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910173430.6A CN109831520A (en) 2019-03-07 2019-03-07 A kind of timed task dispatching method and relevant apparatus

Publications (1)

Publication Number Publication Date
CN109831520A true CN109831520A (en) 2019-05-31

Family

ID=66865686

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910173430.6A Pending CN109831520A (en) 2019-03-07 2019-03-07 A kind of timed task dispatching method and relevant apparatus

Country Status (1)

Country Link
CN (1) CN109831520A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532077A (en) * 2019-08-22 2019-12-03 腾讯科技(深圳)有限公司 Task processing method, device and storage medium
CN110691120A (en) * 2019-09-10 2020-01-14 威富通科技有限公司 Timing task state detection method, server and detection system
CN110968411A (en) * 2019-12-06 2020-04-07 北京明略软件系统有限公司 Timed task scheduling method, timed task scheduling device, server and storage medium
CN111078382A (en) * 2019-12-17 2020-04-28 中国建设银行股份有限公司 Command timeout processing method and device
CN111459951A (en) * 2020-02-25 2020-07-28 深圳联友科技有限公司 Method and device for supporting cluster through timing task
CN111562971A (en) * 2020-04-09 2020-08-21 北京明略软件系统有限公司 Scheduling method and system of distributed timer
CN112416581A (en) * 2020-11-13 2021-02-26 五八同城信息技术有限公司 Distributed calling system for timed tasks
CN116344016A (en) * 2023-04-23 2023-06-27 深圳作为科技有限公司 Timing task execution method of networking nursing machine and related system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075358A (en) * 2010-12-31 2011-05-25 网宿科技股份有限公司 System and method for distributing and deploying content of large-scale server cluster
CN104461747A (en) * 2014-12-31 2015-03-25 合一网络技术(北京)有限公司 Distributed type task scheduling system
CN106886450A (en) * 2015-12-16 2017-06-23 阿里巴巴集团控股有限公司 Method for scheduling task and system
CN107092521A (en) * 2016-12-30 2017-08-25 北京小度信息科技有限公司 A kind of distributed task dispatching method, apparatus and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075358A (en) * 2010-12-31 2011-05-25 网宿科技股份有限公司 System and method for distributing and deploying content of large-scale server cluster
CN104461747A (en) * 2014-12-31 2015-03-25 合一网络技术(北京)有限公司 Distributed type task scheduling system
CN106886450A (en) * 2015-12-16 2017-06-23 阿里巴巴集团控股有限公司 Method for scheduling task and system
CN107092521A (en) * 2016-12-30 2017-08-25 北京小度信息科技有限公司 A kind of distributed task dispatching method, apparatus and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
孙岩: ""基于分布式架构的高可用定时任务调度系统的设计与实现"", 《中国优秀硕士学位论文全文数据库》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532077A (en) * 2019-08-22 2019-12-03 腾讯科技(深圳)有限公司 Task processing method, device and storage medium
CN110691120A (en) * 2019-09-10 2020-01-14 威富通科技有限公司 Timing task state detection method, server and detection system
CN110968411A (en) * 2019-12-06 2020-04-07 北京明略软件系统有限公司 Timed task scheduling method, timed task scheduling device, server and storage medium
CN111078382A (en) * 2019-12-17 2020-04-28 中国建设银行股份有限公司 Command timeout processing method and device
CN111459951A (en) * 2020-02-25 2020-07-28 深圳联友科技有限公司 Method and device for supporting cluster through timing task
CN111562971A (en) * 2020-04-09 2020-08-21 北京明略软件系统有限公司 Scheduling method and system of distributed timer
CN112416581A (en) * 2020-11-13 2021-02-26 五八同城信息技术有限公司 Distributed calling system for timed tasks
CN112416581B (en) * 2020-11-13 2022-02-18 五八同城信息技术有限公司 Distributed calling system for timed tasks
CN116344016A (en) * 2023-04-23 2023-06-27 深圳作为科技有限公司 Timing task execution method of networking nursing machine and related system
CN116344016B (en) * 2023-04-23 2024-04-26 深圳作为科技有限公司 Timing task execution method of networking nursing machine and related system

Similar Documents

Publication Publication Date Title
CN109831520A (en) A kind of timed task dispatching method and relevant apparatus
CN108287756A (en) A kind of method and device of processing task
US10365626B2 (en) Extending the functionality of a programmable logic controller (PLC) with apps without changing the PLC programming
US6529934B1 (en) Information processing system and method for same
US7139629B2 (en) Planning and scheduling for failure recovery system and method
JP2870117B2 (en) Optimal plan creation method
CN110046039A (en) Method for scheduling task and system, control centre's server and storage medium
CN101201753A (en) Method for configuring and managing multimode machine supervising engine
CN102043625A (en) Workflow operation method and system
CN109684057A (en) Task processing method, device and storage medium
CN108280150A (en) A kind of distribution asynchronous service distribution method and system
CN109408216A (en) Task creating method, device, equipment and storage medium
CN115858083A (en) Container CPU resource scheduling and isolating method and device, storage medium and electronic equipment
CN107977275A (en) Task processing method and relevant device based on message queue
CN109978380A (en) A kind of workflow processing method and device
US7451132B2 (en) System and method for production planning utilizing on-line state-space planning
US20060224431A1 (en) Data processing method, system and computer program
Adacher et al. Autonomous agents architectures and algorithms in flexible manufacturing systems
CN105227648B (en) A kind of subway comprehensive monitoring system time sequence triggering method based on time bucket
CN102214094B (en) Operation is performed via asynchronous programming model
Garrido et al. Integrating planning and scheduling
CN117149378A (en) Task scheduling method, device, equipment and medium of intelligent automobile operating system
CN113032128B (en) Multi-task control method and device, electronic equipment and storage medium
de Miguel et al. Automatic generation of simulation models for the evaluation of performance and reliability of architectures specified in UML
CN115437757A (en) Scheduling method, system, server and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190531

RJ01 Rejection of invention patent application after publication