CN111625425A - Data monitoring method, device and system - Google Patents

Data monitoring method, device and system Download PDF

Info

Publication number
CN111625425A
CN111625425A CN202010470125.6A CN202010470125A CN111625425A CN 111625425 A CN111625425 A CN 111625425A CN 202010470125 A CN202010470125 A CN 202010470125A CN 111625425 A CN111625425 A CN 111625425A
Authority
CN
China
Prior art keywords
exception
thread
termination signal
information
collecting
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
CN202010470125.6A
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 Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet 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 Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010470125.6A priority Critical patent/CN111625425A/en
Publication of CN111625425A publication Critical patent/CN111625425A/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/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present disclosure relates to a data monitoring method, an apparatus, an electronic device, and a storage medium, for at least solving a problem in the related art that a developer cannot accurately acquire and locate an ANR problem due to a system framework in development of an operating system not providing an interface for monitoring the ANR problem, and finally the ANR problem cannot be restored and repaired, so that an application cannot smoothly run, the method includes: intercepting a termination signal when monitoring that a system service process sends the termination signal of an application; responding to the termination signal, creating an exception collecting thread, collecting exception information through the exception collecting thread, and writing the exception information into a user-defined log; and after the abnormal collection thread self-defined log is determined to be written in, forwarding the termination information to a system abnormal processing thread so that the system abnormal processing thread responds to the termination information to perform abnormal processing.

Description

Data monitoring method, device and system
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data monitoring method and apparatus, an electronic device, and a storage medium system.
Background
With the rapid development of terminal technology, various intelligent terminals applying the latest technology are developed, and in order to meet various use requirements of users, more and more Applications (APPs) related to life, entertainment and the like are developed, which greatly facilitates daily work and life of people, so that the intelligent terminals and the APPs installed on the intelligent terminals become important tools which are unavailable for daily work and life of people gradually.
The technical level, the testing depth, the adaptability to the terminal system and the like of an application developer are limited, the running stability of the application on the intelligent terminal is different, and for most applications, some potential inducing factors of internal errors exist more or less. Therefore, application developers often need to collect exception problems and repair applications based on the collected exception problems.
Taking the android system as an example, when a user's Application has a period of time with insufficient response sensitivity, the system displays a dialog box called an Application Not Responding (ANR) dialog box to the user. The user can choose to wait and let the program continue to run; or "forced shutdown" may be selected to stop the program from running, and the occurrence of the ANR problem greatly affects the smooth outflow degree of the running of the application program. A sophisticated application should avoid ANR problems as much as possible.
In order to eliminate the ANR problem of the program, a developer is often required to monitor the ANR problem occurring in the application to acquire information related to the ANR problem, and then the ANR problem that has occurred can be analyzed and processed according to the acquired information, so that the ANR problem is prevented from occurring again.
However, in the development of the existing android system, a system frame does not provide an interface for monitoring the ANR problem, so that a developer cannot accurately acquire and locate the ANR problem, and finally the ANR problem cannot be restored and repaired, and the use experience of a user is greatly applied.
Disclosure of Invention
The present disclosure provides a data monitoring method, an apparatus, an electronic device, and a storage medium, so as to at least solve a problem in the related art that a system framework in development of an operating system does not provide an interface for monitoring an ANR problem, so that a developer cannot accurately acquire and locate the ANR problem, and finally the ANR problem cannot be restored and repaired, thereby causing an application to run smoothly. The technical scheme of the disclosure is as follows:
intercepting a termination signal when monitoring that a system service process sends the termination signal of an application; responding to the termination signal, creating an exception collecting thread, collecting exception information through the exception collecting thread, and writing the exception information into a user-defined log; and after the abnormal collection thread self-defined log is determined to be written in, forwarding the termination information to a system abnormal processing thread so that the system abnormal processing thread responds to the termination information to perform abnormal processing.
According to a second aspect of the embodiments of the present disclosure, there is provided a data monitoring apparatus including:
the intercepting unit is configured to intercept a termination signal when monitoring that the system service process sends the termination signal;
the exception collecting unit is configured to respond to the termination signal, create an exception collecting thread, collect exception information through the exception collecting thread and write the exception information into a custom log;
and the forwarding unit is configured to forward the termination information to a system exception handling thread after the exception collecting thread self-defined log is determined to be written into the exception collecting thread, so that the system exception handling thread performs exception handling in response to the termination information.
According to a third aspect of the embodiments of the present disclosure, there is provided a data monitoring electronic device, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data monitoring method steps of any one of the above first aspects.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium including: the instructions in the storage medium, when executed by a processor of a data monitoring electronic device, enable the data monitoring electronic device to perform the data monitoring method steps of any one of the first aspects described above.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising:
when it is run on the device, it causes the item packaging device to perform: the data monitoring method steps of any one of the first aspect above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
by adopting the data monitoring method provided by the embodiment of the disclosure, when the system service process is monitored to send out an application termination signal, an application program can intercept the termination signal before a system exception handling thread through a main thread, an exception collection thread is created in response to the termination signal, and the exception collection thread collects exception information by calling a system function and writes the exception information into a custom log so as to finish the collection of application exception data; after the writing of the self-defined log of the exception collection thread is determined to be completed, the application main line can re-forward the termination information to the system exception handling thread so that the system exception handling thread performs exception handling in response to the termination information, and therefore, the exception data of the application can be collected under the condition that the terminal operating system is unaware, namely, interaction between the system collection log and a user cannot be influenced, and meanwhile, the exception data of the application (such as ANR problem data) can be accurately collected and positioned, so that an application developer can repair the application in time according to the collected exception data, and the use experience of the user is greatly 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 disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow diagram illustrating a method of data monitoring in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating an android SystemServer process handling ANR problems in accordance with an illustrative embodiment;
FIG. 3 is a block diagram illustrating an ANR problem popup in accordance with an exemplary embodiment;
FIG. 4 is a flow diagram illustrating a data monitoring method in accordance with an exemplary embodiment;
FIG. 5 is a block diagram illustrating a data monitoring device according to an exemplary embodiment;
FIG. 6 is a block diagram illustrating a data monitoring electronic device according to an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Technical solutions provided by embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
The embodiment of the disclosure provides a data monitoring method, which is used for at least solving the problem that in the related art, as a system framework in the development of an operating system does not provide an interface for monitoring an ANR problem, developers cannot accurately acquire and locate the ANR problem, and finally the ANR problem cannot be restored and repaired, so that an application cannot smoothly run.
The execution subject of the data monitoring method provided by the embodiment of the present disclosure may be, but is not limited to, at least one of a mobile phone, a tablet Computer, a Personal Computer (PC), a smart television, and any terminal device that can run an application. Alternatively, the execution subject of the method may be the application itself installed on the above-described apparatus.
For convenience of description, the data monitoring method provided by the embodiment of the disclosure is described below by taking the video APP as an example of the execution subject of the method. It is understood that the execution of the method by the video APP is only an exemplary illustration and should not be construed as a limitation to the embodiments of the present disclosure.
Fig. 1 is a flowchart illustrating a data monitoring method according to an exemplary embodiment, where the data monitoring method is used in a video APP as illustrated in fig. 1, and includes the following steps:
in step S101, when it is monitored that the system service process sends out an application termination signal, intercepting the termination signal;
when an application program is started, a corresponding process is created by a terminal operating system, and the process represents the running activity of the application for a certain data set. Meanwhile, a Thread is also run immediately in the process, the Thread is usually called a Main Thread (Main Thread) of the application, the Main Thread starts to execute when the application is started, and if a Thread needs to be created again later, the created Thread is a sub-Thread of the Main Thread, and each process has at least one Main Thread. The end of the main thread means the end of the whole process, and all other threads are exited. The characteristics of the main thread include: is a thread that spawns other child threads; control of the executive in the main thread; typically the main thread must eventually complete execution, performing various shutdown actions.
Generally, the detection behavior of the application program ANR problem is implemented by a terminal operating system, and a specific implementation flow is shown in fig. 2. When detecting that an ANR problem occurs during the operation of an APP process, a system service process (SystemServer process) of the android system sends a SIG QUIT signal (SIGQUIT signal, which is a program termination signal for notifying a foreground process group to terminate a process corresponding to a program) to a system _ server process, because a virtual machine performs a masking process on a thread of the application when running the application, the SIG QUIT signal can only be received by a processing thread SignalCacher specific to the operating system but cannot be received by other threads of the application, the SignalCacher thread starts to collect abnormal information in the APP process after receiving the SIGQUIT signal sent by the SystemServer process and records the abnormal information in a trace.txt file of the operating system, when the SystemServer process detects that the trace.txt file is completely written, an ANR dialog box shown in FIG. 3 is popped to a user, and when the user selects "force close" to the SystemServer process, the SystemServer process sends a SIGGILL signal for forcing the termination of the APP process to the APP process, and after the main thread of the APP receives the SIGKILL signal, the APP process is automatically stopped.
Therefore, due to the shielding processing of the virtual machine of the terminal operating system, the existing APP thread cannot acquire the SIG QUIT signal sent by the SystemServer process, the existing APP cannot directly sense the ANR problem, and further the ANR data cannot be collected in time.
Therefore, in order to solve the problem that the ANR data cannot be accurately collected in the related art, first, the application thread needs to receive the SIG QUIT signal sent by the SystemServer process. In the related art, in order to prevent the APP from monitoring the system signal, when creating an application thread, the operating system virtual machine sets the flag bits of all APP threads to a limit flag (block) so as to achieve the purpose of shielding the application thread from receiving the signal sent by the SystemServer process. In the embodiment of the present application, the application thread can be unmasked by modifying the flag bit of the application main thread.
Specifically, the APP program code may be modified, so that when the virtual machine runs to the modified code, the flag bit of the main thread created by the virtual machine may be modified, and the flag bit is modified from block to unblock, so that the application main thread may receive the SIGQUIT signal sent by the SystemServer process.
In an embodiment, a specific implementation manner of step S101 may include: when a system service process is monitored to send out a termination signal, modifying a restriction flag bit of a main thread created in advance for the application by the restriction flag bit to remove the restriction flag bit, so that the modified main thread can receive the termination signal; intercepting the termination signal by the modified main thread.
Through the above operation of step S101, the APP main thread may listen to the SystemServer process issuing the SIGQUIT signal and intercept the signal so that the signal is not temporarily received by the operating system specific processing thread SignalCatcher.
In step S102, the APP main thread creates an exception collecting thread in response to intercepting the termination signal by executing step S101, collects exception information by the exception collecting thread, and writes the exception information into a custom log;
after the APP main thread intercepts an SIGQUIT signal sent by a SystemServer process, the current APP can be determined to have an ANR problem, and then the APP main thread can create an exception collecting thread to collect ANR exception information from a line.
Specifically, in the present solution, the APP may collect the ANR exception information by using a Hook (Hook) mechanism and calling a function inside the virtual machine, and write the collected ANR exception information into a custom log of the APP, and then monitor the SIGQUIT signal at the APP by executing the method in step S102, where the executed operation is as shown in fig. 4.
In order to call an internal function of a virtual machine to collect exception information, in this embodiment of the present application, an address of an exception collecting function in the virtual machine needs to be determined first, and in an implementation manner, a specific implementation manner of step S102 may include: scanning the memory, and acquiring the initial address of the executable file of the virtual machine in the memory; determining the address of an abnormal collection function in the executable file of the virtual machine according to the initial address; and according to the address of the abnormal collection function, collecting abnormal information by calling the abnormal collection function.
In the operating system of the mobile terminal, each system library, including libart of the virtual machine, is an Executable and Linkable Format (ELF) file, the ELF file is a standard Format of a linux operating system Executable file, and Executable codes and data are stored in the ELF file. The ELF file is composed of four parts, namely, an ELF header (ELF header), a Program header table (Program header table), a Section (Section), and a Section header table (Section header). In the embodiment of the present application, the APP needs to find the addresses of the dynsym section and the symtab section in the libart.
In the Android operating system, each system library needs to be loaded (loaded) into a memory before being executed, and since the virtual machine runs in the process of the APP, and the APP has the right to read the memory of the APP, the APP can acquire the initial address (base address) of the virtual machine libart. In one embodiment, the initial address of libart.
Meanwhile, the APP can obtain the offset of each segment of the libart.so library in the memory by analyzing the ELF file, and then the APP can obtain the offset of the dynsym segment and the symtab segment in the memory according to the name, so that the address of the dynsym segment and the symtab segment in the libart.so library in the memory is determined by the starting address of the libart.so library in the memory.
In the embodiment of the present application, the address of the exception collecting function may be determined in the libart. Analyzing the executable file of the virtual machine, and determining the offset of the section in the memory, in which the function name and the parameter are stored, in the executable file of the virtual machine; and determining the address of an abnormal collection function in the executable file of the virtual machine according to the determined offset and the starting address.
It should be noted here that in the present solution, a function method with a stable interface in a virtual machine needs to be used as an exception collecting function, so as to avoid a problem that the APP cannot call the function due to a change of a terminal developer. The less the corresponding parameters of the function, the less the possibility that the function is altered, so that in the embodiment of the present application, the function with the least corresponding parameters can be determined as the anomaly collection function from the dynasym paragraph and the symtab paragraph.
In this embodiment, the following method may be specifically adopted to determine the address of the exception collecting function: determining the function with the least number of corresponding parameters as an abnormal collection function in the paragraph storing the function name and the parameters; determining the offset of the abnormal collection function in the memory according to the offset of the section in which the function name and the parameter are stored in the memory; and determining the address of the abnormal collection function in the executable file of the virtual machine according to the offset of the abnormal collection function in the memory and the initial address. For example, in one embodiment, a dumpforssigquit function with only one parameter may be determined as the anomaly collection function.
In addition, it should be noted here that, in order to ensure that the state of the virtual machine does not change when the exception collection thread collects exception data, adaptation is performed according to the version of the operating system, and a corresponding locking operation is further required when a hook function is performed.
By executing step S102, the APP collects exception information when an ANR problem occurs by calling a virtual machine exception collection function, and writes the exception information into an APP custom log.
In step S103, after it is determined that the writing of the exception collecting thread custom log is completed, the termination information is forwarded to a system exception handling thread, so that the system exception handling thread performs exception handling in response to the termination information.
In the process of executing step S102, the APP main thread monitors the state of the exception collection thread, and when it is determined that the exception collection thread completes writing the custom log, the main thread sends the intercepted SIGQUIT Signal to the operating system processing thread Signal Catcher, so that the Signal Catcher thread, in response to the Signal, writes relevant information of the ANR problem of this time, such as the state of the virtual machine, the ANR occurrence time, the ANR occurrence process, the stacks of all threads of the relevant processes, the CPU scheduling information, the lock relationship, and the like, into the trace file of the operating system, and the SystemServer process monitors that the writing of the trace file is completed, and pops the user to terminate the application, so that the application can complete the collection of the ANR exception data without sensing by the operating system.
It should be noted here that, after the user clicks a "force close" button in the ANR popup, the APP is killed, and when the APP is started again, the APP may upload a custom log that is written before and stores ANR exception data to the APP backend server, so that a system-insensitive and accurate ANR exception data monitoring process is completed.
Specifically, in an implementation manner, the method provided in the embodiment of the present application may further include: and uploading the custom log containing abnormal information to the application server after the application is determined to be restarted.
By adopting the data monitoring method provided by the embodiment of the disclosure, when the system service process is monitored to send out an application termination signal, an application program can intercept the termination signal before a system exception handling thread through a main thread, an exception collection thread is created in response to the termination signal, and the exception collection thread collects exception information by calling a system function and writes the exception information into a custom log so as to finish the collection of application exception data; after the writing of the self-defined log of the exception collection thread is determined to be completed, the application main line can re-forward the termination information to the system exception handling thread so that the system exception handling thread performs exception handling in response to the termination information, and therefore, the exception data of the application can be collected under the condition that the terminal operating system is unaware, namely, interaction between the system collection log and a user cannot be influenced, and meanwhile, the exception data of the application (such as ANR problem data) can be accurately collected and positioned, so that an application developer can repair the application in time according to the collected exception data, and the use experience of the user is greatly improved.
Fig. 5 is a block diagram of a data monitoring apparatus according to an exemplary embodiment, which is used to at least solve a problem in the related art that a system framework in development of an operating system does not provide an interface for monitoring an ANR problem, so that a developer cannot accurately acquire and locate the ANR problem, and finally the ANR problem cannot be restored and repaired, so that an application cannot smoothly run. Referring to fig. 5, the apparatus includes an interception unit 201, an exception collection unit 202, and a forwarding unit 203.
Wherein, the interception unit 201 is configured to intercept the termination signal when monitoring that the system service process sends out the application termination signal;
the exception collecting unit 202 is configured to execute creating an exception collecting thread in response to the termination signal, collecting exception information through the exception collecting thread, and writing the exception information into a custom log;
the forwarding unit 203 is configured to forward the termination information to a system exception handling thread after it is determined that the writing of the exception collecting thread self-defined log is completed, so that the system exception handling thread performs exception handling in response to the termination information.
In an embodiment, the intercepting unit 201 is specifically configured to perform: when a system service process is monitored to send out a termination signal, modifying a restriction flag bit of a main thread created in advance for the application by the restriction flag bit to remove the restriction flag bit, so that the modified main thread can receive the termination signal; intercepting the termination signal by the modified main thread.
In an embodiment, the exception collecting unit 202 is specifically configured to perform: scanning the memory, and acquiring the initial address of the executable file of the virtual machine in the memory; determining the address of an abnormal collection function in the executable file of the virtual machine according to the initial address; and according to the address of the abnormal collection function, collecting abnormal information by calling the abnormal collection function.
In an embodiment, the exception collecting unit 202 is specifically configured to perform: analyzing the executable file of the virtual machine, and determining the offset of the section in the memory, in which the function name and the parameter are stored, in the executable file of the virtual machine; and determining the address of an abnormal collection function in the executable file of the virtual machine according to the determined offset and the starting address.
In an embodiment, the exception collecting unit 202 is specifically configured to perform: determining the function with the least number of corresponding parameters as an abnormal collection function in the paragraph in which the function name and the parameters are stored; determining the offset of the abnormal collection function in the memory according to the offset of the section in which the function name and the parameter are stored in the memory; and determining the address of the abnormal collection function in the executable file of the virtual machine according to the offset of the abnormal collection function in the memory and the initial address.
In an embodiment, the system further includes a log uploading unit, specifically configured to perform: and uploading the custom log containing abnormal information to the application server after the application is determined to be restarted.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
By adopting the data monitoring device provided by the embodiment of the disclosure, when the system service process is monitored to send out an application termination signal, an application program can intercept the termination signal before a system exception handling thread through a main thread, an exception collection thread is created in response to the termination signal, and the exception collection thread collects exception information by calling a system function and writes the exception information into a custom log so as to finish the collection of application exception data; after the writing of the self-defined log of the exception collection thread is determined to be completed, the application main line can re-forward the termination information to the system exception handling thread so that the system exception handling thread performs exception handling in response to the termination information, and therefore, the exception data of the application can be collected under the condition that the terminal operating system is unaware, namely, interaction between the system collection log and a user cannot be influenced, and meanwhile, the exception data of the application (such as ANR problem data) can be accurately collected and positioned, so that an application developer can repair the application in time according to the collected exception data, and the use experience of the user is greatly improved.
Fig. 6 is a schematic structural diagram illustrating an electronic device 300 for data monitoring according to an exemplary embodiment. Referring to fig. 6, in the hardware level, the data monitoring electronic device includes a processor, and optionally an internal bus, a network interface, and a memory. The memory may include a memory, such as a Random-access memory (RAM), and may further include a non-volatile memory, such as at least 1 disk memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (peripheral component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the data monitoring device on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
intercepting a termination signal when monitoring that a system service process sends the termination signal of an application;
responding to the termination signal, creating an exception collecting thread, collecting exception information through the exception collecting thread, and writing the exception information into a user-defined log;
and after the abnormal collection thread self-defined log is determined to be written in, forwarding the termination information to a system abnormal processing thread so that the system abnormal processing thread responds to the termination information to perform abnormal processing.
The method performed by the data monitoring electronic device according to the embodiment of fig. 6 of the present disclosure may be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may also execute the method of fig. 1 and implement the functions of the data monitoring apparatus in the embodiment shown in fig. 1, which are not described herein again in the embodiments of the present disclosure.
Of course, besides the software implementation, the electronic device of the present disclosure does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution main body of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
In an exemplary embodiment, a storage medium comprising instructions, such as a memory comprising instructions, executable by the processor 320 of the electronic device 300 to perform the above-described method is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for monitoring data, comprising:
intercepting a termination signal when monitoring that a system service process sends the termination signal of an application;
responding to the termination signal, creating an exception collecting thread, collecting exception information through the exception collecting thread, and writing the exception information into a user-defined log;
and after the abnormal collection thread self-defined log is determined to be written in, forwarding the termination information to a system abnormal processing thread so that the system abnormal processing thread responds to the termination information to perform abnormal processing.
2. The data monitoring method according to claim 1, wherein intercepting a termination signal when it is monitored that a system service process sends out the termination signal specifically comprises:
when a system service process is monitored to send out a termination signal, modifying a restriction flag bit of a main thread created in advance for the application by the restriction flag bit to remove the restriction flag bit, so that the modified main thread can receive the termination signal;
intercepting the termination signal by the modified main thread.
3. The data monitoring method according to claim 1, wherein the collecting of the exception information by the exception collecting thread specifically includes:
scanning the memory, and acquiring the initial address of the executable file of the virtual machine in the memory;
determining the address of an abnormal collection function in the executable file of the virtual machine according to the initial address;
and according to the address of the abnormal collection function, collecting abnormal information by calling the abnormal collection function.
4. The data monitoring method according to claim 3, wherein determining an address of an exception collection function in the virtual machine executable file according to the start address specifically comprises:
analyzing the executable file of the virtual machine, and determining the offset of the section in the memory, in which the function name and the parameter are stored, in the executable file of the virtual machine;
and determining the address of an abnormal collection function in the executable file of the virtual machine according to the determined offset and the starting address.
5. The data monitoring method according to claim 4, wherein determining an address of an exception collection function in the virtual machine executable file according to the determined offset and the start address specifically comprises:
determining the function with the least number of corresponding parameters as an abnormal collection function in the paragraph in which the function name and the parameters are stored;
determining the offset of the abnormal collection function in the memory according to the offset of the section in which the function name and the parameter are stored in the memory;
and determining the address of the abnormal collection function in the executable file of the virtual machine according to the offset of the abnormal collection function in the memory and the initial address.
6. The data monitoring method of claim 1, further comprising:
and uploading the custom log containing abnormal information to the application server after the application is determined to be restarted.
7. A data monitoring device, comprising:
the intercepting unit is configured to intercept a termination signal when monitoring that the system service process sends the termination signal;
the exception collecting unit is configured to respond to the termination signal, create an exception collecting thread, collect exception information through the exception collecting thread and write the exception information into a custom log;
and the forwarding unit is configured to forward the termination information to a system exception handling thread after the exception collecting thread self-defined log is determined to be written into the exception collecting thread, so that the system exception handling thread performs exception handling in response to the termination information.
8. The data monitoring apparatus according to claim 7, wherein the intercepting unit is specifically configured to perform:
when a system service process is monitored to send out a termination signal, modifying a restriction flag bit of a main thread created in advance for the application by the restriction flag bit to remove the restriction flag bit, so that the modified main thread can receive the termination signal;
intercepting the termination signal by the modified main thread.
9. A data monitoring electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data monitoring method of any one of claims 1 to 6.
10. A storage medium having instructions that, when executed by a processor of a data monitoring electronic device, enable the data monitoring electronic device to perform the data monitoring processing method of any one of claims 1 to 6.
CN202010470125.6A 2020-05-28 2020-05-28 Data monitoring method, device and system Pending CN111625425A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010470125.6A CN111625425A (en) 2020-05-28 2020-05-28 Data monitoring method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010470125.6A CN111625425A (en) 2020-05-28 2020-05-28 Data monitoring method, device and system

Publications (1)

Publication Number Publication Date
CN111625425A true CN111625425A (en) 2020-09-04

Family

ID=72270016

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010470125.6A Pending CN111625425A (en) 2020-05-28 2020-05-28 Data monitoring method, device and system

Country Status (1)

Country Link
CN (1) CN111625425A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732475A (en) * 2021-01-13 2021-04-30 北京字节跳动网络技术有限公司 Log collection method and device, electronic equipment and storage medium
CN113064799A (en) * 2021-04-30 2021-07-02 网易传媒科技(北京)有限公司 Client monitoring method, device, system, medium and computing equipment
CN113703400A (en) * 2021-07-27 2021-11-26 中电科思仪科技股份有限公司 Equipment state monitoring system supporting remote coordination and state reporting method thereof
CN113867999A (en) * 2021-08-30 2021-12-31 荣耀终端有限公司 Application exception handling method, terminal and computer readable storage medium
CN117453513A (en) * 2023-12-21 2024-01-26 荣耀终端有限公司 Log acquisition method and related equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268055A (en) * 2014-09-01 2015-01-07 腾讯科技(深圳)有限公司 Program exception monitoring method and device
CN105446806A (en) * 2014-09-28 2016-03-30 广州市动景计算机科技有限公司 Processing method and apparatus for application not responding
US20160321453A1 (en) * 2013-12-30 2016-11-03 Beijing Qihoo Technology Company Limited Method and device for detecting malicious code in an intelligent terminal
CN108897533A (en) * 2018-06-06 2018-11-27 北京奇虎科技有限公司 A kind of method, apparatus and terminal of function call
CN110377341A (en) * 2019-06-10 2019-10-25 北京字节跳动网络技术有限公司 A kind of method, apparatus, medium and electronic equipment of the monitoring without response abnormality

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160321453A1 (en) * 2013-12-30 2016-11-03 Beijing Qihoo Technology Company Limited Method and device for detecting malicious code in an intelligent terminal
CN104268055A (en) * 2014-09-01 2015-01-07 腾讯科技(深圳)有限公司 Program exception monitoring method and device
CN105446806A (en) * 2014-09-28 2016-03-30 广州市动景计算机科技有限公司 Processing method and apparatus for application not responding
CN108897533A (en) * 2018-06-06 2018-11-27 北京奇虎科技有限公司 A kind of method, apparatus and terminal of function call
CN110377341A (en) * 2019-06-10 2019-10-25 北京字节跳动网络技术有限公司 A kind of method, apparatus, medium and electronic equipment of the monitoring without response abnormality

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732475A (en) * 2021-01-13 2021-04-30 北京字节跳动网络技术有限公司 Log collection method and device, electronic equipment and storage medium
CN113064799A (en) * 2021-04-30 2021-07-02 网易传媒科技(北京)有限公司 Client monitoring method, device, system, medium and computing equipment
CN113703400A (en) * 2021-07-27 2021-11-26 中电科思仪科技股份有限公司 Equipment state monitoring system supporting remote coordination and state reporting method thereof
CN113867999A (en) * 2021-08-30 2021-12-31 荣耀终端有限公司 Application exception handling method, terminal and computer readable storage medium
CN117453513A (en) * 2023-12-21 2024-01-26 荣耀终端有限公司 Log acquisition method and related equipment

Similar Documents

Publication Publication Date Title
CN111625425A (en) Data monitoring method, device and system
CN109284269B (en) Abnormal log analysis method and device, storage medium and server
US10838838B2 (en) Method and apparatus for dealing with abnormality of application program and storage medium
CN106844136B (en) Method and system for collecting program crash information
CN108197032B (en) Main thread jamming monitoring method, medium, equipment and system for IOS application
CN111708655A (en) Application crash processing method, device and system
WO2021218178A1 (en) Automatic report generation method, device, computer apparatus, and storage medium
US9256513B2 (en) Method, apparatus and computer readable medium for automatic debugging and error prevention
CN110879781B (en) Program debugging method, device, electronic equipment and computer readable storage medium
CN109144873B (en) Linux kernel processing method and device
CN110795311B (en) Event playback method and device
CN106775620B (en) Timing method and device
CN107515811B (en) Method and device for acquiring power consumption of application program
CN110688245B (en) Information acquisition method, device, storage medium and equipment
CN112241362A (en) Test method, test device, server and storage medium
US20230315620A1 (en) System and Method for Diagnosing a Computing Device in Safe Mode
CN109783261B (en) Crash processing method and device for terminal application, electronic equipment and storage medium
CN116860552A (en) Application program operation monitoring method and device, electronic equipment and storage medium
CN107391267B (en) Process detection method and device, electronic equipment and readable storage medium
CN115756934A (en) Application crash analysis method and device
CN115686899A (en) Terminal abnormity capture analysis method and device
CN114637685A (en) Performance test method, device, equipment and medium of application program in bank system
CN113590435A (en) Abnormal information display method and equipment
CN113900914A (en) Exception handling method and device, electronic equipment and computer storage medium
CN113742113A (en) Embedded system health management method, equipment 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