CN109960659A - Method and apparatus for detecting application program - Google Patents
Method and apparatus for detecting application program Download PDFInfo
- Publication number
- CN109960659A CN109960659A CN201910248655.3A CN201910248655A CN109960659A CN 109960659 A CN109960659 A CN 109960659A CN 201910248655 A CN201910248655 A CN 201910248655A CN 109960659 A CN109960659 A CN 109960659A
- Authority
- CN
- China
- Prior art keywords
- value
- default mark
- main thread
- message
- title
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3604—Software analysis for verifying properties of programs
- G06F11/3612—Software analysis for verifying properties of programs by runtime analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
Abstract
The embodiment of the present application discloses the method and apparatus for detecting application program.One specific embodiment of this method includes: to execute occlusion detection step: the title and value of the default mark of record send the message with the title of default mark to main thread, wherein the value of default mark can be modified by main thread;Determine whether the value of default mark changes after the preset duration of interval;If having not been changed, determine that main thread blocks.The embodiment is able to detect ANR, facilitates positioning, analysis ANR problem.
Description
Technical field
The invention relates to field of computer technology, and in particular to the method and apparatus for detecting application program.
Background technique
ANR, i.e. Application Not Responding, also referred to as application program is without response.
For example, some events needs are completed in certain duration, if it exceeds in advance in Android (Android) system
Timing length fails to obtain significant response or the response time is too long, can all cause ANR.If because some time-consuming operations cause to lead
Thread block is more than preset duration, then system will show ANR dialog box, to prompt the corresponding application of user in no sound
Answer state.
When there is ANR, system the process stacks information of application program can be stored into local file (for example, "/
Traces.txt file under data/anr/ " catalogue).Under normal conditions, developer can not get in real time occurs ANR's
Process stacks information, so that some ANR can not be restored and be repaired.
Summary of the invention
The embodiment of the present application proposes the method and apparatus for detecting application program.
In a first aspect, the embodiment of the present application provides a kind of method for detecting application program, this method comprises: executing
Occlusion detection step: the title and value of the default mark of record send the message with the title of default mark to main thread,
In, the value of default mark can be modified by main thread;Determine whether the value of default mark changes after the preset duration of interval;If not changing
Become, determines that main thread blocks.
In some embodiments, this method further include: if the value of default mark has not been changed, obtain the storehouse letter of main thread
Breath, and stack information is uploaded onto the server.
In some embodiments, this method further include: if the value of default mark has changed, execute occlusion detection step again
Suddenly.
In some embodiments, the message with the title of default mark is sent to main thread, comprising: be invoked at main thread
The message transmission object of middle creation sends the message with the title of default mark, wherein message transmission object will be for that will send
Message indentation main thread message queue in.
In some embodiments, main thread is configured to: in response to having the message of the title of default mark from main thread
Message queue in be removed, change the value of default mark.
In some embodiments, determine whether the value of default mark changes after being spaced preset duration, comprising: when suspend mode is preset
It is long;Determine whether the value of default mark changes.
Second aspect, the embodiment of the present application provide it is a kind of for detecting the device of application program, the device include obstruction
Detection unit.Wherein, occlusion detection unit is configured to execute occlusion detection step: the title and value of the default mark of record, to
Main thread sends the message with the title of default mark, wherein the value of default mark can be modified by main thread;When interval is default
Determine whether the value of default mark changes after length;If having not been changed, determine that main thread blocks.
In some embodiments, device further include: reporting unit obtains if the value for being configured to default mark has not been changed
The stack information of main thread is taken, and stack information is uploaded onto the server.
In some embodiments, the device further include: execution unit again, if the value for being configured to default mark has changed
Become, executes occlusion detection step again.
In some embodiments, the message with the title of default mark is sent to main thread, comprising: be invoked at main thread
The message transmission object of middle creation sends the message with the title of default mark, wherein message transmission object will be for that will send
Message indentation main thread message queue in.
In some embodiments, main thread is configured to: in response to having the message of the title of default mark from main thread
Message queue in be removed, change the value of default mark.
In some embodiments, determine whether the value of default mark changes after being spaced preset duration, comprising: when suspend mode is preset
It is long;Determine whether the value of default mark changes.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, comprising: one or more processors;Storage dress
It sets, is stored thereon with one or more programs;When one or more programs are executed by one or more processors so that one or
Multiple processors realize the method as described in implementation any in first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer-readable medium, are stored thereon with computer program, should
The method as described in any implementation of first aspect is realized when computer program is executed by processor.
Method and apparatus provided by the embodiments of the present application for detecting application program, by the title for recording default mark
And value, and the message with the title of default mark is sent to main thread, it is spaced preset duration later and determines the default mark
Value whether change, and determine that main thread blocks when the value of default mark changes, so as to detect ANR, facilitate positioning,
Analyze ANR problem.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 is that one embodiment of the application can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for detecting application program of the application;
Fig. 3 is the timing diagram according to an application scenarios of the method for detecting application program of the application;
Fig. 4 is the structural schematic diagram according to one embodiment of the device for detecting application program of the application;
Fig. 5 is adapted for the structural schematic diagram for realizing the electronic equipment of the embodiment of the present application.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to
Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can the method for detecting application program using the application or the dress for detecting application program
The exemplary system architecture 100 for the embodiment set.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105.
Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with
Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out
Send message etc..Various telecommunication customer end application (Application, abbreviations can be installed on terminal device 101,102,103
APP), for example, web browser applications, shopping class application, searching class application, instant messaging tools, mailbox client, social activity put down
Platform software etc..
Terminal device 101,102,103 can be hardware, be also possible to software.When terminal device 101,102,103 is hard
When part, it can be the various electronic equipments that can run application program, including but not limited to smart phone, tablet computer, individual
Digital assistants (Personal Digital Assistant, PDA) etc..It, can when terminal device 101,102,103 is software
To be mounted in above-mentioned cited electronic equipment.Multiple softwares or software module may be implemented into (such as providing point in it
Cloth service), single software or software module also may be implemented into.It is not specifically limited herein.
Server 105 can be to provide the server of various services, such as to running on terminal device 101,102,103
The background server supported using offer.Background server can receive the thread stacks that terminal device 101,102,103 reports
Information, for developer's positioning, analysis ANR problem.
It should be noted that for detecting the method for application program generally by terminal device provided by the embodiment of the present application
101, it 102,103 executes, correspondingly, the device for detecting application program is generally positioned in terminal device 101,102,103.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need
It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, the stream of one embodiment of the method for detecting application program according to the application is shown
Journey 200.The method for being used to detect application program may comprise steps of:
Step 201, the title and value of the default mark of record, the message with the title of default mark is sent to main thread.
In the present embodiment, the method for detecting application program runs executing subject thereon (for example, Fig. 1's
The sub thread started in the main thread of the application program run in terminal device 101,102,103) pre- bidding can be recorded first
Then the title and value of knowledge send the message with the title of default mark to main thread.For example, sub thread obtain/create one
Then a certain attribute setup of the message is the title of default mark, then sends the message to main thread by a message.Its
In, the value of default mark can be modified by main thread.Here, default mark can be pair by main thread or sub thread creation
As the default value that the value of default mark can be is also possible to value set by user.Above-mentioned executing subject (for example, sub thread)
It can be created and be opened by main thread when application program is run.
In some optional implementations of the present embodiment, step 201 be can specifically include: being invoked in main thread and creates
The message transmission object built sends the message with the title of default mark.Wherein, message transmission object can be used for message
It is pressed into the message queue of main thread.By taking Android system as an example, message transmission object can be Handler example (that is,
Handler instance).Here, each Handler example can be with a thread (thread of creation Handler example, example
Such as main thread) and the thread message queue association, other threads (such as sub thread) can send out by Handler example
Give/handle message.
In some optional implementations of the present embodiment, main thread be may be configured to: in response to above-mentioned pre-
The message for being marked with the title known is removed from the message queue of main thread, changes the value of above-mentioned default mark, that is, will be above-mentioned pre-
The value that bidding is known is changed to the value different from the value of sub thread record.For example, when the message of the title with above-mentioned default mark
After being removed in the message queue of main thread, the value of above-mentioned default mark is revised as 1 by 0 by main thread.
Although describing above-mentioned executing subject (that is, sub thread) in above-mentioned implementation is invoked at disappearing of creating in main thread
Breath transmitting object sends message, but the application is not limited to this.It will be understood by those skilled in the art that can also be using other conjunctions
Suitable mode sends message between sub thread and main thread.
Step 202, the default value identified is obtained after being spaced preset duration.
In the present embodiment, above-mentioned executing subject can be spaced the value that preset duration obtains above-mentioned default mark later.This
In, since preset duration can refer to the time interval sending above-mentioned message until the value for getting above-mentioned default mark.
Preset duration can be according to the ANR time-out time that system defines and preset value, for example, 6s, 8s etc..
In some optional implementations of the present embodiment, step 202 can specifically include: above-mentioned executing subject is in step
Suspend mode preset duration first after rapid 201, and the value of above-mentioned default mark is obtained after hibernate.With in Android system, sub-line
Journey can suspend mode 8s after step 201, obtain the value of default mark later.
Step 203, determine whether the value of default mark changes.
In the present embodiment, above-mentioned executing subject can carry out the value that step 202 is got and the value that step 201 records
Compare, to determine whether the value of above-mentioned default mark has changed.
Step 204, if the value of above-mentioned default mark has not been changed, determine that main thread blocks.
In the present embodiment, if step 203 determines that the value of above-mentioned default mark has not been changed, that is, the value that step 202 is got
With step 201 record value it is identical (that is, step 201 send message do not have it is processed), then above-mentioned executing subject can
To determine that obstruction (that is, application program is without response) has occurred in main thread.
In some optional implementations of the present embodiment, if step 203 determines that the value of above-mentioned default mark has changed,
That is, the value that step 202 is got is different from the value that step 201 records (that is, the message that step 201 is sent is located
Reason), then above-mentioned executing subject can determine that main thread does not block, execute again so as to return step 201.
In some optional implementations of the present embodiment, which can also include:
After determining main thread obstruction, the stack information of the above-mentioned available main thread of executing subject, the stack information that then will acquire
It uploads onto the server, for developer's positioning, analysis ANR.By taking Android system as an example, StackTrace (also referred to as storehouse
Track) recalls information of main thread is saved in the form of stack, therefore, it can pass through and obtain main thread
(StackTraceElement is the method object indicated in StackTrace to StackTraceElement, passes through this
Calling process information in the available call stack of object, the row of class name, method name, filename including method and calling
Number etc.) obtain the stack information of main thread.
In above-mentioned implementation, developer can get the main thread obstruction that application end detects in real time, thus
ANR can be positioned, be analyzed.
With continued reference to the application scenarios that Fig. 3, Fig. 3 are according to the method for detecting application program of the present embodiment
Timing 300.In the application scenarios of Fig. 3, in application program operation, main thread starts one for monitoring the prison of ANR first
Thread is controlled (referring to step 301).Later, the title of the default mark of monitoring thread record and value are (referring to step 302), and to main line
Journey sends the message with the default title identified, and (referring to step 303), then suspend mode 8s is (referring to step 304).It is wherein above-mentioned
Message is pressed into the message queue of main thread.Main thread takes out above-mentioned message from message queue and repairs the value of default mark
The value different from the value of monitoring thread record is changed to (referring to step 305).Then, monitoring thread is determined after suspend mode terminates
The value of above-mentioned default mark is different from the value that monitoring thread records (referring to step 306), can to determine that main thread does not occur currently
Obstruction, then record presets the value of mark again and sending to main thread has the message of the default title identified (referring to step
307 and 308), suspend mode 8s is (referring to step 309) again.During this period, it calls, does not have since main thread is handling always upper one
It takes out message and modifies the value of default mark.Therefore, monitoring thread determines the value and note of default mark after suspend mode terminates
The value of record is identical (referring to step 310), can to determine that main thread has blocked, while obtaining the stack information of main thread at this time
(referring to step 311).Finally, the stack information that monitoring thread will acquire reports server (referring to step 312).
The method provided by the above embodiment for detecting application program of the application, by the title for recording default mark
And value, and the message with the title of default mark is sent to main thread, it is spaced preset duration later and determines the default mark
Value whether change, and determine that main thread blocks when the value of default mark changes, so as to detect ANR, facilitate positioning,
Analyze ANR problem.
With further reference to Fig. 4, as the realization to method shown in Fig. 2, this application provides one kind to apply journey for detecting
One embodiment of the device of sequence, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which can specifically answer
For in terminal device.
As shown in figure 4, the present embodiment may include occlusion detection unit 401 for detecting the device 400 of application program.
Wherein, occlusion detection unit 401 may be configured to execute occlusion detection step: the title and value of the default mark of record, to master
Thread sends the message with the title of default mark, wherein the value of default mark can be modified by main thread;It is spaced preset duration
Determine whether the value of default mark changes afterwards;If having not been changed, determine that main thread blocks.
In the present embodiment, above-mentioned occlusion detection step can specifically include following steps:
The first step records the title and value of default mark, and sends the message with the title of default mark to main thread.
For example, sub thread obtains/creates a message, it is then the title of default mark by a certain attribute setup of the message, then
The message is sent to main thread.Wherein, the value for presetting mark can be modified by main thread.Here, default mark can be by leading
Thread or the object of sub thread creation, the default value that the value of default mark can be are also possible to value set by user.Sub thread
It can be created and be opened by main thread when application program is run.
Optionally, the first step can specifically include: being invoked at the message transmission object created in main thread and sending has in advance
It is marked with the message for the title known, wherein in the message queue for the message indentation main thread that message transmission object is used to send.
Optionally, main thread can be configured to: in response to having message of the message of the title of default mark from main thread
It is removed in queue, changes the value of default mark.
Second step, interval preset duration obtain the value of default mark later.Here, preset duration can refer to from transmission
It states message and starts time interval until the value for getting above-mentioned default mark.Preset duration, which can be, to be defined according to system
ANR time-out time and preset value, for example, 6s, 8s etc..
Optionally, second step can specifically include: suspend mode preset duration;Obtain the value of default mark.
Third step will acquire value and be compared with the value of record, to determine whether the value of default mark has changed.
4th step, if the value of default mark has not been changed, that is, the value got is identical as the value of record (that is, being sent out
The message sent does not have processed), it can determine that obstruction (that is, application program is without response) has occurred in main thread.
In some optional implementations of the present embodiment, which can also be wrapped
Include reporting unit.Wherein, reporting unit may be configured to: if the value of default mark has not been changed, obtain the storehouse letter of main thread
Breath, and stack information is uploaded onto the server.
In some optional implementations of the present embodiment, which can also be wrapped
Include execution unit 402 again.Wherein, execution unit 402 may be configured to again: if the value of default mark has changed, again
Execute above-mentioned occlusion detection step.
The application's is provided by the above embodiment for detecting the device of application program, by the title for recording default mark
And value, and the message with the title of default mark is sent to main thread, it is spaced preset duration later and determines the default mark
Value whether change, and determine that main thread blocks when the value of default mark changes, so as to detect ANR, facilitate positioning,
Analyze ANR problem.
Below with reference to Fig. 5, it illustrates the electronic equipment for being suitable for being used to realize the embodiment of the present application (such as the electronics of Fig. 1
The structural schematic diagram of equipment 101,102,103) 500.Electronic equipment 500 shown in Fig. 5 is only an example, should not be to this Shen
Please embodiment function and use scope bring any restrictions.
As shown in figure 5, electronic equipment 500 may include processing unit (such as central processing unit, graphics processor etc.)
501, random access can be loaded into according to the program being stored in read-only memory (ROM) 502 or from storage device 508
Program in memory (RAM) 503 and execute various movements appropriate and processing.In RAM 503, it is also stored with department of computer science
Various programs and data needed for 500 operation of system.Processing unit 501, ROM 502 and RAM503 pass through the phase each other of bus 504
Even.Input/output (I/O) interface 505 is also connected to bus 504.
Usual following device can connect to I/O interface 505: the input unit 506 including such as touch screen, key etc.;
Output device 507 including such as liquid crystal display (LCD), loudspeaker etc.;And communication device 508.Communication device 508 can be with
Electronic equipment 500 is allowed wirelessly or non-wirelessly to be communicated with other equipment to exchange data.Although Fig. 5 is shown with various dresses
The electronic equipment 500 set, it should be understood that being not required for implementing or having all devices shown.It can be alternatively real
Apply or have more or fewer devices.Each box shown in Fig. 5 can represent a device, also can according to need generation
The multiple devices of table.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communication device 508, or be pacified from ROM 502
Dress.When the computer program is executed by processing unit 501, the above-mentioned function limited in the method for embodiment of the disclosure is executed
Energy.It should be noted that computer-readable medium described in the disclosure can be computer-readable signal media or computer
Readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but it is unlimited
In system, device or the device of --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, or any above combination.It calculates
The more specific example of machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, portable of one or more conducting wires
Formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable programmable read only memory
(EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device or
The above-mentioned any appropriate combination of person.In embodiment of the disclosure, computer readable storage medium can be it is any include or
The tangible medium of program is stored, which can be commanded execution system, device or device use or in connection.
And in embodiment of the disclosure, computer-readable signal media may include propagating in a base band or as carrier wave a part
Data-signal, wherein carrying computer-readable program code.The data-signal of this propagation can take various forms,
Including but not limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can be with
Any computer-readable medium other than computer readable storage medium, which can send, propagate or
Person's transmission is for by the use of instruction execution system, device or device or program in connection.Computer-readable Jie
The program code for including in matter can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc.
Deng or above-mentioned any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned apparatus;It is also possible to individualism, and it is unassembled
Enter in the device.Above-mentioned computer-readable medium carries one or more program, when said one or multiple program quilts
When the device executes, so that the device: execute occlusion detection step: the title and value of the default mark of record are sent to main thread
The message of title with default mark, wherein the value of default mark can be modified by main thread;It is determined in advance after being spaced preset duration
Whether the value that bidding is known changes;If having not been changed, determine that main thread blocks.
The behaviour for executing embodiment of the disclosure can be write with one or more programming languages or combinations thereof
The computer program code of work, described program design language include object oriented program language-such as Java,
Smalltalk, C++ further include conventional procedural programming language-such as " C " language or similar program design language
Speech.Program code can be executed fully on the user computer, partly be executed on the user computer, as an independence
Software package execute, part on the user computer part execute on the remote computer or completely in remote computer or
It is executed on server.In situations involving remote computers, remote computer can pass through the network of any kind --- packet
It includes local area network (LAN) or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as benefit
It is connected with ISP by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use
The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box
The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually
It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse
Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding
The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction
Combination realize.
Being described in unit involved in embodiment of the disclosure can be realized by way of software, can also be passed through
The mode of hardware is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor
Including occlusion detection unit.Wherein, the title of these units does not constitute the restriction to the unit itself, example under certain conditions
Such as, occlusion detection unit is also described as " executing the unit of occlusion detection step ".
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art
Member is it should be appreciated that invention scope involved in the disclosure, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic
Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature
Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed in the disclosure
Can technical characteristic replaced mutually and the technical solution that is formed.
Claims (11)
1. a kind of method for detecting application program, which comprises
Execute occlusion detection step: the title and value of the default mark of record send the name with the default mark to main thread
The message of title, wherein the value of the default mark can be modified by the main thread;The pre- bidding is determined after being spaced preset duration
Whether the value of knowledge changes;If having not been changed, the main thread obstruction is determined.
2. according to the method described in claim 1, wherein, the method also includes:
If the value of the default mark has not been changed, the stack information of the main thread is obtained, and the stack information is uploaded
To server.
3. according to the method described in claim 1, wherein, the method also includes:
If the value of the default mark has changed, the occlusion detection step is executed again.
4. according to the method described in claim 1, wherein, the title to main thread transmission with the default mark disappears
Breath, comprising:
It is invoked at the message transmission object created in the main thread and sends the message with the title of the default mark,
In, the message of transmission for being pressed into the message queue of the main thread by the message transmission object.
5. according to the method described in claim 4, wherein, the main thread is configured to: in response to the default mark
The message of title be removed from the message queue of the main thread, change the value of the default mark.
6. method described in one of -5 according to claim 1, wherein determine the default mark after the interval preset duration
Whether value changes, comprising:
Suspend mode preset duration;
Determine whether the value of the default mark changes.
7. a kind of for detecting the device of application program, described device includes:
Occlusion detection unit is configured to execute occlusion detection step: the title and value of the default mark of record are sent to main thread
The message of title with the default mark, wherein the value of the default mark can be modified by the main thread;Interval is default
Determine whether the value of the default mark changes after duration;If having not been changed, the main thread obstruction is determined.
8. device according to claim 7, wherein described device further include:
Reporting unit obtains the stack information of the main thread, and will if the value for being configured to the default mark has not been changed
The stack information is uploaded onto the server.
9. device according to claim 7, wherein described device further include:
Execution unit again executes the occlusion detection step if the value for being configured to the default mark has changed again.
10. a kind of electronic equipment, comprising:
One or more processors;
Storage device is stored thereon with one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real
Now such as method as claimed in any one of claims 1 to 6.
11. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that the program is executed by processor
Shi Shixian method for example as claimed in any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910248655.3A CN109960659B (en) | 2019-03-29 | 2019-03-29 | Method and device for detecting application program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910248655.3A CN109960659B (en) | 2019-03-29 | 2019-03-29 | Method and device for detecting application program |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109960659A true CN109960659A (en) | 2019-07-02 |
CN109960659B CN109960659B (en) | 2022-11-01 |
Family
ID=67025214
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910248655.3A Active CN109960659B (en) | 2019-03-29 | 2019-03-29 | Method and device for detecting application program |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109960659B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113742177A (en) * | 2021-09-10 | 2021-12-03 | 掌阅科技股份有限公司 | Application performance monitoring method, electronic device and storage medium |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1728106A (en) * | 2004-07-26 | 2006-02-01 | 中兴通讯股份有限公司 | Method for positioning malfunction of application program |
US20110307445A1 (en) * | 2010-06-11 | 2011-12-15 | Microsoft Corporation | Background synchronization of data objects |
CN106610881A (en) * | 2015-10-22 | 2017-05-03 | 阿里巴巴集团控股有限公司 | Method and device for extracting function stack during no program response |
CN106776253A (en) * | 2016-12-08 | 2017-05-31 | 武汉斗鱼网络科技有限公司 | A kind of interface interim card monitoring method and device |
US20170153962A1 (en) * | 2015-11-30 | 2017-06-01 | International Business Machines Corporation | Monitoring the performance of threaded applications |
CN107590015A (en) * | 2017-09-11 | 2018-01-16 | 北京京东尚科信息技术有限公司 | The method and apparatus for monitoring the obstruction of main thread |
WO2018040271A1 (en) * | 2016-08-31 | 2018-03-08 | 北京奇虎科技有限公司 | Thread processor and thread processing method |
CN108021496A (en) * | 2016-10-28 | 2018-05-11 | 腾讯科技(深圳)有限公司 | Thread-data processing method and processing device |
CN108512695A (en) * | 2018-03-12 | 2018-09-07 | 腾讯音乐娱乐科技(深圳)有限公司 | The method and device of interim card is applied in monitoring |
CN109446094A (en) * | 2018-11-05 | 2019-03-08 | 网易(杭州)网络有限公司 | A kind of Caton detection method, device, electronic equipment and storage medium |
CN109445957A (en) * | 2018-09-26 | 2019-03-08 | 迪瑞医疗科技股份有限公司 | A kind of synchronization and asynchronous communication control method, system and device |
-
2019
- 2019-03-29 CN CN201910248655.3A patent/CN109960659B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1728106A (en) * | 2004-07-26 | 2006-02-01 | 中兴通讯股份有限公司 | Method for positioning malfunction of application program |
US20110307445A1 (en) * | 2010-06-11 | 2011-12-15 | Microsoft Corporation | Background synchronization of data objects |
CN106610881A (en) * | 2015-10-22 | 2017-05-03 | 阿里巴巴集团控股有限公司 | Method and device for extracting function stack during no program response |
US20170153962A1 (en) * | 2015-11-30 | 2017-06-01 | International Business Machines Corporation | Monitoring the performance of threaded applications |
WO2018040271A1 (en) * | 2016-08-31 | 2018-03-08 | 北京奇虎科技有限公司 | Thread processor and thread processing method |
CN108021496A (en) * | 2016-10-28 | 2018-05-11 | 腾讯科技(深圳)有限公司 | Thread-data processing method and processing device |
CN106776253A (en) * | 2016-12-08 | 2017-05-31 | 武汉斗鱼网络科技有限公司 | A kind of interface interim card monitoring method and device |
CN107590015A (en) * | 2017-09-11 | 2018-01-16 | 北京京东尚科信息技术有限公司 | The method and apparatus for monitoring the obstruction of main thread |
CN108512695A (en) * | 2018-03-12 | 2018-09-07 | 腾讯音乐娱乐科技(深圳)有限公司 | The method and device of interim card is applied in monitoring |
CN109445957A (en) * | 2018-09-26 | 2019-03-08 | 迪瑞医疗科技股份有限公司 | A kind of synchronization and asynchronous communication control method, system and device |
CN109446094A (en) * | 2018-11-05 | 2019-03-08 | 网易(杭州)网络有限公司 | A kind of Caton detection method, device, electronic equipment and storage medium |
Non-Patent Citations (4)
Title |
---|
EDUARDO H.M.CRUZ等: ""Dynamic thread mapping of shared memory applications by exploiting cache coherence protocols"", 《JOURNAL OF PARALLEL AND DISTRIBUTED COMPUTING》 * |
MATTHEW CURLAND等: "" 用VB创建高效的多线程应用程序"", 《程序员》 * |
天津滨海迅腾科技集团有限公司: "《Android项目式程序设计》", 31 January 2017, 南开大学出版社 * |
李维勇: "《Android应用开发项目化教程》", 30 April 2017, 北京航空航天大学出版社 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113742177A (en) * | 2021-09-10 | 2021-12-03 | 掌阅科技股份有限公司 | Application performance monitoring method, electronic device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109960659B (en) | 2022-11-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110865898B (en) | Method, device, medium and equipment for converging crash call stack | |
CN111555940A (en) | Client test method and device, electronic equipment and computer readable storage medium | |
CN110232091A (en) | Mthods, systems and devices for synchrodata | |
CN110008050A (en) | Method and apparatus for handling information | |
CN109975688A (en) | General evaluating method and device for heterogeneous chip | |
CN109218041A (en) | Request processing method and device for server system | |
CN110881224B (en) | Network long connection method, device, equipment and storage medium | |
CN112256372B (en) | Information processing method and device and electronic equipment | |
CN110275736A (en) | Obtain operation data method, apparatus, equipment and the readable medium of application program | |
CN110399253A (en) | Delay machine treating method and apparatus | |
CN111813685B (en) | Automatic test method and device | |
CN109949806A (en) | Information interacting method and device | |
CN109828830A (en) | Method and apparatus for managing container | |
CN110119386A (en) | Data processing method, data processing equipment, medium and calculating equipment | |
CN111400581B (en) | System, method and apparatus for labeling samples | |
CN109960659A (en) | Method and apparatus for detecting application program | |
CN108920085A (en) | Information processing method and device for wearable device | |
CN110532803A (en) | Private data guard method and device | |
CN109936477A (en) | Method and apparatus for sending information | |
CN109933508A (en) | Method and apparatus for sending information | |
CN115187364A (en) | Method and device for monitoring deposit risk under bank distributed scene | |
CN113568695A (en) | Corner mark processing method and device for boarder application | |
CN113407229A (en) | Method and device for generating offline script | |
CN110489262A (en) | Automatic positioning method, system, medium and the electronic equipment of system fault module | |
CN109766246B (en) | Method and apparatus for monitoring applications |
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 | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20211012 Address after: 100176 101, floor 1, building 1, yard 7, Ruihe West 2nd Road, Beijing Economic and Technological Development Zone, Daxing District, Beijing Applicant after: Apollo Zhilian (Beijing) Technology Co.,Ltd. Address before: Unit D, Unit 3, 301, Productivity Building No. 5, High-tech Secondary Road, Nanshan District, Shenzhen City, Guangdong Province Applicant before: BAIDU INTERNATIONAL TECHNOLOGY (SHENZHEN) Co.,Ltd. |
|
TA01 | Transfer of patent application right | ||
GR01 | Patent grant | ||
GR01 | Patent grant |