A thread monitoring method, device, computer equipment and storage medium

By establishing a pointer linked list in the Linux operating system and using thread capture signals for real-time monitoring, the problem of long thread crash analysis is solved, and more efficient thread crash analysis and application stability is achieved.

CN115509855BActive Publication Date: 2025-02-07CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211188582.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-28
Publication Date
2025-02-07
Estimated Expiration
2042-09-28

AI Technical Summary

Technical Problem

In Linux operating systems, thread crash analysis time is long, affecting the stability and efficiency of the application.

Method used

By establishing a pointer link list, recording the thread name and stack information, and monitoring the currently running threads in real time based on the thread capture signal, including capturing the operation information and backtracking interface to analyze the stack information for thread crash analysis.

Benefits of technology

Improves the efficiency of thread crash analysis, makes the analysis process faster and easier, and reduces the possibility of application crashes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115509855B_ABST
    Figure CN115509855B_ABST
Patent Text Reader

Abstract

The present application relates to a thread monitoring method, device, computer equipment and storage medium. The method comprises: establishing a pointer linked list, establishing a thread according to the pointer linked list, wherein the pointer linked list comprises a thread name and stack information; obtaining a thread capture signal according to the thread name and stack information; and monitoring the running state of the currently running thread according to the thread capture signal. The method can improve the efficiency of analysis when a thread crashes.
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 thread monitoring method, apparatus, computer device and storage medium. Background Art

[0002] During the running of an application, if there is a long period of freezing, it is easy to cause the application to crash. Therefore, it is necessary to monitor the threads during the running of the application and analyze the threads with problems so as to optimize the threads. However, in the Linux operating system, when the program is running, the thread crash is generally analyzed through logs, and the thread information needs to be saved for later analysis, which takes a long time to analyze. Summary of the invention

[0003] Based on this, a thread monitoring method, apparatus, computer device and storage medium are provided to improve the problem of long thread crash analysis time in the prior art.

[0004] On the one hand, a method for thread monitoring is provided, the method comprising: establishing a pointer linked list, and establishing a thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information; obtaining a thread capture signal according to the thread name and the stack information; and monitoring the running status of the currently running thread according to the thread capture signal.

[0005] In one of the embodiments, the running state of the currently running thread is monitored according to the thread capture signal, including: capturing the running information of the currently running thread according to the thread capture signal; if the running information is an error signal, monitoring the running state of the currently running thread through a backtrace interface.

[0006] In one of the embodiments, if the running information is an error signal, the running state of the currently running thread is monitored through a backtrace interface, including: if the running information is an error signal, obtaining the stack information of the currently running thread through the backtrace interface; and performing a thread crash analysis on the currently running thread based on the stack information.

[0007] In one of the embodiments, monitoring the currently running thread according to the thread capture signal includes: capturing running information of the currently running thread according to the thread capture signal, wherein the running information includes stack display information and thread pause information; monitoring the running status of the currently running thread according to the stack display information or the thread pause information.

[0008] In one of the embodiments, after establishing a pointer linked list and establishing the thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information, and before obtaining a thread capture signal according to the thread name and the stack information, it also includes: obtaining thread data according to the thread, wherein the thread data includes a thread identifier; binding the pointer linked list to the thread data so that the thread identifier and the thread name correspond.

[0009] In one of the embodiments, a pointer linked list is established, and the thread is established based on the pointer linked list, including: establishing a pointer linked list and storing a thread initial value in the pointer linked list, wherein the thread initial value includes initial stack information; establishing the thread based on the initial stack information and the pointer linked list to initialize the thread.

[0010] In one embodiment, a pointer linked list is established, and the thread initial value is stored in the pointer linked list, including: establishing a pointer linked list, wherein the pointer linked list includes priority information; storing the thread initial value in the priority information of the pointer linked list to implement priority conversion of the thread, wherein the thread initial value includes an initial priority.

[0011] On the other hand, a thread monitoring device is provided, which includes: a thread establishment module, used to establish a pointer linked list, and establish a thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information; a signal establishment module, used to obtain a thread capture signal according to the thread name and the stack information; and a thread monitoring module, used to monitor the running status of the currently running thread according to the thread capture signal.

[0012] On the other hand, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: establishing a pointer linked list, establishing a thread according to the pointer linked list, and obtaining a corresponding thread capture signal according to the thread, wherein the pointer linked list includes a thread name and stack information; and monitoring the currently running thread according to the thread capture signal.

[0013] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: establishing a pointer linked list, and establishing a thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information; obtaining a thread capture signal according to the thread name and the stack information; and monitoring the running status of the currently running thread according to the thread capture signal.

[0014] The above-mentioned thread monitoring method, device, computer equipment and storage medium establish a pointer linked list and establish a thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information; obtain a thread capture signal according to the thread name and the stack information; monitor the running status of the currently running thread according to the thread capture signal, thereby further improving the efficiency of thread crash analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 An application environment diagram of a thread monitoring method in one embodiment;

[0016] Figure 2 A schematic diagram of a process flow of a thread monitoring method in one embodiment;

[0017] Figure 3 is a structural block diagram of a thread monitoring device in one embodiment;

[0018] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0020] The thread monitoring method provided in this application can be applied to Figure 1 In the application environment shown. The terminal 102 communicates with the server 104 through a network. The server 104 establishes a pointer linked list and establishes the thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information; obtains a thread capture signal according to the thread name and the stack information; and monitors the running state of the currently running thread according to the thread capture signal, thereby improving the efficiency of analyzing the thread when the thread crashes. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0021] In one embodiment, Figure 2 As shown, a thread monitoring method is provided, which is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:

[0022] Step 201, establish a pointer linked list, and establish a thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information;

[0023] Step 202, obtaining a thread capture signal according to the thread name and stack information;

[0024] Step 203: monitor the running state of the currently running thread according to the thread capture signal.

[0025] In step 201, it is exemplarily explained that a pointer list is established, and a thread is established according to the pointer list, wherein the pointer list includes a thread name and stack information. For example, before each thread is established, a corresponding pointer list can be established, and the pointer list is used to record the thread name, priority, scheduling strategy, stack information and other related thread information of the established thread. Then, according to the thread name and stack information recorded in the pointer list, the corresponding thread is established through the encapsulated job creation interface (apiTaskCreate), and the thread entry function is a unified job encapsulation interface (apiTaskWrapper). Then, the function pointer is called to run the user's thread entry function through the incoming user entry function. Since in the operating system, the corresponding thread has an inherent thread identifier (process ID, PID), and the user views the thread through the thread name, the thread name of the corresponding thread is recorded through the pointer list, so that the thread name is bound to the thread identifier, so that the user can view the relevant information of the thread through the thread name, thereby monitoring and analyzing the thread crash through the stack information recorded in the corresponding pointer list, and further improving the efficiency of the thread crash analysis.

[0026] In step 202, it is exemplarily explained that a thread capture signal is obtained according to the thread name and stack information. For example, a corresponding thread capture signal can be established according to the thread name and stack information, including the running status of the thread corresponding to the thread name. The signal type of the thread capture signal can be defined as: obtaining task stack information, displaying task stack information, thread suspension, thread resumption and other user diagnostic signals.

[0027] In step 203, it is exemplarily explained that the running state of the currently running thread is monitored according to the thread capture signal. For example, the running information of the thread can be captured by the thread capture signal, so as to monitor the running state of the thread. When the thread is running, the thread capture signal captures the error signal of the thread crash, and the cause of the thread crash can be analyzed according to the error signal, so as to optimize the thread. Specifically, when the thread capture signal captures the error signal, the call relationship of the current stack can be tracked through the backtrace and backtrace_symbols functions, and the results can be output to the corresponding terminal for display, and the current thread can be suspended at the same time. The analyst analyzes the state of the code according to the displayed content and troubleshoots the problem of thread crash.

[0028] During the running of the application, if there is a long period of freezing, it is easy to cause the application to crash. Therefore, it is necessary to monitor the threads when the application is running, and analyze the threads with problems, so as to optimize the threads. However, in the Linux operating system, when the program is running, the thread crash is generally analyzed through logs, and the thread information needs to be saved for later analysis, which takes a long time to analyze. In the above thread monitoring method, by establishing a pointer linked list to record the thread name and stack information of the corresponding thread, and then establishing a corresponding thread capture signal through the thread to monitor the currently running thread, the thread crash can be analyzed in real time, which improves the efficiency of thread crash analysis.

[0029] As a specific implementation method of the above embodiment, the running state of the currently running thread is monitored according to the thread capture signal, including: capturing the running information of the currently running thread according to the thread capture signal; if the running information is an error signal, monitoring the running state of the currently running thread through the backtrace interface.

[0030] It should be noted that the signal processing during user diagnosis can be captured by creating a private signal state, that is, the thread capture signal. The signal type definition of the thread capture signal may include: obtaining task stack information, displaying task stack information, thread suspension, thread recovery and other user diagnostic signals, so as to obtain the thread operation information, such as thread normal operation, thread error operation and other operation information. At the same time, the state of the thread error can be captured by creating a system error signal and signal processing interface. The error signal types include: SIGBUS, SIGSEGV, SIGHUP, SIGILL, SIGABRT, SIGIOT, SIGFPE and other system signals. In order to ensure the executability of the signal, SA_SIGINFO or SA_ONSTACK can be used. Furthermore, after obtaining the error signal, in the signal processing interface, the currently running thread is monitored through the backtrace interface, such as backtrace and backtrace_symbols.

[0031] As a specific implementation method of the above embodiment, the currently running thread is monitored according to the thread capture signal, including: if the running information is an error signal, the stack information of the currently running thread is obtained through the backtrace interface; according to the stack information, the thread crash analysis is performed on the currently running thread.

[0032] It should be noted that when a running thread crashes, analysis can be performed based on the stack information of the thread. Specifically, the call relationship of the current stack can be tracked through the backtrace and backtrace_symbols functions in the signal processing interface, and output to the corresponding terminal, and then the status of the relevant code can be checked through the display of the terminal, thereby troubleshooting the problem of thread crash and optimizing the thread. In this embodiment, since the call relationship of the current stack can be tracked by capturing the error signal and displayed in real time on the corresponding terminal, the thread crash can be analyzed in time, so the analysis is simpler and more efficient. Among them, the backtrace and backtrace_symbols functions are used to obtain the backtrace information in the thread, that is, a series of function call relationships. In this embodiment, they can be used to track the call relationship of the current stack.

[0033] As a specific implementation method of the above embodiment, monitoring the currently running thread according to the thread capture signal includes: capturing the running information of the currently running thread according to the thread capture signal, wherein the running information includes stack display information and thread pause information; monitoring the running status of the currently running thread according to the stack display information or the thread pause information.

[0034] It should be noted that in addition to capturing system error signals through thread capture signals to analyze thread crashes, thread crash analysis can also be performed directly through thread capture signals. Specifically, a private signal, namely, a thread capture signal, can be sent to the thread state to execute monitoring and analysis of running information, including display of task stack information, thread suspension, thread resumption, etc., to troubleshoot communication problems between threads.

[0035] In another embodiment, in addition to the above manual diagnosis, when an exception occurs during program operation, thread information can be saved through logs for later analysis.

[0036] As a specific implementation method of the above embodiment, after establishing a pointer linked list and establishing a thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information, and before obtaining a thread capture signal according to the thread name and the stack information, it also includes: obtaining thread data according to the thread, wherein the thread data includes a thread identifier; binding the pointer linked list to the thread data so that the thread identifier and the thread name correspond.

[0037] It should be noted that the thread identifier refers to the thread PID. When the thread is created by the system, the system information corresponds to the thread PID, which is not convenient for users to view. Therefore, it is necessary to bind the thread name to the thread PID so that the user can promptly understand the thread name of the crashed thread when viewing it, so as to perform thread crash analysis more timely. In some implementation processes, thread data can also be established to prevent data conflicts. The thread data is private thread data, including the thread name, the thread's own PID, and the thread semaphore. Specifically, the pthread_setspecific function is used in the apiTaskWrapper interface to create private thread data. pthread_setspecific is part of the thread data storage mechanism. In a multi-threaded program, for global variables, all threads can share them. When one of the threads changes the global variable, other threads will also change accordingly. Therefore, there may be data conflicts, and the pthread_setspecific function can avoid this situation.

[0038] As a specific implementation method of the above embodiment, a pointer linked list is established, and a thread is established based on the pointer linked list, including: establishing a pointer linked list and storing the thread initial value in the pointer linked list, wherein the thread initial value includes initial stack information; establishing a thread based on the initial stack information and the pointer linked list to initialize the thread.

[0039] It should be noted that when establishing a thread, the thread needs to be initialized. The thread can be initialized through the system interface and the thread initial value can be stored in a pointer linked list, where the thread initial value includes the thread's initial priority, initial scheduling strategy, initial stack information, etc.

[0040] As a specific implementation method of the above embodiment, a pointer linked list is established, and the thread initial value is stored in the pointer linked list, including: establishing a pointer linked list, wherein the pointer linked list includes priority information; storing the thread initial value in the priority information of the pointer linked list to implement thread priority conversion, wherein the thread initial value includes an initial priority.

[0041] It should be noted that in order to improve the portability of the platform, private priorities can be defined for threads, and thread priorities can be converted according to the characteristics of the specific operating system to achieve compatibility with multiple platforms. Specifically, when the thread is initialized, the initial priority value can be stored in the priority information of the pointer linked list, and the corresponding thread can be established based on the initial priority value.

[0042] It should be understood that although Figure 2The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0043] In one embodiment, Figure 3 As shown, a thread monitoring device is provided, including: a thread establishment module and a thread monitoring module, wherein:

[0044] A thread creation module is used to create a pointer linked list and create a thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information;

[0045] A signal establishment module is used to obtain a thread capture signal according to the thread name and stack information;

[0046] The thread monitoring module is used to monitor the running status of the currently running thread according to the thread capture signal.

[0047] Optionally, the thread monitoring module is further used to capture the running information of the currently running thread according to the thread capture signal; if the running information is an error signal, the running state of the currently running thread is monitored through the backtracking interface.

[0048] Optionally, the thread monitoring module is further used to obtain stack information of the currently running thread through a backtrace interface if the running information is an error signal; and perform thread crash analysis on the currently running thread according to the stack information.

[0049] Optionally, the thread monitoring module is also used to capture the running information of the currently running thread according to the thread capture signal, wherein the running information includes stack display information and thread pause information; and monitor the running status of the currently running thread according to the stack display information or the thread pause information.

[0050] Optionally, the thread establishment module is also used to establish a pointer linked list, establish a thread based on the pointer linked list, wherein the pointer linked list includes a thread name and stack information; obtain thread data based on the thread, wherein the thread data includes a thread identifier; bind the pointer linked list to the thread data so that the thread identifier and the thread name correspond.

[0051] Optionally, the thread establishment module is further used to establish a pointer linked list and store the thread initial value in the pointer linked list, wherein the thread initial value includes initial stack information; establish the thread according to the initial stack information and the pointer linked list to initialize the thread.

[0052] Optionally, the thread establishment module is also used to establish a pointer linked list, wherein the pointer linked list includes priority information; the thread initial value is stored in the priority information of the pointer linked list to implement thread priority conversion, wherein the thread initial value includes an initial priority.

[0053] For the specific definition of the thread monitoring device, please refer to the definition of the thread monitoring method above, which will not be repeated here. Each module in the above-mentioned thread monitoring device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0054] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for thread monitoring is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0055] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0056] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: establishing a pointer linked list, establishing a thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information; obtaining a thread capture signal according to the thread name and the stack information; and monitoring the running status of the currently running thread according to the thread capture signal.

[0057] In one embodiment, when executing the computer program, the processor further implements the following steps: capturing the running information of the currently running thread according to the thread capture signal; if the running information is an error signal, monitoring the running state of the currently running thread through the backtrace interface.

[0058] In one embodiment, when executing the computer program, the processor further implements the following steps: if the running information is an error signal, obtaining the stack information of the currently running thread through the backtrace interface; and performing thread crash analysis on the currently running thread according to the stack information.

[0059] In one embodiment, when the processor executes the computer program, the following steps are also implemented: capturing the running information of the currently running thread according to the thread capture signal, wherein the running information includes stack display information and thread pause information; and monitoring the running status of the currently running thread according to the stack display information or the thread pause information and the running information.

[0060] In one embodiment, when the processor executes the computer program, the following steps are also implemented: establishing a pointer linked list, establishing a thread based on the pointer linked list, wherein the pointer linked list includes a thread name and stack information; obtaining thread data based on the thread, wherein the thread data includes a thread identifier; binding the pointer linked list to the thread data so that the thread identifier and the thread name correspond.

[0061] In one embodiment, when the processor executes the computer program, the following steps are also implemented: establishing a pointer linked list and storing the thread initial value in the pointer linked list, wherein the thread initial value includes initial stack information; establishing the thread according to the initial stack information and the pointer linked list to initialize the thread.

[0062] In one embodiment, when the processor executes the computer program, the processor also implements the following steps: establishing a pointer linked list, wherein the pointer linked list includes priority information; storing the thread initial value in the priority information of the pointer linked list to implement thread priority conversion, wherein the thread initial value includes an initial priority.

[0063] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: establishing a pointer linked list, and establishing a thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information; obtaining a thread capture signal according to the thread name and the stack information; and monitoring the running status of the currently running thread according to the thread capture signal.

[0064] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: capturing the running information of the currently running thread according to the thread capture signal; if the running information is an error signal, monitoring the running state of the currently running thread through the backtrace interface.

[0065] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the running information is an error signal, the stack information of the currently running thread is obtained through the backtrace interface; and according to the stack information, a thread crash analysis is performed on the currently running thread.

[0066] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: capturing the running information of the currently running thread according to the thread capture signal; and monitoring the running state of the currently running thread according to the running information.

[0067] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: establishing a pointer linked list, establishing a thread based on the pointer linked list, wherein the pointer linked list includes a thread name and stack information; obtaining thread data based on the thread, wherein the thread data includes a thread identifier; binding the pointer linked list to the thread data so that the thread identifier and the thread name correspond.

[0068] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: establishing a pointer linked list and storing the thread initial value in the pointer linked list, wherein the thread initial value includes initial stack information; establishing the thread according to the initial stack information and the pointer linked list to initialize the thread.

[0069] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: establishing a pointer linked list, wherein the pointer linked list includes priority information; storing the thread initial value in the priority information of the pointer linked list to implement thread priority conversion, wherein the thread initial value includes an initial priority.

[0070] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0071] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0072] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A thread monitoring method, characterized in that: include: Establishing a pointer linked list, and establishing a thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information; Obtaining a thread capture signal according to the thread name and the stack information; Monitoring the running state of the currently running thread according to the thread capture signal, including capturing running information of the currently running thread according to the thread capture signal; if the running information is an error signal, monitoring the running state of the currently running thread through a backtracking interface; If the running information is an error signal, the stack information of the currently running thread is obtained through a backtrace interface; and according to the stack information, a thread crash analysis is performed on the currently running thread.

2. The thread monitoring method according to claim 1, characterized in that: Monitoring the currently running thread according to the thread capture signal includes: Capturing running information of the currently running thread according to the thread capture signal, wherein the running information includes stack display information and thread suspension information; The running state of the currently running thread is monitored according to the stack display information or the thread suspension information.

3. The thread monitoring method according to claim 1, characterized in that: After establishing a pointer linked list, and establishing the thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information, and before obtaining a thread capture signal according to the thread name and the stack information, the method further includes: Obtain thread data according to the thread, wherein the thread data includes a thread identifier; The pointer linked list is bound to the thread data so that the thread identifier corresponds to the thread name.

4. The thread monitoring method according to claim 1, characterized in that: Establishing a pointer linked list, and establishing the thread according to the pointer linked list, including: Establishing a pointer linked list, and storing the thread initial value in the pointer linked list, wherein the thread initial value includes initial stack information; The thread is established according to the initial stack information and the pointer linked list to initialize the thread.

5. The thread monitoring method according to claim 4, characterized in that: Establishing a pointer linked list and storing the thread initial value in the pointer linked list includes: Establishing a pointer linked list, wherein the pointer linked list includes priority information; The thread initial value is stored in the priority information of the pointer linked list to implement the priority conversion of the thread, wherein the thread initial value includes an initial priority.

6. A thread monitoring device, characterized in that: include: A thread establishment module, used to establish a pointer linked list, and establish the thread according to the pointer linked list, wherein the pointer linked list includes a thread name and stack information; A signal establishment module, used for obtaining a thread capture signal according to the thread name and the stack information; A thread monitoring module, used for monitoring the running state of the currently running thread according to the thread capture signal, including capturing the running information of the currently running thread according to the thread capture signal; if the running information is an error signal, monitoring the running state of the currently running thread through a backtracking interface; If the running information is an error signal, the stack information of the currently running thread is obtained through a backtrace interface; and according to the stack information, a thread crash analysis is performed on the currently running thread.

7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.