Fault analysis method and device, equipment and storage medium

By obtaining the initial blocking thread and target thread stack of the intelligent operating system service process, determining the jam type, and performing fault analysis on the target communication process, the problem of inaccurate fault analysis results in the existing technology is solved, and the system stability is improved.

CN119336533APending Publication Date: 2025-01-21SHENZHEN TCL DIGITAL TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411380048.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing technology cannot effectively troubleshoot the real reason why the intelligent operating system service process is stuck, resulting in inaccurate fault analysis results and affecting system stability.

Method used

Through response failure analysis requests, obtain the initial blocking thread associated with the system service process, obtain its target thread stack, determine the type of stuttering. result.

Benefits of technology

The accurate analysis of the cause of the system service process card was realized, and the comprehensiveness and effectiveness of fault analysis were improved, thereby improving the operating stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336533A_ABST
    Figure CN119336533A_ABST
Patent Text Reader

Abstract

The invention provides a fault analysis method and device, equipment and a storage medium, and the method comprises the steps: responding to a fault analysis request, and obtaining an initial blocking thread associated with a system service process corresponding to the fault analysis request; obtaining a target thread stack corresponding to the initial blocked thread, and determining a target lag type corresponding to the system service process according to the target thread stack; if the target jamming type is a communication jamming type, acquiring a target communication process corresponding to the system service process; and performing fault analysis on the target communication process to obtain a fault analysis result. According to the technical scheme, the fault analysis comprehensiveness and effectiveness when the system service process is stuck can be improved, and then the system operation stability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a fault analysis method, apparatus, device and storage medium. Background Art

[0002] At present, with the rapid development of intelligent operating systems such as the Android operating system, more and more intelligent terminals can use these intelligent operating systems to control intelligent devices. However, during the operation of the intelligent operating system, the system service process may be stuck due to the watchdog mechanism. For such system defects, the existing fault analysis method is to read the system process log of the system service process itself and perform fault analysis on the system process log. However, this fault analysis method cannot effectively find out the real reason for the system service process being stuck, resulting in inaccurate fault analysis results, and further, it is impossible to perform effective fault repair for such problems, resulting in poor system stability of the intelligent operating system. Summary of the invention

[0003] The embodiments of the present application provide a fault analysis method, apparatus, device and storage medium, which are intended to solve the technical problem of inaccurate fault analysis results for abnormal freezing of an intelligent operating system in the prior art.

[0004] On the one hand, an embodiment of the present application provides a fault analysis method, the fault analysis method comprising the following steps:

[0005] In response to the fault analysis request, obtaining an initial blocked thread associated with the system service process corresponding to the fault analysis request;

[0006] Obtain a target thread stack corresponding to the initial blocked thread, and determine a target jam type corresponding to the system service process according to the target thread stack;

[0007] If the target jam type is a communication jam type, obtaining a target communication process corresponding to the system service process;

[0008] Performing a fault analysis on the target communication process to obtain a fault analysis result.

[0009] In a possible implementation of the present application, the obtaining an initial blocked thread associated with the system service process corresponding to the fault analysis request includes:

[0010] Acquire the system service process corresponding to the fault analysis request, and read the system stack file corresponding to the fault analysis request in the system service process;

[0011] The system stack file is parsed to determine an initial blocked thread corresponding to the fault analysis request.

[0012] In a possible implementation of the present application, obtaining a target thread stack corresponding to the initial blocked thread, and determining a target jam type corresponding to the system service process according to the target thread stack, includes:

[0013] Using a preset stack extraction function and the thread identifier of the initial blocked thread, a target thread stack corresponding to the initial blocked thread is read;

[0014] Reading stack trace information corresponding to each of the initial blocked threads in the target thread stack;

[0015] Determine a target freeze type corresponding to the system service process according to the stack trace information.

[0016] In a possible implementation of the present application, determining the target jam type corresponding to the system service process according to the stack trace information includes:

[0017] Parsing the stack trace information to obtain thread call information in the stack trace information;

[0018] If the abnormal thread calling function in the thread calling information is a local calling function, determining the regular jamming type as the target jamming type corresponding to the system service process;

[0019] If the abnormal thread calling function is a cross-process communication function, the communication jam type is determined as the target jam type corresponding to the system service process.

[0020] In a possible implementation of the present application, if the target jam type is a communication jam type, obtaining a target communication process corresponding to the system service process includes:

[0021] Determine that the target jam type corresponding to the system service process is a communication jam type, obtain a target blocked thread in the initial blocked thread, and thread identification information of the target blocked thread;

[0022] Determine the communication process identifier corresponding to the initial blocked thread according to the thread identifier information and the target thread stack;

[0023] The target communication process corresponding to the system service process is captured based on the communication process identifier.

[0024] In a possible implementation of the present application, performing fault analysis on the target communication process to obtain a fault analysis result includes:

[0025] Obtaining a peer process stack of the target communication process;

[0026] A fault analysis is performed on the target communication process according to the peer process stack to obtain a fault analysis result of the system service process.

[0027] In a possible implementation of the present application, performing fault analysis on the target communication process according to the peer process stack to obtain a fault analysis result of the system service process includes:

[0028] Parsing the peer process stack to determine the thread state of the communication blocking thread in the target communication process;

[0029] If the thread state is in the waiting lock state, locating the target lock thread corresponding to the communication blocked thread, acquiring the abnormal peer process corresponding to the target lock thread, and outputting the first fault analysis result corresponding to the abnormal peer thread;

