CN114090194A - Method and device for realizing distributed transaction consistency - Google Patents

Method and device for realizing distributed transaction consistency Download PDF

Info

Publication number
CN114090194A
CN114090194A CN202111404934.8A CN202111404934A CN114090194A CN 114090194 A CN114090194 A CN 114090194A CN 202111404934 A CN202111404934 A CN 202111404934A CN 114090194 A CN114090194 A CN 114090194A
Authority
CN
China
Prior art keywords
remote
call request
request
remote call
retry
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111404934.8A
Other languages
Chinese (zh)
Inventor
李涵
姬志刚
张航
冯奇
王宏
安强
王强
汤东波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202111404934.8A priority Critical patent/CN114090194A/en
Publication of CN114090194A publication Critical patent/CN114090194A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention discloses a method and a device for realizing distributed transaction consistency, belonging to the distribution type, wherein the method comprises the following steps: when a first system receives a first remote call request for the first system, which is sent by a second system, caching the first remote call request; if the state of the transaction operation corresponding to the execution of the first remote call request by the first system is abnormal, the cached identification of the first remote call request is placed into a preset retry queue; reading the identifier of the first remote call request from the retry queue according to a preset reading time, and acquiring the first remote call request according to the identifier; and resending the first remote invocation request to the first system. The invention ensures the consistency of the distributed transaction processing result by retrying the first remote call request with abnormal transaction operation state.

Description

