Transaction request processing method and device, equipment, storage medium and program product

By judging the database table information to be accessed in the SQL statement of the parallel database transaction request, identifying and adjusting the deadlock logic conditions, the database deadlock problem caused by execution time conflicts in the concurrent transaction request is solved, and the stability and processing efficiency of the system are improved. .

CN119202048APending Publication Date: 2024-12-27JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411232165.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In concurrently executed database transaction requests, database deadlocks caused by execution time conflicts of SQL request statements are common, affecting business processing, and the logical optimization analysis information provided by the prior art is limited, making it difficult to effectively solve.

Method used

By obtaining the database transaction request executed in parallel, determining the database table information to be accessed in its corresponding SQL request statement, determining whether there is a deadlock logical condition, and adjusting the execution time of the target transaction execution request if it exists to avoid deadlock.

Benefits of technology

Effectively optimize and handle database deadlocks caused by SQL request statement execution time conflicts, avoid transaction execution errors or rollbacks, and improve system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202048A_ABST
    Figure CN119202048A_ABST
Patent Text Reader

Abstract

The invention discloses a transaction request processing method and device, equipment, a storage medium and a program product. The method comprises the following steps: acquiring at least two database transaction execution requests which are executed in parallel under the same execution time; determining to-be-accessed database table information according to the SQL request statement corresponding to each database transaction execution request; according to the to-be-accessed database table information, determining whether a target transaction execution request meeting a database deadlock logic judgment condition exists in the database transaction execution requests or not; if yes, the execution time of the target transaction execution request is adjusted, so that the target transaction execution request executes the transaction based on the adjusted execution time. By adopting the method, the deadlock logic judgment can be performed on the database transaction requests which are executed in parallel under the same execution time, and the execution time of the database transaction requests which are executed in parallel and meet the deadlock logic condition is adjusted, so that the transaction execution error report or rollback caused by the occurrence of the deadlock logic is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database transaction processing, and in particular to a transaction request processing method, device, equipment, storage medium and program product. Background Art

[0002] As a system for storing and processing data, databases need to handle a large number of logically complex transaction requests in actual applications. In the process of executing transaction requests, there are usually a large number of concurrently executed SQL (Structured Query Language) request statements. Database deadlock is a common phenomenon in the case of concurrent execution. Deadlock will affect the business's processing of data, requiring reprocessing or rollback operations, which has a great impact on the entire system. In addition, the analytical information that can be provided by logical optimization of transaction requests is relatively limited.

[0003] Therefore, how to optimize the database deadlock phenomenon caused by the conflict in the execution time of SQL request statements in concurrently executed transaction requests has become a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0004] The present invention provides a transaction request processing method, device, equipment, storage medium and program product to solve the database deadlock problem that may occur in concurrently executed transaction requests.

[0005] According to one aspect of the present invention, a transaction request processing method is provided, comprising:

[0006] Obtain at least two database transaction execution requests executed in parallel at the same execution time;

[0007] Determine the database table information to be accessed according to the SQL request statement corresponding to each of the database transaction execution requests;

[0008] Determine, based on the to-be-accessed database table information, whether there is a target transaction execution request that satisfies a database deadlock logic judgment condition in each of the database transaction execution requests;

[0009] If so, the execution time of the target transaction execution request is adjusted so that the target transaction execution request executes the transaction based on the adjusted execution time.

[0010] According to another aspect of the present invention, there is provided a transaction request processing device, comprising:

[0011] An execution request acquisition module, used to acquire at least two database transaction execution requests executed in parallel at the same execution time;

[0012] A data table information determination module, used to determine the database table information to be accessed according to the SQL request statement corresponding to each of the database transaction execution requests;

[0013] An execution request determination module, used to determine whether there is a target transaction execution request that meets the database deadlock logic judgment condition among the database transaction execution requests according to the database table information to be accessed;

[0014] The execution time adjustment module is used to adjust the execution time of the target transaction execution request when there is a target transaction execution request that meets the database deadlock logic judgment condition, so that the target transaction execution request executes the transaction based on the adjusted execution time.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] at least one processor; and

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

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the transaction request processing method described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the transaction request processing method described in any embodiment of the present invention when executed.

[0020] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the transaction request processing method described in any embodiment of the present invention is implemented.

[0021] The technical solution of the embodiment of the present invention obtains at least two database transaction execution requests executed in parallel at the same execution time; determines the database table information to be accessed according to the SQL request statements corresponding to each database transaction execution request; determines whether there is a target transaction execution request that meets the database deadlock logic judgment condition in each database transaction execution request according to the database table information to be accessed; if so, adjusts the execution time of the target transaction execution request so that the target transaction execution request executes the transaction based on the adjusted execution time. It can determine whether the SQL request statements corresponding to the database transaction requests executed in parallel at the same execution time meet the deadlock logic condition, and adjust the execution time of the database transaction requests executed in parallel that meet the deadlock logic condition, and can optimize the database deadlock phenomenon caused by the conflict in the execution time of the SQL request statements, thereby avoiding transaction execution errors or rollbacks due to the occurrence of deadlock logic.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 is a flowchart of a transaction request processing method provided according to Embodiment 1 of the present invention;

[0025] Figure 2 is a flow chart of a transaction request processing method provided according to Embodiment 2 of the present invention;

[0026] Figure 3 is a structural diagram of a transaction request processing device provided according to Embodiment 3 of the present invention;

[0027] Figure 4 It is a structural schematic diagram of an electronic device for implementing the transaction request processing method according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Embodiment 1

[0031] Figure 1 A flowchart of a transaction request processing method is provided for the first embodiment of the present invention. This embodiment can be applied to solve the situation where a database deadlock occurs in concurrently executed database transaction requests. The method can be executed by a transaction request processing device. The transaction request processing device can be implemented in the form of hardware and / or software. The transaction request processing device can be configured in an electronic device. Figure 1 As shown, the method includes:

[0032] S110: Obtain at least two database transaction execution requests executed in parallel at the same execution time.

[0033] Parallel execution may refer to the ability of a database management system to process multiple transaction execution requests within the same time period. The same execution time may be a time period during which at least two database transaction execution requests are processed simultaneously, and may specifically be a time period during which at least two SQL request statements in the same database transaction execution request are called simultaneously, or a time period during which corresponding SQL request statements in at least two database transaction execution requests are called simultaneously.

[0034] Specifically, when it is detected that there is a database transaction execution request, at least two database transaction execution requests executed in parallel at the execution time are obtained.

[0035] S120: Determine the database table information to be accessed according to the SQL request statement corresponding to each database transaction execution request.

[0036] The SQL request statement may specifically be a database language for querying and / or operating data content in a database, such as database management operations such as read operation, write operation, read-write operation or update operation. The database table information to be accessed may specifically be the database to be accessed and the database table information to be accessed, such as the table rows to be accessed and the table columns to be accessed, required to be accessed by calling the corresponding SQL request statement during the processing of each database transaction execution request.

[0037] For any SQL request statement of a database transaction execution request, the SQL request statement is parsed to obtain the database table information to be accessed. Specifically, the statement parsing can be based on preset key fields, such as "SELECT" and "FROM", which can be pre-set according to the characteristics of the SQL statement.

[0038] S130. Determine, based on the information of the database table to be accessed, whether there is a target transaction execution request that meets the database deadlock logic judgment condition among the database transaction execution requests.

[0039] Among them, the deadlock logic judgment condition can be specifically used to determine whether there is data resource contention between database transaction execution requests executed in parallel at the same execution time, and can also be specifically used to determine whether the database table information to be accessed determined by the SQL request statements corresponding to each database transaction execution request executed in parallel at the same execution time is the same.

[0040] Specifically, deadlock logic can include resource mutual exclusion and circular waiting. Among them, resource mutual exclusion means that transactions will lock database resources (such as rows, tables, pages, etc.) during execution to ensure that other transactions cannot modify the resources at the same time. If a transaction has locked certain resources, other transactions that want to access the same resources may be blocked until the first transaction releases these resources. Circular waiting means that a chain of circular waiting resources is formed between multiple transactions. For example, transaction A holds resource a and waits for resource b, while transaction B holds resource b and waits for resource a. In this case, both transactions cannot continue to execute, thus forming a deadlock.

[0041] Therefore, by judging the to-be-accessed database table information corresponding to each transaction execution request, it is possible to judge whether there is a deadlock logic between transaction requests. Specifically, it can be judged whether there is a circular waiting situation or a simultaneous modification situation between the locked database resources in the to-be-accessed database table information, such as table pages, table rows, and table columns. If so, there is a deadlock logic; if not, there is no deadlock logic.

[0042] In an optional scheme of the present embodiment, it can be combined with one or more optional schemes of the present embodiment. Optionally, the information of the database table to be accessed includes the data table to be accessed and the data row to be accessed. Accordingly, according to the information of the database table to be accessed, it is determined whether there is a target transaction execution request that meets the database deadlock logic judgment condition in each database transaction execution request, including: performing consistency comparison on the data table to be accessed and the data row to be accessed corresponding to each database transaction execution request; if there are at least two database transaction execution requests whose data tables to be accessed and the data rows to be accessed are consistent, then at least two database data execution requests are determined as target transaction execution requests.

[0043] The to-be-accessed data table and the to-be-accessed data row may be specifically used to record the location of the database data in the database accessed by calling the corresponding SQL request statement during the processing of each database transaction execution request.

[0044] Specifically, the database table information to be accessed can be determined according to the corresponding SQL request statement in each database transaction execution request, and the data table to be accessed and the data row to be accessed corresponding to each database transaction execution request can be obtained. The data table to be accessed and the data row to be accessed can be determined by parsing the corresponding SQL request statement in each database transaction execution request, and the consistency between the data table to be accessed and the data row to be accessed between each SQL request statement can be compared.

[0045] For example, if the SQL request statement corresponding to transaction A is parsed, it can be obtained that the database table information to be accessed is the seventh row of data in data table a. If the SQL request statement corresponding to transaction B is parsed, it can be obtained that the processing process of transaction B also needs to access the seventh row of data in data table a, that is, it can be determined that there are transactions A and B with the same data table and data row to be accessed. Therefore, transaction execution request A and transaction execution request B can be determined as target transaction execution requests.

[0046] It should be noted that the purpose of determining consistent SQL request statements is to perform corresponding operations on the same table row or table column of the same database, that is, transaction request A may have locked a table row, and other transaction requests may be blocked when they want to access the same resource. Therefore, determining the same SQL request statement ensures that the deadlock mechanism can be released in the time dimension later.

[0047] In an optional solution of the present embodiment, it can be combined with one or more optional solutions of the present embodiment. Optionally, the database transaction execution request includes at least two SQL request statements; accordingly, according to the database table information to be accessed, it is determined whether there is a target transaction execution request that meets the database deadlock logic judgment condition in each database transaction execution request, including: performing consistency comparison on each SQL request statement between each database execution transaction request; if there is an SQL request statement with the same database table information to be accessed, then the SQL request statement with the same database table information to be accessed is determined as the target transaction execution request.

[0048] Specifically, the to-be-accessed database table information determined by the SQL request statement corresponding to the database transaction execution request can be compared for consistency of the SQL request statements. The to-be-accessed database table information requested by the corresponding SQL request statements can be compared.

[0049] Exemplarily, the SQL request statements corresponding to transaction A may be statements 1 and 2, the SQL request statements corresponding to transaction B may be statements 3 and 4, and the SQL request statements corresponding to transaction C may be statements 5. By respectively parsing the SQL request statements corresponding to transactions A, B, and C, the database table information to be accessed of each statement may be obtained. Specifically, statements 1, 3, 4, and 5 may be respectively compared for consistency of the database table information to be accessed, and statements 2, 3, 4, and 5 may be respectively compared for consistency of the database table information to be accessed, and the same SQL request statements may be further determined. For any transaction execution request, if any SQL statement is the same in the comparison process, the transaction execution request is determined as the target transaction execution request. For example, if statement 1 of transaction A and statement 3 of transaction B are the same, even if statement 1 of transaction A and statement 4 of transaction B are different, the requests of transaction A and transaction B are also used as target transaction execution requests.

[0050] S140: If yes, adjust the execution time of the target transaction execution request so that the target transaction execution request executes the transaction based on the adjusted execution time.

[0051] Accordingly, adjusting the execution time of the target transaction execution request includes: determining the SQL request statement with the same to-be-accessed database table information in the target transaction execution request as the target SQL request statement; and adjusting the statement execution time of the target SQL request statement in the target transaction execution request.

