CN108710537A - A kind of task processing method, storage medium and server - Google Patents

A kind of task processing method, storage medium and server Download PDF

Info

Publication number
CN108710537A
CN108710537A CN201810309682.2A CN201810309682A CN108710537A CN 108710537 A CN108710537 A CN 108710537A CN 201810309682 A CN201810309682 A CN 201810309682A CN 108710537 A CN108710537 A CN 108710537A
Authority
CN
China
Prior art keywords
task
execution
timed
timed task
node
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
CN201810309682.2A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810309682.2A priority Critical patent/CN108710537A/en
Priority to PCT/CN2018/097096 priority patent/WO2019196250A1/en
Publication of CN108710537A publication Critical patent/CN108710537A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • 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

Abstract

The present invention provides a kind of task processing method, storage medium and servers, including:Obtain the timed task file packet that user uploads from user interface;The timed task file packet is scanned, the timed task in the timed task file packet is obtained;Obtain the execution information of the timed task;When the timed task starts, the timed task is distributed to task execution node corresponding with the execution information according to the execution information, so that timed task described in the task execution node load and execution.Timed task of the present invention independently of executing program, timed task execute will not the failure of coverlet point server influence, in more new task without redeploying program, the efficiency of exploitation can be improved in the efficiency for improving task execution while.

Description

A kind of task processing method, storage medium and server
Technical field
The present invention relates to a kind of technical field of information processing more particularly to task processing method, storage medium and servers.
Background technology
In the application system using Java, usually realize that timed task passes through two ways:It is opened one is Java is used It sends out included timer (Timer) tool of tool set (Java Development Kit, JDK) and realizes that another kind is that use is opened The Quartz timed task frames for putting source code tissue (opensymphony) are realized.Timer included JDK can realize most simple Timed task, task (Task) class state is checked with regular time interval, can thus be repeated by specified Time and number is repeated to trigger specified Task classes.Quartz can realize fairly perfect timed task, using more A sub-line journey executes specified Jab classes, as long as the operation of developer realizes Jab classes, can be used in configuration file Cron expression formulas refer to the triggered time of timed task.However, above two realizes that the mode of timed task needs when in use In the triggered time of hard coded assignment, per subtask, update is required for redeploying program, takes a substantial amount of time, causes out Send out inefficiency.
Invention content
An embodiment of the present invention provides a kind of task processing method, storage medium and servers, are appointed with solving existing timing The mode of business needs the triggered time of hard coded assignment when in use, and per subtask, update is required for redeploying program, It takes a substantial amount of time, leads to the problem that development efficiency is low.
The first aspect of the embodiment of the present invention provides a kind of task processing method, including:
Obtain the timed task file packet that user uploads from user interface;
The timed task file packet is scanned, the timed task in the timed task file packet is obtained;
Obtain the execution information of the timed task;
When the timed task starts, the timed task is distributed to described according to the execution information and executes letter Corresponding task execution node is ceased, so that timed task described in the task execution node load and execution.
The second aspect of the embodiment of the present invention provides a kind of server, including memory and processor, the storage Device is stored with the computer program that can be run on the processor, and the processor is realized such as when executing the computer program Lower step:
Obtain the timed task file packet that user uploads from user interface;
The timed task file packet is scanned, the timed task in the timed task file packet is obtained;
Obtain the execution information of the timed task;
When the timed task starts, the timed task is distributed to described according to the execution information and executes letter Corresponding task execution node is ceased, so that timed task described in the task execution node load and execution.
The third aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, the computer program to realize following steps when being executed by processor:
Obtain the timed task file packet that user uploads from user interface;
The timed task file packet is scanned, the timed task in the timed task file packet is obtained;
Obtain the execution information of the timed task;
When the timed task starts, the timed task is distributed to described according to the execution information and executes letter Corresponding task execution node is ceased, so that timed task described in the task execution node load and execution.
In the embodiment of the present invention, the timed task file packet uploaded from user interface by obtaining user scans institute Timed task file packet is stated, obtains the timed task in the timed task file packet, timed task is independently of program is executed, mutually It does not influence, then obtains the execution information of the timed task, when the timed task starts, according to the execution information by institute It states timed task to distribute to task execution node corresponding with the execution information, so that task execution node load is held The row timed task, this programme use distributed deployment, timed task execute will not the failure of coverlet point server influence, In more new task without redeploying program, the efficiency of exploitation can be improved in the efficiency for improving task execution while.
Description of the drawings
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description be only the present invention some Embodiment for those of ordinary skill in the art without having to pay creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is the implementation flow chart of task processing method provided in an embodiment of the present invention;
When Fig. 2 is that execution information includes the realization language of timed task in task processing method provided in an embodiment of the present invention The specific implementation flow chart of S104;
Fig. 3 is the specific of S104 when execution information includes performance requirement in task processing method provided in an embodiment of the present invention Implementation flow chart;
When Fig. 4 is that execution information includes specified task execution node in task processing method provided in an embodiment of the present invention The specific implementation flow chart of S104;
Fig. 5 is that execution information includes triggering timing times when task relies in task processing method provided in an embodiment of the present invention The specific implementation flow chart that business starts;
Fig. 6 is the implementation flow chart for the task processing method that another embodiment of the present invention provides;
Fig. 7 is the structure diagram of Task Processing Unit provided in an embodiment of the present invention;
Fig. 7 .1 are the structure diagrams of another Task Processing Unit provided in an embodiment of the present invention;
Fig. 8 is the schematic diagram of server provided in an embodiment of the present invention.
Specific implementation mode
In order to make the invention's purpose, features and advantages of the invention more obvious and easy to understand, below in conjunction with the present invention Attached drawing in embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that disclosed below Embodiment be only a part of the embodiment of the present invention, and not all embodiment.Based on the embodiments of the present invention, this field All other embodiment that those of ordinary skill is obtained without making creative work, belongs to protection of the present invention Range.
Fig. 1 shows that the implementation process of task processing method provided in an embodiment of the present invention, this method flow include step S101 to S104.The specific implementation principle of each step is as follows:
S101:Obtain the timed task file packet that user uploads from user interface.
Task processing method provided in an embodiment of the present invention is applied in distributed system cluster.In distributed system cluster In, entire cluster is coordinated using distributed coordination technology (ZooKeeper, ZK).In the distributed system cluster, including in Central server, task control platform and task execution node, and the distributed system cluster supports task execution node self-discovery work( Dynamic capacity-expanding can be used as.The task control platform is used to be arranged the execution information of timed task, is additionally operable to the task execution Node is monitored.The central server distributes the timed task in timed task file packet to task execution node.
Wherein, the timed task file packet includes timed task, and the timed task is compiled using computer language It writes, as generated jar packets after written in Java can be used to be packaged, other computer languages of such as Python, PHP can also be used to compile It writes, and the timed task write is packaged and generates timed task file packet, the language of writing of timed task is not limited thereto. In the embodiment of the present invention, the timed task file packet that user uploads from user interface is stored in file server, scanning The timed task file packet generates timed task.It may include more than one timed task in one timed task file packet.
In embodiments of the present invention, timed task independent timed task file packet is packaged into be grasped by user by user It is uploaded to file memory as interface, timed task is independent from task execution node, so that each timed task It is independent of each other with the server of task execution node.
S102:The timed task file packet is scanned, the timed task in the timed task file packet is obtained.
In embodiments of the present invention, the timed task file packet includes interface message, and central server passes through scanning The timed task file packet obtains interface message and generates timed task.
S103:Obtain the execution information of the timed task.
Wherein, the execution information of the timed task includes executing start the time, execute period and task parameters, can be with Including specified task execution node.Task parameters include the position of timed task file packet storage, and task parameters are appointed in timing Business file is wrapped to be automatically generated when reaching file server.In embodiments of the present invention, the execution information of the timed task can Be arranged by task control platform by user, i.e., user on the task control platform specify the timed task the execution period and The execution informations such as task execution node.
It is alternatively possible to be directly added into the execution information of the timed task when writing timed task at the beginning.
S104:When the timed task starts, according to the execution information by the timed task distribute to it is described The corresponding task execution node of execution information, so that timed task described in the task execution node load and execution.
Specifically, central server records the execution information after the execution information for obtaining the timed task.Into one Step ground starts time setting timer according to the execution in the execution information, and starts countdown, and central server divides on time With the timed task.When the timed task starts, server distributes the timed task according to the execution information To task execution node corresponding with the execution information, if the execution information includes the timed task, specified task is held Row node then directly distributes the timed task to the specified task execution node, so that the task execution section Task is executed described in point load and execution.Further, the task execution node is according to the task parameters in the execution information Obtain the position of the timed task, and timed task described in load and execution.
Optionally, in embodiments of the present invention, to avoid task execution conflict, a timing is only distributed a time point Task is to a task execution node, and therefore, timed task is being distributed to before task execution node, first obtains described specified Task execution node status information, the status information of task execution node includes idle state and busy condition, idle shape State is the task that is not carried out, and busy condition expression is carrying out task, is believed according to the state of the specified task execution node Breath judges whether the task execution node is in idle condition.If the specified task execution node is in idle condition, The timed task to be allocated is distributed to the specified task execution node and carries out load and execution.If described specified appoints Business executes node and is in busy condition, then hangs up the timed task to be allocated, until the specified task execution node Into idle state.
In embodiments of the present invention, as an embodiment of the present invention, the execution information includes the reality of timed task Existing language, Fig. 2 shows the specific implementation flows of task processing method step S104 provided in an embodiment of the present invention, are described in detail such as Under:
A1:When the timed task starts, the timed task is parsed, obtain the timed task writes sentence.
A2:The sentence of writing is subjected to language format matching, determines the realization language of the timed task.Specifically, Language format matching refers in preset language library lookup and the language format for writing statement matching, so that it is determined that described fixed When task realization language.
A3:According to the realization language of the timed task, the timed task is distributed to supporting the language of realizing Task execution node, so that timed task described in the task execution node load and execution.Specifically, in distributed type assemblies Task execution node all there are linguistic labels, the linguistic labels are for identifying the calculating that the task execution node is supported Machine voice.
In embodiments of the present invention, described by a variety of computer languages can be supported to realize timed task in this present embodiment Timed task is write using JAVA, Python, PHP, C language or other computer languages, therefore, if the timing is appointed The execution information of business does not include the task execution node specified, then the difference for the language that can be realized according to timed task will timing Task is distributed to different task execution nodes, and specifically, timed task is distributed to the realization language for supporting the timed task The task execution node load and execution of speech, to improve the efficiency of timed task execution.
Optionally, if support the timed task realization voice task execution node more than one, can according to appoint Business executes the priority of node or the status information of task execution node distributes the timed task.
Optionally, when task execution node is in running order, the number of the timed task of the execution, task are obtained Number include the timed task being carrying out number, further include the task execution node pending timed task Number.The priority of each task execution node is set according to the number of timed task.When the timing of described task execution node is appointed When the number of business is identical, obtains task execution node and executed the time that task enters idle state needs, it is idle according to entering The priority for the time setting task execution node that state needs.
As an embodiment of the present invention, the execution information includes performance requirement, and Fig. 3 shows the embodiment of the present invention The specific implementation flow of the task processing method S104 of offer, details are as follows:
B1:When the timed task starts, the performance information of the task execution node is obtained.The task execution section The performance information of point includes in the EMS memory occupation situation for executing node server, log recording, cpu performance and network speed One or more.Specifically, VM memory usage amounts can be monitored by jstat, alternatively, in each task execution node Cpu, the memory of server equipped with shell script timing acquisition task execution nodes, the performance informations such as hard disk.
B2:According to the performance information of the task execution node, the performance of the task execution node, and will be described Task execution node sorts from high to low by performance.
B3:According to performance requirement and the task execution section to sort from high to low by performance in the execution information Point distributes the timed task to the task execution node for meeting the performance requirement, so that the task execution node adds It carries and executes the timed task.If for example, the execution information includes the requirement to running memory, check current assignable The arranging situation of the EMS memory occupation of task execution node from high to low distributes timed task to meeting wanting for the running memory The task execution node load and execution asked.If the execution information includes wanting for requirement to running memory and network speed It asks, then holds the task that timed task is distributed to the requirement for meeting the running memory and the requirement that meets the network speed Row node load and execution.
In embodiments of the present invention, according to the performance requirement of task execution node, being closed in the execution information of timed task Reason distributes the timed task, to improve the efficiency of timed task execution.
As an embodiment of the present invention, the execution information includes specified task execution node, and Fig. 4 shows this The specific implementation flow for the task processing method S104 that inventive embodiments provide, details are as follows:
C1:When the timed task starts, judge whether the specified task execution node is held with timed task Row permission.
C2:If the specified task execution node, which has timed task, executes permission, the timed task is distributed Node is executed to the specified timed task.
C3:If the specified task execution node, which does not have timed task, executes permission, by the timed task point It is assigned to and has the task execution node that timed task executes permission and is in idle condition.
By judging whether the specified task execution node of the timed task there is timed task to execute permission, then determine Whether timed task is distributed to the specified task execution node, to avoid distribution from failing, lead to task executes effect Rate reduces.
Specifically, each timed task is to stay process forever, and to specified time point, each timed task executes node according to identical Path naming rule identical routing information is written to Zookeeper cluster applications, obtain the task execution node of write-in power The task that the task execution node for obtaining task execution permission, executing timed task, and do not obtain write-in power does not obtain then is held Row permission can only be abandoned executing timed task, wait until that next specified time point, each timed task execution node repeat above-mentioned Operation.When timed task starts, the task execution node that permission is executed to obtain timed task distributes timed task, and does not obtain The task execution node for obtaining timed task execution permission does not distribute timed task, until next preset time point, recycling It obtains timed task and executes permission.
Illustratively, task execution node applies for the identical path of write-in into cluster according to identical path naming rule Information.Path naming rule includes:According to timed task file packet name, class name and current time stamp, node path is generated. Such as:" cn.knet.timing.TcpTask " this timed task will execute for 30 minutes 15 points of April 5 in 2018 according to plan Timing calculates, then the path generated should be "/cn/knet/timing/tcptask/201008052030 ".
Optionally, when multiple timed tasks are run simultaneously, in point expeced time, only there are one timed task execution nodes to hold Row task in the case of at the same time there are multiple timed tasks to execute node, ensures only by using cluster distributed lock mechanism Execution permission can be obtained there are one task execution node, to make timed task cluster dispose and safeguard it is upper it is simpler just It is prompt.
Optionally, when task execution node processing starts execution task, the timing of opening timing task calculates.Specifically Ground, when each timed task executes timing calculating, using distributed lock mechanism, according to identical path naming rule, to cluster Interior application creates a transient node, and obtains the serial number of all establishment nodes under transient node, according to the sequence of transient node Number, judge whether to obtain and lock successfully to determine whether to execute timing calculating.The retention time is same when each task execution node starts Step.It is distinguished according to the packet name and class name to timed task, to realize that different timed tasks shares cluster.Each timing is appointed When business executes timing calculating, first according to identical path naming rule, a transient node is created to distributed type assemblies application, and All serial numbers for creating node under this node are obtained to be considered as and locked, continued to execute if the node ID of oneself is minimum Timing calculates, and calculating finishes deletion transient node;If oneself node ID is not minimum, it is considered as acquisition lock failure, deletes Transient node is cancelled this timing and is calculated.
Optionally, the execution information includes that task relies on, as shown in figure 5, task provided in an embodiment of the present invention is handled The triggering of timed task is as follows in method:
D1:It is relied on if the execution information includes task, obtains holding for other timed tasks that the timed task relies on Row information, it refers to that the triggering that the timed task executes depends on other timed tasks that the task, which relies on,.Specifically, when described Just triggering includes the timed task execution that task relies on when the execution of other timed tasks meets preset condition.
D2:Other described timed tasks are monitored according to the execution information of other timed tasks.Other described timings are appointed Business refers to the timed task in addition to the timed task relied on including task
D3:If detecting, the execution of other timed tasks meets the dependence condition that the task relies on, and triggers institute State timed task startup.The dependence condition that the task relies on can be preset.If for example, the dependence item that the task relies on Part is that other timed tasks are completed, then when detecting that other described timed tasks are completed, triggers the timed task and start.If The dependence condition that the task relies on is that other timed tasks go to half, then when detecting that other described timed tasks complete When to half, triggers the timed task and start.
In embodiments of the present invention, it is relied on by the task in the execution information of timed task and obtains the timed task The execution information of other timed tasks relied on is executed, and other described timed tasks are monitored, to trigger in time The timed task starts, avoid in advance or timed task described in delay start and cause the timed task to execute failure.
In the embodiment of the present invention, the timed task file packet uploaded from user interface by obtaining user scans institute Timed task file packet is stated, obtains the timed task in the timed task file packet, timed task is independently of program is executed, mutually It does not influence, then obtains the execution information of the timed task, when the timed task starts, according to the execution information by institute It states timed task to distribute to task execution node corresponding with the execution information, so that task execution node load is held The row timed task, this programme use distributed deployment, timed task execute will not the failure of coverlet point server influence, In more new task without redeploying program, the efficiency of exploitation can be improved in the efficiency for improving task execution while.
As an embodiment of the present invention, Fig. 6 shows provided in an embodiment of the present invention a kind of including alarm prompt Task processing method, details are as follows:
S201:Obtain the timed task file packet that user uploads from user interface.
S202:The timed task file packet is scanned, the timed task in the timed task file packet is obtained.
S203:Obtain the execution information of the timed task.
S204:When the timed task starts, according to the execution information by the timed task distribute to it is described The corresponding task execution node of execution information, so that timed task described in the task execution node load and execution.
In the present embodiment, the specific steps of step S201 to step S204 are referring to above-described embodiment step S101 to step S104, details are not described herein.
S205:The task execution daily record for the task execution nodes records for executing the timed task is obtained in real time.
Specifically, the task execution daily record includes the case where task execution node is in the task of execution.
S206:Task execution daily record described in timing scan detects the task execution node and is executing the timed task When with the presence or absence of abnormal.
Specifically, the exception includes abnormal performance of the task execution node when executing the timed task.
S207:If the task execution node has exception when executing the timed task, alarm prompt is sent.
Wherein, the form of alarm prompt includes but not limited to e-mail alert, audio alarm prompt, information alert.
Illustratively, by taking jar assignment file packets as an example, developer first realizes specified dispatching platform interface, completes work( Can exploitation, timed task is packaged into jar, jar is uploaded in user interface and completes task and submit, central server is by jar It is uploaded to file server, and scans the total interface inside jar and generates timed task.The timing is obtained from task control platform The execution information of task, including the execution period of timed task, task parameters, or specified task execution node, or even also There is the task dependence etc. of the timed task.One jar can have multiple tasks, when timed task starts, according to timing The execution information of task distributes the timed task to task execution node, and task execution node appoints timed task according to described Execution information from file server obtain jar, load the timed task.It ends task and holds when reaching in the task execution period Row.In task implementation procedure, central server obtains appointing for the task execution nodes records for executing the timed task in real time Business execution journal, logger task node executes task execution daily record when task, and timing scan task execution daily record, if described There is exception when executing the timed task in task execution node, then send alarm prompt, to solve exception in time, improve The efficiency of task processing.
In the embodiment of the present invention, the timed task file packet uploaded from user interface by obtaining user scans institute Timed task file packet is stated, obtains the timed task in the timed task file packet, timed task is independently of program is executed, mutually It does not influence, then obtains the execution information of the timed task, when the timed task starts, according to the execution information by institute It states timed task to distribute to task execution node corresponding with the execution information, so that task execution node load is held The row timed task is distributing timed task and then is obtaining the task execution node of the execution timed task in real time The task execution daily record of record, task execution daily record described in timing scan, detect the task execution node execute it is described fixed When task when with the presence or absence of abnormal, if the task execution node exists extremely when executing the timed task, send announcement Alert prompt, this programme use distributed deployment, timed task execute will not the failure of coverlet point server influence, more newly appointed It without redeploying program when business, and is monitored in the process for executing task to task execution node, is sent out when noting abnormalities Alarm prompt is sent, to solve exception in time, the efficiency of exploitation can be improved in the efficiency for improving task execution while.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
Corresponding to the task processing method described in foregoing embodiments, Fig. 7 is shown at task provided by the embodiments of the present application The structure diagram of reason device illustrates only and the relevant part of the embodiment of the present application for convenience of description.
With reference to Fig. 7, which includes:File packet acquiring unit 71, scanning element 72, information acquisition unit 73, task processing unit 74, wherein:
File packet acquiring unit 71, the timed task file packet uploaded from user interface for obtaining user;
Scanning element 72 obtains the timing in the timed task file packet for scanning the timed task file packet Task;
Information acquisition unit 73 obtains the execution information of the timed task;
Task processing unit 74 divides the timed task according to the execution information when the timed task starts It is assigned to task execution node corresponding with the execution information, so that periodically appointing described in the task execution node load and execution Business.
Optionally, the task processing unit 74 includes:
Speech analysis module obtains the timing and appoints for when the timed task starts, parsing the timed task Sentence is write in business;
Voice determining module determines the reality of the timed task for the sentence of writing to be carried out language format matching Existing language;
First task distribution module, for according to the realization language of the timed task, by the timed task distribute to The task execution node for realizing language is supported, so that timed task described in the task execution node load and execution.
Optionally, the task processing unit 74 includes:
Performance information acquisition module, for when the timed task starts, obtaining the performance of the task execution node Information;
Sorting module, for the performance information according to the task execution node, the property of the task execution node Can, and the task execution node is sorted from high to low by performance;
Second task allocating module, for pressing performance from high to low with described according to the performance requirement in the execution information The task execution node of sequence distributes the timed task to the task execution node for meeting the performance requirement, so that institute State timed task described in task execution node load and execution.
Optionally, the task processing unit 74 includes:
Permission detection module, for when the timed task starts, whether judging the specified task execution node Permission is executed with timed task;
Third task allocating module, if having timed task for the specified task execution node executes permission, The timed task is distributed to the specified timed task and executes node;
4th task allocating module, if not having timed task for the specified task execution node executes permission, Then the timed task is distributed to the task execution node for having timed task execution permission and being in idle condition.
Optionally, as shown in Fig. 7 .1, the Task Processing Unit further includes:
Execution information acquiring unit 75, if for the execution information include task rely on, obtain the timed task according to The execution information of other bad timed tasks, it refers to that the triggering that the timed task executes is fixed dependent on other that the task, which relies on, When task.Specifically, when other described timed tasks, which execute, meets dependence condition, just triggering includes the timing times that task relies on Business executes;
Monitoring unit 76, for other described timed tasks of execution information monitoring according to other timed tasks;
Task trigger element 77, if for detect executions of other timed tasks meet the task dependence according to The condition of relying then triggers the timed task and starts.
Optionally, the Task Processing Unit further includes:
Log acquisition unit 78, the task for obtaining the task execution nodes records for executing the timed task in real time are held Row daily record;
Abnormality detecting unit 79 detects the task execution node and is holding for task execution daily record described in timing scan With the presence or absence of abnormal when the row timed task;
Alarm prompt unit 710, if there is exception when executing the timed task for the task execution node, Send alarm prompt.
In the embodiment of the present invention, the timed task file packet uploaded from user interface by obtaining user scans institute Timed task file packet is stated, obtains the timed task in the timed task file packet, timed task is independently of program is executed, mutually It does not influence, then obtains the execution information of the timed task, when the timed task starts, according to the execution information by institute It states timed task to distribute to task execution node corresponding with the execution information, so that task execution node load is held The row timed task, this programme use distributed deployment, timed task execute will not the failure of coverlet point server influence, In more new task without redeploying program, the efficiency of exploitation can be improved in the efficiency for improving task execution while.
Fig. 8 is the schematic diagram for the server that one embodiment of the invention provides.As shown in figure 8, the server 8 of the embodiment wraps It includes:Processor 80, memory 81 and it is stored in the computer that can be run in the memory 81 and on the processor 80 Program 82, such as task processor.The processor 80 is realized when executing the computer program 82 at above-mentioned each task The step in embodiment of the method, such as step 101 shown in FIG. 1 are managed to 104.Alternatively, the processor 80 executes the calculating The function of each module/unit in above-mentioned each device embodiment, such as the work(of unit 71 to 74 shown in Fig. 7 are realized when machine program 82 Energy.
Illustratively, the computer program 82 can be divided into one or more module/units, it is one or Multiple module/units are stored in the memory 81, and are executed by the processor 80, to complete the present invention.Described one A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for Implementation procedure of the computer program 82 in the server 8 is described.
The server 8 can be the computing devices such as desktop PC, notebook, palm PC and cloud server. The server may include, but be not limited only to, processor 80, memory 81.It will be understood by those skilled in the art that Fig. 8 is only It is the example of server 8, does not constitute the restriction to server 8, may include than illustrating more or fewer components or group Close certain components or different components, for example, the server can also include input-output equipment, network access equipment, Bus etc..
The processor 80 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor Deng.
The memory 81 can be the internal storage unit of the server 8, such as the hard disk or memory of server 8. The memory 81 can also be that the plug-in type that is equipped on the External memory equipment of the server 8, such as the server 8 is hard Disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, the memory 81 can also both include the internal storage unit of the server 8 or wrap Include External memory equipment.The memory 81 is used to store other programs needed for the computer program and the server And data.The memory 81 can be also used for temporarily storing the data that has exported or will export.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can be stored in a computer read/write memory medium.Based on this understanding, the present invention realizes above-mentioned implementation All or part of flow in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium May include:Any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic of the computer program code can be carried Dish, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described The content that computer-readable medium includes can carry out increasing appropriate according to legislation in jurisdiction and the requirement of patent practice Subtract, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium does not include electric carrier signal and electricity Believe signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to aforementioned reality Applying example, invention is explained in detail, it will be understood by those of ordinary skill in the art that:It still can be to aforementioned each Technical solution recorded in embodiment is modified or equivalent replacement of some of the technical features;And these are changed Or replace, the spirit and scope for various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of task processing method, which is characterized in that including:
Obtain the timed task file packet that user uploads from user interface;
The timed task file packet is scanned, the timed task in the timed task file packet is obtained;
Obtain the execution information of the timed task;
When the timed task starts, according to the execution information by the timed task distribute to the execution information pair The task execution node answered, so that timed task described in the task execution node load and execution.
2. task processing method according to claim 1, which is characterized in that the execution information includes the reality of timed task Existing language, it is described when the timed task starts, the timed task is distributed to described according to the execution information and is held The corresponding task execution node of row information, so that timed task described in the task execution node load and execution, including:
When the timed task starts, the timed task is parsed, obtain the timed task writes sentence;
The sentence of writing is subjected to language format matching, determines the realization language of the timed task;
According to the realization language of the timed task, the timed task is distributed to the task execution for supporting the realization language Node, so that timed task described in the task execution node load and execution.
3. task processing method according to claim 1, which is characterized in that the execution information includes performance requirement, institute It states when the timed task starts, is distributed the timed task to corresponding with the execution information according to the execution information Task execution node so that timed task described in the task execution node load and execution, including:
When the timed task starts, the performance information of the task execution node is obtained;
According to the performance information of the task execution node, the performance of the task execution node, and the task is held Row node sorts from high to low by performance;
According to performance requirement and the task execution node to sort from high to low by performance in the execution information, institute is distributed Timed task is stated to the task execution node for meeting the performance requirement, so that described in the task execution node load and execution Timed task.
4. task processing method according to claim 1, which is characterized in that the execution information includes that specified task is held Row node, it is described when the timed task starts, the timed task is distributed to described according to the execution information and is held The corresponding task execution node of row information, so that timed task described in the task execution node load and execution, including:
When the timed task starts, judge whether the specified task execution node there is timed task to execute permission;
If the specified task execution node, which has timed task, executes permission, the timed task is distributed to the finger Fixed timed task executes node;
If the specified task execution node does not have timed task and executes permission, the timed task is distributed to having The task execution node that timed task executes permission and is in idle condition.
5. task processing method according to claim 1, which is characterized in that described when the timed task starts, The timed task is distributed to task execution node corresponding with the execution information according to the execution information, so that institute Before stating timed task described in task execution node load and execution, including:
It is relied on if the execution information includes task, obtains the execution information for other timed tasks that the timed task relies on, It refers to that the triggering that the timed task executes depends on other timed tasks that the task, which relies on,;
Other described timed tasks are monitored according to the execution information of other timed tasks;
If detecting, the execution of other timed tasks meets the dependence condition that the task relies on, and triggers the timing and appoints Business starts.
6. task processing method according to any one of claims 1 to 5, which is characterized in that the task processing method is also Including:
The task execution daily record for the task execution nodes records for executing the timed task is obtained in real time;
Task execution daily record described in timing scan detects the task execution node and whether there is when executing the timed task It is abnormal;
If the task execution node has exception when executing the timed task, alarm prompt is sent.
7. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, feature to exist In the step of realization task processing method as described in any one of claim 1 to 5 when the computer program is executed by processor Suddenly.
8. a kind of server, including memory, processor and it is stored in the memory and can transports on the processor Capable computer program, which is characterized in that the processor realizes following steps when executing the computer program:
Obtain the timed task file packet that user uploads from user interface;
The timed task file packet is scanned, the timed task in the timed task file packet is obtained;
Obtain the execution information of the timed task;
When the timed task starts, according to the execution information by the timed task distribute to the execution information pair The task execution node answered, so that timed task described in the task execution node load and execution.
9. server as claimed in claim 8, which is characterized in that the execution information includes performance requirement, described when described When timed task starts, the timed task is distributed to task corresponding with the execution information according to the execution information and is held Row node, so that timed task described in the task execution node load and execution, including:
When the timed task starts, the performance information of the task execution node is obtained;
According to the performance information of the task execution node, the performance of the task execution node, and the task is held Row node sorts from high to low by performance;
According to performance requirement and the task execution node to sort from high to low by performance in the execution information, institute is distributed Timed task is stated to the task execution node for meeting the performance requirement, so that described in the task execution node load and execution Timed task.
10. such as claim 8 to 9 any one of them server, which is characterized in that the processor executes the computer journey Following steps are also realized when sequence:
The task execution daily record for the task execution nodes records for executing the timed task is obtained in real time;
Task execution daily record described in timing scan detects the task execution node and whether there is when executing the timed task It is abnormal;
If the task execution node has exception when executing the timed task, alarm prompt is sent.
CN201810309682.2A 2018-04-09 2018-04-09 A kind of task processing method, storage medium and server Pending CN108710537A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810309682.2A CN108710537A (en) 2018-04-09 2018-04-09 A kind of task processing method, storage medium and server
PCT/CN2018/097096 WO2019196250A1 (en) 2018-04-09 2018-07-25 Task handling method, storage medium, server, and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810309682.2A CN108710537A (en) 2018-04-09 2018-04-09 A kind of task processing method, storage medium and server

Publications (1)

Publication Number Publication Date
CN108710537A true CN108710537A (en) 2018-10-26

Family

ID=63866471

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810309682.2A Pending CN108710537A (en) 2018-04-09 2018-04-09 A kind of task processing method, storage medium and server

Country Status (2)

Country Link
CN (1) CN108710537A (en)
WO (1) WO2019196250A1 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558234A (en) * 2018-11-30 2019-04-02 中国联合网络通信集团有限公司 A kind of timed task dispatching method and device
CN109656699A (en) * 2018-12-14 2019-04-19 平安医疗健康管理股份有限公司 Distributed computing method, device, system, equipment and readable storage medium storing program for executing
CN109684063A (en) * 2018-12-26 2019-04-26 亚信科技(中国)有限公司 A kind of method for scheduling task and device
CN109783224A (en) * 2018-12-10 2019-05-21 平安科技(深圳)有限公司 Method for allocating tasks, device and terminal device based on load allotment
CN110196765A (en) * 2019-05-30 2019-09-03 苏州浪潮智能科技有限公司 Timed task processing method, device, equipment and computer readable storage medium
CN110231998A (en) * 2019-06-13 2019-09-13 泰康保险集团股份有限公司 Detection method, device and the storage medium of distributed timing task
CN110389961A (en) * 2019-07-26 2019-10-29 苏州浪潮智能科技有限公司 Timed task processing method, device, equipment and computer readable storage medium
CN110532083A (en) * 2019-09-04 2019-12-03 深圳市思迪信息技术股份有限公司 Timed task dispatching method and device
CN110888739A (en) * 2019-11-22 2020-03-17 南京甄视智能科技有限公司 Distributed processing method and device for delayed tasks
CN111026541A (en) * 2019-05-22 2020-04-17 珠海随变科技有限公司 Rendering resource scheduling method, device, equipment and storage medium
CN111475272A (en) * 2020-04-07 2020-07-31 四川虹美智能科技有限公司 Method and device for controlling Java Web application timing task and task scheduling platform

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110764894A (en) * 2019-10-24 2020-02-07 北京锐安科技有限公司 Timed task management method, device, equipment and storage medium
CN111984384B (en) * 2020-08-24 2024-01-05 北京思特奇信息技术股份有限公司 Daemon and timing type job coexistence scheduling mechanism method and related device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101604242A (en) * 2009-07-17 2009-12-16 深圳市珍爱网信息技术有限公司 Realize the system of timed task in the Java application system
CN103744724A (en) * 2014-02-19 2014-04-23 互联网域名系统北京市工程研究中心有限公司 Timed task clustering method and device thereof
CN107748695A (en) * 2017-10-24 2018-03-02 平安科技(深圳)有限公司 Timed task processing method, device, storage medium and computer equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874094A (en) * 2017-02-17 2017-06-20 广州爱九游信息技术有限公司 timed task processing method, device and computing device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101604242A (en) * 2009-07-17 2009-12-16 深圳市珍爱网信息技术有限公司 Realize the system of timed task in the Java application system
CN103744724A (en) * 2014-02-19 2014-04-23 互联网域名系统北京市工程研究中心有限公司 Timed task clustering method and device thereof
CN107748695A (en) * 2017-10-24 2018-03-02 平安科技(深圳)有限公司 Timed task processing method, device, storage medium and computer equipment

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558234A (en) * 2018-11-30 2019-04-02 中国联合网络通信集团有限公司 A kind of timed task dispatching method and device
CN109783224A (en) * 2018-12-10 2019-05-21 平安科技(深圳)有限公司 Method for allocating tasks, device and terminal device based on load allotment
CN109656699A (en) * 2018-12-14 2019-04-19 平安医疗健康管理股份有限公司 Distributed computing method, device, system, equipment and readable storage medium storing program for executing
CN109684063A (en) * 2018-12-26 2019-04-26 亚信科技(中国)有限公司 A kind of method for scheduling task and device
CN111026541A (en) * 2019-05-22 2020-04-17 珠海随变科技有限公司 Rendering resource scheduling method, device, equipment and storage medium
CN111026541B (en) * 2019-05-22 2020-09-29 珠海随变科技有限公司 Rendering resource scheduling method, device, equipment and storage medium
CN110196765A (en) * 2019-05-30 2019-09-03 苏州浪潮智能科技有限公司 Timed task processing method, device, equipment and computer readable storage medium
CN110231998A (en) * 2019-06-13 2019-09-13 泰康保险集团股份有限公司 Detection method, device and the storage medium of distributed timing task
CN110231998B (en) * 2019-06-13 2021-07-20 泰康保险集团股份有限公司 Detection method and device for distributed timing task and storage medium
CN110389961A (en) * 2019-07-26 2019-10-29 苏州浪潮智能科技有限公司 Timed task processing method, device, equipment and computer readable storage medium
CN110532083A (en) * 2019-09-04 2019-12-03 深圳市思迪信息技术股份有限公司 Timed task dispatching method and device
CN110888739A (en) * 2019-11-22 2020-03-17 南京甄视智能科技有限公司 Distributed processing method and device for delayed tasks
CN110888739B (en) * 2019-11-22 2020-10-20 南京甄视智能科技有限公司 Distributed processing method and device for delayed tasks
CN111475272A (en) * 2020-04-07 2020-07-31 四川虹美智能科技有限公司 Method and device for controlling Java Web application timing task and task scheduling platform

Also Published As

Publication number Publication date
WO2019196250A1 (en) 2019-10-17

Similar Documents

Publication Publication Date Title
CN108710537A (en) A kind of task processing method, storage medium and server
CN105184166A (en) Kernel-based Android application real-time behavior analysis method and system
CN110069572A (en) HIVE method for scheduling task, device, equipment and storage medium based on big data platform
CN109284217A (en) Application exception processing method, device, electronic equipment and storage medium
CN112214260A (en) Loading method and device of terminal application APP
CN106897072A (en) Traffic engineered call method, device and electronic equipment
CN107491371B (en) Deployment monitoring method and device
CN108491311A (en) A kind of the house dog monitoring method and terminal of real time operating system
CN109376009A (en) A kind of method and device of shared resource
CN111813635A (en) Monitoring method, system and device for intelligent contracts of block chains
CN110457132B (en) Method and device for creating functional object and terminal equipment
CN107515811A (en) A kind of method and apparatus for obtaining application program power consumption
CN106293890B (en) A kind of method and device for business processing based on complexity
CN109684846A (en) A kind of file extraction method and device
CN115220887A (en) Processing method of scheduling information, task processing system, processor and electronic equipment
CN115617612A (en) Log reporting method and device, computer equipment and storage medium
CN112437132B (en) Service resource sharing method based on cloud computing and digital upgrading and cloud server
CN115237889A (en) Database switching method and device, storage medium and computer equipment
CN107704362A (en) A kind of method and device based on Ambari monitoring big data components
CN114791884A (en) Test environment construction method and device, storage medium and electronic equipment
Wang et al. KerTSDroid: Detecting android malware at scale through kernel task structures
CN110347471B (en) Hierarchical display component system, display component calling method and device
CN108874625B (en) Information processing method and device, electronic equipment and storage medium
Rammig et al. Online behavior classification for anomaly detection in self‐x real‐time systems
CN114546793A (en) Log generation method and device 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