Abstract:
A method for managing and controlling a real-time system which is processing a variable complexity task in a predetermined period of time, the method comprising the steps of detecting the progress in processing the task is detected in real-time, determining if the system is likely to complete processing the task in the predetermined time period, increasing or decreasing the complexity of the task and the processing rate of the real-time system accordingly.

Description:
FIELD OF THE INVENTION  
         [0001]    The present invention relates to a method for managing a real-time system in general and to a method for managing real-time communication processing in particular.  
         BACKGROUND OF THE INVENTION  
         [0002]    Methods for managing and controlling real-time systems are known in the art. A real time system often executes several tasks, at the same time, and it often has to finish executing each of them within a predetermined period of time. Thus, the real-time system has to monitor the progress in execution of each of the tasks and provides resources thereto, accordingly.  
           [0003]    If the execution of a task does not progress in a way that the task shall be completed in the given period of time assigned thereto, then the real-time system may increase the number and volume of the resources assigned to this task.  
           [0004]    For example, the prediction for a task Is that it would require 10 million CPU operations (also called instructions). The time period determined for this task is 2 seconds. The clock of the CPU is set to 50 million instructions/second (MIPS). Thus, the system assigns 5 MIPS to this task, which are 10% of the CPUs&#39; power according to the current clock setting.  
           [0005]    While executing the task, after one second has passed, the system detects that this task would require 20 million CPU operations. Hence, there is a single second left to complete the executing of the task, in which 15 million CPU operations have to be performed.  
           [0006]    Accordingly, if the rest of the tasks processed by the CPU require less than 35 MIPS, then the system assigns the remaining 15 MIPS to this task.  
           [0007]    It will be appreciated that if the system had 15 MIPS available then, the overall efficiency of the system at that time is 70%. Many real-time systems, being aware that they may need extra processing power, reserve a considerable portion of their resources for crisis situations such as described above. Hence, these systems become less efficient.  
           [0008]    Another way to provide the task with 15 MIPS is for the system to initially set the clock of the CPU to a higher frequency, In the present example, since the task uses 10% of the processing power of the CPU, the clock of the CPU has to be set to 100 MIPS, which is twice as high as the current setting. By doing so, the system has to operate constantly under a high frequency, which results in a higher power consumption, This aspect is especially critical in systems which have limited power sources such as cellular telephones, pagers and the like. The object of these systems is to reduce power consumption, thereby prolonging the use of their limited power sources.  
           [0009]    It will be appreciated that any increase in clock frequency requires an increase of the electrical power which is supplied to the CPU. This aspect is especially critical for apparatus which have limited power sources, such as battery operated devices.  
           [0010]    It will also be appreciated that real time systems which run a single task at a time do not have the ability to shift resources between tasks. All of the resources of the system are devoted to the single task and so, a considerable margin has to taken into account when attempting to forecast an outstanding situation which may require more processing resources than normal operation.  
           [0011]    A real time system may often encounter low power tasks which require less resources than those available. It will be appreciated that in these cases, the remaining resources, beyond the requirements of a low task, are not used and are, thereby, wasted.  
           [0012]    In cellular telephone devices, a considerable reduction of the operating frequency is called sleep mode. In sleep mode, only a selected group of low power tasks may run. Sleep mode is used when the cellular telephone is not in use (i.e. waiting for an incoming call). It will be appreciated that a cellular telephone can not fully operate In sleep mode.  
         SUMMARY OF THE PRESENT INVENTION  
         [0013]    It is an object of the present invention to provide a novel method for providing an efficient management of real-time processing.  
           [0014]    According to the present invention there is thus provided a system for real time processing of at least one real-time software application, wherein the processing of at least a selected one of the at least one real-time software application is according to a predetermined complexity level and has to be completed at a predetermined point in time T E .  
           [0015]    The system includes at least one processing unit for processing the least one real-time software application, a system clock for timing the at least one processing unit, connected to the processing unit and a processing controller connected to the at least one processing unit and to the system clock.  
           [0016]    The processing controller controls the complexity level of the selected software application. The processing controller also detects the extent of progress in processing the selected real-time software application by the at least one processing unit, determines an estimated point in time T C  whereby the processing unit is likely to complete processing the selected real-time software application and provides a command to reduce the complexity level to the processing unit when the estimated point in time T C  is grater than the point in time T E .  
           [0017]    The processing controller also controls the frequency produced by the system clock, so as to increase or decrease it.  
           [0018]    According to one aspect of the invention, the processing controller includes a memory unit, a real-time clock connected to the memory unit and a processor connected to the memory unit and the real-time dock. The processor receives processing progress indications from the processing unit. The real-time clock detects the frequency produced by the system clock and generates a corresponding time indication for each the processing progress indication. The processor stores each the processing progress indication and the corresponding time indication as a data entry in the memory unit.  
           [0019]    The processor determines a prediction of a point in time wherein the processing unit is likely to complete processing the task.  
           [0020]    According to another aspect of the invention, there is thus provided a method for managing and controlling the system of the invention, operating according to a predetermined system clock frequency value F. The system processes a real-time task according to a complexity value C and has to complete processing the real-time task by a time point T E . The method including the steps of:  
           [0021]    detecting the system clock frequency value F thereby determining a processing rate;  
           [0022]    detecting progress in processing the at least one real-time task;  
           [0023]    determining a predicted time point To from the progress and the processing rate by which the system should complete processing the at least one real-time task;  
           [0024]    determining a complexity level decrease value C STEP , whereby according to a complexity level of C−C STEP , the system Is likely to complete processing the at least one real-time task, when the predicted time point T 1  is greater than the time point T E ;  
           [0025]    subtracting the complexity level decrease value C STEP  from the complexity level value C and providing the complexity level to the system; and  
           [0026]    repeating from the step of detecting the system clock frequency value F,  
           [0027]    When the complexity value C is limited by a predetermined minimal complexity value C MIN , the method including the steps of:  
           [0028]    detecting the system clock frequency value F thereby determining a processing rate;  
           [0029]    detecting progress in processing the at least one real-time task;  
           [0030]    determining an predicted time point T 1  from the progress and the processing rate, whereby the system will complete processing the at least one realime task;  
           [0031]    determining a complexity level decrease value C STEP , whereby according to a complexity level of C−C STEP , the system is likely to complete processing the at least one real-time task, when the predicted time point T 1 , is greater than the time point T E ;  
           [0032]    setting the complexity value C to be the minimal complexity value C MIN . determining a frequency increase value F STEP  wherein the system will complete processing the at least one real-time task by T E  according to a system clock frequency F+F STEP  and a complexity level C MIN  and setting the system clock frequency value F to be F+F  STEP , when C−C STEP &lt;C MIN ;  
           [0033]    setting the complexity value C to be C−C STEP  when C−C STEP ≧C MIN , and  
           [0034]    repeating from the step of detecting the system clock frequency value F.  
           [0035]    According to a further aspect of the invention, the real-time task is operable according to at least two modes of operation. Each of the modes of operation requires a different amount of processing. In this case, the method of the invention the method including the steps of:  
           [0036]    determining a selected mode of operation from the at least two modes of operation;  
           [0037]    determining a selected system clock frequency value F SELECTED  wherein the system will complete processing the at least one real-time task by T E  according to a the selected system clock frequency value F SELECTED  and the complexity level C; and  
           [0038]    setting the system clock frequency value F to be the selected system clock frequency value F SELECTED .  
           [0039]    The method of the invention, according to this case, may also include the steps of detecting progress in processing the at least one real-time task;  
           [0040]    determining an predicted time point T 1  from the progress and the processing rate, whereby the system will complete processing the at least one real-time task;  
           [0041]    determining a complexity level decrease value C STEP , whereby according to a complexity level of C−C STEP , the system is likely to complete processing the at least one real-time task, when the predicted time point T 1  is greater than the time point T E ;  
           [0042]    subtracting the complexity level decrease value C STEP  from the complexity level value C and providing the complexity level to the system; and  
           [0043]    repeating from the step of detecting the system clock frequency value F.  
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0044]    The present invention will be understood and appreciated more fully from the following detailed description taken in conjunction with the drawings in which:  
         [0045]    [0045]FIG. 1 is a schematic illustration of a system for real-time processing, constructed and operative in accordance with a preferred embodiment of the invention;  
         [0046]    [0046]FIG. 2 is a schematic illustration of a method for real-time processing, operative in accordance with another preferred embodiment of the invention;  
         [0047]    [0047]FIG. 3 is a schematic illustration of a range of values provided as input to a processing unit of FIG. 1 so as to determine the most suitable one, in accordance with a further preferred embodiment of the invention;  
         [0048]    [0048]FIG. 4 is a schematic illustration of a system for real-time processing, constructed and operative in accordance with yet another preferred embodiment of the invention;  
         [0049]    [0049]FIG. 5 which is a graphic illustration of probability versus processing power of a typical real-time, variable rate, voice encoding task; and  
         [0050]    [0050]FIG. 6 is a schematic illustration of a method for real-time processing, operative in accordance with another preferred embodiment of the invention.  
     
    
     DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS  
       [0051]    The method of the present invention overcomes the disadvantages of the prior art by providing control over the complexity of tasks. In other words, according to the invention, selected tasks are made to be less consuming of system resources.  
         [0052]    The present invention provides a processing controller which controls resource allocation and consumption of tasks. If, at real-time, the processing controller detects that the current CPU clock setting will not be sufficient to complete processing the tasks, it can decrease the complexity of selected tasks, thereby reducing their CPU processing power consumption.  
         [0053]    According to the invention, the CPU clock setting is maintained and the processing capabilities are utilized at full efficiency.  
         [0054]    Reference is now made to FIG. 1 which is a schematic illustration of a system, generally referenced  100 , for realtime processing, constructed and operative in accordance with a preferred embodiment of the invention.  
         [0055]    System  100  includes a processing controller  102 , a clock  104  connected to the processing controller  102  and three processing units  106 ,  108  and  110 , all connected to the processing controller  102  and to the clock  104 .  
         [0056]    The clock  104  produces a frequency F which determines the processing rate of the processing units  106 ,  108  and  110 . The clock  104  provides the value of F to the processing controller  102 . Each of the processing units  106 ,  108  and  110  runs a task wherein the processing of each of the tasks has to be completed at a predetermined point In time T E . Each of the processing units  106 ,  108  and  110  processes its task, according to a predetermined complexity level C i .  
         [0057]    The processing controller  102  monitors the progress in each of the processing unit  106 ,  108  and  110 . Each of the processing units  108 ,  108  and  110  provides processing information to the processing controller  102 . This processing information relates to the nature of the currently processed task and to a prediction of the amount of processing needed to complete this task.  
         [0058]    It will be noted that, according to one aspect of the invention, the processing unit may provide processing information to the processing controller, upon request from the processing controller. According to another aspect of the invention, the task run by a processing unit may include instructions to provide processing Information to the processing controller, at predetermined points in the algorithm. According to a further aspect of the invention, a processing unit is adapted to provide processing information at predetermined points in the process as well as according to a request of the processing controller. According to yet another aspect of the invention, the processing controller determines a predicted increase value of resource consumption which deviates from a predetermined resource consumption value.  
         [0059]    The processing controller 102 determines a predicted time value T 1 . for each of the tasks processed by processing units  106 ,  108  and  110 , from the processing information and from the processing rate provided by clock  104 . In the present example, the processing controller  102  determines predicted time values T 1 , T 2  and T 3  for processing units  106 ,  108  and  110 , respectively.  
         [0060]    In the present example, the processing controller  102  determines T 1  by evaluating each predication of the amount of processing with its time of occurrence.  
         [0061]    If T 1 &gt;T E , then the processing controller  102  determines a new complexity value C 1 , wherein according to this new complexity value C 1 , the processing unit  106  is expected to complete processing its task no later than T E .  
         [0062]    Then, the processing controller provides this new complexity value C 1 , to processing unit  106 , which in turn, reduces the complexity of the task processed thereby.  
         [0063]    According to the invention, the processing controller controls both the processing units  106 ,  108  and  110  as well as the clock  104 . The processing controller may provide commands to the clock  104  so as it increase or decrease the frequency.  
         [0064]    In the present example, which will be further discussed hereinbelow, the system processes a task which is a series calculation, having N series elements, producing an output Y. The quality of Y increases as N increases since, more elements of the series are calculated. Hence, the quality Q(Y) is proportional to N. It will be noted that a lowest quality Q MIN (Y) can be predetermined, according to various parameters, standards and the like.  
         [0065]    Normally, the complexity C of a task determines the quality Q of the output Y. It will be appreciated to those skilled in the art, that Q is proportional to C. According to the invention, a threshold Q MIN  is set for the quality which determines the lowest quality of the output Y, which may be tolerated by the system. Q MIN  determines a lowest complexity value C MIN , which is the lowest level of complexity that will provide an output Y with a quality Q, wherein Q≧Q MIN .  
         [0066]    Reference is now made to FIG. 2 which is a schematic illustration of a method for real-time processing, operative in accordance with another preferred embodiment of the invention.  
         [0067]    In step  200 , the processing controller  102  detects the clock frequency F, which determines the processing rate of a selected processing units, which in the present example, is processing unit  106 .  
         [0068]    Then, the processing controller  102  detects the progress in processing of the task at the processing unit  106  (step  202 ). Accordingly, the processing controller  102  predicts T 1  for this task, It will be noted that T 1  can also be predicted by processing unit  106  and provided to the processing controller  102 .  
         [0069]    If T 1 &gt;T E  (step  204 ), then, according to the current clock frequency F 1 , at the current quality level Q, the processing unit  106  is not likely to complete processing its task in time. Accordingly, the system proceeds to step  206 . Otherwise, the system proceeds back to step  202 .  
         [0070]    In step  206 , the processing controller  102  determines the desired decrease in complexity level C STEP .  
         [0071]    If C−C STEP &lt;C MIN  (step  208 ), then the desired decrease in the complexity will result in a quality which is beneath the Q MIN . In this case, the system  100  proceeds to step  212 . Otherwise, the system proceeds to step  210 .  
         [0072]    In step  210 , the processing controller  102  provides a complexity decrease command to the processing unit  108 , so as to decrease the complexity of its task by C STEP . Then, the system proceeds back to step  202 .  
         [0073]    In step  212 , the processing controller determines an increase in the frequency F STEP  of clock  104 . F STEP  is determined according to C MIN  and T E , so that F+F STEP  is directed to enable processing unit  106  to complete processing the task by T E , according to complexity level C MIN .  
         [0074]    In step  214 , the processing controller  102  provides a complexity decrease command to the processing unit  106 , so as to decrease the complexity of its task to a value of C MIN . The processing controller  102  also provides a frequency increase command to the clock  104 , so as to increase the frequency F by F STEP .  
         [0075]    According to the present invention, reduction of the complexity level can be provided for tasks which are able to produce variable quality results. Such tasks are, for example, voice encoding and decoding software applications, video encoding and decoding software applications, estimation and prediction procedures, series calculation procedures and the like.  
         [0076]    In other words, these tasks are likely to produce variable quality results in a fixed complexity level and have a variable complexity level, given a fixed quality result.  
         [0077]    For example, a series calculation procedure is often given by the expression:  
       Y   =       ∑     l   =   1     N            A   i          X   i                               
 
         [0078]    wherein Y is an output value, A i  is a coefficient of an element i and N is the number of series elements.  
         [0079]    It will be appreciated that conventionally, the quality of Y Increases as N increases, since more elements of the series are calculated. Hence, the quality Q(Y) is proportional to N. It will be noted that a lowest quality Q MIN (Y) can be predetermined, according to various parameters, standards and the like.  
         [0080]    According to one aspect of the invention, this series is evaluated so as to determine a minimal number of series elements N MIN , wherein N MIN  elements have to be calculated in order to achieve an output Y, having the predetermined lowest quality Q MIN (Y). Thus, N MIN  determines a minimal complexity level C MIN .  
         [0081]    In the present example, processing unit  108 , processes a task which is a series calculation of N elements. When processing controller  102  detects that processing unit  108  is not likely to complete processing all of the N elements of the series, it can direct the processing unit  108  to process less than N elements, thereby decreasing the complexity of the task.  
         [0082]    It will be noted that the method of the invention, as disclosed in FIG. 2, providing a combined control over task complexity C and clock frequency F, is applicable in this case, as in all other examples set forth.  
         [0083]    Another example for a variable complexity task Is calculating a range of values so as to determine the most suitable one.  
         [0084]    Reference is also made to FIG. 3 which is a schematic illustration of a range of values provided as input to processing unit  110 , so as to determine the most suitable one, in accordance with a further preferred embodiment of the invention.  
         [0085]    Range  300  includes a plurality of elements A N , each having a probability P of being the most suitable value for a predetermined parameter. The elements A N  are arranged in a descending probability order, so that the elements having the highest probability are located first and the elements having the lowest probability are located last.  
         [0086]    The sum of the probabilities of all of the elements A i is  1. Hence, an optimal result is achieved when all of the elements A N  are checked.  
         [0087]    The optimal object of processing unit  110  is to determine the most suitable value, from the values of elements A N , by checking each and every one of them. Accordingly, if processing unit  110  will check all of the N elements, it will determine the optimal value for the predetermined parameter.  
         [0088]    In the present example, N determines the complexity C of the task of determining the optimal value,  1  N MIN  is the minimal number of elements which have to be calculated so as to achieve the lowest quality Q MIN , tolerated by the system  100 .  
         [0089]    When the processing controller  102  detects that processing unit  110  is not likely to complete checking N MAX  elements, by T E , it can direct processing unit  110  to check less than N MAX  elements, as long as it checks no less than the first N MIN  elements.  
         [0090]    Accordingly, it will be appreciated that at the same time, the processing controller  102  can provide a frequency increase command to the clock  104 , if it detects that the complexity decrease of the task run by processing unit  110 , will not result in completing the process of this task by T E .  
         [0091]    It will be noted that the present invention relates to managing several processing units as well as to managing a multi-tasking single processing unit, whereby a reduction in the complexity of one task provides more system sources which can be provided to another task.  
         [0092]    Reference is now made to FIG. 4 which is a schematic illustration of a system for real-time processing, generally referenced  308 , constructed and operative in accordance with yet another preferred embodiment of the invention.  
         [0093]    System  308  includes a processing unit  320 , a clock  318  connected to the processing unit  320  and a processing controller  310 , which is connected both to the clock  318  and to the processing unit  320 . The processing controller  310  includes a processor  312 , a real time counter  314  and a memory unit  316 , which is connected both to the processor  312  and to the real time counter  314 .  
         [0094]    The clock  318  generates a frequency F signal, which determines the rate of processing and provides it to the processing unit  320 . At the same time, the clock  318  also provides this signal to the real-time counter  314 . The real-time counter  314  counts time according to the frequency signal provided thereto and can produce a time stamp indication when requested.  
         [0095]    The processing unit  320  processes a software application task and provides processing data to the processor  312  of processing controller  310 . The processing data relates to the extent of progress that the processing unit  320  has already achieved in processing the task.  
         [0096]    The processor  312  stores this processing data in the memory unit  316  as a data entry and at the same time orders the real-time counter  314  to provide a time stamp which is attached to the data entry.  
         [0097]    The processor  312  processes all of the data entries of the task run on processing unit  320 , stored in the memory unit  318  and calculates a prediction of the time in which the processing unit  320  is likely to complete the processing of the task.  
         [0098]    According to the present embodiment, the processing controller  310 , including real-time counter  314 , is adapted to be connected to system clocks which provide timing signals and do not provide time indications. Thus, the processing controller  310  performs all of the time related calculations required to determine a complexity level decrease or increase. It is noted that the method of the invention, as disclosed in FIG. 2 is also applicable for system  308 .  
         [0099]    It will be appreciated that for certain types of tasks, one can estimate the amount of processing power required thereby.  
         [0100]    Reference is now made to FIG. 5 which is a graphic illustration of probability versus processing power of a typical realtime, variable rate, voice encoding task.  
         [0101]    The horizontal axis represents processing power (in MIPS) and the vertical axis represents the probability of a task to require processing power of a given value.  
         [0102]    Area  450  represents all of the tasks which require 10±1 MIPS. Area  460  represents all of the tasks which require 16±0.7 MIPS. Area  470  represents all of the tasks which require 22±1 MIPS.  
         [0103]    The real-time voice encoding task of the present example operates according to several known modes of operation, which require different amounts of processing power.  
         [0104]    The processing requirements of the first mode of operation are generally located in area  460  (i.e. running the task in the first mode will require between 9 MIPS and 11 MIPS). The processing requirements of the second and third modes of operation are generally located in areas  460  and  470 , respectively.  
         [0105]    According to the present invention, the system clock can be set to a selected frequency, according to the selected mode. Thus, if the first mode is selected, then the system clock has to be set to 11 MIPS. It will be appreciated that, in systems such as systems  100  (FIG. 1) and  308  (FIG. 4), the system clock can be set to 10 MIPS, whereby the complexity of the task is adjusted accordingly. If the current task requires between 10 MIPS and 11 MIPS, then the system will reduce processing complexity and if the current task requires between 9 MIPS and 10 MIPS, then the system may increase the processing complexity.  
         [0106]    It will be noted that the complexity C can be determined from the frequency F and a predetermined time interval in which the task is to be processed beginning at T 0  and ending at T E .  
         [0107]    When the system is not able to provide an estimation of the exact processing requirements of a given task, it can determine an approximated frequency value and from that, control the complexity of the task, in real-time.  
         [0108]    Reference is also made now to FIG. 6 which is a schematic illustration of a method for real-time processing, operative in accordance with another preferred embodiment of the invention.  
         [0109]    In step  400 , the system  308  evaluates a task for processing requirements and determines a frequency F which corresponds to these requirements.  
         [0110]    In step  402 , while processing the task, the system detects the processing progress and determines a predicted point in time T 1 , in which the system  308  is likely to complete processing the task.  
         [0111]    In step  404 , if the processing controller  102  detects that T 1 =T E , then the system will probably complete processing the task in time and so, the system proceeds back to step  402 . Otherwise, the complexity value C has or may be changed according to T E .  
         [0112]    In step  406 , the system determines the complexity C as the complexity which will use the highest amount of processing power available by the system and still ensure that the system will complete processing the task by T E .  
         [0113]    It will be appreciated by persons skilled in the art that the present invention is not limited to what has been particularly shown and described hereinabove. Rather the scope of the present invention is defined only by the claims which follow.