Information display method and device, computer equipment, readable storage medium and program product

By building a global graph data structure in a distributed database and detecting and displaying deadlock rings, the complexity of deadlock detection and cancellation in a distributed database is solved, real-time and accurate deadlock ring detection and display is realized, and the efficiency of deadlock cancellation is improved.

CN120011428AActive Publication Date: 2025-05-16CHINA TELECOM CLOUD TECH CO LTD

Patent Information

Application Number
CN202510461810.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-05-16
Estimated Expiration
2045-04-14

AI Technical Summary

Technical Problem

The deadlock problem in distributed databases is complex and difficult to detect and relieve, especially when remote resources across nodes are involved, it is difficult for the existing technology to achieve real-time and accurate deadlock ring detection and display.

Method used

By sending an information acquisition request to the second node when the first target transaction is in the lock waiting state, a dependency information in the auxiliary process is obtained, and a global graph data structure is constructed, and transaction information and lock waiting relationship information in the deadlock ring are detected and displayed.

Benefits of technology

Real-time aggregation of dependent information and fast and accurate detection of deadlock rings are realized, helping developers intuitively identify deadlock transactions and improving deadlock cancellation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011428A_ABST
    Figure CN120011428A_ABST
Patent Text Reader

Abstract

The invention relates to an information display method and device, computer equipment, a readable storage medium and a program product. The method comprises: when a first target transaction is in a lock waiting state, in response to dependency information sent by a target node, sending an information acquisition request to a second node to instruct the second node to acquire dependency information in an auxiliary process and send the dependency information to a first node; wherein the dependency information comprises that the first target transaction is in a lock holding state; generating a corresponding graph data structure on the basis of dependency information stored in the graph data structure and the received dependency information; points in the graph data structure comprise transaction information, and edges in the graph data structure comprise lock waiting relation information between transactions; and in response to the loop existing in the graph data structure, displaying transaction information contained in the loop and lock waiting relationship information between transactions. By adopting the method, the deadlock removing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and in particular to an information display method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] A distributed database is a database system that stores data on multiple computers (nodes) that are connected through a network and work together. With the widespread application of distributed databases, its deadlock problem has gradually become an important challenge in system design and operation and maintenance.

[0003] Deadlock refers to a blocking state where two or more processes cannot continue to execute because they hold resources needed by each other. In a distributed database, multiple transactions may be deadlocked on multiple nodes at the same time. This deadlock involves not only local resources but also remote resources across nodes. Due to the complexity of the distributed environment and the dispersion of resources, deadlock detection and resolution become more difficult. Summary of the invention

[0004] Based on this, it is necessary to provide an information display method, device, computer equipment, computer-readable storage medium and computer program product that can improve the efficiency of deadlock release in response to the above technical problems.

[0005] In a first aspect, the present application provides an information display method, which is applied to a first node, and the method includes:

[0006] In the case where the first target transaction is in a lock waiting state, in response to the dependency information sent by the target node, an information acquisition request is sent to the second node to instruct the second node to acquire the dependency information in the auxiliary process and send the dependency information to the first node; wherein the dependency information includes that the first target transaction is in a lock holding state; the target node is any node of the second nodes, and the second node is a node other than the first node in the distributed database system;

[0007] Generate a corresponding graph data structure based on the dependency information stored in the system and the dependency information received; the points in the graph data structure contain transaction information, and the edges in the graph data structure contain lock waiting relationship information between transactions;

[0008] In response to a loop existing in the graph data structure, transaction information included in the loop and lock wait relationship information between transactions are displayed.

[0009] In one of the embodiments, when the first target transaction is in a lock waiting state, in response to the dependency information sent by the target node, an information acquisition request is sent to the second node, which includes:

[0010] In response to a first target transaction being in a lock waiting state, constructing first dependency information between the first target transaction and a second target transaction; the second target transaction holds the lock that the first target transaction is waiting for;

[0011] The first dependency information is sent to a second node where the second target transaction is located; wherein the second node is used to construct second dependency information between the second target transaction and a third target transaction in response to the second target transaction being in a lock waiting state, and send the second dependency information to the node where the third target transaction is located; the third target transaction holds the lock that the second target transaction is waiting for.

[0012] In one of the embodiments, when the first target transaction is in a lock wait state, in response to the dependency information sent by the target node, sending an information acquisition request to the second node to instruct the second node to acquire the dependency information in the auxiliary process and send the dependency information to the first node, includes:

[0013] When the first target transaction is in a lock waiting state, in response to the dependency information sent by the target node, an information acquisition request is sent to the second node to instruct the second node to respond to the information acquisition request, send a write signal to the auxiliary process, and read the dependency information in the shared memory and send it to the first node; wherein the auxiliary process is used to write the dependency information stored in itself into the shared memory of the second node in response to the write signal.

[0014] In one embodiment, in response to the existence of a loop in the graph data structure, displaying transaction information contained in the loop and lock wait relationship information between transactions includes:

[0015] Assigning a unique identifier to the transaction information of each transaction in the graph data structure;

[0016] In response to the existence of a loop in the graph data structure, unique identifiers corresponding to the transaction information contained in the loop are concatenated according to a preset sorting rule to obtain identification information of the loop;

[0017] Based on the identification information, the transaction information included in the loop and the lock waiting relationship information between the transactions are displayed.

[0018] In one of the embodiments, in response to the existence of a loop in the graph data structure, unique identifiers corresponding to the transaction information included in the loop are concatenated according to a preset sorting rule to obtain identification information of the loop, followed by:

[0019] Calculate and save the hash value corresponding to the identification information;

[0020] The stored identification information is deduplicated based on the hash value.

[0021] In one embodiment, in response to the existence of a loop in the graph data structure, the transaction information contained in the loop and the lock waiting relationship information between transactions are displayed, followed by:

[0022] A transaction with the lowest priority is determined from the loop, and execution of the transaction is suspended.

[0023] In a second aspect, the present application also provides an information display device, including:

[0024] an information acquisition module, configured to send an information acquisition request to a second node in response to dependency information sent by a target node when a first target transaction is in a lock waiting state, so as to instruct the second node to acquire dependency information in an auxiliary process and send the dependency information to the first node; wherein the dependency information includes that the first target transaction is in a lock holding state; the target node is any node among the second nodes, and the second node is a node other than the first node in a distributed database system;

[0025] A graph model building module, used to generate a corresponding graph data structure based on the dependency information stored in the module and the dependency information received; the points in the graph data structure contain transaction information, and the edges in the graph data structure contain lock waiting relationship information between transactions;

[0026] The information display module is used to display the transaction information contained in the loop and the lock waiting relationship information between transactions in response to the existence of a loop in the graph data structure.

[0027] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above-described methods when executing the computer program.

[0028] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of any of the methods described above when executed by a processor.

[0029] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of any of the methods described above when executed by a processor.

[0030] The above-mentioned information display method, apparatus, computer equipment, computer-readable storage medium and computer program product can achieve real-time convergence of dependency information by acquiring dependency information saved by auxiliary processes in other nodes when a deadlock is detected based on local dependency information; by constructing a global graph data structure based on the acquired dependency information, searching for deadlock loops in the graph data structure and displaying the information contained in the loop, it is possible to detect the deadlock loop in real time and quickly and accurately draw the deadlock loop information, which can make it easier for developers to troubleshoot and locate defects, allowing users to more intuitively see which transactions have deadlocked, and facilitating users to adjust business logic strategies to avoid deadlocks. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0032] Figure 1 A schematic diagram of a centralized deadlock detection in the related art;

[0033] Figure 2 A schematic diagram of distributed deadlock detection in related technology;

[0034] Figure 3 is a flow chart of an information display method in one embodiment;

[0035] Figure 4 is a flow chart of an information display method in another embodiment;

[0036] Figure 5 A schematic diagram of obtaining dependency information in one embodiment;

[0037] Figure 6 is a flowchart of an information display method in another embodiment;

[0038] Figure 7 is a structural block diagram of an information display device in an embodiment;

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

[0040] 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.

[0041] In the description of the present application, it should be understood that if the terms "first" and "second" appear, these terms are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present application, if the term "plurality" appears, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0042] In related technologies, the methods of deadlock detection in distributed databases are mainly divided into centralized and distributed methods. Figure 1 Centralized deadlock detection mainly involves the central node requesting the waiting information of transactions from all other nodes, and then constructing the dependency relationships between all transactions (such as Figure 1 ), and then find the deadlock loop through these dependencies. Figure 1 a, b, c, d, e in the above table represent transactions; WFG (Wait-for Graph) is a waiting graph. After obtaining the global dependency relationship, the central node usually searches for deadlocks by calling the interface function regularly. The centralized deadlock detection in related technologies has poor real-time performance. Please refer to Figure 2 In distributed deadlock detection, each node can only perform detection based on local dependency information and cooperate with other nodes through message passing to detect whether a deadlock occurs. Since each node only stores local dependency information, the distributed deadlock detection in related technologies cannot obtain the complete dependency information of the deadlock loop in real time and accurately. For example, when Figure 2 Node 1 in the example is the first node to send a message. The message can be transmitted back to node 1 via node 2, node 3, and node 4 in sequence, or transmitted back to node 1 via node 3 and node 4 in sequence. At this time, node 1 can detect the occurrence of deadlock, but node 1 cannot know the path of the deadlock loop.

[0043] Based on this, the embodiment of the present application provides an information display method, which can be applied to nodes in a distributed database system. Here, the distributed database system can be implemented based on PostgreSQL, MySQL, etc. Figure 3 As shown, the method is applied to the first node in a distributed database system as an example. The method includes the following steps S102 to S106.

[0044] Step S102, when the first target transaction is in a lock waiting state, in response to the dependency information sent by the target node, an information acquisition request is sent to the second node to instruct the second node to obtain the dependency information in the auxiliary process and send the dependency information to the first node; wherein the dependency information includes that the first target transaction is in a lock holding state; the target node is any node among the second nodes, and the second node is a node other than the first node in the distributed database system.

[0045] The first node / second node may be used to maintain its own dependency information (e.g., dependency information related to local transactions), that is, the first node / second node may store local dependency information of the distributed database system. In a possible implementation, the distributed database system may perform distributed deadlock detection on each node, so that each node maintains its own dependency information. The first node / second node may be a computing node. The first node may be any computing node in the distributed database system.

[0046] The first target transaction can be used to execute on the first node. The first target transaction is in a lock waiting state, which means that the first target transaction is waiting to obtain a lock for a resource, but because the lock is already held by other transactions, it cannot continue to execute and enters a blocked state. Specifically, when a waiting relationship occurs between transactions, a transaction dependency pair is generated. A transaction dependency pair includes a waiting transaction and a waited transaction, which are in a lock waiting state and a lock holding state respectively, and the waited transaction holds the lock that the waiting transaction is waiting for. For a distributed database system, each transaction dependency pair may occur on any node.

[0047] Exemplarily, when the first node determines that the first target transaction is in a lock waiting state (that is, the first target transaction is waiting for a certain resource), and receives dependency information sent by the target node including that the first target transaction is in a lock holding state (that is, the first target transaction occupies a certain resource), an information acquisition request can be sent to all second nodes in the distributed database system to instruct the second nodes to each acquire the dependency information stored by themselves and send the acquired dependency information to the first node. In this way, the first node can obtain all the dependency information of the distributed database system. Among them, the first node / second node can store its own dependency information based on the auxiliary process. The auxiliary process can be generated when the first node / second node executes the main process. The function of the main process can be deadlock detection, cross-node communication, etc., and one node can have one auxiliary process.

[0048] Specifically, when the first node determines that the first target transaction is in a lock waiting state, and receives the dependency information sent by the target node including that the first target transaction is in a lock holding state, it can be determined whether a deadlock exists based on the necessary conditions of the deadlock. If a deadlock exists, the first node can send an information acquisition request to all second nodes in the distributed database system to instruct the second nodes to each obtain the dependency information stored by themselves and send the acquired dependency information to the first node. Among them, deadlock is a situation where two or more processes hold the resources required by each other, causing them to be unable to continue execution and enter a blocking state that cannot be resolved. The necessary conditions for deadlock include: mutual exclusion, hold and wait, non-preemption, and circular waiting.

[0049] Step S104, based on the dependency information stored in itself and the received dependency information, a corresponding graph data structure is generated; the points in the graph data structure contain transaction information, and the edges in the graph data structure contain lock waiting relationship information between transactions.

[0050] Exemplarily, the first node may store its own stored dependency information and received dependency information in a graph data structure. The graph data structure may be implemented based on an array and a linked list, where each position in the array corresponds to a transaction node and contains a list of downstream nodes of the transaction node. In one possible implementation, the graph data structure may be a directed wait graph (Wait For Graph, WFG). The edges in a directed wait graph are all directed edges, with transactions as nodes and the wait relationships between transactions as edges, so that a global or local wait relationship graph of a distributed database system can be drawn. The graph data structure may also be a resource allocation graph.

[0051] Step S106 , in response to the existence of a loop in the graph data structure, displaying transaction information included in the loop and lock wait relationship information between transactions.

[0052] Exemplarily, the first node may detect deadlock loops in the graph data structure based on a depth-first search (DFS) algorithm. After processing the entire graph data structure, the first node may save all the obtained deadlock loops into a log or print them to a terminal for visual display of the deadlock loops.

[0053] In the above information display method, by obtaining the dependency information saved by the auxiliary process in other nodes when a deadlock is detected based on local dependency information, real-time aggregation of dependency information can be achieved; by building a global graph data structure based on the obtained dependency information, searching for deadlock loops in the graph data structure and displaying the information contained in the loop, the deadlock loop can be detected in real time and the deadlock loop information can be quickly and accurately drawn, which can make it easier for developers to troubleshoot and locate defects, allowing users to more intuitively see which transactions have deadlocked, and facilitating users to adjust business logic strategies to avoid deadlocks.

[0054] In an exemplary embodiment, Figure 4 As shown, the above information display method may also include:

[0055] Step S1011 , in response to the first target transaction being in a lock waiting state, constructing first dependency information between the first target transaction and the second target transaction; the second target transaction holds the lock that the first target transaction is waiting for.

[0056] The second target transaction may be executed on a different node from the first target transaction.

[0057] Step S1012, sending the first dependency information to the second node where the second target transaction is located; wherein the second node is used to construct second dependency information between the second target transaction and the third target transaction in response to the second target transaction being in a lock waiting state, and send the second dependency information to the node where the third target transaction is located; the third target transaction holds the lock that the second target transaction is waiting for.

[0058] Among them, the third target transaction can be used to execute on a different node from the second target transaction. The first dependency information / the second dependency information may include transaction information and lock wait relationship information between transactions. The node where the third target transaction is located may be the first node / the second node. It can be understood that when the node where the third target transaction is located is the first node, the deadlock ring includes two transaction nodes; when the node where the third target transaction is located is the second node, the deadlock ring includes at least three transaction nodes.

[0059] Exemplarily, the first node / the second node can be used to execute a distributed deadlock detection algorithm. By deducing the distributed deadlock detection algorithm, the distributed database system can detect the existence of a deadlock. In a possible implementation, the steps of the distributed deadlock detection algorithm may include: each node (including the first node and the second node) in the distributed database system generates dependency information during the execution of a background process, and each node saves the dependency information in its own auxiliary process, and each node sends the dependency information to the node where the downstream transaction is located using the transaction as the basic unit of detection.

[0060] In this embodiment, when a transaction is blocked, a corresponding dependency relationship is generated and transmitted to the node where the downstream transaction is located, thereby ensuring the real-time performance of distributed deadlock detection.

[0061] In an exemplary embodiment, the above step S102 may include:

[0062] Step S1021, when the first target transaction is in a lock waiting state, in response to the dependency information sent by the target node, an information acquisition request is sent to the second node to instruct the second node to respond to the information acquisition request, send a write signal to the auxiliary process, and read the dependency information in the shared memory and send it to the first node; wherein the auxiliary process is used to write the dependency information stored in itself into the shared memory of the second node in response to the write signal.

[0063] The shared memory may be obtained based on a storage area of ​​a pre-divided node, and one node may be allocated with one shared memory.

[0064] For example, please refer to Figure 5 , the dependency acquisition interface function can be implemented in advance (for example, it can be implemented by defining a user function), which is used to execute on the background process of each node of the distributed database system to obtain all dependency information stored in the auxiliary process. When the function is called, the background process will send a write signal to the auxiliary process. After the auxiliary process receives the write signal, it will write all dependency information stored in the process into the shared memory, and set the flag write_done of the shared memory to true after the write is completed. The background process will continue to access the flag, and when it reads write_done as true, it will start to read all dependency information from the shared memory and return. After detecting a deadlock based on distributed deadlock detection, the first node / second node can build a list of computing nodes and remotely execute the dependency acquisition interface function on all computing nodes.

[0065] In this embodiment, by reusing the local dependency information in the auxiliary process and opening it to other nodes for reading through the shared memory, efficient dependency information sharing can be achieved, ensuring the real-time performance of deadlock detection.

[0066] In an exemplary embodiment, Figure 6 As shown, the above step S106 may include:

[0067] Step S1061, assigning a unique identifier to the transaction information of each transaction in the graph data structure.

[0068] In a possible implementation, the unique identifier corresponding to the transaction information of each transaction may be determined and used as a subscript according to the order in which the transaction information is stored in the graph data structure. For example, a smaller number may be assigned as a unique identifier to the transaction information stored first in the graph data structure.

[0069] Step S1062, in response to the existence of a loop in the graph data structure, the unique identifiers corresponding to the transaction information contained in the loop are concatenated according to a preset sorting rule to obtain identification information of the loop.

[0070] Step S1063: Based on the identification information, display the transaction information included in the loop and the lock waiting relationship information between the transactions.

[0071] In one possible implementation, whenever a deadlock loop is detected, the unique identifiers corresponding to the transaction information contained in the loop are concatenated into a string according to a preset sorting rule. For example, the concatenation may be started with the smallest / largest unique identifier as the starting point. At this point, based on the identification information of the loop, the path of the deadlock loop can be clearly identified. For example, when there is a deadlock loop consisting of three transactions whose transaction information is "0:994:2", "1:876:9", and "1:723:5", respectively, and their subscripts in the graph data structure are 7, 5, and 14, respectively, you can first find the smallest subscript "5", and then use "5" as the starting point to concatenate the remaining subscripts according to the lock waiting relationship between transactions to obtain the string "5->14->7".

[0072] For further information, please refer to Figure 6 , the above information display method may also include:

[0073] Step B1, calculate and save the hash value corresponding to the identification information.

[0074] Step B2: deduplicate the stored identification information based on the hash value.

[0075] In a possible implementation, a hash table can be constructed, and the hash value corresponding to the identification information is used as the key and the identification information is stored as the value. Each time an identification information is generated, the corresponding hash value is calculated, and based on the hash value, it is checked whether the current deadlock loop already exists in the hash table. If not, the identification information and the corresponding hash value are saved as a new key-value pair.

[0076] In this embodiment, by concatenating the unique identifiers corresponding to the transaction information contained in the loop according to the preset sorting rule, the same deadlock loop can be avoided from being repeatedly constructed. Furthermore, by storing the concatenated identifier information based on the hash algorithm, the time complexity of managing the information contained in the deadlock loop can be reduced.

[0077] In an exemplary embodiment, after the above step S106, the following steps may be included:

[0078] Step S107, determine the transaction with the lowest priority from the loop, and terminate the execution of the transaction.

[0079] Exemplarily, in the case where the first target transaction is the transaction with the lowest priority, the first node can suspend the execution of the first target transaction. In one possible implementation, a priority identifier can be pre-set for each transaction, which can be a number (for example, 1 to 100, the smaller the value, the lower the priority), or other forms of identifiers. The transaction priority information is stored together with other relevant information of the transaction (such as transaction ID, transaction status, data resources involved, etc.) in a data structure or database table related to transaction management. Once the transaction with the lowest priority is determined, the system can call the corresponding transaction management interface or function to suspend the execution of the transaction to release all lock resources held by the transaction. In this way, the lock waiting relationship in the loop can be broken, and the system can continue to perform distributed deadlock detection.

[0080] To summarize, in the above information display method, by obtaining the dependency information saved by the auxiliary processes in other nodes when a deadlock is detected based on local dependency information, real-time aggregation of dependency information can be achieved; by building a global graph data structure based on the obtained dependency information, searching for deadlock loops in the graph data structure and displaying the information contained in the loop, the deadlock loop can be detected in real time, and the deadlock loop information can be quickly and accurately drawn, which can make it easier for developers to troubleshoot and locate defects, allowing users to more intuitively see which transactions have deadlocked, and facilitating users to adjust business logic strategies to avoid deadlocks.

[0081] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0082] Based on the same inventive concept, the embodiment of the present application also provides an information display device for implementing the above-mentioned information display method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more information display device embodiments provided below can refer to the limitations on the information display method above, and will not be repeated here.

[0083] In an exemplary embodiment, Figure 7As shown, an information display device 300 is provided, comprising: an information acquisition module 301, a graph model construction module 302 and an information display module 303, wherein:

[0084] The information acquisition module 301 is used to send an information acquisition request to the second node in response to the dependency information sent by the target node when the first target transaction is in a lock waiting state, so as to instruct the second node to obtain the dependency information in the auxiliary process and send the dependency information to the first node; wherein the dependency information includes that the first target transaction is in a lock holding state; the target node is any node among the second nodes, and the second node is a node other than the first node in the distributed database system.

[0085] The graph model building module 302 is used to generate a corresponding graph data structure based on the dependency information stored in itself and the dependency information received; the points in the graph data structure contain transaction information, and the edges in the graph data structure contain lock waiting relationship information between transactions.

[0086] The information display module 303 is used to display the transaction information contained in the loop and the lock waiting relationship information between transactions in response to the existence of a loop in the graph data structure.

[0087] In an exemplary embodiment, the information display device 300 further includes an information transmission module, which is used to:

[0088] In response to the first target transaction being in a lock waiting state, first dependency information between the first target transaction and the second target transaction is constructed; the second target transaction holds the lock that the first target transaction is waiting for;

[0089] The first dependency information is sent to a second node where the second target transaction is located; wherein the second node is used to construct second dependency information between the second target transaction and the third target transaction in response to the second target transaction being in a lock waiting state, and send the second dependency information to the node where the third target transaction is located; the third target transaction holds the lock that the second target transaction is waiting for.

[0090] In an exemplary embodiment, the information acquisition module 301 is further used to:

[0091] When the first target transaction is in a lock waiting state, in response to the dependency information sent by the target node, an information acquisition request is sent to the second node to instruct the second node to respond to the information acquisition request, send a write signal to the auxiliary process, and read the dependency information in the shared memory and send it to the first node; wherein the auxiliary process is used to write the dependency information stored in itself into the shared memory of the second node in response to the write signal.

[0092] In an exemplary embodiment, the information display module 303 is also used to:

[0093] Assign a unique identifier to the transaction information of each transaction in the graph data structure;

[0094] In response to the existence of a loop in the graph data structure, unique identifiers corresponding to the transaction information contained in the loop are concatenated according to a preset sorting rule to obtain identification information of the loop;

[0095] Based on the identification information, the transaction information contained in the loop and the lock waiting relationship information between transactions are displayed.

[0096] In an exemplary embodiment, the information display module 303 is also used to:

[0097] Calculate the hash value corresponding to the identification information and save it;

[0098] De-duplicate the saved identification information based on the hash value.

[0099] In an exemplary embodiment, the information display device 300 further includes a transaction abort module, which is used to:

[0100] The lowest priority transaction is identified from the loop and execution of the transaction is aborted.

[0101] Each module in the above information display device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0102] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store local dependency information. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication 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, an information display method is implemented.

[0103] Those skilled in the art will understand that Figure 8 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.

[0104] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0105] 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 steps in the above-mentioned method embodiments are implemented.

[0106] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0107] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method 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 the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0108] 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 application.

[0109] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications 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 present application shall be subject to the attached claims.

Claims

1. An information display method, characterized in that: Applied to the first node, the method comprises: In the case where the first target transaction is in a lock waiting state, in response to the dependency information sent by the target node, an information acquisition request is sent to the second node to instruct the second node to acquire the dependency information in the auxiliary process and send the dependency information to the first node; wherein the dependency information includes that the first target transaction is in a lock holding state; the target node is any node of the second nodes, and the second node is a node other than the first node in the distributed database system; Generate a corresponding graph data structure based on the dependency information stored in the system and the dependency information received; the points in the graph data structure contain transaction information, and the edges in the graph data structure contain lock waiting relationship information between transactions; In response to a loop existing in the graph data structure, transaction information included in the loop and lock wait relationship information between transactions are displayed.

2. The method according to claim 1, characterized in that In the case where the first target transaction is in a lock waiting state, in response to the dependency information sent by the target node, sending an information acquisition request to the second node, the process includes: In response to a first target transaction being in a lock waiting state, constructing first dependency information between the first target transaction and a second target transaction; the second target transaction holds the lock that the first target transaction is waiting for; The first dependency information is sent to a second node where the second target transaction is located; wherein the second node is used to construct second dependency information between the second target transaction and a third target transaction in response to the second target transaction being in a lock waiting state, and send the second dependency information to the node where the third target transaction is located; the third target transaction holds the lock that the second target transaction is waiting for.

3. The method according to claim 1, characterized in that When the first target transaction is in a lock waiting state, in response to the dependency information sent by the target node, sending an information acquisition request to the second node to instruct the second node to acquire the dependency information in the auxiliary process and send the dependency information to the first node, comprising: When the first target transaction is in a lock waiting state, in response to the dependency information sent by the target node, an information acquisition request is sent to the second node to instruct the second node to respond to the information acquisition request, send a write signal to the auxiliary process, and read the dependency information in the shared memory and send it to the first node; wherein the auxiliary process is used to write the dependency information stored in itself into the shared memory of the second node in response to the write signal.

4. The method according to claim 1, characterized in that: In response to the existence of a loop in the graph data structure, displaying transaction information contained in the loop and lock wait relationship information between transactions includes: Assigning a unique identifier to the transaction information of each transaction in the graph data structure; In response to the existence of a loop in the graph data structure, unique identifiers corresponding to the transaction information contained in the loop are concatenated according to a preset sorting rule to obtain identification information of the loop; Based on the identification information, the transaction information included in the loop and the lock waiting relationship information between the transactions are displayed.

5. The method according to claim 4, characterized in that In response to the existence of a loop in the graph data structure, unique identifiers corresponding to the transaction information contained in the loop are concatenated according to a preset sorting rule to obtain identification information of the loop, followed by: Calculate and save the hash value corresponding to the identification information; The stored identification information is deduplicated based on the hash value.

6. The method according to claim 1, characterized in that In response to the existence of a loop in the graph data structure, displaying transaction information contained in the loop and lock wait relationship information between transactions, followed by: A transaction with the lowest priority is determined from the loop, and execution of the transaction is suspended.

7. An information display device, characterized in that: The device comprises: an information acquisition module, configured to send an information acquisition request to a second node in response to dependency information sent by a target node when a first target transaction is in a lock waiting state, so as to instruct the second node to acquire dependency information in an auxiliary process and send the dependency information to the first node; wherein the dependency information includes that the first target transaction is in a lock holding state; the target node is any node among the second nodes, and the second node is a node other than the first node in a distributed database system; A graph model building module, used to generate a corresponding graph data structure based on the dependency information stored in the module and the dependency information received; the points in the graph data structure contain transaction information, and the edges in the graph data structure contain lock waiting relationship information between transactions; The information display module is used to display the transaction information contained in the loop and the lock waiting relationship information between transactions in response to the existence of a loop in the graph data structure.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. 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 6 are implemented.

10. A computer program product, comprising a computer program, 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 6 are implemented.

Citation Information

Patent Citations

  • Deadlock detection method based on side tracing for distributed system

    CN106557371A

  • Distributed deadlock detection method and device, computer equipment and readable medium

    CN110442459A

  • Distributed deadlock detection method and device and electronic equipment

    CN115809150A

  • Distributed transaction implementation method and device, equipment and storage medium

    CN117785390A

  • Distributed database deadlock detection method, device and equipment

    CN118796949A

Cited By

  • Database deadlock processing method and device and database deadlock processing system

    CN121597698A

  • Detection method and device for exchange rate generation dependency relationship and computer readable medium

    CN122087161A