[go: up one dir, main page]

CN110489318A - Grasping means, device, storage medium and the terminal of systrace information - Google Patents

Grasping means, device, storage medium and the terminal of systrace information Download PDF

Info

Publication number
CN110489318A
CN110489318A CN201910769047.7A CN201910769047A CN110489318A CN 110489318 A CN110489318 A CN 110489318A CN 201910769047 A CN201910769047 A CN 201910769047A CN 110489318 A CN110489318 A CN 110489318A
Authority
CN
China
Prior art keywords
processed
systrace
message
information
threshold value
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.)
Granted
Application number
CN201910769047.7A
Other languages
Chinese (zh)
Other versions
CN110489318B (en
Inventor
李军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN201910769047.7A priority Critical patent/CN110489318B/en
Publication of CN110489318A publication Critical patent/CN110489318A/en
Application granted granted Critical
Publication of CN110489318B publication Critical patent/CN110489318B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the present application discloses grasping means, device, storage medium and the terminal of a kind of systrace information, belongs to field of computer technology.Method includes: detection message to be processed;When the not processed duration of message to be processed is more than the first duration threshold value, start to grab Android system tracking systrace information at the first moment;When the not processed duration of message to be processed is more than the second duration threshold value, stop crawl systrace information at the second moment;Wherein, the second duration threshold value is that duration of the application without response ANR occurs for message to be processed, and the second duration threshold value is greater than the first duration threshold value;It is stored in the systrace information grabbed during the first moment and the second moment.The embodiment of the present application starts to grab systrace information at the time of ANR may occur, and reduces the data volume of processing expense and systrace information.

Description

Grasping means, device, storage medium and the terminal of systrace information
Technical field
This application involves computer field more particularly to a kind of grasping means of systrace information, device, storage medium And terminal.
Background technique
User increasingly payes attention to handset capability fluency, so that more stringent requirements are proposed to the system performance of mobile phone. Systrace (Android system trace, Android system tracking) is to carry out performance evaluation to the Android operation system of mobile phone Tool.The function of systrace includes the input/output operations (output/input, I/O) of tracking system, Core Operational team Column, central processing unit (central processing uint, CPU) load and the operation of Android operation system subsystems State.Systrace grabs the systrace information of mobile phone, and the system performance of mobile phone is analyzed by analysis systrace information.
In the related art, the method for grabbing systrace information includes: that default script and terminal to be measured establish communication link It connects, and sends acquisition notice to terminal to be measured, grab terminal applies module to be measured by way of default script and be activated the moment Systrace information.
Summary of the invention
Grasping means, device, storage medium and the terminal for the systrace information that the embodiment of the present application provides, can solve Systrace of the overhead caused by systrace information greatly with crawl is certainly grabbed when application module starts in the related technology The big problem of information content.The technical solution is as follows:
In a first aspect, the embodiment of the present application provides a kind of grasping means of systrace information, which comprises
Detect message to be processed;When the not processed duration of message to be processed is more than the first duration threshold value, at first Start at quarter to grab systrace information;When the not processed duration of message to be processed is more than the second duration threshold value, at second It carves and stops crawl systrace information, the second duration threshold value is the duration that ANR occurs for the message to be processed, the second duration threshold value Greater than the first duration threshold value, it is stored in the systrace information grabbed during the first moment and the second time.
Second aspect, the embodiment of the present application provide a kind of grabbing device of systrace information, the grabbing device packet It includes:
Detection unit, for detecting message to be processed;
Start unit, for when the not processed duration of the message to be processed is more than the first duration threshold value, first Moment starts to grab Android system tracking systrace information;
Stop unit, for when the not processed duration of the message to be processed is more than the second duration threshold value, second Moment stops crawl systrace information;Wherein, the second duration threshold value is that the message to be processed occurs using no response The duration of ANR, the second duration threshold value are greater than the first duration threshold value;
Storage unit, the systrace information for being grabbed during being stored in first moment and second moment.
The third aspect, the embodiment of the present application provide a kind of computer storage medium, and the computer storage medium is stored with A plurality of instruction, described instruction are suitable for being loaded by processor and executing above-mentioned method and step.
Fourth aspect, the embodiment of the present application provide a kind of terminal, it may include: processor and memory;Wherein, the storage Device is stored with computer program, and the computer program is suitable for being loaded by the processor and executing above-mentioned method and step.
The technical solution bring beneficial effect that some embodiments of the application provide includes at least:
Detect message to be processed, the given time before ANR occurs for message to be processed starts to grab systrace letter Breath stops crawl systrace information when ANR occurs for message to be processed, then stores the systrace information grabbed, The reason of so that ANR occurs according to systrace information analysis, solves the crawl in application starting in the related technology The problem that processing expense caused by systrace information is big and the data volume of systrace information is big, the embodiment of the present application only need Given time before ANR occurs grabs systrace information, the possibility of given time configuration between at the time of ANR occurs At the time of ANR occurs, reduce the data volume of the systrace information of crawl, avoid the redundancy of systrace information, according to grabbing The reason of ANR, occurs for the systrace information analysis got, and will not influence the accuracy of analysis;In addition reduce systrace's Working time reduces the processing expense of terminal.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is the structural schematic diagram of terminal provided by the embodiments of the present application;
Fig. 2 is the structural schematic diagram of operating system provided by the embodiments of the present application and user's space;
Fig. 3 is the architecture diagram of Android operation system in Fig. 1;
Fig. 4 is the flow diagram of the grasping means of systrace information provided by the embodiments of the present application;
Fig. 5 is another flow diagram of the grasping means of systrace information provided by the embodiments of the present application;
Fig. 6 is the timing diagram of the grasping means of systrace information provided by the embodiments of the present application;
Fig. 7 is a kind of structural schematic diagram of device provided by the present application.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the embodiment of the present application Mode is described in further detail.
Referring to FIG. 1, the structural block diagram of the terminal provided it illustrates one exemplary embodiment of the application.The application In terminal may include one or more such as lower component: processor 110, memory 120, input unit 130, output device 140 and bus 150.Bus 150 can be passed through between processor 110, memory 120, input unit 130 and output device 140 Connection.
Processor 110 may include one or more processing core.Processor 110 utilizes various interfaces and connection Various pieces in entire terminal, by running or executing the instruction being stored in memory 120, program, code set or instruction Collection, and the data being stored in memory 120 are called, execute the various functions and processing data of terminal 100.Optionally, locate Reason device 110 can use Digital Signal Processing (digital signal processing, DSP), field programmable gate array (field-programmable gate array, FPGA), programmable logic array (programmable logicArray, At least one of) PLA example, in hardware is realized.Processor 110 can integrating central processor (central processing Unit, CPU), one of image processor (graphics processing unit, GPU) and modem etc. or several The combination of kind.Wherein, the main processing operation system of CPU, user interface and application program etc.;GPU is for being responsible for display content Rendering and drafting;Modem is for handling wireless communication.It is understood that above-mentioned modem can not also integrate Into processor 110, realized separately through one piece of communication chip.
Memory 120 may include random access memory (randomAccess Memory, RAM), also may include read-only deposit Reservoir (read-onlymemory, ROM).Optionally, which includes non-transient computer-readable medium (non- transitory computer-readable storage medium).Memory 120 can be used for store instruction, program, generation Code, code set or instruction set.Memory 120 may include storing program area and storage data area, wherein storing program area can store Instruction for realizing operating system, the instruction for realizing at least one function (such as touch function, sound-playing function, Image player function etc.), for realizing instruction of following each embodiments of the method etc., which can be Android (Android) system (including the system based on android system deep development), Apple Inc.'s exploitation IOS system (including base In the system of IOS system depth exploitation) or other systems.Storage data area can also store the number that terminal is created in use According to (such as phone directory, audio, video data, chat record data) etc..
Shown in Figure 2, memory 120 can be divided into operating system space and user's space, and operating system runs on behaviour Make system space, primary and third party application runs on user's space.In order to guarantee that different third party applications are equal Preferable operational effect can be reached, operating system distributes corresponding system resource for different third party applications for it. However, there is also differences for demand of the different application scene to system resource in same third party application, for example, in local money Under the loading scenario of source, third party application is more demanding to disk reading speed;Under animation render scenes, third party is answered With program then to the more demanding of GPU performance.And it is mutually indepedent between operating system and third party application, operating system is past Toward the current application scenarios of third party application cannot be perceived in time, cause operating system can not be according to third party application Concrete application scene carry out targetedly system resource be adapted to.
In order to enable operating system to distinguish the concrete application scene of third party application, need to get through third-party application Data communication between program and operating system enables operating system to obtain the current scene of third party application at any time Information, and then targetedly system resource is carried out based on current scene and is adapted to.
By taking operating system is android system as an example, the program and data stored in memory 120 is as shown in figure 3, storage Linux inner core 320, system run-time library layer 340, application framework layer 360 and application layer 380 can be stored in device 120, In, Linux inner core 320, system Runtime Library layer 340 and application framework layer 360 belong to operating system space, and application layer 380 belongs to In user's space.Linux inner core 320 provides the driving of bottom for the various hardware of terminal, and such as display driving, audio are driven Dynamic, webcam driver, bluetooth driving, Wi-Fi driving, power management etc..System Runtime Library layer 340 by some libraries C/C++ come Main characteristic is provided for android system to support.If the library SQLite provides the support of database, the library OpenGL/ES is mentioned The support for having supplied 3D to draw, the library Webkit provides the support etc. of browser kernel.It is also provided in system run-time library layer 340 There is Android run-time library (Android runtime), it mainly provides some core libraries, and developer can allow for use Java Language is applied to write Android.Application framework layer 360 provides the various API that may be used when building application program, exploitation Person can also construct the application program of oneself by using these API, such as activity management, window management, view management, logical Know management, content provider, assure reason, call management, resource management, orientation management.Operation has at least one in application layer 380 Application program, these application programs can be the included native applications program of operating system, such as contact person's program, short message journey Sequence, timing routine, camera applications etc.;It is also possible to the third party application that third party developer is developed, such as game class Application program, instant messaging program, photograph pretty program, shopping program etc..
Wherein, the instruction for receiving input of input unit 130 or data, input unit 130 include but is not limited to keyboard, Mouse, camera, microphone or touch control device.Output device 140 be used for output order or data, output device 140 include but It is not limited to display equipment and loudspeaker etc..In one example, input unit 130 and output device 140, which can close, sets, input dress Set 130 and output device 140 be touch display screen, the touch display screen is any using finger, felt pen etc. for receiving user The touch operation of suitable object on it or nearby, and the user interface of each application program of display.Touch display screen is logical It is normally placed in the front panel of terminal.Touch display screen is designed to shield comprehensively, Curved screen or abnormal shape shield.Touch display screen is also It is designed to shield and the combination of Curved screen comprehensively, the combination of abnormal shape screen and Curved screen, the embodiment of the present application is not subject to this It limits.
In addition to this, it will be understood by those skilled in the art that the structure of terminal shown by above-mentioned attached drawing is not constituted pair The restriction of terminal, terminal may include perhaps combining certain components or different components than illustrating more or fewer components Arrangement.For example, further including radio circuit, input unit, sensor, voicefrequency circuit, Wireless Fidelity (wireless in terminal Fidelity, WiFi) components such as module, power supply, bluetooth module, details are not described herein.
In the embodiment of the present application, the executing subject of each step can be terminal described above.Optionally, each step Executing subject is the operating system of terminal.Operating system can be Android system, be also possible to IOS system or other operations System, the embodiment of the present application are not construed as limiting this.
The terminal of the embodiment of the present application, is also equipped with display equipment thereon, and display equipment can be various be able to achieve The equipment of display function, such as: cathode-ray tube display (cathode ray tubedisplay, abbreviation CR), light-emitting diodes Tube display (light-emitting diode display, abbreviation LED), electronic ink screen, liquid crystal display (liquid Crystal display, abbreviation LCD), Plasmia indicating panel (plasma displaypanel, abbreviation PDP) etc..User can With using the display equipment in terminal 101, come information such as the texts, picture, video of checking display.The terminal can be intelligence Mobile phone, tablet computer, game station, AR (Augmented Reality, augmented reality) equipment, automobile, data storage device, Audio playing apparatus, video play device, notebook, Desktop computing device, wearable device such as electronic watch, electronic eyes The equipment such as mirror, electronic helmet, electronic bracelet, electronics necklace, electronic clothes.
In terminal shown in Fig. 1, processor 110 can be used for calling the application program stored in memory 120, and have Body executes the grasping means of the systrace information of the embodiment of the present application.
In technical solution provided by the embodiments of the present application, message to be processed is detected, before ANR occurs for message to be processed Given time start grab systrace information, until message to be processed occur ANR when stop crawl systrace information, so Store the systrace information grabbed afterwards, so as to according to systrace information analysis occur ANR the reason of, solve related skill In application starting, processing expense caused by crawl systrace information is greatly and the data volume of systrace information is big in art asks Topic, the embodiment of the present application only need the crawl systrace between at the time of ANR occurs of the given time before ANR occurs to believe Breath, reduces the data volume of the systrace information of crawl, while reducing the working time of systrace, reduces terminal Handle expense.
In following methods embodiment, for ease of description, only it is introduced using the executing subject of each step as terminal It is bright.
Below in conjunction with Fig. 4-Fig. 5, the grasping means of systrace information provided by the embodiments of the present application is carried out detailed It introduces.Wherein, the grabbing device of the systrace information in the embodiment of the present application can be Fig. 4-terminal shown in fig. 5.
Fig. 4 is referred to, a kind of flow diagram of the grasping means of systrace information is provided for the embodiment of the present application. As shown in figure 4, the embodiment of the present application the method may include following steps:
S401, detection message to be processed.
Wherein, message to be processed is related with main thread, and message to be processed can be main thread generation, instruction Android operation Other thread process in system;Or message to be processed is that other threads generate, instruction main thread is handled.It is to be processed to disappear Breath is that the time-out being pre-configured in Android operation system generates ANR (application not responding, using do not respond) Message will pop up one when that is, Android operation system detects that the not processed duration of message to be processed is more than specified duration ANR dialog box, ANR dialog box include compulsory withdrawal button and continue waiting for button, and user is referred to by clicking compulsory withdrawal button Show the treatment process for exiting message to be processed, user clicks and continues waiting for button, then continues with message to be processed.
Wherein, the scene that ANR occurs includes: that a, incoming event are not processed in preset duration;B, radio receiver (broadcast receiver) untreated broadcast message received in preset duration, such as: it is broadcasted for foreground, broadcast Receiver untreated broadcast message received in 10s;It is broadcasted for backstage, radio receiver untreated reception in 60s The broadcast message arrived;C, service service starting has been not carried out in preset duration;D, content provider (contentprovider) (publish) operation is not completed in preset duration.
S402, when the not processed duration of message to be processed is more than the first duration threshold value, start to grab at the first moment Systrace information.
Wherein, systrace is the performance analysis tool being arranged in Android operation system, and terminal is pre-stored or is pre-configured with First duration threshold value, the first duration threshold value are less than the second duration threshold value that ANR occurs for message to be processed, such as: incoming event hair The second preset duration of raw ANR is 10s, and the first duration threshold value of terminal configuration is 5s.The reference moment of first duration threshold value can To be at the time of detecting message to be processed in S401, at the time of can also being preset with other, the embodiment of the present application is not limited System.First duration threshold value is related with the type of message to be processed, and the first duration threshold value of different types of message to be processed can be with It is identical, it can not also be identical.Terminal can call instruction systrace to start to grab systrace at the first moment by system At the time of information, the first moment can be the untreated duration of message to be processed and be more than the first duration threshold value, it is also possible to other It is pre-stored or at the time of be pre-configured, the first moment and at the time of detect message to be processed between duration be greater than or equal to first Duration threshold value.Terminal temporarily can be in interim stored memory or caching in the systrace information that the first moment grabbed.
S403, when the not processed duration of message to be processed is more than the second duration threshold value, the second moment stop grab Systrace information.
Wherein, terminal is pre-stored or is pre-configured with the second duration threshold value, and the second duration threshold value is greater than the first duration threshold value, the Two duration threshold values are the durations that ANR occurs for message to be processed, and the second duration threshold value is related with the type of message to be processed, inhomogeneity The message to be processed of type may correspond to identical second duration threshold value or the second different duration threshold values.The ginseng of second duration threshold value Examine can be constantly at the time of detect message to be processed, be also possible to other moment of terminal pre-configuration, the second moment and inspection Duration between at the time of measuring message to be processed is greater than or equal to the second duration threshold value.The side that terminal can be called by system Formula indicates that systrace stops crawl systrace information at the second moment.
S404, it is stored in the systrace information grabbed during the first moment and the second moment.
Wherein, the initial time for grabbing the time interval of systrace information was the first moment, when finish time is second Carve, terminal determines that message to be processed is still not processed when reaching for the second moment, and ANR occurs for terminal, terminal by the first moment and The systrace information grabbed during second moment carries out persistent storage, so that subsequent service performance analysis tool is oriented The reason of ANR occurs.
The scheme of the embodiment of the present application when being executed, detects message to be processed, before ANR occurs for message to be processed Given time starts to grab systrace information, stops crawl systrace information when ANR occurs for message to be processed, then The systrace information that grabs is stored, the reason of so that ANR occurs according to systrace information analysis, solves the relevant technologies In processing expense caused by crawl systrace information is big and the data volume of systrace information is big in application starting problem, The embodiment of the present application only needs the given time before ANR occurs to grab systrace information between at the time of ANR occurs, Reduce the data volume of the systrace information of crawl, while reducing the working time of systrace, reduces the place of terminal Manage expense.
Fig. 5 is referred to, a kind of flow diagram of the grasping means of systrace information is provided for the embodiment of the present application. The present embodiment is applied to illustrate in terminal with the grasping means of systrace information.This may include following step using journey It is rapid:
S501, detection message to be processed.
Wherein, message to be processed is that the message of ANR may occur in Android operation system, occur ANR scene include with Under several situations: a, incoming event are not processed in preset duration, incoming event include touch screen incoming event, keyboard input Event or the other kinds of incoming event to user interface, such as: touch screen incoming event is not processed in 10s, terminal Triggering generates ANR;B, radio receiver untreated broadcast message received in preset duration, radio receiver are arranged in master In thread, according to the difference in broadcast message source, the size of preset duration is not also identical, such as: the radio receiver of main thread It receives foreground broadcast and generates ANR when the duration of untreated foreground broadcast is more than 10s;The radio receiver of main thread receives It is broadcasted to backstage, when the duration of the untreated backstage broadcast is more than 60s, generates ANR;C, main thread creation service, the service exist When preset duration has not been executed, ANR is generated;D, content provider (content provider) does not complete in preset duration (publish) it operates, publication operation notifies other application for updating the shared data in application program into shared drive Program updates shared data.
Wherein, according to the scene of above-mentioned generation ANR, correspondingly, the message of the embodiment of the present application be respectively as follows: incoming event, It broadcasts the message, for starting giving out information for the message and content provider that service.
Wherein, it is more than specified that the process of terminal generation ANR, which may include: the duration for detecting that message to be processed is not processed, When duration, an ANR dialog box will pop up, ANR dialog box includes compulsory withdrawal button and continues waiting for button, and user passes through a little Hit the instruction of compulsory withdrawal button and exit the treatment process of message to be processed, user clicks and continues waiting for button, then continue with to Handle message.
Wherein, terminal can create a finger daemon, detect message to be processed by finger daemon, and identify wait locate The type for managing message is executed when the type of message to be processed is message (message that ANR may occur) of preset kind S502。
Wherein, it is can be used as at the time of terminal detects message to be processed with reference to the moment, when subsequent duration is with the reference Carving is starting point.
S502, judge the not processed duration of message to be processed whether more than the first duration threshold value.
Wherein, terminal is pre-stored or is pre-configured with the first duration threshold value, and the not processed duration of message to be processed is from S501 In the reference moment start to calculate, it is assumed that the first duration threshold value be T1, with reference to the moment be t0, if message to be processed is in t0+T1 It is not processed before moment, then the not processed duration of message to be processed is more than the first duration threshold value, S504 is executed, is otherwise held Row S503.
S503, the operation for not executing crawl systrace information.
Wherein, terminal determines that message to be processed is processed before the first preset duration threshold value time-out, shows to occur ANR, then also not needing crawl systrace information.
S504, start to grab systrace information at the first moment.
Wherein, the first moment and the first preset duration threshold value and detect message to be processed at the time of, are related, such as: assuming that First moment was t1, and it is t0 at the time of detecting message to be processed, then t1=t0+T1 that the first duration threshold value, which is T1,. Systrace is the component for being used to grab systrace information being arranged in the Android operation system of terminal, and terminal can pass through The mode that system is called indicates that systrace grabs systrace information.
Such as: terminal sends crawl to systrace at the first moment and starts to notify, crawl starts notice and carries wait grab Parameter type, cache size, application program identification and crawl duration, application program identification indicate systrace crawl application The mark of program, crawl duration are the duration grabbed.
Wherein, terminal by the systrace information cache of crawl in pre-set spatial cache, spatial cache it is big Small and position can start to notify by crawl to configure or preconfigured fixed value.
S505, judge the not processed duration of message to be processed whether more than the second duration threshold value.
Wherein, terminal is when determining that the not processed duration of message to be processed is more than the first duration threshold value, continue monitoring to The not processed duration of message is handled, terminal is pre-stored or is pre-configured with the second duration threshold value, and the second duration threshold value is greater than first Duration threshold value, the second duration threshold value indicate that the overtime duration of ANR occurs for message to be processed, such as: the super of ANR occurs for incoming event When constantly a length of 10s, i.e. incoming event not processed duration is more than 10s, ANR is generated, in other words, the second duration threshold value is 10s。
Wherein, the size of the second duration threshold value is related with the type of message to be processed.Such as: the second duration of incoming event Threshold value is 10s, and the second duration threshold value of broadcast message is 60s, and the second duration threshold value of the message for starting service is 20s.
Wherein, when terminal determines that the not processed duration of message to be processed is more than the second duration threshold value, S508 is executed;Terminal When determining that the not processed duration of message to be processed is less than the second duration threshold value, S506 is executed.It should be understood that due to the second duration Threshold value is greater than the first duration threshold value, when the not processed duration of message to be processed is greater than the first duration threshold value, when not processed Length is likely larger than the second duration threshold value, it is also possible to be less than or equal to the second duration threshold value.Message to be processed is not processed in S505 Duration at the time of can detect message to be processed using in S501 as with reference to the moment.
S506, stop crawl systrace information at the second moment.
Wherein, detected in the second moment and the second duration threshold value and S501 it is related at the time of message to be processed, such as: Two moment were t2, t2=t0+T1, and shown in Figure 6, t0 is at the time of detecting message to be processed, and t1 was the first moment, and t2 is Second moment, T1 are the first duration threshold value, and T2 is the second duration threshold value, and t1=t0+T1, t2=t0+T2, T2 is greater than T1.
Wherein, terminal can notify systrace to stop crawl systrace at the second moment in such a way that system is called Information, such as: terminal sends crawl expiry notification to systrace.
S507, the systrace information for being discarded in the first moment and the crawl of the second moment.
Wherein, since ANR does not occur for terminal, the treatment process of message to be processed is normally that terminal can empty The spatial cache of systrace information is discarded in the systrace information grabbed during the first moment and the second moment.
S508, stop crawl systrace information at the second moment.
Wherein, the explanation at the second moment can refer to the description of S506, and details are not described herein again.
S509, it is stored in the systrace information grabbed during the first moment and the second moment.
Wherein, terminal can deposit the systrace information progress persistence that the first moment and the second moment device grab The problem of storing up, ANR occurs so as to performance evaluation job analysis application program, analytic process can be used in the prior art any one Kind mode, details are not described herein again.
The scheme of the embodiment of the present application when being executed, detects message to be processed, before ANR occurs for message to be processed Given time starts to grab systrace information, stops crawl systrace information when ANR occurs for message to be processed, then The systrace information that grabs is stored, the reason of so that ANR occurs according to systrace information analysis, solves the relevant technologies In processing expense caused by crawl systrace information is big and the data volume of systrace information is big in application starting problem, The embodiment of the present application only needs the given time before ANR occurs to grab systrace information between at the time of ANR occurs, Reduce the data volume of the systrace information of crawl, while reducing the working time of systrace, reduces the place of terminal Manage expense.
Following is the application Installation practice, can be used for executing the application embodiment of the method.It is real for the application device Undisclosed details in example is applied, the application embodiment of the method is please referred to.
Fig. 7 is referred to, it illustrates the grabbing devices for the systrace information that one exemplary embodiment of the application provides Structural schematic diagram, hereinafter referred to as device 7.The device 7 being implemented in combination with as terminal by software, hardware or both All or part of.Device 7 includes detection unit 701, start unit 702, processing unit 703 and storage unit 704.
Detection unit 701, for detecting message to be processed;
Start unit 702, for when the not processed duration of the message to be processed is more than the first duration threshold value, One moment started to grab Android system tracking systrace information;
Processing unit 703, for when the not processed duration of the message to be processed is more than the second duration threshold value, Two moment stopped crawl systrace information;Wherein, the second duration threshold value is that the message to be processed occurs using no sound The duration of ANR is answered, the second duration threshold value is greater than the first duration threshold value;
Storage unit 704, the systrace letter for being grabbed during being stored in first moment and second moment Breath.
In one or more embodiments, processing unit 703 is also used to:
If the not processed duration of the message to be processed is less than the first duration threshold value, crawl is not executed The operation of systrace information.
In one or more embodiments, processing unit 703 is also used to:
If the not processed duration of the message to be processed is more than the first duration threshold value but is less than the second duration threshold Value stops crawl systrace information at second moment;
Abandon the systrace information grabbed between the first moment and the second moment.
In one or more embodiments, the type of the message to be processed includes: incoming event, broadcast message, service The initiation message of service and giving out information for content provider contentprovider.
In one or more embodiments, the first duration threshold value, the second duration threshold value to be processed disappear with described The type of breath is related.
Like in one or more embodiments, the generation moment of message to be processed is t0, and the first duration threshold value is T1, when second Long threshold value is T2, and the first moment was t1, and the second moment was t2, t1=t0+T1, t2=t0+T2, T2 > T1.
In one or more embodiments, it is described be stored in first moment and second moment during grab Systrace information, comprising:
System is sent to systrace and calls message, and system calls message to be used to indicate the systrace for the first moment It stores with the systrace information grabbed during the second moment to designated position.
It should be noted that device 7 provided by the above embodiment execute systrace information grasping means when, only with The division progress of above-mentioned each functional module can according to need and for example, in practical application by above-mentioned function distribution by not Same functional module is completed, i.e., the internal structure of equipment is divided into different functional modules, to complete whole described above Or partial function.In addition, the crawl of the grabbing device of systrace information provided by the above embodiment and systrace information The embodiment of method belongs to same design, embodies realization process and is detailed in embodiment of the method, which is not described herein again.
Above-mentioned the embodiment of the present application serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
The device 7 of the embodiment of the present application detects message to be processed, the given time before ANR occurs for message to be processed Start to grab systrace information, stops crawl systrace information when ANR occurs for message to be processed, then storage crawl The systrace information arrived, so as to according to systrace information analysis occur ANR the reason of, solve and applying in the related technology Processing expense caused by systrace information is grabbed when starting greatly and the big problem of data volume of systrace information, the application reality Applying example only needs the given time before ANR occurs to grab systrace information between at the time of ANR occurs, and reduces and grabs The data volume of the systrace information taken, while reducing the working time of systrace, reduce the processing expense of terminal.
The embodiment of the present application also provides a kind of computer storage medium, the computer storage medium can store more Item instruction, described instruction are suitable for being loaded by processor and being executed the method and step such as above-mentioned Fig. 4-embodiment illustrated in fig. 6, specifically hold Row process may refer to Fig. 4-embodiment illustrated in fig. 6 and illustrate, herein without repeating.
The embodiment of the present application also provides a kind of computer program product, which is stored at least one Instruction, at least one instruction are loaded as the processor and are executed to realize systrace described in as above each embodiment The grasping means of information.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic Dish, CD, read-only memory or random access memory etc..
Above disclosed is only the application preferred embodiment, cannot limit the right model of the application with this certainly It encloses, therefore according to equivalent variations made by the claim of this application, still belongs to the range that the application is covered.

Claims (10)

1. a kind of grasping means of systrace information, which is characterized in that the described method includes:
Detect message to be processed;
When the not processed duration of the message to be processed is more than the first duration threshold value, start to grab Android system at the first moment System tracking systrace information;
When the not processed duration of the message to be processed is more than the second duration threshold value, stop grabbing at the second moment Systrace information;Wherein, the second duration threshold value is that duration of the application without response ANR, institute occur for the message to be processed The second duration threshold value is stated greater than the first duration threshold value;
It is stored in the systrace information grabbed during first moment and second moment.
2. the method according to claim 1, wherein further include:
If the not processed duration of the message to be processed is less than the first duration threshold value, crawl systrace is not executed The operation of information.
3. method according to claim 1 or 2, which is characterized in that further include:
If the not processed duration of the message to be processed is more than the first duration threshold value but is less than the second duration threshold value, In Second moment stops crawl systrace information;
Abandon the systrace information grabbed between the first moment and the second moment.
4. according to the method described in claim 3, it is characterized in that, the type of the message to be processed include: incoming event, it is wide Broadcast message, the service initiation message of service and giving out information for content provider contentprovider.
5. according to the method described in claim 4, it is characterized in that, the first duration threshold value, the second duration threshold value with The type of the message to be processed is related.
6. method according to claim 4 or 5, which is characterized in that the generation moment of message to be processed is t0, the first duration Threshold value is T1, and the second duration threshold value is T2, and the first moment was t1, and the second moment was t2, t1=t0+T1, t2=t0+T2, T2 > T1。
7. according to the method described in claim 6, it is characterized in that, described be stored in first moment and second moment The systrace information of period crawl, comprising:
System is sent to systrace and calls message, and system calls message to be used to indicate the systrace for the first moment and the The systrace information grabbed during two moment is stored to designated position.
8. a kind of grabbing device of systrace information, which is characterized in that the grabbing device includes:
Detection unit, for detecting message to be processed;
Start unit, for when the not processed duration of the message to be processed is more than the first duration threshold value, at the first moment Start to grab Android system tracking systrace information;
Processing unit, for when the not processed duration of the message to be processed is more than the second duration threshold value, at the second moment Stop crawl systrace information;Wherein, the second duration threshold value is that application occurs for the message to be processed without response ANR Duration, the second duration threshold value are greater than the first duration threshold value;
Storage unit, the systrace information for being grabbed during being stored in first moment and second moment.
9. a kind of computer storage medium, which is characterized in that the computer storage medium is stored with a plurality of instruction, described instruction Suitable for being loaded by processor and being executed the method and step such as claim 1~10 any one.
10. a kind of terminal characterized by comprising processor and memory;Wherein, the memory is stored with computer journey Sequence, the computer program are suitable for being loaded by the processor and being executed the method and step such as claim 1~10 any one.
CN201910769047.7A 2019-08-20 2019-08-20 Systrace information grabbing method and device, storage medium and terminal Active CN110489318B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910769047.7A CN110489318B (en) 2019-08-20 2019-08-20 Systrace information grabbing method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910769047.7A CN110489318B (en) 2019-08-20 2019-08-20 Systrace information grabbing method and device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN110489318A true CN110489318A (en) 2019-11-22
CN110489318B CN110489318B (en) 2023-04-28

Family

ID=68552354

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910769047.7A Active CN110489318B (en) 2019-08-20 2019-08-20 Systrace information grabbing method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN110489318B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625302A (en) * 2020-05-29 2020-09-04 北京字节跳动网络技术有限公司 Function time consumption tracking method, device and storage medium
CN113590017A (en) * 2020-04-30 2021-11-02 伊姆西Ip控股有限责任公司 Method, electronic device and computer program product for processing data

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110320873A1 (en) * 2010-06-24 2011-12-29 International Business Machines Corporation Error identification
US20130081001A1 (en) * 2011-09-23 2013-03-28 Microsoft Corporation Immediate delay tracker tool
CN105446806A (en) * 2014-09-28 2016-03-30 广州市动景计算机科技有限公司 Processing method and apparatus for application not responding
JP2016115978A (en) * 2014-12-11 2016-06-23 セコム株式会社 Portable terminal, monitoring system, and program for portable terminal
US20170331901A1 (en) * 2016-05-11 2017-11-16 Fitbit, Inc. Companion app to cooperate with an integrated tracker app
US9842017B1 (en) * 2015-03-30 2017-12-12 Amazon Technologies, Inc. Collection and aggregation of device health metrics
CN108153647A (en) * 2017-12-26 2018-06-12 广东欧珀移动通信有限公司 log processing method, device, terminal device and storage medium
CN108572906A (en) * 2018-04-24 2018-09-25 广州优视网络科技有限公司 ANR method for real-time monitoring, device, terminal and storage medium
CN108804299A (en) * 2017-04-26 2018-11-13 腾讯科技(深圳)有限公司 Application exception processing method and processing device
US20180365954A1 (en) * 2017-03-28 2018-12-20 Theft Trackers, LLC Device tracking systems and methods
CN109240888A (en) * 2018-09-17 2019-01-18 深圳市闻耀电子科技有限公司 Information extraction method, device, equipment and medium
CN109426603A (en) * 2017-08-21 2019-03-05 北京京东尚科信息技术有限公司 A kind of method and apparatus for analyzing application program Caton
CN110109769A (en) * 2019-04-16 2019-08-09 深圳壹账通智能科技有限公司 Method for safety monitoring, device, equipment and the storage medium of application crash

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110320873A1 (en) * 2010-06-24 2011-12-29 International Business Machines Corporation Error identification
US20130081001A1 (en) * 2011-09-23 2013-03-28 Microsoft Corporation Immediate delay tracker tool
CN105446806A (en) * 2014-09-28 2016-03-30 广州市动景计算机科技有限公司 Processing method and apparatus for application not responding
JP2016115978A (en) * 2014-12-11 2016-06-23 セコム株式会社 Portable terminal, monitoring system, and program for portable terminal
US9842017B1 (en) * 2015-03-30 2017-12-12 Amazon Technologies, Inc. Collection and aggregation of device health metrics
US20170331901A1 (en) * 2016-05-11 2017-11-16 Fitbit, Inc. Companion app to cooperate with an integrated tracker app
US20180365954A1 (en) * 2017-03-28 2018-12-20 Theft Trackers, LLC Device tracking systems and methods
CN108804299A (en) * 2017-04-26 2018-11-13 腾讯科技(深圳)有限公司 Application exception processing method and processing device
CN109426603A (en) * 2017-08-21 2019-03-05 北京京东尚科信息技术有限公司 A kind of method and apparatus for analyzing application program Caton
CN108153647A (en) * 2017-12-26 2018-06-12 广东欧珀移动通信有限公司 log processing method, device, terminal device and storage medium
CN108572906A (en) * 2018-04-24 2018-09-25 广州优视网络科技有限公司 ANR method for real-time monitoring, device, terminal and storage medium
CN109240888A (en) * 2018-09-17 2019-01-18 深圳市闻耀电子科技有限公司 Information extraction method, device, equipment and medium
CN110109769A (en) * 2019-04-16 2019-08-09 深圳壹账通智能科技有限公司 Method for safety monitoring, device, equipment and the storage medium of application crash

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590017A (en) * 2020-04-30 2021-11-02 伊姆西Ip控股有限责任公司 Method, electronic device and computer program product for processing data
CN113590017B (en) * 2020-04-30 2023-11-17 伊姆西Ip控股有限责任公司 Methods, electronic equipment and computer program products for processing data
CN111625302A (en) * 2020-05-29 2020-09-04 北京字节跳动网络技术有限公司 Function time consumption tracking method, device and storage medium

Also Published As

Publication number Publication date
CN110489318B (en) 2023-04-28

Similar Documents

Publication Publication Date Title
US10884605B2 (en) Methods and systems for displaying hidden information on a web page
CN111459586B (en) Remote assistance method, device, storage medium and terminal
CN111124668B (en) Memory release method, device, storage medium and terminal
WO2019047231A1 (en) Touch operation response method and device
CN113312572A (en) Resource processing method and device, storage medium and electronic equipment
CN111913614B (en) Multi-screen display control method, device, storage medium and display
CN110702346B (en) Vibration testing method and device, storage medium and terminal
CN112995562A (en) Camera calling method and device, storage medium and terminal
CN110489318A (en) Grasping means, device, storage medium and the terminal of systrace information
CN113595662A (en) Signal prompting method and device, terminal equipment and storage medium
CN114647336B (en) Click delay measurement method, device, storage medium and electronic device
CN113825022B (en) Method and device for detecting play control state, storage medium and electronic equipment
WO2019047234A1 (en) Touch operation response method and apparatus
CN112882857B (en) Performance problem positioning method, device, electronic equipment and storage medium
CN112256354B (en) Application starting method and device, storage medium and electronic equipment
CN110045958A (en) Data texturing generation method, device, storage medium and equipment
CN111475242B (en) Equipment control method and device, storage medium and electronic equipment
CN113098859A (en) Webpage page backspacing method, device, terminal and storage medium
CN112988097A (en) Display screen control method and device, storage medium and mobile terminal
CN113495641A (en) Touch screen ghost point identification method and device, terminal and storage medium
CN113312249A (en) Log data generation method, log data display method and device
CN113918350B (en) Garbage collection method, garbage collection device, storage medium and electronic equipment
CN108415746A (en) Application interface display method and device, storage medium and electronic equipment
CN112612633A (en) Inter-process communication method, device, storage medium and terminal
CN117591488B (en) File detection method, device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant