CN1862576A - Method for obtaining timing task carrying-out time - Google Patents

Method for obtaining timing task carrying-out time Download PDF

Info

Publication number
CN1862576A
CN1862576A CNA200510090902XA CN200510090902A CN1862576A CN 1862576 A CN1862576 A CN 1862576A CN A200510090902X A CNA200510090902X A CN A200510090902XA CN 200510090902 A CN200510090902 A CN 200510090902A CN 1862576 A CN1862576 A CN 1862576A
Authority
CN
China
Prior art keywords
time
date
base period
execution
difference
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CNA200510090902XA
Other languages
Chinese (zh)
Other versions
CN1862576B (en
Inventor
张磊
龚华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN200510090902XA priority Critical patent/CN1862576B/en
Publication of CN1862576A publication Critical patent/CN1862576A/en
Application granted granted Critical
Publication of CN1862576B publication Critical patent/CN1862576B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Calculators And Similar Devices (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present invention relates to a method for obtaining execution time of timed task. Its kernel lies in that firstly, based on Crontab character string the planning date time of plan-scheduled task in timing iterator can be defined, then based on described timing iterator the next execution date time of plan-scheduled task can be obtained, so that said invention can utilize one timing iterator to obtain any complex timed task execution time.

Description

Obtain the method for timed task execution time
Technical field
The present invention relates to the communications field, relate in particular to a kind of method of obtaining the timed task execution time.
Background technology
Along with the development of infotech, the demand of planned dispatching more and more widely, the daily record that needs planned dispatching every day as, enterprise or night batch process; The user needs the planned dispatching quarter-bell time according to a preconcerted arrangement, or the like.Therefore press for the application program that exploitation can realize a plan and dispatch.
Crontab is an order of Unix system, by defining simple character string, can finish complicated plan definition, and the function of date scheduling is provided.
When utilizing crontab command definition character string (is the crontab character string to call this character string in the following text), this character string is 5 parts by space-separated: f1 f2 f3 f4 f5.Wherein f1 is expression minute, and f2 represents hour f3 represents which day in the month, and f4 represents month, and f5 represents which day in the week.In addition: when f1 is *The time represent that per minute all will carry out, f2 is *The time represent per hour all to want executive routine, the rest may be inferred by analogy for it.Wherein, when f1 represents during for a-b will carry out in during this period of time from a minute to b minute, f2 represents will carry out by b hour from a during for a-b, and the rest may be inferred by analogy for it.Wherein, as f1 be *Represent every n minute the time interval execution during/n once, f2 is */ n represents every n hour time interval execution once, and the rest may be inferred by analogy for it.Wherein, when f1 is a, b, c ... the time represent a, b, c ... minute will carry out, f2 is a, b, c ... the time represent a, b will carry out in c... hour, the rest may be inferred by analogy for it.
The technical scheme of prior art one related to the present invention is: be configured with a general planned dispatching framework on Java timer frame foundation, described planned dispatching framework provides by the timing iterator and obtains the interface of execution time next time.Described timing iterator can only be at certain concrete definition, the timing iterator of carrying out as set time every day, weekly the timing iterator carried out of appointed day, timing iterator that every month appointed day carried out, every how many days/hour/minute/the timing iterator second carried out or the like, by these described special timing iterators, complicated carrying out of a task is decomposed into the timed task of single execution one by one, thus the planned dispatching of the task of realization.
By the technical scheme of prior art one as can be seen, the planned dispatching that it can only realize single by special timing iterator realize the timing plan of various complexity if desired, then must and be made up by many dissimilar timing iterators.
Summary of the invention
In view of above-mentioned existing in prior technology problem, the purpose of this invention is to provide a kind of method of obtaining the timed task execution time, by the present invention, only need one regularly iterator just can realize set time every day carry out, the appointed day carries out weekly, every month appointed day carried out, every how many days/hour/minute/second carry out, the timing planned dispatching of the complexity of the combination in any of execution and above-mentioned various situations in the time between designation area.
The objective of the invention is to be achieved through the following technical solutions:
A kind of method method of obtaining the timed task execution time provided by the invention comprises:
A, based on Crontab character string definition time on timing date of plan scheduler task in the iterator regularly;
B, realize next time execution date of obtaining the planned dispatching task based on described timing iterator.
Wherein, described steps A specifically comprises:
A1, based on the Crontab character string, the Boolean type array is set in the timing iterator represents the time on date respectively;
Value in the Boolean type array of time on the date correspondence of A2, planned dispatching task is set to actual value.
Wherein, described step B specifically comprises:
B1, calculate the time on date and the difference of base period between the time of planned dispatching according to the timing iterator after the definition,
B2, obtain in the planned dispatching task time execution date next time of satisfying definition according to described difference.
Wherein, the described time on date comprises: time, month, day, date in week, hour and/or minute.
Wherein, described step B1 specifically comprises:
Month and the difference of base period between the month in the time in the time on date of B11, the described planned dispatching of calculating;
B12, whether judge described difference greater than 0, if described difference greater than 0, execution in step B13 then; Otherwise, execution in step B14;
B13, adjust the described base period time and be: keep the time constant, the month of base period in the time added the above difference, with the day of base period in the time, date in week, hour and minute be set to 1 day, 1 week, and 0 minute at 0 o'clock; Return step B11 then;
B14, judge that whether described difference is less than 0, if described difference is less than 0, then the base period time of Tiao Zhenging is: the month of base period in the time added the above difference, the time of base period in the time added 1, with the day of base period in the time, date in week, hour and minute be set to 1 day, 1 week, and 0 minute at 0 o'clock, return step B11 then; Otherwise, execution in step B15;
B15, according to day and in the daytime the comparative result of base period in the time in the time on date of described planned dispatching, obtain in the planned dispatching task and to satisfy time execution date next time that defines;
Or,
Comparative result according to all dates in the time on date of described planned dispatching task and base period during the Sunday in the time obtains time execution date next time of satisfying definition in the planned dispatching task;
Or,
Confirm that the base period time of obtaining is the time on date of planned dispatching task.
Wherein, described step B15 comprises:
Day and in the daytime the difference of base period in the time in the time on date of B151, the described planned dispatching of calculating;
B152, whether judge described difference greater than 0, if described difference greater than 0, execution in step B153 then; Otherwise, execution in step B154;
B153, adjust the described base period time and be: the day of base period in the time added the above difference, keeps time and the month of base period in the time constant, with base period in the time all dates, hour and minute be set to 1 week, and 0 minute at 0 o'clock; Return step B11 then;
B154, judge that whether described difference is less than 0, if described difference is less than 0, then adjusting the described base period time is: the day of base period in the time added the above difference, and the month of base period in the time added 1, and according to the calendar algorithm adjust base period in the time month and time, and with all date of base period in the time, hour and minute be set to 1 week, and 0 minute at 0 o'clock; Return step B11 then; Otherwise, execution in step B155;
B155, the comparative result according to all dates in the time on date of described planned dispatching and base period during the Sunday in the time obtain time execution date next time of satisfying definition in the planned dispatching task;
Or,
According in the time on date of described planned dispatching hour with the comparative result of medium and small time of base period time, obtain time execution date next time of satisfying definition in the planned dispatching task;
Or,
Confirm that the base period time of obtaining is the time on date of planned dispatching.
Wherein, described step B155 comprises:
B1551, calculate all dates in time on date of described planned dispatching task and the difference during the Sunday of base period in the time;
B1552, whether judge described difference greater than 0, if described difference greater than 0, execution in step B1553 then; Otherwise, execution in step B1554;
B1553, described base period time of adjustment are: all date of base period in the time added described difference, and according to time, month and the day of calendar algorithm adjustment base period in the time, with base period in the time hour and minute be set to 0 o'clock and 0 minute, return step B11 then;
B1554, judge that whether described difference is less than 0, if described difference is less than 0, then adjusting the described base period time is: all date of base period in the time added described difference, and obtain next week that adds all dates after the above difference according to the calendar algorithm, and according to the calendar algorithm adjust the time of base period in the time, month and day, with in the described time on date hour and minute be set to 0 o'clock and 0 minute; Return step B11 then; Otherwise, execution in step B1555;
B1555, according to day and in the daytime the comparative result of base period in the time in the time on date of described planned dispatching, obtain in the planned dispatching task and to satisfy time execution date next time that defines;
Or,
Confirm that the base period time of obtaining is the time on date of planned dispatching.
Wherein, step B155 or step B1555 are described according to day and in the daytime the comparative result of base period in the time in the time on date of described planned dispatching, obtain the process that satisfies time execution date next time of definition in the planned dispatching task and specifically comprise:
C101, calculate in time on date of described planned dispatching hour and base period in the time hour between difference;
C102, whether judge described difference greater than 0, if described difference greater than 0, execution in step C103 then; Otherwise, execution in step C104;
C103, adjust the described base period time and be: keep the time of base period in the time, month and day constant, base period hour is added the above difference in the time, will minute be set to 0 fen in the described time on date, return step B11 then;
C104, judge that whether described difference is less than 0, if described difference is less than 0, then adjusting the described base period time is: base period hour is added the above difference in the time, and base period day added 1 in the time, and according to the calendar algorithm adjust the time of base period in the time, month and day, with described base period in the time minute be set to 0 fen; Return step B11 then; Otherwise, execution in step C105;
C105, according in the time on date of described planned dispatching minute and base period in the time minute between comparative result, obtain in the planned dispatching task time execution date next time of satisfying definition;
Or,
Confirm that the base period time of obtaining is the time on date of planned dispatching.
Wherein, described step C105 comprises:
C1051, calculate in time on date of described planned dispatching minute and base period in the time on date in the time minute between difference.
C1052, whether judge described difference greater than 0, if described difference greater than 0, execution in step C1053 then; Otherwise, execution in step C1054;
C1053, adjust the described base period time and be: keep the time of base period in the time, month, day and hour constant, base period minute is added the above difference in the time; Return step B11 then;
C1054, whether judge described difference, be if described difference, is then adjusted the described base period time less than 0 less than 0: base period hour is added 1 in the time, and according to the calendar algorithm adjust the time of base period in the time, month and day; Return step B11 then; Otherwise, direct execution in step C1055.
The base period time that C1055, affirmation are obtained is the time on date of planned dispatching.
The wherein said base period time comprises: the time on date of setting or current date time.
As seen from the above technical solution provided by the invention, method of the present invention is based on the date of enterprise time of plan scheduler task in the Crontab character string definition timing iterator; Realize next time execution date of obtaining the planned dispatching task based on described timing iterator then.By the present invention, only need one regularly iterator just can realize set time every day carry out, the appointed day carries out weekly, every month appointed day carried out, every how many days/hour/minute/second carry out, the timing planned dispatching of the complexity of the combination in any of execution and above-mentioned various situations in the time between designation area.
Description of drawings
Fig. 1 is a process flow diagram of the present invention.
Embodiment
The invention provides a kind of method of obtaining the timed task execution time, its core is: based on the time on timing date of plan scheduler task in the Crontab character string definition timing iterator; Realize next time execution date of obtaining the planned dispatching task based on described timing iterator then.
First embodiment provided by the invention comprises two parts:
Step 1 is based on the time on timing date of plan scheduler task in the Crontab character string definition timing iterator.
In this step, at first based on the Crontab character string, the Boolean type array is set in the timing iterator represents the time on date respectively, then, the value in the Boolean type array of time on the date correspondence of planned dispatching task is set to actual value.
Describe the specific implementation process of this step below for example in detail:
As, with 5 Boolean type arrays represent respectively minute, hour, day, month, week, array length is respectively 60,24,31,12 and 7, is worth for true represents the array moment corresponding to satisfy definition.
Suppose to realize 5 a certain timed tasks of execution in every month 1 to 15 morning every three days, then the crontab character string is:
0?5?1-15/2 **
Corresponding array is respectively:
Minute the 0th value of array is true, and other are false;
Hour the 5th value of array is true, and other are false;
The 0th, 2,4,6,8,10,12,14 values of day array are true, and other are false;
The all values of moon array are true;
The all values of week array are true.
Step 2, next time execution date that the planned dispatching task is obtained in realization according to the timing iterator after the definition.
In this step, at first need to calculate the time on date and the difference of base period between the time of planned dispatching task, need the initial value of a base period time before the calculating, this value can oneself define, and also can give tacit consent to from the current date time.Then, the present invention obtains time execution date next time of satisfying definition in the planned dispatching task according to described calculated difference, and according to the task of being obtained of the date time scheduling planning execution of execution next time.The specific implementation process, as shown in Figure 1, comprising from the current date time with acquiescence:
Step S101 calculates the timing month of described planned dispatching task and the difference between current month.
Step S102 judges that whether described difference is greater than 0.
If described difference is greater than 0, then represent to satisfy definition by certain moon after current month, so execution in step S103, promptly adjusting the current date time is: keep the time constant, current month is added the above difference, with the day in the described time on date, date in week, hour and minute be set to 1 day, 1 week, and 0 minute, execution in step S101 then at 0 o'clock.
If described difference is not more than 0, execution in step S104 then, judge that promptly whether described difference is less than 0, if described difference, is then represented certain month of next year less than 0 and is satisfied definition, so execution in step S105, promptly adjusting the current date time is: current month is added the above difference, the time of current date in the time added 1, with the day in the described time on date, date in week, hour and minute be set to 1 day, 1 week, and 0 minute, execution in step S101 then at 0 o'clock; Otherwise, represent current month to satisfy definition then direct execution in step S111.
Step S111 calculates the timing day and current in the daytime the difference of described planned dispatching task.
Step S112 judges that whether described difference is greater than 0.
If described difference is greater than 0, then represent satisfied definition one day after current day, so execution in step S113, promptly adjusting the current date time is: ought add described difference the day before yesterday, keep time and month constant, with all dates in the described time on date, hour and minute be set to 1 week, and 0 minute at 0 o'clock; Execution in step S101 then.
If described difference is not more than 0, execution in step S114 then, judge that promptly whether described difference is less than 0, if described difference is less than 0, then represent to satisfy current one day a few days ago definition, that is to say, satisfy definition the one day of next month, so execution in step S115, promptly adjusting current date is: ought add described difference the day before yesterday, and the month in the current date added 1, and adjust month and time in the described time on date according to the calendar algorithm, and with all dates in the described time on date, hour and minute be set to 1 week, and 0 minute at 0 o'clock; Execution in step S101 then; Otherwise definition was satisfied in expression when the day before yesterday, then direct execution in step S121.
Step S121 calculates all dates in time on date of described planned dispatching task and the difference during current Sunday.
Step S122 judges that whether described difference is greater than 0.
If described difference is greater than 0, then represent certain expiration on Sunday foot definition of after date on current Sunday, so execution in step S123, promptly adjusting the current date time is: the current date in week is added described difference, and according to the calendar algorithm adjust time, month and day, with in the described time on date hour and minute be set to 0 o'clock and 0 minute; Execution in step S101 then.
If described difference is not more than 0, execution in step S124 then, judge that promptly whether described difference is less than 0, if described difference is less than 0, then represent next week on current date in week to satisfy definition, so execution in step S125, promptly adjusting the current date time is: the current date in week is added described difference, and obtain next week that adds all dates after the above difference according to the calendar algorithm, and according to calendar algorithm adjustment time, month and day, with in the described time on date hour and minute be set to 0 o'clock and 0 minute, execution in step S101 then; Otherwise represent the definition of current expiration on Sunday foot, then direct execution in step S131.
Step S131 calculates timing hour and the difference between current hour in time on date of described planned dispatching task.
Step S132 judges that whether described difference is greater than 0.
If described difference is greater than 0, then represent the satisfied definition in certain hour after current hour, so execution in step S133, promptly adjusting the current date time is: keep time, month and day constant, the above difference will be added in current hour, and keep time, month and day constant, will minute be set to 0 fen in the described time on date; Execution in step S101 then.
If described difference is not more than 0, execution in step S134 then, judge that promptly whether described difference is less than 0, if described difference, is then represented certain hour after current day less than 0 and is satisfied definition, so execution in step S135, promptly adjusting the current date time is: will add the above difference in current hour, and ought add 1 the day before yesterday, and according to the calendar algorithm adjust time, month and day, will minute be set to 0 fen in the described time on date; Execution in step S101 then; Otherwise represent satisfied definition in current hour, then direct execution in step S141.
Step S141, calculate in time on date of described planned dispatching task minute and current date in the time minute between difference.
Step S142 judges that whether described difference is greater than 0.
If described difference greater than 0, is then represented after current minute certain minute to satisfy definition, so execution in step S143 promptly adjusts the current date time and is: keep time, month, day and hour constant, current date minute is added the above difference in the time; Execution in step S141 then.
If described difference is not more than 0, execution in step S144 then, judge that promptly whether described difference is less than 0, if described difference is less than 0, then represent after current hour certain minute to satisfy definition, so execution in step S135 promptly adjusts the current date time and is: current date minute is added the above difference in the time, and current date hour added 1 in the time, and according to the calendar algorithm adjust time, month and day; Execution in step S141 then; Otherwise represent satisfied definition in current minute, then direct execution in step S141.
Step S141 confirms that the current date time of obtaining is the time on date of planned dispatching.
The second embodiment of the present invention, the places different with first embodiment be, do not comprise the process of step 121 between step 125, when judge when the day before yesterday satisfy define after, directly turn to step S131.
Describe the implementation process of second embodiment below for example in detail:
Suppose that planned time is every month 1: 10 on the 5th, the current time is a point 6 days 13 May in 2005.The process of obtaining the concrete time of next time carrying out so is:
Step 1 compares month, because planned time is every month, so meet the demands execution in step two certainly.
Step 2, compare the date: plan day is 5, is 6 when the day before yesterday, and the difference of the two is-1, so current month is added 1, current date becomes: 6+ (1)=5, hour be adjusted into 0, and minute be adjusted into 0, at this moment the current time becomes 0: 0 on the 5th June in 2005, execution in step one then, and relatively month, the month of planned time this moment is every month, so satisfy definition, the difference in itself and current month is 0, so the step 2 of turning to continues the relatively date, plan day this moment is 5, when the day before yesterday also was 5, and the difference of the two all is 0, and execution in step three then;
Step 3, when smaller: plan hour is 1 point, and current hour is 0 point, and the difference of the two is 1, then adjusts current date: current hourage is directly added 1, and execution in step one then, the difference of this moment month, day, hour is 0, turns to step 4;
Step 4, relatively minute, difference is 10, minute adds 10, the time of this moment is 1: 10 on the 5th June in 2005.Confirm that promptly the current date time of obtaining is the time on date of planned dispatching.Execution time.
In the foregoing description, if the date of enterprise time of planned dispatching task only is that then step S111 was when certain month or every month, timing took place, confirm that the current date time of obtaining is the time on date of planned dispatching, subsequent process no longer carries out.
If the date of enterprise time of planned dispatching task, is then no longer carried out the processing procedure of step 121 between step 145 in such a month, and on such a day or when regularly taking place every month one day, when judge when the day before yesterday satisfy define after, directly turn to step S146.
If the date of enterprise time of planned dispatching task when in such a month, and on such a day some time or every month one day, the some time regularly took place, is then no longer carried out the processing procedure of step 141 between step 145, after judging current hour and satisfying definition, directly turn to step S146.
If the date of enterprise time of planned dispatching task is when certain month certain week or every month, certain week regularly took place, then no longer carry out step 111 between step 105, and step 131 is to the processing procedure of between step 145, when judge current week satisfy definition after, directly turn to step S146.
In the above-mentioned process of obtaining time execution date next time, at first from the current date time, the time on date of definition (promptly value is true) is satisfied in search backward, if there is the time on date of satisfying definition, then obtains time execution date next time according to above-mentioned steps; If the search failure is then searched for the time on date of satisfying definition from beginning in first month then backward.
With the month is the ergodic process that example illustrates time execution date next time that the present invention obtains: at first from current month, the month of definition (promptly value is true) is satisfied in search backward, if there is such month, then obtain time execution date next time according to above-mentioned steps; If the search failure is then searched for the time on date of satisfying definition from beginning in first month then backward.
Get access to the time on date of execution next time by above-mentioned steps as the present invention after, then carry out the scheduling of planned dispatching task according to described time execution date next time that gets access to.
As seen from the above technical solution provided by the invention, method of the present invention is based on the date of enterprise time of plan scheduler task in the Crontab character string definition timing iterator; Realize next time execution date obtain the planned dispatching task according to the timing iterator after the definition then.By the present invention, only need one regularly iterator just can realize set time every day carry out, the appointed day carries out weekly, every month appointed day carried out, every how many days/hour/minute/second carry out, the timing planned dispatching of the complexity of the combination in any of execution and above-mentioned various situations in the time between designation area.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.

Claims (10)

1, a kind of method of obtaining the timed task execution time is characterized in that, comprising:
A, based on Crontab character string definition time on timing date of plan scheduler task in the iterator regularly;
B, realize next time execution date of obtaining the planned dispatching task based on described timing iterator.
2, method according to claim 1 is characterized in that, described steps A specifically comprises:
A1, based on the Crontab character string, the Boolean type array is set in the timing iterator represents the time on date respectively;
Value in the Boolean type array of time on the date correspondence of A2, planned dispatching task is set to actual value.
3, method according to claim 1 and 2 is characterized in that, described step B specifically comprises:
B1, calculate the time on date and the difference of base period between the time of planned dispatching according to the timing iterator after the definition;
B2, obtain in the planned dispatching task time execution date next time of satisfying definition according to described difference.
4, method according to claim 3 is characterized in that, the described time on date comprises: time, month, day, date in week, hour and/or minute.
5, method according to claim 4 is characterized in that, described step B1 specifically comprises:
Month and the difference of base period between the month in the time in the time on date of B11, the described planned dispatching of calculating;
B12, whether judge described difference greater than 0, if described difference greater than 0, execution in step B13 then; Otherwise, execution in step B14;
B13, adjust the described base period time and be: keep the time constant, the month of base period in the time added the above difference, with the day of base period in the time, date in week, hour and minute be set to 1 day, 1 week, and 0 minute at 0 o'clock, return step B11 then;
B14, judge that whether described difference is less than 0, if described difference is less than 0, then the base period time of Tiao Zhenging is: the month of base period in the time added the above difference, the time of base period in the time added 1, with the day of base period in the time, date in week, hour and minute be set to 1 day, 1 week, and 0 minute at 0 o'clock, return step B11 then; Otherwise, execution in step B15;
B15, according to day and in the daytime the comparative result of base period in the time in the time on date of described planned dispatching, obtain in the planned dispatching task and to satisfy time execution date next time that defines;
Or,
Comparative result according to all dates in the time on date of described planned dispatching task and base period during the Sunday in the time obtains time execution date next time of satisfying definition in the planned dispatching task;
Or,
Confirm that the base period time of obtaining is the time on date of planned dispatching task.
6, method according to claim 5 is characterized in that, described step B15 comprises:
Day and in the daytime the difference of base period in the time in the time on date of B151, the described planned dispatching of calculating;
B152, whether judge described difference greater than 0, if described difference greater than 0, execution in step B153 then; Otherwise, execution in step B154;
B153, described base period time of adjustment are: the day of base period in the time added the above difference, keep time and the month of base period in the time constant, with base period in the time all dates, hour and minute be set to 1 week, and 0 minute at 0 o'clock, return step B11 then;
B154, judge that whether described difference is less than 0, if described difference is less than 0, then adjusting the described base period time is: the day of base period in the time added the above difference, and the month of base period in the time added 1, and according to the calendar algorithm adjust base period in the time month and time, and with all date of base period in the time, hour and minute be set to 1 week, and 0 minute at 0 o'clock, return step B11 then; Otherwise, execution in step B155;
B155, the comparative result according to all dates in the time on date of described planned dispatching and base period during the Sunday in the time obtain time execution date next time of satisfying definition in the planned dispatching task;
Or,
According in the time on date of described planned dispatching hour with the comparative result of medium and small time of base period time, obtain time execution date next time of satisfying definition in the planned dispatching task;
Or,
Confirm that the base period time of obtaining is the time on date of planned dispatching.
7, method according to claim 5 is characterized in that, described step B155 comprises:
B1551, calculate all dates in time on date of described planned dispatching task and the difference during the Sunday of base period in the time;
B1552, whether judge described difference greater than 0, if described difference greater than 0, execution in step B1553 then; Otherwise, execution in step B1554;
B1553, described base period time of adjustment are: all date of base period in the time added described difference, and according to time, month and the day of calendar algorithm adjustment base period in the time, with base period in the time hour and minute be set to 0 o'clock and 0 minute, return step B11 then;
B1554, judge that whether described difference is less than 0, if described difference is less than 0, then adjusting the described base period time is: all date of base period in the time added described difference, and obtain next week that adds all dates after the above difference according to the calendar algorithm, and according to time, month and the day of calendar algorithm adjustment base period in the time, with in the described time on date hour and minute be set to 0 o'clock and 0 minute, return step B11 then; Otherwise, execution in step B1555;
B1555, according to day and in the daytime the comparative result of base period in the time in the time on date of described planned dispatching, obtain in the planned dispatching task and to satisfy time execution date next time that defines;
Or,
Confirm that the base period time of obtaining is the time on date of planned dispatching.
8, method according to claim 7, it is characterized in that, step B155 or step B1555 are described according to day and in the daytime the comparative result of base period in the time in the time on date of described planned dispatching, obtain the process that satisfies time execution date next time of definition in the planned dispatching task and specifically comprise:
C101, calculate in time on date of described planned dispatching hour and base period in the time hour between difference;
C102, whether judge described difference greater than 0, if described difference greater than 0, execution in step C103 then; Otherwise, execution in step C104;
C103, adjust the described base period time and be: keep the time of base period in the time, month and day constant, base period hour is added the above difference in the time, will minute be set to 0 fen in the described time on date, return step B11 then;
C104, judge that whether described difference is less than 0, if described difference is less than 0, then adjusting the described base period time is: base period hour is added the above difference in the time, and base period day added 1 in the time, and adjust time, month and the day of base period in the time according to the calendar algorithm, with described base period in the time minute be set to 0 fen, return step B11 then; Otherwise, execution in step C105;
C105, according in the time on date of described planned dispatching minute and base period in the time minute between comparative result, obtain in the planned dispatching task time execution date next time of satisfying definition;
Or,
Confirm that the base period time of obtaining is the time on date of planned dispatching.
9, method according to claim 8 is characterized in that, described step C105 comprises:
C1051, calculate in time on date of described planned dispatching minute and base period in the time on date in the time minute between difference.
C1052, whether judge described difference greater than 0, if described difference greater than 0, execution in step C1053 then; Otherwise, execution in step C1054;
C1053, adjust the described base period time and be: keep the time of base period in the time, month, day and hour constant, base period minute is added the above difference in the time, return step B11 then;
C1054, judge that whether described difference is less than 0, if described difference is less than 0, then adjusting the described base period time is: base period hour is added 1 in the time, and according to the calendar algorithm adjust the time of base period in the time, month and day, return step B11 then; Otherwise, direct execution in step C1055.
The base period time that C1055, affirmation are obtained is the time on date of planned dispatching.
10, the base period time according to claim 3 comprises: the time on date of setting or current date time.
CN200510090902XA 2005-08-19 2005-08-19 Method for obtaining timing task carrying-out time Expired - Fee Related CN1862576B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200510090902XA CN1862576B (en) 2005-08-19 2005-08-19 Method for obtaining timing task carrying-out time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200510090902XA CN1862576B (en) 2005-08-19 2005-08-19 Method for obtaining timing task carrying-out time

Publications (2)

Publication Number Publication Date
CN1862576A true CN1862576A (en) 2006-11-15
CN1862576B CN1862576B (en) 2012-02-29

Family

ID=37390001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200510090902XA Expired - Fee Related CN1862576B (en) 2005-08-19 2005-08-19 Method for obtaining timing task carrying-out time

Country Status (1)

Country Link
CN (1) CN1862576B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103426134A (en) * 2013-08-12 2013-12-04 惠州市结核病防治研究所 System and method for supervising patient
WO2015043407A1 (en) * 2013-09-30 2015-04-02 Tencent Technology (Shenzhen) Company Limited Method, system, and apparatus for online service inspection
CN105094066A (en) * 2014-05-06 2015-11-25 中芯国际集成电路制造(上海)有限公司 Method and device for controlling production system
CN101615131B (en) * 2008-06-27 2016-04-27 中国电信股份有限公司 The dispatching method of the storage means of timing task information and device and timed task
CN106815072A (en) * 2017-01-16 2017-06-09 北京市天元网络技术股份有限公司 A kind of method for scheduling task
CN107545053A (en) * 2017-08-24 2018-01-05 郑州云海信息技术有限公司 A kind of group system caching query method and apparatus
TWI617203B (en) * 2016-12-23 2018-03-01 Chunghwa Telecom Co Ltd Monitoring data collection system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6032172A (en) * 1997-05-29 2000-02-29 Sun Microsystems, Inc. Distributed computer process scheduling mechanism

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101615131B (en) * 2008-06-27 2016-04-27 中国电信股份有限公司 The dispatching method of the storage means of timing task information and device and timed task
CN103426134A (en) * 2013-08-12 2013-12-04 惠州市结核病防治研究所 System and method for supervising patient
WO2015043407A1 (en) * 2013-09-30 2015-04-02 Tencent Technology (Shenzhen) Company Limited Method, system, and apparatus for online service inspection
CN105094066A (en) * 2014-05-06 2015-11-25 中芯国际集成电路制造(上海)有限公司 Method and device for controlling production system
TWI617203B (en) * 2016-12-23 2018-03-01 Chunghwa Telecom Co Ltd Monitoring data collection system and method
CN106815072A (en) * 2017-01-16 2017-06-09 北京市天元网络技术股份有限公司 A kind of method for scheduling task
CN107545053A (en) * 2017-08-24 2018-01-05 郑州云海信息技术有限公司 A kind of group system caching query method and apparatus
CN107545053B (en) * 2017-08-24 2021-01-22 苏州浪潮智能科技有限公司 Cluster system cache query method and device

Also Published As

Publication number Publication date
CN1862576B (en) 2012-02-29

Similar Documents

Publication Publication Date Title
CN1862576A (en) Method for obtaining timing task carrying-out time
CN1862575A (en) Method for planing dispatching timing task
CN1300693C (en) Device for adjusting used of system resource and its method
CN1826611A (en) Electronic appointment scheduling
CN1920781A (en) Task execution device and method
WO2006074027A3 (en) Mechanism to schedule threads on os-sequestered without operating system intervention
CN1728023A (en) Energy efficient achievement of integrated circuit performance goals
CN1783723A (en) Clock frequency divider circuit
CN1794855A (en) Method and device synchronous operating time in equipment management
CN1804803A (en) Software tool with modeling of asynchronous program flow
CN1828541A (en) Implementation method for timing task in Java operating system
CN1615471A (en) Method of determining a schedule, scheduler and system
CN1946075A (en) Method and system to determine a user specific relevance score of a message within a messaging system
TW200519605A (en) System, apparatus and method of enhancing priority boosting of scheduled threads
EP0735475A3 (en) Method and apparatus for managing objects in a distributed object operating environment
CN1834666A (en) Power conditioner
CN1641568A (en) Firmware automatic configuration system and method for substrate management controller
CN100351809C (en) Device and method for implementing intelligent agent in monitoring system
CN1501293A (en) Advertisement effect analyzing method and advertising system
CN1229932C (en) Program control information creating apparatus
CN1199243A (en) Apparatus and method for synthesis of module
CN1306407C (en) Method for autonomic self-learning in selecting resources for dynamic provisioning
CN1529858A (en) Computing system
CN1255683A (en) Batch workpiece transport controlling system and method for same
EP1022654A3 (en) Concurrent timed digital system design method and environment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120229

Termination date: 20130819