A distributed transaction processing method, terminal and computer-readable storage medium

By synchronizing incremental messages of distributed transaction unique identification information by the master node global transaction management, the computing node reduces interaction with the master node, solving the problem of high traffic pressure on computing node network in the distributed database and improving concurrent processing performance.

CN113961639BActive Publication Date: 2025-05-16JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010576647.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-22
Publication Date
2025-05-16
Estimated Expiration
2040-06-22

AI Technical Summary

Technical Problem

In a distributed database, the number of interactions between the computing node and the global transaction management master node is too high, resulting in high network traffic pressure and affecting concurrent processing performance.

Method used

The global transaction management master node synchronizes incremental messages of distributed transaction unique identification information to all computing nodes. The computing node obtains distributed transaction unique identification information of data to be operated from the storage node and performs checksum processing.

Benefits of technology

It reduces the number of interactions between the computing node and the global transaction management master node, reduces the network traffic pressure, and improves the concurrency capability and transaction processing performance of the computing node.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113961639B_ABST
    Figure CN113961639B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a distributed transaction processing method, in which a global transaction management master node synchronizes incremental messages of distributed transaction unique identification information to all computing nodes, wherein the distributed transaction unique identification information is set by the global transaction management master node; the computing node obtains the distributed transaction unique identification information of the data to be operated from the storage node, and verifies the data to be operated; and processes the data to be operated according to the verification result; the present invention also discloses a terminal and a computer-readable storage medium, which stores a program of the above functions and allows a processor to implement the above scheme, thereby reducing the number of interactions between the computing nodes and the global transaction management master node in the distributed database in certain implementation processes, thereby alleviating the network traffic pressure of the computing nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to, but are not limited to, the field of distributed transaction processing, and specifically, relate to, but are not limited to, a distributed transaction processing method, a terminal, and a storage medium. Background Art

[0002] There are more and more distributed database products on the market, and the competition among them is very fierce. High-performance concurrent distributed transaction processing solutions are the core competitiveness. In related technologies, computing nodes need to repeatedly confirm with the global transaction management master node whether the currently processed transaction is active, which makes the network traffic pressure between computing nodes and the global transaction management master node large. At the same time, computing nodes also need to repeatedly obtain data to be operated from storage nodes. Therefore, how to reduce the number of interactions between computing nodes and global transaction management master nodes in distributed databases, shorten the processing time of distributed transactions, improve the concurrency of computing nodes, and how to save the CPU usage of computing nodes, thereby effectively improving the performance of distributed transaction processing, has become an urgent problem to be solved. Summary of the invention

[0003] The embodiments of the present invention provide a distributed transaction processing method, terminal and storage medium, which mainly solve the technical problem of how to reduce the number of interactions between computing nodes and global transaction management master nodes in a distributed database and alleviate the network traffic pressure of computing nodes.

[0004] To solve the above technical problems, an embodiment of the present invention provides a distributed transaction processing method, including:

[0005] The global transaction management master node synchronizes the incremental message of the distributed transaction unique identification information to all computing nodes, wherein the distributed transaction unique identification information is set by the global transaction management master node;

[0006] The computing node obtains the distributed transaction unique identification information of the data to be operated from the storage node, and verifies the data to be operated;

[0007] Process the data to be operated based on the verification results.

[0008] Furthermore, the present invention also provides a terminal, the terminal comprising a processor, a memory and a communication bus;

[0009] The communication bus is used to realize the connection and communication between the processor and the memory;

[0010] The processor is used to execute one or more computer programs stored in the memory to implement the steps of the above-mentioned distributed transaction processing method.

[0011] Furthermore, the present invention also provides a computer-readable storage medium, which stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to implement the steps of the distributed transaction processing method as described above.

[0012] The beneficial effects of the present invention are:

[0013] According to a distributed transaction processing method, terminal and computer-readable storage medium provided by an embodiment of the present invention, incremental messages of distributed transaction unique identification information are synchronized to all computing nodes through a global transaction management master node, and the distributed transaction unique identification information is set by the global transaction management master node; the computing node obtains the distributed transaction unique identification information of the data to be operated from the storage node, and verifies the data to be operated; based on the verification result, the data to be operated is processed, and the number of interactions between the computing node and the global transaction management master node in the distributed database is reduced in some implementation processes.

[0014] Other features and corresponding beneficial effects of the present invention are described in the latter part of the specification, and it should be understood that at least part of the beneficial effects become obvious from the description in the specification of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 A basic flow chart of a distributed transaction processing method provided in Embodiment 1 of the present invention;

[0016] Figure 2 A schematic diagram of a structure in which a global transaction management master node synchronizes incremental messages to all computing nodes and standby nodes simultaneously, provided in the first embodiment of the present invention;

[0017] Figure 3 A schematic diagram of the interaction between various nodes in the distributed transaction processing process provided in the first embodiment of the present invention;

[0018] Figure 4 A flowchart of a distributed transaction processing method provided in Embodiment 2 of the present invention;

[0019] Figure 5 A schematic diagram of the structure of a terminal provided in the third embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the following is a further detailed description of the embodiments of the present invention through specific implementation methods combined with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0021] Embodiment 1:

[0022] In order to reduce the number of interactions between computing nodes and a global transaction management master node in a distributed database, an embodiment of the present invention provides a distributed transaction processing method. Figure 3 A schematic diagram of the interaction between various nodes in the distributed transaction processing process provided in the first embodiment of the present invention; Figure 1 A basic flow chart of a distributed transaction processing method provided by an embodiment of the present invention, the method comprising:

[0023] S101: The global transaction management master node synchronizes the incremental message of the distributed transaction unique identification information to all computing nodes, where the distributed transaction unique identification information is set by the global transaction management master node.

[0024] It should be understood that the unique identification information of all distributed transactions is generated in the global transaction management master node to identify different transactions. The incremental message of the distributed transaction unique identification information includes: a distributed transaction unique identification information addition message, and a distributed transaction unique identification information release message. When the computing node locally synchronizes and obtains the distributed transaction unique identification information release message, it means that the transaction is in an inactive state, that is, the computing node can directly perform operations and processing.

[0025] Further, such as Figure 2 As shown, Figure 2 A structural diagram of a global transaction management master node synchronizing incremental messages to all computing nodes and standby nodes at the same time; that is, while the global transaction management master node synchronizes the incremental messages of the distributed transaction unique identification information to all computing nodes in real time, the global transaction management master node also synchronizes the incremental messages of the distributed transaction unique identification information to the standby nodes in real time.

[0026] In some implementations, the global transaction management node has high availability. This method can be applied to a mode of one master node and multiple standby nodes; it can also be a mode of multiple master nodes and multiple standby nodes; and the computing node only synchronizes the distributed transaction unique identification information from the global transaction management master node and is not used as a standby node.

[0027] S102: The computing node obtains the distributed transaction unique identification information of the data to be operated from the storage node, and verifies the data to be operated.

[0028] The verification of the data to be operated includes: the computing node obtains an active distributed transaction unique identification information list according to an incremental message of the distributed transaction unique identification information synchronized locally; and determines whether the distributed transaction unique identification information of the data to be operated is in the active distributed transaction unique identification information list.

[0029] S103: Process the data to be operated according to the verification result.

[0030] The specific verification process includes: the computing node obtains an active distributed transaction unique identification information list according to the incremental message of the distributed transaction unique identification information synchronized locally; and determines whether the distributed transaction unique identification information of the data to be operated is in the active distributed transaction unique identification information list.

[0031] When the distributed transaction unique identification information of the data to be operated is not in the active distributed transaction unique identification information list, the computing node directly operates the data to be operated or directly returns the data to be operated to the client.

[0032] When the distributed transaction unique identification information of the data to be operated is in the active distributed transaction unique identification information list, the computing node suspends the transaction corresponding to the data to be operated.

[0033] A time threshold t is set. After the computing node suspends the transaction corresponding to the data to be operated, if a distributed transaction unique identification information release message of the data to be operated synchronized by the global transaction management master node is received within the time threshold t, indicating that the distributed transaction unique identification information of the data to be operated is not in the active distributed transaction unique identification information list, the computing node then operates the data to be operated or directly returns the data to be operated to the client.