Method and device for realizing distributed transaction consistency
Technical Field
The invention relates to the technical field of computer systems, in particular to a method and a device for realizing distributed transaction consistency.
Background
In a microservice environment, a transaction request may require many systems to operate cooperatively to obtain a final result, the systems need to be accessed by Remote Procedure Call (RPC), network consumption is involved in the process, and the processing state of the transaction by a client and a server may be different. And inconsistencies in state may cause the final requested result to deviate from the actual result.
The single application to achieve transaction consistency can be resolved using database-based transactions or spring-encapsulated declarative transactions. Due to the isolation of the application, the distributed application system in the micro-service environment communicates with the application through the network, the database transaction and the spring declarative transaction cannot play a role, and due to the complexity of network interaction in the micro-service environment, it is difficult to achieve complete data consistency in the single application environment, so the final consistency of the transaction becomes a better choice in the micro-service environment.
In order to achieve final consistency of transactions, the prior art provides such a two-phase or three-phase transaction submission mode, the two-phase submission is divided into a submission application phase and a submission execution phase, the application phase is initiated by the transaction coordinator to each transaction participant to inquire whether the transaction participant can submit, if all participants respond to the inquiry, the coordinator performs the second-phase submission execution, otherwise, the coordinator initiates a rollback operation request to each participant. The second phase also initiates a rollback operation request if any participant fails to respond successfully. Three-phase submission based on the two-phase submission, an inquiry phase is added in the application phase and timeouts are processed, all of which are initiated by the coordinator to the participants with an abort request. In the mode, one transaction is divided into a plurality of stages to be completed, the success rate of transaction execution is improved, but because the coordinator participates in the transaction, the network nodes are increased, the uncertain risk of network communication between the transaction coordinator and other transaction participants is correspondingly increased, and the mechanism of inquiring and waiting for response causes the overall loss in time efficiency and lower efficiency.
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
Disclosure of Invention
The embodiment of the invention provides a method for realizing distributed transaction consistency, which comprises the following steps:
when a first system receives a first remote call request for the first system, which is sent by a second system, caching the first remote call request;
if the state of the transaction operation corresponding to the execution of the first remote call request by the first system is abnormal, the cached identification of the first remote call request is placed into a preset retry queue;
reading the identifier of the first remote call request from the retry queue according to a preset reading time, and acquiring the first remote call request according to the identifier;
and resending the first remote invocation request to the first system.
In one embodiment, after the step of resending the first remote invocation request to the first system, the method further comprises:
if the state of the corresponding transaction operation executed by the first system according to the retransmitted first remote calling request is abnormal again, sending information of failure of transaction consistency to an operation management platform; or
If the state of the transaction operation executed by the first system according to the retransmitted first remote invocation request is abnormal again, the following steps are repeatedly executed until the number of times of retransmitting the first remote invocation request reaches a preset number threshold: and putting the cached identifier of the first remote call request into a preset retry queue again, reading the identifier of the first remote call request from the retry queue again according to a preset reading time, acquiring the first remote call request according to the identifier and resending the first remote call request to the first system again.
In one embodiment, after placing the cached identifier of the first remote invocation request into a preset retry queue, the method further includes:
in the retry queue, marking the corresponding delay time of the first remote call request identification and timing;
the reading the identifier of the first remote invocation request from the retry queue according to a preset reading opportunity includes:
and reading the first remote call request with the delay time of 0 from the retry queue in a mode of periodically reading the call request with the delay time of 0 in the retry queue.
In one embodiment, the first system executes a corresponding transaction operation according to the first remote invocation request, and the method includes: the transaction operation executed in the first system or the transaction operation realized by remotely calling the third system;
the delay time corresponding to the first remote call request identifier is determined according to the duration and/or frequency of the first system internal execution transaction operation or the third system execution transaction according to the remote call.
In one embodiment, resending the first remote invocation request to the first system includes:
and sending the first remote calling request to an interface corresponding to the first system in a remote calling mode.
An embodiment of the present invention further provides a device for implementing distributed transaction consistency, including: the system comprises a retry component module, a retry service module, a request buffer queue module and a retry queue module; wherein:
the retry component module is used for caching the first remote call request in the request cache queue module when the first system receives the first remote call request to the first system, which is sent by the second system; if the state of the transaction operation corresponding to the execution of the first remote call request by the first system is abnormal, the cached identification of the first remote call request is placed into a retry queue of the retry queue module;
the retry service module is configured to read an identifier of the first remote invocation request from the retry queue according to a preset reading time, and obtain the first remote invocation request according to the identifier; and resending the first remote invocation request to the first system.
In an embodiment, the retry service module is further configured to, after the step of resending the first remote invocation request to the first system, send information of transaction consistency failure to an operation management platform if the first system executes a corresponding transaction operation according to the resent first remote invocation request and a state abnormality occurs again; or if the state abnormality occurs again when the first system executes the corresponding transaction operation according to the retransmitted first remote invocation request, repeatedly executing the following steps until the number of times of retransmitting the first remote invocation request reaches a preset number threshold: and putting the cached identifier of the first remote call request into a preset retry queue again, reading the identifier of the first remote call request from the retry queue again according to a preset reading time, acquiring the first remote call request according to the identifier and resending the first remote call request to the first system again.
In an embodiment, the retry service module is specifically configured to mark, in a retry queue, a corresponding delay time for the identifier of the first remote invocation request and time the delay time after placing the cached identifier of the first remote invocation request into a preset retry queue; and reading the first remote call request with the delay time of 0 from the retry queue in a mode of periodically reading the call request with the delay time of 0 in the retry queue.
An embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method for implementing distributed transaction consistency when executing the computer program.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for implementing distributed transaction consistency is implemented.
An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the method for implementing distributed transaction consistency is implemented.
According to the method and the device for realizing the consistency of the distributed transactions provided by the embodiment of the invention, when the first system receives the remote call request of the second system, the first remote call request is cached, and the pre-stored first remote call request is subjected to delayed retry when the state of the subsequent transaction execution operation is abnormal, such as the execution transaction state is unknown, so that on one hand, the pre-stored first remote call request can prevent the loss of request information caused by interruption in the transaction processing process, and the subsequent retry of the first remote call request is convenient, and on the other hand, the retry of the first remote call request also ensures the consistency of the distributed transaction processing result. The method can be directly realized in an application system (such as a first system and the like) without depending on an independent network entity, and compared with the prior art, the method has the advantages of small change on the original application system, good compatibility and high processing efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
FIG. 1 is a flowchart of a method for implementing distributed transaction consistency in an embodiment of the invention;
FIG. 2 is a second flowchart of a method for implementing distributed transaction consistency according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of interaction between systems in an embodiment of the invention;
FIG. 4 is a flowchart corresponding to an embodiment of the present invention;
fig. 5 is a block diagram of an apparatus for implementing distributed transaction consistency according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
The invention belongs to the field of distributed technology. In order to solve the problem of transaction consistency of a distributed system in the prior art, an embodiment of the present invention provides a method for implementing distributed transaction consistency, and for convenience of description, for different application systems related to the same transaction processing in a microservice environment, a "first system", a "second system", a "third system", and the like are used for distinguishing.
Referring to fig. 1, a method for implementing distributed transaction consistency according to an embodiment of the present invention includes the following steps:
s11, when the first system receives a first remote call request for the first system sent by the second system, caching the first remote call request;
s12, if the state of the transaction operation executed by the first system according to the first remote call request is abnormal, putting the cached identification of the first remote call request into a preset retry queue;
s13, reading the identifier of the first remote calling request from the retry queue according to a preset reading time, and acquiring the first remote calling request according to the identifier;
s14, resending the first remote calling request to the first system.
In step S14, for example, the first remote invocation request is sent to the interface corresponding to the first system by way of remote invocation, that is, the second system is simulated, and the first remote invocation request in S11 is sent again.
According to the method for realizing the consistency of the distributed transactions provided by the embodiment of the invention, when the first system receives the remote call request of the second system, the first remote call request is cached, and when the state of the subsequent execution transaction operation is abnormal, for example, the execution transaction state is unknown, the pre-stored first remote call request is subjected to delayed retry, so that on one hand, the pre-stored first remote call request can prevent the request information from being lost due to interruption in the transaction processing process, and the subsequent retry of the first remote call request is convenient, and on the other hand, the retry of the first remote call request also ensures the consistency of the distributed transaction processing result. The method can be directly realized in an application system (such as a first system and the like) without depending on an independent network entity, and compared with the prior art, the method has the advantages of small change on the original application system, good compatibility and high processing efficiency.
In an embodiment, after the step of resending the first remote invocation request to the first system in the step S14, the method for distributed transaction consistency provided in the embodiment of the present invention, as shown in fig. 2, may further perform the following steps: and S15, after the retry fails or the retry times reach the limited times, sending the information of the transaction consistency failure to the operation management platform. Specifically, namely:
1. if the state of the corresponding transaction operation executed by the first system according to the retransmitted first remote calling request is abnormal again, sending information of failure of transaction consistency to an operation management platform;
2. and if the state abnormality occurs again when the first system executes the corresponding transaction operation according to the retransmitted first remote call request, repeating the steps of S12-S14 until the number of times of retransmitting the first remote call request reaches a preset number threshold. For example: the cached identification of the first remote call request is put into a preset retry queue again, the identification of the first remote call request is read from the retry queue again according to a preset reading opportunity, the first remote call request is obtained according to the identification and is sent to the first system again, whether the current number of times of sending the first remote call request reaches a preset number threshold value or not is judged, and if the current number of times of sending the first remote call request reaches the preset number threshold value, information of transaction consistency failure is directly sent to an operation management platform.
And the information of failure of the transaction consistency is sent to the operation management platform, so that service management personnel of the operation management platform can conveniently perform further problem positioning and subsequent problem processing.
In an embodiment, after the foregoing S11 puts the cached identifier of the first remote invocation request into a preset retry queue, the following steps may be further performed: and marking the corresponding delay time for the first remote call request identification in the retry queue and timing.
For example, the delay time corresponding to the first remote invocation request identifier is marked as 10s, and timing is started after the marking is completed until the delay time is 0.
Correspondingly, in step S13, the first remote call request with a delay time of 0 may be read from the retry queue by periodically reading the call request with a delay time of 0 in the retry queue.
In a specific implementation of the embodiment of the present invention, in S11, the first remote invocation request may be placed into a cache queue; when determining that a first remote call request needs to be retried, placing the first remote call request in a retry queue, so that in the retry queue, there may be more than one first remote call request identifier needing to be retried, delay time corresponding to each first remote call request identifier may be different (time for placing the first remote call request identifier in the retry queue is sequential, and the delay time may also be different), and during each reading, only reading the first remote call request identifier with delay time of 0, reading the content of the first remote call request from the cached queue, and retrying again.
When the first system executes the corresponding transaction operation according to the first remote call request, in a specific implementation, there may be a plurality of cases, for example, the transaction operation executed inside the first system or the transaction operation implemented by remotely calling the third system. If the state is abnormal or unknown, the retry process of the first remote call request is also triggered. For another example, the first system needs to remotely call the third system according to the first remote call request, and it may be unknown that a network exception exists or the state returned by the third system is remotely called, and this situation may also trigger a retry of the first remote call request.
The delay time of each first remote call request needing to be retried can also be determined according to the time and/or frequency of executing the transaction operation in the first system or the time and/or frequency of executing the transaction processing by the third system according to the remote call, the processing time is longer, the frequency is lower, the delay time can be longer, unnecessary resource loss caused by the fact that the first remote call request is retried too frequently is avoided, and different retry strategies can be provided for different services in the retry process.
The method for implementing distributed transaction consistency provided by the embodiment of the present invention is described in a specific example, and is shown in fig. 3, where the example includes three application systems, i.e., system a, system B, and system C. The system B is improved, and a retry component, a redis request buffer queue, a redis retry queue, a retry service and an operation platform are added.
The retry component is mainly responsible for pre-storing the request information and putting the request information into a retry queue after communication is abnormal; the redis request buffer queue is mainly used for buffering prestored request information, and the retry queue is mainly used for storing a request information ID needing retry; the retry service is mainly responsible for regularly acquiring request information to be retried from the retry queue and sending the request information out in an RPC mode.
Referring to fig. 4, the overall process is as follows:
s41, the system A calls an interface of the system B in an RPC mode;
s42, after receiving the request of the A, the system B firstly caches the request information in a redis request cache queue;
s43, the system B processes the normal service logic of the request and calls an RPC interface provided by the system C;
s44, if the RPC network called by the system B is abnormal or the state returned by the system C is unknown, the retry component puts the request information ID in the step 2 into a redis retry queue and marks certain delay time in the queue;
s45, the retry service acquires data with the delay time of 0, namely the ID of the request information from a redis retry queue at regular intervals, and acquires specific request information from the redis request cache queue according to the ID;
s46, the retry service calls an interface provided by the system B in an RPC mode; the equivalent simulation system A resends the request of the step 1 again;
s47, if the retry reaches a certain number of times or an error is generated in the step 4, the retry failure information needs to be uploaded to the operation management platform, and the operation management platform displays the failure information to related business personnel.
The embodiment of the present invention further provides an apparatus for implementing distributed transaction consistency, as described in the following embodiments. Because the principle of the device for solving the problem is similar to the method for realizing the distributed transaction consistency, the implementation of the device can refer to the implementation of the method for realizing the distributed transaction consistency, and repeated details are not repeated.
Referring to fig. 5, an embodiment of the present invention provides an apparatus for implementing distributed transaction consistency, where the apparatus includes: a retry component module 51, a retry service module 52, a request buffer queue module 53, and a retry queue module 54; wherein:
the retry component module 51 is configured to, when the first system receives a first remote call request to the first system sent by the second system, cache the first remote call request in the request cache queue module; if the state of the transaction operation corresponding to the execution of the first remote call request by the first system is abnormal, the cached identification of the first remote call request is placed into a retry queue of the retry queue module;
the retry service module 52 is configured to read an identifier of the first remote invocation request from the retry queue according to a preset reading time, and obtain the first remote invocation request according to the identifier; and resending the first remote invocation request to the first system.
In an embodiment, the retry service module 52 is further configured to, after the step of resending the first remote invocation request to the first system, send information of transaction consistency failure to the operation management platform if the first system executes a corresponding transaction operation according to the resent first remote invocation request and a state abnormality occurs again; or if the state abnormality occurs again when the first system executes the corresponding transaction operation according to the retransmitted first remote call request, repeatedly executing the following steps until the number of times of retransmitting the first remote call request reaches a preset number threshold: and putting the cached identifier of the first remote call request into a preset retry queue again, reading the identifier of the first remote call request from the retry queue again according to a preset reading time, acquiring the first remote call request according to the identifier and resending the first remote call request to the first system again.
In an embodiment, the retry service module 52 is specifically configured to mark a corresponding delay time for the identifier of the first remote call request in a retry queue and time after the identifier of the first remote call request that is cached is placed in a preset retry queue; and reading the first remote call request with the delay time of 0 from the retry queue in a mode of periodically reading the call request with the delay time of 0 in the retry queue.
In the apparatus for implementing distributed transaction consistency provided in the embodiment of the present invention, the retry component module and the retry service module may exist independently of the application of the first system, and are decoupled from the application, so that the cost of modifying the existing application to support a retry mechanism to solve the transaction consistency can be reduced, and only the component and the module need to be introduced into the existing first system to modify the interface support idempotent; the retry component module prestores transaction information before transaction processing, so that the transaction information loss caused by program processing interruption can be prevented; the retry component module can also configure different retry times and retry interval time aiming at different requests, so that the transaction consistency problem can be solved by utilizing retry maximally according to the application processing rate, and the retry times can be reduced; the retry component module and the retry service module exist independently of the existing application, can also reduce the resource consumption of the application initiating the retry request, and is also beneficial to maintaining different retry strategies for different services; and after the retry times exceed the limit or the retry fails, the transaction information is sent to the operation management platform, so that the transaction information is prevented from being lost, and the problem of real-time tracking of service personnel is also facilitated.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method for implementing distributed transaction consistency is implemented.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for implementing distributed transaction consistency is implemented.
An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the method for implementing distributed transaction consistency is implemented.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (11)

