CN109086157B - Log tracking method and device, electronic equipment and storage medium - Google Patents

Log tracking method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109086157B
CN109086157B CN201810871673.2A CN201810871673A CN109086157B CN 109086157 B CN109086157 B CN 109086157B CN 201810871673 A CN201810871673 A CN 201810871673A CN 109086157 B CN109086157 B CN 109086157B
Authority
CN
China
Prior art keywords
log
configuration file
tracking
target
class
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.)
Active
Application number
CN201810871673.2A
Other languages
Chinese (zh)
Other versions
CN109086157A (en
Inventor
邓生金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN201810871673.2A priority Critical patent/CN109086157B/en
Publication of CN109086157A publication Critical patent/CN109086157A/en
Application granted granted Critical
Publication of CN109086157B publication Critical patent/CN109086157B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0766Error or fault reporting or storing
    • G06F11/0775Content or structure details of the error report, e.g. specific table structure, specific error fields
    • 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/0766Error or fault reporting or storing
    • G06F11/0781Error filtering or prioritizing based on a policy defined by the user or on a policy defined by a hardware/software module, e.g. according to a severity level
    • 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 present disclosure provides a log tracking method, apparatus, electronic device and storage medium, including: acquiring an original configuration file of a target class in an operating state; replacing the original configuration file with a preset target configuration file, wherein the target configuration file comprises a tracking mechanism, and the tracking mechanism is used for collecting the operation attribute of the target class; and generating a tracking log according to the operation attribute. According to the method and the device, the target configuration file replaces the original configuration file, the target configuration file generates the tracking log according to the operation attribute, the operation problem of the mobile application system can be accurately positioned, the workload of technical developers is reduced, the technical developers can timely find and solve the operation problem, and therefore the stability of the mobile application program in the android system and the experience of users on the mobile application program are improved.

Description

Log tracking method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer applications, and in particular, to a log tracking method and apparatus, an electronic device, and a storage medium.
Background
In internet development, particularly in mobile application development, serious problems of system fragmentation causing crash of the mobile application are often encountered, for example, the mobile application is forcibly closed by a system pop-up box. Or, even if the mobile application running well on the simulator is installed on the mobile phone of the user for use, the system crash problem exists due to the complex network environment, and the system stability of the mobile application is greatly influenced.
In the related technology, the mobile application program records log information when the android system runs normally, and if the android system runs abnormally, a technical developer can search and solve the current problems of the android system by analyzing the log information. However, the existing log information files have a large amount of useless log information, so that the workload of technical developers is increased, the running problem cannot be solved in time, the stability of the mobile application program in the android system is affected, and the experience of a user on the mobile program is affected.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a log tracking method, apparatus, electronic device and storage medium.
According to a first aspect of the embodiments of the present disclosure, there is provided a log tracking method, including:
acquiring an original configuration file of a target class in an operating state;
replacing the original configuration file with a preset target configuration file, wherein the target configuration file comprises a tracking mechanism, and the tracking mechanism is used for collecting the operation attribute of the target class;
and generating a tracking log according to the operation attribute.
Optionally, the original configuration file of the target class includes an activity management class, a test base class, a package management class, and a view root.
Optionally, the obtaining the original configuration file of the target class in the running state includes:
acquiring attribute information of an original configuration file of a target class;
acquiring a path of the original configuration file according to the attribute information;
and acquiring the original configuration file according to the path.
Optionally, replacing the original configuration file with a preset target configuration file includes:
acquiring components and code blocks in the target configuration file;
replacing the data packets respectively corresponding to the activity management class, the test base class and the packet management class with the components by adopting a Java reflection mechanism;
and injecting the code blocks into the view root graph, and changing the variables of the view root graph.
Optionally, generating a trace log according to the operation attribute includes:
creating a tracking log table;
scanning and reading the operation attribute of the target class;
and recording the operation attribute of the target class in the tracking log table to obtain the tracking log.
Optionally, after replacing the original configuration file with a preset target configuration file, the log tracking method further includes:
detecting whether the tracking log has general error reporting information or not in a preset troubleshooting information table;
if the tracking log has the common error reporting information, automatically repairing the common error reporting information;
and if the trace log does not have the common error reporting information, marking the trace log.
Optionally, after generating the trace log according to the operation attribute, the log tracing method further includes:
and sending the marked tracking log to an administrator terminal in a preset notification mode within a preset time.
According to a second aspect of the embodiments of the present disclosure, there is provided a log tracking apparatus, including:
the acquisition unit is configured to acquire an original configuration file of a target class in a running state;
the processing unit is configured to replace the original configuration file with a preset target configuration file, wherein the target configuration file comprises a tracking mechanism, and the tracking mechanism is used for collecting the operation attribute of the target class;
an execution unit configured to generate a trace log according to the run attribute.
Optionally, the original configuration file of the target class includes an activity management class, a test base class, a package management class, and a view root.
Optionally, the log tracking apparatus further comprises:
a first obtaining unit configured to obtain attribute information of an original configuration file of a target class;
a first processing unit configured to acquire a path of the original configuration file according to the attribute information;
a first execution unit configured to obtain the original configuration file according to the path.
Optionally, the log tracking apparatus further comprises:
a second obtaining unit configured to obtain the components and the code blocks in the target configuration file;
the second processing unit is configured to replace the data packages corresponding to the activity management class, the test base class and the package management class with the components by adopting a Java reflection mechanism;
and the second execution unit is configured to inject the code block into the root view and change the variable of the root view.
Optionally, the log tracking apparatus further comprises:
a creating unit configured to create a trace log table;
a scanning unit configured to scan and read the run attribute of the target class;
and the recording unit is configured to record the running attribute of the target class in the tracking log table to obtain the tracking log.
Optionally, the log tracking apparatus further comprises:
the detection unit is configured to detect whether the tracking log has general error reporting information in a preset troubleshooting information table;
a repairing unit configured to automatically repair the general error message if the trace log has the general error message;
a marking unit configured to mark the trace log if the trace log does not have the general error information.
Optionally, the log tracking apparatus further comprises:
a sending unit configured to send the marked tracking log to an administrator terminal in a preset notification manner within a preset time.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device comprising a processor; a memory for storing processor-executable instructions; wherein the processor is configured to the steps of the log tracking method described above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, wherein instructions, when executed by a processor of a mobile terminal, enable the mobile terminal to perform the steps of the log tracking method described above.
According to a fifth aspect of the embodiments disclosed herein, there is provided a computer program product comprising computer program code, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the steps of the log tracking method described above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: acquiring an original configuration file of a target class in an operating state; replacing the original configuration file with a preset target configuration file, wherein the target configuration file comprises a tracking mechanism, and the tracking mechanism is used for collecting the operation attribute of the target class; and generating a tracking log according to the operation attribute. According to the method and the device, the target configuration file replaces the original configuration file, so that the target configuration file generates the tracking log according to the operation attribute, the operation problem of the mobile application system can be accurately positioned, a system administrator can timely find and solve the operation problem, and the stability of the mobile application system and the experience of a user on the mobile application program are 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 application and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a method of log tracking according to an example embodiment.
FIG. 2 is a flow diagram illustrating one embodiment of obtaining an original configuration file, according to an example embodiment.
Fig. 3 is a flowchart illustrating an embodiment of replacing an original profile with a preset target profile according to an exemplary embodiment.
FIG. 4 is a flow diagram illustrating one embodiment of generating a trace log, according to an example embodiment.
FIG. 5 is a flow diagram illustrating one embodiment of processing a trace log, according to an example embodiment.
FIG. 6 is a block diagram illustrating a log tracking device according to an example embodiment.
Fig. 7 is a block diagram illustrating a mobile terminal according to an example embodiment.
FIG. 8 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. 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 log tracking methods consistent with certain aspects of the present disclosure, as recited in the claims below.
Fig. 1 is a flowchart illustrating a log tracking method according to an exemplary embodiment, where as shown in fig. 1, the log tracking method is used in a terminal and includes the following steps:
s100: and acquiring an original configuration file of the target class in a running state.
Specifically, under an operating environment of the android system, the server side of the mobile application obtains an original configuration file of a target class in the android system, wherein the original configuration file includes various components in the android system, such as an activity management class (activity manager service), a testing base class (instrumentation), a package management class (PackageManage), and a view root (viewrootim).
The obtained original configuration files are four important files in the android system, and functions of the original configuration files comprise communication, distribution, event transmission and the like, which have great significance for tracking the running problem of the android system, so that the original configuration files need to be obtained before the preset target configuration files are replaced.
S200: and replacing the original configuration file with a preset target configuration file, wherein the target configuration file comprises a tracking mechanism, and the tracking mechanism is used for collecting the operation attributes of the target class.
Specifically, the tracking mechanism includes an application signature mechanism, a permission declaration mechanism, an access control mechanism, a process communication mechanism, and a memory management mechanism, so that the tracking mechanism can track and collect the operation attributes of the target class.
The operation attribute of the target class comprises forced shutdown of the application program, no response of the application program, serious error exception, severe mode exception, low memory exception, no response of system service, network state exception, battery discharge exception, abnormal startup of the system, abnormal restart of the system, kernel error, system recovery layer exception or local process exception.
Wherein forced shutdown (ForceClose, also known as crash) of an application typically occurs when uncaptured exceptions occur in Java code; application unresponsiveness (ANR), which typically occurs when the main thread of an application fails to respond for a long time; gross error failure (WTF), a problem that is often found to be very serious at present; a critical mode exception (strictmodevision), which typically occurs when a network, file, is monitored that should not be executed in the main thread; memory exceptions (also known as lowmemory) typically occur when there is insufficient memory; the system service is unresponsive, which typically occurs when the watchdog monitors that the system service (system _ server) is unresponsive; network state anomalies (netstats _ error) typically occur when a significant network state error is encountered.
The server replaces the original configuration file with a preset target configuration file according to the path corresponding to the obtained original configuration file, so that the running state of the mobile application program in the android system can be tracked better and more accurately according to the target configuration file.
S300: and generating a tracking log according to the operation attribute.
The service end detects the running state of the target mobile application program in the android system, records the running attribute corresponding to the running state in a tracking log according to the running attribute tracked by the target configuration file, and the tracking log records the running problem encountered when the target mobile application program runs within a preset time period.
Acquiring an original configuration file of a target class in an operating state; replacing the original configuration file with a preset target configuration file, wherein the target configuration file comprises a tracking mechanism, and the tracking mechanism is used for collecting the operation attribute of the target class; and generating a tracking log according to the operation attribute. According to the method and the device, the target configuration file replaces the original configuration file, the target configuration file generates the tracking log according to the operation attribute, the operation problem of the mobile application system can be accurately positioned, the workload of technical developers is reduced, the technical developers can timely find and solve the operation problem, and therefore the stability of the mobile application program in the android system is improved.
In some embodiments, the original configuration file for the target class includes an activity management class, a test base class, a package management class, and a view root.
Specifically, the Activity management class is a tool used by the client to manage information of all active components (activities) running in the system, including tasks (tasks), memories (memories), services (services), and the like. A large number of get () methods are available in the activity management class, which can collect various information and provide the information to the application management system, and the application management system completes interaction and scheduling work; in an active component in the android system, all events need to be distributed through a middleware testing base class; in the query packet information of the android system, packet management classes are required to serve as intermediate distributors; the android system can involve the distribution of the view root in the process of UI drawing or event transmission, namely all displayed on the interface needs to pass through the view root.
Referring to fig. 2, fig. 2 is a flowchart illustrating an embodiment of obtaining an original configuration file according to the present embodiment. As shown in fig. 2, step S100 includes:
s101: and acquiring the attribute information of the original configuration file of the target class.
The attribute information of the original configuration file comprises a name of the configuration folder, access authority, the number of layers of the access directory and the like. Where access rights are mechanisms that restrict access to certain information items or certain controls based on the identity of the users and their membership in various predefined groups, are used by system administrators to control the access of users to network resources, such as servers, directories and files, and are typically implemented by granting users and groups rights to access particular objects.
S102: and acquiring the path of the original configuration file according to the attribute information.
And the server acquires the path of the original configuration file according to the folder name in the attribute information and the access target layer number, wherein the path is the storage path of the original configuration file.
S103: and acquiring an original configuration file according to the path.
The server side locates the position of the original configuration file according to the path; and opening various files on the original configuration file according to the access authority in the attribute information, and acquiring the original configuration files such as an activity management class, a test base class, a package management class, a view root and the like.
The method comprises the steps of obtaining attribute information of an original configuration file of a target class, obtaining a path of the original configuration file according to the attribute information, and obtaining the original configuration file according to the path, so that the original configuration file can be obtained more accurately, and preparation is made for replacing the original configuration file later.
Referring to fig. 3, fig. 3 is a flowchart illustrating an embodiment of replacing an original configuration file with a preset target configuration file according to the present embodiment. As shown in fig. 3, step S200 includes:
s201: the components and code blocks in the target configuration file are obtained.
The components and code blocks in the target configuration file are the configuration file improved according to the basic characteristics of the original configuration file, and the configuration file is responsible for monitoring and tracking running problems of the target mobile application program in the android system. The component comprises the attributes and methods of the preset class or object, and the code block comprises preset parameter values which are used for replacing variable values involved in the current running problem.
And the server side searches and acquires the components and the code blocks according to the storage path of the target configuration file.
Specifically, the storage path of the target configuration file is a preset path established in advance on the android system; and copying the improved target configuration file to a folder where the target configuration file of the preset path is located according to a preset file format. The preset file format comprises: for example, the target configuration file is converted into a document file JAR, an image file ISO or an executable file EXE, etc.
S202: and replacing the data packages corresponding to the activity management class, the test base class and the package management class by components by adopting a Java reflection mechanism.
The Java reflection mechanism is that in the running state, all attributes and methods corresponding to any class can be acquired; for any object, any method and attribute of the object can be called; this function of dynamically acquiring information and dynamically calling object methods is called the reflection mechanism of the Java language.
The data packet comprises the attribute of the class, the method of the class, the attribute of the object and the method of the object corresponding to the original configuration file.
The service side replaces the data packages corresponding to the activity management class, the test base class and the package management class by components through a Java reflection mechanism, namely, the method of the class, the attribute of the class, the method of the object or the attribute of the object in the original configuration file are modified.
S203: and injecting code blocks into the root graph, and changing variables of the root graph.
By injecting a code block into the view root, for example, the code block is an ID variable value for modifying the view root, and the problem that the view state is not saved or the view state is abnormally saved is prevented when the non-mobile application program exits by changing the ID variable value.
By adopting a Java reflection mechanism, the data packages corresponding to the activity management class, the test base class and the package management class are replaced by the components and the code blocks in the target configuration file, so that the original configuration file is replaced, and a basic condition is provided for tracking running problems.
Referring to fig. 4, fig. 4 is a flowchart illustrating an embodiment of generating a trace log according to the present embodiment. As shown in fig. 4, step S300 includes:
s301: a trace log table is created.
Specifically, the server tracks and detects functional behaviors in the android system in real time, when the server detects that a running problem of a target mobile application program occurs under the operation of the android system, for example, the mobile application program runs to cause forced quitting, immediately opens the target mobile application program after starting, responds slowly and even forcibly closes, or detects that multiple operation behaviors of a user cause the mobile application program to be in a stuck state, and the like, the server automatically generates a tracking log table according to the detected running problem. The field names on the trace log table include time, state, class name, type of the early warning tag, operation attribute, and the like.
S302: and scanning and reading the running attribute of the target class.
The server scans the running states of target classes such as an activity management class, a test base class, a package management class, a view root and the like; screening the operation attribute of the target class from the operation state; and the operation attribute of the target class is read, so that the normal operation state of the target class is prevented from being read, and the running problem is captured more effectively.
Specifically, the running attribute of the target class carries the early warning tag, so that the running attribute with the running problem characteristic can be conveniently screened out in the running state. Different types of operation attributes carry different early warning labels, so that the server classifies and summarizes the operation attributes according to the early warning labels. For example, a program in the operation attribute of the target class is forcibly closed and set as a first-level early warning tag, a system service non-response is set as a second-level early warning tag, and a local anomaly is set as a third-level early warning tag.
S303: and recording the operation attribute of the target class in a tracking log table to obtain a tracking log.
Reading running information such as operation attributes, states, corresponding time when the operation attributes are generated, classes corresponding to the operation attributes and the like which are classified and summarized; and automatically writing running information according to the field name of the tracking log table, and finally obtaining the tracking log of the target mobile application program.
The running attribute of the read target class is recorded in the created tracking log table, so that the running problem of the target mobile application program can be better fed back in the process of obtaining the tracking log, and the running problem can be better tracked.
Referring to fig. 5, fig. 5 is a flowchart illustrating an embodiment of processing a trace log according to the present embodiment. As shown in fig. 5, after performing step S200, the log tracking method further includes:
s210: and detecting whether the tracking log has general error reporting information in a preset troubleshooting information table.
Error reporting information is generally a description of frequently occurring rushing problems, and such rushing problems generally have solutions to automatic repair.
Specifically, the preset troubleshooting information table records general error information and a solution of the general error information.
S220: if the trace log has the common error information, the common error information is automatically repaired.
If the tracking log has the same operation attribute with the common error reporting information, calling a data packet corresponding to a solution according to the solution of the common error information recorded on the troubleshooting information table; and analyzing the program codes in the data packet to realize automatic repair of the general error information.
S230: if the trace log does not have the common error information, marking the trace log.
Specifically, the marking process may be to mark the operation attribute of the non-general error information, for example, the marking manner includes, but is not limited to, setting a special warning label, or marking the signal information to be processed.
If the tracking log is detected to have general error reporting information in the preset troubleshooting information table, the general error reporting information is automatically repaired, otherwise, the tracking log is marked, so that the problem of running away is solved more quickly, and the workload of technical developers is reduced.
After step S300 is executed, the log tracking method further includes: and sending the marked tracking log to an administrator terminal in a preset notification mode within a preset time.
Specifically, the preset time may be freely set, for example, a working time per day, or an hour, or the like; the preset notification mode includes, but is not limited to, mail, short message, or information notification of a management system.
The identified tracking log marked and processed is sent to the terminal of the administrator, so that instant feedback of the running problem of the target mobile application program is facilitated, the administrator can timely solve the running attribute on the tracking log, and the target application program is better maintained.
FIG. 6 is a block diagram illustrating a log tracking device according to an example embodiment. Referring to fig. 6, the log tracking apparatus includes an acquisition unit 110, a processing unit 120, and an execution unit 130. The obtaining unit 110 is configured to obtain an original configuration file of a target class in a running state; a processing unit 120 configured to replace the original configuration file with a preset target configuration file, wherein the target configuration file includes a tracking mechanism, and the tracking mechanism is used for collecting operation attributes of the target class; an execution unit 130 configured to generate a trace log according to the run attribute.
In some embodiments, the original configuration file for the target class includes an activity management class, a test base class, a package management class, and a view root.
In some embodiments, the log tracking device further includes a first obtaining unit, a first processing unit, and a first executing unit. The first obtaining unit is configured to obtain attribute information of an original configuration file of a target class; a first processing unit configured to acquire a path of an original configuration file according to the attribute information; a first execution unit configured to obtain an original configuration file according to the path.
In some embodiments, the log tracking device further comprises a second obtaining unit, a second processing unit, and a second executing unit. The second acquisition unit is configured to acquire the components and the code blocks in the target configuration file; the second processing unit is configured to replace the data packages corresponding to the activity management class, the test base class and the package management class by components by adopting a Java reflection mechanism; and the second execution unit is configured to inject code blocks into the root graph and change the variable of the root graph.
In some embodiments, the log tracking device further comprises a creating unit, a scanning unit, and a recording unit. Wherein the creating unit is configured to create a trace log table; a scanning unit configured to scan and read the run attribute of the target class; and the recording unit is configured to record the operation attribute of the target class in the tracking log table to obtain the tracking log.
In some embodiments, the log tracking device further comprises: a detection unit, a repair unit and a marking unit. The detection unit is configured to detect whether the tracking log has general error reporting information in a preset troubleshooting information table; the repairing unit is configured to automatically repair the general error message if the trace log has the general error message; and the marking unit is configured to mark the trace log if the trace log has no general error information.
In some embodiments, the log tracking apparatus further includes a transmitting unit configured to transmit the marked tracking log to the administrator terminal in a preset notification manner within a preset time.
With regard to the log tracking apparatus in the above embodiments, the specific manner in which each unit performs the operation has been described in detail in the embodiments related to the method, and will not be described in detail here.
Fig. 7 is a block diagram illustrating a mobile terminal 700 for log tracking according to an example embodiment. For example, the mobile terminal 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
Referring to fig. 7, mobile terminal 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.
Processing component 702 generally controls overall operation of mobile terminal 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to perform all or part of the steps of the log tracking method 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 mobile terminal 700. Examples of such data include instructions for any application or log tracking method operating on mobile terminal 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 component 706 provides power to the various components of the mobile terminal 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 mobile terminal 700.
The multimedia component 708 includes a screen that provides an output interface between the mobile terminal 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 may include a Microphone (MIC) configured to receive external audio signals when the mobile terminal 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 component 714 includes one or more sensors for providing various aspects of state assessment for the mobile terminal 700. For example, sensor assembly 714 may detect an open/closed state of device 700, the relative positioning of components, such as a display and keypad of mobile terminal 700, sensor assembly 714 may also detect a change in the position of mobile terminal 700 or a component of mobile terminal 700, the presence or absence of user contact with mobile terminal 700, orientation or acceleration/deceleration of mobile terminal 700, and a change in the temperature of mobile terminal 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 communications between the mobile terminal 700 and other devices in a wired or wireless manner. The mobile terminal 700 may access a wireless network based on a communication standard, such as WiFi, an operator network (e.g., 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 mobile terminal 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 log tracking method described above.
In an exemplary embodiment, a non-transitory computer readable storage medium including instructions, such as the memory 704 including instructions, executable by the processor 720 of the mobile terminal 700 to perform the log tracking method described above is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
FIG. 8 is a block diagram illustrating an electronic device 800 for log tracking according to an example embodiment. For example, the electronic device 800 may be provided as a server. Referring to fig. 8, electronic device 800 includes a processing component 822, which further includes one or more processors, and memory resources, represented by memory 832, for storing instructions, such as applications, that are executable by processing component 822. The application programs stored in memory 832 may include one or more modules that each correspond to a set of instructions. Further, the processing component 822 is configured to execute instructions to perform the log tracking method described above.
The electronic device 800 may also include a power component 826 configured to perform power management of the electronic device 800, a wired or wireless network interface 850 configured to connect the electronic device 800 to a network, and an input/output (I/O) interface 858. The electronic device 800 may operate based on an operating system stored in the memory 832, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
A computer program product comprising computer program code, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the log tracking method described above.
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 (12)

1. A method for log tracking, comprising:
acquiring an original configuration file of a target class in an operating state; the original configuration file of the target class comprises an activity management class, a test base class, a package management class and a view root;
replacing the original configuration file with a preset target configuration file, wherein the target configuration file comprises a tracking mechanism, and the tracking mechanism is used for collecting the operation attribute of the target class;
generating a tracking log according to the operation attribute; the trace log is used for recording the crash problem encountered when the target mobile application program runs;
the replacing the original configuration file with a preset target configuration file comprises:
acquiring components and code blocks in the target configuration file;
replacing the data packets respectively corresponding to the activity management class, the test base class and the packet management class with the components by adopting a Java reflection mechanism;
and injecting the code block into the view root, and changing the variable of the view root.
2. The log tracking method as recited in claim 1, wherein the obtaining the original configuration file of the target class in the running state comprises:
acquiring attribute information of an original configuration file of a target class;
acquiring a path of the original configuration file according to the attribute information;
and acquiring the original configuration file according to the path.
3. The log tracking method of claim 1, wherein said generating a tracking log according to the run attribute comprises:
creating a tracking log table;
scanning and reading the operation attribute of the target class;
and recording the operation attribute of the target class in the tracking log table to obtain the tracking log.
4. The log tracking method as claimed in claim 3, wherein after replacing the original configuration file with a preset target configuration file, the log tracking method comprises:
detecting whether the tracking log has general error reporting information or not in a preset troubleshooting information table;
if the tracking log has the common error reporting information, automatically repairing the common error reporting information;
and if the trace log does not have the common error reporting information, marking the trace log.
5. The log tracking method of claim 4, wherein after generating the tracking log according to the run attribute, the log tracking method comprises:
and sending the marked tracking log to an administrator terminal in a preset notification mode within a preset time.
6. An apparatus for log tracking, comprising:
the acquisition unit is configured to acquire an original configuration file of a target class in a running state; the original configuration file of the target class comprises an activity management class, a test base class, a package management class and a view root;
the processing unit is configured to replace the original configuration file with a preset target configuration file, wherein the target configuration file comprises a tracking mechanism, and the tracking mechanism is used for collecting the operation attribute of the target class; the replacing the original configuration file with a preset target configuration file comprises: acquiring components and code blocks in the target configuration file; replacing the data packets respectively corresponding to the activity management class, the test base class and the packet management class with the components by adopting a Java reflection mechanism; injecting the code block into the view root, and changing the variable of the view root;
an execution unit configured to generate a trace log according to the run attribute; the trace log is used to record crash problems encountered while the target mobile application is running.
7. The log tracking device of claim 6, further comprising:
a first obtaining unit configured to obtain attribute information of an original configuration file of a target class;
a first processing unit configured to acquire a path of the original configuration file according to the attribute information;
a first execution unit configured to obtain the original configuration file according to the path.
8. The log tracking device of claim 6, further comprising:
a creating unit configured to create a trace log table;
a scanning unit configured to scan and read the run attribute of the target class;
and the recording unit is configured to record the running attribute of the target class in the tracking log table to obtain the tracking log.
9. The log tracking device of claim 8, further comprising:
the detection unit is configured to detect whether the tracking log has general error reporting information in a preset troubleshooting information table;
a repairing unit configured to automatically repair the general error message if the trace log has the general error message;
a marking unit configured to mark the trace log if the trace log does not have the general error information.
10. The log tracking device of claim 9, further comprising:
a sending unit configured to send the marked tracking log to an administrator terminal in a preset notification manner within a preset time.
11. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the steps of the log tracking method according to any of claims 1 to 5.
12. A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a mobile terminal, enable the mobile terminal to perform the log tracking method of any of claims 1 to 5.
CN201810871673.2A 2018-08-02 2018-08-02 Log tracking method and device, electronic equipment and storage medium Active CN109086157B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810871673.2A CN109086157B (en) 2018-08-02 2018-08-02 Log tracking method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810871673.2A CN109086157B (en) 2018-08-02 2018-08-02 Log tracking method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109086157A CN109086157A (en) 2018-12-25
CN109086157B true CN109086157B (en) 2022-03-25

Family

ID=64833372

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810871673.2A Active CN109086157B (en) 2018-08-02 2018-08-02 Log tracking method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109086157B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111352760B (en) * 2020-02-27 2023-06-13 深圳市腾讯网域计算机网络有限公司 Data processing method and related device
CN111782522B (en) * 2020-06-29 2023-10-24 哲库科技(北京)有限公司 Tracking message output method, electronic device and storage medium
CN116701134A (en) * 2022-10-14 2023-09-05 荣耀终端有限公司 Data processing method and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103123601A (en) * 2011-11-17 2013-05-29 北京神州泰岳软件股份有限公司 Software development troubleshooting method and device based on Symbian system
CN104239054A (en) * 2014-09-12 2014-12-24 广州市久邦数码科技有限公司 Android-system-based plug-in loading method and system
CN106897609A (en) * 2015-12-17 2017-06-27 北京奇虎科技有限公司 The method and device that a kind of application program to dynamic load is monitored
CN107577579A (en) * 2017-09-15 2018-01-12 通鼎互联信息股份有限公司 A kind of log recording method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114153702A (en) * 2015-04-03 2022-03-08 甲骨文国际公司 Method and system for implementing a log parser in a log analysis system
CN107491383A (en) * 2017-08-17 2017-12-19 杭州师范大学 Catching method, device and the mobile terminal of application crashes Operation Log

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103123601A (en) * 2011-11-17 2013-05-29 北京神州泰岳软件股份有限公司 Software development troubleshooting method and device based on Symbian system
CN104239054A (en) * 2014-09-12 2014-12-24 广州市久邦数码科技有限公司 Android-system-based plug-in loading method and system
CN106897609A (en) * 2015-12-17 2017-06-27 北京奇虎科技有限公司 The method and device that a kind of application program to dynamic load is monitored
CN107577579A (en) * 2017-09-15 2018-01-12 通鼎互联信息股份有限公司 A kind of log recording method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Android将程序崩溃信息保存到本地文件;huohu1007;《https://blog.csdn.net/huohu1007/article/details/51423206》;20160516;第1页至第13页 *

Also Published As

Publication number Publication date
CN109086157A (en) 2018-12-25

Similar Documents

Publication Publication Date Title
US10929266B1 (en) Real-time visual playback with synchronous textual analysis log display and event/time indexing
JP6396887B2 (en) System, method, apparatus, and non-transitory computer readable storage medium for providing mobile device support services
CN109086157B (en) Log tracking method and device, electronic equipment and storage medium
EP3168747B1 (en) Method and device for monitoring a file in a system partition
CN106406956B (en) Application program installation method and device
CN116069612A (en) Abnormality positioning method and device and electronic equipment
CN107609402B (en) Security vulnerability processing method and device and storage medium
CN112256563A (en) Android application stability testing method and device, electronic equipment and storage medium
CN109783261B (en) Crash processing method and device for terminal application, electronic equipment and storage medium
JP5828457B2 (en) API execution control device and program
CN115509872A (en) Client behavior data acquisition method and device
CN115408277A (en) Interface testing method and device
CN111831292A (en) Method and device for generating installation package, storage medium and electronic equipment
CN111736890A (en) Data updating method and device, electronic equipment and storage medium
CN111984532A (en) Applet-based exception handling method and device
CN112306566A (en) Data processing method and device
CN111782508A (en) Automatic test method, device, electronic equipment and storage medium
CN111611470A (en) Data processing method and device and electronic equipment
CN112363917B (en) Application program debugging exception processing method and device, electronic equipment and medium
CN112527651A (en) Display method and device for installation package size, electronic equipment and storage medium
US20230171166A1 (en) Endpoint-level sla evaluation in managed networks
CN116662101B (en) Fault restoration method of electronic equipment and electronic equipment
CN117520023A (en) Screen shot acquisition method, screen shot acquisition device and storage medium
CN114281581A (en) Data display method and device, electronic equipment and storage medium
CN113986648A (en) Method and device for executing application program, electronic 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
GR01 Patent grant
GR01 Patent grant