[0030] If the thread state is a thread blocking state, a second fault analysis result associated with the communication blocking thread is output.

[0031] On the other hand, the present application provides a fault analysis device, the fault analysis device comprising:

[0032] A thread acquisition module is configured to respond to a fault analysis request and acquire an initial blocked thread associated with a system service process corresponding to the fault analysis request;

[0033] A type identification module is configured to obtain a target thread stack corresponding to the initial blocked thread, and determine a target jam type corresponding to the system service process according to the target thread stack;

[0034] A peer acquisition module is configured to acquire a target communication process corresponding to the system service process if the target jam type is a communication jam type;

[0035] The fault analysis module is configured to perform fault analysis on the target communication process to obtain a fault analysis result.

[0036] On the other hand, the present application also provides a fault analysis device, the fault analysis device comprising:

[0037] one or more processors;

[0038] Memory; and

[0039] One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the steps of the fault analysis method.

[0040] On the other hand, the present application also provides a computer-readable storage medium on which a computer program is stored. The computer program is loaded by a processor to execute the steps in the fault analysis method.

[0041] In the present application, by responding to a fault analysis request, the initial blocked thread associated with the system service process corresponding to the fault analysis request is obtained; the target thread stack corresponding to the initial blocked thread is obtained, and the target jam type corresponding to the system service process is determined according to the target thread stack; if the target jam type is a communication jam type, the target communication process corresponding to the system service process is obtained; and the target communication process is fault analyzed to obtain a fault analysis result. When the operating system is abnormally stuck and restarted, the target thread stack corresponding to the initial blocked process in the system service process is analyzed, and the target jam type that causes the system service process jam is determined according to the target thread stack, and when the target jam type is determined to be a communication jam type that causes the system service process to jam due to abnormal operation of the peer communication process during cross-process communication, the target communication process that causes the communication jam is obtained, and a fault analysis is performed on the target communication process, thereby determining the actual cause of the fault, so as to improve the comprehensiveness and effectiveness of the fault analysis when the system service process is stuck, thereby improving the stability of system operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 A schematic diagram of a scenario of a fault analysis method according to an embodiment of the present application;

[0044] Figure 2 A schematic diagram of a flow chart of an embodiment of a fault analysis method in an embodiment of the present application;

[0045] Figure 3 A flowchart of an embodiment of capturing a target communication process in a fault analysis method provided in an embodiment of the present application;

[0046] Figure 4 A flowchart of an embodiment of performing fault analysis on a target communication process in a fault analysis method provided in an embodiment of the present application;

[0047] Figure 5 A schematic diagram of the structure of an embodiment of a fault analysis device provided in an embodiment of the present application;

[0048] Figure 6 A schematic diagram of the structure of an embodiment of a fault analysis device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0050] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0051] In this application, the word "exemplary" is used to mean "serving as an example, illustration, or illustration." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any person skilled in the art to implement and use the invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the invention can be implemented without using these specific details. In other instances, well-known structures and processes are not elaborated in detail to avoid obscuring the description of the invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in this application.

[0052] At present, with the rapid development of intelligent operating systems such as the Android operating system, more and more intelligent terminals can use these intelligent operating systems to control intelligent devices. However, during the operation of the intelligent operating system, the system service process may be stuck due to the watchdog mechanism. For such system defects, the existing fault analysis method is to read the system process log of the system service process itself and perform fault analysis on the system process log. However, this fault analysis method cannot effectively find out the real reason for the system service process being stuck, resulting in inaccurate fault analysis results, and further, it is impossible to perform effective fault repair for such problems, resulting in poor system stability of the intelligent operating system.

[0053] Based on this, the present application proposes a fault analysis method, device, equipment and computer-readable storage medium to solve the technical problem of inaccurate fault analysis results of abnormal freezing of intelligent operating systems in the prior art.

[0054] The fault analysis method in the embodiment of the present invention is applied to a fault analysis device, which is arranged in the fault analysis device. The fault analysis device is provided with one or more processors, a memory, and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the fault analysis method; wherein the fault analysis device can be an intelligent terminal, such as a mobile phone, a tablet computer, a network device, and a smart computer; optionally, the fault analysis device can also be a server, or a service cluster composed of multiple servers.

[0055] like Figure 1 As shown, Figure 1 This is a scenario diagram of the fault analysis method in an embodiment of the present application. The fault analysis scenario in the embodiment of the present invention includes a fault analysis device 100 (a fault analysis apparatus is integrated in the fault analysis device 100), and a computer-readable storage medium corresponding to the fault analysis method is running in the fault analysis device 100 to execute the steps of the fault analysis method.

[0056] Understandably, Figure 1 The fault analysis equipment in the fault analysis method scenario shown, or the devices included in the fault analysis equipment, does not constitute a limitation on the embodiments of the present invention, that is, the number of devices and types of devices of the fault analysis equipment included in the fault analysis method scenario, or the number of devices and types of devices included in each device, do not affect the overall implementation of the technical solution in the embodiments of the present invention, and can all be regarded as equivalent replacements or derivatives of the technical solution claimed to be protected in the embodiments of the present invention.

[0057] The fault analysis device 100 in the embodiment of the present invention is mainly used for: responding to a fault analysis request, obtaining an initial blocked thread associated with a system service process corresponding to the fault analysis request; obtaining a target thread stack corresponding to the initial blocked thread, and determining a target jam type corresponding to the system service process according to the target thread stack; if the target jam type is a communication jam type, obtaining a target communication process corresponding to the system service process; performing a fault analysis on the target communication process to obtain a fault analysis result.

[0058] The fault analysis device 100 in the embodiment of the present invention may be an independent fault analysis device, such as a smart terminal such as a mobile phone, a tablet computer, a network device, a server, and a smart computer, or may be a fault analysis network or a fault analysis cluster composed of multiple fault analysis devices.

[0059] The embodiments of the present application provide a fault analysis method, apparatus, device, and computer-readable storage medium, which are described in detail below.

[0060] It can be understood by those skilled in the art that Figure 1 The application environment shown in is only one of the application scenarios related to the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or fewer fault analysis devices, or fault analysis network connection relationships shown, such as Figure 1 Only one fault analysis device is shown. It can be understood that the scenario of the fault analysis method can also include one or more fault analysis devices, which is not specifically limited here. The fault analysis device 100 can also include a memory for storing stack files and other data.

[0061] It should be noted that Figure 1 The scenario diagram of the fault analysis method shown is only an example. The scenario of the fault analysis method described in the embodiment of the present invention is to more clearly illustrate the technical solution of the embodiment of the present invention, and does not constitute a limitation on the technical solution provided by the embodiment of the present invention.

[0062] Based on the scenario of the above fault analysis method, various embodiments of the fault analysis method disclosed in the present invention are proposed.

[0063] like Figure 2 As shown, Figure 2 This is a flow chart of an embodiment of a fault analysis method in an embodiment of the present application. The fault analysis method includes the following steps 201 to 204:

[0064] 201. Respond to a fault analysis request and obtain an initial blocked thread associated with a system service process corresponding to the fault analysis request;

[0065] The fault analysis method in this embodiment is applied to a fault analysis device, and the type and quantity of the fault analysis device are not specifically limited, that is, the fault analysis device can be one or more intelligent terminals or servers equipped with an intelligent operating system. In a specific embodiment, the fault analysis device is a smart phone or a smart TV. The intelligent operating system can be an Android operating system or other intelligent operating systems (for example, Pengpai OS, Col or OS, Orange OS and other operating systems).

[0066] Specifically, since there is a watchdog mechanism in the existing intelligent operating system, the intelligent operating system of the intelligent terminal can use the watchdog mechanism to monitor the system operation status, and when the system is deadlocked, unresponsive or other abnormal conditions occur, the terminal can trigger the restart of the system or execute a specific error handling program through the watchdog mechanism. However, when an abnormality occurs in the system, the existing intelligent terminal will only capture the stack file of the system service process itself, and cannot effectively analyze the abnormality of the system, which leads to frequent triggering of the watchdog mechanism and frequent system restarts, affecting the stability of system operation. Therefore, during the operation of the fault analysis device, it is necessary to perform fault analysis on the abnormally stuck system service process and its associated target communication process to determine the cause of the stuck system service process.

[0067] Specifically, the fault analysis device responds to a fault analysis request during operation, wherein the fault analysis request is an operation event for performing fault analysis on a system service process or other running process. The fault analysis request can be actively triggered by the fault analysis device, for example, the fault analysis device actively triggers the fault analysis request when an abnormal restart is triggered due to an abnormal freezing of the system service process. In addition, the fault analysis request can also be actively triggered by the user, for example, the user can actively trigger a fault analysis request for the past historical freezing of the system service process by clicking a fault analysis button in the fault analysis device.

[0068] Specifically, after the fault analysis device obtains the fault analysis request, before triggering the abnormal restart mechanism to restart, the fault analysis device also obtains the current system stack file of the system service process, and determines the process jam type of the system service process through the system stack file. Among them, the system service process is the system_server process, and the abnormal restart mechanism can be a watchdog mechanism or other mechanisms that can achieve similar functions. The process jam type can be a regular process jam type caused by the operation of the system service process itself, or a communication jam type caused by the cross-process communication between the system service process and other peer processes, and the peer process cannot respond in time, resulting in the jam of the system service.

[0069] Specifically, before the abnormal restart mechanism is triggered and the system is about to be restarted, the fault analysis device obtains the system stack file generated by the system service process during the abnormal time period, determines the system stack file as the system stack file corresponding to the fault analysis request, and determines the initial blocked thread in the system service process that causes the abnormal restart mechanism based on the system stack file. The initial blocked thread is a thread in the system service process that is blocked / stuck.

[0070] Specifically, the fault analysis device parses the system stack file to obtain the thread identifier and thread status of each running thread in the system service process recorded in the system stack file, thereby locating the thread identifier whose thread status is a blocked state, and determining the running thread pointed to by the thread identifier as the initial blocked thread corresponding to the fault analysis request, and analyzing the thread information associated with the initial blocked thread in subsequent steps to determine the target jam type of the system service process.

[0071] Optionally, in a specific embodiment, after triggering the abnormal restart mechanism, the fault analysis device obtains the system stack file generated by the system service process within the abnormal time period, and reads the abnormal thread information indicated in the system stack file, and locates the initial blocked thread through the abnormal thread information, wherein the abnormal thread information can be: Subject: Blocked in monitor com.android.serve r.am.TclActivityManagerServi ceon foreground thread(android.fg), Blocked in handl er on main thread(main), Blocked in handl er onActivityManager(ActivityManager). The abnormal thread information can determine that the initial blocked threads in the system service process are the android.fg thread, the main thread, and the ActivityManager thread. The fault analysis device determines the target stuck state of the system service process by analyzing the thread information of the android.fg thread, the main thread, and the ActivityManager thread.

[0072] 202. Obtain a target thread stack corresponding to the initial blocked thread, and determine a target jam type corresponding to the system service process according to the target thread stack;

[0073] Specifically, after determining the initial blocked thread in the system service process, the fault analysis device also obtains the target thread stack corresponding to the initial blocked thread, and determines the target jam type of the system service process based on the target thread stack. The target jam type is a type parameter corresponding to the reason why the system service process is stuck. The target jam type can be a regular process jam type caused by the operation of the system service process itself or a communication jam type caused by the system service process communicating with other peer processes across processes, and the peer process cannot respond in time, resulting in the system service being stuck.

[0074] Specifically, after determining the initial blocked process that caused the system service process to be stuck, the fault analysis device also uses the preset stack extraction function and the thread identifier of the initial blocked thread to read the target thread stack corresponding to the initial blocked thread, and uses the target thread stack to determine the cause of the initial blocked thread being stuck or blocked, and then determines the target jam type corresponding to the system service process. Among them, the preset stack extraction function can be any one of the traceback.format_stack() function, Thread.currentThread().getStackTrace() method function and GetFrames() method. That is, after the fault analysis device inputs the thread identifier of the initial blocked thread into the preset stack function, it obtains the target thread stack corresponding to the initial blocked thread through the preset stack function. Among them, the target thread stack is a stack file or data that records the stack tracking information of the thread running status of the initial blocked thread.

[0075] Specifically, after acquiring the target thread stack, the fault analysis device parses the target thread stack to obtain stack trace information corresponding to the initial blocked thread in the target thread stack, and determines the target jam type corresponding to the system service process through the stack trace information.

[0076] Specifically, after obtaining the target thread stack and the stack trace information in the target thread stack, the fault analysis device further parses the stack trace information to obtain the thread call information in the stack trace information, and determines whether there is abnormal call information corresponding to cross-process communication in the thread call information, thereby determining the target freeze type corresponding to the system service process.

[0077] That is, after obtaining the stack trace information, the fault analysis device parses the stack trace information, determines the abnormal thread call function in the thread call information in the stack trace information, determines the cause of the blockage of the initial blocked thread through the abnormal thread call function, and then determines the target jam type corresponding to the system service process. Among them, the abnormal thread call function includes a local call function and a cross-process communication function, wherein the local call function is a call occurrence function that characterizes that the initial blocked thread is a call interaction that causes abnormal blockage / stuck in the process of the system service process. The cross-process communication function is a call occurrence function that characterizes that the initial blocked thread is a call that causes blockage or jamming due to cross-process communication with other running processes.

[0078] Optionally, if the fault analysis device parses the thread call information and determines that the abnormal thread call function in the thread call information is a local call function, the fault analysis device determines that the cause of the blockage of the initial blocked thread that caused the system service process to freeze is an exception that occurred during the internal call of the system service process. The fault analysis device then determines the target freeze type corresponding to the system service process based on the regular freeze type.

[0079] Optionally, if the fault analysis device parses the thread call information and determines that the abnormal thread call function in the thread call information is a cross-process communication function, the fault analysis device determines that the cause of the initial blocked thread that caused the system service process to freeze is an abnormality in the cross-process communication, that is, the initial blocked thread may be frozen / stuck during the cross-process communication due to the peer process of the cross-process communication, and the fault analysis device determines the communication freeze type as the target freeze type corresponding to the system service process. In a specific embodiment, the cross-process communication function includes but is not limited to the following types:

[0080] nat i ve:#04pc 0003a503 / system / lib / libb i nder.so(androi d::IPCThreadState::transact(i nt, uns i gned i nt,androi d::Parce l const&,androi d::Parce l*,uns i gned i nt)+122)

[0081] nat i ve:#05pc 00035347 / system / lib / li bb i nder.so(androi d::BpBinder::transact(uns i gned i nt,androi d::Parce l const&,androi d::Parce l*,uns i gned i nt)+98)

[0082] nat i ve:#06pc 000c75c3 / system / lib / li bandro i d_runt ime.so(androi d_os_Bi nderProxy_transact(_JN I Env*,_jobject*,i nt,_jobject*,_jobject*,i nt)+82)

[0083] at androi d.os.Bi nderProxy.transactNat i ve(Nat i ve method)

[0084] at androi d.os.Bi nderProxy.transact(Bi nderProxy.java:540)

[0085] Optionally, in other embodiments, the cross-process communication function may also be other functions or method classes that can call a thread to perform cross-thread interaction with other processes, which is not specifically limited in this embodiment.

[0086] 203. If the target jamming type is a communication jamming type, obtaining a target communication process corresponding to the system service process;

[0087] Specifically, after the fault analysis device determines that the target jam type corresponding to the system service process is the communication jam type, the fault analysis device determines that the process that triggers the operating system's abnormal restart mechanism is not the system service process itself, but the target communication process that interacts with the system service process through cross-process communication. The fault analysis device then further obtains the target communication process corresponding to the system service process, that is, the fault analysis device obtains the target communication process that communicates with the system service process through cross-process communication and causes the system service process to freeze / jam.

[0088] Specifically, after determining that the target jam type corresponding to the system service process is the communication jam type, the fault analysis device further searches for the target communication process that causes the system service process to freeze / jam through the initial blocking thread, and performs fault analysis on the target communication process in the subsequent process, thereby determining the fault cause that triggered the abnormal restart mechanism.

[0089] 204. Perform a fault analysis on the target communication process to obtain a fault analysis result.

[0090] Specifically, after determining the target communication process that is abnormally stuck due to the system service process, the fault analysis device also performs a fault analysis on the target communication process to obtain a fault analysis result, and in a subsequent step, performs an abnormal repair on the target communication process based on the fault analysis result, thereby avoiding the abnormal restart mechanism being triggered again due to the same abnormality in the target communication process in the future, thereby improving the system stability of the fault analysis device or other intelligent terminals.

[0091] Specifically, after determining the target communication thread to be analyzed, the fault analysis device also obtains the peer process stack corresponding to the target communication process, and performs fault analysis on the target communication process according to the peer process stack, thereby determining the actual fault analysis result of the system service process. The peer process stack is a stack file that records the process stack tracking information of the target communication process within a preset time period. The fault analysis result characterizes the root cause of the system service process freezing / stuck and triggering the abnormal restart mechanism.

[0092] Specifically, the fault analysis device uses a preset stack extraction function and the process ID of the target communication process to read the peer process stack corresponding to the target communication process, and uses the peer process stack to determine the cause of the target communication process being stuck or blocked, and then determines the target jam type corresponding to the system service process. Among them, the preset stack extraction function can be any one of the traceback.format_stack() function, Thread.currentThread().getStackTrace() method function, and GetFrames() method. That is, after the fault analysis device inputs the process ID of the target communication process into the preset stack function, it obtains the peer process stack corresponding to the target communication process through the preset stack function.

[0093] Specifically, after obtaining the target thread stack, the fault analysis device determines according to the peer process stack whether the target communication process did not respond to the communication interaction of the system service process during the communication process, causing the system service process to become stuck or stuck. In addition, the fault analysis device can further determine whether the abnormal running state of the target communication process in response to the communication interaction of the system service process is caused by waiting for other threads to lock, and then determine the real cause of the system service process being stuck. After determining the real cause of the system service process being stuck, the cause of the stuck is repaired during the execution of the operating system restart process (including any time period before and after the restart), thereby avoiding triggering the abnormal restart mechanism again due to the same reason after the restart.

[0094] In this embodiment, the fault analysis device obtains the initial blocked thread associated with the system service process corresponding to the fault analysis request by responding to the fault analysis request; obtains the target thread stack corresponding to the initial blocked thread, and determines the target jam type corresponding to the system service process according to the target thread stack; if the target jam type is a communication jam type, obtains the target communication process corresponding to the system service process; performs fault analysis on the target communication process to obtain a fault analysis result. When the operating system is abnormally stuck and restarted, the target thread stack corresponding to the initial blocked process in the system service process is analyzed, and the target jam type that causes the system service process jam is determined according to the target thread stack, and when the target jam type is determined to be a communication jam type that causes the system service process to jam due to abnormal operation of the opposite communication process during cross-process communication, the target communication process that causes the communication jam is obtained, and a fault analysis is performed on the target communication process, thereby determining the actual cause of the fault, so as to improve the comprehensiveness and effectiveness of the fault analysis when the system service process is jammed, thereby improving the stability of system operation.

[0095] like Figure 3 As shown, Figure 3 This is a flow chart of an embodiment of capturing a target communication process in a fault analysis method provided in an embodiment of the present application. Specifically, in this embodiment, the fault analysis method further includes steps 301 to 303:

[0096] 301. Determine that the target jam type corresponding to the system service process is a communication jam type, obtain a target jam thread in the initial jam thread, and thread identification information of the target jam thread;

[0097] 302. Determine a communication process identifier corresponding to the initial blocked thread according to the thread identifier information and the target thread stack;

[0098] 303. Capture a target communication process corresponding to the system service process based on the communication process identifier.

[0099] Based on the above embodiments, in this embodiment, after the fault analysis device determines that the target jam type corresponding to the system service process is a communication jam type caused by the failure of the counterpart process to respond in time during cross-process communication interaction, the fault analysis device also searches for the target communication process that causes the system service process to freeze / jam through the initial blocking thread, and performs a fault analysis on the target communication process in the subsequent process, thereby determining the fault cause that triggered the abnormal restart mechanism.

[0100] Specifically, after the fault analysis device determines that the target jam type is a communication jam type, it also obtains the target jam thread in the initial jam thread, parses the target jam thread, and obtains the thread identification information of the target jam thread, wherein the target jam thread is the initial jam thread that is abnormally stuck during cross-process communication interaction in the system service process. The thread identification information is a globally unique identifier that characterizes the thread. In a specific embodiment, the thread identification information is T ID (thread ID).

[0101] Specifically, after obtaining the thread identification information of the target blocked thread, the fault analysis device also determines the communication process identification corresponding to the initial blocked thread based on the thread identification information and the target thread stack, that is, the fault analysis device parses the target thread stack corresponding to the target blocked thread through the thread identification information, and obtains the communication process identification in the target thread stack that has cross-process communication interaction with the target blocked thread.

[0102] Specifically, after determining the communication process identifier, the fault analysis device captures the target communication process corresponding to the system service process according to the communication process identifier, obtains the peer process stack of the target communication process, and uses the peer process stack to determine the cause of the target communication process being stuck or blocked, and then determines the target jam type corresponding to the system service process.

[0103] In this embodiment, the fault analysis device determines that the target jam type corresponding to the system service process is a communication jam type, obtains the target jam thread in the initial jam thread, and the thread identification information of the target jam thread; determines the communication process identification corresponding to the initial jam thread according to the thread identification information and the target thread stack; and captures the target communication process corresponding to the system service process based on the communication process identification. When it is determined that the jam type of the system service process is a jam type caused by other processes, the target communication process and stack information are quickly located to improve the jam analysis efficiency and jam analysis accuracy of the system service process.

[0104] like Figure 4 As shown, Figure 4 This is a flow chart of an embodiment of performing fault analysis on a target communication process in a fault analysis method provided in an embodiment of the present application. Specifically, in this embodiment, the fault analysis method further includes steps 401 to 403:

[0105] 401. Parse the peer process stack to determine the thread state of the communication blocking thread in the target communication process;

[0106] 402. If the thread state is in the waiting lock state, locate the target lock thread corresponding to the communication blocked thread, obtain the abnormal peer process corresponding to the target lock thread, and output the first fault analysis result corresponding to the abnormal peer thread;

[0107] 403. If the thread state is a thread blocking state, output a second fault analysis result associated with the communication blocking thread.

[0108] Based on the above embodiments, in this embodiment, after the fault analysis device determines the target communication process and the corresponding peer process stack that cause the abnormal freezing of the system service process, it also uses the peer process stack to perform a fault analysis on the target communication process to obtain a fault analysis result, and in subsequent steps, the target communication process is repaired abnormally by using the fault analysis result, thereby avoiding the subsequent triggering of the abnormal restart mechanism due to the same abnormality in the target communication process, thereby improving the system stability of the fault analysis device or other intelligent terminals.

[0109] Specifically, after obtaining the target communication process and the corresponding peer process stack, the fault analysis device parses the peer process stack, determines the communication blocking thread in the target communication process that causes the cross-process communication interaction abnormality, and obtains the thread state of the communication blocking thread. The thread blocking state may include any one of a waiting lock state and a thread blocking state, wherein the waiting lock state is a thread blocking state that indicates that the blocking reason of the communication blocking thread is waiting for the thread lock of other threads. The thread blocking state is a thread blocking state that indicates that the blocking reason of the communication blocking thread is the abnormal operation of the thread itself.

[0110] Optionally, if the fault analysis device parses the peer process stack and determines that the thread state representing the communication congestion thread in the peer process stack is a waiting lock state, that is, the reason for the congestion of the communication congestion thread is that the communication congestion thread is waiting for the thread lock of other threads, and other threads may be in a locked state due to waiting for other thread locks, thereby causing the communication congestion thread to be stuck. Therefore, the communication congestion thread cannot perform cross-process communication interaction with the target congestion thread in a timely manner, causing the system service process to be stuck. Based on this, after determining that the thread state is in the waiting lock state, the fault analysis device also locates the occupied lock thread that is occupying the communication blocking thread waiting thread lock through the stack tracking information in the opposite process stack, and determines the cause of the abnormal occupation of the thread lock by the occupied lock thread according to the stack file of the occupied lock thread, and then determines whether the occupied lock thread is waiting for the thread lock of other threads, causing the occupied lock thread to abnormally occupy the thread lock required by the target blocking thread, and finally determines the target locked thread that causes the cross-process communication abnormality of the target blocking thread, and determines the abnormal opposite process corresponding to the target locked thread, wherein the target locked thread is a running thread that actually occupies a specific thread lock and causes the communication blocking thread to be blocked. The abnormal opposite process is the running process to which the target locked thread belongs or the opposite running process that performs cross-process communication with the target locked thread.

[0111] Specifically, after determining the target locking thread and the abnormal peer process corresponding to the target locking thread, the fault analysis device outputs a first fault analysis result corresponding to the abnormal peer process, wherein the first fault analysis result indicates that the reason why the system service process is stuck is that the target locking thread in the abnormal peer process occupies a specified thread lock.

[0112] Optionally, if the fault analysis device parses the peer process stack and determines that the thread state representing the communication congestion thread in the peer process stack is a thread congestion state, that is, the communication congestion thread is blocked due to the operation of its own thread, then the fault analysis device determines that there is an abnormality in the target communication process, and outputs a second fault analysis result associated with the communication congestion thread, wherein the second fault analysis result represents that the cause of the system service process being stuck is the abnormal operation of the target communication process that communicates with the system service process across processes.

[0113] In this embodiment, the fault analysis device determines the thread state of the communication blocking thread in the target communication process by parsing the peer process stack; if the thread state is a waiting lock state, the target lock thread corresponding to the communication blocking thread is located, the abnormal peer process corresponding to the target lock thread is obtained, and the first fault analysis result corresponding to the abnormal peer process is output; if the thread state is a thread blocking state, the second fault analysis result associated with the communication blocking thread is output. Thus, the real cause of the system service process being stuck can be accurately captured, so as to accurately perform system repair on the smart terminal and improve the system operation stability.

[0114] In order to better implement the fault analysis method in the embodiment of the present application, based on the fault analysis method, a fault analysis device is also provided in the embodiment of the present application, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the structure of a fault analysis device provided in an embodiment of the present application. Specifically, the fault analysis device 500 includes:

[0115] The thread acquisition module 501 is configured to respond to a fault analysis request and acquire an initial blocked thread associated with a system service process corresponding to the fault analysis request;

[0116] The type identification module 502 is configured to obtain a target thread stack corresponding to the initial blocked thread, and determine a target jam type corresponding to the system service process according to the target thread stack;

[0117] The peer acquisition module 503 is configured to acquire a target communication process corresponding to the system service process if the target jamming type is a communication jamming type;

[0118] The fault analysis module 504 is configured to perform fault analysis on the target communication process to obtain a fault analysis result.

[0119] In a possible implementation of this embodiment, the fault analysis device obtains the initial blocked thread associated with the system service process corresponding to the fault analysis request, including:

[0120] Acquire the system service process corresponding to the fault analysis request, and read the system stack file corresponding to the fault analysis request in the system service process;

[0121] The system stack file is parsed to determine an initial blocked thread corresponding to the fault analysis request.

[0122] In a possible implementation of this embodiment, the fault analysis device obtains a target thread stack corresponding to the initial blocked thread, and determines a target jam type corresponding to the system service process according to the target thread stack, including:

[0123] Using a preset stack extraction function and the thread identifier of the initial blocked thread, a target thread stack corresponding to the initial blocked thread is read;

[0124] Reading stack trace information corresponding to each of the initial blocked threads in the target thread stack;

[0125] Determine a target freeze type corresponding to the system service process according to the stack trace information.

[0126] In a possible implementation of this embodiment, the fault analysis device determines the target jamming type corresponding to the system service process according to the stack trace information, including:

[0127] Parsing the stack trace information to obtain thread call information in the stack trace information;

[0128] If the abnormal thread calling function in the thread calling information is a local calling function, determining the regular jamming type as the target jamming type corresponding to the system service process;

[0129] If the abnormal thread calling function is a cross-process communication function, the communication jam type is determined as the target jam type corresponding to the system service process.

[0130] In a possible implementation of this embodiment, if the target jamming type is a communication jamming type, the fault analysis device obtains the target communication process corresponding to the system service process, including:

[0131] Determine that the target jam type corresponding to the system service process is a communication jam type, obtain a target blocked thread in the initial blocked thread, and thread identification information of the target blocked thread;

[0132] Determine the communication process identifier corresponding to the initial blocked thread according to the thread identifier information and the target thread stack;

[0133] The target communication process corresponding to the system service process is captured based on the communication process identifier.

[0134] In a possible implementation of this embodiment, the fault analysis device performs fault analysis on the target communication process to obtain a fault analysis result, including:

[0135] Obtaining a peer process stack of the target communication process;

[0136] A fault analysis is performed on the target communication process according to the peer process stack to obtain a fault analysis result of the system service process.

[0137] In a possible implementation of this embodiment, the fault analysis device performs fault analysis on the target communication process according to the peer process stack to obtain a fault analysis result of the system service process, including:

[0138] Parsing the peer process stack to determine the thread state of the communication blocking thread in the target communication process;

[0139] If the thread state is in the waiting lock state, locating the target lock thread corresponding to the communication blocked thread, acquiring the abnormal peer process corresponding to the target lock thread, and outputting the first fault analysis result corresponding to the abnormal peer thread;

[0140] If the thread state is a thread blocking state, a second fault analysis result associated with the communication blocking thread is output.

[0141] In this embodiment, the fault analysis device obtains the initial blocked thread associated with the system service process corresponding to the fault analysis request by responding to the fault analysis request; obtains the target thread stack corresponding to the initial blocked thread, and determines the target jam type corresponding to the system service process according to the target thread stack; if the target jam type is a communication jam type, obtains the target communication process corresponding to the system service process; performs fault analysis on the target communication process to obtain a fault analysis result. When the operating system is abnormally stuck and restarted, the target thread stack corresponding to the initial blocked process in the system service process is analyzed, and the target jam type that causes the system service process jam is determined according to the target thread stack, and when the target jam type is determined to be a communication jam type that causes the system service process to jam due to abnormal operation of the opposite communication process during cross-process communication, the target communication process that causes the communication jam is obtained, and a fault analysis is performed on the target communication process, thereby determining the actual cause of the fault, so as to improve the comprehensiveness and effectiveness of the fault analysis when the system service process is jammed, thereby improving the stability of system operation.

[0142] The embodiment of the present invention also provides a fault analysis device, such as Figure 6 As shown, Figure 6 This is a schematic diagram of the structure of an embodiment of the fault analysis device provided in the embodiments of the present application.

[0143] The fault analysis device integrates any one of the fault analysis devices provided in the embodiments of the present invention, and the fault analysis device includes:

[0144] one or more processors;

[0145] Memory; and

[0146] One or more applications, wherein the one or more applications are stored in the memory and are configured so that the processor executes the steps of the fault analysis method described in any of the above fault analysis method embodiments.

[0147] Specifically, the fault analysis device may include one or more processing core processors 601, one or more computer-readable storage media memories 602, a power supply 603, an input unit 604, and other components. Those skilled in the art will understand that Figure 6 The structure of the fault analysis device shown in the figure does not constitute a limitation on the fault analysis device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0148] The processor 601 is the control center of the fault analysis device. It uses various interfaces and lines to connect various parts of the entire fault analysis device. By running or executing software programs and / or modules stored in the memory 602, and calling data stored in the memory 602, it performs various functions of the fault analysis device and processes data, thereby monitoring the fault analysis device as a whole. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.