1. A method for achieving distributed transaction consistency, comprising:
when a first system receives a first remote call request sent by a second system to the first system, caching the first remote call request;
if the state of the transaction operation corresponding to the execution of the first remote call request by the first system is abnormal, the cached identification of the first remote call request is placed into a preset retry queue;
reading the identifier of the first remote call request from the retry queue according to a preset reading time, and acquiring the first remote call request according to the identifier;
and resending the first remote invocation request to the first system.
2. The method of claim 1, wherein after the step of resending the first remote invocation request to the first system, further comprising:
if the state of the corresponding transaction operation executed by the first system according to the retransmitted first remote calling request is abnormal again, sending information of failure of transaction consistency to an operation management platform; or
If the state of the transaction operation executed by the first system according to the retransmitted first remote invocation request is abnormal again, the following steps are repeatedly executed until the number of times of retransmitting the first remote invocation request reaches a preset number threshold: and putting the cached identifier of the first remote call request into a preset retry queue again, reading the identifier of the first remote call request from the retry queue again according to a preset reading time, acquiring the first remote call request according to the identifier and resending the first remote call request to the first system again.
3. The method of claim 1, wherein after placing the cached identity of the first remote invocation request in a preset retry queue, further comprising:
in the retry queue, marking the corresponding delay time of the first remote call request identification and timing;
the reading the identifier of the first remote invocation request from the retry queue according to a preset reading opportunity includes:
and reading the first remote call request with the delay time of 0 from the retry queue in a mode of periodically reading the call request with the delay time of 0 in the retry queue.
4. The method of claim 3, wherein the first system performing the corresponding transactional operation in accordance with the first remote invocation request comprises: the transaction operation executed in the first system or the transaction operation realized by remotely calling the third system;
the delay time corresponding to the first remote call request identifier is determined according to the duration and/or frequency of the first system internal execution transaction operation or the third system execution transaction according to the remote call.
5. The method of any of claims 1-4, wherein resending the first remote invocation request to the first system comprises:
and sending the first remote calling request to an interface corresponding to the first system in a remote calling mode.
6. An apparatus for distributed transaction consistency, comprising: the system comprises a retry component module, a retry service module, a request buffer queue module and a retry queue module; wherein:
the retry component module is used for caching the first remote call request in the request cache queue module when the first system receives the first remote call request to the first system, which is sent by the second system; if the state of the transaction operation executed by the first system according to the first remote call request is abnormal, the cached identification of the first remote call request is placed into a retry queue of the retry queue module;
the retry service module is configured to read an identifier of the first remote invocation request from the retry queue according to a preset reading time, and obtain the first remote invocation request according to the identifier; and resending the first remote invocation request to the first system.
7. The apparatus according to claim 6, wherein the retry service module is further configured to, after the step of resending the first remote invocation request to the first system, send a message of transaction consistency failure to the operation management platform if the state exception occurs again when the first system executes a corresponding transaction operation according to the resent first remote invocation request; or if the state abnormality occurs again when the first system executes the corresponding transaction operation according to the retransmitted first remote invocation request, repeatedly executing the following steps until the number of times of retransmitting the first remote invocation request reaches a preset number threshold: and putting the cached identifier of the first remote call request into a preset retry queue again, reading the identifier of the first remote call request from the retry queue again according to a preset reading time, acquiring the first remote call request according to the identifier and resending the first remote call request to the first system again.
8. The apparatus according to claim 6, wherein the retry service module is specifically configured to mark and time a delay time corresponding to the identifier of the first remote call request in a retry queue after placing the identifier of the first remote call request buffered in the retry queue; and reading the first remote call request with the delay time of 0 from the retry queue in a mode of periodically reading the call request with the delay time of 0 in the retry queue.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of achieving distributed transaction consistency of any of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and wherein the computer program when executed by a processor implements the method for distributed transaction consistency of any of claims 1 to 5.
11. A computer program product, characterized in that it comprises a computer program which, when being executed by a processor, carries out the method of carrying out distributed transaction consistency according to any one of claims 1 to 5.
CN202111404934.8A 2021-11-24 2021-11-24 Method and device for realizing distributed transaction consistency Pending CN114090194A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111404934.8A CN114090194A (en) 2021-11-24 2021-11-24 Method and device for realizing distributed transaction consistency

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111404934.8A CN114090194A (en) 2021-11-24 2021-11-24 Method and device for realizing distributed transaction consistency

