Database transaction processing method and device, storage medium and electronic equipment

By screening transactions in the database whose running time and data volume are greater than the preset values, the problem in the existing technology that it is difficult to automatically discover large database transactions in advance is solved, and the database performance is improved.

CN118484455APending Publication Date: 2024-08-13INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410710358.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-08-13

AI Technical Summary

Technical Problem

It is difficult to automatically discover and predict large database transactions in advance with existing technology, leading to a decrease in database performance.

Method used

By obtaining the target table and multiple database transactions in the database, filter out the database transactions whose running time is longer than the preset time and involve data volume greater than the preset amount, build a filtering table and remind the target object to process.

Benefits of technology

It realizes automatic discovery and prediction of suspicious large database transactions in advance, improving database performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118484455A_ABST
    Figure CN118484455A_ABST
Patent Text Reader

Abstract

The invention discloses a database transaction processing method and device, a storage medium and electronic equipment, and relates to the technical field of big data, the field of financial science and technology or other related fields. The method comprises the steps that a target table in a database is obtained, and the line number of the target table is larger than a preset threshold value; a plurality of database transactions in the database are obtained, a plurality of first tables related to each database transaction are determined, and the database transactions are database transactions with target operation in the database; and screening each database transaction according to a target table in the database and the plurality of first tables related to each database transaction, and determining a target database transaction in the plurality of database transactions. Through the method and the device, the problem that the performance of the database is reduced due to the fact that suspicious database large transactions are difficult to automatically find and pre-judge in advance in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, financial technology or other related fields, and specifically, to a method and device for processing database transactions, a storage medium and an electronic device. Background Art

[0002] Database management plays a vital role in modern information technology, but large transactions may cause database performance degradation, failures and resource contention. Moreover, in related technologies, detecting and solving large transaction problems requires manual intervention and analysis.

[0003] For example, the large transaction detection method in the related art usually involves post-checking and pre-manual inspection. For example, the post-automatic check is to find that the binlog (binary log) generated by the execution of a single SQL (Structured Query Language) exceeds a certain size. The database will consider the SQL as a large transaction, and in order to ensure the availability of the database, a certain strategy can be configured to implement the check to ensure that the database is available to the outside world as a whole. In addition, the manual inspection in the related art needs to rely on professionals to check all SQL operations in the code one by one, and judge whether it is a large transaction by evaluating whether indexes are used, whether they are submitted in batches, and combining the size of the data.

[0004] However, the large transaction detection methods in the related art cannot predict and perceive the risk of large transactions in advance or cannot automatically check them. In addition, potential large transactions rely on a large number of professional manual checks, which cannot quickly discover and perceive potential large transactions in advance. Large transactions can often be discovered and rectified after the fact. Therefore, it is difficult to automatically detect and predict suspicious database large transactions in advance in the related art, which will lead to a decrease in database performance.

[0005] Currently, no effective solution has been proposed to address the problem that related technologies are difficult to automatically detect and predict suspicious large database transactions in advance, which leads to database performance degradation. Summary of the invention

[0006] The main purpose of the present application is to provide a method and device for processing database transactions, a storage medium and an electronic device to solve the problem in the related art that it is difficult to automatically discover and predict suspicious large database transactions in advance, resulting in a decrease in database performance.

[0007] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for processing database transactions is provided. The method comprises: obtaining a target table in a database, wherein the number of rows in the target table is greater than a preset threshold; obtaining multiple database transactions in the database, and determining multiple first tables involved in each database transaction, wherein the multiple database transactions are database transactions in which target operations exist in the database, and the target operations are at least one of the following: an operation of updating a table and an operation of deleting a table; based on the target table in the database and the multiple first tables involved in each database transaction, screening each database transaction, and determining a target database transaction among the multiple database transactions, wherein the target database transaction is a transaction whose running time is greater than a preset time and the number of data to be operated is greater than a preset number.

[0008] Further, based on the target table in the database and multiple first tables involved in each database transaction, each database transaction is screened to determine the target database transaction in the multiple database transactions, including: judging whether each first table involved in each database transaction is the target table in the database; if each first table involved in each database transaction is not the target table in the database, determining that the target database transaction does not exist in the multiple database transactions; if at least one first table among the multiple first tables involved in each database transaction is the target table in the database, obtaining the target database transaction in the multiple database transactions based on the at least one first table.

[0009] Furthermore, determining whether each first table involved in each database transaction is a target table in the database includes: obtaining a second table, wherein the second table is used to record field information of the target table in the database; obtaining field information corresponding to each first table involved in each database transaction; and determining whether each first table involved in each database transaction is a target table in the database based on the field information of the target table in the database recorded in the second table and the field information corresponding to each first table involved in each database transaction.

[0010] Further, each database transaction is screened according to a target table in the database and a plurality of first tables involved in each database transaction, and determining a target database transaction among the plurality of database transactions comprises: obtaining target information of each database transaction, wherein the target information is at least one of the following: information on whether a target code involved in each database transaction uses an index and information on whether an update operation is performed on a table in each database transaction; and determining a target database transaction among the plurality of database transactions according to the target information of each database transaction.

[0011] Furthermore, after screening each database transaction according to the target table in the database and the multiple first tables involved in each database transaction to determine the target database transaction in the multiple database transactions, the method also includes: acquiring multiple third tables involved in the target database transactions in the multiple database transactions; constructing a fourth table based on information of the multiple third tables involved in the target database transactions in the multiple database transactions; sending the fourth table to the target object, and reminding the target object to process the target database transaction in the multiple database transactions according to the information in the fourth table.

[0012] Furthermore, obtaining multiple database transactions in the database includes: obtaining multiple database transactions containing annotation information from the database to obtain a database transaction set; determining whether the database transaction set includes a database transaction with the target operation; if the database transaction set does not include a database transaction with the target operation, prohibiting obtaining multiple database transactions in the database; if the database transaction set includes a database transaction with the target operation, obtaining multiple database transactions in the database based on the database transaction set.

[0013] Furthermore, obtaining the target table in the database includes: obtaining multiple tables in the database and obtaining the number of rows in each table; determining whether the number of rows in each table is greater than the preset threshold; if the number of rows in each table is not greater than the preset threshold, prohibiting the acquisition of the target table in the database; if there is at least one table among the multiple tables in the database whose number of rows is greater than the preset threshold, obtaining the target table in the database based on the at least one table.

[0014] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a device for processing database transactions is provided. The device includes: a first acquisition unit, used to acquire a target table in a database, wherein the number of rows in the target table is greater than a preset threshold; a first processing unit, used to acquire multiple database transactions in the database, and determine multiple first tables involved in each database transaction, wherein the multiple database transactions are database transactions in which target operations exist in the database, and the target operations are at least one of the following: an operation of updating a table and an operation of deleting a table; a first determination unit, used to screen each database transaction according to the target table in the database and the multiple first tables involved in each database transaction, and determine a target database transaction among the multiple database transactions, wherein the target database transaction is a transaction whose running time is greater than a preset time and the number of data to be operated is greater than a preset number.

[0015] Furthermore, the first determination unit includes: a first judgment module, used to judge whether each first table involved in each database transaction is a target table in the database; a first determination module, used to determine that the target database transaction does not exist in the multiple database transactions if each first table involved in each database transaction is not a target table in the database; and a second determination module, used to obtain the target database transaction in the multiple database transactions based on the at least one first table if at least one first table among the multiple first tables involved in each database transaction is a target table in the database.

[0016] Furthermore, the first judgment module includes: a first acquisition submodule, used to acquire a second table, wherein the second table is used to record field information of a target table in the database; a second acquisition submodule, used to acquire field information corresponding to each first table involved in each database transaction; and a first judgment submodule, used to judge whether each first table involved in each database transaction is the target table in the database based on the field information of the target table in the database recorded in the second table and the field information corresponding to each first table involved in each database transaction.

[0017] Furthermore, the first determination unit includes: a first acquisition module, used to obtain target information of each database transaction, wherein the target information is at least one of the following: information on whether the target code involved in each database transaction uses an index and information on whether there is an update operation on a table in each database transaction; and a third determination module, used to determine the target database transaction among the multiple database transactions based on the target information of each database transaction.

[0018] Furthermore, the device also includes: a second acquisition unit, used to screen each database transaction according to the target table in the database and the multiple first tables involved in each database transaction, and after determining the target database transaction in the multiple database transactions, obtain the multiple third tables involved in the target database transaction in the multiple database transactions; a first construction unit, used to construct a fourth table based on information of the multiple third tables involved in the target database transactions in the multiple database transactions; and a second processing unit, used to send the fourth table to the target object, and remind the target object to process the target database transaction in the multiple database transactions according to the information in the fourth table.

[0019] Furthermore, the first processing unit includes: a fourth determination module, used to obtain multiple database transactions containing annotation information from the database to obtain a database transaction set; a second judgment module, used to determine whether the database transaction set contains a database transaction with the target operation; a first processing module, used to prohibit obtaining multiple database transactions in the database if the database transaction set does not contain a database transaction with the target operation; and a second acquisition module, used to obtain multiple database transactions in the database according to the database transaction set if the database transaction set contains a database transaction with the target operation.

[0020] Furthermore, the first acquisition unit includes: a third acquisition module, used to acquire multiple tables in the database and acquire the number of rows of each table; a third judgment module, used to judge whether the number of rows of each table is greater than the preset threshold; a second processing module, used to prohibit acquiring the target table in the database if the number of rows of each table is not greater than the preset threshold; and a fourth acquisition module, used to acquire the target table in the database based on the at least one table among the multiple tables in the database if the number of rows of at least one table is greater than the preset threshold.

[0021] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer-readable storage medium is provided, wherein the storage medium stores a program, wherein the program executes any one of the above-mentioned methods for processing database transactions.

[0022] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an electronic device is provided, which includes one or more processors and a memory, and the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned methods for processing database transactions.

[0023] Through the present application, the following steps are adopted: obtaining a target table in a database, wherein the number of rows in the target table is greater than a preset threshold; obtaining multiple database transactions in the database, and determining multiple first tables involved in each database transaction, wherein the multiple database transactions are database transactions in which target operations exist in the database, and the target operations are at least one of the following: an operation of updating a table and an operation of deleting a table; based on the target table in the database and the multiple first tables involved in each database transaction, each database transaction is screened to determine a target database transaction in multiple database transactions, wherein the target database transaction is a transaction whose running time is greater than a preset time and the number of data to be operated is greater than a preset number, thereby solving the problem that it is difficult to automatically discover and predict suspicious large database transactions in advance in the related art, resulting in a decrease in database performance. By pre-scanning the large table range in the database, and then scanning the multiple database transactions in the database with update or delete table actions, and then analyzing the table range involved in each database transaction with update or delete table actions, and based on the table range involved in each database transaction obtained by the analysis and the pre-scanned large table, the large transactions in the multiple database transactions in the database are screened, so that suspicious large database transactions can be automatically discovered and predicted in advance, thereby achieving the effect of improving the performance of the database. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0025] Figure 1 The process of the method for processing database transactions provided in the embodiment of the present application is as follows Figure 1 ;

[0026] Figure 2 The process of the method for processing database transactions provided in the embodiment of the present application is as follows Figure 2 ;

[0027] Figure 3 The process of the method for processing database transactions provided in the embodiment of the present application is as follows Figure 3 ;

[0028] Figure 4 is a schematic diagram of a database transaction processing device provided according to an embodiment of the present application;

[0029] Figure 5 is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0034] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:

[0035] Large transaction: A complex and long-running transaction executed in a database, which may include a large number of data operations and multiple database operation steps. This type of transaction usually requires more resources and time to complete, which will have a certain impact on database performance.

[0036] The present invention is described below in conjunction with preferred implementation steps. Figure 1 The process of the method for processing database transactions provided in the embodiment of the present application is as follows Figure 1 ,like Figure 1 As shown, the method comprises the following steps:

[0037] Step S101 , obtaining a target table in a database, wherein the number of rows in the target table is greater than a preset threshold.

[0038] For example, the above-mentioned target table can be a large table in the database, and a table with more than 5,000 data (corresponding to the above-mentioned preset threshold) can be pre-configured as a large table, that is, all tables in the current database can be scanned first. If it is found that the number of rows involved in the traversed current table is greater than 5,000 rows (corresponding to the above-mentioned preset threshold), the current table can be marked as a large table.

[0039] Step S102, obtaining multiple database transactions in the database, and determining multiple first tables involved in each database transaction, wherein the multiple database transactions are database transactions with target operations in the database, and the target operation is at least one of the following: an operation of updating a table and an operation of deleting a table.

[0040] For example, the above-mentioned multiple database transactions can be scanned database transactions with update or delete table actions (corresponding to the above-mentioned target operations), and then the table range involved in each scanned database transaction can be analyzed (corresponding to the multiple first tables involved in each of the above-mentioned database transactions).

[0041] Step S103, screening each database transaction according to the target table in the database and the multiple first tables involved in each database transaction, and determining the target database transaction among the multiple database transactions, wherein the target database transaction is a transaction whose running time is greater than the preset time and the amount of data to be operated is greater than the preset amount.

[0042] For example, the above-mentioned target database transaction may be a large transaction in the database. For example, after analyzing and obtaining the table range (corresponding to the multiple first tables involved in each of the above-mentioned database transactions) involved in the database transaction with the update or delete table action (corresponding to the above-mentioned target operation), the table range involved in the analysis (corresponding to the multiple first tables involved in each of the above-mentioned database transactions) may be intersected with the preset large table range (corresponding to the target table in the above-mentioned database), and the preset large table (corresponding to the target table in the above-mentioned database) in the table range (corresponding to the multiple first tables involved in each of the above-mentioned database transactions) involved in the database transaction with the update or delete table action (corresponding to the above-mentioned target operation) may be screened out, and the current transaction with the preset large table (corresponding to the target table in the above-mentioned database) in the table range (corresponding to the multiple first tables involved in each of the above-mentioned database transactions) involved in the database transaction may be marked as a large table transaction (corresponding to the above-mentioned target database transaction).

[0043] It should be noted that the database transaction processing method provided in the embodiment of the present application can be applied in financial scenarios.

[0044] Through the above steps S101 to S103, by pre-scanning the large table range in the database, and then scanning the multiple database transactions with table update or deletion actions in the database, and then analyzing the table range involved in each database transaction with table update or deletion actions, and based on the table range involved in each database transaction obtained by analysis and the pre-scanned large table, the large transactions among the multiple database transactions in the database are screened out, so that suspicious large database transactions can be automatically discovered and predicted in advance, thereby achieving the effect of improving the performance of the database.

[0045] Optionally, in the database transaction processing method provided in the embodiment of the present application, obtaining the target table in the database includes: obtaining multiple tables in the database and obtaining the number of rows in each table; determining whether the number of rows in each table is greater than a preset threshold; if the number of rows in each table is not greater than the preset threshold, prohibiting the acquisition of the target table in the database; if there is at least one table among the multiple tables in the database whose number of rows is greater than the preset threshold, then obtaining the target table in the database based on the at least one table.

[0046] For example, scan all tables S (corresponding to the above-mentioned multiple tables) in the current database instance A (corresponding to the above-mentioned database); and traverse S (corresponding to the above-mentioned multiple tables) one by one to query the number of rows B' involved in the current table S'; if B' of the current table S' is not greater than B (corresponding to the above-mentioned preset threshold), mark the current table as not a large table (corresponding to the target table in the above-mentioned database); if B' of the current table S' is greater than B (corresponding to the above-mentioned preset threshold), mark the current table as a large table (corresponding to the target table in the above-mentioned database).

[0047] Through the above solution, according to the number of rows involved in each table in the database, the preset large table in the database can be scanned quickly and accurately.

[0048] Optionally, in the database transaction processing method provided in the embodiment of the present application, obtaining multiple database transactions in the database includes: obtaining multiple database transactions containing annotation information from the database to obtain a database transaction set; determining whether the database transaction set includes a database transaction with a target operation; if the database transaction set does not include a database transaction with a target operation, prohibiting the acquisition of multiple database transactions in the database; if the database transaction set includes a database transaction with a target operation, obtaining multiple database transactions in the database based on the database transaction set.

[0049] For example, read the code engineering file path S; then scan all JAVA codes (a high-level programming language) and Mapper files (a file used to define data mapping relationships), and save them in the database in TEXT (text format) format, including class names, fully qualified names, and source code texts, involving tables (initialized to empty) to table Q; then the lexical parsing tool can be used to scan the source code texts involving Q saved in the database, and filter out database transactions containing transaction annotations or specific transaction annotations (corresponding to the above-mentioned annotation information), and read the call relationships of the current database transactions line by line, and filter out database transactions of table update and / or deletion operations (corresponding to the above-mentioned target operations).

[0050] For example, after filtering out the database transactions (corresponding to the above-mentioned database transaction set) containing the transaction annotation or the specific transaction annotation (corresponding to the above-mentioned annotation information), it can be determined whether there are database transactions with table update and / or deletion operations (corresponding to the above-mentioned target operations) in the database transactions (corresponding to the above-mentioned database transaction set) containing the transaction annotation or the specific transaction annotation (corresponding to the above-mentioned annotation information); if there are no database transactions with table update and / or deletion operations (corresponding to the above-mentioned target operations) in the database transactions (corresponding to the above-mentioned database transaction set) containing the transaction annotation or the specific transaction annotation (corresponding to the above-mentioned annotation information), then It is impossible to obtain database transactions in which table update and / or deletion operations (corresponding to the above-mentioned target operations) exist in the database; if there are database transactions with table update and / or deletion operations (corresponding to the above-mentioned target operations) in the database transactions (corresponding to the above-mentioned database transaction set) containing transaction annotations or specific transaction annotations (corresponding to the above-mentioned annotation information), then the database transactions with table update and / or deletion operations (corresponding to the above-mentioned target operations) in the database transactions (corresponding to the above-mentioned database transaction set) containing transaction annotations or specific transaction annotations (corresponding to the above-mentioned annotation information) can be marked, and multiple database transactions in the above-mentioned database can be obtained.

[0051] In summary, by filtering out database transactions that contain transaction annotations or specific transaction annotations in the database, it is possible to easily filter out database transactions that have actions of updating or deleting tables in the database.

[0052] Optionally, in the database transaction processing method provided in the embodiment of the present application, determining whether each first table involved in each database transaction is a target table in the database includes: obtaining a second table, wherein the second table is used to record field information of the target table in the database; obtaining field information corresponding to each first table involved in each database transaction; and determining whether each first table involved in each database transaction is the target table in the database based on the field information of the target table in the database recorded in the second table and the field information corresponding to each first table involved in each database transaction.

[0053] For example, the above-mentioned second table can be table K, and after scanning the large table in the database (corresponding to the target table in the above-mentioned database), the table name, current number of rows, physical, and logical primary key fields (corresponding to the field information of the target table in the database recorded in the above-mentioned second table) of the scanned large table (corresponding to the target table in the above-mentioned database) can be counted, and the table name, current number of rows, physical, and logical primary key fields (corresponding to the field information of the target table in the database recorded in the above-mentioned second table) of the scanned large table (corresponding to the target table in the above-mentioned database) can be uniformly recorded in table K (corresponding to the above-mentioned second table). In addition, after filtering out the database transaction list Q' in which there are actions of updating or deleting tables in the database, the method list in Q' can be traversed, and the field T involved in updating the table can be read; then, T can be split according to individual tables, and T can be parsed into T1, T2...Tn, which is the T' set; then, by traversing the T' set and the large table record K to see if there is an intersection, it can be determined whether the table involved in the database transaction in which there are actions of updating or deleting tables in the database (corresponding to the multiple first tables involved in each of the above-mentioned database transactions) contains a large table (corresponding to the target table in the above-mentioned database) that was scanned out in advance in the database.

[0054] For example, if there is an intersection between the traversed T' set and the large table record K, it can be determined that the table involved in the database transaction with the update or delete table action in the database (corresponding to the multiple first tables involved in each of the above database transactions) contains the large table pre-scanned in the database (corresponding to the target table in the above database); if there is no intersection between the traversed T' set and the large table record K, it can be determined that the table involved in the database transaction with the update or delete table action in the database (corresponding to the multiple first tables involved in each of the above database transactions) does not contain the large table pre-scanned in the database (corresponding to the target table in the above database).

[0055] Through the above solution, the preset large table in the table involved in the database transaction with update or delete table action in the database can be quickly and accurately screened out according to the field information in the table.

[0056] Figure 2 The process of the method for processing database transactions provided in the embodiment of the present application is as follows Figure 2 ,like Figure 2 As shown, in the database transaction processing method provided in the embodiment of the present application, each database transaction is screened according to the target table in the database and the multiple first tables involved in each database transaction, and the target database transaction among the multiple database transactions is determined to include:

[0057] Step S201, determining whether each first table involved in each database transaction is a target table in the database;

[0058] Step S202, if each first table involved in each database transaction is not a target table in the database, determining that there is no target database transaction in the multiple database transactions;

[0059] Step S203 : if at least one first table among the multiple first tables involved in each database transaction is a target table in the database, a target database transaction among the multiple database transactions is obtained according to the at least one first table.

[0060] For example, if there is no intersection between the traversed T' set and the large table records K, it can be determined that the table involved in the database transaction with update or delete table actions in the database (corresponding to the multiple first tables involved in each of the above database transactions) does not contain the large table pre-scanned in the database (corresponding to the target table in the above database), and it can be determined that there is no large transaction operation risk in the database; if there is an intersection between the traversed T' set and the large table records K, it can be determined that the table involved in the database transaction with update or delete table actions in the database (corresponding to the multiple first tables involved in each of the above database transactions) contains the large table pre-scanned in the database (corresponding to the target table in the above database), and it can be further determined that there is a potential large transaction operation risk in the database.

[0061] For example, after determining that there is a potential large transaction operation risk in the database, additional large transaction risk analysis weight rules can be added, such as Rule 1: Parse the SQL involved in the current table, match the large table records, follow the index, and increase the large transaction mark weight by 1; Rule 2: Parse the SQL involved in the current table, match the large table records, do not follow the index, and increase the large transaction mark weight by 2; Rule 3: Parse the current method, if there is a table update operation in the loop body, and follow the index, the large transaction mark weight is +5; Rule 4: Parse the current method, if there is a table update operation in the loop body, and do not follow the index, the large transaction mark weight is +10; Rule 5: Parse the current method, if there is no table update operation in the loop body, the large transaction mark weight is +1.

[0062] Through the above solution, large transactions in the database can be quickly and accurately screened out according to the tables involved in the database transactions that have table update or deletion actions in the database and the pre-scanned large tables.

[0063] Figure 3 The process of the method for processing database transactions provided in the embodiment of the present application is as follows Figure 3 ,like Figure 3As shown, in the database transaction processing method provided in the embodiment of the present application, each database transaction is screened according to the target table in the database and the multiple first tables involved in each database transaction, and the target database transaction among the multiple database transactions is determined to include:

[0064] Step S301, obtaining target information of each database transaction, wherein the target information is at least one of the following: information on whether the target code involved in each database transaction uses an index and information on whether there is an update operation on a table in each database transaction;

[0065] Step S302: determining a target database transaction among multiple database transactions according to the target information of each database transaction.

[0066] For example, the above target information may be a weight rule for analyzing the hidden dangers of large transactions, such as Rule 1: Parse the SQL involved in the current table, match the large table record, go through the index, and add a large transaction mark weight of +1; Rule 2: Parse the SQL involved in the current table, match the large table record, do not go through the index, and add a large transaction mark weight of +2; Rule 3: Parse the current method, if there is a table update operation in the loop body, and go through the index, add a large transaction mark weight of +5; Rule 4: Parse the current method, if there is a table update operation in the loop body, and do not go through the index, add a large transaction mark weight of +10; Rule 5: Parse the current method, if there is no table update operation in the loop body, add a large transaction mark weight of +1. And according to these rules, the database transactions (corresponding to each of the above database transactions) with table update or deletion actions in the database can be analyzed, and according to the weight information that the database transactions (corresponding to each of the above database transactions) with table update or deletion actions correspond to large transactions, determine the large transactions (corresponding to the above target database transactions) in the database transactions (corresponding to each of the above database transactions) with table update or deletion actions in the database.

[0067] For example, if there are database transactions A, B, and C in the database that update or delete table actions, and the probability that database transaction A is a large transaction (corresponding to the target database transaction) is 95%, the probability that database transaction B is a large transaction (corresponding to the target database transaction) is 50%, and the probability that database transaction C is a large transaction (corresponding to the target database transaction) is 70% calculated through the above rules 1 to 5. And it is preset that database transactions with probability values ​​exceeding 90% are large transactions, then according to the calculation results, it can be determined that the probability that database transaction A is a large transaction (corresponding to the target database transaction) is 95%, which exceeds the preset probability value of 90%, and finally it can be determined that database transaction A among the database transactions that update or delete table actions in the database is a large transaction (corresponding to the target database transaction).

[0068] Through the above solution, large transactions in the database can be quickly and accurately screened out according to the pre-set weight rules.

[0069] Optionally, in the method for processing database transactions provided in an embodiment of the present application, after screening each database transaction based on a target table in the database and multiple first tables involved in each database transaction to determine a target database transaction among multiple database transactions, the method further includes: obtaining multiple third tables involved in the target database transactions among the multiple database transactions; constructing a fourth table based on information of the multiple third tables involved in the target database transactions among the multiple database transactions; sending the fourth table to the target object, and reminding the target object to process the target database transaction among the multiple database transactions based on the information in the fourth table.

[0070] For example, after outputting the database transaction list Q2 with large transaction risks, you can use the JAVA method to involve large tables (corresponding to the multiple third tables involved in the target database transactions in the multiple database transactions mentioned above) and SQL to perform statistics, form a table (corresponding to the fourth table mentioned above), append it to the email, and notify the developer (corresponding to the target object mentioned above) through the SMTP (Simple Mail Transfer Protocol) email channel.

[0071] Through the above solution, large transactions can be reported to developers through monitoring alarm emails, completing automated analysis of potential large transactions and entry points.

[0072] For example, in order to solve the problem of delay in discovering traditional large transactions, there is no need to rely on professional personnel to check JAVA code, troubleshoot SQL statements, etc., but it can automatically discover and predict suspicious database large transaction problems in advance and issue early warnings.

[0073] For example, the complete technical solution of this embodiment includes four modules: a large table pre-scanning device, a transaction boundary scanning device, a large transaction analysis device, and a large transaction early warning device. The overall idea is that the large table scan is responsible for scanning the table list of potentially large data volumes, the transaction boundary scanning device is responsible for scanning the transaction boundaries of suspicious boundaries in the code, and the table range involved in the abstract syntax tree analysis is intersected with the preset large table range to filter out the preset large table, and mark the current transaction as a possible large table transaction. Finally, the large transaction early warning device sends a large transaction alarm to the developer, completing the automated analysis of potential large transactions and entries.

[0074] Step 1: Large table pre-scanning device. The large table pre-scanning device management device is mainly responsible for presetting the large table information that the user is concerned about (corresponding to the target table in the aforementioned embodiment), specifying the database instance, and configuring more than B records of data to be preset as large tables and other table information fields to define the scope of the large table.

[0075] The processing flow is as follows:

[0076] Input parameters: include database instance A and large transaction data threshold B.

[0077] Processing steps:

[0078] (1) Scan all tables S in the current database instance A.

[0079] (2) Traverse S one by one to query the number of rows B' involved in the current table S'.

[0080] 1) If B' of the current table S' is greater than B, mark the current table as a large table.

[0081] 2) Count the large table records including the table name, current number of rows, physical and logical primary key fields into unified records in table K.

[0082] Output parameter: large table record K, including the table name, the number of rows in the table, the physical primary key, the logical primary key and other fields. For use by the large transaction analysis device.

[0083] Step 2: Transaction boundary scanning, relying on the transaction boundary scanning device to scan the scope of the transaction boundary in the JAVA code. This device scans specific transaction annotations, such as scanning the @Transactional annotation in the spring framework (an open source framework for building enterprise-level Java applications) (an annotation in the Spring framework, used to mark a method or class that requires transaction management) (in this embodiment, only the transaction annotation scope of the transaction non-propagation mechanism is discussed. Annotation-type transactions with propagation attributes and transaction nesting, and programmatic transactions are not within the scope of this embodiment). The method entry abstract syntax tree is used to parse the entire method body and nested methods to determine all method calls in the current transaction boundary, including table operation calls. The main process is as follows:

[0084] Input parameters: Code project for database interaction with transaction annotations.

[0085] Processing steps:

[0086] (1) Read the code project file path S.

[0087] (2) Scan all JAVA codes and Mapper files (a file used to define data mapping relationships), save them in the database in TEXT format (text format), including class names, fully qualified names, and source code text, involving tables (initialized to empty) to table Q.

[0088] (3) Use the lexical analysis tool to scan the source code text related to Q saved in the database, and filter out the JAVA method M containing the transaction annotation @Transactionnal or a specific transaction annotation, read the calling relationship of the current method line by line, and filter out the SQL statements for table update and delete operations.

[0089] (4) Table T defined in the parsing statement. If the current method involves update and delete operations, the method M is marked as having update in the Q set, and the current table information T is appended to the table field in M. After the update is completed, all JAVA methods involved in the update operation are uniformly marked in the Q' set. At this point, the list of table methods involved in the update operation has been screened out for large transaction analysis.

[0090] Output parameter: A list of JAVA methods Q' that mark the existence of update or delete table actions.

[0091] Step 3: As of step 2, the JAVA methods with table update operations have been marked and the large table list has been screened. This step only requires counting the tables involved in the JAVA methods and the intersection of the large table list to screen out suspicious JAVA methods.

[0092] Input parameters: table record K of database instance A, JAVA method list Q' that marks the existence of update or delete table actions.

[0093] Processing steps:

[0094] (1) Traverse the method list in Q' and read the field T involved in updating the table.

[0095] (2) Split into separate tables and parse T into T1, T2...Tn, which is the set T'.

[0096] (3) Traverse the T' set and find that the same large table record K has an intersection.

[0097] 1) If there is an intersection, it is a potential large transaction operation risk, and the large transaction hidden danger analysis weight rule can be added.

[0098] Rule 1: Parse the SQL involved in the current table, match the large table records, use the index, and mark the large transaction weight +1;

[0099] Rule 2: Parse the SQL involved in the current table, match the large table records, do not use the index, and mark the large transaction weight +2;

[0100] Rule 3: Analyze the current method. If there is a table update operation in the loop body and the index is used, the large transaction mark weight is increased by 5.

[0101] Rule 4: Analyze the current method. If there is a table update operation in the loop body and the index is not used, the large transaction mark weight is increased by 10;

[0102] Rule 5: Analyze the current method. If there is no table update operation in the loop body, the large transaction mark weight is increased by 1.

[0103] 2) If there is no intersection, it is judged that there is no risk of major transaction operation.

[0104] Output parameter: Output the JAVA method list Q2 that has the risk of large transactions.

[0105] Step 4: As of step 3, the JAVA method list screening operation with potential large transaction risks has been completed. This step only requires statistics on the risk list and related tables, and carries out monitoring and early warning.

[0106] Input parameters: Output the list of JAVA methods with large transaction risks Q2.

[0107] Processing steps: According to the JAVA method, statistics involving large tables and SQL are formed into tables, appended to emails, and developers are notified through the SMTP (Simple Mail Transfer Protocol) email channel.

[0108] Output parameter: monitoring alarm email.

[0109] Therefore, in this embodiment, the large transaction analysis of the application is performed according to the preset scanning of the large table, and the update operations in the database table list and the code are automatically analyzed to perform cross-checking, thereby reducing manual checking and intervention, especially in the context of large-scale technical debt management, which can fully improve the efficiency of optimizing and integrating human resources.

[0110] In summary, the method for processing database transactions provided in the embodiments of the present application obtains a target table in the database, wherein the number of rows in the target table is greater than a preset threshold; obtains multiple database transactions in the database, and determines multiple first tables involved in each database transaction, wherein the multiple database transactions are database transactions in which target operations exist in the database, and the target operations are at least one of the following: an operation of updating a table and an operation of deleting a table; based on the target table in the database and the multiple first tables involved in each database transaction, each database transaction is screened to determine a target database transaction among the multiple database transactions, wherein the target database transaction is a transaction whose running time is greater than a preset time and the number of data to be operated is greater than a preset number, thereby solving the problem in the related art that it is difficult to automatically discover and predict suspicious large database transactions in advance, resulting in a decrease in database performance. By pre-scanning the large table range in the database, and then scanning multiple database transactions in the database with table update or deletion actions, and then analyzing the table range involved in each database transaction with table update or deletion actions, and based on the table range involved in each database transaction obtained by analysis and the pre-scanned large table, the large transactions among the multiple database transactions in the database are screened out, so that suspicious large database transactions can be automatically discovered and predicted in advance, thereby achieving the effect of improving database performance.

[0111] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0112] The embodiment of the present application also provides a database transaction processing device. It should be noted that the database transaction processing device of the embodiment of the present application can be used to execute the database transaction processing method provided by the embodiment of the present application. The following introduces the database transaction processing device provided by the embodiment of the present application.

[0113] Figure 4 Schematic diagram of a database transaction processing device provided according to an embodiment of the present application. Figure 4 As shown, the device includes: a first acquisition unit 401, a first processing unit 402 and a first determination unit 403.

[0114] The first acquisition unit 401 is used to acquire a target table in a database, wherein the number of rows in the target table is greater than a preset threshold value; the first processing unit 402 is used to acquire multiple database transactions in the database, and determine multiple first tables involved in each database transaction, wherein the multiple database transactions are database transactions in which target operations exist in the database, and the target operations are at least one of the following: an operation of updating a table and an operation of deleting a table; the first determination unit 403 is used to screen each database transaction according to the target table in the database and the multiple first tables involved in each database transaction, and determine a target database transaction among the multiple database transactions, wherein the target database transaction is a transaction having a running time greater than a preset time and a number of data to be operated greater than a preset number.

[0115] In summary, the database transaction processing device provided by the embodiment of the present application obtains the target table in the database through the first acquisition unit 401, wherein the number of rows in the target table is greater than a preset threshold; the first processing unit 402 obtains multiple database transactions in the database, and determines multiple first tables involved in each database transaction, wherein the multiple database transactions are database transactions in which target operations exist in the database, and the target operations are at least one of the following: an operation of updating a table and an operation of deleting a table; the first determination unit 403 screens each database transaction according to the target table in the database and the multiple first tables involved in each database transaction, and determines the target database transaction among the multiple database transactions, wherein the target database transaction is a transaction whose running time is greater than a preset time and the number of data to be operated is greater than a preset number, thereby solving the problem in the related art that it is difficult to automatically discover and predict suspicious large database transactions in advance, resulting in a decrease in database performance. By pre-scanning the large table range in the database, and then scanning multiple database transactions in the database with table update or deletion actions, and then analyzing the table range involved in each database transaction with table update or deletion actions, and based on the table range involved in each database transaction obtained by analysis and the pre-scanned large table, the large transactions among the multiple database transactions in the database are screened out, so that suspicious large database transactions can be automatically discovered and predicted in advance, thereby achieving the effect of improving database performance.

[0116] Optionally, in the database transaction processing device provided in the embodiment of the present application, the first determination unit includes: a first judgment module, used to judge whether each first table involved in each database transaction is a target table in the database; a first determination module, used to determine that there is no target database transaction in multiple database transactions if each first table involved in each database transaction is not the target table in the database; a second determination module, used to obtain the target database transaction in multiple database transactions based on the at least one first table if at least one first table among the multiple first tables involved in each database transaction is the target table in the database.

[0117] Optionally, in the database transaction processing device provided in the embodiment of the present application, the first judgment module includes: a first acquisition sub-module, used to acquire a second table, wherein the second table is used to record field information of a target table in a database; a second acquisition sub-module, used to acquire field information corresponding to each first table involved in each database transaction; and a first judgment sub-module, used to determine whether each first table involved in each database transaction is a target table in the database based on the field information of the target table in the database recorded in the second table and the field information corresponding to each first table involved in each database transaction.

[0118] Optionally, in the database transaction processing device provided in an embodiment of the present application, the first determination unit includes: a first acquisition module, used to obtain target information of each database transaction, wherein the target information is at least one of the following: information on whether the target code involved in each database transaction uses an index and information on whether there is an update operation on a table in each database transaction; a third determination module, used to determine the target database transaction among multiple database transactions based on the target information of each database transaction.

[0119] Optionally, in the database transaction processing device provided in the embodiment of the present application, the device also includes: a second acquisition unit, used to screen each database transaction based on a target table in the database and multiple first tables involved in each database transaction, and after determining the target database transaction in the multiple database transactions, obtain multiple third tables involved in the target database transactions in the multiple database transactions; a first construction unit, used to construct a fourth table based on information of the multiple third tables involved in the target database transactions in the multiple database transactions; and a second processing unit, used to send the fourth table to the target object, and remind the target object to process the target database transaction in the multiple database transactions based on the information in the fourth table.

[0120] Optionally, in the database transaction processing device provided in the embodiment of the present application, the first processing unit includes: a fourth determination module, used to obtain multiple database transactions containing annotation information from the database to obtain a database transaction set; a second judgment module, used to determine whether the database transaction set contains a database transaction with a target operation; the first processing module, used to prohibit obtaining multiple database transactions in the database if the database transaction set does not contain a database transaction with a target operation; and the second acquisition module, used to obtain multiple database transactions in the database based on the database transaction set if the database transaction set contains a database transaction with a target operation.

[0121] Optionally, in the database transaction processing device provided in the embodiment of the present application, the first acquisition unit includes: a third acquisition module, used to acquire multiple tables in the database and acquire the number of rows of each table; a third judgment module, used to judge whether the number of rows of each table is greater than a preset threshold; a second processing module, used to prohibit acquiring the target table in the database if the number of rows of each table is not greater than the preset threshold; a fourth acquisition module, used to acquire the target table in the database based on at least one table if the number of rows of at least one table among the multiple tables in the database is greater than the preset threshold.

[0122] The database transaction processing device includes a processor and a memory. The first acquisition unit 401, the first processing unit 402 and the first determination unit 403 are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.

[0123] The processor includes a kernel, which calls the corresponding program unit from the memory. The kernel can be set to one or more, and the kernel parameters can be adjusted to automatically detect and predict suspicious large database transactions in advance.

[0124] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0125] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the method for processing database transactions is implemented.

[0126] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the method for processing database transactions when running.

[0127] like Figure 5As shown, an embodiment of the present invention provides an electronic device, the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the following steps when executing the program: obtaining a target table in a database, wherein the number of rows in the target table is greater than a preset threshold; obtaining multiple database transactions in the database, and determining multiple first tables involved in each database transaction, wherein the multiple database transactions are database transactions in which target operations exist in the database, and the target operations are at least one of the following: an operation of updating a table and an operation of deleting a table; based on the target table in the database and the multiple first tables involved in each database transaction, screening each database transaction, and determining a target database transaction among the multiple database transactions, wherein the target database transaction is a transaction having a running time greater than a preset time and a number of data to be operated greater than a preset number.

[0128] When the processor executes the program, the following steps are also implemented: based on the target table in the database and the multiple first tables involved in each database transaction, each database transaction is screened, and determining the target database transaction in the multiple database transactions includes: judging whether each first table involved in each database transaction is the target table in the database; if each first table involved in each database transaction is not the target table in the database, determining that there is no target database transaction in the multiple database transactions; if at least one first table among the multiple first tables involved in each database transaction is the target table in the database, obtaining the target database transaction in the multiple database transactions based on the at least one first table.

[0129] When the processor executes the program, the following steps are also implemented: determining whether each first table involved in each database transaction is a target table in the database includes: obtaining a second table, wherein the second table is used to record field information of the target table in the database; obtaining field information corresponding to each first table involved in each database transaction; and determining whether each first table involved in each database transaction is a target table in the database based on the field information of the target table in the database recorded in the second table and the field information corresponding to each first table involved in each database transaction.

[0130] When the processor executes the program, the following steps are also implemented: based on the target table in the database and the multiple first tables involved in each database transaction, each database transaction is screened, and determining the target database transaction among the multiple database transactions includes: obtaining target information of each database transaction, wherein the target information is at least one of the following: information on whether the target code involved in each database transaction uses an index and information on whether an update operation on the table exists in each database transaction; and determining the target database transaction among the multiple database transactions based on the target information of each database transaction.

[0131] When the processor executes the program, the following steps are also implemented: after screening each database transaction according to the target table in the database and the multiple first tables involved in each database transaction to determine the target database transaction in the multiple database transactions, it also includes: obtaining multiple third tables involved in the target database transactions in the multiple database transactions; constructing a fourth table based on information of the multiple third tables involved in the target database transactions in the multiple database transactions; sending the fourth table to the target object, and reminding the target object to process the target database transaction in the multiple database transactions according to the information in the fourth table.

[0132] When the processor executes the program, the following steps are also implemented: obtaining multiple database transactions in the database includes: obtaining multiple database transactions containing annotation information from the database to obtain a database transaction set; determining whether the database transaction set contains a database transaction with a target operation; if the database transaction set does not contain a database transaction with a target operation, obtaining multiple database transactions in the database is prohibited; if the database transaction set contains a database transaction with a target operation, obtaining multiple database transactions in the database based on the database transaction set.

[0133] When the processor executes the program, the following steps are also implemented: obtaining the target table in the database includes: obtaining multiple tables in the database and obtaining the number of rows in each table; determining whether the number of rows in each table is greater than a preset threshold; if the number of rows in each table is not greater than the preset threshold, prohibiting the acquisition of the target table in the database; if there is at least one table among the multiple tables in the database whose number of rows is greater than the preset threshold, then obtaining the target table in the database based on at least one table.

[0134] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0135] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: obtaining a target table in a database, wherein the number of rows in the target table is greater than a preset threshold; obtaining multiple database transactions in the database, and determining multiple first tables involved in each database transaction, wherein the multiple database transactions are database transactions in which target operations exist in the database, and the target operations are at least one of the following: an operation of updating a table and an operation of deleting a table; based on the target table in the database and the multiple first tables involved in each database transaction, screening each database transaction to determine a target database transaction among the multiple database transactions, wherein the target database transaction is a transaction whose running time is greater than a preset time and the number of data to be operated is greater than a preset number.

[0136] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: based on the target table in the database and the multiple first tables involved in each database transaction, each database transaction is screened, and determining the target database transaction in the multiple database transactions includes: judging whether each first table involved in each database transaction is the target table in the database; if each first table involved in each database transaction is not the target table in the database, determining that there is no target database transaction in the multiple database transactions; if at least one first table in the multiple first tables involved in each database transaction is the target table in the database, then obtaining the target database transaction in the multiple database transactions based on the at least one first table.

[0137] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: judging whether each first table involved in each database transaction is a target table in the database, including: obtaining a second table, wherein the second table is used to record field information of the target table in the database; obtaining field information corresponding to each first table involved in each database transaction; judging whether each first table involved in each database transaction is a target table in the database based on the field information of the target table in the database recorded in the second table and the field information corresponding to each first table involved in each database transaction.

[0138] When executed on a data processing device, it is also suitable for executing an initialized program having the following method steps: screening each database transaction based on a target table in a database and multiple first tables involved in each database transaction, and determining a target database transaction among multiple database transactions includes: obtaining target information of each database transaction, wherein the target information is at least one of the following: information on whether a target code involved in each database transaction uses an index and information on whether an update operation on a table exists in each database transaction; and determining a target database transaction among multiple database transactions based on the target information of each database transaction.

[0139] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: after screening each database transaction based on a target table in the database and multiple first tables involved in each database transaction to determine a target database transaction among multiple database transactions, it also includes: obtaining multiple third tables involved in the target database transactions among the multiple database transactions; constructing a fourth table based on information of the multiple third tables involved in the target database transactions among the multiple database transactions; sending the fourth table to a target object, and reminding the target object to process the target database transaction among the multiple database transactions based on information in the fourth table.

[0140] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: obtaining multiple database transactions in a database includes: obtaining multiple database transactions containing annotation information from the database to obtain a database transaction set; determining whether the database transaction set contains a database transaction with a target operation; if the database transaction set does not contain a database transaction with a target operation, prohibiting the acquisition of multiple database transactions in the database; if the database transaction set contains a database transaction with a target operation, obtaining multiple database transactions in the database based on the database transaction set.

[0141] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: obtaining a target table in a database includes: obtaining multiple tables in the database and obtaining the number of rows in each table; determining whether the number of rows in each table is greater than a preset threshold; if the number of rows in each table is not greater than the preset threshold, prohibiting the acquisition of the target table in the database; if there is at least one table among the multiple tables in the database whose number of rows is greater than the preset threshold, then obtaining the target table in the database based on at least one table.

[0142] 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 adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0143] 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 box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 generate 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.

[0144] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate 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 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

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

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

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

[0148] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by 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 memory (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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape 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 temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0149] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0150] 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 adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0151] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for processing database transactions, characterized in that: include: Acquire a target table in a database, wherein the number of rows in the target table is greater than a preset threshold; Acquire multiple database transactions in the database, and determine multiple first tables involved in each database transaction, wherein the multiple database transactions are database transactions in the database having a target operation, and the target operation is at least one of the following: an operation of updating a table and an operation of deleting a table; Based on the target table in the database and multiple first tables involved in each database transaction, each database transaction is screened to determine a target database transaction among the multiple database transactions, wherein the target database transaction is a transaction whose running time is greater than a preset time and the number of data to be operated is greater than a preset number.

2. The method according to claim 1, characterized in that: Screening each database transaction according to the target table in the database and the multiple first tables involved in each database transaction, and determining that the target database transaction in the multiple database transactions includes: Determining whether each first table involved in each database transaction is a target table in the database; If each first table involved in each database transaction is not a target table in the database, determining that the target database transaction does not exist in the plurality of database transactions; If at least one first table among the multiple first tables involved in each database transaction is a target table in the database, then the target database transaction among the multiple database transactions is obtained according to the at least one first table.

3. The method according to claim 2, characterized in that Determining whether each first table involved in each database transaction is a target table in the database includes: Acquire a second table, wherein the second table is used to record field information of the target table in the database; Obtaining field information corresponding to each first table involved in each database transaction; According to the field information of the target table in the database recorded in the second table and the field information corresponding to each first table involved in each database transaction, it is determined whether each first table involved in each database transaction is the target table in the database.

4. The method according to claim 1, characterized in that: Screening each database transaction according to the target table in the database and the multiple first tables involved in each database transaction, and determining that the target database transaction in the multiple database transactions includes: Obtaining target information of each database transaction, wherein the target information is at least one of the following: information on whether a target code involved in each database transaction uses an index and information on whether an update operation is performed on a table in each database transaction; According to the target information of each database transaction, a target database transaction among the multiple database transactions is determined.

5. The method according to claim 1, characterized in that After screening each database transaction according to the target table in the database and the multiple first tables involved in each database transaction to determine the target database transaction among the multiple database transactions, the method further includes: Acquire a plurality of third tables involved in a target database transaction among the plurality of database transactions; constructing a fourth table based on information of multiple third tables involved in the target database transaction in the multiple database transactions; The fourth table is sent to a target object, and the target object is reminded to process a target database transaction among the multiple database transactions according to the information in the fourth table.

6. The method according to claim 1, characterized in that Acquiring a plurality of database transactions in the database includes: Acquire multiple database transactions containing annotation information from the database to obtain a database transaction set; Determine whether the database transaction set contains a database transaction in which the target operation exists; If the database transaction set does not include the database transaction in which the target operation exists, it is prohibited to obtain multiple database transactions in the database; If the database transaction set includes a database transaction in which the target operation exists, multiple database transactions in the database are acquired according to the database transaction set.

7. The method according to claim 1, characterized in that Obtaining the target table in the database includes: Obtain multiple tables in the database and obtain the number of rows in each table; Determine whether the number of rows in each table is greater than the preset threshold; If the number of rows in each table is not greater than the preset threshold, it is prohibited to obtain the target table in the database; If the number of rows of at least one table among the multiple tables in the database is greater than the preset threshold, a target table in the database is acquired according to the at least one table.

8. A database transaction processing device, characterized in that: include: A first acquisition unit is used to acquire a target table in a database, wherein the number of rows in the target table is greater than a preset threshold; A first processing unit is configured to obtain a plurality of database transactions in the database and determine a plurality of first tables involved in each database transaction, wherein the plurality of database transactions are database transactions in which a target operation exists in the database, and the target operation is at least one of the following: an operation of updating a table and an operation of deleting a table; A first determination unit is used to screen each database transaction according to a target table in the database and multiple first tables involved in each database transaction, and determine a target database transaction among the multiple database transactions, wherein the target database transaction is a transaction whose running time is greater than a preset time and the amount of data to be operated is greater than a preset amount.

9. A computer-readable storage medium, characterized in that: The storage medium stores a program, wherein the program executes the method for processing database transactions as described in any one of claims 1 to 7.

10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the database transaction processing method described in any one of claims 1 to 7.