Database abnormality monitoring and processing method, device and medium

Through real-time monitoring and deadlock detection, you can choose to roll back a specific transaction and update transaction attributes, which solves database deadlock and exception problems, improves system performance and stability, and reduces the burden on administrators.

CN119356985BActive Publication Date: 2025-09-12SHANDONG INSPUR AIGOU CLOUD CHAIN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411511692.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-09-12
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

Deadlocks and exceptions in databases affect performance and may lead to data loss or system crashes. Existing technologies make it difficult to effectively monitor and handle them.

Method used

By monitoring the database operation status in real time, performing exception analysis and deadlock detection, identifying deadlock events, selecting specified transactions for rollback operations, and updating transaction attributes to release the deadlock status, combined with load balancing and resource optimization strategies.

Benefits of technology

It realizes real-time monitoring and exception handling of the database, avoids data loss, improves system performance and stability, and reduces the workload of administrators.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356985B_ABST
    Figure CN119356985B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and medium for monitoring and processing database anomalies. The method includes: real-time monitoring to obtain the operating status of the database and determine the abnormal events existing in the database; based on the abnormal events, analyzing the transaction wait graph of the database through a deadlock detection algorithm to identify deadlock events; for the deadlock event, determining the corresponding multiple participating transactions, and based on the transaction attributes corresponding to the participating transactions, selecting at least some of the participating transactions as designated transactions; performing a rollback operation on the designated transaction and updating the transaction attributes of the designated transaction after the rollback operation; based on the rollback operation, continuing to execute the designated transaction after the transaction attributes are updated. The database is uniformly managed by the monitoring server, and the load of each node in the database cluster is monitored. According to the monitoring results, the data distribution and query routing strategies are dynamically adjusted to ensure load balancing of each node, avoid single point overload, and improve the overall performance of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a method, device, and medium for monitoring and processing database anomalies. Background Art

[0002] With the rapid development of the internet, more and more businesses are emerging or expanding their operations. This process is accompanied by a rapid increase in data volumes, coupled with the complexity of the internet environment, and the emergence of increasingly prominent security issues. Consequently, businesses are beginning to prioritize the security of their networked systems.

[0003] Deadlocks and exceptions are common performance bottlenecks and stability issues in database management systems. Deadlocks typically occur when two or more transactions are unable to proceed while waiting for resources held by each other. Exceptions can be caused by a variety of reasons, including data errors, insufficient resources, and program logic errors. These issues not only affect database performance but can also lead to data loss or system crashes. Summary of the Invention

[0004] To solve the above problems, this application proposes a database anomaly monitoring and processing method, including:

[0005] Real-time monitoring to obtain the operating status of the database, and performing anomaly analysis based on the operating status to determine abnormal events existing in the database;

[0006] Based on the abnormal event, analyzing the transaction wait graph of the database using a deadlock detection algorithm to identify a deadlock event;

[0007] For the deadlock event, determining a plurality of participating transactions corresponding thereto, and selecting at least some of the participating transactions as designated transactions based on transaction attributes corresponding to the participating transactions;

[0008] Performing a rollback operation on the designated transaction and updating transaction attributes of the designated transaction after the rollback operation is performed;

[0009] Based on the rollback operation, the specified transaction is continued to be executed after the transaction attributes are updated.

[0010] In one example, performing an anomaly analysis based on the operating status to determine an abnormal event present in the database specifically includes:

[0011] Determining the operation log and performance status included in the operation status;

[0012] Based on the operation log, an analysis is performed using an analysis engine and / or log analysis rules to determine whether there are abnormal events in the database; wherein the log analysis rules include query timeout, data inconsistency, and error code;

[0013] Based on the performance status, analyzing using performance analysis rules to determine whether there are abnormal events in the database; wherein the performance analysis rules include resource usage and resource exhaustion;

[0014] If there is an abnormal event, the alarm mechanism will be triggered and the abnormality handling process will begin.

[0015] In one example, analyzing the transaction wait graph of the database using a deadlock detection algorithm to identify deadlock events specifically includes:

[0016] A transaction waiting graph of the database is defined; wherein the transaction waiting graph includes nodes and edges, where nodes represent transactions and edges represent waiting relationships between transactions;

[0017] Traverse all active transactions and build a transaction waiting graph;

[0018] Determine the transactions included in the abnormal event, and determine whether the included transactions are in a loop in the transaction waiting graph;

[0019] If so, the ring is treated as a deadlock event, and all transactions participating in the ring are treated as participating transactions in the deadlock event.

[0020] In one example, the method further includes:

[0021] Determining that a duration during which no included transaction is detected in the ring by the abnormal event has exceeded a first preset duration;

[0022] Searching the transaction waiting graph by a priority search algorithm to determine whether there is a loop;

[0023] If so, the loop is treated as a deadlock event, and all transactions participating in the loop are treated as participating transactions in the deadlock event.

[0024] In one example, based on transaction attributes corresponding to the participating transactions, selecting at least some of the participating transactions as designated transactions specifically includes:

[0025] Determine transaction attributes corresponding to the participating transaction, wherein the transaction attributes include: priority and execution time;

[0026] For each participating transaction, confirm whether the participating transaction exists in the abnormal event;

[0027] If it exists, the participating transaction is taken as the first designated transaction;

[0028] For each remaining participating transaction, determining whether the execution time of the participating transaction exceeds a second preset time period;

[0029] If not, the participating transaction will be regarded as the second designated transaction;

[0030] For each remaining participating transaction, determining whether the priority of the participating transaction is higher than the preset priority;

[0031] If not higher, the participating transaction will be regarded as the third designated transaction.

[0032] In one example, updating the transaction attributes of a specified transaction after a rollback operation is performed specifically includes:

[0033] For the first specified transaction, update its transaction attributes and add a specified identifier;

[0034] updating the priority of the third designated transaction to increase the priority of the third designated transaction;

[0035] The method further comprises:

[0036] For a new deadlock event, if it is determined that there is a participating transaction with a specified identifier, the participating transaction will be rolled back to the initial node, the process processing of the participating transaction will be suspended, and an exception alarm will be issued.

[0037] In one example, the method further includes:

[0038] When selecting a designated transaction through participating transactions, the selection of designated transactions is stopped in the order of the first designated transaction, the second designated transaction, and the third designated transaction, whenever the number of selected designated transactions reaches a preset number.

[0039] In one example, the method further includes:

[0040] Obtaining a detection frequency of deadlock events detected by a priority search algorithm within a recent third preset time period, wherein the third preset time period is longer than the first preset time period;

[0041] The first preset duration is adjusted based on the detection frequency.

[0042] On the other hand, the present application also proposes a database anomaly monitoring and processing device, comprising:

[0043] at least one processor; and,

[0044] a memory communicatively connected to the at least one processor; wherein,

[0045] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the database exception monitoring and processing method as described in any of the above examples.

[0046] On the other hand, the present application also proposes a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as: the database abnormality monitoring and processing method described in any of the above examples.

[0047] The database anomaly monitoring and processing method proposed in this application can bring the following beneficial effects:

[0048] The monitoring server centrally manages the database and monitors the load of each node in the database cluster, including key indicators such as CPU usage, memory utilization, and disk I / O speed. Based on the monitoring results, data distribution and query routing strategies are dynamically adjusted to ensure load balancing across nodes, avoid single point overload, and improve overall system performance.

[0049] Scan the database for anomalies in real time. If a deadlock or other abnormal situation occurs, automatically select a sacrificial transaction (for example, based on transaction priority, execution time, etc.) and roll it back to resolve the deadlock.

[0050] Propose optimization plans for SQL statements that are extremely long and time-consuming in the database, and automatically propose improvement plans (such as creating indexes) based on the frequency of SQL usage. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0052] Figure 1 Schematic diagram of the process of database abnormality monitoring and processing in an embodiment of the present application;

[0053] Figure 2 This is a schematic diagram of a database exception monitoring and processing system in an embodiment of the present application;

[0054] Figure 3 This is a schematic diagram of a database exception monitoring and processing device in an embodiment of the present application. DETAILED DESCRIPTION

[0055] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0056] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.

[0057] like Figure 1 As shown, the embodiment of the present application provides a database abnormality monitoring and processing method, including:

[0058] S101: Real-time monitoring is performed to obtain the operating status of a database, and an abnormality analysis is performed based on the operating status to determine abnormal events existing in the database.

[0059] You can use built-in monitoring tools in the database (for example, PostgreSQL and MySQL data blocks have built-in internal monitoring tools) or third-party monitoring tools to monitor the operating status of the database.

[0060] When using monitoring tools, you can query the database's operating status through log analysis, transaction auditing, performance analysis, etc. The operating status includes but is not limited to the database's performance status, transaction status, and operating logs.

[0061] Specifically, when determining whether an abnormal event exists, an analysis is performed based on the operation log through an analysis engine and / or log analysis rules to determine whether an abnormal event exists in the database.

[0062] The analysis engine can be implemented through corresponding monitoring and analysis tools, or through a machine learning framework. Log analysis rules can include query timeouts, data inconsistencies, error codes, etc. When query timeouts, data inconsistencies, or error codes occur, the corresponding log content is considered to have an abnormal event.

[0063] Based on the performance status, analysis is performed using performance analysis rules to determine whether there are any abnormal events in the database.

[0064] Among them, performance analysis rules include resource utilization, resource exhaustion, etc. When the resource utilization of a certain resource (such as computing resources, storage resources, network resources, etc.) is too high and exceeds the threshold, or when resource exhaustion is identified, it is considered an abnormal event.

[0065] At this time, if it is determined that an abnormal event exists, the alarm mechanism will be triggered and the abnormality handling process will be entered.

[0066] S102: Based on the abnormal event, a transaction wait graph of the database is analyzed using a deadlock detection algorithm to identify a deadlock event.

[0067] First, we define the database's transaction wait graph. The transaction wait graph consists of nodes and edges. Nodes represent transactions, and edges represent wait relationships between transactions. A wait relationship means that transactions have an execution order relationship. If one transaction needs to wait for another transaction to complete before executing, then the two transactions have a wait relationship.

[0068] At this point, all active transactions are traversed to build a transaction waiting graph, which is the transaction waiting graph corresponding to the current database.

[0069] At this time, deadlock events can be directly identified through relevant search algorithms (such as depth search algorithm, breadth search algorithm, etc.). However, when the amount of data in the database is large, each round of search algorithm requires more computing power resources.

[0070] Based on this, we identify the transactions contained in the abnormal event and, in the transaction wait graph, determine whether the included transactions are in a loop. Even without deadlock detection, abnormal events still require periodic or real-time monitoring. In this case, we determine whether there are transactions in the abnormal event. If so, we further determine whether they are in a loop, thus enabling deadlock detection without initiating a search algorithm. A loop refers to the formation of multiple transactions in a waiting relationship, which prevents further execution of these multiple transactions.

[0071] S103: For the deadlock event, determine multiple participating transactions corresponding to the deadlock event, and select at least some of the participating transactions as designated transactions based on transaction attributes corresponding to the participating transactions.

[0072] If it is detected through the above steps that the transaction is in a loop, the loop is regarded as a deadlock event, and all transactions participating in the loop are regarded as participating transactions in the deadlock event.

[0073] Of course, if it is determined that the duration for which no included transaction is in a loop detected by an abnormal event has exceeded a first preset duration (the preset duration is usually longer than the timing duration for direct detection using the deadlock detection algorithm as mentioned above. Of course, if the preset duration is consistent, it is generally believed that the frequency of abnormal event monitoring is faster, and the real-time performance of deadlock event monitoring can be increased through the transactions included therein), it is believed that there may be some deadlocks that violate the detection, so the transaction waiting graph is searched through a priority search algorithm (for example, a depth-first search algorithm, a breadth-first search algorithm, etc.) to determine whether there is a loop, thereby reducing the occurrence of missed detections.

[0074] If it exists, the loop is treated as a deadlock event, and all transactions participating in the loop are treated as participating transactions in the deadlock event.

[0075] In addition, the detection frequency of deadlock events detected by the priority search algorithm within the most recent third preset time period (the third preset time period is higher than the first preset time period) can also be obtained, that is, the priority search algorithm that detects the deadlock event is divided by the total number of priority search algorithms executed to obtain the detection frequency.

[0076] At this time, based on the detection frequency, the first preset duration is adjusted. When the detection frequency is too high (higher than the preset frequency), the first preset duration is reduced and the detection speed is increased. When the detection frequency is too low (lower than the preset frequency), the first preset duration is increased to reduce computing power consumption.

[0077] The specified transaction refers to the transaction used to perform rollback when a deadlock event occurs.

[0078] Based on this, the transaction attributes corresponding to the participating transactions are determined. The transaction attributes include: priority (usually pre-set, set by the initiator. For example, a high-priority transaction may be a user-initiated operation, and a low-priority transaction may be a background batch process) and execution time.

[0079] At this time, for each participating transaction, it is determined whether the participating transaction has an abnormal event. If so, it is considered that the participating transaction itself may have other abnormal situations in addition to the deadlock, so the participating transaction is regarded as the first designated transaction and participates in the rollback.

[0080] For each remaining participating transaction, determine whether the execution time of the participating transaction exceeds the second preset time. If not, it is considered that the participating transaction has just been executed for a short time, and you can continue to wait for a while and use the participating transaction as the second designated transaction to participate in the rollback.

[0081] For each remaining participating transaction, determine whether the priority of the participating transaction is higher than the preset priority. If not, the participating transaction is considered to have a low priority and is treated as the third designated transaction to participate in the rollback.

[0082] Of course, in actual selection, it may not be necessary to select too many designated transactions for rollback. Therefore, when selecting designated transactions through participating transactions, the order of the first designated transaction, the second designated transaction, and the third designated transaction is followed. Whenever the number of selected designated transactions reaches the preset number, the selection of designated transactions is stopped. The preset number is 3. When 2 transactions are selected from the first designated transaction, the selection of the second designated transaction continues. At this time, 1 transaction needs to be selected from them. If there are multiple second designated transactions, 1 transaction is randomly selected from them as the second designated transaction. At this time, the sum of the first designated transaction and the second designated transaction meets the preset number, and there is no need to select the third designated transaction.

[0083] S104: performing a rollback operation on the designated transaction, and updating transaction attributes of the designated transaction after the rollback operation is performed.

[0084] Rollback a specified transaction to its previous process node or other process nodes so that the unrolled transactions can continue to execute.

[0085] After executing the rollback operation, the specified transaction can be updated. If the first specified transaction is involved in the rollback, its transaction attributes are updated and a specified identifier is added. The specified identifier is used for detecting a new deadlock event. If it is determined that there is a participating transaction with the specified identifier, it is considered that the participating transaction has previously participated in the rollback. At this time, a deadlock occurs again. Since the participating transaction is the first specified transaction in the abnormal event, it is likely that the frequent deadlocks are caused by the abnormality of the participating transaction. Therefore, the participating transaction is rolled back to the initial node, the process processing of the participating transaction is suspended, and an abnormality alarm is issued.

[0086] For the third designated transaction, since the third designated transaction has participated in the rollback and the corresponding process processing has been delayed for some time, its priority is updated to increase the priority of the third designated transaction. The next time it is detected to be involved in a deadlock event, it can be prevented from being selected as a rollback event multiple times in a row with a higher priority.

[0087] S105: Based on the rollback operation, continue to execute the designated transaction after updating the transaction attributes.

[0088] like Figure 2 As shown in the figure, after handling deadlocks and exceptions, the execution order and priority of transactions are intelligently adjusted based on the current database load and resource availability. For transactions interrupted by exceptions, the execution status is automatically restored to ensure data integrity and consistency. Flexible recovery strategies, such as point-in-time recovery and transaction log-based recovery, are provided to meet the needs of different scenarios.

[0089] It can also provide optimization suggestions based on the database's operating conditions and historical data, such as adjusting index strategies, optimizing query statements, increasing resources, etc. It supports automated management of database configuration, including parameter settings, backup and recovery strategies, etc., reducing the administrator's workload.

[0090] The monitoring server centrally manages the database and monitors the load of each node in the database cluster, including key indicators such as CPU usage, memory utilization, and disk I / O speed. Based on the monitoring results, data distribution and query routing strategies are dynamically adjusted to ensure load balancing across nodes, avoid single point overload, and improve overall system performance.

[0091] Scan the database for anomalies in real time. If a deadlock or other abnormal situation occurs, automatically select a sacrificial transaction (for example, based on transaction priority, execution time, etc.) and roll it back to resolve the deadlock.

[0092] Propose optimization plans for SQL statements that are extremely long and time-consuming in the database, and automatically propose improvement plans (such as creating indexes) based on the frequency of SQL usage.

[0093] like Figure 3 As shown, the embodiment of the present application also provides a database abnormality monitoring and processing device, including:

[0094] at least one processor; and,

[0095] a memory communicatively connected to the at least one processor; wherein,

[0096] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the database exception monitoring and processing method as described in any of the above embodiments.

[0097] An embodiment of the present application further provides a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as: the database abnormality monitoring and processing method described in any of the above embodiments.

[0098] The various embodiments in this application are described in a progressive manner. Similar portions between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the device and medium embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For relevant portions, refer to the descriptions of the method embodiments.

[0099] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects to their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0100] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0101] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0102] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0103] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0104] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0105] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0106] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can be implemented using any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.

[0107] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0108] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A database abnormality monitoring and processing method, characterized in that: include: Real-time monitoring and acquisition of the operating status of the database, and performing anomaly analysis based on the operating status to determine abnormal events in the database, including: real-time monitoring of the operating log and performance status of the database; analysis based on the operating log using an analysis engine and / or log analysis rules to determine whether there are abnormal events in the database, the log analysis rules including query timeout, data inconsistency, and error code; analysis based on the performance status using performance analysis rules to determine whether there are abnormal events in the database, the performance analysis rules including resource utilization and resource exhaustion; if an abnormal event exists, triggering an alarm mechanism to enter the abnormality handling process; Based on the abnormal event, a transaction wait graph of the database is analyzed by a deadlock detection algorithm to identify a deadlock event, and for the deadlock event, a plurality of participating transactions corresponding to the deadlock event are determined, including: traversing all active transactions to construct a transaction wait graph, wherein the transaction wait graph includes nodes and edges, where nodes represent transactions and edges represent waiting relationships between transactions; determining transactions included in the abnormal event, and determining in the transaction wait graph whether the included transactions are in a loop; if so, treating the loop as a deadlock event, and treating all transactions participating in the loop as participating transactions in the deadlock event; but if it is not detected that the duration for which the transactions included in the abnormal event have been in the loop exceeds a first preset duration, searching the transaction wait graph by a priority search algorithm to determine whether a loop exists; if so, treating the loop as a deadlock event, and treating all transactions participating in the loop as participating transactions in the deadlock event; selecting, based on transaction attributes corresponding to the participating transactions, at least some of the participating transactions as designated transactions; Performing a rollback operation on the designated transaction and updating transaction attributes of the designated transaction after the rollback operation is performed; Based on the rollback operation, the specified transaction is continued to be executed after the transaction attributes are updated.

2. The method according to claim 1, characterized in that Based on the transaction attributes corresponding to the participating transactions, selecting at least some of the participating transactions as designated transactions specifically includes: Determine transaction attributes corresponding to the participating transaction, wherein the transaction attributes include: priority and execution time; For each participating transaction, confirm whether the participating transaction exists in the abnormal event; If it exists, the participating transaction is taken as the first designated transaction; For each remaining participating transaction, determining whether the execution time of the participating transaction exceeds a second preset time period; If not, the participating transaction will be regarded as the second designated transaction; For each remaining participating transaction, determining whether the priority of the participating transaction is higher than the preset priority; If not higher, the participating transaction will be regarded as the third designated transaction.

3. The method according to claim 2, characterized in that Update the transaction attributes of the specified transaction after the rollback operation is completed, including: For the first specified transaction, update its transaction attributes and add a specified identifier; updating the priority of the third designated transaction to increase the priority of the third designated transaction; The method further comprises: For a new deadlock event, if it is determined that there is a participating transaction with a specified identifier, the participating transaction will be rolled back to the initial node, the process processing of the participating transaction will be suspended, and an exception alarm will be issued.

4. The method according to claim 2, characterized in that The method further comprises: When selecting a designated transaction through participating transactions, the selection of designated transactions is stopped in the order of the first designated transaction, the second designated transaction, and the third designated transaction, whenever the number of selected designated transactions reaches a preset number.

5. The method according to claim 1, wherein The method further comprises: Obtaining a detection frequency of deadlock events detected by a priority search algorithm within a recent third preset time period, wherein the third preset time period is longer than the first preset time period; The first preset duration is adjusted based on the detection frequency.

6. A database abnormality monitoring and processing device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the database abnormality monitoring and processing method according to any one of claims 1 to 5.

7. A non-volatile computer storage medium storing computer-executable instructions, characterized in that: The computer executable instructions are configured to execute the database abnormality monitoring and processing method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Deadlock processing method and device, computer equipment and storage medium

    CN115373864A

  • Deadlock detection method and related device

    CN118069383A