A cross-system distributed transaction processing method and system

By integrating distributed transaction solutions and incorporating them into distributed online transactions, configurability and alerting are achieved, solving the problem of business data consistency in distributed online transactions in the financial sector and improving R&D efficiency.

CN114153569BActive Publication Date: 2026-03-20CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-08
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing technologies in the financial sector present challenges in ensuring data consistency across multiple systems in distributed online transactions.

Method used

By integrating various distributed transaction solutions, distributed transactions are incorporated into distributed online transactions, enabling configurability and alarms for distributed transactions. The system employs synchronous rollback or retry processing, asynchronous rollback and retry processing, and alarms are triggered when the number of failures exceeds a threshold.

Benefits of technology

It solves the problem of transaction consistency in distributed online transactions, reduces the difficulty of achieving transaction consistency, and improves R&D efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114153569B_ABST
    Figure CN114153569B_ABST
Patent Text Reader

Abstract

The application discloses a cross-system distributed transaction processing method and system, relates to the field of big data processing, and comprises the following steps: calling a first online transaction service interface to obtain a first online transaction node record; recording a first online transaction execution state to the first online transaction node record; when the first online transaction execution state is online timeout or online transaction execution failure, performing transaction synchronization rollback or retry processing; when the transaction synchronization rollback fails, recording to transaction asynchronous rollback, and when the retry processing fails, recording to transaction asynchronous retry processing; when the number of times of transaction asynchronous rollback failure exceeds the preset maximum number of times of failure, performing failure alarm based on a preset alarm mode, and when the number of times of transaction asynchronous retry processing exceeds the preset maximum number of times of retry, performing abnormal alarm. The application solves the problem of business data consistency of the prior art distributed online transaction in the financial field when the distributed online transaction crosses multiple systems.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of big data processing, and in particular to a cross-system distributed transaction processing method and system. BACKGROUND

[0002] With the rapid development of the Internet, software systems have changed from monolithic applications to distributed applications. Distributed systems split an application system into multiple services that can be independently deployed. Therefore, services need to remotely collaborate with each other to complete transaction operations. In a distributed system environment, transactions are completed by different services remotely collaborating through a network, which is referred to as a distributed transaction.

[0003] However, the above method has at least the following technical problems:

[0004] The existing technology financial field distributed online transaction has a business data consistency problem when crossing multiple systems. SUMMARY

[0005] The embodiments of the present application provide a cross-system distributed transaction processing method and system, which solve the technical problem of the existing technology financial field distributed online transaction having a business data consistency problem when crossing multiple systems. The advantages of various distributed transaction schemes are integrated, and the distributed transaction is integrated into the distributed online transaction. The configurable distributed transaction and alarm, and the configurable distributed online transaction transaction rollback mode are achieved. The technical effects of solving the financial field distributed online transaction consistency problem, reducing the difficulty of the distributed online transaction consistency, and improving the research and development efficiency are achieved.

[0006] In view of the above problems, the present application is proposed to provide a method that overcomes the above problems or at least partially solves the above problems.

[0007] In a first aspect, the embodiments of the present application provide a cross-system distributed transaction processing method, the method comprising: obtaining a first online transaction service interface; obtaining a first call instruction, calling the first online transaction service interface by a first online transaction user according to the first call instruction, obtaining a first online transaction transaction node record, and storing data of the first online transaction transaction node record; obtaining a first online transaction transaction execution state according to a first online transaction response operation, recording the first online transaction transaction execution state to the first online transaction transaction node record; when the first online transaction transaction execution state is online timeout or online transaction execution failure, performing transaction synchronization rollback or retry processing; when the transaction synchronization rollback fails, recording to transaction asynchronous rollback, when the retry processing fails, recording to transaction asynchronous retry processing; configuring online transaction transaction parameter information; obtaining a preset maximum number of failures, a preset maximum number of retries, and a preset alarm mode according to the online transaction transaction parameter information; when the number of failures of the transaction asynchronous rollback exceeds the preset maximum number of failures, performing failure alarm based on the preset alarm mode, when the number of times of the transaction asynchronous retry processing exceeds the preset maximum number of retries, performing abnormal alarm based on the preset alarm mode.

[0008] In another aspect, the application also provides a cross-system distributed transaction processing system, comprising: a first obtaining unit configured to obtain a first online transaction service interface; a first calling unit configured to obtain a first calling instruction, call the first online transaction service interface by an online transaction user according to the first calling instruction, obtain a first online transaction transaction node record, and store data of the first online transaction transaction node record; a first recording unit configured to obtain a first online transaction transaction execution state according to a first online transaction response operation, and record the first online transaction transaction execution state to the first online transaction transaction node record; a first processing unit configured to perform transaction synchronization rollback or retry processing when the first online transaction transaction execution state is online timeout or online transaction execution failure; a second recording unit configured to record to transaction asynchronous rollback when the transaction synchronization rollback fails, and record to transaction asynchronous retry processing when the retry processing fails; a first configuration unit configured to configure online transaction transaction parameter information; a second obtaining unit configured to obtain a preset maximum number of failures, a preset maximum number of retries, and a preset alarm mode according to the online transaction transaction parameter information; and a first alarm unit configured to perform failure alarm based on the preset alarm mode when a number of failures of the transaction asynchronous rollback exceeds the preset maximum number of failures, and perform abnormal alarm based on the preset alarm mode when a number of times of the transaction asynchronous retry processing exceeds the preset maximum number of retries.

[0009] In a third aspect, an electronic device is provided, which includes a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and capable of running on the processor. The transceiver, the memory, and the processor are connected through the bus. The computer program, when executed by the processor, implements the steps in the method of controlling output data according to any one of the preceding aspects.

[0010] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program. The computer program, when executed by a processor, implements the steps in the method of controlling output data according to any one of the preceding aspects.

[0011] The one or more technical solutions provided in the embodiments of the application have at least the following technical effects or advantages:

[0012] According to the first calling instruction, the first online transaction service interface is called by the online transaction user, the first online transaction node record is obtained, and the first online transaction node record is stored; according to the first online transaction response operation, the first online transaction execution state is obtained, the first online transaction execution state is recorded to the first online transaction node record; when the first online transaction execution state is online timeout or online transaction execution failure, transaction synchronization rollback or retry processing is performed; when the transaction synchronization rollback fails, it is recorded in the transaction asynchronous rollback, when the retry processing fails, it is recorded in the transaction asynchronous retry processing; when the number of failures of the transaction asynchronous rollback exceeds the preset maximum number of failures, the preset alarm mode is used for failure alarm, when the number of times of the transaction asynchronous retry processing exceeds the preset maximum number of retries, the preset alarm mode is used for abnormal alarm. Further, by integrating the advantages of various distributed transaction schemes, the distributed transaction is integrated into the distributed online transaction, the configurability of the distributed transaction and the alarm, the configurability of the distributed online transaction rollback mode are realized, the consistency problem of the distributed online transaction in the financial field is solved, the difficulty of the consistency of the distributed online transaction is reduced, and the technical effect of improving the research and development efficiency is achieved.

[0013] The above description is only a summary of the technical scheme of the present application. In order to more clearly understand the technical means of the present application, the following specific embodiments of the present application can be implemented according to the content of the specification, and in order to make the above and other purposes, characteristics and advantages of the present application more obvious and easy to understand, the following specific embodiments of the present application are described in detail. BRIEF DESCRIPTION OF DRAWINGS

[0014] Figure 1 A flowchart of a cross-system distributed transaction processing method according to an embodiment of the present application;

[0015] Figure 2 A structure diagram of a cross-system distributed transaction processing system according to an embodiment of the present application;

[0016] Figure 3 A structure diagram of an electronic device for executing a method of controlling output data according to an embodiment of the present application.

[0017] Explanation of reference numerals: first obtaining unit 11, first calling unit 12, first recording unit 13, first processing unit 14, second recording unit 15, first configuration unit 16, second obtaining unit 17, first alarm unit 18, bus 1110, processor 1120, transceiver 1130, bus interface 1140, memory 1150, operating system 1151, application program 1152 and user interface 1160. DETAILED DESCRIPTION

[0018] In the description of the embodiments of the present application, those skilled in the art shall understand that the embodiments of the present application can be implemented as a method, an apparatus, an electronic device and a computer readable storage medium. Therefore, the embodiments of the present application can be specifically implemented as follows: complete hardware, complete software (including firmware, resident software, microcode, etc.), and a combination of hardware and software. In addition, in some embodiments, the embodiments of the present application can also be implemented as a computer program product in one or more computer readable storage media, which includes computer program code.

[0019] The computer readable storage medium described above can adopt any combination of one or more computer readable storage media. The computer readable storage medium includes an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or component, or any combination thereof. More specific examples of the computer readable storage medium include a portable computer diskette, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, a flash memory, an optical fiber, an optical disk only read memory, an optical storage device, a magnetic storage device or any combination thereof. In the embodiments of the present application, the computer readable storage medium can be any tangible medium containing or storing a program that can be used or combined with an instruction execution system, device or component.

[0020] The embodiments of the present application provide the method, apparatus and electronic device described by the flowchart and / or block diagram.

[0021] It should be understood that each block of the flowchart and / or block diagram and combinations thereof can be implemented by computer readable program instructions. These computer readable program instructions can be provided to a processor of a general purpose computer, a special purpose computer, or other programmable data processing apparatus, so as to produce a machine, so that the computer readable program instructions executed by the computer or other programmable data processing apparatus produce an apparatus that implements the functions / operations specified in the block of the flowchart and / or block diagram.

[0022] These computer readable program instructions can also be stored in a computer readable storage medium that can cause a computer or other programmable data processing apparatus to work in a specific manner. Thus, the instructions stored in the computer readable storage medium produce an instruction apparatus product that includes the functions / operations specified in the block of the flowchart and / or block diagram.

[0023] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable data processing apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0024] Embodiments of the present application are described below with reference to the accompanying drawings.

[0025] Example One

[0026] As shown in Figure 1 The embodiments of the present application provide a cross-system distributed transaction processing method, and the method comprises the following steps.

[0027] Step S100: obtaining a first online transaction service interface;

[0028] Specifically, with the rapid development of the Internet, software systems are transformed from monolithic applications to distributed applications. A distributed system splits an application system into multiple services that can be independently deployed. Therefore, remote collaboration between services is required to complete transaction operations. In a distributed system environment, transactions are completed by remote collaboration between different services through a network, which is referred to as a distributed transaction. For example, a user registration and point transaction, a create order and reduce inventory transaction, and a bank transfer transaction are all distributed transactions. Online transactions mean transactions directly provided by a system to the outside. Such transactions have transactional properties, can be rolled back, have real-time properties, have a transaction life cycle, have a timeout mechanism, and the like. A calling party needs to wait for feedback from a called party in real time, and feedback is provided for both success and failure. A transaction can be simultaneously called by multiple threads of the same type or even the same transaction, and there is a lock processing mechanism between transactions. For example, a withdrawal transaction, balance query (which can occur in a situation of insufficient balance), update, transaction flow generation, account usage record generation, and accounting voucher generation. The first online transaction service interface is a business / function service interface provided by an online transaction service party to the outside. There is a business logic relationship between systems or functions. For example, in an ERP system, after purchase and warehousing, a warehouse entry order is generated, and the available quantity is affected. There is an upstream and downstream relationship between interfaces in terms of business logic. Cross-system or module logic control and reverse operations can be involved.

[0029] Step S200: obtaining a first calling instruction, calling, by an online transaction user, the first online transaction service interface according to the first calling instruction, obtaining a first online transaction transaction node record, and storing data of the first online transaction transaction node record;

[0030] Specifically, when the online transaction user calls the online transaction, the first online transaction service interface is called according to the first call instruction, and a first online transaction node record is obtained. The first online transaction node record is used to record the information of the request calling party, server information, request timestamp, request global unique identifier, message content, the step to which the current online transaction belongs (when a plurality of online transactions are dependent on each other in an online transaction, the execution step to which each online transaction belongs), rollback state, current online transaction transaction processing state and the like. The first online transaction node record is stored, for example, the online transaction request message is stored (in a relational database, a non-relational database, a file or the like) when the online transaction is called, so as to store the online transaction information data, which provides a rollback reference for transaction execution failure.

[0031] Step S300: obtaining a first online transaction execution state according to a first online transaction response operation, and recording the first online transaction execution state to the first online transaction node record;

[0032] Further, the first online transaction execution state includes online timeout, online transaction execution exception, online transaction execution success / failure.

[0033] Specifically, the first online transaction service interface is called by the online transaction user, and a first online transaction execution state is obtained according to a first online transaction response operation, i.e., an operation that needs to be responded by a business / function service interface, such as an order microservice and an inventory microservice operation. The first online transaction execution state includes online timeout, online transaction execution exception, online transaction execution success / failure, online timeout, i.e., network connection timeout, which means that no response is obtained from the server within the default waiting time of the program. The possible reasons for network connection timeout include network disconnection, network congestion, unstable network and system problems. The online transaction execution exception is an exception handled by the online service provider, which refers to some abnormal events occurring in the program running process, such as division by zero overflow, array index out of bounds, non-existent file to be read and the like. The online transaction execution success / failure is the success / failure handled by the online service provider. The first online transaction execution state is recorded in the data of the first online transaction node record, so as to store the online transaction execution state information data, which provides a rollback reference for subsequent transaction execution failure.

[0034] Step S400: when the first online transaction execution state is online timeout or online transaction execution failure, transaction synchronization rollback or retry processing is performed;

[0035] Step S500: When the transaction synchronous rollback fails, record it in the transaction asynchronous rollback; when the retry processing fails, record it in the transaction asynchronous retry processing.

[0036] Specifically, a transaction is a collection of related database operations. Therefore, a transaction is only considered committed when all operations within it are completed successfully. If any operation fails, the database reverts to its state before the operation began; this is called transaction rollback. For example, in a banking application that transfers funds from one account to another, one account credits a certain amount to a database table, while another account debits the same amount to a different database table. Because computers may malfunction due to power outages, network interruptions, etc., it's possible that rows in one table are updated but not in the other. If the database supports transactions, these operations can be grouped into a single transaction to prevent inconsistencies caused by such events. If a failure occurs at any point within the transaction, all updates can be rolled back to the state before the transaction began.

[0037] When the first online transaction execution status is online timeout or online transaction execution failure, real-time transaction synchronous rollback or retry processing is performed. Transaction synchronous rollback is synchronous thread rollback, and this operation is a real-time call. For example, the XA scheme is a distributed transaction protocol, which is roughly divided into two parts: a transaction manager and a local resource manager. The local resource manager is often implemented by the database, while the transaction manager, as a global scheduler, is responsible for the commit and rollback of each local resource. Its advantages are standardized interfaces, but its disadvantages are that it is a blocking protocol, affecting system throughput and scalability, resulting in unsatisfactory performance, making it difficult to meet the high concurrency requirements of the Internet, and lacking fault tolerance mechanisms. When the transaction synchronous rollback fails, it will be automatically recorded in the transaction asynchronous rollback processing. Asynchronous rollback is asynchronous thread rollback, such as MQ transactional messages, which is an asynchronous guaranteed implementation scheme that transforms synchronous blocking transactions into asynchronous ones, avoiding contention for database transactions. When the retry processing fails, it will be automatically recorded in the transaction asynchronous retry processing according to the configuration. By combining existing distributed schemes, distributed transactions are integrated into distributed online transactions.

[0038] Step S600: Configure online transaction parameter information;

[0039] Step S700: Based on the online transaction parameter information, obtain the preset maximum number of failures, the preset maximum number of retries, and the preset alarm method;

[0040] Specifically, the online transaction transaction is configured, and the online transaction transaction parameter information includes configuring an online transaction transaction scenario, a maximum number of times of rollback failure / retry failure, an alarm mode of rollback exception / retry exception, a synchronous rollback processing / asynchronous mode, and an interval time between each transaction rollback equal to transaction related parameter information. According to the online transaction transaction parameter information, a preset maximum number of failures, that is, a maximum number of set failures of the online transaction transaction rollback processing, a preset maximum number of retries, that is, a maximum number of set times of the online transaction transaction retry processing, and a preset alarm mode, that is, an alarm mode after exceeding the preset number of times. The advantages of each distributed transaction scheme are integrated, the configurability and alarm of distributed transaction are realized, and the configurability of the distributed online transaction transaction rollback mode is realized.

[0041] Step S800: When the number of failures of the transaction asynchronous rollback exceeds the preset maximum number of failures, failure alarm is performed based on the preset alarm mode, and when the number of times of the transaction asynchronous retry processing exceeds the preset maximum number of retries, exception alarm is performed based on the preset alarm mode.

[0042] Specifically, when the number of failures of the transaction asynchronous rollback exceeds the preset maximum number of failures, the preset alarm mode such as alarm email + mobile phone message and the like is used to remind the transaction failure alarm function, and at this time, manual access processing of the transaction can be performed according to the situation; when the number of times of the transaction asynchronous retry processing exceeds the preset maximum number of retries, the preset alarm mode such as alarm email + mobile phone message and the like is used to remind the transaction exception alarm function, and at this time, manual access processing of the transaction can be performed according to the situation. By integrating the advantages of each distributed transaction scheme, the distributed transaction is integrated into the distributed online transaction, the configurability and alarm of the distributed transaction are realized, the configurability of the distributed online transaction transaction rollback mode is realized, the consistency problem of the distributed online transaction in the financial field is solved, the consistency difficulty of the distributed online transaction is reduced, and the research and development efficiency is improved.

[0043] Further, the embodiment S300 of the application further comprises:

[0044] Step S310: obtaining an online transaction transaction scenario according to the online transaction transaction parameter information;

[0045] Step S320: when the first online transaction transaction execution state is online timeout or online transaction execution exception, the transaction synchronous rollback, the retry processing, the transaction asynchronous rollback, or the transaction asynchronous retry processing is performed according to the online transaction transaction scenario.

