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

Method for obtaining timing task carrying-out time Download PDF

Info

Publication number
CN1862576B
CN1862576B CN200510090902XA CN200510090902A CN1862576B CN 1862576 B CN1862576 B CN 1862576B CN 200510090902X A CN200510090902X A CN 200510090902XA CN 200510090902 A CN200510090902 A CN 200510090902A CN 1862576 B CN1862576 B CN 1862576B
Authority
CN
China
Prior art keywords
time
date
base period
planned dispatching
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.)
Expired - Fee Related
Application number
CN200510090902XA
Other languages
Chinese (zh)
Other versions
CN1862576A (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

Images

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, as, enterprise need planned dispatching every day daily record 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, through defining simple character string, can accomplish 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 representes hour f3 representes which day in the month, and f4 representes month, and f5 representes which day in the week.In addition: all will carry out when f1 representes per minute during for *, f2 representes per hour to want executive routine during for *, and the rest may be inferred by analogy for it.Wherein, when f1 representes during for a-b will carry out in during this period of time from a minute to b minute, f2 representes will carry out by b hour from a during for a-b, and the rest may be inferred by analogy for it.Wherein, represent that when f1 is */n every n minute the time interval carry out once, f2 is that */n representes that every n hour the time interval carry out 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 the prior art one relevant with the present invention is: on Java timer frame foundation, be configured with a general planned dispatching framework, said planned dispatching framework provides through the timing iterator and obtains the interface of execution time next time.Said timing iterator can only be directed against certain concrete definition; The timing iterator of carrying out like set time every day, weekly the timing iterator carried out of appointed day, timing iterator that every month appointed day carried out, every at a distance from how many days/hour/minute/the timing iterator second carried out or the like; Through these said 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.
Technical scheme by prior art one can find out that the planned dispatching that it can only realize single through special timing iterator realizes the timing plan of various complicacies if desired, then must and make up through 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; Through 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 at a distance from how many days/hour/minute/second carry out, the timing planned dispatching of the complicacy of the combination in any of execution and above-mentioned various situation in the time between designation area.
The objective of the invention is to realize through following technical scheme:
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 said timing iterator.
Wherein, said steps A specifically comprises:
A1, based on the Crontab character string, the Boolean type array is set in the timing iterator representes 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, said 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 said difference.
Wherein, the said time on date comprises: time, month, day, date in week, hour and/or minute.
Wherein, said 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 said planned dispatching of calculating;
B12, whether judge said difference greater than 0, if said difference greater than 0, execution in step B13 then; Otherwise, execution in step B14;
B13, adjustment are at the said base period time: 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 said difference is less than 0; If said difference is less than 0; Then the base period time of adjustment 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 said planned dispatching, obtain in the planned dispatching task and to satisfy time execution date next time that defines;
Or,
According to the comparative result during all dates in the time on date of said planned dispatching task and the Sunday of base period in the 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 task.
Wherein, said step B15 comprises:
Day and in the daytime the difference of base period in the time in the time on date of B151, the said planned dispatching of calculating;
B152, whether judge said difference greater than 0, if said difference greater than 0, execution in step B153 then; Otherwise, execution in step B154;
B153, adjustment are at the said base period time: 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 said difference is less than 0; If said difference is less than 0; Then adjusting the said 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 calendar algorithm adjustment 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, according to the comparative result during all dates in the time on date of said planned dispatching and the Sunday of base period 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 said 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, said step B155 comprises:
B1551, calculate all dates and the difference during the Sunday of base period in the time in time on date of said planned dispatching task;
B1552, whether judge said difference greater than 0, if said difference greater than 0, execution in step B1553 then; Otherwise, execution in step B1554;
B1553, said base period time of adjustment are: all date of base period in the time added said 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 said difference is less than 0; If said difference is less than 0; Then adjusting the said base period time is: all date of base period in the time added said difference; And obtain next week that adds all dates after the above difference according to the calendar algorithm, and according to the time of calendar algorithm adjustment base period in the time, month and day, with in the said 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 said 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 said according to day and in the daytime the comparative result of base period in the time in the time on date of said 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 said planned dispatching hour and base period in the time hour between difference;
C102, whether judge said difference greater than 0, if said difference greater than 0, execution in step C103 then; Otherwise, execution in step C104;
C103, adjustment are at the said base period time: keep the time of base period in the time, month and day constant, base period hour is added the above difference in the time, with minute being set to 0 fen in the said time on date, return step B11 then;
C104, judge that whether said difference is less than 0; If said difference is less than 0; Then adjusting the said 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 time of calendar algorithm adjustment base period in the time, month and day, with said 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 said 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, said step C105 comprises:
C1051, calculate in time on date of said planned dispatching minute and base period in the time on date in the time minute between difference.
C1052, whether judge said difference greater than 0, if said difference greater than 0, execution in step C1053 then; Otherwise, execution in step C1054;
C1053, adjustment are at the said base period time: 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 said difference, be if said difference, is then adjusted the said base period time less than 0 less than 0: base period hour is added 1 in the time, and according to the time of calendar algorithm adjustment 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.
Technical scheme by the invention described above provides can find out that 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; Next time execution date of obtaining the planned dispatching task based on said timing iterator realization then.Through 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 at a distance from how many days/hour/minute/second carry out, the timing planned dispatching of the complicacy of the combination in any of execution and above-mentioned various situation 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; Next time execution date of obtaining the planned dispatching task based on said timing iterator realization 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 representes the time on date respectively, then, the value in the Boolean type array of the time on date of planned dispatching task correspondence is set to actual value.
Specify the concrete implementation procedure of this step below for example:
As, with 5 Boolean type arrays come to represent respectively minute, hour, day, month, week, array length is respectively 60,24,31,12 and 7, is worth for true representes 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 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 calculating, this value can ownly define, and also can give tacit consent to from the current date time to begin.Then, the present invention obtains time execution date next time of satisfying definition in the planned dispatching task according to said calculated difference, and according to the task of being obtained of the date time scheduling planning execution of execution next time.Concrete implementation procedure,, as shown in Figure 1 with acquiescence from the current date time, comprising:
Step S101 calculates the timing month of said planned dispatching task and the difference between current month.
Step S102 judges that whether said difference is greater than 0.
If said difference is greater than 0; Then represent to satisfy definition by certain moon after current month; So execution in step S103 promptly adjusts the current date time and is: keep the time constant, current month is added the above difference; With the day in the said 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 said difference is not more than 0, then execution in step S104 judges that promptly whether said difference is less than 0; If said 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 said 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 said planned dispatching task.
Step S112 judges that whether said difference is greater than 0.
If said 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 said difference the day before yesterday, keep time and month constant, with all dates in the said time on date, hour and minute be set to 1 week, and 0 minute at 0 o'clock; Execution in step S101 then.
If said difference is not more than 0, then execution in step S114 judges that promptly whether said difference is less than 0; If said difference, is then represented current one day a few days ago less than 0 and is satisfied definition, that is to say; Satisfy definition the one day of next month; So execution in step S115 promptly adjusts current date and is: ought add said difference the day before yesterday, and the month in the current date is added 1; And adjust month and time in the said time on date according to the calendar algorithm, and with all dates in the said 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 and the difference during current Sunday in time on date of said planned dispatching task.
Step S122 judges that whether said difference is greater than 0.
If said 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: current week is added said difference on the date, and according to calendar algorithm adjustment time, month and day, with in the said time on date hour and minute be set to 0 o'clock and 0 minute; Execution in step S101 then.
If said difference is not more than 0, then execution in step S124 judges that promptly whether said difference is less than 0; If said difference is less than 0; Then represent next week on date in current week to satisfy definition, so execution in step S125 promptly adjusts the current date time and is: the current date in week is added said 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 said 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 said planned dispatching task.
Step S132 judges that whether said difference is greater than 0.
If said difference is greater than 0; Then represent the satisfied definition in certain hour after current hour; So execution in step S133 promptly adjusts the current date time and is: keep time, month and day constant, with adding the above difference in current hour; And keep time, month and day constant, with minute being set to 0 fen in the said time on date; Execution in step S101 then.
If said difference is not more than 0, then execution in step S134 judges that promptly whether said difference is less than 0; If said 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: with adding the above difference in current hour; And ought add 1 the day before yesterday, and according to calendar algorithm adjustment time, month and day, with minute being set to 0 fen in the said 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 said planned dispatching task minute and current date in the time minute between difference.
Step S142 judges that whether said difference is greater than 0.
If said 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 said difference is not more than 0, then execution in step S144 judges that promptly whether said difference is less than 0; If said 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 calendar algorithm adjustment 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 between step 121 to step 125, when judge when the day before yesterday satisfy define after, directly turn to step S131.
Specify the implementation process of second embodiment below for example:
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, relatively 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, and current date becomes: 6+ (1)=5, hour be adjusted into 0, minute be adjusted into 0; At this moment the current time becomes 0: 0 on the 5th June in 2005, and execution in step one then, and relatively month, the month of planned time this moment is every month; So satisfy definition, its difference with current month is 0, so the step 2 of turning to continues the comparison date; Plan day this moment is 5, also is 5 when the day before yesterday, 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 did 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 between step 121 to 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 between step 141 to 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 between step 111 a to step 105; And the processing procedure of between step 131 to 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 begin 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 is explained time execution date next time that the present invention obtains: at first from beginning in 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 through above-mentioned steps as the present invention after, then carry out the scheduling of planned dispatching task according to said time execution date next time that gets access to.
Technical scheme by the invention described above provides can find out that 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; Next time execution date that the planned dispatching task is obtained in realization according to the timing iterator after the definition then.Through 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 at a distance from how many days/hour/minute/second carry out, the timing planned dispatching of the complicacy of the combination in any of execution and above-mentioned various situation in the time between designation area.
The above; Be merely the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, any technician who is familiar with the present technique field is 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 (8)

1. a 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 said timing iterator;
Said 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 said difference;
Said 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 said planned dispatching of calculating;
B12, judge that whether month and the difference of base period between the month in the time in time on date of said planned dispatching be greater than 0; If month in the time on date of said planned dispatching and the difference of base period between the month in the time be greater than 0, execution in step B13 then; Otherwise, execution in step B14;
B13, said base period time of adjustment are: keep the time constant; Added month and the difference of base period between the month in the time in time on date of the above planned dispatching the month of base period in the time; 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 month and the difference of base period between the month in the time in time on date of said planned dispatching be less than 0; If month in the time on date of said planned dispatching and the difference of base period between the month in the time are less than 0; Then the base period time of adjustment is: added month and the difference of base period between the month in the time in time on date of the above planned dispatching the month of base period in the time; 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 said planned dispatching, obtain in the planned dispatching task and to satisfy time execution date next time that defines;
Or,
According to the comparative result during all dates in the time on date of said planned dispatching task and the Sunday of base period in the 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 task.
2. method according to claim 1 is characterized in that, said steps A specifically comprises:
A1, based on the Crontab character string, the Boolean type array is set in the timing iterator representes 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 is characterized in that, the said time on date comprises: time, month, day, date in week, hour and/or minute.
4. method according to claim 1; It is characterized in that; Among the said step B15 according to day and in the daytime the comparative result of base period in the time in the time on date of said planned dispatching, obtain in the planned dispatching task and to satisfy time execution date next time that defines and comprise:
Day and in the daytime the difference of base period in the time in the time on date of B151, the said planned dispatching of calculating;
B152, whether judge day and in the daytime the difference of base period in the time in time on date of said planned dispatching greater than 0, if in the time on date of said planned dispatching day with in the daytime the difference of base period in the time greater than 0, execution in step B153 then; Otherwise, execution in step B154;
B153, adjustment are at the said base period time: added day and in the daytime the difference of base period in the time in time on date of the above planned dispatching the day of base period in the time; Keep time and the month of base period in the time constant; 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;
B154, judge that whether day and in the daytime the difference of base period in the time in time on date of said planned dispatching be less than 0; If in the time on date of said planned dispatching the day with in the daytime the difference of base period in the time less than 0; Then adjusting the said base period time is: the day of base period in the time added day and in the daytime the difference of base period in the time in time on date of the above planned dispatching; And the month of base period in the time added 1; And according to calendar algorithm adjustment month and the time of base period in the 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, according to the comparative result during all dates in the time on date of said planned dispatching and the Sunday of base period 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 said 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.
5. method according to claim 4; It is characterized in that; Among the said step B155 according to the comparative result during all dates in the time on date of said planned dispatching and the Sunday of base period in the time, obtain time execution date next time of satisfying definition in the planned dispatching task to comprise:
B1551, calculate all dates and the difference during the Sunday of base period in the time in time on date of said planned dispatching task;
B1552, judge that whether all dates and the difference during the Sunday of base period in the time in time on date of said planned dispatching task be greater than 0; If the difference during all dates in the time on date of said planned dispatching task and the Sunday of base period in the time is greater than 0, execution in step B1553 then; Otherwise, execution in step B1554;
B1553, adjustment are at the said base period time: added all dates and the difference during the Sunday of base period in the time in time on date of said planned dispatching task all dates of base period in the time; 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 all dates and the difference during the Sunday of base period in the time in time on date of said planned dispatching task be less than 0; If the difference during all dates in the time on date of said planned dispatching task and the Sunday of base period in the time is less than 0; Then adjusting the said base period time is: added all dates and the difference during the Sunday of base period in the time in time on date of said planned dispatching task all dates of base period in the time; And obtain according to the calendar algorithm all dates and next week on all dates after the difference during the Sunday of base period in the time in the time on date that adds the above planned dispatching task; And according to time, month and the day of calendar algorithm adjustment base period in the time; With in the said 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 in the time on date of said planned dispatching hour with base period in the time hour 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.
6. method according to claim 5; It is characterized in that; Step B1555 said according in the time on date of said planned dispatching hour with base period in the time hour comparative result, the process of obtaining in the planned dispatching task time execution date next time of satisfying definition specifically comprises:
C101, calculate in time on date of said planned dispatching hour and base period in the time hour between difference;
C102, judge in time on date of said planned dispatching hour and base period in the time hour between difference whether greater than 0; If in the time on date of said planned dispatching hour and base period in the time hour between difference greater than 0, execution in step C103 then; Otherwise, execution in step C104;
C103, said base period time of adjustment are: keep time, month and the day of base period in the time constant; With base period in the time on date that hour adds the above planned dispatching in the time hour and base period in the time hour between difference; With minute being set to 0 fen in the said time on date, return step B11 then;
C104, judge in time on date of said planned dispatching hour and base period in the time hour between difference whether less than 0; If in the time on date of said planned dispatching hour and base period in the time hour between difference less than 0; Then adjusting the said base period time is: with base period in the time on date that hour adds the above planned dispatching in the time hour and base period in the time hour between difference; And base period day added 1 in the time; And according to the time of calendar algorithm adjustment base period in the time, month and day, said base period minute is set to 0 fen in the time, return step B11 then; Otherwise, execution in step C105;
C105, according in the time on date of said 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.
7. method according to claim 6; It is characterized in that; Among the said step C105 according in the time on date of said 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 to comprise:
C1051, calculate in time on date of said planned dispatching minute and base period in the time on date in the time minute between difference;
C1052, judge in time on date of said planned dispatching minute and base period in the time on date in the time minute between difference whether greater than 0; If in the time on date of said planned dispatching minute and base period in the time on date in the time minute between difference greater than 0, execution in step C1053 then; Otherwise, execution in step C1054;
C1053, adjustment are at the said base period time: keep the time of base period in the time, month, day and hour constant; With base period in the time on date that minute adds the above planned dispatching in the time minute and base period in the time on date in the time minute between difference, return step B11 then;
C1054, judge in time on date of said planned dispatching minute and base period in the time on date in the time minute between difference whether less than 0; If in the time on date of said planned dispatching minute and base period in the time on date in the time minute between difference less than 0; Then adjusting the said base period time is: base period hour is added 1 in the time; And, return step B11 then according to time, month and the day of calendar algorithm adjustment base period in the time; Otherwise, direct execution in step C1055;
The base period time that C1055, affirmation are obtained is the time on date of planned dispatching.
8. method according to claim 1 is characterized in that, the described base period time 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 CN1862576A (en) 2006-11-15
CN1862576B true 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)

Families Citing this family (7)

* 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
CN104518903B (en) * 2013-09-30 2019-01-08 腾讯科技(北京)有限公司 Business method for inspecting, system and device on line
CN105094066B (en) * 2014-05-06 2018-02-02 中芯国际集成电路制造(上海)有限公司 The control method and device of 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
CN107545053B (en) * 2017-08-24 2021-01-22 苏州浪潮智能科技有限公司 Cluster system cache query method and device

Citations (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

Patent Citations (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

Also Published As

Publication number Publication date
CN1862576A (en) 2006-11-15

Similar Documents

Publication Publication Date Title
CN1862576B (en) Method for obtaining timing task carrying-out time
CN1862575B (en) Method for planing dispatching timing task
US10062043B2 (en) System and method for dynamically coordinating tasks, schedule planning, and workload management
US20030054325A1 (en) Techniques for handling time zone changes in personal information management software
US10841401B2 (en) Context prediction
CN103475786A (en) Method and system for setting mobile terminal alarm clock
CA2812525A1 (en) Virtual server control system and program
CN111522719A (en) Method and device for monitoring big data task state
CN110955695A (en) Data processing method and device
CN1983315A (en) System and method for synchronizing schedule reminding time zone
JP2011188656A (en) Method and system for controlling distributed power supply
Scavino Effect of multiple calendars on total float and critical path
CN102096857A (en) Collaboration method and device for data processing process
CN108833719B (en) Reminding service realization method and device
CN110009391B (en) Periodic event information determining method and device
WO2008025118A1 (en) Conflict checking and notification in an electronic device
Koppang et al. New steering strategies for the USNO master clocks
CN107169129B (en) Scheduling method and device
EP0141443A1 (en) Improvements in electric systems for automatically connecting and/or disconnecting electric circuits, specially in lighting
JP2000172768A (en) Safety stock volume calculating device
Koch The re-incarnation, re-interpretation and re-demise of the transition probability model
CN104463565A (en) Time computing method for service grade management
CH673555GA3 (en)
Meeus et al. Polynomial approximations to Delta T, 1620 (2000 AD
CN101452545A (en) Electronic programme arrangement system and method with color cuing display

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