A system anomaly detection method, device, and electronic equipment

By acquiring the scenario patterns when the Android system encounters anomalies, using dynamic libraries and local services to capture log files, and parsing and displaying the causes of the anomalies in real time, the problem of low efficiency in mobile terminal system anomaly detection is solved, enabling rapid location and resolution of system anomalies.

CN114968627BActive Publication Date: 2026-03-06GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-26
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

The low efficiency of detecting anomalies in mobile terminal systems makes the process of locating problems complex and inefficient.

Method used

By acquiring the scenario patterns when the system malfunctions, analyzing log files, including kernel logs and Android system logs, capturing log files using dynamic libraries and local services, and parsing the cause of the malfunction in recovery mode, the cause of the system malfunction is displayed in real time.

Benefits of technology

It improves the efficiency of system anomaly detection, can quickly locate the cause of the problem, and guide users to solve after-sales problems by displaying the cause in real time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114968627B_ABST
    Figure CN114968627B_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer software technology, and in particular to a system anomaly detection method, apparatus, and electronic device. The method includes: acquiring a scenario mode when a system anomaly occurs; acquiring a log file based on the scenario mode; when the system enters recovery mode, parsing the log file to obtain the cause of the system anomaly; and displaying the cause of the system anomaly. This invention can quickly locate the cause of the problem, improving the efficiency of system anomaly detection. Furthermore, by displaying the cause in real time, it can provide guidance to users, enabling them to quickly locate and resolve after-sales issues.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer software technology, and in particular to a system anomaly detection method, apparatus, and electronic device. Background Technology

[0002] With the development of electronic technology, the penetration rate of mobile terminals (such as smartphones) is increasing. During daily Android development using mobile terminals, anomalies frequently occur during the boot process. The typical procedure is for the mobile terminal to reboot into the recovery system, allowing developers to further analyze the cause. This process requires developers to perform a series of software tests and analyses to determine the reason for the mobile terminal's anomaly.

[0003] The above process increases the time cost of software testing, makes the process of locating the cause of mobile terminal anomalies more complicated, and reduces the efficiency of locating problems. Summary of the Invention

[0004] The main technical problem solved by the embodiments of the present invention is to provide a system anomaly detection method, device and electronic device to solve the technical problem of low efficiency in detecting the causes of anomalies in mobile terminal systems.

[0005] To solve the above-mentioned technical problems, one technical solution adopted in the embodiments of the present invention is: to provide a system anomaly detection method, the method comprising:

[0006] Obtain the scenario pattern when the system encounters an anomaly;

[0007] Obtain the log file according to the scenario mode;

[0008] When the system is detected to have entered recovery mode, the log file is parsed to obtain the cause of the system anomaly.

[0009] Display the cause of the system malfunction.

[0010] In some embodiments, when the scene mode is a first scene mode, obtaining the log file according to the scene mode includes:

[0011] Obtain the recovery function corresponding to the first scene mode;

[0012] The recovery function calls the dynamic library, and the log file is obtained from the dynamic library.

[0013] In some embodiments, when the scene mode is a second scene mode, obtaining the log file according to the scene mode includes:

[0014] Configure service attributes in the preset software architecture layer;

[0015] Obtain the local service corresponding to the second scenario mode;

[0016] The local service is triggered based on the service attributes, and the log file is obtained based on the triggered local service.

[0017] In some embodiments, the log files include kernel log files and Android system log files.

[0018] In some embodiments, the method further includes:

[0019] Control for displaying printing error information;

[0020] When the trigger command of the print exception information control is detected, the log file corresponding to the cause of the system exception is displayed.

[0021] In some embodiments, the method further includes:

[0022] Based on the received instructions, the log file is translated into information corresponding to the instructions.

[0023] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of the present invention is: to provide a system anomaly detection device, the device comprising:

[0024] The scenario pattern acquisition module is used to acquire the scenario pattern when the system is in an abnormal situation.

[0025] The log file acquisition module is used to acquire log files according to the scenario mode.

[0026] The file parsing module is used to parse the log file to obtain the cause of the system abnormality when the system enters recovery mode.

[0027] An information display module is used to display the cause of the system malfunction.

[0028] In some embodiments, when the scenario mode is a first scenario mode, the log file acquisition module is specifically used for:

[0029] Obtain the recovery function corresponding to the first scene mode;

[0030] The recovery function calls the dynamic library, and the log file is obtained from the dynamic library.

[0031] In some embodiments, when the scenario mode is the second scenario mode, the log file acquisition module is specifically used for:

[0032] Configure service attributes in the preset software architecture layer;

[0033] Obtain the local service corresponding to the second scenario mode;

[0034] The local service is triggered based on the service attributes, and the log file is obtained based on the triggered local service.

[0035] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of the present invention is to provide an electronic device, including: at least one processor; a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the system anomaly detection method as described above.

[0036] Unlike related technologies, the system anomaly detection method, device, and electronic device provided in this invention obtain corresponding log files based on the scenario mode when a system anomaly occurs, analyze the log files to obtain the cause of the system anomaly, and can display the cause of the system anomaly in real time. Therefore, the system anomaly detection method, device, and electronic device provided in this invention can quickly locate the cause of the problem, improving the efficiency of system anomaly detection. Furthermore, by displaying the cause in real time, it can provide guidance to users, enabling them to quickly locate and resolve after-sales issues. Attached Figure Description

[0037] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0038] Figure 1 This is a flowchart of a system anomaly detection method provided in an embodiment of the present invention;

[0039] Figure 2 This is a flowchart of a system anomaly detection method provided in another embodiment of the present invention;

[0040] Figure 3 This is a flowchart of a system anomaly detection method provided in another embodiment of the present invention;

[0041] Figure 4 This is a schematic diagram of the structure of a system anomaly detection device provided in an embodiment of the present invention;

[0042] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0044] It should be noted that, unless otherwise specified, the various features in the embodiments of the present invention can be combined with each other, and all are within the protection scope of the present invention. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different module division or in a different order than that shown in the device schematic diagram or the flowchart.

[0045] Please see Figure 1 , Figure 1 This is a flowchart of a system anomaly detection method provided in an embodiment of the present invention. The method includes:

[0046] S101, Obtain the scenario mode when the system is abnormal.

[0047] In this embodiment, the system anomalies mainly include system abnormalities that occur during the boot process of the machine during Android development and user use, such as the boot animation getting stuck, the screen going completely black and freezing, or the machine endlessly looping through startup. These anomalies are usually caused by errors in the underlying Android system programs.

[0048] The scenario mode includes a first scenario mode, which refers to a scenario corresponding to a specific startup process within the overall Android system startup process. The Android system startup process mainly includes the following steps: Linux kernel startup; init program startup and startup of various local services; Zygote process startup; Zygote process initialization; SystemServer process startup and startup of various Java services; and a startup completion marker. The scenario mode can be a scenario corresponding to one or more of the above steps. For example, the scenario mode might correspond to the init program startup process, i.e., a system exception occurs during the init program startup process. Or, for example, the scenario mode might correspond to the System Server process startup process, i.e., a system exception occurs during the System Server process startup process.

[0049] The scenario mode also includes a second scenario mode, which refers to a scenario where a preset abnormal situation occurs during the device boot process. For example, the device may repeatedly reboot into recovery mode instead of the normal mode during boot, resulting in a bootloop (infinite reboot) scenario, at which point the system is abnormal. It should be noted that the preset abnormal situation can be set according to the actual application of the Android system, and is not limited to the aforementioned bootloop (infinite reboot) scenario.

[0050] If a system anomaly occurs, the machine executing this method can obtain the scenario mode corresponding to the system anomaly and analyze the cause of the system anomaly based on the scenario mode.

[0051] S102. Obtain the log file according to the scenario mode.

[0052] The above steps divide the scenario mode into a first scenario mode and a second scenario mode. Different methods can be used to obtain log files in different scenario modes. The log files are used to analyze the causes of the system anomalies. The log files include kernel log files and Android system log files, etc.

[0053] Specifically, when the scenario mode is the first scenario mode, obtaining the log file according to the scenario mode includes: obtaining the recovery function corresponding to the first scenario mode; calling a dynamic library pre-stored in the system according to the recovery function, and using the dynamic library to obtain the log file.

[0054] The recovery function is a preset function in the program corresponding to the first scenario mode. For example, the preset function may be a function that can implement restart or hang-up. The recovery function includes the ability to call a dynamic library pre-stored in the system. The dynamic library allows programs to share code and other resources necessary for executing special tasks. The dynamic library includes at least one interface, each interface is used to perform different functional tasks. In this embodiment, the dynamic library may be a librbr, which is used to capture log files through the functions provided by the underlying interface, store them in a specified location, and return the storage location. This embodiment implements a dynamic library that can obtain the kernel log file and Android system log file at the time of the system exception and store them in a high-speed cache partition. The dynamic library encapsulates the implemented functions into interfaces for other modules to call. By obtaining the log file generated when the system exception occurs through the dynamic library, it helps to save memory and share resources, making the process of obtaining the log file more convenient.

[0055] The process of obtaining the log file through the dynamic library is completed before the system enters recovery mode. The captured log file can be a kernel log file or an Android system log file, such as Kernel log or Android log. The obtained log file can be stored in a partition of the high-speed cache memory.

[0056] For example, the first scenario mode corresponds to the init program startup process. In the reboot_into_recovery() function of the init process, the log capture interface in the dynamic library can be called to capture the Kernel log and Android log at that time before entering recovery and save them in the cache partition.

[0057] When the scenario mode is the second scenario mode, obtaining the log file according to the scenario mode includes: setting service attributes in the preset software architecture layer; obtaining the local service corresponding to the second scenario mode; triggering the local service according to the service attributes, and obtaining the log file according to the triggered local service.

[0058] The service attribute is information used to start the local service. For example, the service attribute could be a button to start the service. A button can be instantiated in code and a click event bound to it to enable the service to start. The local service is used to view the log file. In this embodiment, the local service can be created in advance. Creating the local service requires inheriting from an original service. The original service refers to an application component that can run in the background for a long time without providing a user interface. The original service serves as a base class, and the functionality of the local service can be implemented by writing code into it.

[0059] For example, the second scenario corresponds to an exception situation like the rescue party scenario. In this case, a native service (RBR) needs to be implemented. When an exception occurs where the system keeps rebooting indefinitely, an attribute is set in the corresponding code logic of the framework. This attribute is used to trigger the native service, which captures the Kernel log and Android log at the time of the exception and saves them in the cache partition. The rescue party is an Android rescue program. When a process continuously reboots during system startup, it triggers the rescue party mechanism. The rescue party performs a series of operations based on different rescue levels to see if the device can be recovered. In the most severe cases, it enters recovery mode and provides the user with a factory reset to clear user data.

[0060] The above describes different methods for obtaining the log files based on the different scenarios in which system anomalies occur during the machine's boot process. This results in more accurate log files, enabling more precise analysis and localization of the cause of the problem. It should be noted that the first and second scenario modes described above are based on the underlying program execution process involved in the Android system boot process and special application scenarios. In practical applications, the first scenario mode is not limited to the init stage, and the second scenario mode is not limited to rescue party scenarios.

[0061] S103. When the system is detected to have entered recovery mode, the log file is parsed to obtain the cause of the system abnormality.

[0062] S104. Display the cause of the system malfunction.

[0063] After obtaining the log file through the above steps, the system will automatically restart and enter recovery mode. By parsing the log file when entering recovery, the system compares and analyzes to obtain keywords indicating the cause of the system anomaly. Finally, the keywords can be displayed on the machine in real time, thereby helping users quickly locate the reason for the abnormal entry into recovery.

[0064] For example, the keywords include:

[0065] java.lang.NullPointerException: Null pointer exception

[0066] java.lang.ClassNotFoundException: An exception thrown when a class cannot be found.

[0067] java.lang.ArrayIndexOutOfBoundsException: An exception thrown when accessing an array out of bounds.

[0068] java.lang.NumberFormatException: String to Number Conversion Exception

[0069] java.lang.OutOfMemoryError: Out of memory error

[0070] The system anomaly detection method provided in this invention analyzes and summarizes common scenarios where Android systems abnormally enter recovery mode. It implements a dynamic library and a local service to capture anomaly log files for different scenario modes, analyzes the log files to obtain the cause of the abnormal entry into recovery mode, and prints and displays the cause. This method not only improves the efficiency of system anomaly detection but also provides guidance to users by displaying the cause in real time, enabling them to quickly analyze, locate, and resolve similar after-sales issues.

[0071] Please see Figure 2 , Figure 2 This is a flowchart of a system anomaly detection method provided in another embodiment of the present invention. Figure 2 With the above Figure 1 The difference is that the method further includes:

[0072] S105, Control for displaying printing error information;

[0073] S106. When the trigger command of the print exception information control is detected, the log file corresponding to the cause of the system exception is displayed.

[0074] Specifically, the print exception information control can be a touch button displayed on the screen of the machine executing this method. The user can trigger the print exception information control by clicking or swiping. The print exception information control is used to print and display the log file corresponding to the cause of the system exception on the machine according to the user's operation. The log file includes the log file obtained through the above embodiments.

[0075] When the log file corresponding to the system anomaly has too much content to be displayed on one screen on the machine, the log file can be displayed dynamically, such as by scrolling the screen or by displaying the log file in pages.

[0076] In some embodiments, the method further includes: displaying a log file sharing control, and downloading or forwarding the log file to a specified location when a trigger instruction for displaying the log file sharing control is detected. In this embodiment, data on system anomalies, their corresponding causes, and specific log files can be collected to establish a system anomaly data archive. This system anomaly data archive can provide a reference for users to locate and analyze system anomalies in subsequent processes. The system anomaly data archive includes the manifestations and causes of system anomalies in various machine models, as well as the corresponding log files for those causes. It may also include solutions for resolving the system anomaly problems, thereby providing guidance to users encountering the same problem.

[0077] The system anomaly detection method provided in this invention analyzes and summarizes common scenarios where Android systems abnormally enter recovery mode. It implements a dynamic library and a local service to capture anomaly log files for different scenario modes, analyzes the log files to obtain the cause of the abnormal entry into recovery mode, prints and displays the cause, and also prints and displays the specific log file corresponding to the cause. This method improves the efficiency of system anomaly detection, and by displaying the cause and its corresponding log file in real time, it allows users to intuitively understand the cause of the system anomaly, enabling them to quickly analyze, locate, and resolve system anomaly problems.

[0078] Please see Figure 3 , Figure 3 This is a flowchart of a system anomaly detection method provided in another embodiment of the present invention. Figure 3 With the above Figure 2 The difference is that the method further includes:

[0079] S107. According to the received instruction, translate the log file into the information corresponding to the instruction.

[0080] In this embodiment, the log file displayed on the machine screen can be translated into the corresponding language according to the user's needs. The translation is not limited to a literal translation of the log file; more importantly, it serves to explain and clarify the log file. For example, if the log file displayed on the screen is in English, the user can trigger a corresponding command to add Chinese explanations to the English log file, making it easier for general users to understand the log file and quickly determine the reason why the system abnormally entered recovery mode. It should be noted that, in addition to translating the log file, keywords corresponding to the system abnormality reason can also be translated to aid user understanding.

[0081] The instruction can be triggered either by displaying a control on the machine screen and having the user operate the control to trigger the instruction, or by automatically triggering the instruction when the system displays the log file, meaning the system automatically translates and interprets the log file.

[0082] The term "general user" can specifically refer to ordinary users other than R&D personnel and after-sales personnel, such as mobile phone users.

[0083] In some embodiments, the method further includes: displaying a solution for resolving system anomalies, the solution comprising at least one step, the steps being displayed on the screen in a combination of text and images, with each step's corresponding image and text guiding the user to resolve the system anomaly. For general users, this method can effectively assist them in resolving system anomaly problems.

[0084] The system anomaly detection method provided in this invention analyzes and summarizes common scenarios of Android systems abnormally entering recovery mode. It implements a dynamic library and a local service to capture abnormal log files for different scenario modes, analyzes the log files to obtain the cause of the abnormal entry into recovery mode, prints and displays the cause, and can also print and display the specific log file corresponding to the cause. Furthermore, it can translate the log files according to user needs. On the one hand, it improves the efficiency of system anomaly detection, allowing users to intuitively obtain the cause of system anomalies, enabling them to quickly analyze, locate, and resolve system anomaly problems. On the other hand, it assists ordinary users, allowing them to resolve system anomaly problems themselves without needing to contact specialized after-sales personnel.

[0085] Please see Figure 4 , Figure 4 This is a schematic diagram of a system anomaly detection device provided in an embodiment of the present invention. The device 20 includes: a scene mode acquisition module 21, a log file acquisition module 22, a file parsing module 23, and an information display mode 24.

[0086] The scenario mode acquisition module 21 is used to acquire the scenario mode when the system is abnormal; the log file acquisition module 22 is used to acquire the log file according to the scenario mode; the file parsing module 23 is used to parse the log file to obtain the cause of the system abnormality when the system enters recovery mode; the information display module 24 is used to display the cause of the system abnormality.

[0087] Specifically, when the scenario mode is the first scenario mode, the log file acquisition module 22 is used for:

[0088] Obtain the recovery function corresponding to the first scene mode;

[0089] The recovery function calls the dynamic library, and the log file is obtained from the dynamic library.

[0090] Specifically, when the scenario mode is the second scenario mode, the log file acquisition module 22 is used for:

[0091] Configure service attributes in the preset software architecture layer;

[0092] Obtain the local service corresponding to the second scenario mode;

[0093] The local service is triggered based on the service attributes, and the log file is obtained based on the triggered local service.

[0094] The log files include kernel log files and Android system log files.

[0095] In some embodiments, see also Figure 4 The device 20 further includes a control display module 25 and a log file display module 26. The control display module 25 is used to display a print error information control; the log file display module 26 is used to display the log file corresponding to the cause of the system error when a trigger command of the print error information control is detected.

[0096] In some embodiments, see also Figure 4 The device 20 further includes a translation module 27, which is used to translate the log file into information corresponding to the received instruction.

[0097] The system anomaly detection device provided in this invention analyzes and summarizes common scenarios where Android systems abnormally enter recovery mode. It implements a dynamic library and local services to capture anomaly log files for different scenario modes, analyzes the log files to obtain the cause of the abnormal entry into recovery mode, and prints and displays the cause. This device not only improves the efficiency of system anomaly detection but also provides guidance to users by displaying the cause in real time, enabling users to quickly analyze, locate, and resolve similar after-sales issues.

[0098] It should be noted that the above-mentioned system anomaly detection device can execute the system anomaly detection method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in the embodiments of the system anomaly detection device can be found in the system anomaly detection method provided in the embodiments of the present invention.

[0099] Figure 5 This is a schematic diagram of the hardware structure of an electronic device 30 provided in an embodiment of the present invention. This electronic device 30 can be applied to the aforementioned system anomaly detection method and apparatus. Figure 5 As shown, the electronic device 30 includes:

[0100] One or more processors 31 and memory 32, Figure 5 Take a processor 31 as an example.

[0101] Processor 31 and memory 32 can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.

[0102] Memory 32, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the system anomaly detection method in this embodiment of the invention (e.g., attached...). Figure 4 (The various modules shown). The processor 31 executes various functional applications and data processing of the electronic device by running non-volatile software programs, instructions, and modules stored in the memory 32, thereby implementing the system anomaly detection method of the above method embodiment.

[0103] The memory 32 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the system anomaly detection device. Furthermore, the memory 32 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 32 may optionally include memory remotely located relative to the processor 31, and these remote memories can be connected to the system anomaly detection device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0104] The one or more modules are stored in the memory 32. When executed by the one or more processors 31, they perform the system anomaly detection method in any of the above method embodiments, for example, performing the above-described... Figure 1 Method steps S101 to S104, Figure 2 Method steps S101 to S106, Figure 3 The method steps S101 to S107 are implemented. Figure 4 The functions of modules 21-27 in the document.

[0105] The above-described product can execute the method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the method provided in the embodiments of the present invention.

[0106] The electronic devices of this invention exist in various forms, including but not limited to:

[0107] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily aim to provide voice and data communication. These terminals include smartphones, multimedia phones, and feature phones.

[0108] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, possessing computing and processing capabilities, and generally also have mobile internet access features. These terminals include PDAs, MIDs, and UMPCs, etc.

[0109] (3) Portable entertainment devices: These devices can display and play multimedia content. This category includes audio and video players, handheld game consoles, e-book readers, as well as smart toys and portable car navigation devices.

[0110] (4) Other electronic devices with data interaction functions.

[0111] This invention provides a non-volatile computer-readable storage medium storing computer-executable instructions that are executed by one or more processors, for example... Figure 5 One of the processors 31 can enable the one or more processors to execute the system anomaly detection method in any of the above method embodiments, for example, to execute the above-described... Figure 1 Method steps S101 to S104, Figure 2 Method steps S101 to S106, Figure 3 The method steps S101 to S107 are implemented. Figure 4 The functions of modules 21-27 in the document.

[0112] This invention provides a computer program product, comprising a computer program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions that, when executed by an electronic device, enable the electronic device to perform the system anomaly detection method described in any of the above method embodiments, for example, to execute the method described above. Figure 1 Method steps S101 to S104, Figure 2 Method steps S101 to S106, Figure 3 The method steps S101 to S107 are implemented. Figure 4 The functions of modules 21-27 in the document.

[0113] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0114] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software and a general-purpose hardware platform, or of course, using hardware. Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; under the concept of the present invention, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the present invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A system anomaly detection method characterized by, The method comprises: acquiring a scene mode in a system exception, the scene mode comprising a first scene mode and a second scene mode, the first scene mode being a scene corresponding to a starting process of at least one step in a starting process of an Android system, and the second scene mode being a scene in which a preset exception occurs in a starting stage; if the scene mode is the first scene mode, acquiring a recovery function corresponding to the first scene mode; calling a dynamic library according to the recovery function, and acquiring a log file according to the dynamic library; if the scene mode is the second scene mode, setting a service attribute in a preset software architecture layer; acquiring a local service corresponding to the second scene mode; triggering the local service according to the service attribute, and acquiring the log file according to the triggered local service; when it is detected that the system enters a recovery mode, analyzing the log file to acquire a system exception cause; displaying the system exception cause.

2. The method of claim 1, wherein, The log file comprises a kernel log file and an Android system log file.

3. The method of claim 2, wherein, The method further comprises: displaying a print exception information control; when a triggering instruction of the print exception information control is detected, displaying a log file corresponding to the system exception cause.

4. The method of claim 3, wherein, The method further comprises: according to a received instruction, translating the log file into information corresponding to the instruction.

5. A system anomaly detection apparatus characterized by comprising: The device comprises: a scene mode acquisition module, configured to acquire a scene mode in a system exception, the scene mode comprising a first scene mode and a second scene mode, the first scene mode being a scene corresponding to a starting process of at least one step in a starting process of an Android system, and the second scene mode being a scene in which a preset exception occurs in a starting stage; a log file acquisition module, configured to, if the scene mode is the first scene mode, acquire a recovery function corresponding to the first scene mode; call a dynamic library according to the recovery function, and acquire a log file according to the dynamic library; if the scene mode is the second scene mode, set a service attribute in a preset software architecture layer; acquire a local service corresponding to the second scene mode; trigger the local service according to the service attribute, and acquire the log file according to the triggered local service; a file analysis module, configured to, when it is detected that the system enters a recovery mode, analyze the log file to acquire a system exception cause; an information display module, configured to display the system exception cause.

6. An electronic device, comprising: comprise: at least one processor; a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the system exception detection method in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Abnormal log analysis method, device, storage medium, mobile terminal and server

    CN109376056A

  • A log-based cloud service problem fine-grained intelligent tracing method

    CN109861844A