[0149] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the fault analysis device, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.

[0150] The fault analysis device also includes a power supply 603 for supplying power to each component. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 603 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0151] The fault analysis device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0152] Although not shown, the fault analysis device may also include a display unit, etc., which will not be described in detail here. Specifically in this embodiment, the processor 601 in the fault analysis device will load the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 will run the application programs stored in the memory 602, thereby realizing various functions, as follows:

[0153] In response to the fault analysis request, obtaining an initial blocked thread associated with the system service process corresponding to the fault analysis request;

[0154] Obtain a target thread stack corresponding to the initial blocked thread, and determine a target jam type corresponding to the system service process according to the target thread stack;

[0155] If the target jam type is a communication jam type, obtaining a target communication process corresponding to the system service process;

[0156] Performing a fault analysis on the target communication process to obtain a fault analysis result.

[0157] To this end, an embodiment of the present invention provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any of the fault analysis methods provided in the embodiments of the present invention. For example, the computer program may be loaded by a processor to execute the following steps:

[0158] In response to the fault analysis request, obtaining an initial blocked thread associated with the system service process corresponding to the fault analysis request;

[0159] Obtain a target thread stack corresponding to the initial blocked thread, and determine a target jam type corresponding to the system service process according to the target thread stack;

[0160] If the target jam type is a communication jam type, obtaining a target communication process corresponding to the system service process;

[0161] Performing a fault analysis on the target communication process to obtain a fault analysis result.

[0162] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.

[0163] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.

[0164] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0165] The above is a detailed introduction to a fault analysis method provided in an embodiment of the present application. Specific embodiments are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A fault analysis method, characterized in that: The fault analysis method comprises: In response to the fault analysis request, obtaining an initial blocked thread associated with the system service process corresponding to the fault analysis request; Obtain a target thread stack corresponding to the initial blocked thread, and determine a target jam type corresponding to the system service process according to the target thread stack; If the target jam type is a communication jam type, obtaining a target communication process corresponding to the system service process; Performing a fault analysis on the target communication process to obtain a fault analysis result.

2. The fault analysis method according to claim 1, characterized in that: The obtaining of the initial blocked thread associated with the system service process corresponding to the fault analysis request includes: Acquire the system service process corresponding to the fault analysis request, and read the system stack file corresponding to the fault analysis request in the system service process; The system stack file is parsed to determine an initial blocked thread corresponding to the fault analysis request.

3. The fault analysis method according to claim 1, characterized in that: The obtaining of a target thread stack corresponding to the initial blocked thread, and determining a target jam type corresponding to the system service process according to the target thread stack, includes: Using a preset stack extraction function and the thread identifier of the initial blocked thread, a target thread stack corresponding to the initial blocked thread is read; Reading stack trace information corresponding to the initial blocked thread in the target thread stack; Determine a target freeze type corresponding to the system service process according to the stack trace information.

4. The fault analysis method according to claim 3, characterized in that: The determining, according to the stack trace information, a target jam type corresponding to the system service process includes: Parsing the stack trace information to obtain thread call information in the stack trace information; If the abnormal thread calling function in the thread calling information is a local calling function, determining the regular jamming type as the target jamming type corresponding to the system service process; If the abnormal thread calling function is a cross-process communication function, the communication jam type is determined as the target jam type corresponding to the system service process.

5. The fault analysis method according to claim 1, characterized in that: If the target jam type is a communication jam type, obtaining a target communication process corresponding to the system service process includes: Determine that the target jam type corresponding to the system service process is a communication jam type, obtain a target blocked thread in the initial blocked thread, and thread identification information of the target blocked thread; Determine the communication process identifier corresponding to the initial blocked thread according to the thread identifier information and the target thread stack; The target communication process corresponding to the system service process is captured based on the communication process identifier.

6. The fault analysis method according to claim 5, characterized in that: The performing fault analysis on the target communication process to obtain a fault analysis result includes: Obtaining a peer process stack of the target communication process; A fault analysis is performed on the target communication process according to the peer process stack to obtain a fault analysis result of the system service process.

7. The fault analysis method according to claim 6, characterized in that: The performing fault analysis on the target communication process according to the peer process stack to obtain the fault analysis result of the system service process includes: Parsing the peer process stack to determine the thread state of the communication blocking thread in the target communication process; If the thread state is in the waiting lock state, locating the target lock thread corresponding to the communication blocked thread, acquiring the abnormal peer process corresponding to the target lock thread, and outputting the first fault analysis result corresponding to the abnormal peer process; If the thread state is a thread blocking state, a second fault analysis result associated with the communication blocking thread is output.

8. A fault analysis device, characterized in that: The fault analysis device comprises: A thread acquisition module is configured to respond to a fault analysis request and acquire an initial blocked thread associated with a system service process corresponding to the fault analysis request; A type identification module is configured to obtain a target thread stack corresponding to the initial blocked thread, and determine a target jam type corresponding to the system service process according to the target thread stack; A peer acquisition module is configured to acquire a target communication process corresponding to the system service process if the target jam type is a communication jam type; The fault analysis module is configured to perform fault analysis on the target communication process to obtain a fault analysis result.

9. A fault analysis device, characterized in that: The fault analysis device comprises: one or more processors; Memory; and One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the processor to implement the steps of the fault analysis method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps of the fault analysis method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Processor lag monitoring method and device

    CN121008952A