Invention content
The main purpose of the present invention is to provide a kind of control method of task scheduling and devices, to solve in the prior art
Control the relatively low problem of the efficiency of the plan target of distance host.
To achieve the goals above, one side according to the ... of the embodiment of the present invention provides a kind of control of task scheduling
Method.The control method of task scheduling according to the present invention includes:Receive the text of target remote host store tasks list of schedules
Part catalogue;Obtain the file under the file directory;Waiting task plan is searched from the file;And to finding
Waiting task plan is handled.
Further, waiting task plan is searched from the file includes:Obtain the task of waiting task plan
Project documentation presss from both sides class;The task scheduling file class is searched under the file directory;And in the task scheduling file
The waiting task plan is searched in folder class.
Further, the waiting task plan is searched in the task scheduling file class includes:Described in acquisition
The title of waiting task plan;And according to the waiting task plan title from the task scheduling file class
Search the waiting task plan.
Further, before the file under obtaining the file directory, the method further includes:It is remote to obtain the target
Host address, the username and password of journey host;According to the host address, the user name and the password and the target
Distance host establishes connection;And after establishing connection with the target remote host, determines and obtain under the file directory
File.
Further, the target remote host is multiple main frames, is receiving target remote host store tasks plan column
Before the file directory of table, the method further includes:The operation file that sequential processes are carried out to the multiple host is obtained,
In, the title of the host address and the waiting task plan of the target remote host is recorded in the operation file;Or
Person configures the host address of the multiple host, and cyclic access is carried out to the multiple host according to the multiple host address.
To achieve the goals above, another aspect according to the ... of the embodiment of the present invention provides a kind of control of task scheduling
Device.The control device of task scheduling according to the present invention includes:Receiving unit, for receiving target remote host store tasks
The file directory of list of schedules;First acquisition unit, for obtaining the file under the file directory;Searching unit, for from
Waiting task plan is searched in the file;And processing unit, at the waiting task plan to finding
Reason.
Further, the searching unit includes:Acquisition module, the task scheduling text for obtaining waiting task plan
Part presss from both sides class;First searching module, for searching the task scheduling file class under the file directory;And
Second searching module, for searching the waiting task plan in the task scheduling file class.
Further, second searching module includes:Acquisition submodule, for obtaining the waiting task plan
Title;And submodule is searched, it is looked into from the task scheduling file class for the title from the waiting task plan
Look for the waiting task plan.
Further, described device further includes:Second acquisition unit, for the file in the case where obtaining the file directory it
Before, obtain host address, the username and password of the target remote host;Connection unit, for according to the host address,
The user name and the password are established with the target remote host to be connected;And determination unit, for the target
Distance host is established after connection, determines the file obtained under the file directory.
Further, the target remote host is multiple main frames, and described device further includes:Third acquiring unit, is used for
Before the file directory for receiving target remote host store tasks list of schedules, obtain to the multiple host carry out sequence
The operation file of reason, wherein the host address of the target remote host and pending described is recorded in the operation file
The title of business plan;Alternatively, dispensing unit, configures the host address of the multiple host, according to the multiple host address pair
The multiple host carries out cyclic access.
According to inventive embodiments, by the file directory for receiving target remote host store tasks list of schedules;Obtain text
File under part catalogue;Waiting task plan is searched from file;And at the waiting task plan to finding
In the task scheduling control for carrying out distance host, without logging in distance host, the text obtained is arranged for getfiles methods in reason
The file directory of part, getfiles methods according to catalogue obtain distance host in task scheduling file, and to task scheduling into
Row processing, avoids and logs in distance host one by one, to solve the effect of the plan target of control distance host in the prior art
The relatively low problem of rate has achieved the effect that the task scheduling efficiency for improving control distance host.
Specific implementation mode
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.The present invention will be described in detail below with reference to the accompanying drawings and embodiments.
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
The every other embodiment that member is obtained without making creative work should all belong to the model that the present invention protects
It encloses.
It should be noted that term " first " in description and claims of this specification and above-mentioned attached drawing, "
Two " etc. be for distinguishing similar object, without being used to describe specific sequence or precedence.It should be appreciated that using in this way
Data can be interchanged in the appropriate case, so as to the embodiment of the present invention described herein.In addition, term " comprising " and " tool
Have " and their any deformation, it is intended that cover it is non-exclusive include, for example, containing series of steps or unit
Process, method, system, product or equipment those of are not necessarily limited to clearly to list step or unit, but may include without clear
It is listing to Chu or for these processes, method, product or equipment intrinsic other steps or unit.
Explanation of nouns:
Windows task scheduling managers:Any script, program or document can be arranged in some specific time point
Operation.
Directory:.net the class of included operation catalogue.
Path:.net the included class that file path is operated.
Batch processing:Batch processing is exactly that the processing of batch is carried out to certain object, and user's batch is to multiple long-range in this patent
Host is operated.
An embodiment of the present invention provides a kind of control methods of task scheduling.The control method of the task scheduling can be to more
A host carries out the control of task scheduling, also, need not log in distance host one by one and can be achieved with calling to task scheduling.
Fig. 2 is the flow chart of the control method of task scheduling according to the ... of the embodiment of the present invention.As shown in Fig. 2, the control of the task scheduling
Method includes the following steps:
Step S102 receives the file directory of target remote host store tasks list of schedules.
Step S104 obtains the file under file directory.
Step S106 searches waiting task plan from file.
Step S108 handles the waiting task plan found.
When carrying out remote task plan control, the side getfiles in the included directory classes of .net may be used
Method obtains the file under distance host some catalogue.But getfiles methods can not get the mesh of store tasks plan
Therefore file under record after the specified file directory obtained of getfiles methods, the mesh is obtained by getfiles methods
File under record.After the file under obtaining task scheduling catalogue, the task scheduling operated is searched, and to task meter
It draws and is handled.
Task scheduling is for example:Daily 8:36 couples of application program A upgrade.The processing carried out to task scheduling can be with
It is the operations such as startup, disabling, deletion and the addition of task scheduling.
, without logging in distance host, it is in the task scheduling control for carrying out distance host by above-described embodiment
The file directory for the file that the setting of getfiles methods obtains, getfiles methods obtain the task in distance host according to catalogue
Project documentation, and task scheduling is handled, it avoids and logs in distance host one by one, controlled in the prior art to solve
The relatively low problem of the efficiency of the plan target of distance host has reached the effect for the task scheduling efficiency for improving control distance host
Fruit.
Preferably, waiting task plan is searched from file includes:Obtain the task scheduling text of waiting task plan
Part presss from both sides class.Task scheduling file class is searched under file directory.And search pending in task project documentation presss from both sides class
Business plan.
The task scheduling of distance host is generally stored inside C:Windows System32 under Tasks catalogues, belong to different
The task scheduling of class is stored in different file classes, after the catalogue where determining task scheduling is Tasks, in Tasks
Locating file presss from both sides class under catalogue, and waiting task plan is searched in the file class found.I.e. in the C of distance host:\
Windows System32 multiple file classes are stored under Tasks catalogues, storage is by multiple tasks meter in each file class
It draws.For example, in C:Windows System32 have under Tasks catalogues application program A file class and application program B text
Part presss from both sides class, wherein the file class of application program A includes multiple task schedulings for belonging to application program A.I.e. in distance host
When middle lookup waiting task plan, searched step by step from task scheduling file class to task scheduling.
It specifically, can be by the title of waiting task plan in task scheduling when searching waiting task plan
It is searched in file, i.e., searching waiting task plan in task project documentation presss from both sides class includes:Obtain waiting task
The title of plan.Waiting task plan is searched from task scheduling file class according to the title of waiting task plan.
Preferably, before acquisition waiting task plan, it is also necessary to be connected with target remote host, that is, obtain file
Before file under catalogue, method further includes:Obtain host address, the username and password of target remote host.According to host
Address, username and password and target remote host, which are established, to be connected.And after establishing connection with target remote host, determine
Obtain the file under file directory.
It is established and is connected by the host address of target remote host, username and password and target remote host, established
The waiting task plan under specified directory can be obtained after connection, pending task scheduling can also be enabled, be forbidden,
The actions such as addition and deletion.
The task scheduling of acquisition is as shown in figure 3, shown in Fig. 3 first is classified as the title of task scheduling, and shown in Fig. 3 second
Be classified as the current state of task scheduling, can modify as needed to the current state of task scheduling, can also add or
Person deletes task scheduling.Task scheduling state may include enabling, forbidding.
Preferably, usual target remote host is multiple main frames, when distance host is multiple main frames, can be processed in batches
Task scheduling in multiple main frames, i.e., before the file directory for receiving target remote host store tasks list of schedules, method
Further include:Obtain the operation file that multiple main frames are carried out with sequential processes, wherein target remote host is recorded in operation file
The title of host address and waiting task plan.Alternatively, the host address of configuration multiple main frames, according to multiple main frames address pair
Host address carries out cyclic access.
The operation file of task scheduling in batch processing multiple main frames is set, is had recorded in operation file to each master
Machine executes the order of one or more task scheduling, for example, to the task scheduling A1 disablings of distance host A;To distance host B
Task scheduling B3 and B4 enable etc..The task scheduling recorded in operation file is executed to criticize multiple distance hosts to realize
Amount operation.
Furthermore it is also possible to the host address of multiple main frames be configured in configuration file, according to multiple masters in configuration file
Machine address carries out the access of distance host, and obtains the task scheduling list in distance host.User can be to the task of acquisition
Task scheduling in list of schedules is operated.
, without logging in distance host, it is in the task scheduling control for carrying out distance host by above-described embodiment
The file directory for the file that the setting of getfiles methods obtains, getfiles methods obtain the task in distance host according to catalogue
Project documentation, and task scheduling is handled, it avoids and logs in distance host one by one, controlled in the prior art to solve
The problem that the efficiency of the plan target of distance host is relatively low is saved furthermore it is possible to carry out batch processing to multiple distance hosts
The time that multiple distance hosts are carried out with task scheduling control improves the task scheduling efficiency of control distance host.
The embodiment of the present invention additionally provides a kind of control device of task scheduling.The device can realize it by computer
Function.It should be noted that the control device of the task scheduling of the embodiment of the present invention can be used for executing institute of the embodiment of the present invention
The control method of the control method of the task scheduling of offer, the task scheduling of the embodiment of the present invention can also be implemented through the invention
The control device of task scheduling that example is provided executes.
Fig. 4 is the schematic diagram of the control device of task scheduling according to the ... of the embodiment of the present invention.As shown in figure 4, task scheduling
Control device include:Receiving unit 10, first acquisition unit 30, searching unit 50 and processing unit 70.
Receiving unit 10 is used to receive the file directory of target remote host store tasks list of schedules.
First acquisition unit 30 is used to obtain the file under file directory.
Searching unit 50 is used to search waiting task plan from file.
Processing unit 70 is for handling the waiting task plan found.
When carrying out remote task plan control, the side getfiles in the included directory classes of .net may be used
Method obtains the file under distance host some catalogue.But getfiles methods can not get the mesh of store tasks plan
Therefore file under record after the specified file directory obtained of getfiles methods, the mesh is obtained by getfiles methods
File under record.After the file under obtaining task scheduling catalogue, the task scheduling operated is searched, and to task meter
It draws and is handled.
Task scheduling is for example:Daily 8:36 couples of application program A upgrade.The processing carried out to task scheduling can be with
It is the operations such as startup, disabling, deletion and the addition of task scheduling.
, without logging in distance host, it is in the task scheduling control for carrying out distance host by above-described embodiment
The file directory for the file that the setting of getfiles methods obtains, getfiles methods obtain the task in distance host according to catalogue
Project documentation, and task scheduling is handled, it avoids and logs in distance host one by one, controlled in the prior art to solve
The relatively low problem of the efficiency of the plan target of distance host has reached the effect for the task scheduling efficiency for improving control distance host
Fruit.
Preferably, searching unit includes:Acquisition module, the task scheduling file for obtaining waiting task plan
Class.First searching module, for searching task scheduling file class under file directory.And second searching module, for
Waiting task plan is searched in task scheduling file class.
The task scheduling of distance host is generally stored inside C:Windows System32 under Tasks catalogues, belong to different
The task scheduling of class is stored in different file classes, after the catalogue where determining task scheduling is Tasks, in Tasks
Locating file presss from both sides class under catalogue, and waiting task plan is searched in the file class found.I.e. in the C of distance host:\
Windows System32 multiple file classes are stored under Tasks catalogues, storage is by multiple tasks meter in each file class
It draws.For example, in C:Windows System32 have under Tasks catalogues application program A file class and application program B text
Part presss from both sides class, wherein the file class of application program A includes multiple task schedulings for belonging to application program A.I.e. in distance host
When middle lookup waiting task plan, searched step by step from task scheduling file class to task scheduling.
It specifically, can be by the title of waiting task plan in task scheduling when searching waiting task plan
It is searched in file, i.e., the second searching module includes:Acquisition submodule, the title for obtaining waiting task plan.
And submodule is searched, it is searched based on waiting task from task scheduling file class by the title from waiting task plan
It draws.
Preferably, before acquisition waiting task plan, it is also necessary to be connected with target remote host, i.e., the device also wraps
It includes:Second acquisition unit, for before the file under obtaining file directory, obtaining the host address of target remote host, using
Name in an account book and password.Connection unit is connected for being established according to host address, username and password and target remote host.And
Determination unit, for after establishing connection with target remote host, determining the file obtained under file directory.
It is established and is connected by the host address of target remote host, username and password and target remote host, established
The waiting task plan under specified directory can be obtained after connection, pending task scheduling can also be enabled, be forbidden,
The actions such as addition and deletion.
The task scheduling of acquisition is as shown in Fig. 2, shown in Fig. 2 first is classified as the title of task scheduling, and shown in Fig. 2 second
Be classified as the current state of task scheduling, can modify as needed to the current state of task scheduling, can also add or
Person deletes task scheduling.
Preferably, usual target remote host is multiple main frames, when distance host is multiple main frames, can be processed in batches
Task scheduling in multiple main frames, the i.e. device further include:Third acquiring unit, for receiving the storage times of target remote host
Before the file directory for list of schedules of being engaged in, the operation file that multiple main frames are carried out with sequential processes is obtained, wherein in operation file
Record the title of the host address and waiting task plan of target remote host.Alternatively, dispensing unit, configures multiple main frames
Host address carries out cyclic access according to multiple main frames address to multiple main frames.
The operation file of task scheduling in batch processing multiple main frames is set, is had recorded in operation file to each master
Machine executes the order of one or more task scheduling, for example, to the task scheduling A1 disablings of distance host A;To distance host B
Task scheduling B3 and B4 enable etc..The task scheduling recorded in operation file is executed to criticize multiple distance hosts to realize
Amount operation.
Furthermore it is also possible to the host address of multiple main frames be configured in configuration file, according to multiple masters in configuration file
Machine address carries out the access of distance host, and obtains the task scheduling list in distance host.User can be to the task of acquisition
Task scheduling in list of schedules is operated.
, without logging in distance host, it is in the task scheduling control for carrying out distance host by above-described embodiment
The file directory for the file that the setting of getfiles methods obtains, getfiles methods obtain the task in distance host according to catalogue
Project documentation, and task scheduling is handled, it avoids and logs in distance host one by one, controlled in the prior art to solve
The problem that the efficiency of the plan target of distance host is relatively low is saved furthermore it is possible to carry out batch processing to multiple distance hosts
The time that multiple distance hosts are carried out with task scheduling control improves the task scheduling efficiency of control distance host.
It should be noted that for each method embodiment above-mentioned, for simple description, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the described action sequence because
According to the present invention, certain steps can be performed in other orders or simultaneously.Secondly, those skilled in the art should also know
It knows, embodiment described in this description belongs to preferred embodiment, and involved action and module are not necessarily of the invention
It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, it may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way
It realizes.For example, the apparatus embodiments described above are merely exemplary, for example, the unit division, it is only a kind of
Division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or component can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING or communication connection of device or unit,
Can be electrical or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple
In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also
It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list
The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can be stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can be personal computer, mobile terminal, server or network equipment etc.) executes side described in each embodiment of the present invention
The all or part of step of method.And storage medium above-mentioned includes:USB flash disk, read-only memory (ROM, Read-Only Memory),
Random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various to be stored
The medium of program code.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, any made by repair
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.