CN107193579A - The implementation method and device of plan target - Google Patents
The implementation method and device of plan target Download PDFInfo
- Publication number
- CN107193579A CN107193579A CN201710195260.2A CN201710195260A CN107193579A CN 107193579 A CN107193579 A CN 107193579A CN 201710195260 A CN201710195260 A CN 201710195260A CN 107193579 A CN107193579 A CN 107193579A
- Authority
- CN
- China
- Prior art keywords
- field
- benchmark
- cron
- cron expression
- check box
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/466—Transaction processing
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a kind of implementation method of plan target and device, method therein includes:Configuration baseline field drop-down list;The trigger event of benchmark field drop-down list is monitored, currently selected fixed benchmark field is determined;Corresponding relation based on the benchmark field that pre-sets with cron expression formula forms, determines described currently selected to determine the corresponding cron expression formulas form of benchmark field;One or more values of the check box of each field in the cron expression formulas form determined by obtaining, generate cron expression formulas.The present invention can reduce error rate, simplify cron views.
Description
Technical field
The present invention relates to field of computer technology, and in particular to the implementation method and device of plan target.
Background technology
Plan target (cron), is that task performs the work being planned in the time of agreement.For example, can be in configuration
Arrange to restart httpd servers 4 points of every morning in file, dibbling every night 10 sends out envelope letter to some mailbox,
All it is plan target.
Cron expression formulas be used to indicate that task when a kind of expression formula performed, it be generally used for configure plan target
Triggered time.Cron expression formulas are the character strings of six or seven subexpression (field) compositions, and subexpression (word
Section) between separated with space.For example, a kind of typical cron expression formulas field includes:Second, point, when, day, week, month, year.
The cron expression formulas designed at present are required for user to fill in the value of each field manually, so that completion timing is set.
This user writes the mode of cron expression formulas manually, and error rate is higher, for example have input Chinese question mark () and the expression that causes
Formula parsing failure.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome above mentioned problem or at least in part solve on
State the implementation method and device of the plan target of problem.
According to one aspect of the present invention there is provided a kind of implementation method of plan target, including:Configuration baseline field is pulled down
List;The trigger event of benchmark field drop-down list is monitored, currently selected fixed benchmark field is determined;Based on the base pre-set
The corresponding relation of quasi- field and cron expression formula forms, determines described currently selected to determine the corresponding cron expression formulas lattice of benchmark field
Formula;One or more values of the check box of each field in the cron expression formulas form determined by obtaining, generate cron tables
Up to formula.
It is preferred that, the value of the check box of each field in the cron expression formulas form determined by the acquisition, generation
Cron expression formulas, including:To the onchange events of the check box of each field in the identified cron expression formulas form
It is monitored, when monitoring onchange events, calls and state cron expression formula generating functions, gets generation onchange things
One or more values of the check box of the field of part;According to one or more values of the check box of each field, cron tables are generated
Up to formula.
It is preferred that, the value of the check box according to each field generates cron expression formulas, including:For identified
Each field in the cron expression formulas form, sets up empty array;Based on benchmark field and occur onchange events it is each
One or more values of individual field, update the value of the array;The array is spliced into character string, the cron expression is obtained
Formula.
It is preferred that, the benchmark field pre-set and the corresponding relation of cron expression formula forms, including:Based on each
Benchmark field, determines the corresponding all subordinate's fields of each benchmark field;For each subordinate's field, configuration subordinate field
Check box, so as to complete the setting of the cron expression formula forms corresponding to each benchmark field.
It is preferred that, based on the drop down list control built in JavaScript, the benchmark field drop-down list is configured, with
And, based on the check box control built in JavaScript, the check box of configuration subordinate field.
According to another aspect of the present invention there is provided a kind of device of realizing of plan target, including:Benchmark field configuration list
Member, for configuration baseline field drop-down list;Benchmark field monitoring unit, the triggering thing for monitoring benchmark field drop-down list
Part, determines currently selected fixed benchmark field;Determining unit, for based on the benchmark field pre-set and cron expression formula lattice
The corresponding relation of formula, determines described currently selected to determine the corresponding cron expression formulas form of benchmark field;Expression formula generation unit, is used
One or more values of the check box of each field in the cron expression formulas form determined by obtaining, generation cron expression
Formula.
It is preferred that, the expression formula generation unit specifically for:To each in the identified cron expression formulas form
The onchange events of the check box of field are monitored, when monitoring onchange events, are called and are stated the life of cron expression formulas
Into function, one or more values of the check box for the field for occurring onchange events are got;And, according to each field
One or more values of check box, generate cron expression formulas.
It is preferred that, the expression formula generation unit specifically for:For each in the identified cron expression formulas form
Individual field, sets up empty array;Value based on benchmark field and each field for occurring onchange events, updates the array
Value;The array is spliced into character string, the cron expression formulas are obtained.
It is preferred that, in addition to:Setting unit, for based on each benchmark field, determining that each benchmark field is corresponding
All subordinate's fields;For each subordinate's field, the check box of configuration subordinate field, so as to complete corresponding to each benchmark field
Cron expression formula forms setting.
It is preferred that, based on the drop down list control built in JavaScript, the benchmark field drop-down list is configured, with
And, based on the check box control built in JavaScript, the check box of configuration subordinate field.
It can be seen that, the present invention is improved for the mode for being manually entered each field value of prior art, is arranged by pulling down
The mode of table and check box, user only needs to carry out simple selection to the option of each field, due to not needing user's input,
So as to avoid user's input error, error rate is thus reduced;Further, since only showing that selected reference field is corresponding and has triggering
Subordinate's field of event, therefore, it can more directly perceived, succinct displaying timed task triggered time view;Moreover, the present invention can
Realized by JavaScript scripts, therefore, it is possible to very easily be integrated with some existing frameworks.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention,
And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can
Become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit is common for this area
Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention
Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows the implementation method flow chart of the plan target provided according to one embodiment of present invention;
Fig. 2 shows that cron expression formulas are regarded in the implementation method of the plan target provided according to one embodiment of present invention
Diagram is intended to;
Fig. 3 shows the implementation method flow chart of the plan target provided according to another embodiment of the invention;
Fig. 4 shows cron expression formulas in the implementation method of the plan target provided according to another embodiment of the invention
View schematic diagram;
What Fig. 5 showed the plan target provided according to one embodiment of the invention realizes apparatus structure schematic diagram;
What Fig. 6 showed the plan target provided according to a further embodiment of the invention realizes apparatus structure schematic diagram.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
For the error rate that is manually entered each field value in cron input frames in the prior art and exists it is high the problem of,
The present invention realizes a kind of visual cron expression formulas, due to only need user selection determine each field value, without with
Family means input, so as to greatly reduce the probability of error, while can also be according to existing cron expression formulas by task
Triggered time be intuitively shown on interface.
With reference to Fig. 1, for the implementation method flow chart of the plan target provided according to one embodiment of the present of invention, including such as
Lower step S101-S104.
S101:Configuration baseline field drop-down list.
Skilled in the art realises that, a cron expression formula has at least six (may also be 7) to have the field of space-separated
(time element).
For example, time element is followed successively by order:
Second (0~59);
Divide (0~59);
When (0~23);
My god (moon) (0~31, it is necessary to consider the number of days of the moon);
All (what day) (1~7:SUN, MON, TUE, WED, THU, FRI, SAT);
The moon (0~11);
Year (such as 1970-2099).
In the present invention, any of the above time elements can serve as benchmark field, therefore, pulls down and arranges in benchmark field
In table configuration, each above-mentioned time element is configured to the respective option of drop-down list.
In the specific implementation, JavaScript drop down list controls can be based on, the configuration of benchmark field drop-down list is realized.
A kind of literal translation formula scripts of JavaScript, are a kind of regime type, weak type, the language based on prototype, interior
Put support type.Its interpreter is referred to as JavaScript engine, is a part for browser, is widely used in the pin of client
This language, is to be used on HTML (application under standard generalized markup language) webpage earliest, for increasing to html web page
Plus dynamic function.
JavaScript is widely used in webpage design and special effect of web making etc..Almost all of webpage can all be used
JavaScript, such as form validation, animation, style sheet control etc..In the exploitation of webpage, built-in many bases
The control of plinth, such as input frame, drop-down list, check box etc., and the control on a little bases also provides some events machine
System can allow JavaScript to make corresponding response.Therefore, the present invention can be developed very rich based on these events
Rich function, meanwhile, some error-prone text entry operations can be simplified to the selection operation at interface, in all its bearings
The demand of user is met to extend these basic controls.
S102:The trigger event of benchmark field drop-down list is monitored, currently selected fixed benchmark field is determined.
For example, the onchange events by monitoring benchmark field drop-down list, when the option of benchmark field drop-down list
When changing, it may be determined that go out the benchmark field currently selected by user.Wherein, onchange events are to change defeated in client
Enter the value of control, such as one textbox can trigger this event, that is, onchange is triggered when element value changes.
S103:Corresponding relation based on the benchmark field pre-set with cron expression formula forms, determines the currently quilt
The corresponding cron expression formulas form of selected reference field.
In present invention, it is desirable to the benchmark field pre-set and the corresponding relation of cron expression formula forms, were specifically set
Journey includes:Based on each benchmark field, the corresponding all subordinate's fields of each benchmark field are determined;For each subordinate's word
Section, the drop-down list of configuration subordinate field, so as to complete the setting of the cron expression formula forms corresponding to each benchmark field.
Still using the above-mentioned second, point, when, day, week, the moon, year time element as field, for example, on the basis of selected " year "
Field, then subordinate's field in " year " includes:" second, point, when, day, week, the moon ";If field on the basis of selected " moon ", then
Subordinate's field of " moon " includes:" second, point, when, day, week ";If field on the basis of selected " week ", then subordinate's field in " week "
Including:" second, point, when, day ";If it is selected " my god " on the basis of field, then " my god " subordinate's field include:" second, point, when ";
If it is selected " when " on the basis of field, then " when " subordinate's field include:" second, point ";If field on the basis of selected " dividing ",
The subordinate's field so " divided " includes:" second ";If field on the basis of selected " second ", because the second has been minimum tempon
Element, thus the second there is no subordinate's field.
Determine after each corresponding subordinate's field of each benchmark field, it is necessary to configure the drop-down row of each subordinate's field
Table, so as to complete the setting of the cron expression formula forms corresponding to each benchmark field.The drop-down row of concrete configuration subordinate field
The mode of table, can still be realized based on JavaScript drop down list controls as previously described.
S104:The value of the drop-down list of each field in cron expression formula forms determined by obtaining, generation cron expression
Formula.
In one implementation, the value of the drop-down list of each field in cron expression formula forms determined by obtaining,
Cron expression formulas are generated, including:To the onchange things of the drop-down list of each field in identified cron expression formulas form
Part is monitored, when monitoring onchange events, is called and is stated cron expression formula generating functions, gets generation onchange
The value of the drop-down list of the field of event;According to the value of the drop-down list of each field, cron expression formulas are generated.
Further, according to the value of the drop-down list of each field, cron expression formulas are generated, including:For identified institute
Each field in cron expression formula forms is stated, an empty array of field number correspondence size is set up;Based on benchmark field and
Occur the value of each field of onchange events, update the value of array;Array is spliced into character string, cron expression is obtained
Formula.
Wherein, by the onchange events for the drop-down list for monitoring each field, each subordinate's field can be learnt
The value of option changes.Then again by way of above-mentioned array assignment, you can obtain each field (benchmark field and each
Individual subordinate's field) option value, so as to ultimately generate cron expression formulas.
Below with a specific example, the implementation method to the plan target described in Fig. 1 carries out exemplary description.
In the example, in task dispatching platform website for task configure cron expression formulas, comprise the following steps (1)-
(3)。
(1) represent that task triggers date reference field using a drop-down list
For example, it is necessary to configure a cron expression formula for task in the configuration of timed task, the task can be " every
Year ", " monthly ", " weekly ", " daily ", " per hour ", " per minute ", " each second " triggering.Here a drop-down row are accomplished by
Table represents the benchmark field of task triggering, and example code is as follows:
Value therein represents the id of benchmark field, subsequently can the root root benchmark field show other fields correspondence
Drop-down list.
(2) the benchmark field triggered by task shows other fields
For example, because seven fields of cron expression formulas are corresponded to respectively:Second, point, when, day, week, month, year, therefore, configuration
Following " benchmark field-subordinate's field " display rule:
If the selection of benchmark field is " year ":So expression formula form is:_ _ _ _ month
If the selection of benchmark field is " moon ":So expression formula form is:_ _ _ date *
If the selection of benchmark field is " week ":So expression formula form is:___* what day
If benchmark field selection for " my god ":So expression formula form is:___**
If benchmark field selection for " when ":So expression formula form is:__***
If the selection of benchmark field is " dividing ":So expression formula form is:_****
If the selection of benchmark field is " second ":So expression formula form is:*****
Wherein, above-mentioned expression formula form for " second, point, when, day, week, month, year ", the value of " _ " representatives " second, divide or when ",
" * " represent any value can, "" represent to ignore.
Pass through rule as above, when selecting different benchmark fields, the corresponding drop-down of field that other needs are shown
List display comes out.
In order to realize the display of other subordinate's fields, it is necessary to be pre-configured with the drop-down list of each subordinate's field.For example, right
In each field of each cron expression formulas, it is mapped therewith with a drop-down list.Code sample is as follows:
Complete " benchmark field-subordinate's field " rule configuration and each subordinate's field drop-down list configuration it
Afterwards, it is possible to realize the display of other field drop-down lists by monitoring the option change events of benchmark field drop-down list.
For example, the onchange events of benchmark drop-down list are monitored, when the option of benchmark drop-down list changes
Wait, just readjustment this function of baseChage:
$("#base").on('change',baseChage);
Accordingly, it would be desirable to define in event call-back method baseChage, this method, need are shown according to benchmark field id
The drop-down list to be shown.Code sample is as follows.
First all field drop-down lists are stashed first, code is as follows
$("#month").hide();
Other fields are similar.
Secondly, rule in previous step (2) shows corresponding drop-down list:
// choosing is annual, then shows monthly
If (baseId==7)
$("#month").show();
};
The same logic of the drop-down lists of other fields.
So far:The display of the corresponding drop-down list of each field is achieved that by the step.It can be seen that, the present invention can be with
Effectively control which field to need display, which field need not be shown, so as to reduce unnecessary operation, also cause boundary
Face is succinct.
(3) cron expression formulas are generated by the value of each drop-down list
An onchange event is bound for the corresponding drop-down list of each field, when being triggered onchange events,
The function of a cron expression formulas generation is just called, code sample is as follows:
(3.1) onchange events are bound for each drop-down list:
$("#month").on('change',gegerateCron);
$("#weekDay").on('change',gegerateCron);
$("#day").on('change',gegerateCron);
$("#hour").on('change',gegerateCron);
$("#minute").on('change',gegerateCron);
$("#second").on('change',gegerateCron);
(3.2) when the drop-down list of corresponding field changes, the function bound before will be triggered
GegerateCron, code is as follows:
First, being received within each field in an array, the content of corresponding field is subsequently replaced again.
For example, var cron=[' * ', ' * ', ' * ', ' * ', ' * ', ''];Respectively correspond to the second, point, when, day, the moon, week.
Using benchmark field and subordinate's field as below step Rule of judgment.
Var baseId=$ (' #base') .val ();
Var name=$ (this) .attr (" id ");
Then, according to benchmark field and subordinate's field of generation trigger event, by the array of the correspondence position in step a
Value is replaced, and code snippet is as follows:
The replacement of other corresponding fields and similar to the above.
Finally, then by array be spliced into a character string, you can with arrive required cron expression formulas, return
cron.join("");
So far:Final cron expression formulas are just obtained.
It is an exemplary cron expression formula view with reference to Fig. 2, wherein, benchmark field is the moon, occurs trigger event
Subordinate's field be day, when and point, by way of above-mentioned acquisition each field value, finally show cron expression as shown in Figure 2
Formula view.It can be seen that, in Fig. 2, the set of time of timed task is:The 1st day monthly 6 when 5 points.
It can be seen that, the present invention is manually entered each field in the implementation method of above-mentioned plan target for prior art
The mode of value is improved, by way of drop-down list, and user only needs to carry out simple selection to the option of each field,
Due to not needing user's input, so as to avoid user's input error, error rate is thus reduced;Further, since only showing selected base
Quasi- field is corresponding and has subordinate's field of trigger event, when therefore, it can more directly perceived, succinct displaying timed task triggering
Between view;Moreover, the present invention can be realized by JavaScript scripts, therefore, it is possible to very easily with some existing frameworks
Integrated.
With reference to Fig. 3, for the implementation method flow chart of the plan target provided according to an alternative embodiment of the invention, including
Following steps S301-S304.It is with the implementation method main difference of Fig. 1 plan targets provided, the meter that the present embodiment is provided
In the implementation method for the task of drawing, each subordinate's field is realized based on check box, i.e. each subordinate's field can provide multiple
Option.
S301:Configuration baseline field drop-down list.
Skilled in the art realises that, a cron expression formula has at least six (may also be 7) to have the field of space-separated
(time element).
For example, time element is followed successively by order:
Second (0~59);
Minute (0~59);
Hour (0~23);
My god (moon) (0~31, it is necessary to consider the number of days of the moon);
All several (weeks) (1~7:SUN, MON, TUE, WED, THU, FRI, SAT);
The moon (0~11);
Time (1970-2099).
In the present invention, any of the above time elements can serve as benchmark field, therefore, pulls down and arranges in benchmark field
In table configuration, each above-mentioned time element is configured to the respective option of drop-down list.
In the specific implementation, JavaScript drop down list controls can be based on, the configuration of benchmark field drop-down list is realized.
A kind of literal translation formula scripts of JavaScript, are a kind of regime type, weak type, the language based on prototype, interior
Put support type.Its interpreter is referred to as JavaScript engine, is a part for browser, is widely used in the pin of client
This language, is to be used on HTML (application under standard generalized markup language) webpage earliest, for increasing to html web page
Plus dynamic function.
JavaScript is widely used in webpage design and special effect of web making etc..Almost all of webpage can all be used
JavaScript, such as form validation, animation, style sheet control etc..In the exploitation of webpage, built-in many bases
The control of plinth, such as input frame, drop-down list, check box etc., and the control on a little bases also provides some events machine
System can allow JavaScript to make corresponding response.Therefore, the present invention can be developed very rich based on these events
Rich function, meanwhile, some error-prone text entry operations can be simplified to the selection operation at interface, in all its bearings
The demand of user is met to extend these basic controls.
S302:The trigger event of benchmark field drop-down list is monitored, currently selected fixed benchmark field is determined.
For example, the onchange events by monitoring benchmark field drop-down list, when the option of benchmark field drop-down list
When changing, it may be determined that go out the benchmark field currently selected by user.Wherein, onchange events are to change defeated in client
Enter the value of control, such as one textbox can trigger this event, that is, onchange is triggered when element value changes.
S303:Corresponding relation based on the benchmark field pre-set with cron expression formula forms, it is currently selected fixed to determine
The corresponding cron expression formulas form of benchmark field.
In present invention, it is desirable to the benchmark field pre-set and the corresponding relation of cron expression formula forms, were specifically set
Journey includes:Based on each benchmark field, the corresponding all subordinate's fields of each benchmark field are determined;For each subordinate's word
Section, the check box of configuration subordinate field, so as to complete the setting of the cron expression formula forms corresponding to each benchmark field.
Still using the above-mentioned second, point, when, day, week, the moon, year time element as field, for example, on the basis of selected " year "
Field, then subordinate's field in " year " includes:" second, point, when, day, week, the moon ";If field on the basis of selected " moon ", then
Subordinate's field of " moon " includes:" second, point, when, day, week ";If field on the basis of selected " week ", then subordinate's field in " week "
Including:" second, point, when, day ";If it is selected " my god " on the basis of field, then " my god " subordinate's field include:" second, point, when ";
If it is selected " when " on the basis of field, then " when " subordinate's field include:" second, point ";If field on the basis of selected " dividing ",
The subordinate's field so " divided " includes:" second ";If field on the basis of selected " second ", because the second has been minimum tempon
Element, thus the second there is no subordinate's field.
Determine after each corresponding subordinate's field of each benchmark field, it is necessary to configure the final election of each subordinate's field
Frame, so as to complete the setting of the cron expression formula forms corresponding to each benchmark field.The check box of concrete configuration subordinate field
Mode, can be realized based on JavaScript check boxes control.
S304:One or more values of the check box of each field in cron expression formula forms determined by obtaining, generation
Cron expression formulas.
In one implementation, the value of the check box of each field, raw in cron expression formula forms determined by obtaining
Into cron expression formulas, including:Onchange events to the check box of each field in identified cron expression formulas form are entered
Row monitoring, when monitoring onchange events, calls and states cron expression formula generating functions, gets generation onchange events
Field check box value;According to the value of the check box of each field, cron expression formulas are generated.
Further, according to the value of the check box of each field, cron expression formulas are generated, including:For identified cron
Each field in expression formula form, sets up an empty array of field number correspondence size;Based on benchmark field and generation
The value (can be multiple) of each field of onchange events, updates the value of array;Array is spliced into character string, obtained
Cron expression formulas.
Wherein, by the onchange events for the check box for monitoring each field, the choosing of each subordinate's field can be learnt
The value of item changes.Then again by way of above-mentioned array assignment, you can obtain each field (benchmark field and each
Subordinate's field) option value, so as to ultimately generate cron expression formulas.
Below with a specific example, the implementation method to the plan target described in Fig. 3 carries out exemplary description.
In the example, in task dispatching platform website for task configure cron expression formulas, comprise the following steps (1)-
(3)。
(1) represent that task triggers date reference field using a drop-down list
For example, it is necessary to configure a cron expression formula for task in the configuration of timed task, the task can be " every
Year ", " monthly ", " weekly ", " daily ", " per hour ", " per minute ", " each second " triggering.Here a drop-down row are accomplished by
Table represents the benchmark field of task triggering, and example code is as follows:
Value therein represents the id of benchmark field, subsequently can the root root benchmark field show other fields correspondence
Drop-down list.
(2) the benchmark field triggered by task shows other fields
For example, because seven fields of cron expression formulas are corresponded to respectively:Second, point, when, day, week, month, year, therefore, configuration
Following " benchmark field-subordinate's field " display rule:
If the selection of benchmark field is " year ":So expression formula form is:_ _ _ _ month
If the selection of benchmark field is " moon ":So expression formula form is:_ _ _ date *
If the selection of benchmark field is " week ":So expression formula form is:___* what day
If benchmark field selection for " my god ":So expression formula form is:___**
If benchmark field selection for " when ":So expression formula form is:__***
If the selection of benchmark field is " dividing ":So expression formula form is:_****
If the selection of benchmark field is " second ":So expression formula form is:*****
Wherein, above-mentioned expression formula form for " second, point, when, day, week, month, year ", the value of " _ " representatives " second, divide or when ",
" * " represent any value can, "" represent to ignore.
Pass through rule as above, when selecting different benchmark fields, the corresponding final election of field that other needs are shown
Frame is shown.
In order to realize the display of other subordinate's fields, it is necessary to be pre-configured with the check box of each subordinate's field.For example, for
Each field of each cron expression formula forms, is mapped therewith with a check box.Code sample is as follows:
After the configuration of check box of the configuration of " benchmark field-subordinate's field " rule and each subordinate's field is completed,
The display of other field check boxes just can be realized by monitoring the option change events of benchmark field drop-down list.
For example, the onchange events of benchmark drop-down list are monitored, when the option of benchmark drop-down list changes
Wait, just call this function of baseChage:
$("#base").on('change',baseChage)
Accordingly, it would be desirable to define in event call-back method baseChage, this method, need are shown according to benchmark field id
The check box for the subordinate's field to be shown.Code sample is as follows.
First all field check boxes are stashed first, code is as follows
$("#month").hide()
Other fields are similar.
Secondly, rule in previous step (2) shows corresponding check box:
// choosing is annual, then shows monthly
If (baseId==7)
$("#month").show();
}
The same logic of the check boxes of other fields.
So far:The display of the corresponding check box of each field is achieved that by the step.It can be seen that, the present invention can have
Which field of the control of effect needs display, and which field need not be shown, so as to reduce unnecessary operation, also causes interface
Succinctly.
(3) cron expression formulas are generated by the value of each drop-down list/check box
An onchange event is bound for the corresponding drop-down list of each field/check box, whenever onchange events
During triggering, the function of a cron expression formulas generation is just called, code sample is as follows:
(3.1) field drop-down list and the check box of each subordinate's field binding onchange events on the basis of:
$("#month").on('change',gegerateCron);
$("#weekDay").on('change',gegerateCron);
$("#day").on('change',gegerateCron);
$("#hour").on('change',gegerateCron);
$("#minute").on('change',gegerateCron);
$("#second").on('change',gegerateCron);
(3.2) when the drop-down list or check box of corresponding field change, the function bound before will be triggered
GegerateCron, code is as follows:
First, being received within each field in an array, the content of corresponding field is subsequently replaced again.
For example, var cron=[' * ', ' * ', ' * ', ' * ', ' * ', ''];Respectively correspond to the second, point, when, day, the moon, week
Using benchmark field and subordinate's field as below step Rule of judgment.
Var baseId=$ (' #base') .val ();
Var name=$ (this) .attr (" id ");
Then, according to benchmark field and subordinate's field of generation trigger event, by the array of the correspondence position in step a
Value is replaced, and code snippet is as follows:
Herein unlike the example in embodiment corresponding from Fig. 1, each subordinate's field has been possible to multiple values, because
This, when some subordinate's field has multiple values, multiple values are assigned in the position of the corresponding array of the field.
The replacement of other corresponding fields and similar to the above.
Finally, then by array be spliced into a character string, you can with arrive required cron expression formulas, return
cron.join("");
So far:Final cron expression formulas are just obtained.
It is an exemplary cron expression formula view with reference to Fig. 4, wherein, benchmark field is " moon ", occurs trigger event
Subordinate's field be " day, when and point ", by way of above-mentioned acquisition each field value, finally show cron as shown in Figure 4
Expression formula view.Thus, the set of time of the timed task represented in Fig. 4 is:The 1st day and the 10th day monthly 6 when 5 points.
It can be seen that, Fig. 4 from unlike Fig. 2, subordinate's field " day " has carried out multiselect.
It can be seen that, the present invention is manually entered each field in the implementation method of above-mentioned plan target for prior art
The mode of value is improved, by way of drop-down list or check box, and user only needs to carry out simply the option of each field
Selection, due to not needing user's input, so as to avoid user's input error, thus reduces error rate;Further, since only showing
The subordinate's field shown that selected reference field is corresponding and have trigger event, therefore, it can more directly perceived, succinct displaying timing and appoints
Business triggered time view;Moreover, the present invention can be realized by JavaScript scripts, therefore, it is possible to very easily with it is existing
Some frameworks are integrated.
Corresponding with Fig. 1-2 embodiments of the method, what the present invention provided a kind of plan target realizes device.
Referring to Fig. 5, show the plan target provided according to one embodiment of the invention realizes apparatus structure schematic diagram,
The device includes:
Benchmark field configuring unit 501, for configuration baseline field drop-down list;
Benchmark field monitoring unit 502, the trigger event for monitoring benchmark field drop-down list, it is currently selected fixed to determine
Benchmark field;
Determining unit 503, for the corresponding relation based on the benchmark field pre-set with cron expression formula forms, it is determined that
It is described currently selected to determine the corresponding cron expression formulas form of benchmark field;
Expression formula generation unit 504, the drop-down for obtaining each field in the identified cron expression formulas form
The value of list, generates cron expression formulas.
In one implementation, the expression formula generation unit 504 specifically for:The identified cron is expressed
The onchange events of the drop-down list of each field are monitored in formula form, when monitoring onchange events, are called
Cron expression formula generating functions are stated, the value of the drop-down list for the field for occurring onchange events is got;And, according to each
The value of the drop-down list of field, generates cron expression formulas.
In one implementation, the expression formula generation unit 504 specifically for:For the identified cron tables
Each field up in formula form, sets up empty array;Value based on benchmark field and each field for occurring onchange events,
Update the value of the array;The array is spliced into character string, the cron expression formulas are obtained.
In one implementation, described device also includes:Setting unit 505, for based on each benchmark field, it is determined that
Go out the corresponding all subordinate's fields of each benchmark field;For each subordinate's field, the drop-down list of subordinate's field is configured, so that
Complete the setting of the cron expression formula forms corresponding to each benchmark field.
In one implementation, based on the drop down list control built in JavaScript, configure under the benchmark field
Draw the drop-down list of list or subordinate's field.
Corresponding with Fig. 3-4 embodiments of the method, what the present invention provided a kind of plan target realizes device.
Referring to Fig. 6, show the plan target provided according to a further embodiment of the invention realizes that apparatus structure is illustrated
Figure, the device includes:
Benchmark field configuring unit 601, for configuration baseline field drop-down list;
Benchmark field monitoring unit 602, the trigger event for monitoring benchmark field drop-down list, it is currently selected fixed to determine
Benchmark field;
Determining unit 603, for the corresponding relation based on the benchmark field pre-set with cron expression formula forms, it is determined that
It is described currently selected to determine the corresponding cron expression formulas form of benchmark field;
Expression formula generation unit 604, the final election for obtaining each field in the identified cron expression formulas form
One or more values of frame, generate cron expression formulas.
In one implementation, the expression formula generation unit 604 specifically for:The identified cron is expressed
The onchange events of the check box of each field are monitored in formula form, when monitoring onchange events, are called and are stated
Cron expression formula generating functions, get the value of the check box for the field for occurring onchange events;And, according to each field
Check box one or more values, generate cron expression formulas.
In one implementation, the expression formula generation unit 604 specifically for:For the identified cron tables
Each field up in formula form, sets up empty array;Value based on benchmark field and each field for occurring onchange events,
Update the value of the array;The array is spliced into character string, the cron expression formulas are obtained.
In one implementation, described device also includes:Setting unit 605, for based on each benchmark field, it is determined that
Go out the corresponding all subordinate's fields of each benchmark field;For each subordinate's field, the check box of configuration subordinate field, so that complete
Into the setting of the cron expression formula forms corresponding to each benchmark field.
In one implementation, based on the drop down list control built in JavaScript, configure under the benchmark field
List is drawn, and, the check box based on the check box control subordinate field built in JavaScript.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein.
Various general-purpose systems can also be used together with based on teaching in this.As described above, construct required by this kind of system
Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It is understood that, it is possible to use it is various
Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair
Bright preferred forms.
The present invention all parts embodiment can be realized with hardware, or with one or more processor run
Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that can use in practice
In the system of microprocessor or digital signal processor (DSP) to realize user's variable body control according to embodiments of the present invention
The some or all functions of some or all parts.The present invention is also implemented as being used to perform method as described herein
Some or all equipment or program of device (for example, computer program and computer program product).Such reality
The program of the existing present invention can be stored on a computer-readable medium, or can have the form of one or more signal.
Such signal can be downloaded from internet website and obtained, and either be provided or in any other form on carrier signal
There is provided.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not
Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of some different elements and coming real by means of properly programmed computer
It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch
To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame
Claim.
Claims (10)
1. a kind of implementation method of plan target, it is characterised in that including:
Configuration baseline field drop-down list;
The trigger event of benchmark field drop-down list is monitored, currently selected fixed benchmark field is determined;
Corresponding relation based on the benchmark field that pre-sets with cron expression formula forms, determines described currently selected to determine character datum
The corresponding cron expression formulas form of section;
One or more values of the check box of each field in the cron expression formulas form determined by obtaining, generate cron tables
Up to formula.
2. the method as described in claim 1, it is characterised in that each in the cron expression formulas form determined by the acquisition
One or more values of the check box of individual field, generate cron expression formulas, including:
Onchange events to the check box of each field in the identified cron expression formulas form are monitored, and work as prison
When controlling onchange events, call and state cron expression formula generating functions, get the field for occurring onchange events and answer
Select one or more values of frame;
According to one or more values of the check box of each field, cron expression formulas are generated.
3. method as claimed in claim 2, it is characterised in that the value of the check box according to each field, generates cron
Expression formula, including:
For each field in the identified cron expression formulas form, empty array is set up;
Value based on benchmark field and each field for occurring onchange events, updates the value of the array;
The array is spliced into character string, the cron expression formulas are obtained.
4. the method as described in claim 1, it is characterised in that the benchmark field pre-set and cron expression formula forms
Corresponding relation, including:
Based on each benchmark field, the corresponding all subordinate's fields of each benchmark field are determined;
For each subordinate's field, the check box of configuration subordinate field, so as to complete the cron tables corresponding to each benchmark field
Up to the setting of formula form.
5. the method as described in claim any one of 1-4, it is characterised in that based on the drop-down list control built in JavaScript
Part, configures the benchmark field drop-down list, and, based on the check box control built in JavaScript, configuration subordinate field
Check box.
6. a kind of plan target realizes device, it is characterised in that including:
Benchmark field configuring unit, for configuration baseline field drop-down list;
Benchmark field monitoring unit, the trigger event for monitoring benchmark field drop-down list determines currently selected fixed benchmark
Field;
Determining unit, for the corresponding relation based on the benchmark field pre-set with cron expression formula forms, it is determined that described work as
The corresponding cron expression formulas form of preceding chosen benchmark field;
Expression formula generation unit, one for obtaining the check box of each field in the identified cron expression formulas form
Or multiple values, generate cron expression formulas.
7. device as claimed in claim 6, it is characterised in that the expression formula generation unit specifically for:To identified
The onchange events of the check box of each field are monitored in the cron expression formulas form, when monitoring onchange things
During part, call and state cron expression formula generating functions, get one or many of the check box for the field for occurring onchange events
Individual value;And, according to one or more values of the check box of each field, generate cron expression formulas.
8. device as claimed in claim 7, it is characterised in that the expression formula generation unit specifically for:For being determined
The cron expression formulas form in each field, set up empty array;Based on benchmark field and generation onchange events
The value of each field, updates the value of the array;The array is spliced into character string, the cron expression formulas are obtained.
9. device as claimed in claim 6, it is characterised in that also include:
Setting unit, for based on each benchmark field, determining the corresponding all subordinate's fields of each benchmark field;For each
Individual subordinate's field, the check box of configuration subordinate field, so as to complete the cron expression formula forms corresponding to each benchmark field
Set.
10. the device as described in claim any one of 6-9, it is characterised in that based on the drop-down list built in JavaScript
Control, configures the benchmark field drop-down list, and, based on the check box control built in JavaScript, configuration subordinate word
The check box of section.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710195260.2A CN107193579B (en) | 2017-03-29 | 2017-03-29 | Method and device for realizing planned tasks |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710195260.2A CN107193579B (en) | 2017-03-29 | 2017-03-29 | Method and device for realizing planned tasks |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107193579A true CN107193579A (en) | 2017-09-22 |
CN107193579B CN107193579B (en) | 2021-04-27 |
Family
ID=59871373
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710195260.2A Active CN107193579B (en) | 2017-03-29 | 2017-03-29 | Method and device for realizing planned tasks |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107193579B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110011832A (en) * | 2019-03-04 | 2019-07-12 | 杭州迪普科技股份有限公司 | A kind of configuration distributing method and device of plan target |
CN110187871A (en) * | 2019-05-23 | 2019-08-30 | 招商局金融科技有限公司 | Plan target method for building up, electronic device and storage medium |
CN111124558A (en) * | 2018-10-31 | 2020-05-08 | 北京国双科技有限公司 | Expression processing method and device |
CN114004196A (en) * | 2021-12-30 | 2022-02-01 | 云账户技术(天津)有限公司 | Method and device for converting single data format of table |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101604242A (en) * | 2009-07-17 | 2009-12-16 | 深圳市珍爱网信息技术有限公司 | Realize the system of timed task in the Java application system |
US20100205588A1 (en) * | 2009-02-09 | 2010-08-12 | Microsoft Corporation | General purpose distributed data parallel computing using a high level language |
CN101980150A (en) * | 2010-09-30 | 2011-02-23 | 东莞市金友软件科技有限公司 | Methods for monitoring and processing field value onchange in dataset and preventing deadlock |
CN103246733A (en) * | 2013-05-13 | 2013-08-14 | 浪潮集团山东通用软件有限公司 | Dynamic form system based on metadata and generation method thereof |
CN103677973A (en) * | 2013-09-01 | 2014-03-26 | 西安重装渭南光电科技有限公司 | Distributed multi-task scheduling management system |
CN105446812A (en) * | 2016-01-04 | 2016-03-30 | 中国南方电网有限责任公司 | Multitask scheduling configuration method |
US20160092281A1 (en) * | 2014-09-25 | 2016-03-31 | Canon Kabushiki Kaisha | Information processing apparatus, method for controlling the same, and storage medium |
CN105511958A (en) * | 2014-10-11 | 2016-04-20 | 阿里巴巴集团控股有限公司 | Method and device for task scheduling |
WO2016068930A1 (en) * | 2014-10-30 | 2016-05-06 | Hewlett Packard Enterprise Development Lp | Resource consuming tasks scheduler |
CN106383738A (en) * | 2016-09-30 | 2017-02-08 | 北京百度网讯科技有限公司 | Task processing method and distributed computing framework |
CN106485465A (en) * | 2016-09-22 | 2017-03-08 | 济南浪潮高新科技投资发展有限公司 | A kind of configurable timing data synchronous method |
-
2017
- 2017-03-29 CN CN201710195260.2A patent/CN107193579B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100205588A1 (en) * | 2009-02-09 | 2010-08-12 | Microsoft Corporation | General purpose distributed data parallel computing using a high level language |
CN101604242A (en) * | 2009-07-17 | 2009-12-16 | 深圳市珍爱网信息技术有限公司 | Realize the system of timed task in the Java application system |
CN101980150A (en) * | 2010-09-30 | 2011-02-23 | 东莞市金友软件科技有限公司 | Methods for monitoring and processing field value onchange in dataset and preventing deadlock |
CN103246733A (en) * | 2013-05-13 | 2013-08-14 | 浪潮集团山东通用软件有限公司 | Dynamic form system based on metadata and generation method thereof |
CN103677973A (en) * | 2013-09-01 | 2014-03-26 | 西安重装渭南光电科技有限公司 | Distributed multi-task scheduling management system |
US20160092281A1 (en) * | 2014-09-25 | 2016-03-31 | Canon Kabushiki Kaisha | Information processing apparatus, method for controlling the same, and storage medium |
CN105511958A (en) * | 2014-10-11 | 2016-04-20 | 阿里巴巴集团控股有限公司 | Method and device for task scheduling |
WO2016068930A1 (en) * | 2014-10-30 | 2016-05-06 | Hewlett Packard Enterprise Development Lp | Resource consuming tasks scheduler |
CN105446812A (en) * | 2016-01-04 | 2016-03-30 | 中国南方电网有限责任公司 | Multitask scheduling configuration method |
CN106485465A (en) * | 2016-09-22 | 2017-03-08 | 济南浪潮高新科技投资发展有限公司 | A kind of configurable timing data synchronous method |
CN106383738A (en) * | 2016-09-30 | 2017-02-08 | 北京百度网讯科技有限公司 | Task processing method and distributed computing framework |
Non-Patent Citations (6)
Title |
---|
HQMLN: "cron页面例子", 《HTTPS://BLOG.CSDN.NET/HQMLN/ARTICLE/DETAILS/84721065》 * |
LEADERGG: "quartz cron表达式在线生成", 《HTTPS://BLOG.CSDN.NET/LEADERGG/ARTICLE/DETAILS/46617995》 * |
PANIE2015: "将定时任务cron解析成中文", 《HTTPS://WWW.CNBLOGS.COM/PANIE2015/P/5553404.HTML》 * |
ZK32373139: "生成cron表达式", 《HTTPS://BLOG.CSDN.NET/ZK32373139/ARTICLE/DETAILS/83700775》 * |
张宝亮: "《实用JavaScript网页特效编程百宝箱》", 30 June 2001 * |
摆渡人工作室: "《模拟视窗-网页视窗风格控件设计》", 31 January 2001 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111124558A (en) * | 2018-10-31 | 2020-05-08 | 北京国双科技有限公司 | Expression processing method and device |
CN110011832A (en) * | 2019-03-04 | 2019-07-12 | 杭州迪普科技股份有限公司 | A kind of configuration distributing method and device of plan target |
CN110011832B (en) * | 2019-03-04 | 2022-01-25 | 杭州迪普科技股份有限公司 | Configuration issuing method and device for planned tasks |
CN110187871A (en) * | 2019-05-23 | 2019-08-30 | 招商局金融科技有限公司 | Plan target method for building up, electronic device and storage medium |
CN110187871B (en) * | 2019-05-23 | 2022-12-20 | 招商局金融科技有限公司 | Planned task establishing method, electronic device and storage medium |
CN114004196A (en) * | 2021-12-30 | 2022-02-01 | 云账户技术(天津)有限公司 | Method and device for converting single data format of table |
Also Published As
Publication number | Publication date |
---|---|
CN107193579B (en) | 2021-04-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107193579A (en) | The implementation method and device of plan target | |
US8176417B2 (en) | Constructing and maintaining web sites | |
US7593944B2 (en) | Variable abstraction | |
US8719896B2 (en) | Widget host container component for a rapid application development tool | |
US9646117B1 (en) | Activated workflow | |
CN101604339B (en) | Method for online customization of portal system and portal customization system | |
EP3635583A1 (en) | Calendar user interface search and interactivity features | |
US20090150773A1 (en) | Dynamic product configuration user interface | |
Patti et al. | Downtime variability: the impact of duration–frequency on the performance of serial production systems | |
DE112008000527T5 (en) | Method and system for generating a control system user interface | |
CN109814858A (en) | The general UI Component Gallery of WEB front-end based on Vue framework | |
US20160055445A1 (en) | Methods and Apparatus for Interactive Workflow for Patient Scheduling | |
CN106873965A (en) | A kind of method suitable for the monitoring service class application dynamic construction page | |
CN106933629A (en) | Loading browser plug-in figure calibration method and browser | |
CN107168723A (en) | The implementation method and device of plan target | |
US20150040100A1 (en) | Creation and Deployment of RESTful Web Services in a Graphical Programming Language | |
US20170346702A1 (en) | Computer implemented method for displaying a user interface | |
CN103677841B (en) | IETM code generation method and device based on element-level template | |
CN105302558A (en) | Content presentation system and method for multiple clients | |
CN103870280B (en) | Webpage seamless combining processing method based on FLEX and JSP | |
US9626415B2 (en) | Data reduction with specified constraints | |
CN114003831B (en) | Method and system for graphically displaying project progress by using webpage | |
CN112785249A (en) | Schedule management method and system based on VBA | |
CN107918552A (en) | Light application call method, apparatus, client terminal device and electronic equipment | |
CN105653270A (en) | Development method of mobile phone client side application program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |