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

By introducing the transaction status table in the bank transaction system to record the status information of transaction transactions, the problem of difficulty in achieving transaction consistency in distributed systems is solved, and the efficiency and consistency of transaction processing are improved.

CN118796364APending Publication Date: 2024-10-18CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410801873.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Under the distributed transaction framework, the existing bank transaction system is difficult to maintain the consistency of transaction transactions, resulting in long transaction processing times and inconsistent results. The existing methods are difficult to design and have low implementation efficiency.

Method used

Introduce the transaction status table into the bank transaction system to record the status information of the transactions that have been executed or are being executed. The transaction status table is used to determine the execution order and status of the transaction transactions, thereby ensuring the consistency of the transaction transactions.

Benefits of technology

It reduces the design difficulty of achieving transaction transaction consistency, improves implementation efficiency, and avoids the problem of inconsistent transaction results caused by the completion of offset transactions before the positive transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796364A_ABST
    Figure CN118796364A_ABST
Patent Text Reader

Abstract

The invention provides a transaction processing method and device, equipment, a medium and a program product. Relates to the technical field of big data. The method comprises the following steps: in response to a target transaction transaction triggered by an upstream system, determining whether to execute the target transaction transaction according to a transaction state table; the type of the target transaction comprises a reversal transaction and a positive transaction, and the transaction state table is used for recording the state information of the executed or currently executed transaction; when it is determined that the target transaction transaction is executed, executing the target transaction transaction; and after the target transaction transaction is executed, updating the transaction state corresponding to the type of the target transaction transaction into execution success in the state information of the target transaction transaction in the transaction state table. According to the method provided by the invention, the design difficulty of keeping the consistency of transactions is reduced, and the implementation efficiency is improved.
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 technology, and in particular to a transaction processing method, device, equipment, medium and program product. Background Art

[0002] Due to the complexity of banking transaction systems, most systems use a distributed transaction framework to process transactions. Transactions include positive transactions and reversal transactions. Usually, positive transactions are processed before reversal transactions to ensure the normal operation of the system and the accuracy of data. When a banking transaction system completes a business function under a distributed transaction framework, it needs to cross multiple service components and operate multiple databases. It may happen that the positive transaction is sent before the reversal transaction, which may easily cause the reversal transaction to be processed before the positive transaction, or the positive transaction takes a long time to process due to backtracking, etc., and the reversal transaction is processed before the positive transaction is completed, resulting in inconsistent transaction results.

[0003] At present, the Simple Extensible Autonomous Transaction Architecture (SEATA) is commonly used in distributed transaction systems of banks. The consistency of transactions is achieved by splitting the business model into a pre-commit phase and a commit phase. In the pre-commit phase, it is confirmed that all transactions can be processed before executing the commit phase to achieve transaction consistency. When implementing, developers need to consider how to split the business into two phases and implement the logic code of multiple interfaces according to the split phases, which is difficult to implement. Moreover, for systems that were not designed in a two-stage split in the early stage, if they need to be expanded according to this method, developers need to redesign and reconstruct the system. Therefore, the method of maintaining transaction consistency in existing distributed systems is difficult to design and has low implementation efficiency. Summary of the invention

[0004] The present application provides a transaction processing method, apparatus, device, medium and program product to solve the problem that the method for maintaining transaction consistency in a distributed system in the prior art is difficult to design and has low implementation efficiency.

[0005] In a first aspect, the present application provides a transaction processing method, comprising: in response to a target transaction triggered by an upstream system, determining whether to execute the target transaction according to a transaction status table; the types of the target transaction include: a reversal transaction and a positive transaction, the transaction status table is used to record status information of the transaction that has been executed or is being executed, and the status information at least includes: an identifier of the transaction, a reversal transaction status of the transaction, and a positive transaction status of the transaction;

[0006] When it is determined to execute the target transaction, executing the target transaction;

[0007] After the target transaction is executed, the transaction status corresponding to the type of the target transaction is updated to successful execution in the status information of the target transaction in the transaction status table.

[0008] In a possible design, determining whether to execute the target transaction according to the transaction status table includes:

[0009] Determining whether the target transaction is a reversal transaction;

[0010] In the case where the target transaction is a reversal transaction, determining whether status information of the target transaction exists in the transaction status table;

[0011] If so, determining whether to execute the target transaction according to the reversal transaction status in the status information of the target transaction recorded in the transaction status table;

[0012] If it does not exist, insert the status information of the target transaction into the transaction status table, and determine whether to execute the target transaction according to the result of whether the insertion is successful;

[0013] When determining to execute the target transaction, executing the target transaction includes:

[0014] When it is determined to execute the target transaction, the target transaction is executed, and the reversal transaction status corresponding to the target transaction is updated to being executed in the status information of the target transaction.

[0015] In a possible design, determining whether to execute the target transaction according to a result of whether the insertion is successful includes:

[0016] If the insertion is successful, then the target transaction is determined to be executed;

[0017] If the insertion fails due to repeated insertion of the state information of the target transaction, whether to execute the target transaction is determined according to the reversal transaction state in the state information of the target transaction recorded in the transaction state table.

[0018] In a possible design, determining whether to execute the target transaction according to the reversal transaction status in the status information of the target transaction recorded in the transaction status table includes:

[0019] If the reversal transaction status in the status information of the target transaction recorded in the transaction status table is a success status, determining not to execute the target transaction;

[0020] If the reversal transaction status in the status information of the target transaction recorded in the transaction status table is not a success status, it is determined to execute the target transaction.

[0021] In a possible design, determining whether to execute the target transaction according to the transaction status table includes:

[0022] Determining whether the target transaction is a reversal transaction;

[0023] In the case where the target transaction is not a reversal transaction, determining whether there is status information of the target transaction in the transaction status table;

[0024] If so, determining whether to execute the target transaction according to the reversal transaction status and the positive transaction status in the status information of the target transaction recorded in the transaction status table;

[0025] If not, determine to execute the target transaction.

[0026] In a possible design, determining whether to execute the target transaction according to the reversal transaction status and the positive transaction status in the status information of the target transaction recorded in the transaction status table includes:

[0027] Determine whether the reversal transaction status in the status information of the target transaction recorded in the transaction status table is a success status or an executing status;

[0028] If yes, determine not to execute the target transaction;

[0029] If not, determining whether the positive transaction status in the status information of the target transaction recorded in the transaction status table is successful execution;

[0030] If yes, determine not to execute the target transaction;

[0031] If not, determine to execute the target transaction.

[0032] In a possible design, after the target transaction is executed, updating the transaction status corresponding to the type of the target transaction in the status information of the target transaction in the transaction status table to successful execution includes:

[0033] Determining whether the target transaction is successfully executed;

[0034] If the target transaction is successfully executed, determining whether the target transaction is a reversal transaction;

[0035] If the target transaction is a reversal transaction, updating the reversal transaction status of the target transaction in the status information of the target transaction in the transaction status table to successful execution;

[0036] If not, determining whether there is status information of the target transaction in the transaction status table;

[0037] If the status information of the target transaction exists in the transaction status table and the reversal transaction status is the initial state, the positive transaction status of the target transaction is updated to be executed successfully; if the status information of the target transaction does not exist in the transaction status table, the status information of the target transaction is inserted into the transaction status table and the positive transaction status of the target transaction is updated to be executed successfully;

[0038] If the status information of the target transaction exists in the transaction status table, and the reversal transaction status is a non-initial state, the transaction status table is not updated.

[0039] In a second aspect, the present application provides a transaction processing device, including:

[0040] A pre-processing module, configured to respond to a target transaction triggered by an upstream system and determine whether to execute the target transaction according to a transaction status table; the types of the target transaction include: reversal transaction and regular transaction, the transaction status table is configured to record status information of the executed or currently executed transaction, the status information at least including: an identifier of the transaction, a reversal transaction status of the transaction, and a regular transaction status of the transaction;

[0041] An execution module, configured to execute the target transaction when determining to execute the target transaction;

[0042] A post-processing module is used to update the transaction status corresponding to the type of the target transaction to successful execution in the status information of the target transaction in the transaction status table after the target transaction is executed.

[0043] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0044] The memory stores computer-executable instructions;

[0045] The processor executes the computer-executable instructions stored in the memory to implement the transaction processing method as described in the first aspect and various possible designs of the first aspect.

[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the transaction processing method described in the first aspect and various possible designs of the first aspect is implemented.

[0047] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the transaction processing method described in the first aspect and various possible designs of the first aspect.

[0048] The transaction processing method, device, equipment, medium and program product provided by the present application add a transaction status table to the bank transaction system, and record the status information of the executed or executing transaction affairs through the transaction status table, so that the execution order and execution status of the reversal transaction and the positive transaction of the transaction affairs can be obtained when processing the transaction affairs, so as to determine the way to process the transaction affairs according to the execution order to maintain the consistency of the transaction affairs. Based on the method of the present application, for the bank transaction system that has not achieved the consistency of transactions in the early stage, there is no need to redesign and split the transaction business and reconstruct the bank transaction system. It is only necessary to add the processing logic of the transaction table in the bank transaction system to achieve the consistency of the transaction, which reduces the design difficulty of maintaining the consistency of the transaction affairs and improves the efficiency of implementation. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0050] Figure 1 A flowchart of a transaction processing method provided in an embodiment of the present application;

[0051] Figure 2 A flowchart of a transaction processing method in a pre-processing stage of a banking transaction system provided in an embodiment of the present application;

[0052] Figure 3 A flowchart of a transaction processing method in a post-processing stage of a banking transaction system provided in an embodiment of the present application;

[0053] Figure 4 A schematic diagram of the structure of a transaction processing device provided in an embodiment of the present application;

[0054] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0055] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0056] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0057] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.

[0058] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0059] Transaction consistency means that in a distributed system, when multiple transactions are executed simultaneously, the distributed system can ensure that a consistent state is reached in the end, that is, the consistency of the data after the transaction processing. On the contrary, inconsistent transaction processing order may lead to inconsistent final processing results, that is, inconsistent transactions. A distributed system is a system that uses a distributed transaction framework to process transactions.

[0060] A transaction system is a system for processing transaction services. A bank transaction system refers to a system used in a bank to process transaction services, such as transfers, loans, and other services. A bank transaction system completes the processing of transaction services by executing and processing transaction transactions. Due to the complexity of the business, most bank transaction systems are distributed systems implemented using a distributed transaction framework. In order to clearly and concisely explain the method of the embodiment of the present application, the transaction system and bank transaction system mentioned below in the embodiment of the present application all use a distributed transaction framework to process transaction transactions.

[0061] Positive transactions refer to normal transaction operations processed in the trading system that are in line with the customer's wishes, such as normal deposits, withdrawals, transfers, etc.

[0062] Reversal transaction refers to the operation of correcting or rolling back the errors or abnormal transactions that occurred previously in the trading system.

[0063] The transaction types of transaction transactions include positive transactions and reversal transactions. Normally, positive transactions are processed before reversal transactions to ensure the normal operation of the system and the accuracy of data. When a bank transaction system completes a transaction business function under a distributed transaction framework, it needs to cross multiple service components. It is possible that the positive transaction of a transaction transaction is sent before the reversal transaction, or the positive transaction takes a long time to process due to backtracking and other reasons. The reversal transaction has been executed before the positive transaction is processed. This can easily cause inconsistencies in transactions because the reversal transaction is completed before the positive transaction.

[0064] For example, when the upstream bank transaction system sends a positive transaction to system A to verify the loan amount and sends a positive transaction to system B to approve the loan in order to process the loan transaction business, when system A responds to the positive transaction transaction first, but an exception occurs during the execution of the transaction, the abnormal information is fed back to the upstream system. After receiving the feedback from system A, the upstream system sends the transaction of the reversal transaction to system A and system B respectively. After system B receives the transaction of the reversal transaction, system B may be in a state where it has not received the transaction of the positive transaction, or is processing the transaction of the positive transaction, but has processed the transaction of the reversal transaction first, that is, at this time, the reversal transaction may be completed before the positive transaction, and the positive transaction may be executed later, resulting in the approval of the loan being processed without rolling back, that is, the result of the transaction processing is wrong.

[0065] In the prior art, in order to prevent the occurrence of inconsistent transactions due to the reversal transaction being processed before the actual transaction, the SEATA architecture is often used in bank transaction systems. The transaction business is split into a pre-submission phase and a submission phase. In the pre-submission phase, it is confirmed that all transaction transactions issued by the upstream system can be successfully executed and the resources required for execution are locked. Then the submission phase is executed to achieve consistency of transaction transactions. When implementing, developers need to consider how to split the transaction business into two phases and implement the logic code of multiple interfaces according to the split phases, which is difficult to implement.

[0066] For example, in the TCC (Try-Confirm-Cancel) mode in the SEATA distributed transaction framework, developers need to split the transaction business into the Try stage and the Confirm / Cancel stage, and implement the logic code of the three service interfaces of Try, Confirm and Cancel, so that the system reserves resources and performs operations in the Try stage, and commits the transaction in the Confirm stage, and performs transaction rollback in the Cancel stage. By splitting transactions, it is ensured that the transaction transactions in the bank transaction system can be executed or rolled back in a consistent manner, thereby improving the reliability and consistency of the bank transaction system. For bank transaction systems that were not designed in a two-stage split in the early stage, if they need to be expanded according to this method, developers need to redesign and reconstruct the bank transaction system. Therefore, the method design for maintaining event consistency in the existing bank transaction system is difficult and the amount of code is large.

[0067] In view of this, the present application proposes a transaction processing method, which adds a transaction status table in the bank transaction system, and records the status information of the executed or executing transaction affairs through the transaction status table, so that the execution order and execution status of the reversal transaction and the positive transaction of the transaction affairs can be obtained when processing the transaction affairs, so as to determine the way to process the transaction affairs according to the execution order to maintain the consistency of the transaction affairs. Based on the method of the present application, for the bank transaction system that has not achieved the consistency of transactions in the early stage, there is no need to redesign and split the transaction business and reconstruct the bank transaction system. It is only necessary to add the processing logic of the transaction table in the bank transaction system to achieve the consistency of the transaction, which reduces the design difficulty of maintaining the consistency of the transaction affairs and improves the implementation efficiency.

[0068] It should be understood that the execution subject of the method of the embodiment of the present application can be any transaction system that processes transaction business, and the transaction system can be, for example, a securities transaction system or a bank transaction system. The embodiment of the present application takes a bank transaction system as an example to illustrate the transaction processing method proposed in the present application.

[0069] It should be noted that the banking transaction system can be deployed individually on an electronic device in any environment (for example, deployed individually on an edge server in an edge environment), or it can be deployed entirely in a cloud environment, or it can be deployed in a distributed manner in different environments.

[0070] For example, a bank transaction system can be logically divided into multiple parts, each with different functions. The various parts of the bank transaction system can be deployed in any two or three of the electronic device (located on the user side), the edge environment, and the cloud environment. The edge environment is an environment that includes a collection of edge electronic devices that are close to the electronic device. The edge electronic devices include: edge servers, edge stations with computing power, etc. The various parts of the bank transaction system deployed in different environments or devices work together to realize the functions of the bank transaction system.

[0071] It should be understood that this application does not make any restrictive division on which parts of the banking transaction system are deployed in what specific environment. In actual application, it can be adaptively deployed according to the computing power of the electronic device, the resource usage of the edge environment and the cloud environment, or the specific application requirements.

[0072] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0073] Taking the execution subject as a bank transaction system as an example, a transaction status table is pre-created in the bank transaction system to record the status information of the transaction affairs that have been executed or are being executed.

[0074] The transaction status table is a table used to record the status information of transactions that have been executed or are being executed, and is stored in any storage path accessible to the bank transaction system. The status information of a transaction includes at least the identification of the transaction, the reversal transaction status of the transaction, and the positive transaction status of the transaction.

[0075] The transaction identifier is a globally unique character or character combination that identifies and distinguishes different transactions, that is, the transaction key value. The transaction key value usually refers to the unique identifier of the transaction. Each transaction has a different identifier. If there are multiple identical key values ​​in the transaction status table and the status information records are inconsistent, the accurate status of the transaction cannot be determined. Therefore, the same transaction identifier cannot exist in the transaction status table.

[0076] The types of transaction transactions include reversal transactions and regular transactions. The reversal transaction status of a transaction transaction is used to characterize the state of the reversal transaction execution of the transaction transaction, for example, the reversal transaction is being executed, the reversal transaction is successfully executed, the reversal transaction is not executed, etc. The regular transaction status of a transaction transaction is used to characterize the state of the regular transaction execution of the transaction transaction, for example, the regular transaction is successfully executed, the regular transaction is not executed, etc. The reversal transaction status of a transaction transaction and the regular transaction status of a transaction transaction can be represented by any character or a combination of characters.

[0077] Taking the reversal transaction status as an example, the character "S" can be used to indicate that the reversal transaction is successfully executed, the character "1" can be used to indicate that the reversal transaction is being executed, and the character "0" can be used to indicate the initial status of the reversal transaction, which means that the bank transaction system has not received the reversal transaction for the transaction.

[0078] Figure 1 A flowchart of a transaction processing method provided in an embodiment of the present application. Based on the transaction status table pre-created in the bank transaction system, such as Figure 1 As shown in , the method may include the following steps:

[0079] S101 . In response to a target transaction triggered by an upstream system, determine whether to execute the target transaction according to a transaction status table.

[0080] The target transaction is a transaction sent by the upstream system to the bank transaction system based on the pending business. For example, when a user initiates a transfer business, the upstream system sends a target transaction to each downstream bank transaction system used to implement the transfer. At this time, the target transaction is a positive transaction. When the upstream system receives a situation indicating that the target transaction is abnormal, it will send the same target transaction to the downstream system again. At this time, the target transaction is a reversal transaction.

[0081] After receiving the target transaction, the bank transaction system can obtain the target transaction identifier and type through the target transaction information sent by the upstream system. The bank transaction system responds to the target transaction and queries the transaction status table to see whether there is an identifier of the current target transaction. If there is no identifier of the target transaction, it indicates that the target transaction is being executed for the first time. The bank transaction system can execute the target transaction according to the type of the target transaction.

[0082] If there is an identifier of the target transaction, it indicates that the target transaction is not executed for the first time. The bank transaction system can query the status information of the target transaction from the transaction status table, and further determine the execution of the target transaction based on the status information. Exemplarily, when the upstream system sends the positive transaction of the target transaction to the bank transaction system, and sends the reversal transaction of the same target transaction to the bank transaction system again. When the positive transaction is processed, the bank transaction system can obtain the status of the reversal transaction from the transaction status table based on the identifier and status information of the target transaction that the reversal transaction has been processed first. At this time, the target transaction is in a situation where the reversal transaction is completed before the positive transaction. The bank transaction system may not execute the processing of the positive transaction, that is, not submit the processing of the positive transaction, to avoid inconsistencies in transactions.

[0083] If it is determined to execute the target transaction, step S102 is executed.

[0084] S102: Execute the target transaction.

[0085] The bank transaction system executes the target transaction, that is, it performs transaction logic processing according to the target transaction to realize the transaction business of the upstream system. When the bank transaction system performs transaction logic processing, it implements a processing mechanism to prevent the repeated execution of the same transaction. If the current transaction is successfully executed, when the same transaction of the same transaction type is executed later, the bank transaction system will exit the transaction executed later, that is, end the transaction.

[0086] After the target transaction is completed, step S103 is executed.

[0087] S103: Update the transaction status corresponding to the type of the target transaction in the status information of the target transaction in the transaction status table to successful execution.

[0088] After the target transaction is executed, the bank transaction system can update the transaction status corresponding to the type of the target transaction in the status information of the target transaction in the transaction status table to successful execution, so that the bank transaction system can obtain the status of successful execution of the target transaction through the transaction status table and determine the execution of the target transaction.

[0089] For example, if the bank transaction system repeatedly receives the same target transaction and the transaction type of the target transaction is consistent, then it is necessary to obtain whether the execution of the transaction type corresponding to the target transaction has been successful. If the previous target transaction of the same transaction type has been successfully executed, the subsequent transaction does not need to be executed to prevent redundant execution of the target transaction.

[0090] Alternatively, if the target transaction executed by the bank transaction system is a positive transaction, when the target transaction is executed successfully, the successful execution status of the reversal transaction of the target transaction is obtained by querying the transaction status table. That is, the bank transaction system can obtain the status that the reversal transaction of the target transaction is completed before the positive transaction based on the transaction status table, so as to determine the method of handling the transaction according to this status.

[0091] Correspondingly, when executing the target transaction, the bank transaction system may also update the transaction status corresponding to the type of the target transaction in the status information of the target transaction in the transaction status table to being executed.

[0092] If it is determined that the target transaction is a positive transaction, when executing the target transaction, the bank transaction system can optionally update the positive transaction status of the target transaction to being executed in the status information of the target transaction in the transaction status table. In this implementation, the positive transaction status of the target transaction in the transaction status table can be an initial state, being executed, or a successful execution state.

[0093] When the bank transaction system receives two positive transactions with the same target transaction transaction and determines to execute the target transaction transaction received first, the bank transaction system can update the positive transaction status of the target transaction transaction to the executing status in the transaction status table. Before determining to execute the target transaction transaction received later, the bank transaction system can query the target transaction transaction of the same transaction type that was executed earlier, and the target transaction transaction of the same transaction type that was executed earlier is being executed. In this implementation mode, the bank transaction system can determine not to execute the target transaction transaction received later, reduce the execution of redundant transactions, and improve processing efficiency.

[0094] Optionally, when it is determined that the target transaction to be executed is a positive transaction, the positive transaction status of the target transaction may not be updated when the target transaction is executed. In this implementation, the positive transaction status of the target transaction in the transaction status table may be an initial state or a successful execution state.

[0095] If the bank transaction system receives two positive transactions with the same target transaction before and after, before determining to execute the target transaction received later, if the positive transaction status of the target transaction obtained is the initial value, the target transaction received later will be executed. At this time, the target transaction of the same transaction type executed earlier may be executed. Because the bank transaction system has a processing mechanism to prevent the repeated execution of the same transaction when processing transaction transactions, when the target transaction executed earlier is successfully executed, the target transaction executed later will be exited due to repeated execution, which will not affect the result of the target transaction executing the positive transaction. If the transaction executed earlier fails abnormally, the target transaction executed later will continue to execute, thereby improving the success rate of the target transaction executing the positive transaction under abnormal circumstances.

[0096] If it is determined that the target transaction to be executed is a reversal transaction, the target transaction is executed. Because the reversal transaction is completed before the regular transaction, it is easy to cause inconsistency in the transaction results. Therefore, in order to maintain the consistency of transactions, the bank transaction system needs to query the execution status of the reversal transaction based on the transaction status table. Therefore, the transaction status table needs to record the executing status of the reversal transaction. If the target transaction executed by the bank transaction system is a reversal transaction, the reversal transaction status of the target transaction can be updated to being executed in the status information of the target transaction in the transaction status table, so that the bank transaction system can obtain the execution status of the reversal transaction of the target transaction through the transaction status table.

[0097] Furthermore, in an implementation method in which the reversal transaction is updated to an executing status when executing the target transaction, when a system abnormality causes the bank transaction system to receive two reversal transactions with the same target transaction before and after, the bank transaction system can query the target transaction transaction of the same transaction type that was executed earlier before determining to execute the target transaction transaction received later, and the target transaction transaction of the same transaction type that was executed earlier is currently being executed.

[0098] In this implementation, the bank transaction system can optionally determine not to execute the target transaction received later, reduce the execution of redundant transactions, and improve processing efficiency. Alternatively, the bank transaction system can determine to execute the target transaction received later, so that when the target transaction executed earlier fails to execute, the target transaction executed later can continue to execute the reversal transaction, thereby improving the success rate of the target transaction executing the reversal transaction under abnormal circumstances.

[0099] It should be understood that the bank transaction system updates the status information of the target transaction in the transaction table according to the field type of the pre-set transaction table. For example, the field type of the reversal transaction status is represented by a single digit, with the initial status being "0", the executing status being "1", and the successfully executed status being "2". When the bank transaction system updates the reversal transaction status of the target transaction, the corresponding number is updated to the transaction status table according to the reversal transaction status. This embodiment does not limit this.

[0100] The transaction processing method of the embodiment of the present application adds a transaction status table in a distributed system, so that when processing a transaction, the execution order and execution status of the reversal transaction and the positive transaction of the transaction can be obtained from the transaction status table, thereby determining the method of processing the transaction according to the execution order to maintain the consistency of the transaction. Based on the method of the present application, for a bank transaction system that has not achieved transaction consistency in the early stage, there is no need to redesign and split the transaction business and reconstruct the bank transaction system. It is only necessary to add the processing logic of the transaction table in the bank transaction system to achieve transaction consistency, which reduces the design difficulty of maintaining transaction consistency and improves the implementation efficiency.

[0101] The following is an example of how to determine whether to execute a target transaction based on the transaction status table in the transaction processing method proposed in this application.

[0102] The bank transaction system processes transactions before and after the stages, including pre-processing and post-processing stages, to ensure the security and accuracy of transactions. The pre-processing stage usually refers to the stage after the transaction request is initiated and before the bank transaction system processes the transaction, the request is verified, approved and other operations are carried out to provide necessary preparations for subsequent transaction processing. The post-processing stage usually refers to the stage after the transaction is processed, when the bank transaction system submits the processing results, updates records and other operations to complete the entire transaction process and ensure the integrity and accuracy of the transaction.

[0103] The following is a description of the specific steps for the bank transaction system to process a target transaction based on the transaction status table during the pre-processing stage of the transaction. Figure 2 The flowchart of a transaction processing method of a bank transaction system in the pre-processing stage provided by the embodiment of the present application. Take the transaction status table pre-created in the bank transaction system, the reversal transaction status in the transaction status table can be the initial state, the executing state, the successful execution state, and the positive transaction status can be the initial state and the successful execution state as an example. Figure 2 As shown in , the method may include the following steps:

[0104] S201. Determine whether the target transaction is a reversal transaction.

[0105] If yes, execute S202;

[0106] If not, execute S206.

[0107] The target transaction information sent by the upstream system includes the target transaction type and the transaction identifier. After the bank transaction system responds to the received target transaction, it can obtain the target transaction type based on the received target transaction information. It determines whether it is a reversal transaction based on the obtained target transaction type, so as to distinguish between reversal transactions and regular transactions, and perform different transaction processing steps respectively.

[0108] S202: Determine whether there is status information of the target transaction in the transaction status table.

[0109] If not, execute S203;

[0110] If yes, execute S205.

[0111] The bank transaction system can query the status information of the target transaction from the transaction table according to the identifier of the acquired target transaction.

[0112] If the target transaction is a reversal transaction, the bank transaction system can query the transaction status table according to the obtained target transaction identifier. If the transaction status table includes a transaction record with the same identifier, it indicates that the bank transaction system has previously processed the target transaction, and the previously processed target transaction may be a positive transaction or a reversal transaction, and its execution status may also be in progress, or successfully executed, etc. The bank transaction system can further distinguish the type and execution status of the previously processed target transaction from the transaction status table, and confirm the execution of the current target transaction according to different transaction types and statuses.

[0113] If the transaction status table of the bank transaction system does not include a record of a transaction with the same identifier, it indicates that the bank transaction system has received the target transaction for the first time, and the first transaction processed is the reversal transaction of the target transaction, that is, the reversal transaction of the target transaction precedes the correct transaction. At this time, the bank transaction system can process the target transaction, but needs to record the status of the reversal transaction of the target transaction in the transaction status table to mark the target transaction as being in a situation where the reversal transaction precedes the correct transaction.

[0114] S203: Insert the status information of the target transaction into the transaction status table.

[0115] When the target transaction is in a state where the reversal transaction precedes the positive transaction, before the bank transaction system executes the reversal transaction of the target transaction, the bank transaction system can insert the target transaction into the transaction status table and record the reversal transaction status as the state of the reversal transaction being executed. In this implementation, when the bank transaction system receives the positive transaction of the target transaction, it can query the state information of the target transaction based on the transaction status table. If the positive transaction status of the target transaction is the initial value and the reversal transaction status is being executed, it indicates that the target transaction is in a state where the reversal transaction precedes the positive transaction.

[0116] The information inserted into the transaction status table includes the identifier of the target transaction, and the reversal transaction status and the positive transaction status determined according to the preset characters representing different statuses. Exemplarily, when the preset character "S" indicates that the transaction is successfully executed, "1" indicates that the transaction is being executed, and "0" indicates the initial state of the transaction, the reversal transaction status corresponding to the identifier of the target transaction in the information inserted into the transaction status table is "1", and the positive transaction status is "0".

[0117] S204: Whether the status information of the target transaction is successfully inserted.

[0118] If yes, execute S211;

[0119] If not, execute S205.

[0120] If the target transaction information is inserted repeatedly in the transaction status table, the bank transaction system will have an insertion anomaly. If the insertion fails due to repeated insertion of the target transaction status information, it means that other transactions that exist at this time are inserted into the transaction status table first. The bank transaction system can query the status information of the target transaction in the transaction status table, and further determine the execution of the current target transaction based on the status information of the target transaction.

[0121] If the status information of the target transaction is successfully inserted into the transaction status table, it means that there is no identical target transaction in the transaction status table, that is, the target transaction has not been executed. Then, the bank transaction system can execute the target transaction.

[0122] S205: Whether the reversal transaction status in the status information of the target transaction recorded in the transaction status table is a success status.

[0123] If yes, execute S209;

[0124] If not, execute S210.

[0125] If the target transaction transaction contains status information of the target transaction transaction, the bank transaction system may query the reversal transaction status of the recorded target transaction transaction from the transaction status table according to the identifier of the target transaction transaction.

[0126] If the reversal transaction status of the transaction previously recorded in the transaction status table is the execution success status, it indicates that the bank transaction system has previously executed the same reversal transaction as the current target transaction and has executed it successfully. The current target transaction is the same target transaction repeatedly received by the bank transaction system. Therefore, the current target transaction can be determined not to be executed, so as to terminate the repeated target transaction in advance and improve the efficiency of processing transactions.

[0127] If the reversal transaction status of the transaction previously recorded in the transaction status table is not in the execution success status, it can be in the initial status or the executing status.

[0128] If the reversal transaction status of the target transaction recorded in the transaction status table is the initial state, then the transaction that was executed first is a positive transaction. If the target transaction recorded in the transaction status table is a positive transaction, then the positive transaction of the target transaction is executed before the reversal transaction. At this time, the positive transaction status can be any transaction status, and the reversal transaction status is the initial state. Because the execution of the positive transaction before the reversal transaction does not affect the consistency of the target transaction processing, the bank transaction system can execute the reversal transaction of the target transaction. Before execution, the bank transaction system can update the reversal transaction status of the target transaction in the transaction status table from the initial state to the state of executing the reversal transaction.

[0129] If the reversal transaction status of the previously inserted transaction in the transaction status table is in the executing state, it indicates that the bank transaction system has previously executed the same reversal transaction as the current target transaction, and it is being executed. The current target transaction is the same target transaction repeatedly received by the bank transaction system. At this time, the current target transaction can continue to be executed. In this implementation method, if the previously executed transaction is successfully executed first, when the bank transaction system executes the current target transaction, the current target transaction will be exited due to repeated execution, which will not affect the execution result of the reversal transaction. If the reversal transaction of the previously executed transaction fails due to abnormal execution, the current target transaction can continue to execute this transaction to improve the success rate of the reversal transaction of the target transaction in the current state.

[0130] Optionally, if the reversal transaction status in the status information of the target transaction recorded in the transaction status table is in the executing state, the bank transaction system may also confirm not to execute the target transaction. In this implementation, if the current target transaction is the same target transaction repeatedly received by the bank transaction system, the current repeatedly received target transaction is terminated in advance, thereby improving the efficiency of processing transactions.

[0131] S206: Determine whether there is status information of the target transaction in the transaction status table.

[0132] If yes, execute S207;

[0133] If not, execute S211.

[0134] The bank transaction system may refer to step S202 to determine whether there is status information of the target transaction in the transaction status table.

[0135] If the transaction status table includes records of transactions with the same identifier, the bank transaction system can determine whether the reversal transaction status in the status information of the target transaction recorded in the transaction status table is a success status or an executing status to confirm the execution of the current target transaction.

[0136] If the bank transaction system queries the transaction status table and finds no record of the transaction with the same identifier, the bank transaction system may determine to execute the target transaction.

[0137] S207: Determine whether the reversal transaction status in the status information of the target transaction recorded in the transaction status table is a success status or an executing status.

[0138] If yes, execute S209;

[0139] If not, execute S208.

[0140] The bank transaction system can query the reversal transaction status of the target transaction from the transaction status table according to the identifier of the target transaction, that is, the previously executed target transaction that has been processed by the bank transaction system.

[0141] If the reversal transaction status of the previously executed target transaction is found to be the initial state from the transaction status table, the previously executed target transaction is a positive transaction. If the previously executed target transaction is a positive transaction, that is, the same transaction as the current target transaction, the target transaction received by the current bank transaction system is a repeated target transaction. At this time, the positive transaction status of the previously executed target transaction recorded in the transaction status table may be an executing state or a successful execution state. The bank transaction system can further determine the execution of the target transaction based on the positive transaction status.

[0142] If the reversal transaction status of the previously executed target transaction is found to be in the executing or completed state from the transaction status table, the previously executed target transaction is a reversal transaction, indicating that the target transaction is in the state where the reversal transaction is executed before the positive transaction. In the current case, the positive transaction of the target transaction can be ignored, that is, it is determined that the target transaction is not executed, and step S209 is executed.

[0143] S208: Determine whether the positive transaction status in the status information of the target transaction recorded in the transaction status table is successful execution.

[0144] If yes, execute S209;

[0145] If not, execute S211.

[0146] In the current state, it indicates that the current target transaction is a positive transaction, the state information of the target transaction exists in the transaction state table, and the previously recorded target transaction is not a negative transaction, that is, the current target transaction is a target transaction of the same positive transaction type repeatedly received by the bank transaction system. If there is a previously executed target transaction of the same type in the bank transaction system, the bank transaction system can query the positive transaction state of the previously executed target transaction from the transaction state table according to the identifier of the target transaction.

[0147] The transaction status in the transaction status table of the embodiment of the present application may be an initial state or a successful execution state, so the queried transaction status may be an initial state or a successful execution state.

[0148] If the current transaction status is the successful execution status, it indicates that the previously executed target transaction of the same transaction type has been successfully executed. Therefore, the current target transaction can be determined not to be executed, so as to terminate the repeated target transaction in advance and improve the efficiency of processing transactions. When the bank transaction system determines not to execute the target transaction, S209 is executed to terminate the processing of the current transaction.

[0149] If the current transaction state is the initial state, the current target transaction can be continued to be executed. In this implementation, it is possible that the previously executed transaction is in the process of being executed, and the same target transaction received later is also confirmed to be executed. At this time, if the previously executed transaction is successfully executed first, when the bank transaction system starts to execute the current target transaction, the current target transaction will be exited due to repeated execution, which does not affect the execution result of the current transaction. If the current transaction of the previously executed transaction fails due to abnormal execution, the current target transaction can continue to execute this transaction to improve the success rate of the current transaction of the target transaction in the current state.

[0150] S209: End the processing of the target transaction.

[0151] The situation in which the bank transaction system determines not to execute the target transaction transaction includes the situation in which the reversal transaction of the target transaction transaction is executed before the main transaction. Before confirming whether to execute the main transaction of the target transaction transaction later, it is found that the reversal transaction of the target transaction transaction is executed first, then the processing of the current target transaction transaction is terminated, thereby ensuring the transaction consistency when the reversal transaction of the target transaction transaction is executed before the main transaction.

[0152] S210: Update the reversal transaction status corresponding to the target transaction to being executed.

[0153] When the bank transaction system determines to execute the reversal transaction of the target transaction, the bank transaction system updates the reversal transaction status corresponding to the target transaction to the executing status, so that the bank transaction system can obtain the executing status of the reversal transaction of the target transaction from the transaction status table during the transaction processing.

[0154] Under this implementation method, when a system anomaly causes the bank transaction system to receive two reversal transactions with the same target transaction transaction before and after, or when the positive transaction of the target transaction transaction is completed after execution, the execution method can be determined based on the status of the reversal transaction of the target transaction being executed.

[0155] S211. Execute the target transaction.

[0156] When the bank transaction system determines to execute the target transaction, the bank transaction system starts to perform transaction logic processing according to the target transaction.

[0157] Based on the above transaction processing method, in the pre-processing stage, when the reversal transaction of the target transaction is executed before the main transaction, before the target transaction is executed later, the bank transaction system can obtain the status based on the transaction status table and confirm that the target transaction will not be executed.

[0158] For the target transaction to be executed, after the bank transaction system processes the target transaction and obtains the processing result of the current target transaction, it is also necessary to submit the processing result to the data storage space of the bank transaction system, such as the database of the bank transaction system. The submission of the processing result needs to be completed in the post-processing stage. Figure 3 The present invention provides a flowchart of a transaction processing method of a bank transaction system in the post-processing stage. Figure 3 As shown in , the method may include the following steps:

[0159] S301: Determine whether the target transaction is successfully processed.

[0160] If yes, execute S302;

[0161] If not, execute S309.

[0162] When the bank transaction system processes the target transaction, the processing result may be unsuccessful. For example, when the target transaction is executed repeatedly, if the target transaction executed earlier is successfully processed, the target transaction executed later will fail to process. Therefore, in the post-processing stage, the bank transaction system obtains whether the bank transaction system successfully processes the target transaction based on the output processing result. If the processing of the target transaction fails, the current target transaction is exited.

[0163] S302: Determine whether the target transaction is a reversal transaction.

[0164] If yes, execute S303;

[0165] If not, execute S304.

[0166] The bank transaction system queries the transaction status table according to the identifier of the target transaction and determines whether the target transaction is a reversal transaction, so as to distinguish between the regular transaction and the reversal transaction and execute different steps.

[0167] In the post-processing stage, when the target transaction is a reversal transaction, the transaction status table can be updated according to the processing result of the target transaction by the bank transaction system;

[0168] If the target transaction is a positive transaction, it is possible that the bank transaction system receives a reversal transaction of the target transaction while processing the positive transaction of the target transaction, that is, the reversal transaction may be processed before the positive transaction. Therefore, the bank transaction system can further confirm the processing steps according to the reversal transaction status.

[0169] S303: Update the reversal transaction status of the target transaction in the status information of the target transaction in the transaction status table to successful execution.

[0170] If the target transaction is a reversal transaction, the reversal transaction status of the target transaction is updated to successful execution in the status information of the target transaction in the transaction status table, so that the positive transaction of the target transaction can query the execution status of the reversal transaction based on the transaction status table.

[0171] S304: Determine whether there is status information of the target transaction in the transaction status table.

[0172] If yes, execute S305;

[0173] If not, execute S307.

[0174] If the target transaction is a positive transaction and there is no status information of the target transaction in the transaction status table, it means that the bank transaction system has not received or executed the reversal transaction or positive transaction of the target transaction. In the current state, the target transaction currently executed is the target transaction executed for the first time by the bank transaction system, and the data of the target transaction processed by the bank transaction system can be submitted.

[0175] If the transaction status table contains status information of the target transaction, the bank transaction system can obtain the status of the reversal transaction and determine whether to submit the data of the target transaction to the bank transaction system for processing according to the reversal transaction status.

[0176] S305: Determine whether the reversal transaction status is the initial status.

[0177] If yes, execute S306;

[0178] If not, execute S309.

[0179] If the target transaction is a positive transaction, and the reversal transaction status of the target transaction in the transaction status table is in the executing or successful execution state, it means that before the positive transaction of the target transaction is completed, the bank transaction system has received and processed the reversal transaction of the target transaction. The processing data of the positive transaction of the current target transaction processed by the bank transaction system may not be submitted to ensure the consistency of the transaction processing results.

[0180] S306: Update the positive transaction status of the target transaction to successful execution.

[0181] Before the bank transaction system submits the data of the target transaction transaction being processed, the target transaction transaction status is updated to be executed successfully in the status information of the target transaction transaction in the transaction status table, so that the bank transaction system can obtain the status of the target transaction transaction being executed successfully by querying the transaction status table. For example, if the bank transaction system repeatedly receives the target transaction transaction, the status of the target transaction transaction being executed successfully can be queried from the transaction status table to confirm whether to execute the target transaction transaction received later.

[0182] S307: Insert the status information of the target transaction into the transaction status table and update the positive transaction status of the target transaction to successful execution.

[0183] In the current state, the target transaction currently executed is the target transaction executed for the first time by the bank transaction system, and the status information of the target transaction has not been recorded in the transaction status table. The bank transaction system can insert the status information of the target transaction into the transaction status table and update the positive transaction status of the target transaction to successful execution, and then submit the data for processing the target transaction.

[0184] S308: Submit data for processing the target transaction.

[0185] The bank transaction system obtains the processed data after processing the target transaction. In the post-processing stage, the bank transaction system submits the processed data to the bank transaction system's data storage space to store the processing results of the target transaction and end the processing of the current target transaction.

[0186] S309: Do not update the transaction status table, and exit the target transaction.

[0187] In the current state, the bank transaction system does not update the transaction status table and exits the target transaction. In this implementation, the data processed by the bank transaction system is not submitted to the space for storing data in the bank transaction system.

[0188] Based on the above transaction processing method, in the post-processing stage, when the positive transaction of the target transaction is being executed, the reversal transaction is executed first. Subsequently, after the positive transaction of the target transaction is processed, the bank transaction system can obtain the status based on the transaction status table, and confirm not to submit the processing data of the target transaction, thereby ending the processing of the current target transaction.

[0189] The transaction processing method of the embodiment of the present application records the status information of the executed or executing transaction affairs by adding a transaction status table in the distributed system. In the pre-processing stage and the post-processing stage of the transaction affairs, it can be obtained based on the transaction status table whether the reversal transaction of the transaction affairs is executed before the positive transaction, so as to confirm the execution mode of the transaction in the pre-processing stage according to the execution status of the transaction affairs, and to confirm whether to submit the processing result data of the transaction in the post-processing stage to maintain the consistency of the transaction affairs. Based on the method of the present application, for the bank transaction system that has not achieved the consistency of transactions in the early stage, there is no need to redesign and split the transaction business and reconstruct the bank transaction system. It is only necessary to add the processing logic of the transaction table in the bank transaction system to achieve the consistency of the transaction, which reduces the design difficulty of maintaining the consistency of the transaction affairs and improves the implementation efficiency.

[0190] The transaction status table in the transaction processing method proposed in the present application includes at least: the identification of the transaction, the reversal transaction status of the transaction and the positive transaction status of the transaction, and may also include: the sub-transaction sequence number, the record version number, the last modification stage, the first-level bank number, the legal person number, the last modification date, and the last modification time.

[0191] The sub-transaction sequence number is used to mark the transaction type of the transaction, such as transfer, loan, etc.

[0192] The record version number is used to record the number of times the transaction is updated in the transaction status table.

[0193] The last modification stage is used to record the time period when the transaction was last triggered. For example, when the time period of the transaction is divided into the daytime trading time period and the nighttime trading time period, the bank transaction system can determine the transaction time period according to the time when the upstream system initiates the transaction.

[0194] The primary bank number is used to mark the bank branch number of the upstream system to which the transaction belongs.

[0195] The legal entity number is used to mark the legal entity number of the bank branch to which the transaction belongs in the upstream system corresponding to the transaction.

[0196] The last modified date is used to indicate the date when the transaction last updated information in the transaction status table.

[0197] The last modification time is used to indicate the time when the transaction last updated information in the transaction status table.

[0198] Taking the transaction status table including the above information as an example, Table 1 is a transaction status table provided by the present application. It should be understood that the present application does not limit the structure of the transaction status table. Table 1 is only an example of a structure of a transaction status table that can implement the transaction processing method.

[0199] Table 1 Transaction status table

[0200] Status Information Field Name Field Type Transaction ID Field Name 1 Field Type 1 Sub-transaction transaction number Field name 2 Field Type 2 Trading status Field name 3 Field Type 3 Reversing transaction status Field name 4 Field Type 4 Record version number Field name 5 Field Type 5 Final revision stage Field name 6 Field Type 6 First-level line number Field name 7 Field Type 7 Legal entity number Field name 8 Field Type 8 Last modified date Field name 9 Field Type 9 Last modified time Field name 10 Field Type 10

[0201] The field names such as field name 1 and field name 2, and the field types such as field type 1 and field type 2 in Table 1 are only shown for example, and the present application does not limit the setting of actual field names and field types. Based on the transaction status table shown in Table 1, the identifier of the transaction can be set as the primary key, that is, it can uniquely identify each row of data in the table. When the bank transaction system needs to obtain relevant information of a transaction, it can query the corresponding transaction information from the transaction status table according to the identifier of the transaction.

[0202] The transaction processing method of the embodiment of the present application records the status information of executed or in-progress transactions by adding a transaction status table in a distributed system. In the pre-processing and post-processing stages of a transaction, it is possible to obtain whether the reversal transaction of the transaction is executed before the positive transaction based on the transaction status table, so as to confirm the execution mode of the transaction in the pre-processing stage according to the execution status of the transaction, and to confirm whether to submit the processing result data of the transaction in the post-processing stage to maintain the consistency of the transaction. Based on the method of the present application, the design difficulty of maintaining the consistency of transactions is reduced and the implementation efficiency is improved.

[0203] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0204] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0205] The above is a description of the method embodiment of the present application. The following is a description of the device provided in the embodiment of the present application.

[0206] Figure 4 A schematic diagram of the structure of a transaction processing device provided in an embodiment of the present application. Figure 4 As shown, the device may include, for example:

[0207] Pre-processing module 401 is used to respond to the target transaction triggered by the upstream system and determine whether to execute the target transaction according to the transaction status table; the types of target transaction include: reversal transaction and normal transaction, and the transaction status table is used to record the status information of the transaction that has been executed or is being executed, and the status information includes at least: the identification of the transaction, the reversal transaction status of the transaction and the normal transaction status of the transaction.

[0208] The execution module 402 is used to execute the target transaction when the pre-processing module 401 determines to execute the target transaction.

[0209] The post-processing module 403 is used to update the transaction status corresponding to the type of the target transaction in the status information of the target transaction in the transaction status table to successful execution after the target transaction is executed.

[0210] The pre-processing module 401 is also used to determine whether the target transaction is a reversal transaction; if the target transaction is a reversal transaction, determine whether there is status information of the target transaction in the transaction status table; if so, determine whether to execute the target transaction based on the reversal transaction status in the status information of the target transaction recorded in the transaction status table; if not, insert the status information of the target transaction into the transaction status table, and determine whether to execute the target transaction based on the result of whether the insertion is successful.

[0211] For example, the pre-processing module 401 is specifically used to determine whether to execute the target transaction based on the result of whether the insertion is successful. If the insertion is successful, it is determined to execute the target transaction; if the insertion fails due to repeated insertion of the status information of the target transaction, it is determined whether to execute the target transaction based on the reversal transaction status in the status information of the target transaction recorded in the transaction status table.

[0212] Exemplarily, the pre-processing module 401 is specifically used to determine not to execute the target transaction if the reversal transaction status in the status information of the target transaction recorded in the transaction status table is a successful status; if the reversal transaction status in the status information of the target transaction recorded in the transaction status table is not a successful status, determine to execute the target transaction.

[0213] Accordingly, in this possible implementation, the execution module 402 is specifically used to execute the target transaction transaction when determining to execute the target transaction transaction, and update the reversal transaction status corresponding to the target transaction transaction to being executed in the status information of the target transaction transaction.

[0214] A possible implementation method, the pre-processing module 401, is specifically used to determine whether the target transaction is a reversal transaction; if the target transaction is not a reversal transaction, determine whether there is status information of the target transaction in the transaction status table; if so, determine whether to execute the target transaction based on the reversal transaction status and the positive transaction status in the status information of the target transaction recorded in the transaction status table; if not, determine to execute the target transaction.

[0215] For example, the pre-processing module 401 is specifically used to determine whether the reversal transaction status in the status information of the target transaction recorded in the transaction status table is a successful status or an executing status; if so, it is determined that the target transaction is not executed; if not, it is determined whether the positive transaction status in the status information of the target transaction recorded in the transaction status table is successfully executed; if so, it is determined that the target transaction is not executed; if not, it is determined to execute the target transaction.

[0216] A possible implementation method, post-processing module 403, is specifically used to determine whether the target transaction transaction is successfully executed after the target transaction transaction is executed; if the target transaction transaction is successfully executed, determine whether the target transaction transaction is a reversal transaction transaction; if the target transaction transaction is a reversal transaction transaction, update the reversal transaction status of the target transaction transaction in the status information of the target transaction transaction in the transaction status table to successful execution; if not, determine whether there is status information of the target transaction transaction in the transaction status table; if there is status information of the target transaction transaction in the transaction status table, and the reversal transaction status is an initial state, update the positive transaction status of the target transaction transaction to successful execution; if there is no status information of the target transaction transaction in the transaction status table, insert the status information of the target transaction transaction in the transaction status table and update the positive transaction status of the target transaction transaction to successful execution; if there is status information of the target transaction transaction in the transaction status table, and the reversal transaction status is a non-initial state, do not update the transaction status table.

[0217] The device provided in the embodiment of the present application can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0218] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0219] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device may include: at least one processor 501 and a memory 502 .

[0220] The memory 502 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer operation instructions.

[0221] The memory 502 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0222] The processor 501 is used to execute the computer-executable instructions stored in the memory 502 to implement the method of the aforementioned method embodiment. The processor 501 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0223] Optionally, the electronic device may further include a communication interface 503. In specific implementation, if the communication interface 503, the memory 502 and the processor 501 are implemented independently, the communication interface 503, the memory 502 and the processor 501 may be interconnected via a bus and communicate with each other.

[0224] Optionally, in a specific implementation, if the communication interface 503, the memory 502 and the processor 501 are integrated on a chip, the communication interface 503, the memory 502 and the processor 501 can complete communication through an internal interface.

[0225] The present application also provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes. Specifically, the computer-readable storage medium stores program instructions, and the program instructions are used to implement the actions of the above-mentioned method implementation method.

[0226] The present application also provides a program product, which includes an execution instruction, which is stored in a readable storage medium. At least one processor of the electronic device can read the execution instruction from the readable storage medium, and at least one processor executes the execution instruction so that the electronic device implements the actions of the above method implementation.

[0227] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0228] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.

[0229] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0230] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0231] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0232] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A transaction processing method, characterized in that: The method comprises: In response to a target transaction triggered by an upstream system, determining whether to execute the target transaction according to a transaction status table; the types of the target transaction include: reversal transaction and regular transaction, the transaction status table is used to record status information of the executed or being executed transaction, the status information at least includes: an identifier of the transaction, a reversal transaction status of the transaction, and a regular transaction status of the transaction; When it is determined to execute the target transaction, executing the target transaction; After the target transaction is executed, the transaction status corresponding to the type of the target transaction is updated to successful execution in the status information of the target transaction in the transaction status table.

2. The method according to claim 1, characterized in that The determining whether to execute the target transaction according to the transaction status table includes: Determining whether the target transaction is a reversal transaction; In the case where the target transaction is a reversal transaction, determining whether status information of the target transaction exists in the transaction status table; If so, determining whether to execute the target transaction according to the reversal transaction status in the status information of the target transaction recorded in the transaction status table; If it does not exist, insert the status information of the target transaction into the transaction status table, and determine whether to execute the target transaction according to the result of whether the insertion is successful; When determining to execute the target transaction, executing the target transaction includes: When it is determined to execute the target transaction, the target transaction is executed, and the reversal transaction status corresponding to the target transaction is updated to being executed in the status information of the target transaction.

3. The method according to claim 2, characterized in that The step of determining whether to execute the target transaction according to the result of whether the insertion is successful includes: If the insertion is successful, then the target transaction is determined to be executed; If the insertion fails due to repeated insertion of the state information of the target transaction, whether to execute the target transaction is determined according to the reversal transaction state in the state information of the target transaction recorded in the transaction state table.

4. The method according to claim 3, characterized in that The determining whether to execute the target transaction according to the reversal transaction status in the status information of the target transaction recorded in the transaction status table includes: If the reversal transaction status in the status information of the target transaction recorded in the transaction status table is a success status, determining not to execute the target transaction; If the reversal transaction status in the status information of the target transaction recorded in the transaction status table is not a success status, it is determined to execute the target transaction.

5. The method according to claim 1, characterized in that The determining whether to execute the target transaction according to the transaction status table includes: Determining whether the target transaction is a reversal transaction; In the case where the target transaction is not a reversal transaction, determining whether there is status information of the target transaction in the transaction status table; If so, determining whether to execute the target transaction according to the reversal transaction status and the positive transaction status in the status information of the target transaction recorded in the transaction status table; If not, determine to execute the target transaction.

6. The method according to claim 5, characterized in that The determining whether to execute the target transaction according to the reversal transaction status and the positive transaction status in the status information of the target transaction recorded in the transaction status table includes: Determine whether the reversal transaction status in the status information of the target transaction recorded in the transaction status table is a success status or an executing status; If yes, determine not to execute the target transaction; If not, determining whether the positive transaction status in the status information of the target transaction recorded in the transaction status table is successful execution; If yes, determine not to execute the target transaction; If not, determine to execute the target transaction.

7. The method according to any one of claims 1 to 6, characterized in that: After the target transaction is executed, updating the transaction status corresponding to the type of the target transaction in the status information of the target transaction in the transaction status table to successful execution includes: Determining whether the target transaction is successfully executed; If the target transaction is successfully executed, determining whether the target transaction is a reversal transaction; If the target transaction is a reversal transaction, updating the reversal transaction status of the target transaction in the status information of the target transaction in the transaction status table to successful execution; If not, determining whether there is status information of the target transaction in the transaction status table; If the status information of the target transaction exists in the transaction status table and the reversal transaction status is the initial state, the positive transaction status of the target transaction is updated to be executed successfully; if the status information of the target transaction does not exist in the transaction status table, the status information of the target transaction is inserted into the transaction status table and the positive transaction status of the target transaction is updated to be executed successfully; If the status information of the target transaction exists in the transaction status table, and the reversal transaction status is a non-initial state, the transaction status table is not updated.

8. A transaction processing device, characterized in that: include: A pre-processing module, configured to respond to a target transaction triggered by an upstream system and determine whether to execute the target transaction according to a transaction status table; The types of the target transaction include: reversal transaction and normal transaction, the transaction status table is used to record the status information of the transaction that has been executed or is being executed, and the status information at least includes: the identification of the transaction, the reversal transaction status of the transaction, and the normal transaction status of the transaction; An execution module, configured to execute the target transaction when determining to execute the target transaction; A post-processing module is used to update the transaction status corresponding to the type of the target transaction to successful execution in the status information of the target transaction in the transaction status table after the target transaction is executed.

9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.