[0034] After the computing node suspends the transaction corresponding to the data to be operated, if it does not receive the distributed transaction unique identification information release message of the data to be operated synchronized by the global transaction management master node within the time threshold t, it returns a timeout error message to the client.

[0035] The embodiment of the present invention provides a distributed transaction processing method, which synchronizes the incremental message of the distributed transaction unique identification information to all computing nodes in real time through the global transaction management master node, wherein the distributed transaction unique identification information is set by the global transaction management master node; the computing node obtains the distributed transaction unique identification information of the data to be operated from the storage node, and verifies the data to be operated according to the distributed transaction unique identification information list stored locally in the computing node; processes the data to be operated according to the verification result; in some implementation processes, the number of interactions between the computing node and the global transaction management master node in the distributed database is reduced; wherein, the incremental message of the distributed transaction unique identification information is synchronized to all computing nodes through the global transaction management master node, so that the computing node does not need to repeatedly obtain the unique identification information of the data to be operated from the global transaction management master node, solves the problem of increasing transaction delay due to repeated query of active transaction unique identification by the computing node, significantly improves the business concurrency performance, greatly reduces the network traffic pressure between the computing node and the global transaction management master node, that is, reduces the network traffic pressure of the computing node; when it is verified that the distributed transaction unique identification information of the data to be operated is in the active distributed transaction unique identification information list, the computing node suspends the transaction corresponding to the data to be operated, so that the computing node does not need to repeatedly obtain data from the storage node.

[0036] Embodiment 2:

[0037] Now let's take the example of a client sending an update statement to a computing node. Figure 4 As shown, in this embodiment, the distributed transaction processing method includes the following steps:

[0038] The global transaction management master node synchronizes the incremental message of the distributed transaction unique identification information to all computing nodes, where the distributed transaction unique identification information is set by the global transaction management master node. The computing node obtains the distributed transaction unique identification active list according to the incremental message of the distributed transaction unique identification information.

[0039] Step 1: The client sends an update statement to the computing node (the same applies to delete and select);

[0040] Step ②: Based on the where condition of the update, the computing node generates a select...for update statement with the same where condition. The select statement mainly queries the distributed transaction unique identifier value corresponding to the row to be updated on the storage node. Then the unique identifier value is verified and compared with the local distributed transaction unique identifier active list. If it is verified that the transaction unique identifier corresponding to the row to be updated on the storage node is in an active state, the update operation is suspended, that is, the execution of this transaction is suspended until the release signal of the active transaction unique identifier synchronized by the global transaction management master node is received.

[0041] Step 3: When the computing node determines that the transaction unique identifier corresponding to the row to be updated on the storage node is no longer active or receives a release signal of the active transaction unique identifier, it continues to execute the update statement to modify the data on the storage node.

[0042] The embodiment of the present invention provides a distributed transaction processing method, which synchronizes the incremental message of the distributed transaction unique identification information to all computing nodes in real time through the global transaction management master node, wherein the distributed transaction unique identification information is set by the global transaction management master node; the computing node obtains the distributed transaction unique identification information of the data to be operated from the storage node, and verifies the data to be operated according to the distributed transaction unique identification information list stored locally in the computing node; processes the data to be operated according to the verification result; in some implementation processes, the number of interactions between the computing node and the global transaction management master node in the distributed database is reduced; wherein, the incremental message of the distributed transaction unique identification information is synchronized to all computing nodes through the global transaction management master node, so that the computing node does not need to repeatedly obtain the unique identification information of the data to be operated from the global transaction management master node, solves the problem of increasing transaction delay due to repeated query of active transaction unique identification by the computing node, significantly improves the business concurrency performance, greatly reduces the network traffic pressure between the computing node and the global transaction management master node, that is, reduces the network traffic pressure of the computing node; when it is verified that the distributed transaction unique identification information of the data to be operated is in the active distributed transaction unique identification information list, the computing node suspends the transaction corresponding to the data to be operated, so that the computing node does not need to repeatedly obtain data from the storage node at the same time.

[0043] Embodiment three:

[0044] This embodiment also provides a terminal, see Figure 5 As shown, it includes a processor 51, a memory 52 and a communication bus 53, wherein:

[0045] The communication bus 53 is used to realize the connection and communication between the processor 51 and the memory 52;

[0046] The processor 51 is used to execute one or more computer programs stored in the memory 52 to implement at least one step in the distributed transaction processing method in the above-mentioned embodiment 1 and embodiment 2.

[0047] The present embodiment also provides a computer-readable storage medium, which includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer.

[0048] The computer-readable storage medium in this embodiment can be used to store one or more computer programs, and the one or more computer programs stored therein can be executed by a processor to implement at least one step of the distributed transaction processing method in the above-mentioned embodiment 1 and embodiment 2.

[0049] It can be seen that those skilled in the art should understand that all or some of the steps, systems, and functional modules / units in the above disclosed methods can be implemented as software (which can be implemented with computer program code executable by a computing device), firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component can have multiple functions, or a function or step can be performed by several physical components in cooperation. Some or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit.

[0050] In addition, it is well known to those skilled in the art that communication media generally contain computer readable instructions, data structures, computer program modules or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery media. Therefore, the present invention is not limited to any specific hardware and software combination.

[0051] The above contents are further detailed descriptions of the embodiments of the present invention in combination with specific implementation methods, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

Claims

1. A distributed transaction processing method, comprising: The global transaction management master node synchronizes the incremental message of the distributed transaction unique identification information to all computing nodes, the distributed transaction unique identification information is set by the global transaction management master node, and the incremental message of the distributed transaction unique identification information includes: a distributed transaction unique identification information added message and a distributed transaction unique identification information released message, the distributed transaction unique identification information added message is used to indicate that the distributed transaction is in an active state, and the distributed transaction unique identification information released message is used to indicate that the distributed transaction is in an inactive state; The computing node obtains the distributed transaction unique identification information of the data to be operated from the storage node, and performs verification of the data to be operated, including: the computing node obtains an active distributed transaction unique identification information list according to the incremental message of the distributed transaction unique identification information synchronized locally; and determines whether the distributed transaction unique identification information of the data to be operated is in the active distributed transaction unique identification information list; According to the verification results, the data to be operated is processed.

2. The distributed transaction processing method according to claim 1, characterized in that: While the global transaction management master node synchronizes the incremental message of the distributed transaction unique identification information to all computing nodes, the global transaction management master node also synchronizes the incremental message of the distributed transaction unique identification information to the standby node.

3. The distributed transaction processing method according to claim 1, characterized in that: The processing of the data to be operated according to the verification result includes: When the distributed transaction unique identification information of the data to be operated is not in the active distributed transaction unique identification information list, the computing node directly operates the data to be operated or directly returns the data to be operated to the client.

4. The distributed transaction processing method according to claim 1, characterized in that: The processing of the data to be operated according to the verification result includes: When the distributed transaction unique identification information of the data to be operated is in the active distributed transaction unique identification information list, the computing node suspends the transaction corresponding to the data to be operated.

5. The distributed transaction processing method according to claim 4, characterized in that: After the computing node suspends the transaction corresponding to the data to be operated, if it receives a distributed transaction unique identification information release message of the data to be operated synchronized by the global transaction management master node within the time threshold, it directly operates the data to be operated or directly returns the data to be operated to the client.

6. The distributed transaction processing method according to claim 4, characterized in that: After the computing node suspends the transaction corresponding to the data to be operated, if it does not receive a distributed transaction unique identification information release message of the data to be operated synchronized by the global transaction management master node within the time threshold, it returns a timeout error message to the client.

7. A terminal comprising a processor, a memory and a communication bus; The communication bus is used to realize the connection and communication between the processor and the memory; The processor is used to execute one or more computer programs stored in the memory to implement the steps of the distributed transaction processing method according to any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to implement the steps of the distributed transaction processing method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Acquisition method of distributed storage data

    CN103067471A

  • Multi-node storage operation

    CN108694076A