Summary of the invention
The invention provides a kind of system resource allocation method, can the problem of resolution system resource overload.
Present invention also offers a kind of system resource configuration device, can the problem of resolution system resource overload.
Technical scheme of the present invention is achieved in that
A kind of system resource allocation method, comprising:
Judge whether the idleness of system resource is less than the thresholding preset, if be less than, then searching the non-critical processes of excessive occupied system resources, is described process marking to the degree of dependence of process, process to whether current this process that operating of the importance of user, the degree of reliability of process or user according to the crucial rank of process, system cloud gray model;
When process mark close to or when equaling maximal value, if the idleness of system resource is greater than 0%, then keep the priority of this process; Otherwise, reduce the priority of this process;
When the mark of process is close to medium value, reduce the priority of this process;
When process mark close to or when equaling minimum value, prompting stop this process.
In said method, non-critical processes is the process except the process that system cloud gray model must call.
A kind of system resource configuration device, comprising:
Searching module, for judging whether the idleness of system resource is less than the thresholding preset, if be less than, then searching the non-critical processes of excessive occupied system resources, and indicating intelligent module is the process marking found;
Intelligent object, for the crucial rank according to process, system cloud gray model to the degree of dependence of process, process to the importance of user, the degree of reliability of process or user whether current operating this process for described in search the process marking that module searches arrives;
Adjusting module, for when process mark close to or when equaling maximal value, if the idleness of system resource is greater than 0%, then keep the priority of this process; Otherwise, reduce the priority of this process; When the mark of process is close to medium value, reduce the priority of this process; When process mark close to or when equaling minimum value, prompting stop this process.
In the said equipment, search the non-critical processes of module searches for the process except the process that system cloud gray model must call.
Visible, the system resource allocation method that the present invention proposes and equipment, when monitoring system resource and being nervous, find out the non-critical processes of excessive occupied system resources, this non-critical processes is given a mark and adjusts priority, thus the system resource shared by release portion process, the problem of resolution system resource overload.
Embodiment
The present invention proposes a kind of system resource allocation method, if Fig. 1 is the method flow diagram that the present invention proposes, comprising:
Step 101: judge whether the idleness of system resource is less than the thresholding preset, if be less than, then performs step 102;
Step 102: the non-critical processes searching excessive occupied system resources, for described process is given a mark;
Step 103: the priority adjusting described process according to the mark of described process and the idleness of system resource.
Below lift specific embodiment to introduce in detail.
As the realization flow figure that Fig. 2 is embodiment of the present invention allocating system resource, this embodiment comprises the following steps:
Step 201: supervisory system resource take situation, judge whether the idleness of system resource is less than the thresholding preset, if be less than, then perform step 202; If be not less than, illustrative system resource is also very abundant, does not need to make any adjustments.
This thresholding can be set to 50%, when the idleness of system resource (as CPU, memory headroom etc.) is not less than 50%, does not need to adjust, needs to arrange different threshold values for different application scene.A kind of citing is only as threshold value using 50%, this threshold value can be arranged as the case may be, such as, carry out technical Analysis according to the check figure of multi-core CPU and the Technical Architecture of CPU, the system resource occupancy as certain core in multi-core CPU be 100% situation be also abnormal.
Step 202: the process of searching excessive occupied system resources.
Step 203: judge whether this process is system core process, if non-critical processes, then gives intelligent object analysis by this process.
Wherein, critical processes refers to the process that system cloud gray model must call, and the mode such as digital signature mainly through the MD5 value of program, program point and title, program judges; For security classes softwares such as antivirus softwares, then the eigenwert (comprising characteristic signature, filename path etc.) mainly through manually installing rear collection judges.Such as, for Windows system, mainly see whether this process possesses Microsoft signature, and the process that can find from original Windows system process list is critical processes.Critical processes is generally reliable and stable, can not take too many system resource.
Step 204: intelligent object analyzes this process, and be the marking of this process.
Particularly, intelligent object can analyze the production company of this process, software classification is (as virus killing, IM chats), software function is (as background scanning process, foreground process), then the crucial rank of this process comprehensive is (as video card, sound cards etc. drive process), system to its degree of dependence (as virus killing, firewall processes), this process to the importance of user (as word, QQ etc. remain with the process of user profile), the degree of reliability of this process is (as with or without version information, with or without digital signature, software release time and the compatibility to new system), whether user current operates (being obtained by API such as GtforeGoundWndow)) etc. condition, for this process provides a corresponding mark, mark can adopt 100 points of systems, 1 be divided into minimum, 100 be divided into the highest.
Afterwards, just can according to the priority of the mark of process and current this process of resource consumption situation dynamic conditioning of system.Such as, for system core process, do not adjust its priority; For fail-safe software, software that drive software isodisperse is very high, consider after system Current resource consumes, do not carry out processing (unless system CPU, EMS memory occupation all reach the situation of 100%) as far as possible; For user's foreground process such as word, QQ, can only suitably reduce its priority; The process too low for mark, occupying system resources is too serious, directly prompting suggestion user stops this process.
The present invention's system resource of can reappraising when monitoring system resources sit idle rate and be less than the thresholding preset at every turn takies situation, for each process is given a mark again; Or only to the process marking of newly opening.Or namely the present invention can give a mark to all processes again every one period of regular time, or namely the process often increasing fixed number gives a mark again to all processes, adopts this preferred mode, the burden that system is caused of frequently giving a mark can be alleviated.
In addition, in some scenarios, user is absorbed in certain or some specific processes (such as game process or video playback process).Now, the process that user pays close attention to can be set to high priority; Meanwhile, under the prerequisite of not influential system stability, the process that other non-user are paid close attention to is set to low priority, and the system resource making it take is more low better.When this scene changes, need to recover the initial priority of each process.
Each process has corresponding priority, and priority determines when it runs and receive how many CPU time.The priority of process totally 32 grades, can adopt numerical value 0 to 31 to represent, numerical value is that 0 expression priority is minimum, numerical value is that 31 expression priority are the highest, and this priority also can be called that base priority is not (base priority level).System is according to the operation of different priority scheduling processes.0-15 level is normal priority, and the priority of process can dynamic change, and high priority process preferentially runs, and when only having high priority process not run, just schedules low priority process is run; The process that priority is identical is run in turn according to timeslice.16-31 level is real-time priority, the maximum difference of real-time priority and normal priority is that the operation of equal priority process is not in accordance with round-robin, but the process first run just first control CPU, if this process does not initiatively abandon the control to CPU, process that is at the same level or low priority just cannot be run.
Following steps 205-212 introduces the concrete mode of one according to the mark of process and the Expenditure Levels adjustment process priority of system resource, and the present invention can also adopt other mode to adjust, and concrete mode is determined according to actual conditions.
Step 205: judge that whether the mark of process is higher than 90, if so, then do not adjust the priority of this process; Otherwise, perform step 206;
Step 206: judge that whether the mark of this process is higher than 80, if so, then performs step 207; Otherwise, perform step 208;
Step 207: judge whether system resources sit idle rate is greater than 10%, if so, does not then adjust the priority of this process; Otherwise, reduce the priority of this process, and ensure that the priority of this process is not less than 10, terminate the adjustment to current process;
Step 208: judge that whether the mark of this process is higher than 70, if so, then performs step 209; Otherwise, perform step 210;
Step 209: judge whether system resources sit idle rate is greater than 30%, if so, does not then adjust the priority of this process; Otherwise, reduce the priority of this process, and ensure that the priority of this process is not less than 10, terminate the adjustment to current process;
Step 210: judge that whether the mark of this process is higher than 30, if so, then reduces the priority of this process, and ensure that the priority of this process is not less than 5, terminate the adjustment to current process; Otherwise, perform step 211;
Step 211: judge that whether the mark of this process is higher than 10, if so, is then reduced to 0 by the priority of this process, terminates the adjustment to current process; Otherwise, perform step 212;
Step 212: judge whether system resources sit idle rate is less than 10%, if so, then points out user to stop this process.
Correspondingly, the present invention also proposes a kind of system resource configuration device, and if Fig. 3 is the structural representation of this equipment, this equipment comprises:
Searching module 301, for judging whether the idleness of system resource is less than the thresholding preset, if be less than, if be less than, then searching the non-critical processes of excessive occupied system resources, and indicating intelligent module is the process marking found;
Intelligent object 302, for for described in search the process marking that module 301 finds;
Adjusting module 303, the idleness for the mark got for process according to described intelligent object 302 and system resource adjusts the priority of this process.
In said system, searching the non-critical processes that module 301 searches is the process except the process that system cloud gray model must call.
Above-mentioned intelligent object 302 can be given a mark to whether current this process that operating of the importance of user, the degree of reliability of process or user to the degree of dependence of process, process specifically for the crucial rank according to process, system cloud gray model.
Above-mentioned adjusting module 303 according to the mode of the priority of the idleness adjustment process of the mark of process and system resource can be:
When process mark close to or when equaling maximal value, if the idleness of system resource is greater than 0%, then keep the priority of this process; Otherwise, reduce the priority of this process;
When the mark of process is close to medium value, reduce the priority of this process;
When process mark close to or when equaling minimum value, prompting stop this process.
As fully visible, the system resource allocation method that the present invention proposes and equipment, when monitoring system resource and being nervous, the non-critical processes of excessive occupied system resources can be found out, these processes are given a mark and adjusts priority, thus the system resource shared by release portion process, the problem of resolution system resource overload.The present invention can be suitable for but be not limited to each version of Windows system.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.