[0046] Specifically, according to the online transaction parameter information, an online transaction scenario is configured, such as creating an order in an e-commerce platform: reserving inventory, pre-deducting points, and locking a coupon; creating a payment order in a payment platform (selecting bank card payment): querying an account and querying a restriction rule, and if the condition is met, creating a payment order and jumping to a bank; creating a transaction order in a bank platform: finding an account, creating a transaction record, judging an account balance and deducting money, increasing points, and notifying a payment platform; the payment platform receiving a bank deduction result: changing an order state, adding money to an account, increasing points in a point account, generating an accounting entry, and notifying an e-commerce platform; the e-commerce platform receiving a payment result from the payment platform: changing an order state, deducting inventory, deducting points, using a coupon, and increasing consumption points. When the first online transaction execution state is online timeout or online transaction execution exception, transaction synchronous rollback / retry processing or transaction asynchronous rollback / retry processing is needed according to the online transaction scenario, that is, a specific actual scenario. The rollback and retry of the transaction are automatically performed in the development framework, which reduces the development difficulty of the distributed transaction, improves the development efficiency, improves the robustness of the distributed transaction, and reduces the overall difficulty of the distributed online transaction.

[0047] Further, the embodiment of the application further includes:

[0048] Step S910: according to the asynchronous MQ message or the first online transaction node record, performing the transaction asynchronous rollback.

[0049] Specifically, the asynchronous processing of the transaction rollback is realized by scanning the data of the first online transaction node record in the data storage through an asynchronous MQ message or a timing task. The MQ (Message Queue) is a communication method of application to application, and the application communicates by reading and writing the messages in and out of the queue. The publisher and the consumer do not need to know the existence of each other. The asynchronous MQ message is sent asynchronously, and the message sender does not need to wait for the message consumer to process the message, or even does not need to wait for the message to be delivered before continuing to send the message. This is because the message sender defaults that the message receiver can eventually receive the message and process it. For example, the payment result notification of Alipay and WeChat has the advantages of not needing to wait, being message-oriented and decoupled, and being location-independent. The asynchronous processing greatly saves the request response time of the server, thereby improving the throughput of the system.

[0050] Further, the step S910 of the embodiment of the application further includes:

[0051] Step S911: obtaining a first call trigger step;

[0052] Step S912: obtaining a first rollback sequence according to the first call trigger step;

[0053] Step S913: According to the first rollback order, the transaction is asynchronously rolled back.

[0054] Specifically, the transaction is asynchronously rolled back according to the first call trigger step, that is, the step in which the current call is triggered, and the transaction is asynchronously rolled back in the first rollback order, that is, a backward rollback operation is performed. For example, in online transactions, steps A, B, C, and D depend on each other. The rollback order is D, C, B, and A. The transaction rollback is automatically performed in the development framework, the development difficulty of the distributed transaction is reduced, the development efficiency is improved, the request response time of the server is saved, and the overall difficulty of the distributed online transaction is reduced.

[0055] Further, the step of the embodiment of the application further comprises:

[0056] Step S921: A second call instruction is obtained, and the transaction is synchronously rolled back according to the second call instruction;

[0057] Step S922: Based on the online transaction parameter information, the transaction synchronous rollback is processed.

[0058] Specifically, the asynchronous rollback processing can call the transaction synchronous rollback processing according to the second call instruction, determine the maximum number of allowed rollbacks and the rollback time interval based on the online transaction parameter information, and send an alarm email and a mobile phone message if the number of failures of the online transaction rollback processing exceeds the set maximum number, so as to realize the transaction failure alarm function. At this time, manual intervention can be performed to process the transaction according to the situation. The distributed transaction rollback, transaction retry diversification, distributed transaction configurability and alarm, distributed online transaction rollback mode configurability are realized, the consistency problem of the distributed online transaction in the financial field is solved, the consistency difficulty of the distributed online transaction is reduced, and the research and development efficiency is improved.

[0059] Further, the step S922 of the embodiment of the application further comprises:

[0060] Step S9221: A third call instruction is obtained according to the transaction asynchronous retry processing, and the third call instruction re-calls the first online transaction service interface;

[0061] Step S9222: Based on the online transaction parameter information, the first online transaction service interface is processed.

[0062] Specifically, if the transaction asynchronous retry processing is adopted, the calling of the first online transaction service interface is reinitiated according to the third calling instruction, and the first online transaction service interface is processed based on the configured online transaction parameter information, and the subsequent process is automatically started. The advantages of various distributed transaction schemes are integrated, the configurability of transaction rollback and transaction retry is realized, the consistency problem of distributed online transaction in the financial field is solved, the consistency difficulty of distributed online transaction is reduced, and the research and development efficiency is improved.

[0063] In summary, the cross-system distributed transaction processing method and system provided by the embodiments of the present application have the following technical effects:

[0064] Due to the adoption of the first calling instruction, the online transaction user calls the first online transaction service interface, obtains the first online transaction transaction node record, and stores the data of the first online transaction transaction node record; the first online transaction response operation obtains the first online transaction execution state, records the first online transaction execution state to the first online transaction transaction node record; when the first online transaction execution state is online timeout or online transaction execution failure, transaction synchronous rollback or retry processing is performed; when the transaction synchronous rollback fails, it is recorded in the transaction asynchronous rollback, when the retry processing fails, it is recorded in the transaction asynchronous retry processing; when the number of failures of the transaction asynchronous rollback exceeds the preset maximum number of failures, failure alarm is performed based on the preset alarm mode, when the number of times of the transaction asynchronous retry processing exceeds the preset maximum number of retries, abnormal alarm is performed based on the preset alarm mode. In order to achieve the technical effects of integrating the advantages of various distributed transaction schemes, integrating distributed transactions into distributed online transactions, realizing the configurability of distributed transactions and alarm, the configurability of distributed online transaction rollback mode, solving the consistency problem of distributed online transactions in the financial field, reducing the consistency difficulty of distributed online transactions, and improving the research and development efficiency.

[0065] Example Two

[0066] Based on the same inventive concept as the cross-system distributed transaction processing method in the foregoing embodiments, the present application also provides a cross-system distributed transaction processing system, as shown in Figure 2 The system comprises:

[0067] A first obtaining unit 11 is configured to obtain a first online transaction service interface;

[0068] The first calling unit 12 is configured to obtain a first calling instruction, call the first online transaction service interface according to the first calling instruction, obtain a first online transaction transaction node record, and store the first online transaction transaction node record;

[0069] The first recording unit 13 is configured to obtain a first online transaction transaction execution state according to a first online transaction response operation, and record the first online transaction transaction execution state to the first online transaction transaction node record.

[0070] The first processing unit 14 is configured to perform transaction synchronization rollback or retry processing when the first online transaction transaction execution state is online timeout or online transaction execution failure.

[0071] The second recording unit 15 is configured to record in transaction asynchronous rollback when the transaction synchronization rollback fails, and record in transaction asynchronous retry processing when the retry processing fails.

[0072] The first configuration unit 16 is configured to configure online transaction transaction parameter information.

[0073] The second obtaining unit 17 is configured to obtain a preset maximum number of failures, a preset maximum number of retries, and a preset alarm mode according to the online transaction transaction parameter information.

[0074] The first alarm unit 18 is configured to perform failure alarm based on the preset alarm mode when the number of failures of the transaction asynchronous rollback exceeds the preset maximum number of failures, and perform abnormal alarm based on the preset alarm mode when the number of times of the transaction asynchronous retry processing exceeds the preset maximum number of retries.

[0075] Further, the system further comprises:

[0076] The third obtaining unit is configured to obtain an online transaction transaction scenario according to the online transaction transaction parameter information.

[0077] The second processing unit is configured to perform the transaction synchronization rollback, the retry processing, the transaction asynchronous rollback, or the transaction asynchronous retry processing according to the online transaction transaction scenario when the first online transaction transaction execution state is online timeout or online transaction execution exception.

[0078] Further, the system further comprises:

[0079] A third processing unit is configured to perform the transaction asynchronous rollback according to the asynchronous MQ message or the first online transaction transaction node record.

[0080] Further, the system further comprises:

[0081] A fourth obtaining unit is configured to obtain a first call trigger step;

[0082] A fifth obtaining unit is configured to obtain a first rollback order according to the first call trigger step;

[0083] A fourth processing unit is configured to perform the transaction asynchronous rollback according to the first rollback order.

[0084] Further, the system further comprises:

[0085] A second calling unit is configured to obtain a second call instruction, and call the transaction synchronous rollback according to the second call instruction;

[0086] A fifth processing unit is configured to process the transaction synchronous rollback based on the online transaction transaction parameter information.

[0087] Further, the system further comprises:

[0088] A third calling unit is configured to obtain a third call instruction according to the transaction asynchronous retry processing, and the third call instruction re-calls the first online transaction service interface;

[0089] A sixth processing unit is configured to process the first online transaction service interface based on the online transaction transaction parameter information.

[0090] The foregoing Figure 1 The various variations and specific examples of the cross-system distributed transaction processing method in Embodiment One are also applicable to the cross-system distributed transaction processing system in this embodiment. Through the foregoing detailed description of the cross-system distributed transaction processing method, those skilled in the art can clearly understand the implementation method of the cross-system distributed transaction processing system in this embodiment. Therefore, in order to make the description concise, the detailed description is not repeated here.

[0091] Further, the embodiment of the present application also provides an electronic device, comprising a bus, a transceiver, a memory, a processor and a computer program stored in the memory and capable of running on the processor, the transceiver, the memory and the processor are connected through the bus respectively, the computer program is executed by the processor to realize each process of the method for controlling output data and achieve the same technical effects, to avoid repetition, details are not described herein.

[0092] Exemplary electronic device

[0093] Specifically, referring to Figure 3 The embodiment of the present application also provides an electronic device, the electronic device comprising a bus 1110, a processor 1120, a transceiver 1130, a bus interface 1140, a memory 1150 and a user interface 1160.

[0094] In the embodiment of the present application, the electronic device further comprises a computer program stored in the memory 1150 and capable of running on the processor 1120, the computer program is executed by the processor 1120 to realize each process of the method for controlling output data.

[0095] The transceiver 1130 is used for receiving and sending data under the control of the processor 1120.

[0096] In the embodiment of the present application, the bus architecture (represented by the bus 1110) can include any number of interconnected buses and bridges, and the bus 1110 connects various circuits including one or more processors represented by the processor 1120 and the memory represented by the memory 1150 together.

[0097] The bus 1110 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. As an example and not by way of limitation, such architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Extended ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus.

[0098] The processor 1120 can be an integrated circuit chip having signal processing capability. In the implementation process, the steps of the above method embodiments can be completed by the integrated logic circuit or the instructions in the form of software in the processor. The above processor includes: general processor, central processing unit, network processor, digital signal processor, application specific integrated circuit, field programmable gate array, complex programmable logic device, programmable logic array, micro control unit or other programmable logic device, discrete gate, transistor logic device, discrete hardware component. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. For example, the processor can be a single-core processor or a multi-core processor, and the processor can be integrated into a single chip or located in multiple different chips.

[0099] The processor 1120 can be a microprocessor or any conventional processor. The method steps disclosed in combination with the embodiments of the present application can be directly executed by the hardware decoding processor, or executed by the combination of hardware and software modules in the decoding processor. The software modules can be located in the readable storage medium known in the art, such as random access memory, flash memory, read only memory, programmable read only memory, erasable programmable read only memory, register, etc. The readable storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with the hardware thereof.

[0100] The bus 1110 can also connect various other circuits or devices such as peripheral devices, voltage stabilizers or power management circuits together, and the bus interface 1140 provides an interface between the bus 1110 and the transceiver 1130, which are well known in the art. Therefore, the embodiments of the present application will not be further described.

[0101] The transceiver 1130 can be one element or multiple elements, such as multiple receivers and transmitters, which provide units for communicating with various other devices on the transmission medium. For example: the transceiver 1130 receives external data from other devices, and the transceiver 1130 is used to send data processed by the processor 1120 to other devices. Depending on the nature of the computer device, a user interface 1160 can also be provided, such as: touch screen, physical keyboard, display, mouse, speaker, microphone, trackball, joystick, stylus.

[0102] It is to be understood that the memory 1150 in the embodiments of the present application can further include a memory remotely located with respect to the processor 1120, which can be connected to a server through a network. One or more portions of the above-mentioned network can be a self-organizing network, an intranet, an extranet, a virtual private network, a local area network, a wireless local area network, a wide area network, a wireless wide area network, a metropolitan area network, the Internet, a public switched telephone network, a plain old telephone service network, a cellular telephone network, a wireless network, a Wi-Fi network, and a combination of two or more of the above-mentioned networks. For example, the cellular telephone network and the wireless network can be a global system for mobile communications, a code division multiple access device, a worldwide interoperability for microwave access device, a universal mobile telecommunications system device, a wideband code division multiple access device, a long term evolution device, an LTE frequency division duplex device, an LTE time division duplex device, an advanced long term evolution device, a universal mobile telecommunications system device, an enhanced mobile broadband device, a massive machine type communications device, an ultra-reliable low-latency communications device, and the like.

[0103] It is to be understood that the memory 1150 in the embodiments of the present application can be a volatile memory or a nonvolatile memory, or can include both a volatile memory and a nonvolatile memory. The nonvolatile memory includes a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, or a flash memory.

[0104] The volatile memory includes a random access memory used as an external cache. By way of example, and not limitation, many forms of RAM are available, for example, a static random access memory, a dynamic random access memory, a synchronous dynamic random access memory, a double data rate synchronous dynamic random access memory, an enhanced synchronous dynamic random access memory, a synchburst dynamic random access memory, and a direct memory bus random access memory. The memory 1150 of the electronic device described in the embodiments of the present application includes, but is not limited to, the above-mentioned and any other suitable type of memory.

[0105] In the embodiments of the present application, the memory 1150 stores an operating system 1151 and an application 1152 including the following elements: an executable module, a data structure, or a subset or an extended set thereof.

[0106] Specifically, the operating system 1151 includes various device programs, for example, a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and processing hardware-based tasks. The application 1152 includes various applications, for example, a media player, a browser, for implementing various application services. The program implementing the method of the embodiments of the present application can be included in the application 1152. The application 1152 includes applets, objects, components, logic, data structures, and other computer device executable instructions performing specific tasks or implementing specific abstract data types.

[0107] Further, the embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement each process of the above-mentioned method for controlling output data, and can achieve the same technical effects. To avoid repetition, it will not be repeated here.