Publications (1)

Publication Number Publication Date
CN114090194A true CN114090194A (en) 2022-02-25

Family

ID=80304064

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111404934.8A Pending CN114090194A (en) 2021-11-24 2021-11-24 Method and device for realizing distributed transaction consistency

Country Status (1)

Country Link
CN (1) CN114090194A (en)

Similar Documents

Publication Publication Date Title
CN110968586B (en) Distributed transaction processing method and device
CN111277639B (en) Method and device for maintaining data consistency
CN112988883B (en) Database data synchronization method and device and storage medium
CN110888718A (en) Method and device for realizing distributed transaction
CN110727523B (en) Service request processing method, service request processing device and readable storage medium
CN112995262B (en) Distributed transaction submission method, system and computing equipment
JP4516594B2 (en) Message transmission control method, message transmission control device, and message transmission control program
CN114090194A (en) Method and device for realizing distributed transaction consistency
CN116128491A (en) Payment information determination method, device, system and electronic equipment
CN112954008B (en) Distributed task processing method and device, electronic equipment and storage medium
CN111625323A (en) Distributed task processing method, device, equipment and computer readable storage medium
CN112711466B (en) Hanging affair inspection method and device, electronic equipment and storage medium
CN115544034A (en) Data consistency method and service system
CN110795288B (en) Data acquisition method, device and storage medium
CN113010330A (en) Method and terminal for retrying micro-service request
CN107678840B (en) System, method and device for running tasks
CN116643733B (en) Service processing system and method
US11637749B1 (en) Metadata synchronization for remote managed systems
CN111008222A (en) Data state query method and device
CN116010126B (en) Service aggregation method, device and system
US20240152504A1 (en) Data interaction method, apparatus, and electronic device
JP2001306380A (en) Two-phase commitment evading system and its program recording medium
CN111741101A (en) Bank background system message pushing method and device
CN114066632A (en) Transaction retransmission method and device
CN113935841A (en) Transaction data processing method and bank-enterprise interconnection system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination