CN113535579A - Abnormity positioning method and related device - Google Patents

Abnormity positioning method and related device Download PDF

Info

Publication number
CN113535579A
CN113535579A CN202110858500.9A CN202110858500A CN113535579A CN 113535579 A CN113535579 A CN 113535579A CN 202110858500 A CN202110858500 A CN 202110858500A CN 113535579 A CN113535579 A CN 113535579A
Authority
CN
China
Prior art keywords
log
information
target
determining
source code
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
CN202110858500.9A
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.)
Spreadtrum Semiconductor Chengdu Co Ltd
Original Assignee
Spreadtrum Semiconductor Chengdu 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 Spreadtrum Semiconductor Chengdu Co Ltd filed Critical Spreadtrum Semiconductor Chengdu Co Ltd
Priority to CN202110858500.9A priority Critical patent/CN113535579A/en
Publication of CN113535579A publication Critical patent/CN113535579A/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/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Landscapes

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

Abstract

The application discloses an anomaly positioning and related device, wherein the method comprises the following steps: determining that the system has an abnormal event according to the Log file Log; determining a target Log segment corresponding to a time point of an abnormal event; determining a target source code segment corresponding to the target Log segment; and outputting the target source code segment. By the method, the working difficulty and the working load of maintainers can be effectively reduced, and the application and maintenance efficiency is improved.

Description

Abnormity positioning method and related device
Technical Field
The present application relates to the field of computer technologies, and in particular, to an anomaly locating method and a related apparatus.
Background
Once an error occurs in the runtime of an Android (Android) system application, a maintenance person is required to call out a running log. In order to find out log files which possibly cause errors, maintenance personnel are required to acquire check points corresponding to the black box logs according to the problems possibly related to the errors, and then find out the corresponding log files; then, the maintainer needs to analyze the log file to repair the Android system causing the error.
Therefore, the process can greatly increase the working difficulty and workload of maintenance personnel, and the efficiency of application and maintenance is low.
Disclosure of Invention
The application discloses an abnormity positioning method and a related device, which can effectively reduce the working difficulty and workload of maintainers and improve the efficiency of application maintenance.
In a first aspect, an embodiment of the present application provides an anomaly positioning method, including:
determining that the system has an abnormal event according to the Log file Log;
determining a target Log segment corresponding to a time point of an abnormal event;
determining a target source code segment corresponding to the target Log segment;
and outputting the target source code segment.
In one embodiment, a Log is characterized to obtain Log characteristic information, wherein the Log characteristic information is used for indicating logic architecture information of the Log; and determining that the system has an abnormal event according to the logic architecture information of the Log.
In one embodiment, target time information is obtained, and the target time information is used for indicating the time point of the system when an abnormal event occurs; determining an application program with an abnormal event; and determining a target Log segment corresponding to the time point of the abnormal event according to the target time information and the application program.
In one embodiment, the target time information is determined according to a lifecycle function corresponding to the application; alternatively, the target time information is determined according to a point of time at which the application is abnormally shut down by the system.
In an embodiment, after determining the target source code segment corresponding to the time point of the exception, the method further includes: determining abnormal information corresponding to the target source code segment; determining the type of the abnormal information corresponding to the abnormal information; and outputting repair suggestion information according to the abnormal information type.
In one embodiment, if there is repair information with matching exception information types, the target source code segment is repaired according to the repair information.
In a second aspect, an embodiment of the present application provides an anomaly locating device, including:
the processing unit is used for determining the system abnormal event according to the Log file Log;
the processing unit is also used for determining a target Log segment corresponding to a time point of an abnormal event;
the processing unit is further configured to determine a target source code segment corresponding to the target Log segment;
and the output unit is used for outputting the target source code segment.
In a third aspect, an embodiment of the present application further provides a terminal device, including a processor and a memory, where the memory is used to store a computer program, and the computer program includes program instructions, and the processor is configured to invoke the program instructions to execute the abnormality positioning method described in the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing one or more instructions adapted to be loaded by a processor and execute the anomaly locating method described in the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip is configured to perform the anomaly locating method described in the first aspect.
In a sixth aspect, an embodiment of the present application provides a chip module, where the chip module includes a storage device, a chip, and a communication interface, and the chip is configured to execute the anomaly positioning method described in the first aspect.
In the embodiment of the application, the system is determined to have an abnormal event according to the Log file Log; determining a target Log segment corresponding to a time point of an abnormal event; determining a target source code segment corresponding to the target Log segment; and outputting the target source code segment. By the method, the working difficulty and the working load of maintainers can be effectively reduced, and the application and maintenance efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a hardware structure of a mobile terminal according to an embodiment of the present disclosure;
fig. 2 is a communication network system architecture diagram according to an embodiment of the present application;
fig. 3 is a schematic flowchart of an anomaly locating method according to an embodiment of the present application;
fig. 4 is a schematic diagram of a unit of an anomaly locating device according to an embodiment of the present application;
fig. 5 is a simplified schematic diagram of an entity structure of a terminal device according to an embodiment of the present application;
fig. 6 is a simplified schematic diagram of a chip module according to an embodiment of the present disclosure.
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 embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the recitation of an element by the phrase "comprising an … …" does not exclude the presence of additional like elements in the process, method, article, or apparatus that comprises the element, and further, where similarly-named elements, features, or elements in different embodiments of the disclosure may have the same meaning, or may have different meanings, that particular meaning should be determined by their interpretation in the embodiment or further by context with the embodiment.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context. Also, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes" and/or "including," when used in this specification, specify the presence of stated features, steps, operations, elements, components, items, species, and/or groups, but do not preclude the presence, or addition of one or more other features, steps, operations, elements, components, species, and/or groups thereof. The terms "or" and/or "as used herein are to be construed as inclusive or meaning any one or any combination. Thus, "A, B or C" or "A, B and/or C" means "any of the following: a; b; c; a and B; a and C; b and C; A. b and C ". An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some way.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, in different orders, and may be performed alternately or at least partially with respect to other steps or sub-steps of other steps.
It should be noted that, step numbers such as 110, 120, etc. are used herein for the purpose of more clearly and briefly describing the corresponding content, and do not constitute a substantial limitation on the sequence, and those skilled in the art may perform 120 first and then perform 110, etc. in the specific implementation, but these should be within the protection scope of the present application.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for the convenience of description of the present application, and have no specific meaning by themselves. Thus, "module", "component" or "unit" may be used mixedly.
In order to better understand the embodiments of the present application, the following terms refer to the embodiments of the present application:
a Log file (Log) refers to a collection of certain operations of objects specified by the system and their results in time order. The log file is a log file, records interactive information between a system and a user of the system, and is a data collection method for automatically capturing the interactive type, content or time between a person and a system terminal; for web searches, a log is an electronic record of a user searching for information using a web search engine interacting with the web search engine during the search for information. Most log files can be used for seeing their roles from file names, such as uninstantall log, which is usually a record generated during the installation of software and is provided for an uninstaller to use in the future, or error log, which is usually used for recording some error information during the operation of software.
Life cycle function: the process from creation to destruction of an Object (Object). From creation to destruction of an object, a series of executive functions are passed through, and events can be added to each time point in the functions to form a life cycle function of the object.
The apparatus herein may be applied to a terminal device, which may be implemented in various forms. For example, the terminal devices described in the present application may include mobile terminals such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and fixed terminals such as a Digital TV, a desktop computer, and the like.
The following description will be given taking a mobile terminal as an example, and it will be understood by those skilled in the art that the configuration according to the embodiment of the present application can be applied to a fixed type terminal in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present application, the mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a mobile hot spot (WiFi) module 102, an Audio output unit 103, an Audio/Video (a/V) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access 2000(Code Division Multiple Access 2000, CDMA2000), Wideband Code Division Multiple Access (WCDMA), Time Division-Synchronous Code Division Multiple Access (TD-SCDMA), Frequency Division duplex Long Term Evolution (FDD-LTE), and Time Division duplex Long Term Evolution (TDD-LTE), etc.
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio Input/Output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present application, a communication network system on which the mobile terminal of the present application is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present disclosure, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes User Equipment (UE) 201, Evolved UMTS Terrestrial Radio Access Network (E-UTRAN) 202, Evolved Packet Core Network (EPC) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include a Mobility Management Entity (MME) 2031, a Home Subscriber Server (HSS) 2032, other MMEs 2033, a Serving Gateway (SGW) 2034, a packet data network gateway (PDN Gate Way, PGW)2035, and a Policy and Charging Rules Function (PCRF) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IP Multimedia Subsystem (IMS) or other IP services, and the like.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present application is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, 4G, 5G, and future new network systems, and the like.
Based on the above mobile terminal hardware structure and communication network system, various embodiments of the present application are provided.
In order to effectively reduce the work difficulty and workload of maintenance personnel and improve the efficiency of application maintenance, embodiments of the present application provide an anomaly positioning method and apparatus, and the anomaly positioning method and apparatus provided by the embodiments of the present application are further described in detail below.
Referring to fig. 3, fig. 3 is a schematic flow chart of an anomaly locating method according to an embodiment of the present application. The method for locating the abnormality includes operations 310 through 340 as follows. The method execution subject shown in fig. 3 may be a terminal device or a chip in the terminal device. The system installed by the terminal device in the embodiment of the application may be an android system, or may be another system, which is not limited. When the terminal device executes the flow shown in fig. 3, the following steps may be included:
310. and determining that the system has an abnormal event according to the Log file Log.
Specifically, the terminal device may characterize the Log to obtain Log feature information. The Log feature information may indicate logical architecture information of the Log. The terminal device can judge whether an abnormal event occurs in the system according to the logic architecture information of the Log. If the logic architecture information has an exception, it can be determined that an exception event occurs in the system. The abnormal event may be a system Crash (blast) causing the application to stop running.
It should be noted that, the Log in the embodiment of the present application may be specific to the system of the terminal device, and when the system runs an application program, the terminal device may record the running condition recorded in each time period when the system runs the application program.
320. And determining a target Log segment corresponding to the time point of the abnormal event.
Specifically, the terminal device may first obtain target time information, which may indicate a time point at which an abnormal event occurs in the system. The terminal device can locate the position where Crash appears in the Log through the regular expression, and the position can also be understood as a time point. The terminal device can determine the Log segment 1 second before the Crash time point as the target Log segment.
Optionally, the target time information may be determined according to a lifecycle function corresponding to the application program. The terminal device may record the life cycle function of each application program, the time when the life cycle function of the application program stops running, or the time when the life cycle function of the application program normally runs. The condition that the life cycle function is abnormal can be that the life cycle function stops running. For an abnormal application program, the terminal device may record a time point when the lifecycle function of the application program is abnormal, and determine the target time information according to the time point. Thus, the target time information may indicate that the time point at which the system occurred the exception event is the time point at which the lifecycle function of the application program became abnormal.
Optionally, the terminal device may further determine a time point at which each application is abnormally shut down (Kill) by the system, and determine the time point as a target time point. That is, the terminal device may not determine the target time information by the lifecycle function of the application, but may determine the target time information by recording a point in time at which the application is abnormally shut down by the system. Thus, the target time information may indicate that the point in time at which the system has occurred to the exception event is the point in time at which the application was shut down by the system exception.
After the target time information is acquired, the terminal device can determine the application program with the abnormal event according to the target time information. And then, determining a target Log segment corresponding to the time point of the abnormal event according to the application program. The target Log segment is of the Log, that is, the target Log segment is a part of Log information of the Log in which an abnormal event occurs with the application program.
330. And determining a target source code segment corresponding to the target Log segment.
According to the target Log segment, the terminal device can determine a target source code segment corresponding to the target Log segment. The terminal equipment can distinguish whether the application program is a third-party application or a system application, and then the target source code segment is determined by combining the source code system. That is to say, when the system of the terminal device executes the source code of one or more application programs, an abnormal event may occur, that is, an abnormality occurs in a certain source code segment of a certain application program, and the terminal device may determine the abnormal source code segment according to the determined target Log segment.
Optionally, after the terminal device determines the target source code segment, it may also determine abnormal information corresponding to the target original segment, and determine an abnormal information type corresponding to the abnormal information. The Exception information type may be a Null Pointer Exception (NPE), an array Out of bound (Out of Boundary), or the like.
Optionally, for common abnormal information types, the abnormal information types have obvious expression forms and relatively fixed formats, so that the terminal device can output repair suggestion information related to the abnormal information types according to the abnormal information types, and the repair suggestion information can be used for developers to modify target source code segments, which is beneficial to improving the modification efficiency of the developers.
Optionally, there may be repair information matching the type of the abnormal information, and if there is, the terminal device may repair the target source code segment according to the repair information. It should be noted that the terminal device may automatically repair the target source code segment according to the repair information, but the repair is not completely autonomous, and the modification of the target source code segment finally needs to be confirmed by a developer.
340. And outputting the target source code segment.
The terminal device may output the target source code segment, for example, the target source code segment may be output in development software; or in the development software, the target source chip segment is located in the complete source code. The output here may refer to output to a display module for a developer to read, or may be output in a voice manner, and the output manner is not limited in the embodiments of the present application. In this way, the developer can analyze and repair the target source code segment. After the developer finishes repairing the target source code segment, the terminal device can end the process of abnormal positioning.
In the embodiment of the application, the terminal device can determine that the system generates an abnormal event according to the Log, and determine the target Log segment corresponding to the time point of the abnormal event, so as to determine the target source code segment. Therefore, the target source code segment of the application program with the abnormal event is positioned from the system with the abnormal event, and the terminal equipment can output the target source code segment so that developers can analyze the target source code segment. And the terminal equipment can also output the abnormal information type corresponding to the target source code segment and output different repair suggestion information according to different abnormal information types. By the method, the working difficulty and the working load of maintainers can be effectively reduced, and the application and maintenance efficiency is improved.
Referring to fig. 4, fig. 4 is a schematic unit diagram of an anomaly locating device according to an embodiment of the present disclosure. The anomaly locating device shown in FIG. 4 may be used to perform some or all of the functions described above for the embodiment of the method described in FIG. 3. The device may be a terminal device, or a device in the terminal device, or a device capable of being used in cooperation with the terminal device.
The logical structure of the apparatus may include: a processing unit 410, an output unit 420 and an obtaining unit 430, wherein, when the apparatus is applied to a second network element:
the processing unit 410 is used for determining that an abnormal event occurs in the system according to the Log file Log;
the processing unit 410 is further configured to determine a target Log segment corresponding to a time point when the abnormal event occurs;
the processing unit 410 is further configured to determine a target source code segment corresponding to the target Log segment;
and an output unit 420, configured to output the target source code segment.
In a possible implementation manner, the processing unit 410 is further configured to characterize the Log to obtain Log feature information, where the Log feature information is used to indicate logic architecture information of the Log; and determining that the system has an abnormal event according to the logic architecture information of the Log.
In an embodiment, the obtaining unit 430 is configured to obtain target time information, where the target time information is used to indicate a time point when an abnormal event occurs in the system; determining an application program with an abnormal event; and determining a target Log segment corresponding to the time point of the abnormal event according to the target time information and the application program.
In one embodiment, the target time information is determined according to a lifecycle function corresponding to the application; alternatively, the target time information is determined according to a point of time at which the application is abnormally shut down by the system.
In an embodiment, the processing unit 410 is further configured to determine that the application program is after the target source code segment corresponding to the time point of the exception, and the method further includes: determining abnormal information corresponding to the target source code segment; determining the type of the abnormal information corresponding to the abnormal information; and outputting repair suggestion information according to the abnormal information type.
In an embodiment, if there is repair information with matching exception information types, the processing unit 410 is further configured to repair the target source code segment according to the repair information.
Referring to fig. 5, fig. 5 is a simplified schematic diagram of a physical structure of a terminal device according to an embodiment of the present disclosure, where the terminal device includes a processor 510, a memory 520, and a communication interface 530, and the processor 510, the memory 520, and the communication interface 530 are connected by one or more communication buses. The communication device may be a chip, a chip module, or the like.
The processor 510 is configured to support the terminal device to perform the corresponding functions of the method in 3. It should be understood that, in the embodiment of the present application, the processor 510 may be a Central Processing Unit (CPU), and the processor may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 520 is used to store program codes and the like. The memory 520 in embodiments of the present application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, but not limitation, many forms of Random Access Memory (RAM) are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct bus RAM (DR RAM).
Communication interface 530 is used to transmit and receive data, information, messages, etc., and may also be described as a transceiver, transceiving circuitry, etc.
In the embodiment of the present application, the processor 510 calls the program code stored in the memory 520 to perform the following operations:
the processor 510 calls the program code stored in the memory 520 to determine that an abnormal event occurs in the system according to the Log file Log;
processor 510 invokes program code stored in memory 520 to determine a target Log segment corresponding to a time point at which an exception event occurs;
processor 510 invokes program code stored in memory 520 to determine a target source code segment corresponding to the target Log segment;
the control communication interface 530 outputs the target source code segment.
In one possible implementation, processor 510 invokes program code stored in memory 520 to characterize the Log, obtaining Log feature information, where the Log feature information is used to indicate logical architecture information of the Log; and determining that the system has an abnormal event according to the logic architecture information of the Log.
In one embodiment, processor 510 calls program code stored in memory 520 to obtain target time information, where the target time information is used to indicate a time point when an exception event occurs in the system; determining an application program with an abnormal event; and determining a target Log segment corresponding to the time point of the abnormal event according to the target time information and the application program.
In one embodiment, the target time information is determined according to a lifecycle function corresponding to the application; alternatively, the target time information is determined according to a point of time at which the application is abnormally shut down by the system.
In one embodiment, after the processor 510 calls the program code stored in the memory 520 to determine the target source code segment corresponding to the time point of the exception, the method further includes: determining abnormal information corresponding to the target source code segment; determining the type of the abnormal information corresponding to the abnormal information; and outputting repair suggestion information according to the abnormal information type.
In one embodiment, if there is repair information of the exception information type matching, the processor 510 calls the program code stored in the memory 520 to repair the target source code segment according to the repair information.
The embodiment of the application also provides a chip, and the chip can also be contained in the chip module.
When the chip is applied to the terminal device:
the chip is used for determining the system abnormal event according to the Log file Log;
the chip is also used for determining a target Log segment corresponding to a time point of an abnormal event;
the chip is also used for determining a target source code segment corresponding to the target Log segment;
the chip is also used for controlling the communication interface to output the target source code segment.
In a possible implementation manner, the chip is further configured to characterize the Log to obtain Log feature information, where the Log feature information is used to indicate logic architecture information of the Log; and determining that the system has an abnormal event according to the logic architecture information of the Log.
In one embodiment, the chip is further configured to obtain target time information, where the target time information is used to indicate a time point when an abnormal event occurs in the system; determining an application program with an abnormal event; and determining a target Log segment corresponding to the time point of the abnormal event according to the target time information and the application program.
In one embodiment, the target time information is determined according to a lifecycle function corresponding to the application; alternatively, the target time information is determined according to a point of time at which the application is abnormally shut down by the system.
In an embodiment, the chip is further configured to determine, after the target source code segment corresponding to the time point when the exception occurs, the method further includes: determining abnormal information corresponding to the target source code segment; determining the type of the abnormal information corresponding to the abnormal information; and outputting repair suggestion information according to the abnormal information type.
In an embodiment, if there is repair information whose type of the abnormal information matches, the chip is further configured to repair the target source code segment according to the repair information.
Referring to fig. 6, fig. 6 is a simplified schematic diagram of a chip module according to an embodiment of the present application, where the chip module includes a storage device 610, a chip 620, and a communication interface 630, and when the chip module is applied to a second network element, where:
the chip 620 is used for determining the system abnormal event according to the Log file Log;
the chip 620 is further configured to determine a target Log segment corresponding to a time point of occurrence of an abnormal event;
the chip 620 is further configured to determine a target source code segment corresponding to the target Log segment;
the chip 620 is further configured to control the communication interface 630 to output the target source code segment.
In a possible implementation manner, the chip 620 is further configured to characterize the Log to obtain Log feature information, where the Log feature information is used to indicate logic architecture information of the Log; and determining that the system has an abnormal event according to the logic architecture information of the Log.
In one embodiment, the chip 620 is further configured to obtain target time information, where the target time information is used to indicate a time point when an abnormal event occurs in the system; determining an application program with an abnormal event; and determining a target Log segment corresponding to the time point of the abnormal event according to the target time information and the application program.
In one embodiment, the target time information is determined according to a lifecycle function corresponding to the application; alternatively, the target time information is determined according to a point of time at which the application is abnormally shut down by the system.
In an embodiment, the chip 620 is further configured to determine, after the target source code segment corresponding to the time point when the exception occurs, the method further includes: determining abnormal information corresponding to the target source code segment; determining the type of the abnormal information corresponding to the abnormal information; and outputting repair suggestion information according to the abnormal information type.
In an embodiment, if there is repair information with matching exception information types, the chip 620 is further configured to repair the target source code segment according to the repair information.
It should be noted that, in the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to relevant descriptions of other embodiments for parts that are not described in detail in a certain embodiment.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs.
The units in the processing equipment of the embodiment of the invention can be merged, divided and deleted according to actual needs.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, memory Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (11)

1. A method for anomaly location, the method comprising:
determining that the system has an abnormal event according to the Log file Log;
determining a target Log segment corresponding to a time point of the abnormal event;
determining a target source code segment corresponding to the target Log segment;
and outputting the target source code segment.
2. The method according to claim 1, wherein the determining that the system has an abnormal event according to the Log file Log comprises:
characterizing the Log to obtain Log characteristic information, wherein the Log characteristic information is used for indicating logic architecture information of the Log;
and determining that the system has an abnormal event according to the logic architecture information of the Log.
3. The method according to claim 1 or 2, wherein the determining a target Log segment corresponding to a time point of occurrence of the abnormal event comprises:
acquiring target time information, wherein the target time information is used for indicating a time point of the system when the abnormal event occurs;
determining an application program in which the abnormal event occurs;
and determining the target Log segment corresponding to the time point of the abnormal event according to the application program.
4. The method according to any one of claims 1 to 3,
the target time information is determined according to a life cycle function corresponding to the application program; alternatively, the first and second electrodes may be,
the target time information is determined according to a point of time at which the application is abnormally shut down by the system.
5. The method according to any one of claims 1 to 4, wherein after determining the target source code segment corresponding to the time point of the application abnormality, the method further comprises:
determining abnormal information corresponding to the target source code segment;
determining the type of the abnormal information corresponding to the abnormal information;
and outputting repair suggestion information according to the abnormal information type.
6. The method of claim 5, further comprising:
and if the repair information matched with the abnormal information type exists, repairing the target source code segment according to the repair information.
7. An anomaly locating device, comprising:
the processing unit is used for determining the system abnormal event according to the Log file Log;
the processing unit is further configured to determine a target Log segment corresponding to a time point at which the abnormal event occurs;
the processing unit is further configured to determine a target source code segment corresponding to the target Log segment;
and the output unit is used for outputting the target source code segment.
8. A terminal device, comprising a processor, a memory for storing a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the anomaly localization method according to any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon one or more instructions adapted to be loaded by a processor and to perform the method of anomaly locating according to any one of claims 1 to 6.
10. A chip for performing the anomaly localization method according to any one of claims 1 to 6.
11. A chip module, characterized in that the chip module comprises a storage device, a chip and a communication interface, wherein the chip is used for executing the anomaly positioning method according to any one of claims 1 to 6.
CN202110858500.9A 2021-07-28 2021-07-28 Abnormity positioning method and related device Pending CN113535579A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110858500.9A CN113535579A (en) 2021-07-28 2021-07-28 Abnormity positioning method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110858500.9A CN113535579A (en) 2021-07-28 2021-07-28 Abnormity positioning method and related device

Publications (1)

Publication Number Publication Date
CN113535579A true CN113535579A (en) 2021-10-22

Family

ID=78089505

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110858500.9A Pending CN113535579A (en) 2021-07-28 2021-07-28 Abnormity positioning method and related device

Country Status (1)

Country Link
CN (1) CN113535579A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1994015309A1 (en) * 1992-12-21 1994-07-07 The Dow Chemical Company System and method for maintaining codes
CN104640138A (en) * 2013-11-13 2015-05-20 中国移动通信集团广东有限公司 Method and device for locating problematic terminals
CN106339303A (en) * 2016-08-23 2017-01-18 浪潮电子信息产业股份有限公司 Running log abnormity analysis method
CN108132850A (en) * 2017-12-22 2018-06-08 北京比特大陆科技有限公司 Code location method, apparatus and electronic equipment
CN110069403A (en) * 2019-03-21 2019-07-30 深圳壹账通智能科技有限公司 Position method and device, the storage medium, electronic device of crash event
CN111064590A (en) * 2018-10-16 2020-04-24 腾讯科技(深圳)有限公司 Abnormal state repairing method and device and readable storage medium
CN111083422A (en) * 2019-10-18 2020-04-28 视联动力信息技术股份有限公司 Video networking scheduling conference exception analysis method, device, equipment, system and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1994015309A1 (en) * 1992-12-21 1994-07-07 The Dow Chemical Company System and method for maintaining codes
CN104640138A (en) * 2013-11-13 2015-05-20 中国移动通信集团广东有限公司 Method and device for locating problematic terminals
CN106339303A (en) * 2016-08-23 2017-01-18 浪潮电子信息产业股份有限公司 Running log abnormity analysis method
CN108132850A (en) * 2017-12-22 2018-06-08 北京比特大陆科技有限公司 Code location method, apparatus and electronic equipment
CN111064590A (en) * 2018-10-16 2020-04-24 腾讯科技(深圳)有限公司 Abnormal state repairing method and device and readable storage medium
CN110069403A (en) * 2019-03-21 2019-07-30 深圳壹账通智能科技有限公司 Position method and device, the storage medium, electronic device of crash event
CN111083422A (en) * 2019-10-18 2020-04-28 视联动力信息技术股份有限公司 Video networking scheduling conference exception analysis method, device, equipment, system and medium

Similar Documents

Publication Publication Date Title
CN107276789B (en) Log uploading method and device and computer readable storage medium
CN107368518B (en) Notification message management method, terminal and computer readable storage medium
CN108040159B (en) Restart positioning method based on hardware drive, mobile terminal and readable storage medium
CN107357704B (en) Application program detection method, terminal and computer readable storage medium
US20150169874A1 (en) Method, device, and system for identifying script virus
CN111381992B (en) Crash log processing method and device, electronic equipment and storage medium
CN108121613B (en) Memory page-based restart positioning method, mobile terminal and readable storage medium
CN109002547B (en) Log file storage method, mobile terminal and computer readable storage medium
CN112306799A (en) Abnormal information acquisition method, terminal device and readable storage medium
CN108012031B (en) Mobile terminal restart positioning method, mobile terminal and computer readable storage medium
CN108052437B (en) Restart positioning method, mobile terminal and computer readable storage medium
CN108089937B (en) Direct memory allocation-based restart positioning method, mobile terminal and storage medium
CN108052430B (en) Mobile terminal restart positioning method, mobile terminal and computer readable storage medium
CN107832191B (en) Black screen detection method, mobile terminal and computer readable storage medium
CN112347067A (en) Log information management and control method and device and computer readable storage medium
CN106709330B (en) Method and device for recording file execution behaviors
CN108268335B (en) Restart positioning method based on system service, mobile terminal and storage medium
CN108228423B (en) Mobile terminal restart positioning method, mobile terminal and computer readable storage medium
CN108076200B (en) Mobile terminal restart positioning method, mobile terminal and computer readable storage medium
CN110647418A (en) Exception handling method, server and mobile terminal
CN113535579A (en) Abnormity positioning method and related device
CN108108257B (en) Restart positioning method based on MDSS, mobile terminal and readable storage medium
CN109189576B (en) Redis-based request processing method, server and computer-readable storage medium
CN108334433B (en) Restart positioning method based on power consumption management, mobile terminal and readable storage medium
CN113573046A (en) Lens abnormity processing method, mobile terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20211022