Abstract:
A job management and scheduling method for network system, characterized in which a job queue is pre-constructed and a job management module is used to process a job request sent by the application layer. When the job management module determines that the hardware device needed for the job request is available, it would store the job entity into the job queue and output a completion message to the application layer where the job queue executes the stored job entities independently. Based on such a method, the job management module responds to the job request of application layer in a short period of time to enable the application layer to carry out the next job request without waiting. The job queue could adjust the job entity execution order or update the parameter settings according to data dependency, privilege value, or parameter settings to execute the job request quickly and accurately.

Description:
[0001]    This application claims the benefit of Taiwan Patent Application No. 096151020, filed on Dec. 28, 2007, which is hereby incorporated by reference for all purposes as if fully set forth herein. 
       BACKGROUND OF THE INVENTION 
       [0002]    1. Field of the Invention 
         [0003]    The present invention relates to a job management and scheduling method for network system, more particularly a job management and scheduling method for network system that constructs an independently operated job queue in the network system such that the application layer needs not wait for the response of hardware device. 
         [0004]    2. Related Art 
         [0005]      FIG. 1  is a schematic drawing showing the execution process of the object manager of a conventional network system. As shown, the network system contains an application layer, a core layer, a device driver layer, a job queue, and an object manager (OM). 
         [0006]    The object manager receives a job request from the application layer (step S 101 ), then calls the procedure interface of the core layer to process this job request (step S 102 ). The core layer parses the programming syntax of the job request to determine whether it meets the specifications (step S 103 ), and records the job request if it does, and simultaneously calls the procedure interface of the device driver layer to execute the application specific integrated circuit (ASIC) procedure setting according to the job request (step S 104 ). If the job entity requires the operation of related hardware device, the hardware device must give a response (step S 105 ) before the next job entity can be executed. 
         [0007]    Subsequently, the system detects whether the setting of ASIC procedure is completed (step S 106 ). If yes (i.e. related job entity is executed), the device driver layer sends a completion message to the object manager via the core layer (step S 107 ). When the application layer receives the completion message from the object manager, it would end the job request (step S 108 ) and execute the next job request. 
         [0008]    The drawback of the aforesaid technique is that if the required hardware device input/output (I/O) responds that the hardware device is busy or that part of the required resources is occupied, the procedure interface of the device driver layer will not be able to drive the hardware device to execute the procedure setting requested by the job entity until the hardware device I/O has completed its job or releases the resources. Consequently, the execution of job request sent out by the application layer would be prolonged while waiting for hardware device I/O, thereby reducing the work efficiency of the entire network system. 
       SUMMARY OF THE INVENTION 
       [0009]    In light of the drawback of prior art, the objective of the invention is to provide a job management and scheduling method for network system, which, through an independently operated job queue, carries out the scheduling and operation of job entities to enable the application layer to execute job requests continuously without waiting for the response of hardware device, thereby allowing the continuous execution of job requests without interruption. 
         [0010]    To solve the system problem described above, the invention discloses a job management and scheduling method for network system, which uses a schedule processing module to receive a job entity, store the job entity and schedule an execution time for executing the job entity such that an independently operated job queue is constructed. The invention uses a job management module to analyze the job request sent by the application layer so as to extract job entities of the job request and determine whether the hardware device needed by the job request is available, and based on which, determine whether to send a completion message to the application layer, store the job entities of the job request into the job queue, and ask the job queue to execute the scheduled job entities. 
         [0011]    According to the job management and scheduling method for network system disclosed by the invention, when the job queue receives the execution request from the job management module, it takes out and executes the scheduled job entities in sequence until all job entities are completed. 
         [0012]    According to the job management and scheduling method for network system disclosed by the invention, the job queue can execute job entities in a variety of manners. Approach 1, execute the job entities on a first-in, first-out basis; Approach 2, assign a privilege value to each job entity and schedule the job entity execution order based on the privilege value, from high to low; the privilege value can be assigned based on the data dependency of each job entity. 
         [0013]    According to the job management and scheduling method for network system disclosed by the invention, when the job management module stores a new job entity into the job queue, if it detects there is an identical job entity with different parameter settings in the job queue, the job management module would update the parameter settings of job entity in the job queue, and adjust the execution time for job entities in the job queue based on the privilege value and data dependencies of all job entities in the queue. 
         [0014]    According to the job management and scheduling method for network system disclosed by the invention, the network system comprises a plurality of objects, each object having different program commands, and each command is for controlling the hardware device of the network system to carry out different actions, such as receiving and sending data, analyzing data, designating the port for receiving and sending data, carrying out logic operation between data, storing data, and designating the data storage site. Such program commands are collectively termed “job entity.” 
         [0015]    According to the job management and scheduling method for network system disclosed by the invention, the job queue operates independently because when it receives the request to execute the scheduled job entities, it would execute the job entities continuously until all job entities in the schedule are completed. Even if the job entities of a job request are storing in the job queue, and the job queue again receives the request to execute the scheduled job entities during the execution period, the job queue would continue to execute the job entities based on the order of their execution time. The job queue is not interfered by other elements or processes during the execution of job entities. That is why it is called independently operated job queue. 
         [0016]    The present invention may achieve better performance than that of prior art: 
         [0017]    First, the application layer could receive a response to the job request from the job management module in a short period of time, thereby avoiding the prolonged execution time while waiting for a response from the hardware device I/O. 
         [0018]    Secondly, when the job queue executes job entities with identical parameter settings, it would adjust the execution time for job entities, update parameter settings or combine identical job entities according to the parameter settings, privilege value, or data dependency of job entities. As such, the storage space of job queue will not be occupied by identical job entities, thereby allowing the storage of job entities corresponding to other job requests and preventing overflow, which tends to cause operating error of the network system. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0019]    The present invention will become more fully understood from the detailed description given herein below for illustration only, and which thus is not limitative of the present invention, and wherein: 
           [0020]      FIG. 1  is a process flow diagram of the prior art; 
           [0021]      FIG. 2  is a diagram showing a simple configuration of the network system according to an embodiment of the invention; 
           [0022]      FIG. 3  is a process flow diagram of the job management and scheduling method according to an embodiment of the invention; 
           [0023]      FIG. 4  is a process flow diagram of the job queue operation according to an embodiment of the invention; and 
           [0024]      FIG. 5  is a process flow diagram of storing job entities according to an embodiment of the invention. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0025]    The objects and features of the invention are described in detail below with embodiments in reference to the accompanying drawings. 
         [0026]    Referring to  FIG. 2  and  FIG. 3  which show respectively a simple system configuration and flow process of the job management and scheduling method for network system according to an embodiment of the invention, the system configuration includes an application layer  201 , an job management module  202 , a core layer  203 , and a device driver layer  204 , and the flow process includes the following steps: 
         [0027]    Use a schedule processing module to receive a job entity, store the job entity and schedule an execution time for executing the job entity to construct an independently operated job queue (step S 309 ). In this step, the job queue  205  manages, receives, and executes all job entities through a schedule processing module. The network system contains a plurality of objects, each object having different program commands, and each command is for controlling the hardware device of the network system to carry out different actions, such as receiving and sending data, analyzing data, designating the port for receiving and sending data, carrying out logic computation between data, storing data, and designating the data storage site. Such commands are collectively termed “job entity.” 
         [0028]    Firstly, the schedule processing module is used to analyze all objects of the network system, each object containing a plurality of job entities. Next, the schedule processing module computes the sum of all job entities of the object, and provides a memory space in the network system by dividing the sum of job entities. Finally, the schedule processing module stores all job entities, and schedules the execution time for each job entity to construct an independently operated job queue. 
         [0029]    In the construction of job queue, the maximum schedule load of the job queue  205  can be equal to the sum of job entities, or set at a number higher than the sum of job entities to accommodate extra events. Subsequently, the job entities are numbered according to the order of storing the job entities of the object in the hardware device. Such numbers also represent the storage sequence of the job entities in the job queue  205 . 
         [0030]    The network system is assumed to have three objects—Object A, Object B and Object C. Object A has 10 job entities, Object B has 20 job entities, while Object C has 50 job entities. The job entities of Object A are numbered 1 to 10; the job entities of Object B are numbered 11 to 30; the job entities of Object C are numbered 31 to 80. The maximum schedule load of the job queue  205  will be 80 or a higher value. When the job queue  205  stores the job entities of Object A, Object B and Object C, it puts them at locations in the order of 1 st  to 10 th , 11 th  to 30 th , and 31 st  to 80 th  to facilitate subsequent comparison. 
         [0031]    Hence the number of job entities that can be stored by the job queue  205  can match the number of job entities produced by the job requests under the maximum load of the network system. 
         [0032]    When the job queue receives a request to execute the job entities in the schedule, it would proceed continuously until all job entities in the schedule are executed. Even if the job entities of a job request intend to store in the job queue and the job queue again receives the request to execute job entities in the schedule, the job queue would sequentially execute the job entities according to execution time of each job entity. While executing the job entity, the job queue does not interfere with other elements or processes. This is why the job queue is called independently operated. 
         [0033]    A job management module  202  is utilized to parse the job request sent from an application layer  201  so as to extract a job entity of the job request. In this step, first use the job management module  202  to receive the job request sent by the application layer  201  (step S 301 ). Next, the job management module  202  would call the procedure interface of the core layer  203  to analyze whether the programming syntax of the job request is correct (step S 302 ). 
         [0034]    If the result of analysis is incorrect, the core layer  203  would send the failure result to the job management module  202  to send a failure response message to the application layer  201  (step S 308 ), and end the job request, on the other hand, if the result of analysis is correct, the core layer  203  would extract the job entity of the job request (step S 303 ). 
         [0035]    The core layer  203  parses the objects that need to be called and used according to the programming syntax of the job request, and identifies the job entities contained in the objects when called objects or functions are determined as correct. 
         [0036]    The hardware device needed by the job request is determined to be available (step S 304 ) to decide whether to store the job entities of the job request into the job queue  205 . In this step, the device driver layer  204  as called by the core layer  203  enables its procedure interface to work with the job management module  202  to determine the current status of the hardware device  206 . 
         [0037]    If it is determined that the hardware device  206  is not available, the device driver layer  204  would inform the job management module  202  to respond to the application layer  201  with a failure message (step S 308 ) and end the job request; if it is determined that the hardware device  206  is available, the device driver layer  204  would store the job entities of the job request into the job queue  205  (step S 305 ) and ask the job queue  205  to execute the job entities (step S 306 ), and at the same time, send a completion message to the application layer  201  via the job management module  202  (step S 307 ). 
         [0038]    There are at least three ways to determine the status of the hardware device  206 : 
         [0039]    1. The job management module  202  obtains the parameter specifications of the hardware device  206  required for the job request from the device driver layer  204  and compares whether the parameter settings of the job request meet the parameter specifications. For instance, the port numbers of the hardware device  206  include Port- 1  to Port- 1000 . If the port number of the job request command does not fall within the range, the job management module  202  will send a failure response message to the application layer  201 . Conversely, the job management module  202  would store the job entities of the job request into the job queue  205  through the procedure interface of the device driver layer  204 . 
         [0040]    2. The job management module  202  calculates the number of entities already occupied by the jobs in the job request, and obtains the allowable schedule load of the job queue  205  from the device driver layer  204 . Next, the job management module  202  compares whether the number of entities already occupied by the jobs is higher than the allowable schedule load. If yes, it means the job queue  205  is no longer able to add job entities of the new job request, and the job management module  202  would send a failure response message to the application layer  201 . Conversely, the job management module  202  would store the job entities of the job request into the job queue  205  through the procedure interface of the device driver layer  204 . 
         [0041]    3. The job management module  202  asks the hardware device  206  to execute the requested job entities. When the hardware device  206  responds that the operation is completed, it means the hardware device  206  can accept the request of the job entities. In such case, the job management module  202  would store the job entities of the job request into the job queue  205  through the procedure interface of the device driver layer  204 . If the hardware device  206  responds that the operation cannot be carried out, it means the hardware device  206  is unable to accept the job request. The job management module  202  would then send a failure response message to the application layer  201 . 
         [0042]    There are at least two ways for the job management module  202  to store the job entities into the job queue  205  as described below: 
         [0043]    1. The job management module  202  stores the job entities into the job queue  205  on a first-in, first-out principle. Regardless of the importance of the job request, it merely discusses the order of job request to store the job entities. 
         [0044]    2. The job management module  202  assigns a corresponding privilege value to each job entity based on a one-on-one basis, and stores the job entities into the job queue according to the level of the privilege value; the privilege value is assigned by the data dependencies between the job entities. 
         [0045]    For example, the job entity a is dependent on the job entity b, and the job entity b is dependent on the job entity c. Hence the sequence of storing the job entity a in the job queue is: create the job entity c, create the job entity b, then create the job entity a, and the privilege values of the entities from high to low is the job entity c, the job entity b, the job entity a. 
         [0046]    Conversely the removal of the job entity a would start from low to high privilege value in the following sequence: remove the job entity a, remove the job entity b, remove the job entity c. 
         [0047]    When the storage of the job entities is completed, the job management module  202  would ask the job queue  205  to execute the stored job entities, and simultaneously output a completion message to the application layer  201  to finish the job request, and execute the next job request. The job queue  205  then receives the execution request to execute the stored job entities (step S 310 ). 
         [0048]    Referring to  FIG. 4  which is a process flow diagram of the job queue operation according to an embodiment of the invention, the process comprises the following steps: 
         [0049]    Detect whether an execution request is received (step S 401 ). The device driver layer  204  would send the execution request to the job queue  205  after adding job entities to the job queue  205 . Therefore, when the job queue  205  receives an execution request, the job entities must be stored therein. 
         [0050]    If the detection result is no, return to the step of detecting whether an execution request is received (step S 401 ); if the detection result is yes, execute the job entity with the highest priority in terms of execution time (step S 402 ), and then activate the hardware device required for executing the job entity with the highest priority in term of execution time (step S 403 ). 
         [0051]    The job entities executed by the job queue  205  follows either of the two principles described below: 
         [0052]    1. Execute all job entities based on a “first-in, first-out” principle. 
         [0053]    2. Execute all job entities by privilege value as described above from high to low; the privilege value is assigned based on the data dependencies of the job entities. 
         [0054]    Subsequently, the job queue  205  detects whether any job entity is not yet completed (step S 404 ). If no, return to the step of detecting whether an execution request is received (step S 401 ); if yes, execute the job entity with the highest priority in terms of execution time (step S 402 ). 
         [0055]    Referring to  FIG. 5  which is a process flow diagram of storing job entities in the job queue according to an embodiment of the invention, the process comprises the following steps: 
         [0056]    The job management module  202  receives job entities of a job request (steps S 501 ), and detects whether an identical job entity exists in the job queue  205  (step S 502 ). If not, the job management module  202  would store the job entity of the job request into the job queue  205  (step S 503 ); if yes, the job management module  202  would update the job entity of the job queue  205  with the job entity of the job request (step S 504 ). 
         [0057]    If the job entities are numbered earlier, first obtain the numbers of job entities contained in the job request, and search the job entities in the job queue  205  based on the numbers to determine whether job entities are matched the numbers in the job queue  205 . 
         [0058]    If the answer is no, meaning no identical job entities are stored into the job queue  205 , store the job entities of the job request into the job queue  205 ; if the answer is yes, update the job entity with the same number in the job queue  205 . 
         [0059]    As described earlier, if the job queue  205  is already stored with the job entities of Object B, that is to say with the job entities numbered 11 to 30, when the execution of job request calls for the execution of Object A, the job management module  202  would add the job entities of Object A in the job queue, and store them in the order from 1 to 10 since the job queue  205  does not have job entities numbered 1 to 10 present. 
         [0060]    When the execution of job request calls for the execution of Object B, the job management module  202  would find that the job entities  11  to  30  are already stored into the job queue  205  and update those job entities. 
         [0061]    When updating the job entities in the job queue  205 , the job management module  202  would detect whether the parameter settings of two identical job entities are the same. If no, the job entity already in the job queue  205  would be replaced with the job entity of the new job request; if yes, the job entity of the new job request is deleted or combined with the job entity already in the job queue  205 . Subsequently, the job management module  202  computes the data dependencies of all job entities therein, and adjusts the storage sequence of job entities accordingly. 
         [0062]    Such process of updating job entity is to prevent the job queue  205  from repeatedly executing job entities of identical job request, which keeps the job entities contained in other job requests from being stored, thereby causing operating error of the network system. 
         [0063]    The preferred embodiments of the present invention have been disclosed in the embodiments. However the embodiments should not be construed as a limitation on the actual applicable scope of the invention, and as such, all modifications and alterations without departing from the spirits of the invention and appended claims shall remain within the protected scope and claims of the invention.