[0108] The above is only a specific implementation of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be subject to the protection scope of the claims.

Claims

1. A cross-system distributed transaction processing method, characterized in that, The method includes: Obtain the first online transaction service interface; A first invocation instruction is obtained, and the online transaction user invokes the first online transaction service interface according to the first invocation instruction to obtain the first online transaction transaction node record and store the first online transaction transaction node record. The execution status of the first online transaction is obtained based on the response operation of the first online transaction, and the execution status of the first online transaction is recorded in the record of the first online transaction node. The execution status of the first online transaction includes: online timeout, online transaction execution error, and online transaction execution success / failure. When the execution status of the first online transaction is online timeout or online transaction execution failure, transaction synchronization rollback or retry processing is performed; When the transaction synchronous rollback fails, it is recorded in the transaction asynchronous rollback; when the retry processing fails, it is recorded in the transaction asynchronous retry processing. Configure online transaction parameters; Based on the online transaction parameter information, obtain the preset maximum number of failures, the preset maximum number of retries, and the preset alarm method; When the number of failed asynchronous rollbacks of the transaction exceeds the preset maximum number of failures, a failure alarm is triggered based on the preset alarm method. When the number of asynchronous retry processing of the transaction exceeds the preset maximum number of retryes, an anomaly alarm is triggered based on the preset alarm method. The step of obtaining the execution status of the first online transaction based on the first online transaction response operation and recording the execution status of the first online transaction to the first online transaction node record includes: Based on the online transaction parameter information, the online transaction scenario is obtained; When the execution status of the first online transaction is online timeout or online transaction execution abnormal, the transaction is rolled back synchronously or retried, or the transaction is rolled back asynchronously or retried asynchronously, depending on the online transaction scenario.

2. The method as described in claim 1, characterized in that, The method includes: The transaction is asynchronously rolled back based on the asynchronous MQ message or the record of the first online transaction node.

3. The method as described in claim 2, characterized in that, The method includes: Obtain the first call trigger step; Based on the first call triggering step, the first rollback order is obtained; The transaction is asynchronously rolled back according to the first rollback order.

4. The method as described in claim 2, characterized in that, The method includes: Obtain the second invocation instruction, and invoke the transaction synchronous rollback according to the second invocation instruction; Based on the online transaction parameter information, the transaction is synchronously rolled back.

5. The method as described in claim 4, characterized in that, The method includes: A third invocation instruction is obtained based on the asynchronous retry processing of the transaction, and the third invocation instruction re-invokes the first online transaction service interface; Based on the online transaction parameter information, the first online transaction service interface is processed.

6. A cross-system distributed transaction processing system, characterized in that, The system includes: The first obtaining unit is used to obtain the first online transaction service interface; The first calling unit is used to obtain a first calling instruction, and according to the first calling instruction, the online transaction user calls the first online transaction service interface to obtain the first online transaction transaction node record and store the first online transaction transaction node record. The first recording unit is used to obtain the execution status of the first online transaction based on the first online transaction response operation, and record the execution status of the first online transaction to the first online transaction node record. The execution status of the first online transaction includes: online timeout, online transaction execution error, and online transaction execution success / failure. The first processing unit is used to perform transaction synchronization rollback or retry processing when the execution status of the first online transaction is online timeout or online transaction execution failure. The second recording unit is used to record the transaction asynchronous rollback when the transaction synchronous rollback fails, and to record the transaction asynchronous retry processing when the retry processing fails. A first configuration unit, which is used to configure online transaction parameter information; The second obtaining unit is used to obtain the preset maximum number of failures, the preset maximum number of retries, and the preset alarm method based on the online transaction parameter information. The first alarm unit is used to issue a failure alarm based on the preset alarm method when the number of failed asynchronous rollbacks of the transaction exceeds the preset maximum number of failures, and to issue an abnormal alarm based on the preset alarm method when the number of asynchronous retry processing of the transaction exceeds the preset maximum number of retryes. The system also includes: The third obtaining unit is used to obtain the online transaction scenario based on the online transaction parameter information; The second processing unit is configured to perform synchronous rollback, retry processing, or asynchronous rollback and asynchronous retry processing of the transaction according to the online transaction scenario when the execution status of the first online transaction is online timeout or online transaction execution abnormal.

7. A cross-system distributed transaction processing electronic device, comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory, and the processor are connected via the bus, characterized in that, When the computer program is executed by the processor, it implements the steps of the method as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-5.

9. A computer program product, comprising a computer program and / or instructions, characterized in that, When the computer program and / or instructions are executed by a processor, they implement the steps of the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Distributed transaction processing method, device and system

    CN106502769A

  • Data processing method, system and device, electronic equipment and computer storage medium

    CN113420035A