A general deadlock detection method and apparatus

By obtaining resource and operation lists from the software system, forming an association list, and performing deadlock pre-detection, the problem of the inability to universally detect deadlock in existing technologies is solved, and a non-intrusive universal deadlock detection method is realized.

CN114327923BActive Publication Date: 2026-07-14SOUTHERN POWER GRID DIGITAL GRID RESEARCH INSTITUTE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SOUTHERN POWER GRID DIGITAL GRID RESEARCH INSTITUTE CO LTD
Filing Date
2022-01-20
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing technologies are difficult to universally detect deadlocks across different software systems. Common detection methods require intruding into the software to obtain analysis data, which is not applicable to different software systems.

Method used

By acquiring the resource and operation lists of the software system, an association list is formed. Deadlock pre-detection is performed based on the association list and operation duration, and the deadlock results are used for detection to avoid intrusion into the software.

Benefits of technology

It achieves universal deadlock detection across different software systems, avoids intrusion into the detection target, and improves the universality and efficiency of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114327923B_ABST
    Figure CN114327923B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a general deadlock detection method and device, and belongs to the field of software systems. The detection method comprises the following steps: acquiring all resources in a software system to form a resource list; acquiring all operations on the resources in the software system and acquiring the duration of the operations to form an operation list; associating the resource list with the operation list to form an association list, wherein the association list is used to represent the association relationship between an operation and the resource to which the operation is directed in the software system; performing deadlock pre-detection based on the association list and the duration of each operation; determining whether the resource to which a target operation is directed is successfully called for the target operation that fails the deadlock pre-detection, and if the calling is successful, the target operation does not generate a deadlock; and if the calling fails, the target operation generates a deadlock. The application aims to detect deadlocks in different software systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software systems, and more specifically, to a general deadlock detection method and apparatus. Background Technology

[0002] Deadlock is a very common exception in software systems, occurring in network communication, inter-process communication, and database operations. If a deadlock occurs between program processes, the processes waiting for each other will remain blocked and never return, and the resources they are waiting for will never be unlocked. Similarly, if a deadlock occurs within database transactions, the transactions waiting for each other will also remain blocked, and the resources they are waiting for will also never be unlocked.

[0003] Currently, common detection schemes are designed by analyzing the conditions for deadlock generation. However, existing technologies have some problems. Existing schemes usually need to intrude into the software to obtain sufficient analysis data for the target when detecting deadlocks, so they are not universal. For example, detection tools used to detect Java thread deadlocks cannot detect deadlocks that occur in databases. Summary of the Invention

[0004] This application provides a general deadlock detection method and apparatus, which is designed to detect deadlocks in different software systems.

[0005] In a first aspect, embodiments of this application provide a general deadlock detection method, including:

[0006] Obtain all current resources in the software system and create a resource list;

[0007] Obtain all operations performed on resources in the software system and the duration of each operation to form an operation list;

[0008] The resource list is associated with the operation list to form an association list, which is used to represent the association relationship between an operation in the software system and the resource targeted by the operation.

[0009] Based on the association list and the duration of each operation, deadlock pre-detection is performed;

[0010] For target operations that fail deadlock pre-detection, determine whether the call to the resource targeted by the target operation was successful.

[0011] If the call is successful, the target operation does not result in a deadlock;

[0012] If the call fails, the target operation will result in a deadlock.

[0013] Optionally, obtaining all current resources in the software system to form a resource list includes:

[0014] Set the detection cycle and create a resource list corresponding to each detection cycle;

[0015] During the detection period, resource identification information in the software system is continuously acquired, and the resource identification information is used to characterize the resources in the software system;

[0016] The resource identification information is added to the resource list.

[0017] Optionally, during the detection period, whenever a resource disappears from the software system, the resource identification information corresponding to that resource is deleted from the resource list.

[0018] Optionally, all operations performed on resources in the software system are obtained, and the duration of each operation is obtained to form an operation list, including:

[0019] At the start of the detection cycle, all operations performed on resources in the software system are acquired to form a pre-operation list;

[0020] Continuously acquire all operations performed on resources in the software system and generate a reporting list;

[0021] Based on the pre-operation list and the reporting list, determine whether there are any completed operations or new operations;

[0022] Whenever an operation is completed or a new operation is initiated, the pre-operation list is updated to obtain the operation list.

[0023] Optionally, the method further includes: updating the duration of all operations in the pre-operation list when updating the pre-operation list.

[0024] Optionally, associating the resource list with the operation list to form an association list includes:

[0025] Based on the operation list, obtain the resources called by all operations in the operation list;

[0026] Set an operation identifier within the resource list to obtain the associated list.

[0027] Optionally, the deadlock pre-detection based on the association list, resource list, and operation duration includes:

[0028] Based on the association list, a time threshold is set for each operation in the association list;

[0029] If the duration of the operation is greater than or equal to the time threshold of the operation, then the deadlock pre-detection fails.

[0030] If the duration of the operation is less than the time threshold of the operation, then deadlock pre-detection is performed.

[0031] Secondly, embodiments of this application provide a general deadlock detection device, including a resource list module, an operation list module, an association module, a deadlock prediction and detection module, and a deadlock detection module;

[0032] The resource list module is used to retrieve all current resources in the software system and form a resource list.

[0033] The operation list module is used to obtain all operations performed on resources in the software system and the duration of the operations to form an operation list.

[0034] The association module is used to associate the resource list with the operation list to form an association list, which is used to represent the association relationship between an operation in the software system and the resource targeted by the operation.

[0035] The deadlock prediction and detection module is used to perform deadlock pre-detection based on the association list and the duration of each operation;

[0036] The deadlock detection module is used to determine whether the call to the resource targeted by the target operation was successful for target operations that failed the deadlock pre-detection.

[0037] If the call is successful, the target operation does not result in a deadlock;

[0038] If the call fails, the target operation will result in a deadlock.

[0039] Beneficial effects: This application obtains a resource list by acquiring all resources in the software system and an operation list by acquiring all operations performed on those resources. The resource list and operation list are then linked together to form an association list. Deadlock pre-detection is performed using the association list and the duration of each operation. Target operations that fail the deadlock pre-detection may have experienced deadlock. The resource targeted by the potentially deadlocked target operation is then invoked. From the perspective of the consequences of deadlock, if a target operation is deadlocked, the resource it targets cannot be invoked. Therefore, target operations that successfully invoke the resource do not experience deadlock, while those that fail do. During detection, because this method detects deadlock based on the consequences of deadlock leading to failure in invoking the deadlocked resource, it does not need to consider the target system during detection. As long as the operation list and resource list of the target system are available, deadlock detection can be performed, achieving the effect of detecting deadlocks in different software systems. Attached Figure Description

[0040] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1 This is a flowchart of the detection method proposed in one embodiment of this application;

[0042] Figure 2 This is a functional block diagram of a detection device proposed in an embodiment of this application. Detailed Implementation

[0043] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0044] Example 1

[0045] Reference Figure 1 The flowchart of a general deadlock detection method according to an embodiment of the present invention is shown, as follows: Figure 1 As shown, this detection method may specifically include the following steps:

[0046] S101: Obtain all current resources in the software system and form a resource list;

[0047] A resource list is used to store all the resources in a software system. For example, in a database system, if the database uses table-level locks, the resource list stores all the table names in the database system, and all resources in the database system can be found by the table name.

[0048] S102, Obtain all operations performed on resources in the software system and obtain the duration of the operations to form an operation list;

[0049] Whenever a resource-related operation occurs in the software system, these operations are captured and summarized into an operation list. When summarizing, the operation list also records the time of the operation.

[0050] S103, associate the resource list with the operation list to form an association list, the association list being used to characterize the association relationship between an operation in the software system and the resource targeted by that operation;

[0051] The operation list records all operations involving resources in the software system, while the resource list records all resources in the software system. By recording the association relationship between an operation and the resource it targets in the software system through the association list, when performing deadlock detection on an operation, the resource it targets can be found more quickly in the association list.

[0052] S104, perform deadlock pre-detection based on the association list and the duration of each operation;

[0053] Deadlock pre-detection aims to identify operations in the operation list that may lead to deadlock, providing a data foundation for the next step of deadlock detection.

[0054] S105, for target operations that fail deadlock pre-detection, determine whether the call to the resource targeted by the target operation was successful.

[0055] If the call is successful, the target operation does not result in a deadlock;

[0056] If the call fails, the target operation will result in a deadlock.

[0057] When performing deadlock detection on a target operation, the method of the resource targeted by the target operation is invoked. If the target operation results in a deadlock, the resource targeted by the target operation will also be locked, preventing invocation. If the target operation does not result in a deadlock, the resource targeted by the target operation can still be invoked. The detection method focuses on the result of the deadlock, which is more convenient than the conventional approach of detecting the conditions generated by the target operation. Furthermore, this result-based detection method can be applied to different software systems without the need to develop new deadlock detection tools for different software systems, demonstrating strong versatility.

[0058] This embodiment obtains a resource list by acquiring all resources in the software system and an operation list by acquiring all operations performed on those resources. The resource list and operation list are then linked together to form an association list. Deadlock pre-detection is performed using the association list and the duration of each operation. Target operations that fail the deadlock pre-detection may have experienced deadlock. The resource targeted by the potentially deadlocked target operation is then invoked. From the perspective of the consequences of deadlock, if a target operation is deadlocked, the resource it targets cannot be invoked. Therefore, a target operation that successfully invokes the resource it targets does not experience deadlock, while a target operation that fails to invoke the resource it targets experiences deadlock. During detection, because this method detects deadlock based on the consequences of deadlock leading to failure to invoke the deadlocked resource, it does not need to consider the target system during detection. As long as the operation list and resource list of the target system can be obtained, deadlock detection can be performed, achieving the effect of detecting deadlocks in different software systems.

[0059] Example 2

[0060] Reference Figure 1 The diagram illustrates a flowchart of a general deadlock detection method according to an embodiment of this application. Figure 1 As shown, the detection method may specifically include the following steps:

[0061] S101, Obtain all current resources in the software system and form a resource list; including:

[0062] Set the detection cycle and create a resource list corresponding to each detection cycle;

[0063] The detection cycle is the period during which deadlocks need to be detected. The detection cycle can be set by the staff or set to a random cycle. For example, if it is necessary to detect whether deadlocks have occurred in the software system from 12:00 to 16:00, the detection cycle is set to a 4-hour cycle, and the resource list should list all resources that may be locked within these 4 hours.

[0064] During the detection period, resource identification information in the software system is continuously acquired, and the resource identification information is used to characterize the resources in the software system;

[0065] Resource identification information can represent resources within a software system. When the software system is a database, if the resource is a table in the database, then the resource identification information is the table name; if the resource is a record in the table, then the resource identification information is the row lock in the table.

[0066] The resource identification information is added to the resource list.

[0067] During the detection period, all potentially locked resources within the software system must be included in the software system to prevent the occurrence of a deadlock being detected when no deadlock has actually occurred.

[0068] During the detection period, whenever a resource disappears from the software system, the resource identification information corresponding to that resource is deleted from the resource list.

[0069] The resource identification information in the resource list needs to be updated in real time. If a resource in the software system is deleted by the software system, the corresponding resource identification information of that resource needs to be deleted from the resource list to prevent detection vulnerabilities.

[0070] S102, Obtain all operations performed on resources in the software system and obtain the duration of each operation to form an operation list; including:

[0071] At the start of the detection cycle, all operations performed on resources in the software system are acquired to form a pre-operation list;

[0072] In a software system, any operation that requires calling the software system will be recorded accordingly. In this embodiment, a script is used to capture operations within the software system. For example, during the detection period, a script is used to execute thread commands built into the operating system to obtain and report thread information in the program processes within the operating system, or triggers are used to detect changes in transactions in the database. Both methods can obtain operations within the operating system. By identifying whether an operation calls for resources and eliminating operations that do not, a pre-operation list can be formed.

[0073] Continuously acquire all operations performed on resources in the software system and generate a reporting list;

[0074] During the detection period, any operation that calls for resources is added to the reporting list. The reporting list is a list of operations captured in real time during the detection period. Unlike the pre-operation list, which needs to be updated through the reporting list, the reporting list is the source of information for the pre-operation list.

[0075] Based on the pre-operation list and the reporting list, determine whether there are any completed operations or new operations;

[0076] Whenever an operation is completed or a new operation is initiated, the pre-operation list is updated to obtain the operation list.

[0077] If an operation is completed, it is unlikely to cause a deadlock, so it needs to be removed from the pre-operation list. If a new operation occurs, it needs to be added to the pre-operation list to form the final operation list. In this embodiment, the pre-operation list is updated in real time based on the reported list, and the operation list is the updated pre-operation list. Therefore, the operations listed in the operation list are consistent with the operations that exist in the software system in real time, and there will be no deviation.

[0078] S103, associate the resource list with the operation list to form an association list, the association list being used to characterize the association relationship between an operation in the software system and the resource targeted by that operation;

[0079] The resource list contains all the resources in the software system during the testing period, while the operation list contains all the operations performed on those resources during the testing period. There is a relationship between the operations in the operation list and the resources in the resource list. By setting up an association list, this relationship can be clearly indicated.

[0080] The associated list includes:

[0081] Based on the operation list, obtain the resources called by all operations in the operation list;

[0082] Set an operation identifier within the resource list to obtain the associated list.

[0083] In the resource list, some resources may only exist in the software system and not be invoked by operations within the software system, while all operations in the operation list have corresponding resources in the resource list; therefore, when associating the operation list and the resource list, the association is achieved by setting operation identifiers in the resource list to ensure that all operations in the associated list have corresponding resources.

[0084] S104, based on the association list and the duration of each operation, perform deadlock pre-detection; including:

[0085] Based on the association list, a time threshold is set for each operation in the association list;

[0086] In setting the time threshold, the time threshold is set to be greater than the upper limit of the duration of each operation in the software system. Furthermore, the time threshold setting is related to the operation itself; some operations have a longer lifespan in the software system, so the time threshold will be set higher. For example, an operation that calls a table in the database may only last a few milliseconds in the software system, so the time threshold is set to one second; an operation that downloads data from the database may last up to ten minutes, so the time threshold is set to fifteen minutes. When the software system is performing an operation, if the operation has already been completed, the software system will kill the operation to avoid excessive operations consuming system resources.

[0087] If the duration of the operation is greater than or equal to the time threshold of the operation, then the deadlock pre-detection fails.

[0088] During deadlock pre-detection, if it is found that the operation of calling a table in the database has lasted for more than one minute, which exceeds the set time threshold and is much longer than the normal time required to call a table, then the operation may have deadlocked and will be placed in the category of failing deadlock pre-detection.

[0089] If the duration of the operation is less than the time threshold of the operation, then deadlock pre-detection is performed.

[0090] If the operation of downloading data from the database is found to last for nine minutes, then its duration is less than the time threshold, and the operation will be killed by the system after it ends. Therefore, the operation is definitely not deadlocked and is considered to have passed the deadlock pre-detection.

[0091] S105, for target operations that fail deadlock pre-detection, determine whether the call to the resource targeted by the target operation was successful.

[0092] If the call is successful, the target operation does not result in a deadlock;

[0093] If the call fails, the target operation will result in a deadlock.

[0094] Deadlock pre-detection is a screening process that filters operations that exceed a time threshold. Operations that fail the deadlock pre-detection may result in deadlock, but other system problems may also cause their duration to be greater than or equal to the time threshold. Therefore, the results of the deadlock pre-detection need to be confirmed again.

[0095] In determining the outcome, this embodiment adopts a result-based approach. In a software system, if a deadlock occurs between program processes, the processes waiting for each other will be blocked indefinitely and will never return, and the resources they are waiting for will never be unlocked. For example, in a database, if a deadlock occurs between database transactions, the transactions waiting for each other will also be blocked indefinitely, and the resources they are waiting for will never be unlocked.

[0096] The deadlock results show that to determine if a deadlock has occurred, it's sufficient to perform a final check by calling the resource targeted by the potentially deadlocked operation, based on the deadlock pre-detection. If the resource can be called, it means the operation corresponding to that resource did not lock it; the operation failed the deadlock pre-detection for other reasons. If the resource cannot be called, it means the operation corresponding to that resource has locked it, resulting in a deadlock. Through deadlock pre-detection and subsequent verification, it can be determined whether a deadlock has actually occurred, completing the deadlock detection process. Furthermore, the method provided in this embodiment focuses on the results. Unlike traditional methods, it does not require intrusion into the software to obtain sufficient analytical data for the detection target. It is a non-intrusive detection method applicable to various software systems.

[0097] This embodiment obtains a resource list by acquiring all resources in the software system and an operation list by acquiring all operations performed on those resources. The resource list and operation list are then linked together to form an association list. Deadlock pre-detection is performed using the association list and the duration of each operation. Target operations that fail the deadlock pre-detection may have experienced deadlock. The resource targeted by the potentially deadlocked target operation is then invoked. From the perspective of the consequences of deadlock, if a target operation is deadlocked, the resource it targets cannot be invoked. Therefore, a target operation that successfully invokes the resource it targets does not experience deadlock, while a target operation that fails to invoke the resource it targets experiences deadlock. During detection, because this method detects deadlock based on the consequences of deadlock leading to failure to invoke the deadlocked resource, it does not need to consider the target system during detection. As long as the operation list and resource list of the target system are available, deadlock detection can be performed, achieving the effect of detecting deadlocks in different software systems. This deadlock detection method is universal.

[0098] Example 3

[0099] Based on the same inventive concept Figure 2 The diagram shown is a schematic of a general deadlock detection device, with reference to Figure 2 As shown, the detection device may include a resource list module, an operation list module, an association module, a deadlock prediction and detection module, and a deadlock detection module;

[0100] The resource list module is used to retrieve all current resources in the software system and form a resource list.

[0101] The operation list module is used to obtain all operations performed on resources in the software system and the duration of the operations to form an operation list.

[0102] The association module is used to associate the resource list with the operation list to form an association list, which is used to represent the association relationship between an operation in the software system and the resource targeted by the operation.

[0103] The deadlock prediction and detection module is used to perform deadlock pre-detection based on the association list and the duration of each operation;

[0104] The deadlock detection module is used to determine whether the call to the resource targeted by the target operation is successful if the target operation fails the deadlock pre-detection. If the call is successful, the target operation does not cause a deadlock; if the call fails, the target operation causes a deadlock.

[0105] The resource list module includes a list creation unit, a resource identification information acquisition unit, an import unit, and a deletion unit; among them,

[0106] The list creation unit is used to set the detection cycle and create a resource list corresponding to each detection cycle.

[0107] The resource identification information acquisition unit is used to continuously acquire resource identification information in the software system during the detection period, and the resource identification information is used to characterize the resources in the software system.

[0108] The import unit is used to add the resource identification information to the resource list;

[0109] The deletion unit is used to delete the resource identification information corresponding to a resource from the resource list whenever a resource disappears from the software system during the detection period.

[0110] The operation module includes a pre-operation list unit, a reporting unit, an operation judgment unit, and an operation list update unit; among which,

[0111] The pre-operation list unit is used to acquire all operations performed on resources in the software system at the beginning of the detection period and form a pre-operation list;

[0112] The reporting unit is used to continuously acquire all operations performed on resources in the software system and form a reporting list;

[0113] The operation judgment unit determines, based on the pre-operation list and the reporting list, whether there is an operation that has been completed or a new operation.

[0114] The operation list update unit updates the pre-operation list whenever an operation is completed or a new operation is performed, thus obtaining the operation list.

[0115] The association module includes a resource relationship acquisition unit and an operation identifier setting unit; among which,

[0116] The resource relationship acquisition unit is used to acquire the resources called by all operations in the operation list based on the operation list;

[0117] The operation identifier setting unit is used to set operation identifiers within the resource list to obtain an association list.

[0118] The deadlock prediction and detection module includes a time threshold setting unit and a time threshold judgment unit; wherein,

[0119] The time threshold setting unit sets a time threshold for each operation in the association list based on the association list;

[0120] The time threshold determination unit determines that if the duration of the operation is greater than or equal to the time threshold of the operation, then the deadlock pre-detection fails.

[0121] If the duration of the operation is less than the time threshold of the operation, then deadlock pre-detection is performed.

[0122] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0123] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0124] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0125] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0126] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0127] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0128] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0129] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0130] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A general deadlock detection method, characterized in that, The method includes: Obtain all current resources in the software system and create a resource list; Obtain all operations performed on resources in the software system and the duration of each operation to form an operation list; The resource list is associated with the operation list to form an association list, which is used to represent the association relationship between an operation in the software system and the resource targeted by the operation. Based on the aforementioned association list and the duration of each operation, deadlock pre-detection is performed; For target operations that fail deadlock pre-detection, the success of the call to the resource targeted by the target operation is determined by the result of a single call to that resource. If the call is successful, the target operation does not result in a deadlock; If the call fails, the target operation will result in a deadlock. Obtain all resource operations performed in the software system and the duration of each operation to form an operation list, including: At the start of the detection period, all operations performed on resources in the software system are acquired to form a pre-operation list; Continuously acquire all operations performed on resources in the software system and generate a reporting list; Based on the pre-operation list and the reporting list, determine whether there are any completed operations or new operations; Whenever an operation is completed or a new operation is initiated, the pre-operation list is updated to obtain the operation list. The step of associating the resource list with the operation list to form an association list includes: Based on the operation list, obtain the resources called by all operations in the operation list; Set an operation identifier within the resource list to obtain the associated list.

2. The general deadlock detection method according to claim 1, characterized in that, The process of acquiring all current resources in the software system and forming a resource list includes: Set the detection cycle and create a resource list corresponding to each detection cycle; During the detection period, resource identification information in the software system is continuously acquired, and the resource identification information is used to characterize the resources in the software system; The resource identification information is added to the resource list.

3. The general deadlock detection method according to claim 2, characterized in that, The method further includes: During the detection period, whenever a resource disappears from the software system, the resource identification information corresponding to that resource is deleted from the resource list.

4. The general deadlock detection method according to claim 1, characterized in that, The method further includes updating the duration of all operations in the pre-operation list when updating the pre-operation list.

5. The general deadlock detection method according to claim 1, characterized in that, The deadlock pre-detection based on the association list and the duration of each operation includes: Based on the association list, a time threshold is set for each operation in the association list; If the duration of the operation is greater than or equal to the time threshold of the operation, then the deadlock pre-detection fails. If the duration of the operation is less than the time threshold of the operation, then deadlock pre-detection is performed.

6. A universal deadlock detection device, characterized in that, It includes a resource list module, an operation list module, an association module, a deadlock prediction and detection module, and a deadlock detection module; The resource list module is used to retrieve all current resources in the software system and form a resource list. The operation list module is used to obtain all operations performed on resources in the software system and the duration of the operations to form an operation list. The association module is used to associate the resource list with the operation list to form an association list, which is used to represent the association relationship between an operation in the software system and the resource targeted by the operation. The deadlock prediction and detection module is used to perform deadlock pre-detection based on the association list and the duration of each operation; The deadlock detection module is used to determine whether the deadlock pre-detection of a target operation was successful by calling the resource targeted by the target operation once. If the call is successful, the target operation does not result in a deadlock; If the call fails, the target operation will result in a deadlock. The operation module includes a pre-operation list unit, a reporting unit, an operation judgment unit, and an operation list update unit; among which, The pre-operation list unit is used to obtain all operations performed on resources in the software system at the beginning of the detection period and form a pre-operation list; The reporting unit is used to continuously acquire all operations performed on resources in the software system and form a reporting list; The operation judgment unit determines, based on the pre-operation list and the reporting list, whether there is an operation that has been completed or a new operation. The operation list update unit updates the pre-operation list whenever an operation is completed or a new operation is performed, thus obtaining the operation list. The association module includes a resource relationship acquisition unit and an operation identifier setting unit; among which, The resource relationship acquisition unit is used to acquire the resources called by all operations in the operation list based on the operation list; The operation identifier setting unit is used to set operation identifiers within the resource list to obtain an association list.