CN112231132A - Application program jamming positioning method and device, electronic equipment and medium - Google Patents

Application program jamming positioning method and device, electronic equipment and medium Download PDF

Info

Publication number
CN112231132A
CN112231132A CN202011059066.XA CN202011059066A CN112231132A CN 112231132 A CN112231132 A CN 112231132A CN 202011059066 A CN202011059066 A CN 202011059066A CN 112231132 A CN112231132 A CN 112231132A
Authority
CN
China
Prior art keywords
app
pause
recovery
time
time length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011059066.XA
Other languages
Chinese (zh)
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.)
Beijing 58 Information Technology Co Ltd
Original Assignee
Beijing 58 Information 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 Beijing 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN202011059066.XA priority Critical patent/CN112231132A/en
Publication of CN112231132A publication Critical patent/CN112231132A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/0757Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis

Abstract

The embodiment of the invention provides a method and a device for positioning application program blockage, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring the pause time of an application program APP when the APP is paused and the recovery time of pause recovery; judging whether the card pause time length is greater than the recovery time length or not during cold starting; and if the pause time length of the card is longer than the recovery time length, determining that the pause time length of the card is a system forced kill. The embodiment of the invention does not need manual analysis, saves the time of the problem of stuck positioning in development, saves the development time and improves the development efficiency. Meanwhile, the time cost of manually analyzing the coast log is reduced, the development efficiency is improved, the App can be effectively positioned to be forcibly killed by the system, and the accuracy of pause detection is improved.

Description

Application program jamming positioning method and device, electronic equipment and medium
Technical Field
The present invention relates to the field of computer applications, and in particular, to a method and an apparatus for positioning an application program stuck, an electronic device, and a storage medium.
Background
The stability of App operation is a precondition for guaranteeing service development, and is a standard for judging whether the App is excellent or not. The higher the stability of App, the better the user experience, and the higher the user usage.
In the related technology, the unstable factor of the App can be caused by too high memory usage of the mobile terminal, too large CPU consumption, too large power consumption, breakdown, too low survival time of the App entering the background, and the like. The unstable factors can be detected through a detection tool or third-party software, the unstable factors can be solved in a development stage, and the problem of crash can also be positioned and solved in a manner of collecting and analyzing a crash log, however, the influence factors of the survival time of the App are mainly killed by a system, the system is not killed by any signal, and is difficult to accurately detect, and the problem is mainly solved by analyzing the crash log in the mobile terminal when the App is detected by a foreground, wherein the system is not prompted by any signal, and the problem is difficult to accurately detect because the App is triggered by a watchdog policy of the apple or the foreground memory is killed by the system when the usage of the foreground memory is too high; or, artificially locate the problem of excessive memory by analysis, and the like. Therefore, in the prior art, the workload of detecting the mortars is large, the fact that the watchdog is triggered every time the mortars cannot be guaranteed, log analysis is difficult, if the mortars are not detected, the workload of analyzing the crash logs is large, and if a symbol table exists, no ipa packet exists, the crash logs are difficult to analyze. Therefore, the APP can not be accurately positioned and forcibly killed by the system.
Therefore, how to accurately locate the App to be killed by the system is a technical problem to be solved at present.
Disclosure of Invention
The technical problem to be solved by the embodiment of the invention is to provide a method for positioning an application program stuck, so as to solve the technical problem that in the prior art, the APP cannot be accurately positioned to be forcibly killed by a system because no signal is provided for prompting when the APP is forcibly killed by the system.
Correspondingly, the embodiment of the invention also provides a positioning device, an electronic device and a storage medium device for the application program card pause, which are used for ensuring the realization and the application of the method.
In order to solve the problems, the invention is realized by the following technical scheme:
according to a first aspect of the embodiments of the present invention, there is provided a method for positioning an application program stuck, including:
acquiring the pause time of an application program APP when the APP is paused and the recovery time of pause recovery;
judging whether the card pause time length is greater than the recovery time length or not during cold starting;
and if the pause time length of the card is longer than the recovery time length, determining that the pause time length of the card is a system forced kill.
Optionally, obtaining the duration of the application APP on the card pause when the APP appears on the card pause, and the recovery duration of the card pause recovery includes:
monitoring whether the APP is stuck or not by running the characteristics of the circulating runloop;
when the APP is monitored to be blocked, the blocking time length of the APP is recorded; and
and when the blockage is monitored to be recovered through the operation cycle, recording the recovery time length of the blockage recovery.
Optionally, the monitoring whether the APP is stuck by running the property of the loop runloop includes:
circularly monitoring the main thread state in the application program APP through the characteristic of running a circulating runloop;
acquiring the time interval of the execution of the thread task in the state interval of the main thread state;
if the time interval is larger than a preset threshold value, determining that the APP is stuck; otherwise, determining that the APP is not clamped.
Optionally, the method further includes:
and if the pause time length is not more than the recovery time length, determining that the pause is a common pause.
According to a second aspect of the embodiments of the present invention, there is provided an application program stuck location apparatus, including:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring the pause time of an application program APP when the APP appears card pause and acquiring the recovery time of pause recovery;
the judging module is used for judging that the card pause time length is longer than the recovery time length when in cold start;
the first determining module is used for determining that the card pause is system forced killing when the card pause time length is larger than the recovery time length.
Optionally, the first obtaining module includes:
the monitoring module is used for monitoring whether the APP is stuck or not by running the characteristics of the circulating runloop;
the first recording module is used for recording the pause time of the APP when the monitoring module monitors that the APP is paused; and
and the second recording module is used for recording the recovery time of the stuck recovery when the monitoring module monitors that the stuck recovery is carried out through the operation cycle.
Optionally, the monitoring module includes:
the detection module is used for circularly monitoring the main thread state in the application program APP through the characteristic of running a circulating runloop;
the second acquisition module is used for acquiring the execution time of the thread task in each state area of the main thread state;
a second determining module, configured to determine that the APP is stuck in the state region when the execution time obtained by the second obtaining module is greater than a preset time threshold of a corresponding state region; or when the execution time acquired by the second acquisition module is not greater than a preset time threshold of a corresponding state area, determining that the APP is not stuck in the state area.
Optionally, the apparatus further comprises:
and the third determining module is used for determining that the card pause time is not more than the recovery time when the judging module judges that the card pause time is not more than the recovery time, and determining that the card pause is common card pause.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing any of the application program stuck location methods as described above.
According to a fourth aspect of the embodiments of the present invention, there is provided a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the application program stuck location method as described in any one of the above.
According to a fifth aspect of embodiments of the present invention, there is provided a computer program product, wherein instructions of the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform any one of the above-mentioned application program stuck location methods.
Compared with the prior art, the embodiment of the invention has the following advantages:
in the embodiment of the invention, the pause time of the application program APP when the card pause occurs and the recovery time of the pause recovery are firstly obtained; then, judging whether the card pause time length is greater than the recovery time length or not during cold starting; and if the pause time length of the card is longer than the recovery time length, determining that the card pause is a system forced kill, otherwise, determining that the card pause is a common card pause. That is to say, in the embodiment of the present invention, after the time duration of the stuck pause and the time duration of the recovery of the APP occurring at the stuck pause are obtained, whether the APP is forcibly killed by the system is determined by comparing the time duration of the stuck pause and the time duration of the recovery, that is, the embodiment of the present invention does not need manual analysis, saves the time for the stuck location problem in development, saves the development time, and improves the development efficiency. Meanwhile, the time cost of manually analyzing the coast log is reduced, the development efficiency is improved, the App can be effectively positioned to be forcibly killed by the system, and the accuracy of pause detection is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
Fig. 1 is a flowchart of an application program stuck location method according to an embodiment of the present invention;
fig. 2 is an application example diagram of an application program stuck location method according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a positioning apparatus for application program pausing provided by an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a first obtaining module according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a detection module according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of an application program stuck positioning apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart of an application program stuck location method according to an embodiment of the present invention may specifically include the following steps:
step 101: acquiring the pause time of an application program APP when the APP is paused and the recovery time of pause recovery;
step 102: judging whether the card pause time length is greater than the recovery time length or not during cold starting;
step 103: and if the pause time length of the card is longer than the recovery time length, determining that the pause time length of the card is a system forced kill.
The method for determining that the application program is forcibly killed by the system provided by the embodiment of the invention can be applied to a mobile terminal, a server, a client, a back end or a system and the like, and is not limited herein.
The following describes in detail specific implementation steps of an application program stuck location method according to an embodiment of the present invention with reference to fig. 1.
Firstly, step 101 is executed to obtain a pause time length when the application program APP is paused and a recovery time length of the pause recovery.
In this step, whether the APP is stuck can be monitored through the characteristics of the running loop (runloop); when the APP is monitored to be blocked, the blocking time length of the blocking of the APP is recorded, wherein the blocking time length can also be called a blocking time stamp (timestamp) of the blocking time; and when it is monitored that the stuck state is recovered through the operation cycle, recording the recovery time length of the stuck state recovery, wherein the recovery time length can also be called a time stamp during recovery. Where a timestamp (timestamp), usually a sequence of characters, uniquely identifies the time of a moment.
Specifically, in one mode, the main thread state in the application program APP can be circularly monitored through the characteristic of running a loop runloop; acquiring the time interval of the execution of the thread task in the state interval of the main thread state; if the time interval is larger than a preset threshold value, determining that the APP is stuck; otherwise, determining that the APP is not clamped.
The runloop of the main thread is used for processing various tasks, and each loop triggers several different types of callbacks, for example, triggering: the callbacks of kcnfruopopbeforetimers, kcnfruloopbeforesources, kcnfruopopbeforewaiting and kcnfruopoafrevewaiting, and the like.
Typically, callbacks are cycled in the following order:
kCFRunLoopBeforeTimers->kCFRunLoopBeforeSources->kCFRunLoopBeforeWaiting->kCFRunLoopAfterWaiting。
in another mode, the state of a runloop of a main thread of the APP can be monitored by using cfrunloop observer context, whether the APP is stuck or not is judged according to a time interval of task execution in the main thread, namely if the time interval is greater than a preset threshold, the APP is determined to be stuck; otherwise, determining that the APP is not clamped.
The running loop (Runloop) is a loop which does some things in the running process of the application program, if no Runloop program is executed, the application program can be immediately exited, if a Runloop program is always run, and the application program waits for the input operation of a user at any time. The RunLoop can run by itself when needed and stop for rest when no operation is carried out, thereby fully saving CPU resources and improving program performance.
It should be noted that, recording the time length of the card pause after the card pause is monitored, that is, the timestamp of the card pause is the latest timestamp, that is, each time the card pause is located, the corresponding timestamp needs to be updated, so as to ensure that the timestamp of the current card pause is always the time of the last card pause. Similarly, any callback running a loop runloop records the latest recovery duration, i.e. the recovery timestamp of recovery.
Next, step 102 is executed to determine whether the card pause time length is greater than the recovery time length during the cold start.
Wherein, the cold start is to start the computer or the mobile terminal by pressing a POWER-on key (POWER) in the POWER-off state. The cold start is a start mode of a computer or a mobile terminal, namely, the power supply of the computer is firstly cut off and the computer is restarted. After cold start, all contents are lost, the hardware is detected first, and the CMOS is entered to start the operating system.
In this step, it is determined whether the card pause time length is greater than the recovery time length at the time of cold start, and for convenience of description, a specific example will be described below.
Since a callback may trigger a certain time-consuming task in the client, generally, multiple tasks are triggered in one loop, such as job1, job2, job3, and the execution sequence and time-consuming are as follows:
one hour later, cold start was achieved by job1(10ms) - - > job2(1500ms) - - > job3(15000ms) - -
According to the sequence, the job1 is safe, the job2 triggers killing of stall, and is detected and reported by an AppWatchdog tool (assuming that threshold is 2s), the job3 is also detected by the AppWatchdog tool, and then the system watchdog strongly kills the stall due to long-term blocking of the main thread, so that the stall is a real hard stall.
If the runloop can be recovered from the stall, when the runloop enters different events each time, if the stall occurs last time, recording a new timestamp activeTs to indicate that the runloop is recovered from the stall at a future time point, recording the recovery timestamp at the time, and then, judging the next cold start as follows:
Figure BDA0002711776820000071
the time series would become:
job1(10ms) - > job2(1500ms) - > activeTs- > job3(15000ms) - > cold start after one hour
Obviously, after execution of the job2, we record a timestamp that runloop is active, which indicates that the job2 is normal, and the job3 is a strong system due to too long time consumption, and the runloop has no chance to enter the next loop, and no latest activeTs is recorded, so that the judgment according to the above conditions can easily detect that the job2 is normal, and the job3 is hard.
It should be noted that, after hard stall, if the user abandons the current task and starts the App again after a long time, it is still able to determine which stall (call stall) is the true hard stall.
If the incLOOP gets to sleep after executing a task, it needs to record the activeTs, since it can go to sleep to indicate non-hard stall.
Finally, step 103 is executed, if the katton time length is larger than the recovery time length, the katton is determined as system forced killing.
In the step, during each cold start, if the time length of the stuck time (the time stamp of the stuck time) is judged to be greater than the recovery time length (namely the time stamp of the recovery), the APP is forcibly killed by the system, otherwise, the APP is normal stuck, namely the APP is normally stuck.
Further, in another embodiment, on the basis of the above embodiment, the method may further include: step 104:
and if the pause time length is not more than the recovery time length, determining that the pause is a common pause.
That is, in this step, if the pause duration is less than or equal to the recovery duration, it indicates that the APP is normally paused.
In the embodiment of the invention, the pause time of the application program APP when the card pause occurs and the recovery time of the pause recovery are firstly obtained; then, judging whether the card pause time length is greater than the recovery time length or not during cold starting; and if the pause time length of the card is longer than the recovery time length, determining that the card pause is a system forced kill, otherwise, determining that the card pause is a common card pause. That is to say, in the embodiment of the present invention, after the time duration of the stuck pause and the time duration of the recovery of the APP occurring at the stuck pause are obtained, whether the APP is forcibly killed by the system is determined by comparing the time duration of the stuck pause and the time duration of the recovery, that is, the embodiment of the present invention does not need manual analysis, saves the time for the stuck location problem in development, saves the development time, and improves the development efficiency. Meanwhile, the time cost of manually analyzing the coast log is reduced, the development efficiency is improved, the App can be effectively positioned to be forcibly killed by the system, and the accuracy of pause detection is improved.
Referring to fig. 2, an application example diagram of a positioning method for an APP stuck in an embodiment of the present invention is shown, in this embodiment, when the APP is stuck, it is determined whether a call stack can be recovered from a run loop, if the call stack cannot be recovered, it is determined that the APP is killed by the system, and if the call stack cannot be recovered, it is determined that the APP stuck is a normal stuck. The method specifically comprises the following steps:
first, the mortars in the App are collected and analyzed, that is, the mortars which can locate all APPs are obtained, and then which of the App mortars are the mortars which trigger the watchdog (watchdog), and which are the ordinary mortars.
Secondly, after the card pause is positioned, the time stamp A of the card pause is recorded, and the corresponding time stamp A is updated every time the card pause is positioned. To ensure that the current timestamp a is always the last time the card went on. Where a timestamp (timestamp), usually a sequence of characters, uniquely identifies the time of a moment.
Again, each time a card is recovered from a runloop, the recovery timestamp B is recorded, and the callback of any running loop runloop of the main thread records the latest recovery timestamp B.
That is, after entering runloop, the current runloop will continue to be followed
The method comprises the steps of sequentially cycling callback of kcnfoopbefore timers- > kcnfoopbefore resources- > kcnfoopbefore waiting- > kcnfoopafter waiting- > kcnfoop after waiting until receiving a message of exiting runloop, so that when a main thread task is executed in which state interval, acquiring the time interval, if the time interval exceeds a threshold value, indicating that the APP is stuck, recording the stuck time length, reporting stack information, and when the APP is recovered, recording the recovery time length. Otherwise, the APP is not stuck.
And finally, comparing the sizes of the timestamps A and B during each cold start, if the timestamp A is not more than the timestamp B, indicating that the APP is normally stuck, and if the timestamp A is more than the timestamp B, indicating that the APP is forcibly killed by the system.
According to the embodiment of the invention, the clamp pause time and the runloop recovery time are checked through the characteristics of the runloop, the clamp pause type of the App is analyzed through the time comparison result, and the clamp pause type can be analyzed to cause the App to be killed by the system. Namely, the embodiment of the invention can effectively position the App to be killed by the system, and improves the detection accuracy.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 3, a schematic structural diagram of a positioning apparatus for application program pausing provided in an embodiment of the present invention may specifically include the following modules: a first obtaining module 301, a judging module 302 and a first determining module 303, wherein,
the first obtaining module 301 is configured to obtain a pause time length when an APP of an application program appears card pause, and obtain a recovery time length of the card pause recovery;
the determining module 302 is configured to determine that the card pause duration is longer than the recovery duration during a cold start;
the first determining module 303 is configured to determine that the stuck is a system kill when the stuck duration is greater than the recovery duration.
Optionally, in another embodiment, on the basis of the above embodiment, the first obtaining module 301 includes: a monitoring module 401, a first recording module 402 and a second recording module 403, which are schematically shown in fig. 4, wherein,
the monitoring module 401 is configured to monitor whether the APP is stuck or not by running a property of a loop;
the first recording module 402 is configured to record a pause time duration of the APP when the monitoring module 401 monitors that the APP is paused; and
the second recording module 403 is configured to record a recovery time of the stuck recovery when the monitoring module 401 monitors that the stuck recovery is performed through the operation cycle.
Optionally, in another embodiment, on the basis of the foregoing embodiment, the monitoring module 401 includes: a detection module 501, a second obtaining module 502 and a second determining module 503, which are schematically shown in fig. 5, wherein,
the detection module 501 is configured to perform loop monitoring on a main thread state in an application APP by running a loop property;
the second obtaining module 502 is configured to obtain an execution time of the thread task in each state area of the main thread state;
the second determining module 503 is configured to determine that the APP is stuck in the state region when the execution time obtained by the second obtaining module 502 is greater than a preset time threshold of the corresponding state region; or when the execution time obtained by the second obtaining module 502 is not greater than a preset time threshold of a corresponding state region, determining that the APP is not stuck in the state region.
Optionally, in another embodiment, on the basis of the above embodiment, the apparatus further includes: a schematic structural diagram of the third determining module 601 is shown in fig. 6, wherein,
the third determining module 601 is configured to determine that the stuck time is a normal stuck time when the determining module 302 determines that the stuck time is not greater than the recovery time.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
Optionally, an embodiment of the present invention further provides an electronic device, including: the positioning method includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the embodiment of the positioning method for application program stuck as described above, and can achieve the same technical effect, and is not described herein again to avoid repetition. .
Optionally, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the foregoing embodiment of the location method for application program stuck, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
In an exemplary embodiment, a computer program product is further provided, and when an instruction in the computer program product is executed by a processor of an electronic device, the electronic device is enabled to execute each process of the foregoing embodiment of the positioning method for application program pausing, and the same technical effect can be achieved, and details are not repeated here to avoid repetition.
Referring also to fig. 7, a block diagram of an electronic device 700 is shown, according to an example embodiment. For example, the electronic device 700 may be a mobile terminal or a server, and in the embodiment of the present invention, the electronic device is taken as an example of a mobile terminal. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 7, electronic device 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and a communication component 716.
The processing component 702 generally controls overall operation of the electronic device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 702 may include one or more processors 720 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 702 may include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operation at the device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 704 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 706 provides power to the various components of the electronic device 700. The power components 706 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 700.
The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 700 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 710 is configured to output and/or input audio signals. For example, the audio component 710 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 may detect an open/closed state of the device 700, the relative positioning of components, such as a display and keypad of the electronic device 700, the sensor assembly 714 may also detect a change in the position of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, orientation or acceleration/deceleration of the electronic device 700, and a change in the temperature of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described illustrated application program stuck location method.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminals (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The foregoing describes in detail a method, an apparatus, an electronic device, and a storage medium for positioning an application program card provided by the present invention, and a specific example is applied in the present document to explain the principle and the implementation of the present invention, and the description of the foregoing embodiment is only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for positioning application program card pause is characterized by comprising the following steps:
acquiring the pause time of an application program APP when the APP is paused and the recovery time of pause recovery;
judging whether the card pause time length is greater than the recovery time length or not during cold starting;
and if the pause time length of the card is longer than the recovery time length, determining that the pause time length of the card is a system forced kill.
2. The method according to claim 1, wherein the obtaining of the katton time length when the APP appears katton and the recovery time length of the katton recovery comprises:
monitoring whether the APP is stuck or not by running the characteristics of the circulating runloop;
when the APP is monitored to be blocked, the blocking time length of the APP is recorded; and
and when the blockage is monitored to be recovered through the operation cycle, recording the recovery time length of the blockage recovery.
3. The method of claim 1, wherein the monitoring whether the APP is stuck by running a property of a loop runloop comprises:
circularly monitoring the main thread state in the application program APP through the characteristic of running a circulating runloop;
acquiring the time interval of the execution of the thread task in the state interval of the main thread state;
if the time interval is larger than a preset threshold value, determining that the APP is stuck; otherwise, determining that the APP is not clamped.
4. The method according to any one of claims 1 to 3, further comprising:
and if the pause time length is not more than the recovery time length, determining that the pause is a common pause.
5. An application program stuck location device, comprising:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring the pause time of an application program APP when the APP appears card pause and acquiring the recovery time of pause recovery;
the judging module is used for judging that the card pause time length is longer than the recovery time length when in cold start;
the first determining module is used for determining that the card pause is system forced killing when the card pause time length is larger than the recovery time length.
6. The apparatus of claim 5, wherein the first obtaining module comprises:
the monitoring module is used for monitoring whether the APP is stuck or not by running the characteristics of the circulating runloop;
the first recording module is used for recording the pause time of the APP when the monitoring module monitors that the APP is paused; and
and the second recording module is used for recording the recovery time of the stuck recovery when the monitoring module monitors that the stuck recovery is carried out through the operation cycle.
7. The apparatus of claim 5, wherein the monitoring module comprises:
the detection module is used for circularly monitoring the main thread state in the application program APP through the characteristic of running a circulating runloop;
the second acquisition module is used for acquiring the execution time of the thread task in each state area of the main thread state;
a second determining module, configured to determine that the APP is stuck in the state region when the execution time obtained by the second obtaining module is greater than a preset time threshold of a corresponding state region; or when the execution time acquired by the second acquisition module is not greater than a preset time threshold of a corresponding state area, determining that the APP is not stuck in the state area.
8. The apparatus of claim 5, further comprising:
and the third determining module is used for determining that the card pause time is not more than the recovery time when the judging module judges that the card pause time is not more than the recovery time, and determining that the card pause is common card pause.
9. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the application program stuck location method according to any one of claims 1 to 4.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the application stuck location method according to any one of claims 1 to 4.
CN202011059066.XA 2020-09-30 2020-09-30 Application program jamming positioning method and device, electronic equipment and medium Pending CN112231132A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011059066.XA CN112231132A (en) 2020-09-30 2020-09-30 Application program jamming positioning method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011059066.XA CN112231132A (en) 2020-09-30 2020-09-30 Application program jamming positioning method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN112231132A true CN112231132A (en) 2021-01-15

Family

ID=74119910

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011059066.XA Pending CN112231132A (en) 2020-09-30 2020-09-30 Application program jamming positioning method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN112231132A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764959A (en) * 2021-01-27 2021-05-07 北京字节跳动网络技术有限公司 Method, device and equipment for monitoring application program jamming problem and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109902011A (en) * 2019-02-28 2019-06-18 深圳乐信软件技术有限公司 A kind of software Caton monitoring method, device, equipment and storage medium
CN110308951A (en) * 2019-06-28 2019-10-08 Oppo广东移动通信有限公司 A kind of processing method and processing device of startup interface Caton, equipment, storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109902011A (en) * 2019-02-28 2019-06-18 深圳乐信软件技术有限公司 A kind of software Caton monitoring method, device, equipment and storage medium
CN110308951A (en) * 2019-06-28 2019-10-08 Oppo广东移动通信有限公司 A kind of processing method and processing device of startup interface Caton, equipment, storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
半夏半暖半倾城、、、、: "iOS APP 卡顿导致的系统强杀", Retrieved from the Internet <URL:https://www.jianshu.com/p/04576c975c4d> *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764959A (en) * 2021-01-27 2021-05-07 北京字节跳动网络技术有限公司 Method, device and equipment for monitoring application program jamming problem and storage medium

Similar Documents

Publication Publication Date Title
WO2017113660A1 (en) Application program management method and device
CN106970754B (en) Screen capture processing method and device
CN106766022B (en) Sensor control method and device
WO2016029642A1 (en) Background application program control method, device and terminal device
KR101676216B1 (en) Message sending method, device, program, and recording medium
CN108427618B (en) Method and device for determining stuck state and computer readable storage medium
CN112464096A (en) Information processing method and device
CN116069612A (en) Abnormality positioning method and device and electronic equipment
CN112231132A (en) Application program jamming positioning method and device, electronic equipment and medium
CN112256563A (en) Android application stability testing method and device, electronic equipment and storage medium
CN109710152B (en) Event processing method and device and storage medium
CN108228433B (en) Electronic equipment, and method and device for counting visit time and stay time of mobile application
CN110730120A (en) Instant communication message processing method, device, equipment and storage medium
CN115314426A (en) Data acquisition method, system, electronic device and storage medium
CN115033469A (en) Website system performance test method and device, equipment and storage medium
CN115729754A (en) Equipment testing method and device, electronic equipment and storage medium
EP3182650A1 (en) Method and apparatus for traffic monitoring
CN108427582B (en) Method and device for determining stuck state and computer readable storage medium
CN112883314A (en) Request processing method and device
CN106776204B (en) Method and device for determining power consumption application
CN113986190A (en) Application processing method and device and electronic equipment
CN113778696A (en) Thread control method, thread control device, and storage medium
CN111782508A (en) Automatic test method, device, electronic equipment and storage medium
CN109976563B (en) Misoperation determining method and device and touch operation response method and device
CN109756615B (en) Information prompting method, device, terminal and storage medium

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