CN106126335A - The Media Survey method of terminal unit and terminal unit - Google Patents
The Media Survey method of terminal unit and terminal unit Download PDFInfo
- Publication number
- CN106126335A CN106126335A CN201610431515.6A CN201610431515A CN106126335A CN 106126335 A CN106126335 A CN 106126335A CN 201610431515 A CN201610431515 A CN 201610431515A CN 106126335 A CN106126335 A CN 106126335A
- Authority
- CN
- China
- Prior art keywords
- utilization rate
- cpu
- time interval
- terminal unit
- media survey
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
Abstract
The present invention provides Media Survey method and the terminal unit of a kind of terminal unit.The Media Survey method of terminal unit of the present invention, including: when carrying out Media Survey, obtain the utilization rate of the central processor CPU of described terminal unit;If the utilization rate of described CPU is equal to or more than the utilization rate threshold value preset, then suspend Media Survey.The present invention is automatic pause Media Survey when cpu resource uses too high, makes Media Survey enter waiting state, reduces Media Survey and takies system load, thus reduces the impact on front end user operation.
Description
Technical field
The present invention relates to Media Survey technical field, the Media Survey method and the terminal that particularly relate to a kind of terminal unit set
Standby.
Background technology
Android (Android) system, typically will be to internal or peripheral hardware after system start-up or inserting peripheral hardware storage device
Storage device carries out Media Survey, and the media files such as the audio frequency and video scanned be recorded data base, and then unified with one
Form be supplied to other application (such as music player, video player etc.).
Along with the development of memory technology, capacity of memory device is increasing, and open ended catalogue and media file also can be got over
Come the most, the growth of sweep time can be caused accordingly, make Media Survey become a time-consuming process.Scanning process meter at a high speed
Calculate and occupy again more CPU (Central Processing Unit is called for short CPU) resource, if scanned
There are other tasks of expending resource and then there will be the situation that CPU usage is higher in journey, thus causes system load relatively Gao Eryun
Row is slowly.If additionally occurring in scanning process that the read operation of file content emulative with Media Survey frequently please
Ask, also due to I/O bottleneck etc. cannot timely respond to the operation requests of user.These situations be all likely to result in response slowly or
Without the appearance of response condition, Consumer's Experience is poor.
Therefore, problem of the prior art is, current Media Survey process resource takies and more causes system to run slowly, can
Can cannot timely respond to process the various request in front end.
Summary of the invention
The present invention provides Media Survey method and the terminal unit of a kind of terminal unit, to overcome media in prior art to sweep
Retouch process resource to take and more cause system to run slowly, the problem that possibly cannot timely respond to process the various request in front end.
First aspect, the present invention provides a kind of Media Survey method of terminal unit, including:
When carrying out Media Survey, obtain the utilization rate of the central processor CPU of described terminal unit;
If the utilization rate of described CPU is equal to or more than the utilization rate threshold value preset, then suspend Media Survey.
Alternatively, after the utilization rate of the central processor CPU obtaining described terminal unit, described method also includes:
The record acquisition time;
Utilization rate according to described CPU calculates waiting time;
Accordingly, after suspending Media Survey, described method also includes:
When the interval of current time and described acquisition time exceedes described waiting time, obtain the utilization rate of described CPU;
If the utilization rate of described CPU is less than described default utilization rate threshold value, then restart Media Survey.
Alternatively, obtain the utilization rate of the central processor CPU of described terminal unit, including:
According to the described CPU busy duration in the first prefixed time interval and free time length, and the second Preset Time
Busy duration in interval and free time length, obtain the utilization rate of described CPU;
Wherein, described second prefixed time interval is the previous prefixed time interval of described first prefixed time interval;
Described second prefixed time interval is equal to described first prefixed time interval.
Alternatively, according to the described CPU busy duration in the first prefixed time interval and free time length, and second is pre-
If the busy duration in time interval and free time length, obtain the utilization rate of described CPU, specifically include:
The utilization rate of described CPU is obtained by equation below (1);
Load=(Busy-sBusy)/((Busy+Idle)-(sBusy+sIdle)) × 100 (1);
Wherein, Load represents the utilization rate of described CPU;
Busy represents the busy duration in described first prefixed time interval, and Idle represents described first prefixed time interval
Interior free time length;
SBusy represents the busy duration in described second prefixed time interval, and sIdle represents between described second Preset Time
Every interior free time length.
Alternatively, calculate waiting time according to the utilization rate of described CPU, including:
Described waiting time is calculated by equation below (2);
Delay=100+ (Load/2) × (Load/2) (2);
Wherein, Delay represents described waiting time.
Alternatively, described method also includes:
Monitor whether user's operation requests;
If the utilization rate of described CPU is less than described default utilization rate threshold value, and has monitored user's operation requests, the most temporarily
Stop Media Survey.
Alternatively, after having monitored user's operation requests, described method also includes:
The record monitoring time;
Accordingly, after suspending Media Survey, described method also includes:
When the interval of current time and described monitoring time exceedes default time interval threshold value, monitor whether user
Operation requests;
If monitoring no user operation requests, then restart Media Survey.
Second aspect, the present invention provides a kind of terminal unit, including:
Acquisition module, for when carrying out Media Survey, obtains the use of the central processor CPU of described terminal unit
Rate;
Processing module, if the utilization rate for described CPU equals to or more than the utilization rate threshold value preset, then suspends media and sweeps
Retouch.
Alternatively, described acquisition module specifically for:
The utilization rate of described CPU is obtained by equation below (1);
Load=(Busy-sBusy)/((Busy+Idle)-(sBusy+sIdle)) × 100 (1);
Wherein, Load represents the utilization rate of described CPU;
Busy represents the busy duration in described first prefixed time interval, and Idle represents described first prefixed time interval
Interior free time length;
SBusy represents the busy duration in described second prefixed time interval, and sIdle represents between described second Preset Time
Every interior free time length.
Alternatively, described computing module specifically for:
Described waiting time is calculated by equation below (2);
Delay=100+ (Load/2) × (Load/2) (2);
Wherein, Delay represents described waiting time.
Alternatively, also include:
Monitoring modular, is used for having monitored whether user's operation requests;
Described processing module, if the utilization rate being additionally operable to described CPU is less than described default utilization rate threshold value, and monitors
There is user's operation requests, then suspend Media Survey.
Alternatively, described logging modle, it is additionally operable to after having monitored user's operation requests record the monitoring time;
Accordingly, described monitoring modular, it is additionally operable to:
When the interval of current time and described monitoring time exceedes default time interval threshold value, monitor whether user
Operation requests;
Described processing module, is additionally operable to:
If monitoring no user operation requests, then restart Media Survey.
The Media Survey method of terminal unit of the present invention and terminal unit, during Media Survey, the use of monitoring CPU
Rate, the utilization rate if there is CPU equals to or more than the utilization rate threshold value preset, and illustrates that now cpu resource use is too high then certainly
Dynamic time-out Media Survey, makes Media Survey enter waiting state, reduces Media Survey and takies system load, thus reduces
Impact on front end user operation.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
In having technology to describe, the required accompanying drawing used is briefly described, it should be apparent that, the accompanying drawing in describing below is this
Some bright embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, it is also possible to
Other accompanying drawing is obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of Media Survey method one embodiment of terminal unit of the present invention;
Fig. 2 is the structural representation of terminal unit one embodiment of the present invention;
Fig. 3 is the structural representation of another embodiment of terminal unit of the present invention.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
The a part of embodiment of the present invention rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under not making creative work premise, broadly falls into the scope of protection of the invention.
The application such as Media Survey is relevant to a multimedia critical function, and Media Survey is such as audio player carry
For convenient, enrich the function of these application, enhance Consumer's Experience.But Media Survey itself there is also certain restriction:
1. sweep time.Owing to scanning process to travel through whole peripheral hardware file system to complete the filtration of media file,
Peripheral hardware file number directly affect sweep time, especially with the increase of peripheral hardware capacity, accommodating file gets more and more, and increases
Sweep time.
2. systematic function.Scan function will also result in impact to systematic function, needs CPU to bear with bigger in scanning process
Carrying turns.
It addition, if there is customizing scan function, as increased such as media file meta data in scanning simultaneously
(metadata) information, the function such as video, picture thumbnail, on the one hand this function further increases sweep time and system is born
Carry;On the other hand video, picture thumbnail obtain and are required for decoder resources with broadcasting, owing to most platforms can only be simultaneously
Support a road decoder resources, if therefore user selects to play media file in scanning process, then there may be resource punching
The prominent user media that affects plays experience.
For the problem that sweep time is long, multithreading is mostly used to add fast scan speed, but multithreading itself
Add again the system load during scanning.If user's control system in scanning process, easily due to system performance problems
Cause response user's request to slow, application program even occurs without response (Application Not Responding, letter
Claim ANR) problem, affect Consumer's Experience.
The method of the embodiment of the present invention, it is intended to solve Media Survey process resource in prior art and take and more cause system
Run slowly, the problem that possibly cannot timely respond to process the various request in front end.
The terminal unit related in the embodiment of the present invention includes but not limited to the intelligent terminal such as intelligent television, smart mobile phone
Equipment.
With specifically embodiment, technical scheme is described in detail below.These concrete enforcements below
Example can be combined with each other, and may repeat no more in some embodiment for same or analogous concept or process.
Fig. 1 is the schematic flow sheet of Media Survey method one embodiment of terminal unit of the present invention.As it is shown in figure 1, this reality
The method executing example, including:
Step 101, when carrying out Media Survey, obtain the utilization rate of central processor CPU of terminal unit;
If the utilization rate of step 102 CPU is equal to or more than the utilization rate threshold value preset, then suspend Media Survey.
Concrete, owing to Media Survey is a process the most time-consuming, and the calculating of high speed during Media Survey
Occupy again bigger cpu resource, if Media Survey process exists other tasks of expending resource, there will be CPU usage
Higher situation, thus cause system load higher and run slowly.If additionally occurred frequently during Media Survey
User operation is asked, and due to the higher operation requests that possibly cannot timely respond to front end user of system load, affects Consumer's Experience.
And Media Survey is as a kind of background service, is not as front-end operations and must have higher responsiveness like that, the most permissible
When cpu resource utilization rate is higher and/or do time-out in short-term when there is user operation request to process.
In the present embodiment, when carrying out Media Survey, can obtain in described terminal unit in real time or periodically
The utilization rate of central processor CPU;If the utilization rate of CPU is equal to or more than the utilization rate threshold value preset, then suspend Media Survey.Example
If default utilization rate threshold value is 80%, when the utilization rate of CPU is equal to or more than 80%, illustrate that now system load is higher,
Needing to suspend Media Survey, now Media Survey enters waiting state, when the utilization rate of CPU is relatively low, can restart
Media Survey so that technical scheme can utilize free time to complete Media Survey to greatest extent.
Further, in the present embodiment, if the utilization rate of CPU is equal to or more than the utilization rate threshold value preset, it is also possible to
Further according to whether there is user's operation requests, it may be judged whether suspend Media Survey.
Specifically, if the utilization rate of CPU is equal to or more than the utilization rate threshold value preset, and when having user's operation requests, temporarily
Stop Media Survey.
The Media Survey method of the terminal unit that the present embodiment provides, during Media Survey, the use of monitoring CPU
Rate, the utilization rate if there is CPU equals to or more than the utilization rate threshold value preset, and illustrates that now cpu resource use is too high then certainly
Dynamic time-out Media Survey, makes Media Survey enter waiting state, reduces Media Survey and takies system load, thus reduces
Impact on front end user operation.
On the basis of above-described embodiment, in order to restart Media Survey timely, make full use of free time
Complete Media Survey, the most in the present embodiment, can also proceed as follows after step 101:
The record acquisition time;
Utilization rate according to CPU calculates waiting time;
Accordingly, after suspending Media Survey, it is also possible to proceed as follows:
When the interval of current time and the time of acquisition exceedes waiting time, obtain the utilization rate of CPU;
If the utilization rate of CPU is less than the utilization rate threshold value preset, then restart Media Survey.
Concrete, before first having to record time-out scanning, obtain the acquisition time during utilization rate of CPU, then according to CPU
Utilization rate calculate waiting time, the utilization rate of CPU is the highest, and waiting time is the longest.Media Survey kept within waiting time
Suspend, after exceeding waiting time, the most again decide whether that continuing waiting for or restart media sweeps according to the utilization rate of CPU
Retouching, the utilization rate of even CPU equal to or more than the utilization rate threshold value preset, then continues to suspend Media Survey.If the utilization rate of CPU
Less than the utilization rate threshold value preset, then restart Media Survey.
In above-described embodiment, free time and resource can be utilized to greatest extent to carry out Media Survey, alleviate Media Survey
The pressure that system resource is caused and the impact of user operation, it is ensured that sufficient resource priority response processes the user behaviour of front end
Ask.
On the basis of above-described embodiment, further, the central authorities of terminal unit are obtained as a kind of enforceable mode
The utilization rate of processor CPU, specifically can realize in the following way:
According to the CPU busy duration in the first prefixed time interval and free time length, and the second prefixed time interval
Interior busy duration and free time length, obtain the utilization rate of CPU;
Wherein, the second prefixed time interval is the previous prefixed time interval of the first prefixed time interval;Second presets
Time interval is equal to the first prefixed time interval.
Concrete, the busy duration used by the CPU in two adjacent prefixed time interval and free time length, determine
The utilization rate of CPU, busy duration refers to the load of CPU and exceedes the duration presetting load, and free time length refers to the load of CPU
Less than the duration presetting load.
Wherein, in actual applications, equation below (1) can be passed through and obtain the utilization rate of CPU;
Load=(Busy-sBusy)/((Busy+Idle)-(sBusy+sIdle)) × 100 (1);
Wherein, Load represents the utilization rate of CPU;
Busy represents the busy duration in the first prefixed time interval, and Idle represents the free time in the first prefixed time interval
Duration;
SBusy represents the busy duration in the second prefixed time interval, and sIdle represents the sky in the second prefixed time interval
Idle is long.
Concrete, the utilization rate of CPU is equal to: the difference of the busy duration in adjacent two prefixed time interval, with, adjacent
Busy duration in two prefixed time interval and the ratio of the difference of free time length, the difference of busy duration at busy duration and
Ratio shared in the difference of free time length is the biggest, then the utilization rate of CPU is the biggest.
On the basis of above-described embodiment, further, optionally, calculate waiting time according to the utilization rate of CPU, specifically may be used
To realize in the following way:
Waiting time is calculated by equation below (2);
Delay=100+ (Load/2) × (Load/2) (2);
Wherein, Delay represents waiting time.
Concrete, the initial utilization rate threshold value setting a CPU, if the utilization rate of the CPU calculated exceedes this use
Rate threshold value, then it is assumed that current system is the busiest needs to suspend what Media Survey calculating according to formula (2) needed to wait etc.
Treating duration, the utilization rate of CPU is the biggest, and waiting time is the longest.
On the basis of above-described embodiment, further, the method for the present embodiment can also comprise the steps:
Monitor whether user's operation requests;
If the utilization rate of CPU is less than the utilization rate threshold value preset, and has monitored user's operation requests, then suspends media and sweep
Retouch.
Concrete, in the present embodiment, if the utilization rate of CPU is less than the utilization rate threshold value preset, it is also possible to root further
According to whether having user's operation requests, it may be judged whether suspend Media Survey, when the utilization rate of CPU is less than the utilization rate threshold value preset,
And monitored user's operation requests, in order to reduce the impact on user operation request as far as possible, Media Survey can be suspended.
The Media Survey method of the terminal unit that the present embodiment provides, during Media Survey, the utilization rate of monitoring CPU
And having monitored whether user's operation requests, the utilization rate if there is CPU is less than the utilization rate threshold value preset, and has monitored
User operation is asked, and suspends Media Survey, makes Media Survey enter waiting state, thus reduces the shadow to front end user operation
Ring.
Further, optionally, after having monitored user's operation requests, it is also possible to comprise the steps:
The record monitoring time;
Accordingly, after suspending Media Survey, it is also possible to comprise the steps:
When the interval of current time and monitoring time exceedes default time interval threshold value, monitor whether user operation
Request;
If monitoring no user operation requests, then restart Media Survey.
Concrete, in the present embodiment, during for occurring during Media Survey that user asks operation, monitoring
During user operation request, record the monitoring time, a time interval threshold value can be preset, in current time and monitoring time
Interval when exceeding default time interval threshold value, further determine whether to suspend Media Survey, such as, exceed the default time
After interval threshold, no user operation requests, then restart Media Survey, or have user's operation requests, then continue to suspend matchmaker
Swept-volume.
Further, after exceeding default time interval threshold value, during no user operation requests, it is also possible to judge now
The utilization rate of CPU, whether less than the utilization rate threshold value preset, if being less than, restarts Media Survey, otherwise continues to suspend media
Scanning.
With a specific embodiment, said method is described in detail below:
The whole handling process of the embodiment of the present invention can be realized by 3 relatively independent modules: scan module, controls
Module (ThrottleUtil module), Input Monitor Connector (Input Monitoring) module.
Media file that scan module is responsible in end of scan equipment (this module can be the primary module of android or
It is the scan module customized, the embodiment of the present invention can use the Media Survey function of customization).Equipment carry it
After, scan module can receive the broadcast of hanging equipment information carrying breath and start Media Survey.Before starting Media Survey, first
CPU usage and the monitoring of user operation request is opened by ThrottleUtil module.Often scan through a subdirectory or
Actively pass through ThrottleUtil module check after one media item of person and whether have that the utilization rate of CPU is higher or user please
Ask operation to suspend scanning.
ThrottleUtil module is for starting utilization rate and the monitoring of user operation request of CPU.Monitoring method is opened
Latter aspect read at set intervals/proc/stat/ catalogue under virtual file acquisition of information CPU relevant information (as
Busy duration that CPU in one predetermined interval uses and free time length), according to the relevant information of the CPU obtained by above-mentioned reality
Execute the utilization rate calculating CPU in example.The initial utilization rate threshold value setting a CPU, if the utilization rate of the CPU calculated
Exceed this utilization rate threshold value, then it is assumed that the busiest needs of current system suspends Media Survey and according to the rule in above-described embodiment
Then calculate the waiting time needing to wait;On the other hand set up even in Binder mode with Input Monitoring module
Connect, and relevant parameter is included, and monitoring request type (as monitored button operation etc.), time interval threshold value, request results return logical
Know that mode (broadcast type parameter) passes to Input Monitoring module.ThrottleUtil module can receive Input
The disappearing of no user operation requests sent after what Monitoring sent currently have user's operation requests and overtime threshold value
Breath notice.When the user's operation requests that currently has receiving Input Monitoring transmission records this message when notifying to suspend
Scanning.
ThrottleUtil module may be provided for other method for realize suspend Media Survey, the method according to whether
The service condition that there is user operation request and CPU decides whether to suspend Media Survey.The method with a factor of influence,
The waiting time calculated by this factor of influence and cpu usage, the final time determining to need to suspend.
Concrete, when there is user operation request or the higher situation of CPU usage then suspends Media Survey, make scanning
Module enters waiting state, the system resource that release Media Survey takies.When Media Survey placed in a suspend state,
ThrottleUtil module receives the notice of overtime interval threshold no user operation requests or owing to cpu busy suspends super
Spend waiting time, the most again monitor.If neither there is user to ask the situation that operation and CPU usage are higher, then wake up up and sweep
Retouching thread and continue Media Survey, the time out otherwise recalculated according to CPU usage continues to keep halted state.
Such as, waiting time and time interval threshold value can be calculated by the front numerical value once monitored and factor of influence
Arriving, the waiting time such as monitoring for the first time is 5s, and in the case of factor of influence is relatively big, then second time monitors CPU usage
Time higher, current waiting time can be that factor of influence is multiplied by previous waiting time
Wherein, factor of influence can also change, if monitoring CPU usage is the highest the most several times, then factor of influence can
To become big, vice versa.
Being of the higher finger of above-mentioned CPU usage exceedes default utilization rate threshold value.
Input Monitoring module is a service module, operates in window management service (window manger
Service) in process.On the one hand this Input Monitoring module can intercept and capture user operation request in system layer, including
Button operation, point touching operation etc..On the other hand by binder mode receive that ThrottleUtil module sends to
The monitoring of family operation requests processes request, processes, according to the request of monitoring, the user operation request intercepted and captured, and according to
Whether the requirement of ThrottleUtil module will have the result of user's operation requests to carry out feedback notification.Concrete handling process is permissible
For, if continuously receiving the button operation that user is common in less time interval, then it is assumed that user is in the operation busy period, to
ThrottleUtil module sends the notice having user's operation requests;If no user button operation in a preset duration, then to
ThrottleUtil sends the notice of no user operation requests.
Fig. 2 is the structural representation of terminal unit one embodiment of the present invention.As in figure 2 it is shown, the terminal unit of the present embodiment,
Including:
Acquisition module 201 and processing module 202;
Wherein, acquisition module 201, for when carrying out Media Survey, obtain the central processor CPU of described terminal unit
Utilization rate;
Processing module 202, if the utilization rate for described CPU equals to or more than the utilization rate threshold value preset, then suspends matchmaker
Swept-volume.
Alternatively, as a kind of enforceable mode, the Media Survey device of terminal unit, it is also possible to including:
Logging modle, obtains for record after getting the utilization rate of central processor CPU of described terminal unit
Time;
Computing module, calculates waiting time for the utilization rate according to described CPU;
Accordingly, described acquisition module 201 is additionally operable to:
When the interval of current time and described acquisition time exceedes described waiting time, obtain the utilization rate of described CPU;
Described processing module 202, is additionally operable to:
If the utilization rate of described CPU is less than described default utilization rate threshold value, then restart Media Survey.
Alternatively, as a kind of enforceable mode, described acquisition module 201 specifically for:
According to the described CPU busy duration in the first prefixed time interval and free time length, and the second Preset Time
Busy duration in interval and free time length, obtain the utilization rate of described CPU;
Wherein, described second prefixed time interval is the previous prefixed time interval of described first prefixed time interval;
Described second prefixed time interval is equal to described first prefixed time interval.
Alternatively, as a kind of enforceable mode, described acquisition module 201 specifically for:
The utilization rate of described CPU is obtained by equation below (1);
Load=(Busy-sBusy)/((Busy+Idle)-(sBusy+sIdle)) × 100 (1);
Wherein, Load represents the utilization rate of described CPU;
Busy represents the busy duration in described first prefixed time interval, and Idle represents described first prefixed time interval
Interior free time length;
SBusy represents the busy duration in described second prefixed time interval, and sIdle represents between described second Preset Time
Every interior free time length.
Alternatively, as a kind of enforceable mode, described computing module specifically for:
Described waiting time is calculated by equation below (2);
Delay=100+ (Load/2) × (Load/2) (2);
Wherein, Delay represents described waiting time.
Alternatively, as a kind of enforceable mode, the Media Survey device of terminal unit, it is also possible to including:
Monitoring modular, is used for having monitored whether user's operation requests;
Described processing module 202, if the utilization rate being additionally operable to described CPU is less than described default utilization rate threshold value, and prison
Measure user's operation requests, then suspend Media Survey.
Alternatively, as a kind of enforceable mode, described logging modle, it is additionally operable to monitoring user's operation requests
The record monitoring time afterwards;
Accordingly, described monitoring modular, it is additionally operable to:
When the interval of current time and described monitoring time exceedes default time interval threshold value, monitor whether user
Operation requests;
Described processing module 202, is additionally operable to:
If monitoring no user operation requests, then restart Media Survey.
The terminal unit of the present embodiment, may be used for performing the technical scheme of embodiment of the method as shown in Figure 1, and it realizes former
Managing similar with technique effect, here is omitted.
Fig. 3 is the structural representation of another embodiment of terminal unit of the present invention.As it is shown on figure 3, the terminal of the present embodiment sets
Standby, may include that memorizer 301, processor 302 and communication interface 303;Wherein, memorizer 301, it is used for storing program;Specifically
Ground, program can include that program code, described program code include computer-managed instruction.Memorizer 301 may comprise at random
Access memorizer (random access memory is called for short RAM), it is also possible to also include nonvolatile memory (non-
Volatile memory), for example, at least one disk memory.
Processor 302, for performing the program of memorizer 301 storage, for performing what method embodiment of the present invention was provided
Technical scheme, it is similar with technique effect that it realizes principle, refers to the embodiment of the method shown in Fig. 1, and here is omitted.
Communication interface 303, is used for receiving user operation request;
In said apparatus, the function of processing module, acquisition module, logging modle, computing module and monitoring modular can be passed through
Processor 302 realizes.
Above-mentioned parts are communicated by one or more bus.It will be understood by those skilled in the art that shown in Fig. 3
The structure of terminal is not intended that limitation of the invention, and it both can be busbar network, it is also possible to be hub-and-spoke configuration, it is also possible to
Illustrate more or less of parts including ratio, or combine some parts, or different parts are arranged.
It should be noted that for terminal embodiment, owing to it essentially corresponds to embodiment of the method, so being correlated with it
Place sees the part of embodiment of the method and illustrates.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can be passed through
The hardware that programmed instruction is relevant completes, and aforesaid program can be stored in a computer read/write memory medium, this program
Upon execution, perform to include the step of said method embodiment;And aforesaid storage medium includes: ROM, RAM, magnetic disc or light
The various medium that can store program code such as dish.
Last it is noted that various embodiments above is only in order to illustrate technical scheme, it is not intended to limit;To the greatest extent
The present invention has been described in detail by pipe with reference to foregoing embodiments, it will be understood by those within the art that: it depends on
So the technical scheme described in foregoing embodiments can be modified, or the most some or all of technical characteristic is entered
Row equivalent;And these amendments or replacement, do not make the essence of appropriate technical solution depart from various embodiments of the present invention technology
The scope of scheme.
Claims (10)
1. the Media Survey method of a terminal unit, it is characterised in that including:
When carrying out Media Survey, obtain the utilization rate of the central processor CPU of described terminal unit;
If the utilization rate of described CPU is equal to or more than the utilization rate threshold value preset, then suspend Media Survey.
Method the most according to claim 1, it is characterised in that obtain the making of central processor CPU of described terminal unit
After rate, described method also includes:
The record acquisition time;
Utilization rate according to described CPU calculates waiting time;
Accordingly, after suspending Media Survey, described method also includes:
When the interval of current time and described acquisition time exceedes described waiting time, obtain the utilization rate of described CPU;
If the utilization rate of described CPU is less than described default utilization rate threshold value, then restart Media Survey.
Method the most according to claim 1 and 2, it is characterised in that obtain the central processor CPU of described terminal unit
Utilization rate, including:
According to the described CPU busy duration in the first prefixed time interval and free time length, and the second prefixed time interval
Interior busy duration and free time length, obtain the utilization rate of described CPU;
Wherein, described second prefixed time interval is the previous prefixed time interval of described first prefixed time interval;Described
Second prefixed time interval is equal to described first prefixed time interval.
Method the most according to claim 3, it is characterised in that according to numerous in the first prefixed time interval of described CPU
Busy duration in busy length and free time length, and the second prefixed time interval and free time length, obtain the use of described CPU
Rate, specifically includes:
The utilization rate of described CPU is obtained by equation below (1);
Load=(Busy-sBusy)/((Busy+Idle)-(sBusy+sIdle)) × 100 (1);
Wherein, Load represents the utilization rate of described CPU;
Busy represents the busy duration in described first prefixed time interval, in Idle represents described first prefixed time interval
Free time length;
SBusy represents the busy duration in described second prefixed time interval, in sIdle represents described second prefixed time interval
Free time length.
Method the most according to claim 4, it is characterised in that calculate waiting time, bag according to the utilization rate of described CPU
Include:
Described waiting time is calculated by equation below (2);
Delay=100+ (Load/2) × (Load/2) (2);
Wherein, Delay represents described waiting time.
Method the most according to claim 1 and 2, it is characterised in that described method also includes:
Monitor whether user's operation requests;
If the utilization rate of described CPU is less than described default utilization rate threshold value, and has monitored user's operation requests, then suspend matchmaker
Swept-volume.
Method the most according to claim 6, it is characterised in that after having monitored user's operation requests, described method is also
Including:
The record monitoring time;
Accordingly, after suspending Media Survey, described method also includes:
When the interval of current time and described monitoring time exceedes default time interval threshold value, monitor whether user operation
Request;
If monitoring no user operation requests, then restart Media Survey.
8. a terminal unit, it is characterised in that including:
Acquisition module, for when carrying out Media Survey, obtains the utilization rate of the central processor CPU of described terminal unit;
Processing module, if the utilization rate for described CPU equals to or more than the utilization rate threshold value preset, then suspends Media Survey.
Terminal unit the most according to claim 8, it is characterised in that also include:
Logging modle, for recording the acquisition time after getting the utilization rate of central processor CPU of described terminal unit;
Computing module, calculates waiting time for the utilization rate according to described CPU;
Accordingly, described acquisition module is additionally operable to:
When the interval of current time and described acquisition time exceedes described waiting time, obtain the utilization rate of described CPU;
Described processing module, is additionally operable to:
If the utilization rate of described CPU is less than described default utilization rate threshold value, then restart Media Survey.
Terminal unit the most according to claim 8 or claim 9, it is characterised in that described acquisition module specifically for:
According to the described CPU busy duration in the first prefixed time interval and free time length, and the second prefixed time interval
Interior busy duration and free time length, obtain the utilization rate of described CPU;
Wherein, described second prefixed time interval is the previous prefixed time interval of described first prefixed time interval;Described
Second prefixed time interval is equal to described first prefixed time interval.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610431515.6A CN106126335A (en) | 2016-06-15 | 2016-06-15 | The Media Survey method of terminal unit and terminal unit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610431515.6A CN106126335A (en) | 2016-06-15 | 2016-06-15 | The Media Survey method of terminal unit and terminal unit |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106126335A true CN106126335A (en) | 2016-11-16 |
Family
ID=57469948
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610431515.6A Pending CN106126335A (en) | 2016-06-15 | 2016-06-15 | The Media Survey method of terminal unit and terminal unit |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106126335A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106534950A (en) * | 2016-11-22 | 2017-03-22 | 深圳Tcl数字技术有限公司 | Controlling method and device for media scanning and playing |
CN108388797A (en) * | 2018-01-23 | 2018-08-10 | 北京奇艺世纪科技有限公司 | A kind of intrusion detection method, device and electronic equipment |
CN109062711A (en) * | 2018-07-20 | 2018-12-21 | 北斗星通(重庆)汽车电子有限公司 | Based on the quick scanning system of Android multimedia |
CN112346933A (en) * | 2020-11-09 | 2021-02-09 | 深信服科技股份有限公司 | Malicious file scanning method, device, equipment and medium |
WO2021232978A1 (en) * | 2020-05-18 | 2021-11-25 | Oppo广东移动通信有限公司 | Video processing method and apparatus, electronic device and computer readable medium |
CN115599554A (en) * | 2022-11-16 | 2023-01-13 | 浪潮电子信息产业股份有限公司(Cn) | GPGPU resource allocation method, device, equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101710293A (en) * | 2009-12-10 | 2010-05-19 | 青岛海信宽带多媒体技术有限公司 | Method and device for traversing files in USB storage device |
CN102654841A (en) * | 2011-03-02 | 2012-09-05 | 中国电信股份有限公司 | Method and device for allocating computing resource of virtual machine based on fine granularity |
CN104298711A (en) * | 2014-09-12 | 2015-01-21 | 百度在线网络技术(北京)有限公司 | Method and device for scanning information to be scanned and computer equipment |
CN105045661A (en) * | 2015-08-05 | 2015-11-11 | 北京瑞星信息技术有限公司 | Scan task scheduling method and system |
-
2016
- 2016-06-15 CN CN201610431515.6A patent/CN106126335A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101710293A (en) * | 2009-12-10 | 2010-05-19 | 青岛海信宽带多媒体技术有限公司 | Method and device for traversing files in USB storage device |
CN102654841A (en) * | 2011-03-02 | 2012-09-05 | 中国电信股份有限公司 | Method and device for allocating computing resource of virtual machine based on fine granularity |
CN104298711A (en) * | 2014-09-12 | 2015-01-21 | 百度在线网络技术(北京)有限公司 | Method and device for scanning information to be scanned and computer equipment |
CN105045661A (en) * | 2015-08-05 | 2015-11-11 | 北京瑞星信息技术有限公司 | Scan task scheduling method and system |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106534950A (en) * | 2016-11-22 | 2017-03-22 | 深圳Tcl数字技术有限公司 | Controlling method and device for media scanning and playing |
CN108388797A (en) * | 2018-01-23 | 2018-08-10 | 北京奇艺世纪科技有限公司 | A kind of intrusion detection method, device and electronic equipment |
CN109062711A (en) * | 2018-07-20 | 2018-12-21 | 北斗星通(重庆)汽车电子有限公司 | Based on the quick scanning system of Android multimedia |
WO2021232978A1 (en) * | 2020-05-18 | 2021-11-25 | Oppo广东移动通信有限公司 | Video processing method and apparatus, electronic device and computer readable medium |
CN112346933A (en) * | 2020-11-09 | 2021-02-09 | 深信服科技股份有限公司 | Malicious file scanning method, device, equipment and medium |
CN112346933B (en) * | 2020-11-09 | 2023-03-17 | 深信服科技股份有限公司 | Malicious file scanning method, device, equipment and medium |
CN115599554A (en) * | 2022-11-16 | 2023-01-13 | 浪潮电子信息产业股份有限公司(Cn) | GPGPU resource allocation method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106126335A (en) | The Media Survey method of terminal unit and terminal unit | |
RU2586869C2 (en) | Application notifications | |
US7690003B2 (en) | System and method for increasing data throughput using thread scheduling | |
KR100690804B1 (en) | Method for executing garbage collection of mobile terminal | |
CN104506950A (en) | Multithread download method and download device in network streaming media play, and download equipment | |
CN106899649B (en) | Task request processing method and device and user equipment | |
CN107491346B (en) | Application task processing method, device and system | |
CN104572294A (en) | Predictive auto scaling engine | |
WO2014173194A1 (en) | Method and apparatus for optimizing running of browser | |
CN105354042B (en) | Using the processing method and processing device of installation | |
CN112565774B (en) | Video transcoding resource scheduling method and device | |
US8082307B2 (en) | Redistributing messages in a clustered messaging environment | |
CN107818012B (en) | Data processing method and device and electronic equipment | |
CN112333476B (en) | Video loading method and device | |
CN108173840B (en) | Intelligent logistics terminal integration system based on cloud platform | |
CN110618869B (en) | Resource management method, device and equipment | |
CN105577772A (en) | Material receiving method, material uploading method and device | |
CN108762665B (en) | Method and device for controlling reading and writing of storage device | |
CN109343862B (en) | Scheduling method and device of resource data of application | |
WO2016019800A1 (en) | Television switching method and device | |
CN102708006A (en) | Processing optimization load adjustment | |
CN105786539A (en) | File downloading method and device | |
CN104199729A (en) | Resource management method and system | |
CN107329832B (en) | Data receiving method and device | |
CN115981871B (en) | GPU resource scheduling method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20161116 |
|
RJ01 | Rejection of invention patent application after publication |