CN104216785A - Common policy task system and implementing method thereof - Google Patents
Common policy task system and implementing method thereof Download PDFInfo
- Publication number
- CN104216785A CN104216785A CN201410424632.0A CN201410424632A CN104216785A CN 104216785 A CN104216785 A CN 104216785A CN 201410424632 A CN201410424632 A CN 201410424632A CN 104216785 A CN104216785 A CN 104216785A
- Authority
- CN
- China
- Prior art keywords
- task
- tactful
- modules
- information
- scheduling modules
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a common policy task system and an implementing method thereof and relates to the field of computer software programming. The system defines a common data structure; the data structure comprises basic information, object information, additional parameters, status information of a task and an execution result of the task; the system comprises a policy task client module, a policy task scheduling module and a plurality of policy task execution modules. According to the system and the method, existing or future possibly existing tasks which are timed to be executed and do not require manual intervention are brought into a structural system for centralized management, can ensure that tasks which meet any requirements, are established according to user specified time and are periodically repeatedly executed are expanded and different business analysis modules are reused in a binary mode, solves the problem that data structures are inconsistent due to different task types, and also can assign each task to be executed in a specific policy task execution module.
Description
Technical field
The present invention relates to computer software programming field, specifically relate to a kind of general policies task system and its implementation.
Background technology
On time strategy task can automatically perform some task when not needing manual intervention, and computer for controlling soft and hardware system goes execution one operation.Strategy task is applied widely in our daily life: control of Industry Control, banking system Automatic-settlement, traffic lights etc., all very common in every field such as industry, traffic, the energy, bank, scientific research and national defence.Therefore, be necessary to set up a kind of general tactful task mechanism, can by existing or that may exist in the future, timing performs, the task of not needing manual intervention, include in a kind of structural system and manage concentratedly.
Summary of the invention
The object of the invention is the deficiency in order to overcome above-mentioned background technology, a kind of general policies task system and its implementation are provided, set up a kind of general tactful task mechanism, timing that is existing or that may exist in the future can be performed, do not need the task of manual intervention, include in a kind of structural system and manage concentratedly, the expansion meeting the task that any needs are set up by user's stipulated time and periodically repeated can be made, different business diagnosis modules can be reused in a binary fashion, the problem that shielding causes data structure inconsistent because of the difference of task type, often kind of task can also be specified specifically to perform in which tactful task execution module.
The invention provides a kind of general policies task system, this system comprises tactful task client modules, tactful task scheduling modules and some tactful task execution module, this system realizes form adopting software service technology or dynamic link library in module, is convenient to reuse in a binary fashion at different business analysis module; Strategy task client modules, tactful task scheduling modules and tactful task execution module all adopt data structure serializing technology, are the byte stream of same format by dissimilar data transformations;
A kind of general data structure of described general policies task system definition, this data structure comprises essential information, object information, additional parameter, the status information of task and the execution result of task, essential information, object information, additional parameter are that user fills at tactful task client modules, the data flow of essential information, object information and additional parameter is: tactful task client modules-> strategy task scheduling modules-> strategy task execution module is data flow from top to bottom; Essential information and object information are common information, are transparent to tactful task client modules, tactful task scheduling modules and tactful task execution module, and often kind of tactful task all comprises essential information and object information; Additional parameter is the private information of tactful task, often kind of tactful task has different additional parameters, different additional parameters is converted into general form by strategy task client modules, additional parameter only to tactful task client modules and tactful task execution module transparent, consult concrete structure voluntarily by tactful task client modules and tactful task execution module;
The status information of task and the execution result of task are that tactful task execution module produces in implementation strategy task process, and the status information of task is all transparent to tactful task client modules, tactful task scheduling modules and tactful task execution module, strategy task client modules and tactful task scheduling modules are according to the status information of task, judge that whether task is complete, different tactful tasks produces the execution result of different task, the execution result of task to only to tactful task client modules and tactful task execution module transparent, the status information of task and the execution result of task consult structure voluntarily by tactful task client modules and tactful task execution module, the data flow of the status information of task and the execution result of task is: tactful task execution module-> strategy task scheduling modules-> strategy task client modules, it is data flow from down to up,
Described tactful task client modules is used for: distributing policy assignment instructions: increase, revise, delete, inquire about and perform immediately, the execution result of display tasks carrying progress and task; The item number certificate of the essential information of strategy task client modules eligible task, object information and additional parameter, strategy task client modules is by additional parameter serializing, put into byte stream, ensure the interface unitarity of tactful task scheduling modules and the consistance of data structure;
Described tactful task scheduling modules is used for: the configurable file adopting expandable mark language XML, specifies often kind of timed task specifically to perform in which tactful task execution module, receive the instruction that client issues, and perform increase, amendment, deletion, inquiry and perform instruction immediately, read the XML configuration file that timed task is specifically performed in which tactful task execution module, when setting up a new task, launch according to the essential information of task, object information, Task-decomposing is carried out by object, generate tasks carrying object, join in task scheduling queue carry out dispatching, control and management, strategy task scheduling modules is indifferent to the additional parameter of task, and additional parameter does not need solution sequence, strategy task scheduling modules starts scheduling thread, each task in traversal queue, whether the essential information of inspection task meets schedulable condition, if met, which performed by tactful task execution module according to XML configuration file information determination task, and by the essential information of task, object information and additional parameter are issued in this tactful task execution module and perform, start monitoring simultaneously, the status information of task that reception tasks carrying process reports and the execution result of task, if Task-decomposing becomes some subtasks, the status information of each subtask is gathered, calculate the status information of overall task, if the status information of task changes, the state information report of task is given tactful task client modules by tactful task scheduling modules, the status information of tactful task client modules display task, the execution result of task stored in database or writing in files, and is reported tactful task client modules by the execution result of task by strategy task scheduling modules, the execution result of tactful task client display task,
Described tactful task execution module is used for: realize the interface of specifying, ensure the unitarity of interface; Receive object information and additional parameter that tactful task scheduling modules issues, and by additional parameter solution sequence: byte stream is reduced into original data structure; Execute the task, generate the status information of task, report the status information of task; The execution result of generation task, changes into byte stream by the execution result sequence of task, and reports the execution result of task.
On the basis of technique scheme, the essential information in described data structure comprises:
(1) mission number: be used for mark task;
(2) task type: how decision task performs;
(3) task names: for showing the title of task, there is uniqueness;
(4) tasks carrying period type: disposable task or cycle daily, week, the moon circulation task;
(5) task Starting Executing Time: when mark task starts to perform;
(6) task stops the execution time: when mark task stops performing;
(7) task execution time point set: which time point of mark task within certain cycle is performed;
(8) whether task is effective: only perform effective task.
On the basis of technique scheme, the object information in described data structure is performed task for marking which object.
On the basis of technique scheme, the status information of the task in described data structure comprises:
(1) mission number: be exactly the mission number in essential information, which task is the status information for marking task belong to;
(2) executing state of task: running status, idle condition, hang-up/disabled status;
Running status: task meets service condition, runs;
Idle condition: task does not meet executive condition;
Hang-up/disabled status: even if task also cannot continue to perform to the time point performed;
(3) tasks carrying pass flag: mark reports progress that time, and whether task runs succeeded;
(4) the current Starting Executing Time of task: the current Starting Executing Time point of minute book subtask;
(5) the task execution time next time: go out current task execution time point next time according to computation of Period.
On the basis of technique scheme, the execution result of the task in described data structure: for marking task in the process of implementation or perform and terminate the result data of rear generation, the execution result structure sequence of all tasks is changed into character string and preserves by described general policies task system.
On the basis of technique scheme, when described tactful task client modules issues task to tactful task scheduling modules, task initialization is idle condition; Strategy task scheduling modules checks whether the essential information of task meets service condition, if satisfy condition, and the object information of task does not perform in other task of same kind, and task enters running status; If satisfy condition, but the object information of task performs in other task of same kind, and task enters hang-up/disabled status; Detect that once tactful task scheduling modules the object information of the task of hang-up/disabled status does not perform in other task of same kind, task enters running status; Strategy task scheduling modules detects the status information of reporting of task, if tasks carrying failure, or calculation task implementation progress number percent, implementation progress is to 100%, and represent that tasks carrying completes, task reenters idle condition.
On the basis of technique scheme, described tactful task scheduling modules enables timeout mechanism, long-time do not receive tactful task execution module when reporting the status information of task, strategy task scheduling modules judges this tasks carrying failure, task enters idle condition, and the tasks carrying pass flag in the status information of task is set to failure.
The present invention also provides the implementation method of above-mentioned general policies task system, comprises the following steps:
S1, tactful task client modules distributing policy task are to tactful task scheduling modules:
Step 101, user open tactful task client modules, a newly-built tactful task;
The master data that user fills in by step 102, tactful task client modules puts into the essential information of task, and object data puts into object information, after extend information serializing, puts into additional parameter;
Step 103, tactful task client modules issue task to tactful task scheduling modules;
Step 104, tactful task scheduling modules check data, mainly verify the data in the essential information of task and object information, if checking data is wrong, then forward step 105 to; If checking data does not have mistake, then forward step 106 to;
If step 105 checking data is wrong, tactful task scheduling modules returns error message to tactful task client modules, points out the place of makeing mistakes, and requires that user re-enters, return step 102;
If step 106 checking data does not have mistake, task is put into queue by tactful task scheduling modules, and wait task is performed, and forwards step 107 to;
Step 107, tactful task scheduling modules return message give tactful task client modules, and prompting increases Mission Success, and this flow process terminates;
S2, tactful task scheduling modules issue task-performance instructions to each concrete tactful task execution module:
Step 201, system initialization, start the poll thread in tactful task scheduling modules;
Task in step 202, snoop queue;
3 executive conditions below whether step 203, the task that checks meet, if met the following conditions, task just can be performed, and forwards step 204 to; Otherwise return step 202;
(1) current point in time is at the Starting Executing Time of task with between the end execution time;
(2) task is effective, and task status is idle or hangs up/forbidding;
(3) current time deducts the last execution time and is more than or equal to the cycle, or task is disposable task, or task was not also performed;
Step 204, tactful task scheduling modules check whether the object of tasks carrying performs in the task of same kind; If perform, then forward step 205 to; Otherwise, forward step 206 to;
If step 205 performs, task enters hang-up/disabled status, returns step 202;
If step 206 task is broken down into some subtasks, then task is decomposed by object information by tactful task scheduling modules, forwards step 207 to;
Step 207, tactful task scheduling modules are according to XML configuration information, and task is issued to the tactful task execution module of specifying and performs by employing asynchronous call mode, forwards step 208 to;
The reception of step 208, the tactful status information of task scheduling modules initiating task and the execution result of task is monitored, receive the status information of task and the execution result of task that each tactful task execution module reports, and calculate current implementation progress according to the status information of task, if progress is 100%, tasks carrying terminates, task enters idle condition, forwards step 209 to;
Step 209, this flow process terminate.
Compared with prior art, advantage of the present invention is as follows:
(1) the present invention sets up a kind of general tactful task mechanism, task that timing that is existing or that may exist in the future can be performed, that do not need manual intervention, include in a kind of structural system and manage concentratedly, the expansion meeting the task that any needs are set up by user's stipulated time and periodically repeated can be made.
(2) the present invention is based on can versatility, configurable consideration, system realizes form adopting software service technology or dynamic link library in module, is convenient to different business diagnosis modules and reuses in a binary fashion.
(3) the tactful task client modules in the present invention, tactful task scheduling modules and tactful task execution module all adopt data structure serializing technology, be the byte stream of same format by any dissimilar data transformations, the problem that the data structure that causes because of the difference of task type is inconsistent can be shielded.
(4) the tactful task scheduling modules in the present invention adopts the configurable file of XML, and often kind of timed task can be specified specifically to perform in which tactful task execution module.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of general policies task system in the embodiment of the present invention.
Fig. 2 is the change schematic diagram of execution status of task in the embodiment of the present invention.
Fig. 3 is the process flow diagram that in the embodiment of the present invention, task issues.
Fig. 4 is the process flow diagram of task scheduling in the embodiment of the present invention.
Embodiment
Below in conjunction with drawings and the specific embodiments, the present invention is described in further detail.
Shown in Figure 1, the embodiment of the present invention provides a kind of general policies task system, comprise tactful task client modules, tactful task scheduling modules and some tactful task execution module, based on can versatility, configurable consideration, this system realizes form adopting software service technology or dynamic link library in module, is convenient to reuse in a binary fashion at different business analysis module; Strategy task client modules, tactful task scheduling modules and tactful task execution module all adopt data structure serializing technology, be the byte stream of same format by any dissimilar data transformations, the problem that the data structure that causes because of the difference of task type is inconsistent can be shielded.
A kind of general data structure of general policies task system definition, makes it to meet potential tactful task situation.This data structure comprises essential information, object information, additional parameter, the status information of task and the execution result of task.Essential information, object information, additional parameter are that user fills at tactful task client modules, the data flow of essential information, object information and additional parameter is: tactful task client modules-> strategy task scheduling modules-> strategy task execution module is data flow from top to bottom.Essential information and object information are common information, are transparent to tactful task client modules, tactful task scheduling modules and tactful task execution module.Often kind of tactful task all comprises essential information and object information.
Additional parameter is the private information of tactful task, and often kind of tactful task has different additional parameters, in order to meet versatility, different additional parameters must be converted into general form.Additional parameter only to tactful task client modules and tactful task execution module transparent, consult concrete structure voluntarily by tactful task client modules and tactful task execution module, tactful task scheduling modules is indifferent to additional parameter content.
The status information of task and the execution result of task are that tactful task execution module produces in implementation strategy task process, and the status information of task is all transparent to tactful task client modules, tactful task scheduling modules and tactful task execution module, strategy task client modules and tactful task scheduling modules need the status information according to task, judge that whether task is complete, often kind of different tactful task produces the execution result of different task, therefore, the execution result of task to only to tactful task client modules and tactful task execution module transparent, the status information of task and the execution result of task consult structure voluntarily by tactful task client modules and tactful task execution module, the data flow of the status information of task and the execution result of task is: tactful task execution module-> strategy task scheduling modules-> strategy task client modules, it is data flow from down to up.
Below data structure is described in detail.
1, essential information comprises:
(1) mission number: be used for mark task, two tasks can not have identical identification number, and its span is 1 ~ 65535;
(2) task type: the type of task is different, the flow process of executing the task and method just inconsistent, task type determines how task performs on earth;
(3) task names: for showing the title of task, can facilitate people's identification mission what does, have uniqueness, can not repeat;
(4) tasks carrying period type: disposable task or cycle daily, week, the moon circulation task;
(5) task Starting Executing Time: when mark task starts to perform;
(6) task stops the execution time: when mark task stops performing;
(7) task execution time point set: which time point of mark task within certain cycle is performed;
(8) whether task is effective: only perform effective task, can not be performed after idle task to time point.
2, object information: be performed task for marking which object can be empty.
3, additional parameter: the additional parameter of different task may be different, causes data structure inconsistent in order to avoid additional parameter is inconsistent, and all additional parameter structure sequences are changed into character string and preserve by system.
4, the status information of task comprises:
(1) mission number: be exactly the mission number in essential information, which task is the status information for marking task belong to.
(2) executing state of task: running status, idle condition, hang-up/disabled status.
Running status: task meets service condition, runs;
Idle condition: task does not meet executive condition;
Hang-up/disabled status: for a certain reason, even if task also cannot continue to perform to the time point performed.
(3) tasks carrying pass flag: mark reports progress that time, and whether task runs succeeded.
(4) the current Starting Executing Time of task: the current Starting Executing Time point of minute book subtask.
(5) the task execution time next time: go out current task execution time point next time according to computation of Period.
5, the execution result of task: for marking task in the process of implementation or perform and terminate the result data of rear generation, the same with additional parameter, the execution result of different task may be different, and the execution result structure sequence of all tasks is changed into character string and preserves by system.
Below the function of tactful task client modules, tactful task scheduling modules and tactful task execution module and workflow are described in detail.
Strategy task client modules is used for: distributing policy assignment instructions: increase, revise, delete, inquire about and perform immediately, the execution result of display tasks carrying progress and task; The item number certificate of the essential information of strategy task client modules eligible task, object information and additional parameter, strategy task client modules can set up various that existed or that may exist in the future dissimilar, that parameter is inconsistent tactful task, therefore additional parameter may be completely different, in order to shield this species diversity, by additional parameter serializing, put into byte stream, this ensures that there the interface unitarity of tactful task scheduling modules and the consistance of data structure.
Strategy task scheduling modules is used for: the configurable file adopting XML (Extensible Markup Language, extend markup language), and often kind of timed task can be specified specifically to perform in which tactful task execution module; Receive the instruction that client issues, and perform increase, amendment, deletion, inquiry and perform instruction immediately; Read the XML configuration file that timed task is specifically performed in which tactful task execution module.When setting up a new task, will launch according to the essential information of task, object information, Task-decomposing is carried out by object, generate tasks carrying object, join in task scheduling queue carry out dispatching, control and management, strategy task scheduling modules is indifferent to the additional parameter of task, and additional parameter does not need solution sequence.Strategy task scheduling modules starts scheduling thread, each task in traversal queue, whether the essential information of inspection task meets schedulable condition, if met, which performed by tactful task execution module according to XML configuration file information determination task, and by the essential information of task, object information and additional parameter are issued in this tactful task execution module and perform, start monitoring simultaneously, the status information of task that reception tasks carrying process reports and the execution result of task, if Task-decomposing becomes some subtasks, the status information of each subtask is gathered, calculate the status information of the overall task of task, if the status information of task changes, the state information report of task is given tactful task client modules by strategy task scheduling modules, the status information of strategy task client modules display task.Execution result stored in database or writing in files, and is reported tactful task client modules by the execution result of task by strategy task scheduling modules, the execution result of tactful task client display task.
When a task disassembles into some subtasks by object, be handed down to different tactful task execution module to perform, system just needs to calculate total tasks carrying progress P, algorithm is very simple: if split into N number of subtask, the progress of each subtask of tasks carrying progress P=and/N are exactly the overall progress of task.
Shown in Figure 2, when tactful task client modules issues task to tactful task scheduling modules, task initialization is idle condition; Strategy task scheduling modules checks whether the essential information of task meets service condition, if satisfy condition, and the object information of task does not perform in other task of same kind, and task enters running status; If satisfy condition, but the object information of task performs in other task of same kind, and task enters hang-up/disabled status; Detect that once tactful task scheduling modules the object information of the task of hang-up/disabled status does not perform in other task of same kind, task enters running status; Strategy task scheduling modules detects the status information of reporting of task, if tasks carrying failure, or calculation task implementation progress number percent, implementation progress is to 100%, and represent that tasks carrying completes, task reenters idle condition.
If tactful task scheduling modules can not terminate for a long time in order to avoid task, enable timeout mechanism, do not receive the status information that tactful task execution module reports task for a long time, strategy task scheduling modules judges this tasks carrying failure, task enters idle condition, and the tasks carrying pass flag in the status information of task is set to failure.
Strategy task execution module is used for: realize the interface of specifying, ensure the unitarity of interface; Receive object information and additional parameter that tactful task scheduling modules issues, and by additional parameter solution sequence: byte stream is reduced into original data structure; Execute the task, generate the status information of task, report the status information of task; The execution result of generation task, changes into byte stream by the execution result sequence of task, and reports the execution result of task.Strategy task execution module can in any one application or service the inside, and in order to realize the unitarity of interface, each tactful task execution module specifically performing timed task must realize the interface of specifying.Due to the difference of task type, cause the structure of the execution result of task also different, the execution result sequence of task is changed into byte stream by tactful task execution module.
Issuing of whole task order, report, perform and report the execution result of task, strategy task scheduling modules is indifferent to the data of serializing, the data of serializing are handled through consultation by tactful task client modules and tactful task execution module, the data of serializing are opaque to tactful task scheduling modules, newly-increased a kind of tactful task, tactful task client modules and tactful task execution module is only needed to appoint the content of the execution result of additional parameter and task, and the interface of implementation strategy task execution module, do not need to change to tactful task scheduling modules, convenient expansion.
The embodiment of the present invention also provides the implementation method of above-mentioned general policies task system, comprises the following steps:
S1, shown in Figure 3, tactful task client modules distributing policy task is to tactful task scheduling modules:
Step 101, user open tactful task client modules, a newly-built tactful task;
The master data that user fills in by step 102, tactful task client modules puts into the essential information of task, and object data puts into object information, after extend information serializing, puts into additional parameter;
Step 103, tactful task client modules issue task to tactful task scheduling modules;
Step 104, tactful task scheduling modules check data, mainly verify the data in the essential information of task and object information, if checking data is wrong, then forward step 105 to; If checking data does not have mistake, then forward step 106 to;
If step 105 checking data is wrong, tactful task scheduling modules returns error message to tactful task client modules, points out the place of makeing mistakes, and requires that user re-enters, return step 102;
If step 106 checking data does not have mistake, task is put into queue by tactful task scheduling modules, and wait task is performed, and forwards step 107 to;
Step 107, tactful task scheduling modules return message give tactful task client modules, and prompting increases Mission Success, and this flow process terminates.
S2, shown in Figure 4, tactful task scheduling modules issues task-performance instructions to each concrete tactful task execution module:
Step 201, system initialization, start the poll thread in tactful task scheduling modules;
Task in step 202, snoop queue;
3 executive conditions below whether step 203, the task that checks meet, if met the following conditions, task just can be performed, and forwards step 204 to; Otherwise return step 202;
(1) current point in time is at the Starting Executing Time of task with between the end execution time;
(2) task is effective, and task status is idle or hangs up/forbidding;
(3) current time deducts the last execution time and is more than or equal to the cycle, or task is disposable task, or task was not also performed;
Step 204, tactful task scheduling modules check whether the object of tasks carrying performs in the task of same kind; If perform, then forward step 205 to; Otherwise, forward step 206 to;
If step 205 performs, task enters hang-up/disabled status, returns step 202;
If step 206 task is broken down into some subtasks, then task is decomposed by object information by tactful task scheduling modules, forwards step 207 to;
Step 207, tactful task scheduling modules are according to XML configuration information, task is issued to the tactful task execution module of specifying and performs by employing asynchronous call mode, here in order to not cause thread block, adopting asynchronous call mode to issue task execution command, forwarding step 208 to;
The reception of step 208, the tactful status information of task scheduling modules initiating task and the execution result of task is monitored, receive the status information of task and the execution result of task that each tactful task execution module reports, and calculate current implementation progress according to the status information of task, if progress is 100%, tasks carrying terminates, task enters idle condition, forwards step 209 to;
Step 209, this flow process terminate.
Those skilled in the art can carry out various modifications and variations to the embodiment of the present invention, if these amendments and modification are within the scope of the claims in the present invention and equivalent technologies thereof, then these revise and modification also within protection scope of the present invention.
The prior art that the content do not described in detail in instructions is known to the skilled person.
Claims (8)
1. a general policies task system, it is characterized in that: this system comprises tactful task client modules, tactful task scheduling modules and some tactful task execution module, this system realizes form adopting software service technology or dynamic link library in module, is convenient to reuse in a binary fashion at different business analysis module; Strategy task client modules, tactful task scheduling modules and tactful task execution module all adopt data structure serializing technology, are the byte stream of same format by dissimilar data transformations;
A kind of general data structure of described general policies task system definition, this data structure comprises essential information, object information, additional parameter, the status information of task and the execution result of task, essential information, object information, additional parameter are that user fills at tactful task client modules, the data flow of essential information, object information and additional parameter is: tactful task client modules-> strategy task scheduling modules-> strategy task execution module is data flow from top to bottom; Essential information and object information are common information, are transparent to tactful task client modules, tactful task scheduling modules and tactful task execution module, and often kind of tactful task all comprises essential information and object information; Additional parameter is the private information of tactful task, often kind of tactful task has different additional parameters, different additional parameters is converted into general form by strategy task client modules, additional parameter only to tactful task client modules and tactful task execution module transparent, consult concrete structure voluntarily by tactful task client modules and tactful task execution module;
The status information of task and the execution result of task are that tactful task execution module produces in implementation strategy task process, and the status information of task is all transparent to tactful task client modules, tactful task scheduling modules and tactful task execution module, strategy task client modules and tactful task scheduling modules are according to the status information of task, judge that whether task is complete, different tactful tasks produces the execution result of different task, the execution result of task to only to tactful task client modules and tactful task execution module transparent, the status information of task and the execution result of task consult structure voluntarily by tactful task client modules and tactful task execution module, the data flow of the status information of task and the execution result of task is: tactful task execution module-> strategy task scheduling modules-> strategy task client modules, it is data flow from down to up,
Described tactful task client modules is used for: distributing policy assignment instructions: increase, revise, delete, inquire about and perform immediately, the execution result of display tasks carrying progress and task; The item number certificate of the essential information of strategy task client modules eligible task, object information and additional parameter, strategy task client modules is by additional parameter serializing, put into byte stream, ensure the interface unitarity of tactful task scheduling modules and the consistance of data structure;
Described tactful task scheduling modules is used for: the configurable file adopting expandable mark language XML, specifies often kind of timed task specifically to perform in which tactful task execution module, receive the instruction that client issues, and perform increase, amendment, deletion, inquiry and perform instruction immediately, read the XML configuration file that timed task is specifically performed in which tactful task execution module, when setting up a new task, launch according to the essential information of task, object information, Task-decomposing is carried out by object, generate tasks carrying object, join in task scheduling queue carry out dispatching, control and management, strategy task scheduling modules is indifferent to the additional parameter of task, and additional parameter does not need solution sequence, strategy task scheduling modules starts scheduling thread, each task in traversal queue, whether the essential information of inspection task meets schedulable condition, if met, which performed by tactful task execution module according to XML configuration file information determination task, and by the essential information of task, object information and additional parameter are issued in this tactful task execution module and perform, start monitoring simultaneously, the status information of task that reception tasks carrying process reports and the execution result of task, if Task-decomposing becomes some subtasks, the status information of each subtask is gathered, calculate the status information of overall task, if the status information of task changes, the state information report of task is given tactful task client modules by tactful task scheduling modules, the status information of tactful task client modules display task, the execution result of task stored in database or writing in files, and is reported tactful task client modules by the execution result of task by strategy task scheduling modules, the execution result of tactful task client display task,
Described tactful task execution module is used for: realize the interface of specifying, ensure the unitarity of interface; Receive object information and additional parameter that tactful task scheduling modules issues, and by additional parameter solution sequence: byte stream is reduced into original data structure; Execute the task, generate the status information of task, report the status information of task; The execution result of generation task, changes into byte stream by the execution result sequence of task, and reports the execution result of task.
2. general policies task system as claimed in claim 1, is characterized in that: the essential information in described data structure comprises:
(1) mission number: be used for mark task;
(2) task type: how decision task performs;
(3) task names: for showing the title of task, there is uniqueness;
(4) tasks carrying period type: disposable task or cycle daily, week, the moon circulation task;
(5) task Starting Executing Time: when mark task starts to perform;
(6) task stops the execution time: when mark task stops performing;
(7) task execution time point set: which time point of mark task within certain cycle is performed;
(8) whether task is effective: only perform effective task.
3. general policies task system as claimed in claim 2, is characterized in that: the object information in described data structure is performed task for marking which object.
4. general policies task system as claimed in claim 3, is characterized in that: the status information of the task in described data structure comprises:
(1) mission number: be exactly the mission number in essential information, which task is the status information for marking task belong to;
(2) executing state of task: running status, idle condition, hang-up/disabled status;
Running status: task meets service condition, runs;
Idle condition: task does not meet executive condition;
Hang-up/disabled status: even if task also cannot continue to perform to the time point performed;
(3) tasks carrying pass flag: mark reports progress that time, and whether task runs succeeded;
(4) the current Starting Executing Time of task: the current Starting Executing Time point of minute book subtask;
(5) the task execution time next time: go out current task execution time point next time according to computation of Period.
5. general policies task system as claimed in claim 4, it is characterized in that: the execution result of the task in described data structure: for marking task in the process of implementation or perform and terminate the result data of rear generation, the execution result structure sequence of all tasks is changed into character string and preserves by described general policies task system.
6. general policies task system as claimed in claim 5, is characterized in that: when described tactful task client modules issues task to tactful task scheduling modules, task initialization is idle condition; Strategy task scheduling modules checks whether the essential information of task meets service condition, if satisfy condition, and the object information of task does not perform in other task of same kind, and task enters running status; If satisfy condition, but the object information of task performs in other task of same kind, and task enters hang-up/disabled status; Detect that once tactful task scheduling modules the object information of the task of hang-up/disabled status does not perform in other task of same kind, task enters running status; Strategy task scheduling modules detects the status information of reporting of task, if tasks carrying failure, or calculation task implementation progress number percent, implementation progress is to 100%, and represent that tasks carrying completes, task reenters idle condition.
7. general policies task system as claimed in claim 6, it is characterized in that: described tactful task scheduling modules enables timeout mechanism, long-time do not receive tactful task execution module when reporting the status information of task, strategy task scheduling modules judges this tasks carrying failure, task enters idle condition, and the tasks carrying pass flag in the status information of task is set to failure.
8. the implementation method of general policies task system according to any one of claim 1 to 7, is characterized in that, comprise the following steps:
S1, tactful task client modules distributing policy task are to tactful task scheduling modules:
Step 101, user open tactful task client modules, a newly-built tactful task;
The master data that user fills in by step 102, tactful task client modules puts into the essential information of task, and object data puts into object information, after extend information serializing, puts into additional parameter;
Step 103, tactful task client modules issue task to tactful task scheduling modules;
Step 104, tactful task scheduling modules check data, mainly verify the data in the essential information of task and object information, if checking data is wrong, then forward step 105 to; If checking data does not have mistake, then forward step 106 to;
If step 105 checking data is wrong, tactful task scheduling modules returns error message to tactful task client modules, points out the place of makeing mistakes, and requires that user re-enters, return step 102;
If step 106 checking data does not have mistake, task is put into queue by tactful task scheduling modules, and wait task is performed, and forwards step 107 to;
Step 107, tactful task scheduling modules return message give tactful task client modules, and prompting increases Mission Success, and this flow process terminates;
S2, tactful task scheduling modules issue task-performance instructions to each concrete tactful task execution module:
Step 201, system initialization, start the poll thread in tactful task scheduling modules;
Task in step 202, snoop queue;
3 executive conditions below whether step 203, the task that checks meet, if met the following conditions, task just can be performed, and forwards step 204 to; Otherwise return step 202;
(1) current point in time is at the Starting Executing Time of task with between the end execution time;
(2) task is effective, and task status is idle or hangs up/forbidding;
(3) current time deducts the last execution time and is more than or equal to the cycle, or task is disposable task, or task was not also performed;
Step 204, tactful task scheduling modules check whether the object of tasks carrying performs in the task of same kind; If perform, then forward step 205 to; Otherwise, forward step 206 to;
If step 205 performs, task enters hang-up/disabled status, returns step 202;
If step 206 task is broken down into some subtasks, then task is decomposed by object information by tactful task scheduling modules, forwards step 207 to;
Step 207, tactful task scheduling modules are according to XML configuration information, and task is issued to the tactful task execution module of specifying and performs by employing asynchronous call mode, forwards step 208 to;
The reception of step 208, the tactful status information of task scheduling modules initiating task and the execution result of task is monitored, receive the status information of task and the execution result of task that each tactful task execution module reports, and calculate current implementation progress according to the status information of task, if progress is 100%, tasks carrying terminates, task enters idle condition, forwards step 209 to;
Step 209, this flow process terminate.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410424632.0A CN104216785B (en) | 2014-08-26 | 2014-08-26 | General policies task system and its implementation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410424632.0A CN104216785B (en) | 2014-08-26 | 2014-08-26 | General policies task system and its implementation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104216785A true CN104216785A (en) | 2014-12-17 |
CN104216785B CN104216785B (en) | 2017-10-10 |
Family
ID=52098306
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410424632.0A Active CN104216785B (en) | 2014-08-26 | 2014-08-26 | General policies task system and its implementation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104216785B (en) |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104572284A (en) * | 2015-01-08 | 2015-04-29 | 盟游(北京)科技有限公司 | Task implementation device and method and application |
CN104580396A (en) * | 2014-12-19 | 2015-04-29 | 华为技术有限公司 | Task scheduling method, node and system |
CN104935658A (en) * | 2015-06-17 | 2015-09-23 | 交通银行股份有限公司 | Bank task allocation method and device |
CN105389209A (en) * | 2015-12-25 | 2016-03-09 | 中国建设银行股份有限公司 | Asynchronous batch task processing method and system |
CN106021467A (en) * | 2016-05-17 | 2016-10-12 | 北京金山安全软件有限公司 | Method and device for reading data file and electronic equipment |
CN106126354A (en) * | 2016-06-21 | 2016-11-16 | 中国建设银行股份有限公司 | A kind of asynchronous batch processing method and system |
CN106713441A (en) * | 2016-12-16 | 2017-05-24 | 上海斐讯数据通信技术有限公司 | Method and device for uploading terminal application data |
CN106789170A (en) * | 2016-11-28 | 2017-05-31 | 北京奇虎科技有限公司 | A kind of task processing method and device |
CN108255588A (en) * | 2017-03-13 | 2018-07-06 | 平安科技(深圳)有限公司 | A kind of automation layout method for scheduling task and device |
CN109144751A (en) * | 2018-09-04 | 2019-01-04 | 行吟信息科技(上海)有限公司 | A kind of long task processing method and system |
CN109445928A (en) * | 2018-11-14 | 2019-03-08 | 郑州云海信息技术有限公司 | A kind of access request processing method, device, equipment and readable storage medium storing program for executing |
CN110895488A (en) * | 2018-09-12 | 2020-03-20 | 北京奇虎科技有限公司 | Task scheduling method and device |
CN112905314A (en) * | 2021-01-27 | 2021-06-04 | 北京百度网讯科技有限公司 | Asynchronous processing method and device, electronic equipment, storage medium and road side equipment |
CN113254932A (en) * | 2021-06-16 | 2021-08-13 | 百度在线网络技术(北京)有限公司 | Application program risk detection method and device, electronic equipment and medium |
CN113407175A (en) * | 2021-06-24 | 2021-09-17 | 上海中通吉网络技术有限公司 | Timed task management system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050081200A1 (en) * | 2001-12-14 | 2005-04-14 | Rutten Martijn Johan | Data processing system having multiple processors, a task scheduler for a data processing system having multiple processors and a corresponding method for task scheduling |
CN1642105A (en) * | 2004-01-05 | 2005-07-20 | 华为技术有限公司 | Method for realizing task management for network system |
US20070156486A1 (en) * | 2005-12-29 | 2007-07-05 | Microsoft Corporation | Multiple concurrent workflow persistence schemes |
CN101086711A (en) * | 2006-06-11 | 2007-12-12 | 上海全成通信技术有限公司 | Mission management method of multiple-mission operation system |
CN101115057A (en) * | 2006-07-27 | 2008-01-30 | 中兴通讯股份有限公司 | Tactic management based firewall system and dispatching method |
-
2014
- 2014-08-26 CN CN201410424632.0A patent/CN104216785B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050081200A1 (en) * | 2001-12-14 | 2005-04-14 | Rutten Martijn Johan | Data processing system having multiple processors, a task scheduler for a data processing system having multiple processors and a corresponding method for task scheduling |
CN1642105A (en) * | 2004-01-05 | 2005-07-20 | 华为技术有限公司 | Method for realizing task management for network system |
US20070156486A1 (en) * | 2005-12-29 | 2007-07-05 | Microsoft Corporation | Multiple concurrent workflow persistence schemes |
CN101086711A (en) * | 2006-06-11 | 2007-12-12 | 上海全成通信技术有限公司 | Mission management method of multiple-mission operation system |
CN101115057A (en) * | 2006-07-27 | 2008-01-30 | 中兴通讯股份有限公司 | Tactic management based firewall system and dispatching method |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104580396A (en) * | 2014-12-19 | 2015-04-29 | 华为技术有限公司 | Task scheduling method, node and system |
CN104572284B (en) * | 2015-01-08 | 2019-03-15 | 游道易(北京)科技有限公司 | Task realization device and method and application |
CN104572284A (en) * | 2015-01-08 | 2015-04-29 | 盟游(北京)科技有限公司 | Task implementation device and method and application |
CN104935658A (en) * | 2015-06-17 | 2015-09-23 | 交通银行股份有限公司 | Bank task allocation method and device |
CN104935658B (en) * | 2015-06-17 | 2018-05-08 | 交通银行股份有限公司 | A kind of bank's method for allocating tasks and device |
CN105389209A (en) * | 2015-12-25 | 2016-03-09 | 中国建设银行股份有限公司 | Asynchronous batch task processing method and system |
CN105389209B (en) * | 2015-12-25 | 2019-04-26 | 中国建设银行股份有限公司 | A kind of asynchronous batch tasks processing method and system |
CN106021467A (en) * | 2016-05-17 | 2016-10-12 | 北京金山安全软件有限公司 | Method and device for reading data file and electronic equipment |
CN106126354A (en) * | 2016-06-21 | 2016-11-16 | 中国建设银行股份有限公司 | A kind of asynchronous batch processing method and system |
CN106789170A (en) * | 2016-11-28 | 2017-05-31 | 北京奇虎科技有限公司 | A kind of task processing method and device |
CN106713441A (en) * | 2016-12-16 | 2017-05-24 | 上海斐讯数据通信技术有限公司 | Method and device for uploading terminal application data |
CN108255588A (en) * | 2017-03-13 | 2018-07-06 | 平安科技(深圳)有限公司 | A kind of automation layout method for scheduling task and device |
CN109144751A (en) * | 2018-09-04 | 2019-01-04 | 行吟信息科技(上海)有限公司 | A kind of long task processing method and system |
CN110895488A (en) * | 2018-09-12 | 2020-03-20 | 北京奇虎科技有限公司 | Task scheduling method and device |
CN110895488B (en) * | 2018-09-12 | 2023-10-20 | 三六零科技集团有限公司 | Task scheduling method and device |
CN109445928A (en) * | 2018-11-14 | 2019-03-08 | 郑州云海信息技术有限公司 | A kind of access request processing method, device, equipment and readable storage medium storing program for executing |
CN112905314A (en) * | 2021-01-27 | 2021-06-04 | 北京百度网讯科技有限公司 | Asynchronous processing method and device, electronic equipment, storage medium and road side equipment |
CN113254932A (en) * | 2021-06-16 | 2021-08-13 | 百度在线网络技术(北京)有限公司 | Application program risk detection method and device, electronic equipment and medium |
CN113254932B (en) * | 2021-06-16 | 2024-02-27 | 百度在线网络技术(北京)有限公司 | Application risk detection method and device, electronic equipment and medium |
CN113407175A (en) * | 2021-06-24 | 2021-09-17 | 上海中通吉网络技术有限公司 | Timed task management system |
Also Published As
Publication number | Publication date |
---|---|
CN104216785B (en) | 2017-10-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104216785A (en) | Common policy task system and implementing method thereof | |
JP6695984B2 (en) | Multitask scheduling method, system, application server, and computer-readable storage medium | |
CN112668386A (en) | Long running workflows for document processing using robotic process automation | |
Ahmad et al. | A framework for architecture-driven migration of legacy systems to cloud-enabled software | |
CN104461743A (en) | Device and method for automatically generating resources and configuration | |
CN103645909A (en) | Handling method and device for timed task | |
CN106776395B (en) | A kind of method for scheduling task and device of shared cluster | |
WO2019000629A1 (en) | Multi-data-source data synchronizing method and system, application server and computer readable storage medium | |
CN103488775A (en) | Computing system and computing method for big data processing | |
US20220164222A1 (en) | Execution of Services Concurrently | |
US11169495B2 (en) | Methods for provisioning an industrial internet-of-things control framework of dynamic multi-cloud events and devices thereof | |
CN113867916A (en) | Task processing method and device and electronic equipment | |
CN110784347A (en) | Node management method, system, equipment and storage medium for container cluster | |
CN107656796A (en) | A kind of virtual machine cold moving method, system and equipment | |
CN110569113A (en) | Method and system for scheduling distributed tasks and computer readable storage medium | |
CN108596557A (en) | A kind of method and system for realizing event flow based on tree | |
CN114924858A (en) | Task scheduling method and device, storage medium and electronic equipment | |
CN105893122A (en) | Data processing operation scheduling method, device and system | |
CN107609109A (en) | A kind of report form generation method, device and system | |
CN109800090A (en) | A kind of data integrated system and method | |
CN105446812A (en) | Multitask scheduling configuration method | |
CN109660393A (en) | A kind of update method and its device of cloud host specification | |
CN110018866B (en) | User interface theme updating method, device and system, vehicle machine and vehicle | |
CN106682275A (en) | Load processing method and device for industrial plant structural modeling | |
US9766940B2 (en) | Enabling dynamic job configuration in mapreduce |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |