A data processing method, device and system

Through the transaction coordination manager, the transaction operations are coordinated in the microservice architecture, the target transaction group is created and log identification information is added, which solves the data consistency problem under the microservice architecture and realizes unified control and data consistency of distributed transactions.

CN114217910BActive Publication Date: 2025-03-14BEIJING CHINA POWER INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111544748.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-16
Publication Date
2025-03-14
Estimated Expiration
2041-12-16

AI Technical Summary

Technical Problem

Under the microservice architecture, data consistency cannot be guaranteed through database transactions.

Method used

Coordinate through the transaction coordination manager, create a target transaction group, add the log identification information and identity identification information of the transaction terminal, and notify the transaction terminal to perform corresponding operations based on the operation results.

Benefits of technology

It realizes unified control over distributed transactions to ensure data consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114217910B_ABST
    Figure CN114217910B_ABST
Patent Text Reader

Abstract

The present invention provides a data processing method, device and system. When receiving a transaction creation application request sent by a first transaction terminal, a corresponding target transaction group is created, and the transaction information of the target transaction group is sent to the first transaction terminal, so that the first transaction terminal executes the business basic code; after receiving an application instruction to join the target transaction group sent by a second transaction terminal, the log identification information and identity identification information of the second transaction terminal are added to the target transaction group, and the updated transaction information is sent to the second transaction terminal; based on the first operation result received from the first transaction terminal and the second operation result received from the second transaction terminal, a corresponding notification message is generated, and the first transaction terminal and the second transaction terminal are notified, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations. This solution uses a transaction coordination manager to complete the unified control of distributed transactions, thereby ensuring data consistency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device and system. Background Art

[0002] In traditional monolithic applications, all modules of the monolithic application use the same database. When the modules have data associations or need to write related data at the same time, data consistency is guaranteed by database transactions. The commit and rollback mechanisms provided by the database ensure ACID transaction management of related operations.

[0003] In the microservice architecture, each microservice has a database. Since microservices are developed, evolved, and deployed independently, data consistency cannot be guaranteed through the database transactions shown above. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a data processing method, device and system to solve the problem in the prior art that data consistency cannot be guaranteed through database transactions.

[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0006] A first aspect of an embodiment of the present invention shows a data processing method, which is applied to a transaction coordination manager. The method includes:

[0007] Upon receiving the transaction creation application request sent by the first transaction terminal, creating a target transaction group based on the business information carried in the transaction creation application request, wherein the target transaction group includes corresponding transaction information;

[0008] After determining that the target transaction group is created, sending transaction information of the target transaction group to the first transaction terminal, so that the first transaction terminal executes the business basic code after receiving the transaction information;

[0009] After receiving an application instruction for joining the target transaction group sent by a second transaction terminal, adding the log identification information and identity identification information of the second transaction terminal to the target transaction group, and sending transaction information updated based on the log identification information and identity identification information to the second transaction terminal, where the number of the second transaction terminal is at least one;

[0010] When receiving the notification request sent by the first transaction terminal, according to the first operation result and the second operation result carried in the notification instruction, the first transaction terminal and the second transaction terminal are notified of the corresponding notification message so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, and the transaction operations include transaction execution operations and transaction termination operations.

[0011] Optionally, according to the first operation result and the second operation result carried in the notification instruction, notifying the first transaction terminal and the second transaction terminal of a corresponding notification message includes:

[0012] When it is determined that both the first operation result and the second operation result are successful operation results, sending a corresponding notification message to the second transaction terminal so that the second transaction terminal performs a corresponding transaction execution operation;

[0013] After receiving the transaction operation completion information fed back by the second transaction terminal, sending a corresponding notification message to the first transaction terminal so that the first transaction terminal performs the corresponding transaction execution operation;

[0014] When it is determined that there is an abnormal operation result in the first operation result and the second operation result, a corresponding notification message is sent to the first transaction terminal and the second transaction terminal so that the first transaction terminal and the second transaction terminal perform a transaction abort operation.

[0015] Optionally, sending the corresponding notification message to the second transaction terminal so that the second transaction terminal performs a corresponding transaction operation includes:

[0016] When it is determined that the number of the second transaction terminal is one, sending a corresponding notification message to the second transaction terminal so that the second transaction terminal performs a corresponding transaction operation;

[0017] When it is determined that there are multiple second transaction terminals, all the second transaction terminals are traversed, and corresponding notification messages are sent to the second transaction terminals one by one according to preset rules, so that the second transaction terminals can perform corresponding transaction operations.

[0018] Optionally, after the first transaction terminal and the second transaction terminal perform a transaction abort operation, the first transaction terminal and the second transaction terminal are controlled to roll back the transaction.

[0019] A second aspect of an embodiment of the present invention shows a data processing method, which is applied to a first transaction terminal. The method includes:

[0020] Obtain business information corresponding to the business to be executed;

[0021] Sending a transaction creation application request generated based on the business information to a transaction coordination manager;

[0022] When receiving the transaction information sent by the transaction coordination manager, executing the business basic code corresponding to the business to be executed;

[0023] In the process of obtaining the business basic code corresponding to the to-be-executed business, determining a second transaction terminal participating in the to-be-executed business, sending a call application request to the second transaction terminal, wherein the call application carries the transaction identification information in the transaction information, and the number of the second transaction terminal is at least 1;

[0024] Upon receiving the call end instruction carrying the second operation result sent by the second transaction terminal, determining the first operation result of the transaction corresponding to the transaction information, and submitting the notification request generated by the first operation result and the second operation result to the transaction coordination manager;

[0025] When receiving the notification message sent by the transaction coordination manager, a transaction execution operation corresponding to the transaction information is executed.

[0026] A third aspect of an embodiment of the present invention shows a data processing method, which is applied to a second transaction terminal. The method includes:

[0027] After receiving the call application request sent by the first transaction terminal, executing the corresponding local service based on the call application request;

[0028] After completing the execution of the local business, start the timeout waiting task, and send an application instruction for joining the target transaction group to the transaction coordination manager based on the transaction identification information, wherein the application instruction for joining the target transaction group carries the log identification information and identity identification information corresponding to the second transaction terminal;

[0029] When receiving the transaction information sent by the transaction coordination manager, determining a second operation result of the transaction corresponding to the transaction information, and notifying the first transaction terminal of a call end instruction generated based on the second operation result;

[0030] When receiving the notification message sent by the transaction coordination manager, executing the transaction operation corresponding to the transaction information.

[0031] A fourth aspect of an embodiment of the present invention shows a data processing device, which is applied to a transaction coordination manager. The device includes:

[0032] a creating unit, configured to, upon receiving a transaction creation application request sent by the first transaction terminal, create a target transaction group based on the business information carried in the transaction creation application request, wherein the target transaction group includes corresponding transaction information;

[0033] A first sending unit is configured to send transaction information of the target transaction group to the first transaction terminal after determining that the target transaction group is created, so that the first transaction terminal executes a business basic code after receiving the transaction information;

[0034] an adding unit, configured to, after receiving an application instruction sent by a second transaction terminal to join a target transaction group, add the log identification information and identity identification information of the second transaction terminal to the target transaction group, and send transaction information updated based on the log identification information and identity identification information to the second transaction terminal, wherein the number of the second transaction terminal is at least one;

[0035] a processing unit configured to, upon receiving a first operation result fed back by the first transaction terminal and a second operation result fed back by the second transaction terminal, notify the first transaction terminal and the second transaction terminal of corresponding notification messages according to the first operation result and the second operation result, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, wherein the transaction operations include transaction execution operations and transaction termination operations.

[0036] A fifth aspect of an embodiment of the present invention shows a data processing device, which is applied to a first transaction terminal. The device includes:

[0037] An acquisition unit, used to acquire business information corresponding to the business to be executed;

[0038] A second sending unit, configured to send a transaction creation application request generated based on the business information to a transaction coordination manager;

[0039] A first execution unit, configured to execute a basic business code corresponding to the to-be-executed business when receiving the transaction information sent by the transaction coordination manager;

[0040] A first determining unit is configured to determine, during the process of the business basic code corresponding to the business to be executed, a second transaction terminal participating in the business to be executed, send a call application request to the second transaction terminal, wherein the call application carries the transaction identification information in the transaction information, and the number of the second transaction terminals is at least 1; upon receiving a call end instruction carrying a second operation result sent by the second transaction terminal, determine a first operation result of the transaction corresponding to the transaction information, and submit a notification request generated by the first operation result and the second operation result to the transaction coordination manager;

[0041] The second execution unit is configured to execute a transaction execution operation corresponding to the transaction information when receiving a notification message sent by the transaction coordination manager.

[0042] A sixth aspect of an embodiment of the present invention shows a data processing device, which is applied to a second transaction terminal. The device includes:

[0043] A third execution unit, configured to execute a corresponding local service based on the call application request after receiving the call application request sent by the first transaction terminal;

[0044] a third sending unit, after completing the execution of the local business, starting a timeout waiting task, and sending an application instruction for joining a target transaction group to a transaction coordination manager based on the transaction identification information, wherein the application instruction for joining the target transaction group carries log identification information and identity identification information corresponding to the second transaction terminal;

[0045] a second determining unit, configured to determine, when receiving the transaction information sent by the transaction coordination manager, a second operation result of the transaction corresponding to the transaction information, and notify the first transaction terminal of a call end instruction generated based on the second operation result;

[0046] The fourth execution unit is configured to execute a transaction operation corresponding to the transaction information when receiving a notification message sent by the transaction coordination manager.

[0047] A seventh aspect of an embodiment of the present invention shows a data processing system, the system comprising: a transaction coordination manager, a first transaction terminal and a second transaction terminal;

[0048] The first transaction terminal is used to obtain business information corresponding to the business to be executed; send a transaction creation application request generated based on the business information to the transaction coordination manager; when receiving the transaction information sent by the transaction coordination manager, execute the business basic code corresponding to the business to be executed; in the process of the business basic code corresponding to the business to be executed, determine the second transaction terminal participating in the business to be executed, send a call application request to the second transaction terminal, the call application carries the transaction identification information in the transaction information, and the number of the second transaction terminals is at least 1; when receiving the call end instruction carrying the second operation result sent by the second transaction terminal, determine the first operation result of the transaction corresponding to the transaction information, and notify the transaction coordination manager of the generation of the first operation result and the second operation result; when receiving the notification message sent by the transaction coordination manager, execute the transaction execution operation corresponding to the transaction information;

[0049] The transaction coordination manager is configured to, upon receiving a transaction creation application request sent by a first transaction terminal, create a target transaction group based on the business information carried in the transaction creation application request, wherein the target transaction group includes corresponding transaction information; after determining that the target transaction group is created, send the transaction information of the target transaction group to the first transaction terminal, so that the first transaction terminal executes the business basic code after receiving the transaction information; after receiving an application instruction to join the target transaction group sent by a second transaction terminal, add the log identification information and identity identification information of the second transaction terminal to the target transaction group, and send the transaction information updated based on the log identification information and identity identification information to the second transaction terminal, wherein the number of the second transaction terminals is at least 1; upon receiving a notification request sent by the first transaction terminal, notify the first transaction terminal and the second transaction terminal of the corresponding notification message according to the first operation result and the second operation result carried in the notification instruction, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, wherein the transaction operations include transaction execution operations and transaction termination operations;

[0050] The second transaction terminal is used to execute the corresponding local business based on the call application request after receiving the call application request sent by the first transaction terminal; after completing the execution of the local business, start the timeout waiting task, and send an application instruction to join the target transaction group to the transaction coordination manager based on the transaction identification information, and the application instruction to join the target transaction group carries the log identification information and identity identification information corresponding to the second transaction terminal; when receiving the transaction information sent by the transaction coordination manager, determine the second operation result of the transaction corresponding to the transaction information, and notify the first transaction terminal of the call end instruction generated based on the second operation result; when receiving the notification message sent by the transaction coordination manager, execute the transaction operation corresponding to the transaction information.

[0051] A data processing method, device and system provided based on the above-mentioned embodiment of the present invention are applied to a transaction coordination manager, and the method includes: when receiving a transaction creation application request sent by a first transaction terminal, creating a target transaction group based on the business information carried in the transaction creation application request, and the target transaction group includes corresponding transaction information; after determining that the target transaction group is created, sending the transaction information of the target transaction group to the first transaction terminal, so that the first transaction terminal executes the business basic code after receiving the transaction information; after receiving an application instruction to join the target transaction group sent by a second transaction terminal, adding the log identification information and identity identification information of the second transaction terminal to the target transaction group, and sending the transaction information updated based on the log identification information and the identity identification information to the second transaction terminal, and the number of the second transaction terminals is at least 1; when receiving a first operation result fed back by the first transaction terminal and a second operation result fed back by the second transaction terminal, notifying the first transaction terminal and the second transaction terminal of a corresponding notification message according to the first operation result and the second operation result, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, and the transaction operations include transaction execution operations and transaction termination operations. In the embodiment of the present invention, the unified control of distributed transactions is completed through the coordination of the transaction coordination manager, which processes the first operation result fed back by the first transaction terminal and the second operation result fed back by the second transaction terminal to notify the first transaction terminal and the second transaction terminal of the corresponding notification message, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, thereby ensuring data consistency. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0053] Figure 1 A schematic diagram of the structure of a data processing system shown in an embodiment of the present invention;

[0054] Figure 2 A schematic diagram of interaction between a transaction coordination manager, a first transaction terminal, and a second transaction terminal according to an embodiment of the present invention;

[0055] Figure 3 A schematic diagram of the application architecture of a transaction coordination manager, a first transaction terminal, and a second transaction terminal shown in an embodiment of the present invention;

[0056] Figure 4A schematic flow chart of a data processing method according to an embodiment of the present invention;

[0057] Figure 5 A schematic flow chart of another data processing method according to an embodiment of the present invention;

[0058] Figure 6 A flowchart of another data processing method according to an embodiment of the present invention is shown;

[0059] Figure 7 A schematic diagram of the structure of a data processing device according to an embodiment of the present invention;

[0060] Figure 8 A schematic diagram of the structure of another data processing device according to an embodiment of the present invention;

[0061] Fig. 9 The present invention is a schematic diagram of the structure of another data processing device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.

[0063] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising 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, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0064] For ease of understanding, the terms appearing in the embodiments of the present invention are explained below:

[0065] Microservices: Microservice architecture is an approach to developing a single application as a set of small services, each of which runs in its own process and communicates with lightweight mechanisms (usually HTTP resource APIs). These services are built around business functions and can be independently deployed through fully automated deployment mechanisms. The centralized management of these services is minimal, they can be written in different programming languages, and use different data storage technologies.

[0066] Transaction: A transaction consists of a set of operations that can all be executed correctly. If any step in this set of operations fails, the previously completed operations must be rolled back. That is, all operations in the same transaction must either all be executed correctly or none of them should be executed. Transactions provide a mechanism to incorporate all operations involved in an activity into an indivisible execution unit. All operations that make up a transaction can only be submitted if all operations can be executed normally. If any of the operations fail to execute, the entire transaction will be rolled back. Transactions provide a "do nothing or do everything (All or Nothing)" mechanism.

[0067] Distributed transaction: A distributed transaction is a transaction that runs in a distributed environment. For a distributed transaction, each operation step of the transaction is a service running on a different machine. The key to distributed transaction processing is that there must be a way to know all the actions taken by the transaction anywhere, and the decision to commit or rollback the transaction must produce a unified result (all committed or all rolled back).

[0068] Two-phase commit: Two-phase commit refers to an algorithm designed in the field of computer networks and databases to ensure that all nodes in a distributed system architecture maintain consistency when committing transactions.

[0069] In the embodiment of the present invention, under the microservice architecture, the unified control of distributed transactions is completed through the coordination of the transaction coordination manager, and the transaction coordination manager processes the first operation result fed back by the first transaction terminal and the second operation result fed back by the second transaction terminal to notify the first transaction terminal and the second transaction terminal of the corresponding notification message, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, thereby ensuring data consistency.

[0070] See also Figure 1 , is a data processing system shown in an embodiment of the present invention, the system includes a transaction coordination manager (TransactionManager, TM) 10, a first transaction terminal (TransactionClient, TC) 20 and a second transaction terminal (TransactionClient, TC) 30.

[0071] TC, namely the first transaction terminal 20 and the second transaction terminal 30, performs proxy control and locking of resources and cooperates with TM10 to commit and rollback transactions.

[0072] TM10 is a control node used to control the consistency of the entire transaction as the controller of the distributed transaction, namely the first transaction terminal 20 and the second transaction terminal 30, and also records special situations that may occur in the transaction and operation logs of each stage.

[0073] The number of the second transaction terminal (TransactionClient, TC) 30 is at least one.

[0074] In the embodiment of the present invention, the transaction control principle is that the proxy connection pool under the first transaction terminal 20 and the second transaction terminal 30, that is, the DB connection pool and the TM10 coordinate and cooperate to complete the transaction coordination control. The proxy connection pool of the first transaction terminal 20 and the second transaction terminal 30 implements the javax.sql.DataSource interface. After the first transaction terminal 20 and the second transaction terminal 30 commit and close, the DB connection pool of the TC will perform a false close operation and wait for the TM to coordinate and complete the transaction before closing the connection.

[0075] The first transaction terminal 20 and the second transaction terminal 30 perform proxy control locking on resources and cooperate with the transaction coordination manager to commit and rollback transactions. By extending the java data source interface javax.sql.DataSource, a new interface closing connection pool method is determined, and the DB proxy connection pool is optimized.

[0076] The first transaction terminal 20 and the second transaction terminal 30 can implement mechanisms such as a timeout processing mechanism, an intelligent identification and creation of different connection processing mechanisms, and a connection reuse mechanism.

[0077] Among them, since any communication has a maximum timeout limit, the first transaction terminal 20 and the second transaction terminal 30 also have a maximum timeout limit when they are waiting for notification, so there is a timeout processing mechanism. The timeout processing mechanism is used to determine that after the time limit is exceeded, the first transaction terminal 20 and the second transaction terminal 30 will first confirm the transaction status and then decide to perform a commit or rollback operation, mainly to limit the maximum resource occupancy time.

[0078] Intelligent identification creates different connection processing mechanisms. For read-only operations and non-transaction operations, the proxy function will not be enabled and the local connection object will be returned. For the initiator of the compensating transaction, the rollback connection object will be enabled and the transaction will be rolled back immediately after the business is executed.

[0079] The connection reuse mechanism is used to reuse the connection resources when the first transaction terminal 20 and the second transaction terminal 30 are repeatedly executed under the same transaction, thereby improving the utilization rate of the connection.

[0080] The transaction coordination manager 30 can implement mechanisms such as creating a target transaction group, adding a target transaction group, closing a target transaction group, a notification mechanism, a retry mechanism, a switching transaction notification mechanism, and a response transaction mechanism.

[0081] The creation of the target transaction group refers to the process of first calling the transaction coordination manager to create the target transaction group object and then obtaining the transaction identifier GroupId before the first transaction terminal 20 starts to execute the business basic code corresponding to the to-be-executed business.

[0082] Adding a target transaction group means that after the second transaction terminal 30 completes executing the local service, the second transaction terminal 30 adds the transaction information related to the second transaction terminal 30 to the transaction coordination manager 10 .

[0083] Closing the target transaction group means that the business basic code is executed at the first transaction terminal 20, and the first operation result corresponding to the first transaction terminal 20 is notified to the transaction coordination manager 10. After the method of closing the target transaction group is executed, the transaction coordination manager 10 will notify the corresponding participating modules, that is, the first transaction terminal 20 and the second transaction terminal 30, to perform a commit or rollback operation according to the first operation result and the second operation result.

[0084] The notification mechanism is used to start traversing all second transaction terminals 30 under the target transaction group after the transaction coordination manager 10 receives the notification request sent by the first transaction terminal 20, and then notify the second transaction terminals 30 of the corresponding notification information one by one.

[0085] Optionally, the specific process of notifying the second transaction terminal 30 of the corresponding notification information is: after confirming that any second transaction terminal 30 has executed successfully, the status can be marked and other second transaction terminals 30 can be notified continuously until all second transaction terminals 30 have completed the execution.

[0086] If the second transaction terminal 30 does not respond to the data corresponding to the notification information, the transaction coordination manager 10 will perform a retry notification mechanism. The retry notification mechanism is used to find the load module in the second transaction terminal 30 for notification when it is determined that the second transaction terminal 30 does not respond. If the load module notification is successful, after confirming that any second transaction terminal 30 has executed successfully, the state can be marked and then other second transaction terminals 30 can be traversed for notification. If the load module fails to commit due to a lock, the transaction coordination manager 10 will continue to notify and record the corresponding second transaction terminal 30 identifier until the attempt exceeds the preset timeout. If the second transaction terminal 30 has not been notified by the preset timeout, no more attempts will be made, and it will be marked as a pending compensation state, and the operation and maintenance system will be notified, and then other unnotified second transaction terminals 30 will continue to be notified.

[0087] The notification mechanism is also used to notify the first transaction terminal 20 of the final transaction notification result after all transactions are completed. The notification result is commit or rollback, which will also affect the final operation of the first transaction terminal. After the first transaction terminal 20 completes the transaction execution, it needs to feedback the commit completion message to the transaction coordination manager 10.

[0088] The transaction notification mechanism is switched to other load modules when the retry mechanism fails to notify the transaction twice. The second transaction terminal 30 is notified and the second transaction terminal 30 is required to perform the corresponding transaction operation on the transaction. If the operation is successful, the normal response information is sent to the transaction coordination manager 10. The transaction coordination manager 10 also marks the status as notified, and then continues to notify other second transaction terminals 30. If the notification fails, the above-mentioned cyclic retry mechanism is repeated.

[0089] The response transaction mechanism is used for the first transaction terminal 20 to respond to the transaction coordination manager 10 after completing the business. If the transaction coordination manager 10 still cannot receive the successful submission message of the first transaction terminal 20, it will also record the compensation and notify the operation and maintenance system. However, as the first transaction terminal 20, it only needs to send the message and then directly respond to the data to the second transaction terminal 30.

[0090] It should be noted that, if the transaction coordination manager 10 does not receive a response, it will also inquire about the situation from other load modules of the first transaction terminal 20. The operation mechanism is the same as that of the second transaction terminal 30, and they can refer to each other.

[0091] Optionally, the data processing system further includes a database 40. The first transaction terminal 20 and the second transaction terminal 30 perform a transaction commit operation to store corresponding data in the database 40.

[0092] Based on the application architecture shown in the above embodiment of the present invention, the data processing is specifically implemented as follows:

[0093] The first transaction terminal 20 is used to obtain the business information corresponding to the business to be executed in the business module; send the transaction creation application request generated based on the business information to the transaction coordination manager 10. When receiving the transaction information sent by the transaction coordination manager 10, execute the business basic code corresponding to the business to be executed; in the process of the business basic code corresponding to the business to be executed, determine the second transaction terminal 30 participating in the business to be executed, send a call application request to the second transaction terminal 30, and the call application carries the transaction identification information in the transaction information; when receiving the call end instruction carrying the second operation result sent by the second transaction terminal 30, determine the first operation result of the transaction corresponding to the transaction information, and notify the transaction coordination manager 10 of the generation of the first operation result and the second operation result; when receiving the notification message sent by the transaction coordination manager 10, execute the transaction execution operation corresponding to the transaction information.

[0094] It should be noted that there are multiple second transaction terminals 30 .

[0095] The transaction coordination manager 10 is used to, upon receiving a transaction creation application request sent by a first transaction terminal 20, create a target transaction group based on the business information carried in the transaction creation application request, wherein the target transaction group includes corresponding transaction information; after determining that the target transaction group is created, send the transaction information of the target transaction group to the first transaction terminal, so that the first transaction terminal 20 executes the business basic code after receiving the transaction information; after receiving an application instruction to join the target transaction group sent by a second transaction terminal 30, add the log identification information and identity identification information of the second transaction terminal 30 to the target transaction group, and send the transaction information updated based on the log identification information and the identity identification information to the second transaction terminal 30, wherein the number of the second transaction terminals 30 is at least 1; upon receiving a notification request sent by the first transaction terminal 20, notify the first transaction terminal 20 and the second transaction terminal 30 of the corresponding notification message according to the first operation result and the second operation result carried in the notification instruction, so that the first transaction terminal 20 and the second transaction terminal 30 perform corresponding transaction operations, wherein the transaction operations include transaction execution operations and transaction termination operations.

[0096] The second transaction terminal 30 is used to execute the corresponding local business based on the call application request after receiving the call application request sent by the first transaction terminal 20; after completing the execution of the local business, start the timeout waiting task, and send an application instruction to join the target transaction group to the transaction coordination manager 10 based on the transaction identification information, and the application instruction to join the target transaction group carries the log identification information and identity identification information corresponding to the second transaction terminal 30; when receiving the transaction information sent by the transaction coordination manager 10, determine the second operation result of the transaction corresponding to the transaction information, and notify the first transaction 20 of the call end instruction generated based on the second operation result; when receiving the notification message sent by the transaction coordination manager 10, execute the transaction operation corresponding to the transaction information.

[0097] In the embodiment of the present invention, the unified control of distributed transactions is completed through the coordination of the transaction coordination manager, which processes the first operation result fed back by the first transaction terminal and the second operation result fed back by the second transaction terminal to notify the first transaction terminal and the second transaction terminal of the corresponding notification message, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, thereby ensuring data consistency.

[0098] Based on the data processing system shown in the above embodiment of the present invention, the embodiment of the present invention also discloses a schematic diagram of interaction between a transaction coordination manager, a first transaction terminal and a second transaction terminal. The method includes:

[0099] S201: The first transaction terminal obtains business information corresponding to the business to be executed.

[0100] Specific content of S201: The first transaction terminal, that is, the transaction initiator, needs to obtain the business information corresponding to the business to be executed when starting to execute the business.

[0101] It should be noted that business information includes information about the parties who need to execute the business, the global transaction ID, and the business basic code.

[0102] S202: The first transaction terminal sends a transaction creation application request generated based on the business information to the transaction coordination manager.

[0103] Specific content of S202: Before starting to execute the business, the transaction initiator will first call TM to notify the creation of a target transaction group.

[0104] S203: The transaction coordination manager creates a target transaction group based on the business information carried in the transaction creation application request.

[0105] In step S203, the target transaction group includes corresponding transaction information.

[0106] Specific content of S203: The transaction coordination manager incorporates all operations involved in the business information carried in the transaction creation application request into an indivisible execution unit to generate a target transaction group.

[0107] It should be noted that the target transaction group includes relevant transaction information.

[0108] S204: After determining that the target transaction group is created, the transaction coordination manager sends transaction information of the target transaction group to the first transaction terminal.

[0109] Specific content of S204: The transaction coordination manager responds the transaction information related to the target transaction group to the first transaction terminal.

[0110] S205: The first transaction terminal executes the business basic code corresponding to the business to be executed.

[0111] Specific content of S205: After the first transaction terminal determines the transaction message created by the transaction coordination manager, the first transaction terminal, ie, the transaction initiator, starts to execute its own business code, ie, the business basic code.

[0112] S206: The first transaction terminal determines a second transaction terminal participating in the business to be executed during the process of obtaining the business basic code corresponding to the business to be executed, and sends a call application request to the second transaction terminal.

[0113] In step S206, the calling application carries the transaction identification information in the transaction information, and the number of the second transaction terminals is at least one.

[0114] Specific content of S206: During the execution of the business, the first transaction terminal first determines the participant who will execute the service in the pending business, that is, the second transaction terminal; if it is determined that the number of the second transaction terminal is 1, the second transaction terminal is directly called, and the transaction identification information created by the transaction coordination manager is passed to the second transaction terminal during the call. If it is determined that the number of the second transaction terminal is multiple, the order of calling each participant, that is, the second transaction terminal, is determined according to the pending business, and each participant is called in turn. During the call, the transaction identification information created by the transaction coordination manager is passed to the participant, that is, a call application request carrying the transaction identification information is sent to the second transaction terminal.

[0115] It should be noted that the second transaction calling sequence is determined according to the business to be processed.

[0116] It can be understood that the specific process of determining the calling order of each participant, that is, the second transaction terminal, according to the to-be-processed business and calling each participant in turn is as follows: according to the calling order, the first second transaction terminal is called first, so that after the second transaction terminal completes the execution of the local business, it will feedback the called response instruction to the first transaction terminal; after receiving the response instruction fed back by the first second transaction terminal, the first transaction terminal calls the second second transaction terminal, and so on, until the first transaction terminal completes calling all the second transaction terminals.

[0117] S207: The second transaction terminal executes the corresponding local service based on the calling application request.

[0118] Specific content of S207: When the participant, ie, the second transaction terminal, receives the request from the first transaction terminal, it starts to execute the local service.

[0119] It should be noted that the local service refers to the service startup service that the second transaction terminal itself needs to execute.

[0120] S208: After completing the execution of the local business, the second transaction terminal starts the timeout waiting task and sends an application instruction to join the target transaction group to the transaction coordination manager based on the transaction identification information.

[0121] In step S208, the application instruction for joining the target transaction group carries the log identification information and identity identification information corresponding to the second transaction terminal.

[0122] Specific content of S208: Since the pending business will not be processed immediately after the local business is executed, the second transaction terminal will first start the timeout waiting task after completing the execution of the local business, and request the transaction coordination manager to join the target transaction group. The main information submitted includes the local log mark information and identity information of the second transaction terminal.

[0123] Optionally, when completing the execution of the local service, the second transaction terminal also feeds back a response instruction to the first transaction terminal.

[0124] S209: The transaction coordination manager adds the log identification information and identity identification information of the second transaction terminal to the target transaction group, and sends the transaction information updated based on the log identification information and identity identification information to the second transaction terminal.

[0125] In step S209, the number of the second transaction terminals is at least one.

[0126] It should be noted that the transaction coordination manager adds the log identification information and identity identification information of the second transaction terminal to the target transaction group, that is, adds the second transaction terminal to the target transaction group.

[0127] S210: The second transaction terminal determines a second operation result of the transaction corresponding to the transaction information, and notifies the first transaction terminal of a call end instruction generated based on the second operation result.

[0128] Specific content of S210: The second transaction terminal now performs the first phase preparation phase in the two-phase commit. The second transaction terminal can determine whether the execution of its own related transaction is successful or failed, and generate a call end instruction for the successful or failed second operation result, and notify the first transaction terminal.

[0129] S211: The first transaction terminal determines a first operation result of the transaction corresponding to the transaction information, and submits a notification request generated by the first operation result and the second operation result to the transaction coordination manager.

[0130] Specific content of S211: The first transaction terminal now performs the first stage preparation phase in the two-stage commit. The first transaction terminal can determine whether the execution of its own related transaction is successful or failed to generate a first operation result; and submit the notification request generated by the first operation result and the second operation result to the transaction coordination manager.

[0131] S212: The transaction coordination manager notifies the first transaction terminal and the second transaction terminal of corresponding notification messages according to the first operation result and the second operation result carried in the notification instruction.

[0132] It should be noted that the specific implementation of step S212 includes the following steps:

[0133] Step S11: When it is determined that both the first operation result and the second operation result are successful operation results, a corresponding notification message is sent to the second transaction terminal so that the second transaction terminal performs a corresponding transaction execution operation.

[0134] Step S12: after receiving the transaction operation completion information fed back by the second transaction terminal, a corresponding notification message is sent to the first transaction terminal so that the first transaction terminal can perform the corresponding transaction execution operation.

[0135] In the process of specifically implementing step S11 and step S12, the transaction coordination manager uniformly controls the operation results of all nodes (called participants). When it is determined that all the first operation results and the second operation results are successful, and when it is determined that the number of second transaction terminals is 1, the corresponding notification message is sent to the second transaction terminal so that the second transaction terminal can perform the corresponding transaction operation; when it is determined that the number of second transaction terminals is multiple, all the second transaction terminals are traversed, and the corresponding notification messages are sent to the second transaction terminals one by one according to preset rules so that the second transaction terminals can perform the corresponding transaction operation.

[0136] It should be noted that the preset rule refers to the reverse order of the calling sequence.

[0137] It can be understood that the specific implementation process of sending the corresponding notification messages to the second transaction terminals one by one according to the preset rules so that the second transaction terminals can perform the corresponding transaction operations is as follows: according to the reverse order of the calling order, first send the notification message carrying the transaction commit operation instruction to the last second transaction terminal, so that the second transaction terminal performs the execution operation of the corresponding transaction according to the notification message, that is, the commit operation, and feeds back the execution end instruction to the transaction coordination manager; when the transaction coordination manager receives the execution end instruction fed back by the last second transaction terminal, it sends a notification message to the second-to-last second transaction terminal, and so on, until it receives the execution end instruction fed back by the last-to-last second transaction terminal; send notification information to the first transaction terminal so that the first transaction terminal performs the corresponding transaction execution operation.

[0138] Step S13: When it is determined that there is an abnormal operation result in the first operation result and the second operation result, a corresponding notification message is sent to the first transaction terminal and the second transaction terminal so that the first transaction terminal and the second transaction terminal perform a transaction abort operation.

[0139] In the process of implementing step S13, the transaction coordination manager uniformly controls the operation results of all nodes (called participants). When it is determined that there are abnormal operation results in all the first operation results and the second operation results, the notification message carrying the transaction termination operation instruction is fed back to the second transaction terminal in reverse order of the calling order, so that the second transaction terminal performs the corresponding transaction execution operation according to the notification message. After receiving the transaction operation completion information fed back by the last second transaction terminal, the corresponding notification message is sent to the first transaction terminal so that the first transaction terminal performs the corresponding transaction execution operation.

[0140] It should be noted that the specific implementation process of step S13 is the same as the specific implementation process of the above-mentioned steps S11 to S12, and they can refer to each other.

[0141] Optionally, when the transaction coordination manager sends a notification message to the first transaction terminal or the second transaction terminal, if the first transaction terminal and the second transaction terminal have not received the notification message twice, it will switch to other load modules to notify the second transaction terminal through other load modules.

[0142] Optionally, if the transaction coordination manager still fails to receive a successful submission message from the first transaction terminal, the compensation will be recorded and the operation and maintenance system will be notified.

[0143] It should be noted that if the transaction coordination manager does not receive a response, it will also inquire about the situation from other load modules of the first transaction terminal, just like the second transaction terminal, and they can refer to each other.

[0144] S213: The second transaction terminal executes the transaction operation corresponding to the transaction information.

[0145] In the process of implementing step S213, the second transaction terminal performs the second stage of the two-stage commit, i.e., the commit stage. If a notification message carrying a transaction abort operation instruction is received, the transaction abort operation is performed; if a notification message carrying a transaction commit operation instruction is received, the corresponding transaction is executed and the transaction commit operation is performed.

[0146] S214: The first transaction terminal executes a transaction execution operation corresponding to the transaction information.

[0147] In the specific implementation of step S214, the first transaction terminal performs the second stage of the two-stage commit, namely the commit stage. If the first transaction terminal receives a notification message carrying a transaction abort operation instruction, it performs a transaction abort operation; if it receives a notification message carrying a transaction commit operation instruction, it executes the corresponding transaction and performs a transaction commit operation.

[0148] Optionally, after the first transaction terminal and the second transaction terminal perform a transaction abort operation, the first transaction terminal and the second transaction terminal are controlled to roll back the transaction.

[0149] In the embodiment of the present invention, the unified control of distributed transactions is completed through the coordination of the transaction coordination manager, which processes the first operation result fed back by the first transaction terminal and the second operation result fed back by the second transaction terminal to notify the first transaction terminal and the second transaction terminal of the corresponding notification message, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, thereby ensuring data consistency.

[0150] In order to better understand the data processing method shown in the above embodiment of the present invention, an application example is used to explain it below. Figure 3 shown.

[0151] The first transaction terminal Q obtains the business information corresponding to the to-be-executed business a, and sends a transaction creation application request generated based on the business information to the transaction coordination manager.

[0152] The transaction coordination manager creates a target transaction group based on the business information carried in the transaction creation application request, and after confirming that the target transaction group is created, sends a transaction information response of the target transaction group to the first transaction terminal.

[0153] The first transaction terminal Q executes the business basic code corresponding to the business to be executed. In the process of executing the business basic code corresponding to the business to be executed, the second transaction terminal A and the second transaction terminal B participating in the business to be executed are determined; the calling sequence of the second transaction terminal A and the second transaction terminal B is determined according to the business to be executed a; according to the calling sequence, the request module A is first sent to the second transaction terminal A for calling.

[0154] After completing the execution of the local service, the second transaction terminal A feeds back the called response instruction to the first transaction terminal Q.

[0155] After receiving the response instruction fed back by the second transaction terminal A, the first transaction terminal Q sends a request module B to the second transaction terminal B for calling.

[0156] After completing the execution of the local service, the second transaction terminal B feeds back the called response instruction to the first transaction terminal Q.

[0157] The second transaction terminal A and the second transaction terminal B execute the corresponding local business based on the calling application request. After completing the execution of the local business, the second transaction terminal A and the second transaction terminal B start the timeout waiting task and send an application instruction to join the target transaction group to the transaction coordination manager based on the transaction identification information.

[0158] The transaction coordination manager adds the log identification information and identity identification information of the second transaction terminal A and the second transaction terminal B to the target transaction group respectively, and sends the transaction information updated based on the log identification information and identity identification information to the second transaction terminal A and the second transaction terminal B.

[0159] The second transaction terminal A and the second transaction terminal B determine the second operation result of the transaction corresponding to the transaction information, and notify the first transaction terminal Q of the call end instruction generated based on the second operation result.

[0160] The first transaction terminal Q determines the first operation result of the transaction corresponding to the transaction information, and submits the notification request generated by the first operation result and the two second operation results to the transaction coordination manager to commit the transaction.

[0161] The transaction coordination manager, based on the first operation result and the second operation result carried in the notification instruction, when determining that both the first operation result and the second operation result are successful results, first sends a notification message to the second-to-last transaction terminal B in reverse order of the calling order, and then sends a notification message carrying the transaction commit operation instruction, that is, notifies the second transaction terminal B of the transaction.

[0162] The second transaction terminal B executes the execution operation of the corresponding transaction, that is, the commit operation, according to the notification message, and feeds back the execution end instruction to the transaction coordination manager.

[0163] When receiving the execution end instruction fed back by the second transaction terminal B, the transaction coordination manager sends a notification message to the second transaction terminal A which is the second to last, that is, performs a notification transaction on the second transaction terminal A.

[0164] The second transaction terminal B executes the execution operation of the corresponding transaction, that is, the commit operation, according to the notification message, and feeds back the execution end instruction to the transaction coordination manager.

[0165] When receiving the execution end instruction fed back by the second transaction terminal A, the transaction coordination manager sends a notification message to the first transaction terminal Q.

[0166] The first transaction terminal Q executes a transaction execution operation corresponding to the transaction information.

[0167] In the embodiment of the present invention, the unified control of distributed transactions is completed through the coordination of the transaction coordination manager, which processes the first operation result fed back by the first transaction terminal and the second operation result fed back by the second transaction terminal to notify the first transaction terminal and the second transaction terminal of the corresponding notification message, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, thereby ensuring data consistency.

[0168] Based on the interactive diagram of the transaction coordination manager, the first transaction terminal and the second transaction terminal disclosed in the present invention, the transaction coordination manager implements the process of the data processing method, such as Figure 4 FIG. 1 is a flow chart of a data processing method provided by an embodiment of the present invention. The process of the transaction coordination manager specifically implementing the data processing system includes the following steps:

[0169] Step S401: upon receiving a transaction creation application request sent by a first transaction terminal, creating a target transaction group based on the business information carried in the transaction creation application request.

[0170] It should be noted that the target transaction group contains corresponding transaction information.

[0171] Step S402: after determining that the target transaction group is created, sending transaction information of the target transaction group to the first transaction terminal, so that the first transaction terminal executes the business basic code after receiving the transaction information.

[0172] Step S403: After receiving the application instruction to join the target transaction group sent by the second transaction terminal, add the log identification information and identity identification information of the second transaction terminal to the target transaction group, and send the transaction information updated based on the log identification information and identity identification information to the second transaction terminal.

[0173] It should be noted that the number of the second transaction terminal is at least one.

[0174] Step S404: upon receiving the notification request sent by the first transaction terminal, according to the first operation result and the second operation result carried in the notification instruction, the corresponding notification message is notified to the first transaction terminal and the second transaction terminal so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, and the transaction operations include transaction execution operations and transaction termination operations.

[0175] It should be noted that the specific implementation process of step S401 to step S404 and the specific implementation process of the above-mentioned step S201 to step S214 are not limited to this embodiment of the present invention.

[0176] In the embodiment of the present invention, the unified control of distributed transactions is completed through the coordination of the transaction coordination manager, which processes the first operation result fed back by the first transaction terminal and the second operation result fed back by the second transaction terminal to notify the first transaction terminal and the second transaction terminal of the corresponding notification message, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, thereby ensuring data consistency.

[0177] Based on the interactive diagram of the transaction coordination manager, the first transaction terminal and the second transaction terminal disclosed in the present invention, the first transaction terminal implements the process of the data processing method, such as Figure 5 FIG. 1 is a flow chart of a data processing method provided by an embodiment of the present invention. The process of the first transaction terminal specifically implementing the data processing system includes the following steps:

[0178] Step S501: Acquire the business information corresponding to the business to be executed.

[0179] Step S502: Sending a transaction creation application request generated based on the business information to the transaction coordination manager.

[0180] Step S503: When receiving the transaction information sent by the transaction coordination manager, execute the business basic code corresponding to the business to be executed.

[0181] Step S504: in the process of the business basic code corresponding to the business to be executed, determine the second transaction terminal participating in the business to be executed, and send a call application request to the second transaction terminal.

[0182] It should be noted that the call application carries the transaction identification information in the transaction information, and the number of the second transaction terminals is at least one.

[0183] Step S505: upon receiving the call end instruction carrying the second operation result sent by the second transaction terminal, determining the first operation result of the transaction corresponding to the transaction information, and submitting a notification request generated by the first operation result and the second operation result to the transaction coordination manager.

[0184] Step S506: upon receiving the notification message sent by the transaction coordination manager, executing the transaction execution operation corresponding to the transaction information.

[0185] It should be noted that the specific implementation process of steps S501 to S506 and the specific implementation process of steps S201 to S214 are not limited to this embodiment of the present invention.

[0186] In an embodiment of the present invention, the first transaction terminal obtains the business information corresponding to the business to be executed; sends the transaction creation application request generated based on the business information to the transaction coordination manager; when receiving the transaction information sent by the transaction coordination manager, executes the business basic code corresponding to the business to be executed; in the process of the business basic code corresponding to the business to be executed, determines the second transaction terminal participating in the business to be executed, and sends a call application request to the second transaction terminal; when receiving the call end instruction carrying the second operation result sent by the second transaction terminal, determines the first operation result of the transaction corresponding to the transaction information, and submits the notification request generated by the first operation result and the second operation result to the transaction coordination manager; when receiving the notification message sent by the transaction coordination manager, executes the transaction execution operation corresponding to the transaction information. Thus, data consistency can be guaranteed.

[0187] Based on the interactive diagram of the transaction coordination manager, the first transaction terminal and the second transaction terminal disclosed in the present invention, the second transaction terminal implements the process of the data processing method, such as Figure 6 FIG. 1 is a flow chart of a data processing method provided by an embodiment of the present invention. The process of the second transaction terminal specifically implementing the data processing system includes the following steps:

[0188] Step S601: after receiving the call application request sent by the first transaction terminal, executing the corresponding local service based on the call application request.

[0189] Step S602: After the execution of the local business is completed, the timeout waiting task is started, and an application instruction to join the target transaction group is sent to the transaction coordination manager based on the transaction identification information.

[0190] It should be noted that the application instruction for joining the target transaction group carries the log identification information and identity identification information corresponding to the second transaction terminal.

[0191] Step S603: when receiving the transaction information sent by the transaction coordination manager, determining the second operation result of the transaction corresponding to the transaction information, and notifying the first transaction terminal of the call end instruction generated based on the second operation result.

[0192] Step S604: upon receiving the notification message sent by the transaction coordination manager, executing the transaction operation corresponding to the transaction information.

[0193] It should be noted that the specific implementation process of steps S601 to S604 and the specific implementation process of the above-mentioned steps S201 to S214 are not limited to this embodiment of the present invention.

[0194] In the embodiment of the present invention, after receiving the call application request sent by the first transaction terminal, the second transaction terminal executes the corresponding local business based on the call application request; after completing the execution of the local business, it starts the timeout waiting task, and sends an application instruction to join the target transaction group to the transaction coordination manager based on the transaction identification information; when receiving the transaction information sent by the transaction coordination manager, it determines the second operation result of the transaction corresponding to the transaction information, and notifies the first transaction terminal of the call end instruction generated based on the second operation result; when receiving the notification message sent by the transaction coordination manager, it executes the transaction operation corresponding to the transaction information. Thus, data consistency can be guaranteed.

[0195] Based on the data processing method shown in the above embodiment of the present invention, correspondingly, the embodiment of the present invention shows a data processing device, an application and a transaction coordination manager, such as Figure 7 FIG. 1 is a schematic diagram of a data processing device according to an embodiment of the present invention, wherein the device includes:

[0196] The creation unit 701 is configured to create a target transaction group based on the business information carried in the transaction creation application request when receiving the transaction creation application request sent by the first transaction terminal, wherein the target transaction group includes corresponding transaction information.

[0197] The first sending unit 702 is used to send the transaction information of the target transaction group to the first transaction terminal after determining that the target transaction group is created, so that the first transaction terminal executes the business basic code after receiving the transaction information.

[0198] The adding unit 703 is used to add the log identification information and identity identification information of the second transaction terminal to the target transaction group after receiving the application instruction for joining the target transaction group sent by the second transaction terminal, and send the transaction information updated based on the log identification information and identity identification information to the second transaction terminal. The number of second transaction terminals is at least 1.

[0199] The processing unit 704 is used to notify the first transaction terminal and the second transaction terminal of corresponding notification messages according to the first operation result and the second operation result when receiving the first operation result fed back by the first transaction terminal and the second operation result fed back by the second transaction terminal, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, and the transaction operations include transaction execution operations and transaction termination operations.

[0200] It should be noted that the specific principles and execution processes of each module in the data processing device of the application system disclosed in the above embodiment of the present invention can be found in the corresponding parts of the interaction timing of the transaction coordination manager, the first transaction terminal and the second transaction terminal implemented in the above embodiment of the present invention, and will not be repeated here.

[0201] In the embodiment of the present invention, the unified control of distributed transactions is completed through the coordination of the transaction coordination manager, which processes the first operation result fed back by the first transaction terminal and the second operation result fed back by the second transaction terminal to notify the first transaction terminal and the second transaction terminal of the corresponding notification message, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, thereby ensuring data consistency.

[0202] Based on the data processing method shown in the above embodiment of the present invention, correspondingly, the embodiment of the present invention shows a data processing device, which is applied to a first transaction terminal, such as Figure 8 FIG. 1 is a schematic diagram of a data processing device according to an embodiment of the present invention, wherein the device includes:

[0203] The acquisition unit 801 is used to acquire the service information corresponding to the service to be executed.

[0204] The second sending unit 802 is used to send the transaction creation application request generated based on the business information to the transaction coordination manager.

[0205] The first execution unit 803 is used to execute the business basic code corresponding to the business to be executed when receiving the transaction information sent by the transaction coordination manager.

[0206] The first determination unit 804 is used to determine the second transaction terminal participating in the business to be executed in the process of the business basic code corresponding to the business to be executed, send a call application request to the second transaction terminal, the call application carries the transaction identification information in the transaction information, and the number of second transaction terminals is at least 1; when receiving the call end instruction carrying the second operation result sent by the second transaction terminal, determine the first operation result of the transaction corresponding to the transaction information, and submit the notification request generated by the first operation result and the second operation result to the transaction coordination manager.

[0207] The second execution unit 805 is configured to execute a transaction execution operation corresponding to the transaction information when receiving a notification message sent by the transaction coordination manager.

[0208] It should be noted that the specific principles and execution processes of each module in the data processing device of the application system disclosed in the above embodiment of the present invention can be found in the corresponding parts of the interaction timing of the transaction coordination manager, the first transaction terminal and the second transaction terminal implemented in the above embodiment of the present invention, and will not be repeated here.

[0209] In an embodiment of the present invention, the first transaction terminal obtains the business information corresponding to the business to be executed; sends the transaction creation application request generated based on the business information to the transaction coordination manager; when receiving the transaction information sent by the transaction coordination manager, executes the business basic code corresponding to the business to be executed; in the process of the business basic code corresponding to the business to be executed, determines the second transaction terminal participating in the business to be executed, and sends a call application request to the second transaction terminal; when receiving the call end instruction carrying the second operation result sent by the second transaction terminal, determines the first operation result of the transaction corresponding to the transaction information, and submits the notification request generated by the first operation result and the second operation result to the transaction coordination manager; when receiving the notification message sent by the transaction coordination manager, executes the transaction execution operation corresponding to the transaction information. Thus, data consistency can be guaranteed.

[0210] Based on the data processing method shown in the above embodiment of the present invention, correspondingly, the embodiment of the present invention shows a data processing device, which is applied to the second transaction terminal, such as Fig. 9 FIG. 1 is a schematic diagram of a data processing device according to an embodiment of the present invention, wherein the device includes:

[0211] The third execution unit 901 is used to execute the corresponding local service based on the calling application request after receiving the calling application request sent by the first transaction terminal.

[0212] The third sending unit 902, after completing the execution of the local business, starts the timeout waiting task, and sends an application instruction to join the target transaction group to the transaction coordination manager based on the transaction identification information. The application instruction to join the target transaction group carries the log identification information and identity identification information corresponding to the second transaction terminal.

[0213] The second determining unit 903 is used to determine the second operation result of the transaction corresponding to the transaction information when receiving the transaction information sent by the transaction coordination manager, and notify the first transaction terminal of the call end instruction generated based on the second operation result.

[0214] The fourth execution unit 904 is configured to execute a transaction operation corresponding to the transaction information when receiving a notification message sent by the transaction coordination manager.

[0215] It should be noted that the specific principles and execution processes of each module in the data processing device of the application system disclosed in the above embodiment of the present invention can be found in the corresponding parts of the interaction timing of the transaction coordination manager, the first transaction terminal and the second transaction terminal implemented in the above embodiment of the present invention, and will not be repeated here.

[0216] In the embodiment of the present invention, after receiving the call application request sent by the first transaction terminal, the second transaction terminal executes the corresponding local business based on the call application request; after completing the execution of the local business, it starts the timeout waiting task, and sends an application instruction to join the target transaction group to the transaction coordination manager based on the transaction identification information; when receiving the transaction information sent by the transaction coordination manager, it determines the second operation result of the transaction corresponding to the transaction information, and notifies the first transaction terminal of the call end instruction generated based on the second operation result; when receiving the notification message sent by the transaction coordination manager, it executes the transaction operation corresponding to the transaction information. Thus, data consistency can be guaranteed.

[0217] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0218] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0219] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data processing method, characterized in that: Applied to a transaction coordination manager, the method comprises: Upon receiving the transaction creation application request sent by the first transaction terminal, creating a target transaction group based on the business information carried in the transaction creation application request, wherein the target transaction group includes corresponding transaction information; After determining that the target transaction group is created, sending transaction information of the target transaction group to the first transaction terminal, so that the first transaction terminal executes the business basic code after receiving the transaction information; After receiving an application instruction for joining the target transaction group sent by a second transaction terminal, adding the log identification information and identity identification information of the second transaction terminal to the target transaction group, and sending transaction information updated based on the log identification information and identity identification information to the second transaction terminal, where the number of the second transaction terminal is at least one; When receiving the notification request sent by the first transaction terminal, according to the first operation result and the second operation result carried in the notification request, the first transaction terminal and the second transaction terminal are notified of the corresponding notification message so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, where the transaction operations include transaction execution operations and transaction termination operations, and the first operation results and the second operation results refer to the operation results of the transaction corresponding to the transaction information.

2. The method according to claim 1, characterized in that The notifying the first transaction terminal and the second transaction terminal of corresponding notification messages according to the first operation result and the second operation result carried in the notification request includes: When it is determined that both the first operation result and the second operation result are successful operation results, sending a corresponding notification message to the second transaction terminal so that the second transaction terminal performs a corresponding transaction execution operation; After receiving the transaction operation completion information fed back by the second transaction terminal, sending a corresponding notification message to the first transaction terminal so that the first transaction terminal performs the corresponding transaction execution operation; When it is determined that there is an abnormal operation result in the first operation result and the second operation result, a corresponding notification message is sent to the first transaction terminal and the second transaction terminal so that the first transaction terminal and the second transaction terminal perform a transaction abort operation.

3. The method according to claim 2, characterized in that The sending of the corresponding notification message to the second transaction terminal so that the second transaction terminal performs the corresponding transaction operation includes: When it is determined that the number of the second transaction terminal is one, sending a corresponding notification message to the second transaction terminal so that the second transaction terminal performs a corresponding transaction operation; When it is determined that there are multiple second transaction terminals, all the second transaction terminals are traversed, and corresponding notification messages are sent to the second transaction terminals one by one according to preset rules, so that the second transaction terminals can perform corresponding transaction operations.

4. The method according to claim 2, characterized in that: After the first transaction terminal and the second transaction terminal perform the transaction abort operation, the first transaction terminal and the second transaction terminal are controlled to roll back the transaction.

5. A data processing method, characterized in that: Applied to a first transaction terminal, the method includes: Obtain business information corresponding to the business to be executed; Sending a transaction creation application request generated based on the business information to a transaction coordination manager; When receiving the transaction information sent by the transaction coordination manager, executing the business basic code corresponding to the business to be executed; In the process of executing the business basic code corresponding to the to-be-executed business, determining a second transaction terminal participating in the to-be-executed business, sending a call application request to the second transaction terminal, wherein the call application carries the transaction identification information in the transaction information, and the number of the second transaction terminal is at least 1; Upon receiving the call end instruction carrying the second operation result sent by the second transaction terminal, determining the first operation result of the transaction corresponding to the transaction information, and submitting a notification request generated by the first operation result and the second operation result to the transaction coordination manager, wherein the first operation result and the second operation result refer to the operation results of the transaction corresponding to the transaction information; When receiving the notification message sent by the transaction coordination manager, a transaction execution operation corresponding to the transaction information is executed.

6. A data processing method, characterized in that: Applied to the second transaction terminal, the method includes: After receiving the call application request sent by the first transaction terminal, executing the corresponding local service based on the call application request; After completing the execution of the local business, start the timeout waiting task, and send an application instruction for joining the target transaction group to the transaction coordination manager based on the transaction identification information, wherein the application instruction for joining the target transaction group carries the log identification information and identity identification information corresponding to the second transaction terminal; When receiving the transaction information sent by the transaction coordination manager, determining a second operation result of the transaction corresponding to the transaction information, and notifying the first transaction terminal of a call end instruction generated based on the second operation result, wherein the second operation result refers to an operation result of the transaction corresponding to the transaction information; When receiving the notification message sent by the transaction coordination manager, executing the transaction operation corresponding to the transaction information.

7. A data processing device, characterized in that: Applied to a transaction coordination manager, the device comprises: a creating unit, configured to, upon receiving a transaction creation application request sent by the first transaction terminal, create a target transaction group based on the business information carried in the transaction creation application request, wherein the target transaction group includes corresponding transaction information; A first sending unit is configured to send transaction information of the target transaction group to the first transaction terminal after determining that the target transaction group is created, so that the first transaction terminal executes a business basic code after receiving the transaction information; an adding unit, configured to, after receiving an application instruction sent by a second transaction terminal to join a target transaction group, add the log identification information and identity identification information of the second transaction terminal to the target transaction group, and send transaction information updated based on the log identification information and identity identification information to the second transaction terminal, wherein the number of the second transaction terminal is at least one; The processing unit is configured to, upon receiving a notification request sent by the first transaction terminal, notify the first transaction terminal and the second transaction terminal of a corresponding notification message according to a first operation result and a second operation result carried in the notification request, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, wherein the transaction operations include transaction execution operations and transaction termination operations, and the first operation results and the second operation results refer to operation results of the transaction corresponding to the transaction information.

8. A data processing device, characterized in that: Applied to a first transaction terminal, the device comprises: An acquisition unit, used to acquire business information corresponding to the business to be executed; A second sending unit, configured to send a transaction creation application request generated based on the business information to a transaction coordination manager; A first execution unit, configured to execute a basic business code corresponding to the to-be-executed business when receiving the transaction information sent by the transaction coordination manager; A first determining unit is configured to determine, during the process of executing the business basic code corresponding to the business to be executed, a second transaction terminal participating in the business to be executed, and send a call application request to the second transaction terminal, wherein the call application carries the transaction identification information in the transaction information, and the number of the second transaction terminals is at least 1; upon receiving a call end instruction carrying a second operation result sent by the second transaction terminal, determine a first operation result of the transaction corresponding to the transaction information, and submit a notification request generated by the first operation result and the second operation result to the transaction coordination manager, wherein the first operation result and the second operation result refer to the operation results of the transaction corresponding to the transaction information; The second execution unit is configured to execute a transaction execution operation corresponding to the transaction information when receiving a notification message sent by the transaction coordination manager.

9. A data processing device, characterized in that: Applied to a second transaction terminal, the device comprises: A third execution unit is used to execute a corresponding local service based on the call application request after receiving the call application request sent by the first transaction terminal; a third sending unit, after completing the execution of the local business, starting the timeout waiting task, and sending an application instruction for joining the target transaction group to the transaction coordination manager based on the transaction identification information, wherein the application instruction for joining the target transaction group carries the log identification information and the identity identification information corresponding to the second transaction terminal; a second determining unit, configured to determine, when receiving the transaction information sent by the transaction coordination manager, a second operation result of the transaction corresponding to the transaction information, and notify the first transaction terminal of a call end instruction generated based on the second operation result, wherein the second operation result refers to an operation result of the transaction corresponding to the transaction information; The fourth execution unit is configured to execute a transaction operation corresponding to the transaction information when receiving a notification message sent by the transaction coordination manager.

10. A data processing system, characterized in that: The system comprises: a transaction coordination manager, a first transaction terminal and a second transaction terminal; The first transaction terminal is used to obtain business information corresponding to the business to be executed; send a transaction creation application request generated based on the business information to the transaction coordination manager; when receiving the transaction information sent by the transaction coordination manager, execute the business basic code corresponding to the business to be executed; in the process of executing the business basic code corresponding to the business to be executed, determine the second transaction terminal participating in the business to be executed, send a call application request to the second transaction terminal, the call application carries the transaction identification information in the transaction information, and the number of the second transaction terminals is at least 1; when receiving the call end instruction carrying the second operation result sent by the second transaction terminal, determine the first operation result of the transaction corresponding to the transaction information, and notify the transaction coordination manager of the generation of the first operation result and the second operation result; when receiving the notification message sent by the transaction coordination manager, execute the transaction execution operation corresponding to the transaction information; The transaction coordination manager is configured to, upon receiving a transaction creation application request sent by a first transaction terminal, create a target transaction group based on the business information carried in the transaction creation application request, wherein the target transaction group includes corresponding transaction information; after determining that the target transaction group is created, send the transaction information of the target transaction group to the first transaction terminal, so that the first transaction terminal executes the business basic code after receiving the transaction information; after receiving an application instruction to join the target transaction group sent by a second transaction terminal, add the log identification information and identity identification information of the second transaction terminal to the target transaction group, and send the transaction information updated based on the log identification information and identity identification information to the second transaction terminal, wherein the number of the second transaction terminals is at least 1; upon receiving a notification request sent by the first transaction terminal, notify the first transaction terminal and the second transaction terminal of the corresponding notification message according to the first operation result and the second operation result carried in the notification request, so that the first transaction terminal and the second transaction terminal perform corresponding transaction operations, wherein the transaction operations include transaction execution operations and transaction termination operations, and the first operation result and the second operation result refer to the operation results of the transactions corresponding to the transaction information; The second transaction terminal is used to execute the corresponding local business based on the call application request after receiving the call application request sent by the first transaction terminal; after completing the execution of the local business, start the timeout waiting task, and send an application instruction to join the target transaction group to the transaction coordination manager based on the transaction identification information, and the application instruction to join the target transaction group carries the log identification information and identity identification information corresponding to the second transaction terminal; when receiving the transaction information sent by the transaction coordination manager, determine the second operation result of the transaction corresponding to the transaction information, and notify the first transaction terminal of the call end instruction generated based on the second operation result; when receiving the notification message sent by the transaction coordination manager, execute the transaction operation corresponding to the transaction information.

Citation Information

Patent Citations

  • Method for controlling and executing network transaction, network controller and transmission devices

    CN103457770A

  • Distributed transaction coordination method and device and electronic equipment

    CN112148394A