CN108984290A - Method for scheduling task and system - Google Patents

Method for scheduling task and system Download PDF

Info

Publication number
CN108984290A
CN108984290A CN201810872439.1A CN201810872439A CN108984290A CN 108984290 A CN108984290 A CN 108984290A CN 201810872439 A CN201810872439 A CN 201810872439A CN 108984290 A CN108984290 A CN 108984290A
Authority
CN
China
Prior art keywords
task
service
unit
pending
execution unit
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.)
Granted
Application number
CN201810872439.1A
Other languages
Chinese (zh)
Other versions
CN108984290B (en
Inventor
胡彦丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JD Digital Technology Holdings Co Ltd
Jingdong Technology Holding Co Ltd
Original Assignee
Beijing Jingdong Financial Technology Holding 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 Financial Technology Holding Co Ltd filed Critical Beijing Jingdong Financial Technology Holding Co Ltd
Priority to CN201810872439.1A priority Critical patent/CN108984290B/en
Publication of CN108984290A publication Critical patent/CN108984290A/en
Application granted granted Critical
Publication of CN108984290B publication Critical patent/CN108984290B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention discloses a kind of method for scheduling task and systems, are related to field of computer technology.One specific embodiment of this method includes: to send cache unit through the first execution unit at least one pending task of user's creation to store;Wherein, the mark containing the required by task service of trigger condition and execution in each pending task;First execution unit is in the multiple tasks execution unit pre-established, and load capacity meets the task executing units of the first preset condition;Whether the trigger condition for monitoring each pending task meets;When the trigger condition of any pending task meets, the task is obtained from cache unit using the second execution unit in the multiple task executing units, and calls the service of the required by task from service rendering units to execute the task.The server cluster that the embodiment can be formed using multiple tasks execution unit carries out the storage and execution of task, to make system that can cope with the situation that high concurrent accesses.

Description

Method for scheduling task and system
Technical field
The present invention relates to field of computer technology more particularly to a kind of method for scheduling task and systems.
Background technique
In field of computer technology, task schedule (job schedule) refers to notifying or controlling one or more softwares Component executes on a preset condition based.In the prior art, there are a kind of task schedules such as Quartz (task schedule project of open source) Frame can be integrated into application system, realize preset task in the automatic execution of default triggering moment.
In the implementation of the present invention, the inventor finds that the existing technology has at least the following problems: existing task tune Degree frame is generally deployed in single machine or single machine cluster, and the accuracy of task schedule can not be kept in the case where high concurrent accesses And high availability, it is also difficult to situations such as coping with server power failure, network failure;Meanwhile in existing task schedule frame, with Do not support that hypertext transfer protocol HTTP (HyperText Transfer Protocol) etc. is logical generally when service provider interaction With access mode, this affects system performance and user experience.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method for scheduling task and system, list is executed using multiple tasks The server cluster of member composition carries out the storage and execution of task, to make system that can cope with the situation that high concurrent accesses;In addition, Appropriate person can be also selected to handle task with lifting system performance in multiple tasks execution unit.
To achieve the above object, according to an aspect of the invention, there is provided a kind of method for scheduling task.
The method for scheduling task of the embodiment of the present invention includes: to hold at least one pending task of user's creation through first Row unit is sent to cache unit and is stored;Wherein, trigger condition and the execution task institute are contained in each pending task The mark that need to be serviced;First execution unit is in the multiple tasks execution unit pre-established, and load capacity meets the first default item The task executing units of part;Whether the trigger condition for monitoring each pending task meets;In the triggering of any pending task When condition meets, the task is obtained from cache unit using the second execution unit in the multiple task executing units, and The service of the required by task is called from service rendering units to execute the task.
Optionally, the trigger condition is time trigger condition;The method further includes: it is sent out by pending task It is sent to after cache unit stored: for each pending task, being touched by the first execution unit according to the time of the task Clockwork spring part determines its following each triggering moment, and obtained each triggering moment is stored in cache unit;The monitoring Whether the trigger condition of each pending task meets, and specifically includes: whether monitoring current time is equal to each pending task Any triggering moment.
Optionally, the service rendering units are as follows: in the multiple clothes for the required by task service that can provide trigger condition satisfaction Business is provided in unit, and load capacity meets the service rendering units of the second preset condition;Each pending task further comprises Task status;The method further includes: second execution unit using in the multiple task executing units from After obtaining the task in cache unit, the task status of the task is changed to lock state;It is held in any pending task After row failure, which is continuously performed until running succeeded with predetermined period, and is continuously performing the frequency of failure equal to default It is alerted when threshold value.
Optionally, the multiple task executing units form server cluster;First preset condition are as follows: choose load capacity most Small task executing units;Second preset condition are as follows: choose the smallest service rendering units of load capacity;In each pending task It further comprise at least one of following information: task identification, task type, mission mode, alarm mode, service call side Formula, service call interface name or service call URL;Wherein, service call mode includes that HTTP pulls mode, the push side HTTP Formula or Socket access mode.
To achieve the above object, according to another aspect of the present invention, a kind of task scheduling system is provided.
The task scheduling system of the embodiment of the present invention can include: task creation unit, for storing user's creation at least One pending task;Wherein, the mark containing the required by task service of trigger condition and execution in each pending task;Clothes Business governance unit, in the multiple tasks execution unit pre-established, load capacity to be met to the task of the first preset condition Execution unit is determined as the first execution unit;And cache unit is sent through the first execution unit by the pending task and is carried out Storage;Multiple tasks execution unit including the second execution unit, for monitor each pending task trigger condition whether Meet;Wherein, the second execution unit is used for when monitoring that the trigger condition of any pending task meets, from cache unit The task is obtained, and calls the service of the required by task from service rendering units to execute the task.
Optionally, the trigger condition is time trigger condition;First execution unit can be further used for: will it is described to Execution task is sent to after cache unit stored, and determines its future according to the time trigger condition of each pending task Each triggering moment, and obtained each triggering moment is stored in cache unit;The multiple task executing units can be into One step is used for: whether monitoring current time is equal to any triggering moment of each pending task.
Optionally, each pending task further comprises task status;Second execution unit can be further used for: It is described after obtaining the task in cache unit, the task status of the task is changed to lock state;Any pending After task execution failure, which is continuously performed until running succeeded with predetermined period, and continuously performing frequency of failure etc. It is alerted when preset threshold.
Optionally, service governance unit can be further used for: can provide the required by task service of trigger condition satisfaction In multiple service rendering units, the service rendering units that load capacity meets the second preset condition are determined as the second execution unit tune The corresponding service rendering units of service;The system can further comprise Database Unit, described pending for storing The triggering moment of task and each pending task.
Optionally, the multiple task executing units form server cluster;First preset condition are as follows: choose load capacity most Small task executing units;Second preset condition are as follows: choose the smallest service rendering units of load capacity;Each pending task into One step includes at least one of following information: task identification, task type, mission mode, alarm mode, service call side Formula, service call interface name or service call URL;Wherein, service call mode includes: the service governance unit interface side of pulling Formula, service governance unit interface push mode, HTTP pull mode, HTTP push mode or Socket access mode.
To achieve the above object, in accordance with a further aspect of the present invention, a kind of computer readable storage medium is provided.
A kind of computer readable storage medium of the invention, is stored thereon with computer program, described program is by processor Method for scheduling task provided by the present invention is realized when execution.
According to the technique and scheme of the present invention, one embodiment in foregoing invention has the following advantages that or the utility model has the advantages that leads to It crosses to establish by server cluster that multiple tasks execution unit forms and stores and execute task, access system can in high concurrent In the case where keep high reliability and high availability, while situations such as server power failure, network failure can also be coped with;Pass through service The load balancing of governance unit can select the lesser task executing units of load capacity and service rendering units to handle and appoint Business, to avoid causing system risk;For the ease for use of lifting system, the task scheduling system of the embodiment of the present invention with clothes Business supports the general-purpose accessings modes such as http protocol when providing unit interaction;In addition, existing task schedule frame is often because of data The limitation of library inquiry bottleneck is difficult to largely concurrently obtain mission bit stream, and in response to this problem, the present invention is using database purchase task While information, using high-performance cache unit store tasks information, thus lifting system performance and user experience.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the key step schematic diagram of middle method for scheduling task according to embodiments of the present invention;
Fig. 2 is the configuration diagram of middle service governance unit according to embodiments of the present invention;
Fig. 3 is the specific execution step schematic diagram of middle method for scheduling task according to a first embodiment of the present invention;
Fig. 4 is the component part schematic diagram of middle task scheduling system according to embodiments of the present invention.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
It should be pointed out that in the absence of conflict, the technical characteristic in the embodiment of the present invention and embodiment can To be combined with each other.
Fig. 1 is the key step schematic diagram of middle method for scheduling task according to embodiments of the present invention.
As shown in Figure 1, the method for scheduling task of the embodiment of the present invention can be executed specifically in accordance with the following steps:
Step S101: by user creation at least one pending task through the first execution unit be sent to cache unit into Row storage;Wherein, the mark containing the required by task service of trigger condition and execution in each pending task;First executes list Member is in the multiple tasks execution unit pre-established, and load capacity meets the task executing units of the first preset condition.
In this step, task refers to the deliberate action dependent on certain trigger mechanism and some component software.For example, Document progress, which is automatically saved, when monthly No. 25 credits card are refunded automatically, user issues shutdown command belongs to above-mentioned task.Wherein, Trigger mechanism can be realized by time trigger condition, action triggers condition etc..For example, " monthly No. 25 " in above-mentioned example are i.e. For time trigger condition, " user issues shutdown command " is action triggers condition.For time trigger condition, in practical application In, the time trigger condition of natural language description can be converted to temporal expression by system, and then be calculated according to temporal expression Following each triggering moment out.Illustratively, temporal expression can (Cron be that the timing under Linux is held for Cron expression formula Row tool, Linux are a kind of open source operating systems).
In embodiments of the present invention, the task creation unit that can provide a user page end, makes user that can create one herein A or multiple pending tasks.Generally, each pending task may be configured with multiple-task information, such as task identification, Task status, trigger condition, the mark for executing the required by task service, task type, mission mode, alarm mode, service are adjusted With mode, service call interface name or service call uniform resource position mark URL (Uniform Resource Locator) And task inherent parameters.
Wherein, each task has unique task identification, for other assessment of tasks, often to appoint in concrete application Business name is referred to as task identification;The option of task status has lock state and non-locking state, wherein task, which is performed, to be in Lock state is in non-locking state when task is not performed or is released;Trigger condition is used to embody the trigger mechanism of task, It can be time trigger condition or action triggers condition;The mark of required by task service can be the title of the service, be used for The service is determined in service invocation procedure;The option of task type has single machine task, distributed task scheduling etc., appoints for characterizing to execute The main body of business is a server or distributed system;The option of mission mode has and can concurrently execute, can not concurrently execute;It accuses Police's formula may be selected to be short message alarm or mail alarm, further comprise corresponding transmission short message address or email address;Appoint Business inherent parameters are parameter informations relevant to specific business.
Particularly, any pending service can also configure service call mode and service call interface name or service is adjusted Use URL.Specifically, service call mode may be selected to be: HTTP pulls mode, HTTP push mode or socket Socket and visits Ask mode.Wherein, it is pulled in mode in HTTP, task executing units (will be described hereinafter) call service according to http protocol There is provided unit (will be described hereinafter) relevant interface to realize service call;In HTTP push mode, service rendering units Relevant interface according to http protocol access task executing units is to realize service call;In Socket access mode, task The Internet protocol IP address (Internet Protocol) and port that execution unit is bound by service rendering units Socket It number is communicated with service rendering units to call service.Obviously, if service call mode is that HTTP pulls mode, task execution list Member need to obtain the URL of service rendering units;If service call mode is that HTTP pushes mode, service rendering units need to be appointed The URL of business execution unit;If service call mode is Socket access mode, task executing units need to obtain service and provide list The IP address and port numbers of first Socket binding.It is appreciated that supporting http protocol that can promote the ease for use of task scheduling system.
In addition, service call mode also may be selected to be: service governance unit interface pulls mode or service governance unit Interface pushes mode.Both modes all rely on service governance unit.In embodiments of the present invention, service governance unit refers to It is for realizing the distribution of remote procedure call protocol RPC (Remote Procedure Call Protocol) invocation scheme Service framework.Generally, service governance unit provides service-oriented architecture (Service Oriented Architecture) the service resolution of level.In concrete application, service governance unit can be such that service provider and service adjusts With side's directly interaction to realize service call, also service registration and service call side of the offer registration center for service provider Service discovery, provide monitoring center for statistical fractals call number and allocating time.
It is a kind of service governance unit framework can be as shown in Figure 2.In Fig. 2, following steps are can be performed in service call process:
Step S201: service container starting loads simultaneously operation service provider.
Step S202: the service oneself provided is registered in service provider starting to registration center.
Step S203: the starting of service call side, the service needed for subscribing to oneself to registration center.
Step S204: registration center returns to the address list of service provider to service call side.If address above mentioned List has altered, and the address list after change will be pushed to service call side based on long connection by registration center.
Step S205: service call side is based on soft load-balancing algorithm, selects a service to mention from address above mentioned list Supplier is called.If malloc failure malloc, another service provider of replacement continues to call.
Step S206: service provider and service called side count call number and allocating time, and timing in memory It is sent to monitoring center.
In practical application, service governance unit provides across programming language calling, data compression, black and white lists, clothes toward contact The functions such as provider's Dynamic Packet of being engaged in.Illustratively, it is (a kind of to can be Dubbo for the service governance unit in practical application scene Open source service framework), it is also possible to independently developed service framework with the above function.
Preferably, in embodiments of the present invention, realizing task executing units and service using above-mentioned service governance unit Service call between unit is provided.In this interactive process, service rendering units are as service provider, task executing units As service call side, the optional service governance unit interface of service call mode pulls mode or service governance unit interface pushes away Send mode.It is pulled in mode in service governance unit interface, task executing units actively call service the dedicated of governance unit to connect Mouth pulling data;In service governance unit interface push mode, service governance unit is based on its special purpose interface to task execution Unit propelling data.Generally, in above-mentioned service call mode, need to predefine the special purpose interface of service governance unit Title.
In step s101, task creation unit is after the pending task of storage user's creation, by pending task It is sent to service governance unit, service governance unit determines suitable task executing units, and sends this for pending task Task executing units.In the process, task creation unit is provided as service call side, task executing units as service Side.Particularly, task executing units are the servers for storing, executing task.In embodiments of the present invention, it can be preset Multiple tasks execution unit forms server cluster to be responsible for the storage of task and specific execution, to make system can be in high concurrent Situations such as keeping high reliability and high availability in the case where access, while server power failure, network failure can also be coped with.
In concrete application, service governance unit chooses load capacity in multiple tasks execution unit and meets the first preset condition Person is sent to the first execution unit as the first execution unit, by pending task.Wherein, load capacity can be according to each task Execution unit current access request processing quantity, service call quantity or central processor CPU (Central Processing Unit), memory, disk utilization power determine.First preset condition, which can be, " it is minimum to choose load capacity Task executing units ".In this way, by the above-mentioned load balancing of service governance unit, the present invention can select load capacity The smallest task executing units store and execute task, to avoid causing system risk.It is understood that first is default Condition can need flexible setting according to business, however it is not limited to above content.
After receiving pending task, the first execution unit is sent to cache unit and Database Unit carries out Storage.Preferably, cache unit can be cache server, Database Unit can be database server.In order to improve number According to readwrite performance, cache unit and Database Unit server cluster can be used to carry out store tasks.Later, the first execution unit The corresponding temporal expression of time trigger condition of each pending task can be converted to message, issued in message queue, and The message is consumed after (such as one second) after length when preset shorter, is calculated according to the temporal expression in the message wait hold Each triggering moment in row task future, and obtained triggering moment is stored in cache unit and Database Unit.Specific In application scenarios, cache unit and Database Unit can store each triggering moment and its corresponding according to chronological order Mission bit stream, this facilitates the accuracy for promoting execution task.It is appreciated that realizing task triggering moment using message queue Asynchronous computing can be with lifting system response performance and user experience.
Step S102: whether the trigger condition of each pending task of monitoring meets;In the triggering of any pending task When condition meets, the task is obtained from cache unit using the second execution unit in multiple tasks execution unit, and from clothes Business provides in unit and calls the service of the required by task to execute the task.
In this step, when whether task executing units monitoring current time is equal to any triggering of each pending task It carves.When the triggering moment for monitoring a certain task reaches, all task executing units can be attempted to pull from cache unit The task, pulling successful task executing units at first is the second execution unit.In general, the second execution unit can be Above-mentioned first execution unit.After second execution unit pulls the task, its task status is changed to lock state, is thus avoided The task is repeated by other task executing units.It is understood that before the second execution unit change task status, it should The task status of task is non-locking state.
After second execution unit pulls Mission Success, the service of the required by task can be called from service rendering units To execute the task.Obviously, the second execution unit can determine required service according to the service identifiers configured in task.Actually answer In, there are multiple service rendering units that can provide respective service can therefrom choose more appropriate for lifting system performance Service rendering units come call service.Based on above-mentioned consideration, load capacity is chosen using service governance unit and meets second in advance If the service rendering units of condition.Wherein, the second preset condition can be configured according to application environment, such as be set as " choosing negative The smallest service rendering units of carrying capacity ".In this way, the load balancing that the present invention can be provided by service governance unit, is realized The Rational choice of service rendering units, to avoid causing system risk.
In addition, as a preferred embodiment, the second execution unit, can be by after any pending task execution failure Continuously perform the task until running succeeded according to predetermined period, and when continuously performing the frequency of failure equal to preset threshold according to The alarm mode of configuration is alerted.By above-mentioned setting, it can be ensured that system will not omit each pending task.In addition, being The accuracy for guaranteeing task execution sequence realizes the clock mechanisms of high-precision, High Availabitity in task executing units, can be with milli Second is the triggering moment that unit monitors task.
Fig. 3 is the specific execution step schematic diagram of middle method for scheduling task according to a first embodiment of the present invention.Such as Fig. 3 institute Show, steps are as follows for the specific execution of method for scheduling task:
Step S301: task creation unit stores the pending task of user's creation.
Step S302: pending task is sent service governance unit by task creation unit.
Step S303: service governance unit determines the first execution unit from task executing units.Generally, it first executes Unit is the wherein the smallest task executing units of load capacity.
Step S304: pending task is sent the first execution unit by service governance unit.
Pending task is sent cache unit by the S305: the first execution unit of step and Database Unit stores.
The S306: the first execution unit of step turns the temporal expression obtained according to the time trigger condition of pending task It is changed to message.This step can realize the asynchronous computings of task triggering moment.
The S307: the first execution unit of step is by the news release being converted to message queue.
The S308: the first execution unit of step consumes the message from message queue.
The S309: the first execution unit of step calculates each triggering of pending task using the temporal expression in the message Moment.
Obtained triggering moment is stored in cache unit and Database Unit by the S310: the first execution unit of step.By Above step completes pending task in the storage of cache unit and Database Unit.
Step S311: task executing units monitor the triggering moment of pending task.
Step S312: task executing units judge whether current time is equal to triggering moment: if so, performing the next step rapid; Otherwise previous step is returned.
Step S313: when monitoring that triggering moment reaches, the second execution unit obtains corresponding task from cache unit.
Task status is changed to lock state by the S314: the second execution unit of step, is performed a plurality of times to avoid task.
The S315: the second execution unit of step determines suitable service rendering units to call task by servicing governance unit Required service.Generally, which is the smallest service rendering units of load capacity.
The S316: the second execution unit of step is according to the service execution task of calling, to complete the entire stream of task schedule Journey.
In the technical solution of the embodiment of the present invention, can establish the server cluster that is made of multiple tasks execution unit Lai Storage and the task of execution, thus make system that can keep high reliability and high availability in the case where high concurrent accesses, while Situations such as server power failure, network failure can be coped with.Except, by servicing the load balancing of governance unit, can select The lesser task executing units of load capacity and service rendering units handle task, to avoid causing system risk.
It should be noted that for the various method embodiments described above, for ease of description, being stated that a series of dynamic It combines, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described, certain steps In fact it can be carried out using other sequences or be carried out simultaneously.In addition, those skilled in the art should also know that, in specification Described embodiment belongs to preferred embodiment, and related actions and modules not necessarily realizes that institute of the invention is necessary 's.
For the above scheme convenient for the better implementation embodiment of the present invention, phase for implementing the above scheme is also provided below Relationship system.
It please refers to shown in Fig. 3, a kind of task scheduling system 400 provided in an embodiment of the present invention may include: task creation Unit 401, service governance unit 402, the server cluster 407 being made of multiple tasks execution unit 403,404,405,406, Cache unit 408 and Database Unit 409.It is appreciated that four task executing units in server cluster 407 are only to show , can according to need setting in practical application has the server cluster of task executing units of various quantity.
Specifically, task creation unit 401 can be used for storing at least one pending task of user's creation;Wherein, often Mark containing the required by task service of trigger condition and execution in one pending task.
Service governance unit 402 can be used in the multiple tasks execution unit pre-established, and load capacity is met first The task executing units of preset condition are determined as the first execution unit;And the pending task is sent through the first execution unit It is stored to cache unit 408.
Multiple tasks execution unit 403,404,405,406, for monitor each pending task trigger condition whether Meet;Wherein, the second execution unit is used for when monitoring that the trigger condition of any pending task meets, from cache unit The task is obtained in 408, and calls the service of the required by task from service rendering units 410 to execute the task.
As a preferred embodiment, the trigger condition is time trigger condition.First execution unit can be further used for: After sending the pending task to cache unit 408 and being stored, according to the time trigger of each pending task Condition determines its following each triggering moment, and obtained each triggering moment is stored in cache unit 408.It is the multiple Task executing units 403,404,405,406 can be further used for: whether monitoring current time is equal to each pending task Any triggering moment.
Preferably, in embodiments of the present invention, each pending task further comprises task status.Second executes list Member can be further used for: described after obtaining the task in cache unit 408, the task status of the task be changed to lock Determine state;After any pending task execution failure, which is continuously performed until running succeeded with predetermined period, and Alarm when continuously performing the frequency of failure equal to preset threshold.
In concrete application, service governance unit 402 can be further used for: in the required by task that can provide trigger condition satisfaction In multiple service rendering units of service, the service rendering units 410 that load capacity meets the second preset condition are determined as second The corresponding service rendering units of service that execution unit calls.Database Unit 409 can be used for storing the pending task and The triggering moment of each pending task.
In addition, in embodiments of the present invention, the first preset condition are as follows: choose the smallest task executing units of load capacity;The Two preset conditions are as follows: choose the smallest service rendering units of load capacity;Each pending task further comprises in following information At least one: task identification, task type, mission mode, alarm mode, service call mode, service call interface name Or service call URL;Wherein, service call mode includes: that service governance unit interface pulls mode, service governance unit interface Push mode, HTTP pull mode, HTTP push mode or Socket access mode.
In the technical solution of the embodiment of the present invention, can establish the server cluster that is made of multiple tasks execution unit Lai Storage and the task of execution, thus make system that can keep high reliability and high availability in the case where high concurrent accesses, while Situations such as server power failure, network failure can be coped with.Except, by servicing the load balancing of governance unit, can select The lesser task executing units of load capacity and service rendering units handle task, to avoid causing system risk.
In addition, the computer-readable medium can be above-mentioned implementation the present invention also provides a kind of computer-readable medium Included in task scheduling system described in example.Above-mentioned computer-readable medium carries one or more program, when When said one or multiple programs are executed by the equipment, so that the equipment includes: to create user at least the step of execution One pending task is sent to cache unit through the first execution unit and is stored;Wherein, contain in each pending task Trigger condition and the mark for executing the required by task service;First execution unit is the multiple tasks execution unit pre-established In, load capacity meets the task executing units of the first preset condition;Whether the trigger condition for monitoring each pending task meets; When the trigger condition of any pending task meets, postponed using the second execution unit in the multiple task executing units The task is obtained in memory cell, and calls the service of the required by task from service rendering units to execute the task.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (10)

1. a kind of method for scheduling task characterized by comprising
Cache unit is sent through the first execution unit at least one pending task that user creates to store;Wherein, Mark containing the required by task service of trigger condition and execution in each pending task;First execution unit is to pre-establish Multiple tasks execution unit in, load capacity meets the task executing units of the first preset condition;
Whether the trigger condition for monitoring each pending task meets;When the trigger condition of any pending task meets, benefit The task is obtained from cache unit with the second execution unit in the multiple task executing units, and from service rendering units The middle service for calling the required by task is to execute the task.
2. the method according to claim 1, wherein the trigger condition is time trigger condition;The method Further comprise:
After sending pending task to cache unit and being stored: being directed to each pending task, execute list by first Member determines its following each triggering moment according to the time trigger condition of the task, and obtained each triggering moment is stored In cache unit;And
Whether the trigger condition of each pending task of monitoring meets, and specifically include: whether monitoring current time is equal to often Any triggering moment of one pending task.
3. the method according to claim 1, wherein the service rendering units are as follows: can provide trigger condition In multiple service rendering units of the required by task service of satisfaction, load capacity meets the service rendering units of the second preset condition; Each pending task further comprises task status;And
The method further includes: it postpones deposit receipt in second execution unit using in the multiple task executing units After obtaining the task in member, the task status of the task is changed to lock state;Fail in any pending task execution Later, which is continuously performed until running succeeded with predetermined period, and when continuously performing the frequency of failure equal to preset threshold Alarm.
4. according to the method described in claim 3, it is characterized in that,
The multiple task executing units form server cluster;
First preset condition are as follows: choose the smallest task executing units of load capacity;
Second preset condition are as follows: choose the smallest service rendering units of load capacity;
Each pending task further comprises at least one of following information: task identification, task type, task mould Formula, alarm mode, service call mode, service call interface name or service call URL;Wherein, service call mode includes HTTP pulls mode, HTTP push mode or Socket access mode.
5. a kind of task scheduling system characterized by comprising
Task creation unit, for storing at least one pending task of user's creation;Wherein, contain in each pending task There is trigger condition and executes the mark of the required by task service;
Governance unit is serviced, in the multiple tasks execution unit pre-established, load capacity to be met the first preset condition Task executing units be determined as the first execution unit;And caching list is sent through the first execution unit by the pending task Member is stored;And
Whether the multiple tasks execution unit including the second execution unit, the trigger condition for monitoring each pending task are full Foot;Wherein, the second execution unit is used for when monitoring that the trigger condition of any pending task meets, and is obtained from cache unit The task is taken, and calls the service of the required by task from service rendering units to execute the task.
6. system according to claim 5, which is characterized in that the trigger condition is time trigger condition;First executes Unit is further used for:
After sending the pending task to cache unit and being stored, according to the time trigger of each pending task Condition determines its following each triggering moment, and obtained each triggering moment is stored in cache unit;And
The multiple task executing units are further used for: whether monitoring current time is equal to any touching of each pending task Send out the moment.
7. system according to claim 5, which is characterized in that each pending task further comprises task status; And second execution unit be further used for:
Described after obtaining the task in cache unit, the task status of the task is changed to lock state;Any After pending task execution failure, which is continuously performed until running succeeded with predetermined period, and continuously performing failure Number alerts when being equal to preset threshold.
8. system according to claim 6, which is characterized in that
Service governance unit is further used for: providing in the multiple services for the required by task service that can provide trigger condition satisfaction single In member, the service that the service rendering units that load capacity meets the second preset condition are determined as the second execution unit calling is corresponding Service rendering units;And
The system further comprises Database Unit, for storing the triggering of the pending task and each pending task Moment.
9. system according to claim 8, which is characterized in that
The multiple task executing units form server cluster;
First preset condition are as follows: choose the smallest task executing units of load capacity;
Second preset condition are as follows: choose the smallest service rendering units of load capacity;
Each pending task further comprises at least one of following information: task identification, task type, mission mode, Alarm mode, service call mode, service call interface name or service call URL;Wherein, service call mode includes: clothes Business governance unit interface pulls mode, service governance unit interface push mode, HTTP pull mode, HTTP push mode or Socket access mode.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that described program is processed The method as described in any in claim 1-4 is realized when device executes.
CN201810872439.1A 2018-08-02 2018-08-02 Task scheduling method and system Active CN108984290B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810872439.1A CN108984290B (en) 2018-08-02 2018-08-02 Task scheduling method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810872439.1A CN108984290B (en) 2018-08-02 2018-08-02 Task scheduling method and system

Publications (2)

Publication Number Publication Date
CN108984290A true CN108984290A (en) 2018-12-11
CN108984290B CN108984290B (en) 2021-03-30

Family

ID=64554409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810872439.1A Active CN108984290B (en) 2018-08-02 2018-08-02 Task scheduling method and system

Country Status (1)

Country Link
CN (1) CN108984290B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110018893A (en) * 2019-03-12 2019-07-16 平安普惠企业管理有限公司 A kind of method for scheduling task and relevant device based on data processing
CN110225082A (en) * 2019-04-30 2019-09-10 北京奇艺世纪科技有限公司 Task processing method, device, electronic equipment and computer-readable medium
CN111767125A (en) * 2020-06-15 2020-10-13 杭州数梦工场科技有限公司 Task execution method and device, electronic equipment and storage medium
CN113760491A (en) * 2020-10-30 2021-12-07 北京沃东天骏信息技术有限公司 Task scheduling system, method, equipment and storage medium
CN117933949A (en) * 2024-03-22 2024-04-26 广东电网有限责任公司中山供电局 Execution method, device, storage medium and processor for power-supply-protection electric sheet

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106569878A (en) * 2015-10-08 2017-04-19 北京奇虎科技有限公司 Distributed timing task management method and system
EP3226173A1 (en) * 2016-03-30 2017-10-04 Fujitsu Limited Task circumstance processing device and method
CN107657155A (en) * 2016-07-26 2018-02-02 北京京东尚科信息技术有限公司 Method and apparatus for identifying user's operating right
US20180107508A1 (en) * 2016-10-18 2018-04-19 International Business Machines Corporation Resource allocation for tasks of unknown complexity
CN108132833A (en) * 2017-12-08 2018-06-08 广州视源电子科技股份有限公司 Distributed timing task scheduling method and device based on zookeeper technology

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106569878A (en) * 2015-10-08 2017-04-19 北京奇虎科技有限公司 Distributed timing task management method and system
EP3226173A1 (en) * 2016-03-30 2017-10-04 Fujitsu Limited Task circumstance processing device and method
CN107657155A (en) * 2016-07-26 2018-02-02 北京京东尚科信息技术有限公司 Method and apparatus for identifying user's operating right
US20180107508A1 (en) * 2016-10-18 2018-04-19 International Business Machines Corporation Resource allocation for tasks of unknown complexity
CN108132833A (en) * 2017-12-08 2018-06-08 广州视源电子科技股份有限公司 Distributed timing task scheduling method and device based on zookeeper technology

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110018893A (en) * 2019-03-12 2019-07-16 平安普惠企业管理有限公司 A kind of method for scheduling task and relevant device based on data processing
WO2020181813A1 (en) * 2019-03-12 2020-09-17 平安普惠企业管理有限公司 Task scheduling method based on data processing and related device
CN110018893B (en) * 2019-03-12 2024-08-16 河北和熙网络科技有限公司 Task scheduling method based on data processing and related equipment
CN110225082A (en) * 2019-04-30 2019-09-10 北京奇艺世纪科技有限公司 Task processing method, device, electronic equipment and computer-readable medium
CN110225082B (en) * 2019-04-30 2021-12-10 北京奇艺世纪科技有限公司 Task processing method and device, electronic equipment and computer readable medium
CN111767125A (en) * 2020-06-15 2020-10-13 杭州数梦工场科技有限公司 Task execution method and device, electronic equipment and storage medium
CN111767125B (en) * 2020-06-15 2023-07-25 杭州数梦工场科技有限公司 Task execution method, device, electronic equipment and storage medium
CN113760491A (en) * 2020-10-30 2021-12-07 北京沃东天骏信息技术有限公司 Task scheduling system, method, equipment and storage medium
CN117933949A (en) * 2024-03-22 2024-04-26 广东电网有限责任公司中山供电局 Execution method, device, storage medium and processor for power-supply-protection electric sheet

Also Published As

Publication number Publication date
CN108984290B (en) 2021-03-30

Similar Documents

Publication Publication Date Title
CN108984290A (en) Method for scheduling task and system
CN112162865B (en) Scheduling method and device of server and server
CN105190555B (en) Centralized task schedule
US8700413B2 (en) Web services registration for dynamic composition of web services
CN103927225B (en) A kind of internet information processing optimization method of multi-core framework
US10673969B2 (en) Scalable data feed system
CN108449410A (en) Information management method, system and relevant apparatus in a kind of cloud platform
CN111338791A (en) Method, device and equipment for scheduling cluster queue resources and storage medium
GB2532834A (en) A method and system for scalable job processing
US9104488B2 (en) Support server for redirecting task results to a wake-up server
CN116541134B (en) Method and device for deploying containers in multi-architecture cluster
US11228658B1 (en) Pre-caching data for use upon execution of program code
WO2021159831A1 (en) Programming platform user code running method, platform, node, device and medium
US10908963B2 (en) Deterministic real time business application processing in a service-oriented architecture
CN112199353A (en) Data processing method and electric power customer service platform
US20160019089A1 (en) Method and system for scheduling computing
US8694462B2 (en) Scale-out system to acquire event data
CN114615340A (en) Request processing method and device, computer equipment and storage device
CN112948088A (en) Cloud workflow intelligent management and scheduling system in cloud computing platform
CN111625344B (en) Resource scheduling system, method and device in application system
CN111488373A (en) Method and system for processing request
CN113190624A (en) Asynchronous-to-synchronous calling method and device based on distributed cross-container
CN113238875A (en) Queue-based request frequency control system and control method
CN112380040A (en) Message processing method and device, electronic equipment and storage medium
CN111444001A (en) Cloud platform task scheduling method and system

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
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee after: Jingdong Technology Holding Co.,Ltd.

Address before: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee before: Jingdong Digital Technology Holding Co.,Ltd.

Address after: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee after: Jingdong Digital Technology Holding Co.,Ltd.

Address before: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

Address after: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee after: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

Address before: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee before: BEIJING JINGDONG FINANCIAL TECHNOLOGY HOLDING Co.,Ltd.