[0052] The execution time may be the execution start time of the transaction execution request or the calling time of the SQL request statement in the transaction execution request. Specifically, when there is a target transaction execution request that meets the database deadlock logic judgment condition in each database transaction execution request, the calling time of the SQL request statement with the same database table information to be accessed in the target transaction execution request may be adjusted, wherein the SQL request statement with the same database table information to be accessed may be controlled to be called serially by marking a deadlock tag. The time adjustment scheme may be set by the technicians themselves, and this embodiment does not impose any specific restrictions.

[0053] For example, it may be a SQL request statement corresponding to the target transaction D, which may be used to read the content of the database table f to be accessed; it may also be a SQL request statement corresponding to the target transaction E, which may be used to update the content of the database table f to be accessed. Then, the target transaction D and the target transaction E may be deadlocked, so that the target transaction D and the target transaction E perform serial operations on the content of the database table f to be accessed, specifically, read first and then update, or update first and then read, so as to realize the serial execution of the target transaction D and the target transaction E.

[0054] In an optional solution of this embodiment, it can be combined with one or more optional solutions of this embodiment. Optionally, adjusting the execution time of the target transaction execution request includes: determining the request priority of the target transaction execution request according to the request type of the target transaction execution request; if the request priorities are the same, determining the request data volume of the target transaction execution request; and adjusting the execution time of the target transaction execution request according to the request data volume.

[0055] The request type of the target transaction execution request may specifically be an operation type for operating database information, such as read, write, and delete operations. The request priority may be used to indicate the execution order of the transaction execution requests, such as write priority being greater than read priority and read priority being equal to delete priority. Specifically, it may be pre-set by a technician based on experience, or may be automatically generated by a database management system based on data content.

[0056] For example, if statement 2 corresponding to target transaction A can be a read operation to access database table b, and statement 3 corresponding to target transaction B can be a delete operation to access database table b, then the number of requests to access database table b in target transaction A and target transaction B can be determined based on the read priority being equal to the delete request priority. For example, the number of read operation requests can be 5, and the number of delete operation requests can be 1. Then, the execution time of target transaction A can be adjusted to before target transaction B, and target transaction A can be controlled to be executed first.

[0057] Optionally, adjusting the execution time of the target transaction execution request further includes: if the request priorities are different, adjusting the execution time of the target transaction execution request according to the request priority of the target transaction execution request.

[0058] For example, statement 2 corresponding to target transaction A is a read operation on database table b to be accessed, and statement 3 corresponding to target transaction B is a write operation on database table b to be accessed. Then, according to the write priority and the read request priority, the target transaction A and the target transaction B can be deadlocked to control target transaction B to write the content of database table b to be accessed first, and then control target transaction A to read the content of database table b to be accessed.

[0059] Optionally, after adjusting the execution time of the target transaction execution request so that the target transaction execution request executes the transaction based on the adjusted execution time, it also includes: obtaining transaction information obtained during the execution of the transaction by the target transaction execution request; and associating and storing the request identifier and transaction information of the target transaction execution request so as to perform transaction verification on the target transaction execution request in a future time period according to transaction verification requirements.

[0060] The transaction information may include the start time of the target transaction execution request, the corresponding SQL request statement, and the data pages and data rows accessed by the SQL request statement.

[0061] The technical solution of the embodiment of the present invention obtains at least two database transaction execution requests executed in parallel at the same execution time; determines the database table information to be accessed according to the SQL request statements corresponding to each database transaction execution request; determines whether there is a target transaction execution request that meets the database deadlock logic judgment condition in each database transaction execution request according to the database table information to be accessed; if so, adjusts the execution time of the target transaction execution request so that the target transaction execution request executes the transaction based on the adjusted execution time. It can determine whether the SQL request statements corresponding to the database transaction requests executed in parallel at the same execution time meet the deadlock logic condition, and adjust the execution time of the database transaction requests executed in parallel that meet the deadlock logic condition, and can optimize the database deadlock phenomenon caused by the conflict in the execution time of the SQL request statements, thereby avoiding transaction execution errors or rollbacks due to the occurrence of deadlock logic.

[0062] Embodiment 2

[0063] Figure 2 This is a flow chart of a transaction request processing method provided in Embodiment 2 of the present invention. This embodiment provides a preferred example based on the above embodiment. Figure 2 As shown, the method comprises the following specific steps:

[0064] S210: Obtain at least two database transaction execution requests executed in parallel at the same execution time.

[0065] S220 . Determine the database table information to be accessed according to the SQL request statement corresponding to each database transaction execution request; the database table information to be accessed includes the data table to be accessed and the data row to be accessed.

[0066] S230 , performing consistency comparison on the to-be-accessed data tables and to-be-accessed data rows corresponding to the transaction requests executed by each database.

[0067] S240: If there are at least two database transaction execution requests whose to-be-accessed data tables and to-be-accessed data rows are consistent, the at least two database transaction execution requests are determined as target transaction execution requests.

[0068] S250: Determine a request priority of the target transaction execution request according to the request type of the target transaction execution request.

[0069] S260A: If the request priorities are the same, determine the request data volume of the target transaction execution request, and adjust the execution time of the target transaction execution request according to the request data volume, so that the target transaction execution request executes the transaction based on the adjusted execution time.

[0070] S260B: If the request priorities are different, adjusting the execution time of the target transaction execution request according to the request priority of the target transaction execution request, so that the target transaction execution request executes the transaction based on the adjusted execution time.

[0071] S270: Acquire transaction information obtained during the process of executing the target transaction execution request.

[0072] S280: The request identifier and transaction information of the target transaction execution request are associated and stored, so as to perform transaction verification on the target transaction execution request in a future time period according to transaction verification requirements.

[0073] Optionally, if the database transaction execution request includes at least two SQL request statements, each SQL request statement between each database transaction execution request is compared for consistency; if there is an SQL request statement with the same database table information to be accessed, the SQL request statement with the same database table information to be accessed is determined as the target transaction execution request; the SQL request statement with the same database table information to be accessed in the target transaction execution request is determined as the target SQL request statement; and the statement execution time of the target SQL request statement in the target transaction execution request is adjusted.

[0074] Embodiment 3

[0075] Figure 3 This is a schematic diagram of the structure of a transaction request processing device provided by Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:

[0076] The execution request acquisition module 310 is used to acquire at least two database transaction execution requests executed in parallel at the same execution time.

[0077] The data table information determination module 320 is used to determine the database table information to be accessed according to the SQL request statement corresponding to each of the database transaction execution requests.

[0078] The execution request determination module 330 is used to determine whether there is a target transaction execution request that meets the database deadlock logic judgment condition among the database transaction execution requests according to the to-be-accessed database table information.

[0079] The execution time adjustment module 340 is used to adjust the execution time of the target transaction execution request when there is a target transaction execution request that meets the database deadlock logic judgment condition, so that the target transaction execution request executes the transaction based on the adjusted execution time.

[0080] Optionally, the database table information to be accessed includes the data table to be accessed and the data row to be accessed.

[0081] Accordingly, the execution request determination module 330 is specifically configured to:

[0082] Performing consistency comparison on the to-be-accessed data tables and to-be-accessed data rows respectively corresponding to the database execution transaction requests;

[0083] If there are at least two database transaction execution requests whose to-be-accessed data tables and to-be-accessed data rows are consistent, the at least two database transaction execution requests are determined as target transaction execution requests.

[0084] Optionally, the database transaction execution request includes at least two SQL request statements.

[0085] Accordingly, the execution request determination module 330 is further configured to:

[0086] Comparing the consistency of the SQL request statements between the database execution transaction requests;

[0087] If there is an SQL request statement with the same information of the database table to be accessed, the SQL request statement with the same information of the database table to be accessed is determined as the target transaction execution request.

[0088] Accordingly, the execution time adjustment module 340 is specifically used to:

[0089] Determine the SQL request statement with the same to-be-accessed database table information in the target transaction execution request as the target SQL request statement;

[0090] Adjust the statement execution time of the target SQL request statement in the target transaction execution request.

[0091] Optionally, the execution time adjustment module 340 is further configured to determine a request priority of the target transaction execution request according to a request type of the target transaction execution request;

[0092] If the request priorities are the same, determining the request data volume of the target transaction execution request;

[0093] According to the requested data volume, the execution time of the target transaction execution request is adjusted.

[0094] Optionally, the execution time adjustment module 340 is further configured to adjust the execution time of the target transaction execution request according to the request priority of the target transaction execution request if the request priorities are different.

[0095] Optionally, the device further includes: an associated storage module 350 configured to, after adjusting the execution time of the target transaction execution request so that the target transaction execution request executes the transaction based on the adjusted execution time, obtain transaction information obtained during the execution of the transaction by the target transaction execution request;

[0096] The request identifier and transaction information of the target transaction execution request are associated and stored so as to perform transaction verification on the target transaction execution request in a future time period according to transaction verification requirements.

[0097] The transaction request processing device provided in the embodiment of the present invention can execute the transaction request processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0098] Embodiment 4

[0099] Figure 4 A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0100] like Figure 4 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0101] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0102] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital logic processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as a transaction request processing method.

[0103] In some embodiments, the transaction request processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the transaction request processing method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to execute the transaction request processing method in any other appropriate manner (e.g., by means of firmware).

[0104] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0105] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0106] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable logic medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0107] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0108] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0109] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0110] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0111] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A transaction request processing method, characterized in that: include: Obtain at least two database transaction execution requests executed in parallel at the same execution time; Determine the database table information to be accessed according to the SQL request statement corresponding to each of the database transaction execution requests; Determine, based on the to-be-accessed database table information, whether there is a target transaction execution request that satisfies a database deadlock logic judgment condition in each of the database transaction execution requests; If so, the execution time of the target transaction execution request is adjusted so that the target transaction execution request executes the transaction based on the adjusted execution time.

2. The method according to claim 1, characterized in that The database table information to be accessed includes the data table to be accessed and the data row to be accessed; Correspondingly, determining whether there is a target transaction execution request that meets the database deadlock logic judgment condition in each of the database transaction execution requests according to the to-be-accessed database table information includes: Performing consistency comparison on the to-be-accessed data tables and to-be-accessed data rows respectively corresponding to the database execution transaction requests; If there are at least two database transaction execution requests whose to-be-accessed data tables and to-be-accessed data rows are consistent, the at least two database transaction execution requests are determined as target transaction execution requests.

3. The method according to claim 1, characterized in that The database transaction execution request includes at least two SQL request statements; Correspondingly, determining whether there is a target transaction execution request that meets the database deadlock logic judgment condition in each of the database transaction execution requests according to the to-be-accessed database table information includes: Comparing the consistency of the SQL request statements between the database execution transaction requests; If there is an SQL request statement with the same information of the database table to be accessed, the SQL request statement with the same information of the database table to be accessed is determined as the target transaction execution request; Accordingly, adjusting the execution time of the target transaction execution request includes: Determine the SQL request statement with the same to-be-accessed database table information in the target transaction execution request as the target SQL request statement; Adjust the statement execution time of the target SQL request statement in the target transaction execution request.

4. The method according to claim 1, characterized in that: The adjusting the execution time of the target transaction execution request includes: Determining a request priority of the target transaction execution request according to a request type of the target transaction execution request; If the request priorities are the same, determining the request data volume of the target transaction execution request; According to the requested data volume, the execution time of the target transaction execution request is adjusted.

5. The method according to claim 3, characterized in that: The method further comprises: If the request priorities are different, the execution time of the target transaction execution request is adjusted according to the request priority of the target transaction execution request.

6. The method according to claim 1, characterized in that After adjusting the execution time of the target transaction execution request so that the target transaction execution request executes the transaction based on the adjusted execution time, the method further includes: Acquire transaction information obtained during the process of executing the target transaction execution request; The request identifier and transaction information of the target transaction execution request are associated and stored so as to perform transaction verification on the target transaction execution request in a future time period according to transaction verification requirements.

7. A transaction request processing device, characterized in that: include: An execution request acquisition module, used to acquire at least two database transaction execution requests executed in parallel at the same execution time; A data table information determination module, used to determine the database table information to be accessed according to the SQL request statement corresponding to each of the database transaction execution requests; An execution request determination module, used to determine whether there is a target transaction execution request that meets the database deadlock logic judgment condition among the database transaction execution requests according to the database table information to be accessed; The execution time adjustment module is used to adjust the execution time of the target transaction execution request when there is a target transaction execution request that meets the database deadlock logic judgment condition, so that the target transaction execution request executes the transaction based on the adjusted execution time.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the transaction request processing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the transaction request processing method according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the transaction request processing method according to any one of claims 1 to 6.