Abstract:
A computer system and operating method thereof are provided. The computer system comprises a central processing unit ( 21 ) and a random access memory ( 22 ). The random access memory ( 22 ) is provided with a resource allocating management storage region ( 32 ) for storing execution sequence of the central processing unit executing an application program, and a resource allocating management unit ( 31 ) for dynamically changing the execution sequence according to request amount of resource occupied by a plurality of application programs, wherein the execution sequence is such that the execution priority level of an application program with a small request amount of resource is higher than the execution priority level of an application program with a large request amount of resource. The method comprises the following steps: the resource allocating management unit ( 31 ) receives information on request amount of resource sent from a plurality of application programs; writes an execution sequence of the plurality of application programs into the resource allocating management storage region ( 32 ); the resource allocating management unit ( 31 ) dynamically changes the execution sequence according to request amount of resource occupied by the application programs; and the central processing unit ( 21 ) executes the application programs according to the execution sequence.

Description:
FIELD OF TECHNOLOGY 
       [0001]    The present invention relates to a computer system, especially relates to network computer system and the operating method of the computer system. The invention is based on Chinese application for patent for invention with No. 201010510598.0 filed on Oct. 15, 2010, the content of the application is hereby incorporated as reference literature closely related to the invention. 
       BACKGROUND OF THE INVENTION 
       [0002]    Personal computer is an important device in modern office and life, along with the development of technology, personal computer has been miniaturized, highly integrated, and its computing power has also become more and more powerful. Since 1990s, along with the development of the network technique, the form of the personal computer has changed with diversity, deriving various kinds of computer system with special functions, including the network computer system. 
         [0003]    Referring to  FIG. 1 , a related network computer system consisting of a server  1  and three client terminals  17 ,  18 ,  19  is provided, certainly the number of client terminal can be larger, the client terminal  17 ,  18 ,  19  can be personal computers having a CPU (central processing unit), an inner memory, a hard disk and an input/output device, and can also be network computer terminals only provided with a CPU, an inner memory and an input/output device. 
         [0004]    The server  1  is provided with a CPU  11 , an inner memory as RAM (random access memory), a hard disk as electrically erasable read-only memory  13  and a plurality of network interfaces  14 ,  15 ,  16 , each network interface  14 ,  15 ,  16  communicates with client terminals  17 ,  18 ,  19  in wired or wireless manner. 
         [0005]    When the network computer system is working, each client terminal  17 ,  18 ,  19  runs a respective application program or runs a plurality of application programs simultaneously, so it needs to continuously send request for executing the application program to the server  1 . The CPU of server  1  executes a plurality of application programs according to time sequence of plurality of application program requests after receiving the request for executing the plurality of the application programs. 
       Disclose of the Invention 
     Technical Problem 
       [0006]    Due to the plurality of client terminals  17 ,  18 ,  19  send a large number of requests for the executing of the application program to the server  1  disorderly, and the CPU of the server  1  only executes according to the request time sequence of a plurality of application programs, When the proportion of the occupied CPU  11  resource by certain running program is too large, for example 80%, it will result in that the start time of the application program of part of the client terminals is too long or the application program can&#39;t operate, when serious, it will cause the collapse of the operation of the network computer system. For example, when the request amount of resource occupied by the application program sent by certain client terminal to the server  1  is too large, namely, the CPU  11  needs more time to execute, then the CPU  11  needs to execute the application program before execution of the application program requested and sent by other client terminals later. Therefore it will result in that the later application programs occupied smaller resource can&#39;t be executed timely, and these client terminals response slowly. 
         [0007]    The manner of the CPU  11  executing a plurality of application programs is distributing execution slots to each application program, when the request amount of resource requested by certain application program is larger, the length of slot distributed by the CPU  11  is relatively longer when executing the application program. Therefore, the CPU  11  only distributes shorter slot to execute part of the processes of later-requested application program in the idle time between executions of a plurality of processes of the application program. 
         [0008]    Due to the idle time between the plurality of the processes of the prior application program is shorter, so the CPU  11  often can&#39;t execute the processes of the later application program, and the later application program can&#39;t be executed until the execution of the prior application program is finished, which results in the execution time of later application program is too long and the client terminal responses slowly. 
         [0009]    Certainly, in the environment in which a single computer is running, there will be such problem that the request amount of resource requested by the prior application program is too large and results in that the later application program can&#39;t start timely, and the response time of the application program of the computer is too long, which causes the “crash” of the computer. 
       Solution of the Technology 
       [0010]    The main purpose of the present invention is to provide a computer system which enables the application program with smaller request amount of resource responses rapidly. 
         [0011]    Another purpose of the present invention is to provide a operating method of the computer system that can effectively avoid “crash” phenomenon of the computer. 
         [0012]    In order to realize above-mentioned main purpose, the computer system provided by the present invention comprises: a CPU and a memory connected to the CPU; wherein, the memory is provided with a resource allocating management storage region for storing the execution sequence of the CPU executing an application program, the memory stores a resource allocating management unit used for dynamically changing the execution sequence according to request amount of resource occupied by each of a plurality of application programs, wherein the changed execution sequence is such that the execution priority level of an application program with a small request amount of resource is higher than the execution priority level of an application program with a large request amount of resource. 
         [0013]    A preferred scheme is, the computer system is a network computer system, the network computer system comprises a server and a plurality of client terminals connected to the server, wherein a CPU and the memory connected to the CPU are provided in the server, a resource allocating management unit and a resource allocating management storage region are provided in the memory of the server. 
         [0014]    Thus it can be seen, the server of the network computer system is provided with a resource allocating management unit which orders the execution sequence of a plurality of application programs of a plurality of client terminals, so the problem that the request amount of resource by certain application program of certain client terminal is too large and results in the slow running of other client terminals can be effectively avoided, and the running speed of all client terminals can be effectively improved. 
         [0015]    In order to realize another above-mentioned purpose, the foregoing operating method of the computer system provided by the present invention comprises a resource allocating management unit to receive information on request amount of resource sent from a plurality of application programs and writes an execution sequence of the plurality of application programs into the resource allocating management storage region, the resource allocating management unit dynamically changes the execution sequence of the plurality of application programs according to the request amount of resource occupied by each application program, wherein the sort of the execution sequence is such that the execution priority level of an application program with a small request amount of resource is higher than the execution priority level of an application program with a large request amount of resource, and the CPU executes the plurality of application programs according to the priority levels of the plurality of application programs from high to low orderly. 
         [0016]    It can be seen from foregoing scheme, the CPU prior executes the application program with small request amount of resource when executing the plurality of application programs, in this way, it can ensure the execution time of the resource with small request amount of resource is shorter, and the “crash” phenomenon caused by the slow response speed of the computer can be avoided. 
         [0017]    A preferred scheme is, the computer system is a network computer system, the network computer system comprises a server and a plurality of client terminals connected to the server, wherein a CPU and the memory connected to the CPU are provided in the server, a resource allocating management unit and a resource allocating management storage region are provided in the memory of the server, the resource allocating management unit dynamically changes the execution sequence of a plurality of application programs of a plurality of terminals. 
         [0018]    Thus it can be seen, the server of the network computer system can effectively manage the execution sequence and execution time of a plurality of application programs by resource allocating management unit, and the slowness of entire running speed of a plurality of client terminals can be avoided. 
         [0019]    Further scheme is, the resource allocating management unit stores a threshold of computer resource usage, the resource allocating management unit determines whether the current computer resource usage is higher than the threshold, if higher, then dynamically changes the execution sequence of a plurality of application programs. 
         [0020]    In this way, the resource allocating management unit only dynamically changes the execution sequence of the plurality of application programs when the computer resource usage is higher than the threshold, so the frequently changing of the execution sequence of the application programs can be avoided, and it is beneficial to the coherence of the execution of application program. 
       Advantageous Effects 
       [0021]    The present invention adopts the resource allocating management unit to order execution sequence of a plurality of application programs, the application program with small request amount of resource can be executed prior, and the application program with large request amount of resource will be executed after the execution of the application program with small request amount of resource is finished. Thus, the CPU can reduce the execution priority level of the application program with large request amount of resource when it executes the application program, and prior executes other application program with small request amount of resource, the long execution time of the application program with small request amount of resource can be avoided, and thus the “crash” phenomenon is avoided. 
     
    
     
       BRIEF DESCRIPTION OF DRAWINGS 
         [0022]      FIG. 1  is a structural schematic block diagram of a related network computer system; 
           [0023]      FIG. 2  is a structural schematic block diagram of the first embodiment of the computer system of the present invention; 
           [0024]      FIG. 3  is a flow chart of the embodiment of the operating method of the computer system of the present invention; 
           [0025]      FIG. 4  is a storage schematic view of the resource allocating management storage region before changing the execution sequence in the first embodiment of the computer system of the present invention; 
           [0026]      FIG. 5  is a storage schematic view of the resource allocating management storage region after changing the execution sequence in the first embodiment of the computer system of the present invention; 
           [0027]      FIG. 6  is a structural schematic block diagram of the second embodiment of the computer system of the present invention. 
       
    
    
       [0028]    The following is detailed description of the present invention with reference to drawings and embodiments. 
       DETAILED DESCRIPTION OF THE EMBODIMENTS 
       [0029]    The first embodiment of the computer system and the embodiment of the operating method of the computer system. 
         [0030]    Referring to  FIG. 2 , the computer system of the embodiment is a network computer system, having a server  2  and three client terminals  27 ,  28 ,  29 , wherein, the server  2  is provided with a CPU  21 , an inner memory as a RAM  22  and a hard disk as an electrically erasable read-only memory (ROM)  23 . Certainly, a flash memory (flash) or a fixed hard disk can be used as hard disk. The server  1  is also provided with other auxiliary devices, such as input/output device, display card and the like. 
         [0031]    The server  2  is provided with three network interfaces  24 ,  25 ,  26 , connected to three client terminals  27 ,  28 ,  29  respectively in wired or wireless manner as a network. In this embodiment, three client terminals  27 ,  28 ,  29  are terminals all only provided with a CPU, an inner memory and an input/output device, no hard disk in them, so that the client terminals  27 ,  28 ,  29  all need to send execution request for application program to the server to realize the execution of the application programs. 
         [0032]    The server  2  of this embodiment is also provided with a resource allocating management memory  30 , the resource allocating management memory  30  can be a memory integrated on the mainboard of the server  2 , to facilitate the server  1  integrating the function of the invention. The CPU  21  accesses the resource allocating management memory  30  through the RAM  22 . The resource allocating management memory  30  is provided therein with a resource allocating management unit  31  and a resource allocating management storage region  32 , the resource allocating management storage region  32  stores the execution sequence of a plurality of application programs waiting for execution by the CPU  21 , and the resource allocating management unit  31  is used for the management of the execution sequence of the plurality of application programs, including dynamically real-time change of the execution sequence of each application program. 
         [0033]    And, the resource allocating management unit  31  stores a threshold of resource usage, such as the threshold of usage rate of the CPU  21 , for example 90%. The resource allocating management unit  31  dynamically changes the execution sequence of each application program if only the current usage rate of CPU  21  is higher than the threshold. 
         [0034]    Referring to  FIG. 3 , when the network computer system is working, the client terminal sends the information on execution request of the application program to the server  2 , the resource allocating management unit  31  of the server  2  will receive the request information of each application program sent from the plurality of terminals, namely performs step S 1 . The resource allocating management unit  31  performs step S 2  to write the execution sequence of a plurality of application programs into the resource allocating management storage region  32  after receiving request information on a plurality of application programs. The newly-requested application program will be written into the end of the sequence if in the execution sequence in the resource allocating management storage region  32  there still is unfinished application programs, namely, the execution priority level of the newly-requested application program is the lowest. 
         [0035]    For example, as shown in  FIG. 4 , the execution sequence stored in the resource allocating management storage region includes nine application programs need to be executed, including A program of the client terminal  27 , B program of the control terminal  29 , C program of the client terminal  28  and the like. After the client terminal  27  sends the information on the execution request of D program to the server  2 , the D program will be written into the table of the execution sequence by the resource allocating management unit, and the execution sequence of the D program is 10, which is the lowest execution priority level. 
         [0036]    Then, the resource allocating management unit  31  performs step S 3  to determine whether the current usage rate of the CPU  21  is higher than the threshold, if it is higher than the threshold, step S 4  will be performed to dynamically change the execution sequence of each application program. 
         [0037]    At this time, the resource allocating management unit  31  determines the request amount of resource requested by each application program, which is the occupied slot length of CPU, and changes the execution sequence of each application program according to the length of occupied slot. The principle of changing execution sequence is, the priority level of the application program with large request amount of resource, which occupies longer slot, is low, the priority level of the application program with small request amount of resource, which occupies shorter slot, is high. 
         [0038]    According to the above-mentioned principle of changing, the execution sequence after changing is shown as in  FIG. 5 . Due to the D program of the client terminal  27  occupies the shortest slot, only 5 ms, so the execution priority level is highest, its execution sequence is “1”. The B program of the client terminal  29  occupies 10 ms of slot, just longer than the slot occupied by A program, its execution priority level is higher, the execution sequence is “2”. The slot that A program of the client terminal  27  occupies is the longest, so its execution priority level is lowest, the execution sequence is “10”. While the slot occupied by C program of the client terminal  28  is longer, so the execution priority level is lower, the execution sequence is “9”. 
         [0039]    And so on, the resource allocating management unit changes the execution priority level of each application program according to the slot length occupied by it. 
         [0040]    Certainly, if the usage rate of the CPU  21  is lower than the threshold, the resource allocating management unit will not change the execution sequence of the application program, namely the execution sequence of the plurality of application programs is arranged according to the time sequence of the application program request. 
         [0041]    Then, the CPU  21  performs step S 5 , it executes the application programs according to the execution sequence stored in the resource allocating management storage region  32  in order from high priority level to low priority level. 
         [0042]    When the CPU  21  executes a application program, it distributes very short slot to the application program and executes a process or thread of the application program in the slot, when a process or thread is executed, the CPU  21  has idle slot, which can be used to execute a process or thread of the next application program. 
         [0043]    When a process or thread is executed, the resource allocating management unit  31  needs to reorder the sequence of the execution stored in the resource allocating management storage region  32 , and remove the finished application program from the execution sequence, and update the remaining slot length occupied by each application program, then order the execution sequence of each application program according to remaining length of the occupied slot. 
         [0044]    Certainly, the CPU  21  also determines whether the execution of all application programs are finished, in other words, performs step S 6 , if there still is unfinished application program, returns to step S 1 , or the CPU  21  executes the application programs according to updated execution sequence. 
         [0045]    Thus it can be seen, the resource allocating management unit  31  dynamically real-time changes the execution sequence of a plurality of application programs, and updates the execution sequence immediately when a thread or process of certain application program is executed, then executes a process or thread of the next application program. In this way, the plurality of application programs are executed alternatively, and the execution priority level of the application program with small request amount of resource is higher and the time of it is shorter, and the response speed within the client terminal is faster. 
         [0046]    It is clear that, even though certain client terminal sends a application program request with large request amount of resource to the server, it will not result in the application program with small request amount of resource requested later can&#39;t be executed timely, thus the problem that the long response time of the application program requested later is avoided, so that the “crash” phenomenon at the client terminal can be avoided effectively. 
         [0047]    Due to the execution time of the application program with small request amount of resource is often shorter, and there usually have more idle slots between the execution of application programs with small request amount of resource which can be used to execute application programs with large request amount of resource, so that the prior execution of the application program with small request amount of resource will not result in that the waiting time for the execution of the application program with large request amount of resource is too long. 
         [0048]    When executing application program, the CPU  21  needs to exchange data with the RAM  22  and the electrically erasable read-only memory  23 , and to transfer the data to client terminals  27 ,  28 ,  29  through the network interfaces  24 ,  25 ,  26 , therefore certain application program, which occupies longer slot of the CPU  21 , will occupies more usage of the RAM  22 , resource of the electrically erasable read-only memory  23  and the network resource. 
         [0049]    It is thus clear that, the request amount of computer resource occupied by an application program is not always the occupied slot length of the CPU  21 , also can be the usage occupied the RAM  22 , or the usage occupied the network resource, such as the amount of the data traffic and the like. 
         [0050]    The second embodiment of the computer system. 
         [0051]    Referring to  FIG. 6 , the computer system of this embodiment is a personal computer  4 , which has a CPU  41 , an inner memory as a RAM  42 , a hard disk as an electrically erasable read-only memory  43 , and is provided with auxiliary equipments, such as input/output device, display card and the like. 
         [0052]    The personal computer  4  is also provided with a resource allocating management memory  45  integrated on the mainboard of the computer  4 , the resource allocating management memory  45  is provided with a resource allocating management storage region  47  and a resource allocating management unit  46 , the resource allocating management storage region  47  stores the execution sequence of a plurality of application programs to be executed by the CPU  41 , the resource allocating management unit  46  dynamically real-time changes the execution sequence of a plurality of application programs, to ensure the prior execution of the application program with small request amount of resource, thus the startup and response speed of the application program with small request amount of resource are improved, and the “crash” phenomenon is avoided. 
         [0053]    While working, the personal computer  4  still determines whether it needs to change the execution sequence of application programs according to the current usage rate of the CPU  41 , if the current usage rate of the CPU  41  is lower than the threshold, the resource allocating management unit  46  won&#39;t change the execution sequence of application programs, avoiding the resource allocating management unit  46  frequently changing the execution sequence of application programs, and keeping the coherence of the execution of the application programs. 
         [0054]    Certainly, foregoing embodiments are only preferred implementation schemes of the present invention, there may be many modifications in practical application, for example, the resource allocating management unit and the resource allocating management storage region is provided in a hard disk instead of the separated resource allocating management memory; or the resource allocating management storage region is provided on the RAM or other storage devices; or, the resource allocating management unit is provided on other external storage devices such as USB disk, mobile hard disk, the purpose of the present invention can also be realized through these modifications. 
         [0055]    Finally, it should be emphasized that, the present invention is not limited to foregoing embodiments, such as the change of the threshold of the computer resource usage, the change of the form of the computer system memory also should be included within the scope of the claims of the present invention. 
       INDUSTRIAL APPLICABILITY 
       [0056]    Due to the resource allocating management unit orders the execution sequence of a plurality of application programs, the application program with small request amount of resource can be executed prior, and the application program with large request amount of resource will be executed after the execution of the application program with small request amount of resource is finished. Thus, the CPU can reduce the execution priority level of the application program with large request amount of resource when it executes the application program, and prior executes other application programs with small request amount of resource, the long execution time of the application program with small request amount of resource can be avoided, and thus the “crash” phenomenon is avoided.