The content of the invention
It is a primary object of the present invention to propose detection method and mobile terminal, the storage of a kind of application resource leakage
Medium, it is intended to solve in the prior art can not track and localization exist resource leakage application program technical problem.
To achieve the above object, the present invention provides a kind of detection method of application resource leakage, the application program
The detection method of resource leakage includes:
Obtain the figure layer for being waited in mobile terminal buffering queue and being handed over to specified interface;
Back ground Information corresponding to the figure layer is counted, the Back ground Information includes the figure layer corresponding A PP
The title and/or type of (Application, application program);
According to Back ground Information corresponding to the figure layer, the figure layer is classified;
According to the type of the figure layer, the resource size of each APP occupancy, takes as any APP in output buffer queue
When resource size is more than default threshold value, it is determined that any APP has resource leakage.
Optionally, the step of being handed over to the figure layer of specified interface is waited to include in the acquisition mobile terminal buffering queue:
The figure layer synthesized in detection buffering queue, and whether the figure layer synthesized described in judgement waits and is handed over to the finger
Stationary interface;
Obtain the figure layer for waiting and being handed over to the specified interface.
Optionally, also wrapped according to the type of the figure layer, the step of the resource size that each APP takes in output buffer queue
Include:
It is big every the resource that each APP takes in the time interval output buffer queue of setting according to the type of the figure layer
It is small.
Optionally, it is determined that any APP resource leakage be present after also include:
The resource size taken according to any APP, determine the resource leakage grade of any APP.
Optionally, it is determined that any APP resource leakage be present after also include:
By title and/or type corresponding to any APP, and the resource sizes that currently take of any APP with
The form of daily record is preserved, and the daily record is fed back into after-sale service system corresponding to the mobile terminal.
In addition, to achieve the above object, the present invention also provides a kind of mobile terminal, and the mobile terminal includes:Memory,
Processor and the detection program for being stored in the application resource leakage that can be run on the memory and on the processor,
Following steps are realized when the detection program of the application resource leakage is by the computing device:
Obtain the figure layer for being waited in mobile terminal buffering queue and being handed over to specified interface;
Count Back ground Information corresponding to the figure layer, the Back ground Information include the figure layer corresponding A PP title and/or
Type;
According to Back ground Information corresponding to the figure layer, the figure layer is classified;
According to the type of the figure layer, the resource size of each APP occupancy, takes as any APP in output buffer queue
When resource size is more than default threshold value, it is determined that any APP has resource leakage.
Optionally, the step of being handed over to the figure layer of specified interface is waited to include in the acquisition mobile terminal buffering queue:
The figure layer synthesized in detection buffering queue, and whether the figure layer synthesized described in judgement waits and is handed over to the finger
Stationary interface;
Obtain the figure layer for waiting and being handed over to the specified interface;
According to the type of the figure layer, also include the step of the resource size of each APP occupancy in output buffer queue:
It is big every the resource that each APP takes in the time interval output buffer queue of setting according to the type of the figure layer
It is small.
Optionally, after it is determined that any APP has resource leakage, the detection journey of the application resource leakage
When sequence is by the computing device, following steps can also be realized:
The resource size taken according to any APP, determine the resource leakage grade of any APP.
Optionally, after it is determined that any APP has resource leakage, the detection journey of the application resource leakage
When sequence is by the computing device, following steps can also be realized:
By title and/or type corresponding to any APP, and the resource sizes that currently take of any APP with
The form of daily record is preserved, and the daily record is fed back into after-sale service system corresponding to the mobile terminal.
In addition, to achieve the above object, the present invention also provides a kind of storage medium, and application is stored with the storage medium
The detection program of program resource leakage, the detection program of the application resource leakage realize following step when being executed by processor
Suddenly:
Obtain the figure layer for being waited in mobile terminal buffering queue and being handed over to specified interface;
Count Back ground Information corresponding to the figure layer, the Back ground Information include the figure layer corresponding A PP title and/or
Type;
According to Back ground Information corresponding to the figure layer, the figure layer is classified;
According to the type of the figure layer, the resource size of each APP occupancy, takes as any APP in output buffer queue
When resource size is more than default threshold value, it is determined that any APP has resource leakage.
Optionally, the step of being handed over to the figure layer of specified interface is waited to include in the acquisition mobile terminal buffering queue:
The figure layer synthesized in detection buffering queue, and whether the figure layer synthesized described in judgement waits and is handed over to the finger
Stationary interface;
Obtain the figure layer for waiting and being handed over to the specified interface;
According to the type of the figure layer, also include the step of the resource size of each APP occupancy in output buffer queue:
It is big every the resource that each APP takes in the time interval output buffer queue of setting according to the type of the figure layer
It is small.
Optionally, after it is determined that any APP has resource leakage, the detection journey of the application resource leakage
When sequence is by the computing device, following steps can also be realized:
The resource size taken according to any APP, determine the resource leakage grade of any APP.
Optionally, after it is determined that any APP has resource leakage, the detection journey of the application resource leakage
When sequence is by the computing device, following steps can also be realized:
By title and/or type corresponding to any APP, and the resource sizes that currently take of any APP with
The form of daily record is preserved, and the daily record is fed back into after-sale service system corresponding to the mobile terminal.
The detection method and mobile terminal, storage medium of application resource leakage provided by the present invention, can be achieved:Obtain
The figure layer for being waited in mobile terminal buffering queue and being handed over to specified interface is taken, then counts Back ground Information corresponding to each figure layer,
According to the type of each figure layer, the resource size of each APP occupancy in output buffer queue, when the resource size that any APP takes
It during more than default threshold value, then can determine that the APP has resource leakage, thus just effectively track and localization can be provided to presence
The leak point of source leakage, technical staff targetedly can then be carried out after track and localization to the leakage point to leakage point
Software upgrading or reparation, so as to solve the problems, such as mobile terminal abnormal restarting in the aspect of processing system.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In follow-up description, the suffix using such as " module ", " part " or " unit " for representing element is only
Be advantageous to the explanation of the present invention, itself there is no a specific meaning.Therefore, " module ", " part " or " unit " can mix
Ground uses.
Terminal can be implemented in a variety of manners.For example, the terminal described in the present invention can include such as mobile phone, flat board
Computer, notebook computer, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable
Media player (Portable Media Player, PMP), guider, wearable device, Intelligent bracelet, pedometer etc. move
Dynamic terminal, and the fixed terminal such as digital TV, desktop computer.
It will be illustrated in subsequent descriptions by taking mobile terminal as an example, it will be appreciated by those skilled in the art that except special
Outside element for moving purpose, construction according to the embodiment of the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, its hardware architecture diagram for a kind of mobile terminal of each embodiment of the realization present invention, the shifting
Dynamic terminal 100 can include:RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, A/V (audio/video)
Input block 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processing
The part such as device 110 and power supply 111.It will be understood by those skilled in the art that the mobile terminal structure shown in Fig. 1 not structure
The restriction of paired mobile terminal, mobile terminal can include parts more more or less than diagram, or some parts of combination, or
The different part arrangement of person.
The all parts of mobile terminal are specifically introduced with reference to Fig. 1:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, the reception and transmission of signal, specifically, by base station
Downlink information receive after, handled to processor 110;In addition, up data are sent to base station.Generally, radio frequency unit 101
Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrate
Frequency unit 101 can also be communicated by radio communication with network and other equipment.Above-mentioned radio communication can use any communication
Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications
System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (Code
Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division
Multiple Access, WCDMA), TD-SCDMA (Time Division-Synchronous Code
Division Multiple Access, TD SDMA), FDD-LTE (Frequency Division
Duplexing-Long Term Evolution, FDD Long Term Evolution) and TDD-LTE (Time Division
Duplexing-Long Term Evolution, time division duplex Long Term Evolution) etc..
Wi-Fi belongs to short range wireless transmission technology, and mobile terminal can help user to receive and dispatch by Wi-Fi module 102
Email, browse webpage and access streaming video etc., it has provided the user wireless broadband internet and accessed.Although Fig. 1
Wi-Fi module 102 is shown, but it is understood that, it is simultaneously not belonging to must be configured into for mobile terminal, completely can basis
Need to omit in the essential scope for do not change invention.
A/V input blocks 104 are used to receive audio or video signal.A/V input blocks 104 can include graphics processor
(Graphics Processing Unit, GPU) 1041, graphics processor 1041 is in video acquisition mode or image capture mould
The static images or the view data of video obtained in formula by image capture apparatus (such as camera) are handled.Figure after processing
As frame may be displayed on display unit 106.Picture frame after the processing of graphics processor 1041 can be stored in memory 109
It is transmitted in (or other storage mediums) or via radio frequency unit 101 or Wi-Fi module 102.
Mobile terminal 100 also includes at least one sensor 105, such as optical sensor, motion sensor and other biographies
Sensor.Specifically, optical sensor includes ambient light sensor and proximity transducer, wherein, ambient light sensor can be according to environment
The light and shade of light adjusts the brightness of display panel 1061, and proximity transducer can close when mobile terminal 100 is moved in one's ear
Display panel 1061 and/or backlight.As one kind of motion sensor, accelerometer sensor can detect in all directions (general
For three axles) size of acceleration, size and the direction of gravity are can detect that when static, the application available for identification mobile phone posture
(such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.;
The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer,
The other sensors such as hygrometer, thermometer, infrared ray sensor, will not be repeated here.
Display unit 106 is used for the information for showing the information inputted by user or being supplied to user.Display unit 106 can wrap
Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used
Forms such as (Organic Light-Emitting Diode, OLED) configures display panel 1061.
User input unit 107 can be used for the numeral or character information for receiving input, and produce the use with mobile terminal
The key signals input that family is set and function control is relevant.Specifically, user input unit 107 may include contact panel 1071 with
And other input equipments 1072.Contact panel 1071, also referred to as touch-screen, collect touch operation of the user on or near it
(for example user uses any suitable objects or annex such as finger, stylus on contact panel 1071 or in contact panel 1071
Neighbouring operation), and corresponding attachment means are driven according to formula set in advance.Contact panel 1071 may include touch detection
Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band
The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it
Contact coordinate is converted into, then gives processor 110, and the order sent of reception processing device 110 and can be performed.In addition, can
To realize contact panel 1071 using polytypes such as resistance-type, condenser type, infrared ray and surface acoustic waves.Except contact panel
1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap
Include but be not limited to physical keyboard, in function key (such as volume control button, switch key etc.), trace ball, mouse, action bars etc.
One or more, do not limit herein specifically.
Further, contact panel 1071 can cover display panel 1061, detect thereon when contact panel 1071 or
After neighbouring touch operation, processor 110 is sent to determine the type of touch event, is followed by subsequent processing device 110 according to touch thing
The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, contact panel 1071 and display panel
1061 be the part independent as two to realize the input of mobile terminal and output function, but in certain embodiments, can
Input and the output function of mobile terminal are realized so that contact panel 1071 and display panel 1061 is integrated, is not done herein specifically
Limit.
Interface unit 108 is connected the interface that can pass through as at least one external device (ED) with mobile terminal 100.For example,
External device (ED) can include wired or wireless head-band earphone port, external power source (or battery charger) port, wired or nothing
Line FPDP, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end
Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number
It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 100 or can be with
For transmitting data between mobile terminal 100 and external device (ED).
Memory 109 can be used for storage software program and various data.Memory 109 can mainly include storing program area
And storage data field, wherein, storing program area can storage program area, application program (such as the sound needed at least one function
Sound playing function, image player function etc.) etc.;Storage data field can store according to mobile phone use created data (such as
Voice data, phone directory etc.) etc..In addition, memory 109 can include high-speed random access memory, can also include non-easy
The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the whole mobile terminal of connection
Individual part, by running or performing the software program and/or module that are stored in memory 109, and call and be stored in storage
Data in device 109, the various functions and processing data of mobile terminal are performed, so as to carry out integral monitoring to mobile terminal.Place
Reason device 110 may include one or more processing units;Preferably, processor 110 can integrate application processor and modulatedemodulate is mediated
Device is managed, wherein, application processor mainly handles operating system, user interface and application program etc., and modem processor is main
Handle radio communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 100 can also include the power supply 111 (such as battery) to all parts power supply, it is preferred that power supply 111
Can be logically contiguous by power-supply management system and processor 110, so as to realize management charging by power-supply management system, put
The function such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 100 can also will not be repeated here including bluetooth module etc..
For the ease of understanding the embodiment of the present invention, the communications network system being based on below to the mobile terminal of the present invention enters
Row description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system Organization Chart provided in an embodiment of the present invention, the communication network system
Unite as the LTE system of universal mobile communications technology, the UE that the LTE system includes communicating connection successively (User Equipment, is used
Family equipment) 201, E-UTRAN (Evolved UMTS Terrestrial Radio Access Network, evolved UMTS lands
Ground wireless access network) 202, EPC (Evolved Packet Core, evolved packet-based core networks) 203 and operator IP operation
204。
Specifically, UE201 can be above-mentioned terminal 100, and here is omitted.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returning
Journey (backhaul) (such as X2 interface) is connected with other eNodeB2022, and eNodeB2021 is connected to EPC203,
ENodeB2021 can provide UE201 to EPC203 access.
EPC203 can include MME (Mobility Management Entity, mobility management entity) 2031, HSS
(Home Subscriber Server, home subscriber server) 2032, other MME2033, SGW (Serving Gate Way,
Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and PCRF (Policy and
Charging Rules Function, policy and rate functional entity) 2036 etc..Wherein, MME2031 be processing UE201 and
The control node of signaling between EPC203, there is provided carrying and connection management.HSS2032 is all to manage for providing some registers
Such as the function of attaching position register (not shown) etc, and preserve some and used about service features, data rate etc.
The special information in family.All customer data can be transmitted by SGW2034, and PGW2035 can provide UE 201 IP
Address is distributed and other functions, and PCRF2036 is strategy and the charging control strategic decision-making of business data flow and IP bearing resources
Point, it selects and provided available strategy and charging control decision-making with charge execution function unit (not shown) for strategy.
IP operation 204 can include internet, Intranet, IMS (IP Multimedia Subsystem, IP multimedia
System) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art it is to be understood that the present invention not only
Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with
And following new network system etc., do not limit herein.
Based on above-mentioned mobile terminal hardware configuration and communications network system, each embodiment of the inventive method is proposed.
Following examples of the present invention provide a kind of detection method of application resource leakage, and this method passes through tracking and monitoring
Before each APP in mobile terminal is shown to specified interface transmission figure layer, the resource size shared by each APP, to sentence
Each APP that breaks whether there is the phenomenon of resource leakage, thus come the leak point that track and localization has resource leakage, so as to help skill
Art personnel solve the problems, such as mobile terminal processing system abnormal restarting from processing system aspect.
Reference picture 3, Fig. 3 are the schematic flow sheet of the detection method first embodiment of application resource of the present invention leakage,
In the present embodiment, the detection method of above-mentioned application resource leakage includes:
Step S10, obtain the figure layer for being waited in mobile terminal buffering queue and being handed over to specified interface.
Wherein, graphics system includes WindowManager, SurfaceFlinger, Open GL in android system
(Open Graphics Library, open graphic library), GPU (Graphics Processing Unit, graphics processor) etc.
Module.Cores of the wherein SurfaceFlinger as responsible drafting application program UI (User Interface, user interface),
Its function is to complete all Surface synthetic works.Regardless of whether render API (Application using using what mode
Programming Interface, application programming interface), all it is finally to be rendered into " Surface ".Android platform institute
The Window of establishment is supported that all visible Surface are rendered into display device and passed through by Surface
SurfaceFlinger is completed.
Wherein, whenever application program refresh UI when, can intermediary BufferQueue apply a buffer, then
UI information is inserted, and is lost to SurfaceFlinger, SurfaceFlinger by more re-computations synthesize visibleRegion it
Afterwards, lose and give the processing of open GL layers, be sent on display display and show after processing.
Specifically, SurfaceFlinger plays the manager at all UI interfaces in mobile terminal processing system, i.e., it is negative
Then final " mapping result " progress " mixing " of all application programs in mobile terminal processing system is uniformly shown to thing by duty
Manage on screen, and the painting process of other such as each programs of aspect, then served as by its BufferQueue, BufferQueue
Instruct a series of details such as " drawing board application ", " flow of drawing a picture " of UI programs.
Wherein, when application program gives SurfaceFlinger the figure layer to be shown (layer), for example application program exists
When playing video, application program gives the layer videos of SurfaceFlinger mono-, one layer of tool bar, and SurfaceFlinger need not be gone
Synthesis, but specified interface directly is given these figure layers, such as hwcomposer interfaces are given, hwcomposer interfaces can
To carry out synthesis in oneself limit of power, then synthetic result is exported to display and shown.
In order to be better understood from the present invention, reference picture 4, Fig. 4 illustrates for graphics architectures corresponding to application program in the present invention
Figure, in Fig. 4:
Image Stream Producers (producer of graphical stream):Expression can produce graphic buffers life
Production person, such as OpenGL ES, Canvas 2D, mediaserver Video Decoder etc..
Image Stream Consumers (consumer of graphical stream):The consumer of the scene is
SurfaceFlinger, it combines one group of surfaces using Open GL and Hardware Composer.
OpenGL ES applications can consume graphical stream, such as camera app consumption camera preview graphical streams;Non- OpenGL
ES applications can also consume, such as ImageReader classes.
Window Manager:For managing window, this is one group of view container, and Window Manager will be moved
The window metadata informations of terminal are sent to SurfaceFlinger, therefore SurfaceFlinger can be come using these information
Surfaces is synthesized, and is output to display device.
Hardware Composer (hardware synthesizer):The hardware abstraction layer of display subsystem, SurfaceFlinger energy
Some synthetic works are entrusted into Hardware Composer, so as to reduce the load from OpenGL and GPU.
Gralloc (graphics memory allocator, image memory distributor):For encapsulating client layer to frame
All operate interfaces of buffer device, and serviced by SurfaceFlinger to application program and display support is provided.
In addition, reference picture 5, Fig. 5 is graphics process schematic flow sheet corresponding to application program in the present invention, in Figure 5, figure
The middle leftmost side refers to renderer, for producing graphics buffers, such as status bar, UI etc..
In the present embodiment, caused figure layer in mobile terminal processing system buffering queue is detected in real time, is obtained to wait and is transferred
To the figure layer of specified interface (such as hwcomposer interfaces).
Step S20, counts Back ground Information corresponding to the figure layer, and the Back ground Information includes the figure layer corresponding A PP's
Title and/or type.
In the present embodiment, after wait is handed over to the figure layer of specified interface in getting mobile terminal buffering queue, receive
Collecting and count Back ground Information corresponding to each figure layer, the Back ground Information includes each figure layer corresponding A PP title and/or type,
At the same time it can also including title etc. corresponding to each figure layer.
Wherein, each figure layer corresponding A PP title can be only included in above-mentioned Back ground Information;Each figure can also only be included
Layer corresponding A PP type;Each figure layer corresponding A PP title and type can also be included simultaneously.
Wherein it is possible to collect and unite using FDS (file description system, file description system) systems
Count Back ground Information corresponding to each figure layer.
Step S30, according to Back ground Information corresponding to the figure layer, the figure layer is classified.
In the present embodiment, according to Back ground Information corresponding to the above-mentioned figure layer of statistics, each figure layer is classified, specifically
, above-mentioned figure layer can be classified according only to each figure layer corresponding A PP title;Can also be according only to each figure layer pair
APP type is answered, above-mentioned figure layer is classified;Also can also be right simultaneously according to each figure layer corresponding A PP title and type
Above-mentioned figure layer is classified.
Step S40, according to the type of the figure layer, the resource size of each APP occupancy in output buffer queue, when any
When the resource size that APP takes is more than default threshold value, it is determined that any APP has resource leakage.
In the present embodiment, after classifying to above-mentioned figure layer, you can according to the classification type of each figure layer, count
The resource size that each APP takes respectively in mobile terminal buffering queue, that is, count each APP in mobile terminal buffering queue
The SurfaceFlinger FD quantity taken respectively, the money for each APP occupancy that statistics is completed then is exported with the Log way of outputs
Source size.
It should be noted that in the present embodiment, each APP takes respectively in mobile terminal buffering queue resource size,
The SurfaceFlinger FD quantity that each APP takes respectively as in mobile terminal buffering queue.
Wherein, when any APP SurfaceFlinger FD quantity taken is more than default threshold value, it is determined that described
There is SurfaceFlinger FD leakages in any APP, that is, resource leakage be present.For example, what a certain APP took
When SurfaceFlinger FD quantity is more than 500, then it is assumed that the APP has resource leakage, otherwise, then it is assumed that the APP is not deposited
Revealed in resource.
Wherein, the SurfaceFlinger FD quantity that each APP takes in mobile terminal buffering queue can be counted simultaneously,
And the SurfaceFlinger FD of all APP occupancy total quantity.
It is understood that above-mentioned, " the SurfaceFlinger FD quantity that any APP " refers both to take is more than threshold value
APP。
The detection method of application resource leakage described in the present embodiment, it is medium by obtaining mobile terminal buffering queue
The figure layer of specified interface to be handed over to, Back ground Information corresponding to each figure layer is then counted, according to the type of each figure layer, output
The resource size that each APP takes in buffering queue, then can be with when the resource size that any APP takes is more than default threshold value
Determine that the APP has resource leakage, thus just can effectively track and localization to exist resource leakage leak point, technical staff
After track and localization to the leakage point, then software upgrading or reparation targetedly can be carried out to leakage point, so as to locate
Solves the problems, such as mobile terminal abnormal restarting in the aspect of reason system.
Further, the detection method first embodiment based on the application resource of the present invention leakage described in above-mentioned Fig. 3,
The detection method second embodiment of application resource leakage of the present invention is proposed, reference picture 6, Fig. 6 is step shown in Fig. 3 of the present invention
S10 refinement step schematic flow sheet, in the present embodiment, the acquisition mobile terminal buffering shown in above-mentioned Fig. 3 described in step S10
The figure layer for being handed over to specified interface is waited to include in queue:
Step S11, the figure layer synthesized in buffering queue is detected, and whether the figure layer synthesized described in judgement waits transfer
To the specified interface;
Step S12, obtain the figure layer for waiting and being handed over to the specified interface.
Wherein, when user is in any APP in operating mobile terminal, will be generated in mobile terminal buffering queue some
Individual figure layer, wherein, for the figure layer to be shown on mobile terminal display screen curtain, then need first to be handed over to what is specified
Hwcomposer interfaces, by hwcomposer interfaces shown again after relevant treatment.And it need not enter for some
The figure layer of row display, then need not be handed over to hwcomposer interfaces.
Specifically, first detect the figure layer that has synthesized in mobile terminal buffering queue, then judge whether is the figure layer that has synthesized
Wait is handed over to hwcomposer interfaces, if it is determined that the figure layer of the synthesis waits and is handed over to hwcomposer interfaces, then obtains
The figure layer;Otherwise, then any processing is not carried out to the figure layer.
The detection method of application resource leakage described in the present embodiment, first detects and has been closed in mobile terminal buffering queue
Into figure layer, and judge whether the figure layer that has synthesized waits the interface for being handed over to and specifying, if so, then obtaining the figure layer;Otherwise, no
Any processing is carried out, which thereby enhances the validity and reliability of detection application resource leakage.
Further, the detection method first embodiment based on the application resource of the present invention leakage described in above-mentioned Fig. 3,
The detection method 3rd embodiment of application resource of the present invention leakage is proposed, in the present embodiment, described in above-mentioned steps S40
According to the type of the figure layer, also include the step of the resource size of each APP occupancy in output buffer queue:
It is big every the resource that each APP takes in the time interval output buffer queue of setting according to the type of the figure layer
It is small.
In the present embodiment, a time interval can be set according to the combination property of mobile terminal, such as set between the time
It is divided into 5 seconds, 10 seconds etc..Wherein it is possible to understand, different mobile terminals, its corresponding combination property also can be different, right
For the preferable mobile terminal of combination property, its memory source will typically be more than combination property general or poor mobile end
End, therefore, its resource size that can allow for APP to take can also be much larger than the general or poor mobile terminal of combination property,
Therefore for the preferable mobile terminal of combination property, above-mentioned time interval is settable longer, general or poor for combination property
Mobile terminal, above-mentioned time interval are settable more shorter.
Wherein, after setting interval, then according to the type of above-mentioned figure layer, moved every a time interval output
The resource size that each APP takes in dynamic terminal suspending queue, then judges in the time interval, the resource size that each APP takes
Whether default threshold value is more than, if the resource size that any APP takes is more than above-mentioned threshold value, it is determined that in above-mentioned time interval
Interior, there is resource leakage in the APP.
For example, it is 5 seconds to set the time interval, then it is once mobile whole every output in 5 seconds according to the type of above-mentioned figure layer
The resource size that each APP takes in buffering queue is held, is then judged in this 5 seconds, whether the resource size that each APP takes is more than
Default threshold value, if the resource size that any APP takes is more than above-mentioned threshold value, it is determined that in above-mentioned 5 seconds, the APP has money
Reveal in source.
The detection method of application resource leakage described in the present embodiment, sets previously according to the combination property of mobile terminal
A time interval is put, then according to the type of above-mentioned figure layer, every in the time interval output mobile terminal suspending queue
The resource size that each APP takes, then judges in the time interval, and whether the resource size that each APP takes is more than default threshold
Value, if the resource size that any APP takes is more than above-mentioned threshold value, it is determined that in above-mentioned time interval, the APP has resource and let out
Dew, the i.e. present invention can be applied to the mobile terminal that various performances differ, application by setting the size of above-mentioned time interval
Scope is wider.
Further, the detection method first, second, third based on the leakage of the invention described above application resource is implemented
Example, proposes the detection method fourth embodiment of application resource of the present invention leakage, in the present embodiment, it is determined that described any
APP also includes after resource leakage being present:
The resource size taken according to any APP, determine the resource leakage grade of any APP.
Wherein it is possible to a unified threshold value is set with regard to APP all in mobile terminal, when the resource that any APP takes
When size is more than the threshold value, it is determined that the APP has resource leakage.
Alternatively, it is also possible to set multiple threshold values with regard to APP all in mobile terminal, for example, setting the threshold value to include presenting
The first threshold of increasing trend, Second Threshold, the 3rd threshold value, the 4th threshold value etc.;Then according to the size of each threshold value, above-mentioned the is set
Grade is revealed corresponding to one threshold value to the 4th threshold value, that is, sets resource corresponding to each APP to reveal grade, resource leakage grade can
Including " slight leakage ", " common leakage ", " abnormal leakage ", " severe leakage ".
For example, when any APP resource sizes taken are more than above-mentioned first threshold, during less than Second Threshold, it is determined that this
APP is present " slight leakage ";When the resource size that any APP takes is more than or equal to above-mentioned Second Threshold, and it is less than the 3rd threshold
During value, it is determined that the APP is present " common leakage ";When any APP take resource size be more than or equal to above-mentioned 3rd threshold value,
And when being less than four threshold values, it is determined that the APP is present " abnormal leakage ";When the resource size that any APP takes is more than or equal to
During above-mentioned four threshold value, it is determined that the APP has " severe leakage ".
In addition, in the present embodiment, the size of above-mentioned threshold value according to the combination property of mobile terminal, can be set, wherein, can
With understanding, different mobile terminals, its corresponding combination property also can be different, for the preferable mobile terminal of combination property
For, its memory source will typically be more than the general or poor mobile terminal of combination property, and therefore, it can allow for APP
The resource size of occupancy can also be much larger than the general or poor mobile terminal of combination property, therefore for the preferable movement of combination property
Terminal, above-mentioned threshold value can be set larger, and for the general or poor mobile terminal of combination property, above-mentioned threshold value is settable smaller by one
A bit.
The detection method of application resource leakage described in the present embodiment, sets threshold value corresponding to each APP, wherein, when
The threshold value for it is multiple when, then according to the size of the threshold value, set resource corresponding to each APP to reveal grade, thus can be with
Directly export resource corresponding to each APP and reveal grade, facilitate technical staff intuitively to understand resource leak degree corresponding to each APP.
Further, the detection method first, second, third, fourth based on the leakage of the invention described above application resource
Embodiment, proposes the embodiment of detection method the 5th of application resource of the present invention leakage, in the present embodiment, shown in above-mentioned Fig. 3
Described in step S40 it is determined that any APP resource leakage be present after also include:
By title and/or type corresponding to any APP, and the resource sizes that currently take of any APP with
The form of daily record is preserved, and the daily record is fed back into after-sale service system corresponding to the mobile terminal.
Wherein, after it is determined that any APP has resource leakage, then by title and/or type corresponding to the APP, and
The resource size that the APP currently takes is preserved in the form of daily record.Wherein, in android system, there is provided simple,
Convenient Log memory mechanisms, developer can easily use Log memory mechanisms, and each APP pairs is preserved in the form of daily record
The title and/or type answered, and the resource size that each APP currently takes.Wherein, in program development process, Log storage machines
System is widely used for the process of logging program execution, and it both can be used for program debugging, can be used for the event in product operation
Record.
Wherein, can be by multiple data according to different rows is recorded in, if APP is corresponding using Log memory mechanisms
Title and/or type, and the resource size that APP currently takes recorded according to different rows.
Further, by title and/or type corresponding to any APP, and the resource sizes that currently take of the APP with
After the form of daily record is preserved, the daily record is fed back into after-sale service system corresponding to the mobile terminal.Wherein, technology
Personnel can the daily record that receives of the after-sale service system according to corresponding to above-mentioned mobile terminal, to analyze the mobile terminal processing system
The defects of existing or leak;Either upgrade or repair the APP for often producing resource leakage in time.
Wherein it is possible to understand, it is essentially identical the defects of present in its system for the mobile terminal of same model,
Therefore, the mobile terminal of same model can be made to correspond to identical after-sale service system, the after-sale service system is receiving largely
After daily record on the mobile terminal of the model, technical staff can be accurately judged to mobile terminal according to substantial amounts of daily record
Either leak or accurate find out often produce the APP that resource is revealed to the defects of processing system is present.
It is wherein, above-mentioned that " resource size that any APP " refers both to take is more than the APP of above-mentioned given threshold.
The detection method of application resource leakage described in the present embodiment, it is determined that any APP, which has resource, reveals it
Afterwards, title and/or type corresponding to the APP, and the resource size that the APP currently takes are protected in the form of daily record
Deposit, and the daily record is fed back into after-sale service system corresponding to the mobile terminal so that technical staff can be according to the daily record
To be accurately judged to the defects of mobile terminal processing system is present, either leak or accurate find out often produce resource leakage
APP。
Further, the present invention also provides a kind of mobile terminal, and the mobile terminal includes:Memory, processor and storage
On the memory and can run on the processor application resource leakage detection program, the application program
Following steps are realized when the detection program of resource leakage is by the computing device:
Obtain the figure layer for being waited in mobile terminal buffering queue and being handed over to specified interface;
Count Back ground Information corresponding to the figure layer, the Back ground Information include the figure layer corresponding A PP title and/or
Type;
According to Back ground Information corresponding to the figure layer, the figure layer is classified;
According to the type of the figure layer, the resource size of each APP occupancy, takes as any APP in output buffer queue
When resource size is more than default threshold value, it is determined that any APP has resource leakage.
Further, the step of being handed over to the figure layer of specified interface is waited to wrap in above-mentioned acquisition mobile terminal buffering queue
Include:
The figure layer synthesized in detection buffering queue, and whether the figure layer synthesized described in judgement waits and is handed over to the finger
Stationary interface;
Obtain the figure layer for waiting and being handed over to the specified interface;
According to the type of the figure layer, also include the step of the resource size of each APP occupancy in output buffer queue:
It is big every the resource that each APP takes in the time interval output buffer queue of setting according to the type of the figure layer
It is small.
Further, after it is determined that any APP has resource leakage, the detection of the application resource leakage
When program is by the computing device, following steps can also be realized:
The resource size taken according to any APP, determine the resource leakage grade of any APP.
Further, after it is determined that any APP has resource leakage, the detection of the application resource leakage
When program is by the computing device, following steps can also be realized:
By title and/or type corresponding to any APP, and the resource sizes that currently take of any APP with
The form of daily record is preserved, and the daily record is fed back into after-sale service system corresponding to the mobile terminal.
In order to be better understood from the present invention, reference picture 7, Fig. 7 is the software runtime environment that mobile terminal of the present invention is related to
Structural representation, in the present embodiment, above-mentioned mobile terminal may include:Processor 110, such as CPU, network interface 1004, user
Interface 1003, memory 109, communication bus 1002.Wherein, communication bus 1002 is used to realize that the connection between these components is led to
Letter;User interface 1003 can include the interface unit 108 and display unit 106 shown in above-mentioned Fig. 1;Network interface 1004 is optional
Wireline interface, the wave point (such as WI-FI interfaces) that can include standard;Memory 109 can be high-speed RAM memory,
Can also be stable memory (non-volatile memory), such as magnetic disk storage;Memory 109 optionally may be used also
To be independently of the storage device of aforementioned processor 110.
It will be understood by those skilled in the art that the structure shown in Fig. 7 does not form the restriction to above-mentioned mobile terminal, can
With including than illustrating more or less parts, either combining some parts or different parts arrangement.
As shown in fig. 7, as in a kind of memory 109 of storage medium, operating system, network service mould can be included
The detection program of block, Subscriber Interface Module SIM and application resource leakage.
As shown in fig. 7, network interface 1004 is mainly used in connecting background server, carrying out data with background server leads to
Letter;User interface 1003 is mainly used in connecting client (user terminal), enters row data communication with client;And processor 110 can
For calling the detection program of the application resource stored in memory 109 leakage, and perform corresponding operation.
Wherein, embodiment corresponding to the mobile terminal is corresponding with the detection method that aforementioned applications program resource is revealed each
Embodiment is essentially identical, therefore will not be repeated here.
Further, the present invention also provides a kind of storage medium, and application resource leakage is stored with the storage medium
Detection program, the detection program of application resource leakage realizes following steps when being executed by processor:
Obtain the figure layer for being waited in mobile terminal buffering queue and being handed over to specified interface;
Count Back ground Information corresponding to the figure layer, the Back ground Information include the figure layer corresponding A PP title and/or
Type;
According to Back ground Information corresponding to the figure layer, the figure layer is classified;
According to the type of the figure layer, the resource size of each APP occupancy, takes as any APP in output buffer queue
When resource size is more than default threshold value, it is determined that any APP has resource leakage.
Further, the step of being handed over to the figure layer of specified interface is waited to wrap in above-mentioned acquisition mobile terminal buffering queue
Include:
The figure layer synthesized in detection buffering queue, and whether the figure layer synthesized described in judgement waits and is handed over to the finger
Stationary interface;
Obtain the figure layer for waiting and being handed over to the specified interface;
According to the type of the figure layer, also include the step of the resource size of each APP occupancy in output buffer queue:
It is big every the resource that each APP takes in the time interval output buffer queue of setting according to the type of the figure layer
It is small.
Further, after it is determined that any APP has resource leakage, the detection of the application resource leakage
When program is by the computing device, following steps can also be realized:
The resource size taken according to any APP, determine the resource leakage grade of any APP.
Further, after it is determined that any APP has resource leakage, the detection of the application resource leakage
When program is by the computing device, following steps can also be realized:
By title and/or type corresponding to any APP, and the resource sizes that currently take of any APP with
The form of daily record is preserved, and the daily record is fed back into after-sale service system corresponding to the mobile terminal.
Specifically, embodiment corresponding to the storage medium is corresponding with the detection method that aforementioned applications program resource is revealed each
Individual embodiment is essentially identical, therefore will not be repeated here.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row
His property includes, so that process, method, article or system including a series of elements not only include those key elements, and
And also include the other element being not expressly set out, or also include for this process, method, article or system institute inherently
Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this
Other identical element also be present in the process of key element, method, article or system.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on such understanding, technical scheme is substantially done to prior art in other words
Going out the part of contribution can be embodied in the form of software product, and the computer software product is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disc, CD), including some instructions to cause a station terminal equipment (can be mobile phone,
Computer, server, or network equipment etc.) perform method described in each embodiment of the present invention.
The preferred embodiments of the present invention are these are only, are not intended to limit the scope of the invention, it is every to utilize this hair
The equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills
Art field, is included within the scope of the present invention.