CN114637758A - Transaction processing method and device - Google Patents

Transaction processing method and device Download PDF

Info

Publication number
CN114637758A
CN114637758A CN202210312305.0A CN202210312305A CN114637758A CN 114637758 A CN114637758 A CN 114637758A CN 202210312305 A CN202210312305 A CN 202210312305A CN 114637758 A CN114637758 A CN 114637758A
Authority
CN
China
Prior art keywords
transaction
sub
reissue
state
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210312305.0A
Other languages
Chinese (zh)
Inventor
李昀
李增兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202210312305.0A priority Critical patent/CN114637758A/en
Publication of CN114637758A publication Critical patent/CN114637758A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction

Abstract

The application discloses a transaction processing method and a transaction processing device, which can be applied to the field of block chains or the technical field of computers. Acquiring first reissue information of a first sub-transaction of the target transaction from the reissue table, wherein the first reissue information comprises a first identifier, a first state and transaction data of the first sub-transaction, the first state is used for indicating that the first sub-transaction is in a reissuable state, and the first identifier is used for identifying a first block chain corresponding to the first sub-transaction; complementary sending the transaction data to the first block chain based on the first complementary sending information; and in response to the successful uploading of the transaction data to the first block chain, modifying the first state in the first reissue information into a second state, and obtaining second reissue information, wherein the second reissue information comprises the second state, and the second state is used for indicating that the first sub-transaction is in a non-reissue state. Therefore, a mechanism for automatically reissuing the sub-transaction which fails in transaction is provided, and the working efficiency is improved on the basis of ensuring the integrity of the final transaction.

Description

Transaction processing method and device
Technical Field
The present application relates to the field of computer technology, and more particularly, to a method and apparatus for processing a transaction, wherein the transaction is associated with at least two blockchains.
Background
For transactions that are associated with multiple blockchains, it is becoming more and more common as blockchain technology evolves. For example, in a data evidence scenario, the service system may associate multiple block chains such as a notary chain, a judicial chain, and an arbitration chain for one transaction of storing service data, that is, the service system needs to store service data to multiple block chains such as a notary chain, a judicial chain, and an arbitration chain.
When transaction failure occurs in a blockchain in a plurality of blockchains associated with a transaction exchange (for example, transaction overtime or transaction unknown and the like occurs), and data in the plurality of associated blockchains are inconsistent, in order to ensure the integrity of final transaction, currently, a transaction log is generally queried manually, and after the transaction failure is determined, the original transaction is initiated again manually, so that the workload is large and the intelligence is not sufficient.
Disclosure of Invention
The embodiment of the application provides a transaction processing method and device, a reissue mechanism is designed for transactions related to a plurality of blockchains, and after sub-transactions on partial blockchains of one transaction fail, the failed sub-transactions can be reissued in a targeted manner.
In a first aspect, an embodiment of the present application provides a method for transaction processing, including:
acquiring first reissue information of a first sub-transaction of a target transaction from a reissue table, wherein the reissue table is generated when an unsuccessful sub-transaction exists in the target transaction, the unsuccessful sub-transaction comprises the first sub-transaction, the first reissue information comprises a first identifier, a first state and transaction data of the first sub-transaction, the first state is used for indicating that the first sub-transaction is in a reissuable state, and the first identifier is used for identifying a first block chain corresponding to the first sub-transaction;
subsidizing the transaction data to the first blockchain based on the first reissue information;
and responding to the successful uploading of the transaction data to the first block chain, modifying the first state in the first reissue information into a second state, and obtaining second reissue information, wherein the second reissue information comprises the second state, and the second state is used for indicating that the first sub-transaction is in a state of being not reissued.
Optionally, the method further comprises:
generating the replenishment table according to a log table, wherein the log table comprises first log information of the first sub-transaction, and the first log information comprises: the first identification, the transaction data and first indication information, wherein the first indication information is used for indicating that the first sub-transaction fails.
Optionally, the log table includes a sending table and a receiving table, the sending table includes the transaction data and the first identifier, and the receiving table includes the first identifier and the first indication information.
Optionally, the reissue table further includes third reissue information of a second sub-transaction of the target transaction, and the method further includes:
acquiring third reissue information, wherein the third reissue information comprises a second identifier, a third state and the transaction data of the second sub-transaction, the third state is used for indicating that the second sub-transaction is in a reissuable state, and the second identifier is used for identifying a second block chain corresponding to the second sub-transaction;
subsidizing the transaction data to the second blockchain based on the third reissue information;
and in response to the successful uploading of the transaction data to the second block chain, modifying the third state in the third reissue information into a fourth state, and obtaining fourth reissue information, wherein the fourth reissue information comprises the fourth state, and the fourth state is used for indicating that the second sub-transaction is in a state of non-reissue.
Optionally, the method further comprises:
and if the reissue information of all the sub-transactions of the target transaction in the reissue table indicates that the corresponding sub-transactions are in a non-reissue state, determining that the target transaction is finished.
Optionally, the first identifier includes:
the system comprises a transaction code, a serial number and a serial number, wherein the transaction code is used for indicating interfaces of a plurality of blockchains related to the target transaction, the serial number is used for identifying the target transaction, and the serial number is used for identifying the first sub-transaction.
In a second aspect, an embodiment of the present application further provides a transaction processing apparatus, including:
a first obtaining unit, configured to obtain, from a reimbursement table, first reimbursement information of a first sub-transaction of a target transaction, where the reimbursement table is generated when an unsuccessful sub-transaction is monitored in the target transaction, where the unsuccessful sub-transaction includes the first sub-transaction, the first reimbursement information includes a first identifier, a first state, and transaction data of the first sub-transaction, the first state is used to indicate that the first sub-transaction is in a reimburseable state, and the first identifier is used to identify a first block chain corresponding to the first sub-transaction;
a first reissue unit, configured to reissue the transaction data to the first blockchain based on the first reissue information;
a first modifying unit, configured to modify the first state in the first reissue information to a second state in response to the successful upload of the transaction data to the first block chain, and obtain second reissue information, where the second reissue information includes the second state, and the second state is used to indicate that the first sub-transaction is in a non-reissue state.
Optionally, the apparatus further comprises:
a generating unit, configured to generate the replenishment table according to a log table, where the log table includes first log information of the first sub-transaction, and the first log information includes: the first identification, the transaction data and first indication information, wherein the first indication information is used for indicating that the first sub-transaction fails.
Optionally, the log table includes a sending table and a receiving table, the sending table includes the transaction data and the first identifier, and the receiving table includes the first identifier and the first indication information.
Optionally, the reissue table further includes third reissue information of a second sub-transaction of the target transaction, and the apparatus further includes:
a second obtaining unit, configured to obtain third reissue information, where the third reissue information includes a second identifier, a third state, and the transaction data of the second sub-transaction, where the third state is used to indicate that the second sub-transaction is in a reissuable state, and the second identifier is used to identify a second block chain corresponding to the second sub-transaction;
a second reissue unit, configured to reissue the transaction data to the second block chain based on the third reissue information;
a second modifying unit, configured to modify the third state in the third reissue information to a fourth state in response to the successful uploading of the transaction data to the second block chain, so as to obtain fourth reissue information, where the fourth reissue information includes the fourth state, and the fourth state is used to indicate that the second sub-transaction is in a non-reissuable state.
Optionally, the apparatus further comprises:
and the determining unit is used for determining that the target transaction is finished if the reissue information of all the sub-transactions of the target transaction in the reissue table indicates that the corresponding sub-transactions are in a state of being not reissued.
Optionally, the first identifier includes:
the system comprises a transaction code, a serial number and a serial number, wherein the transaction code is used for indicating interfaces of a plurality of blockchains related to the target transaction, the serial number is used for identifying the target transaction, and the serial number is used for identifying the first sub-transaction.
In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes a processor and a memory:
the memory is used for storing a computer program;
the processor is configured to perform the method provided by the first aspect above according to the computer program.
In a fourth aspect, this application embodiment further provides a computer-readable storage medium, where the computer-readable storage medium is used to store a computer program, where the computer program is used to execute the method provided in the first aspect.
Therefore, the embodiment of the application has the following beneficial effects:
an embodiment of the present application provides a method for transaction processing, which may include: acquiring first reissue information of a first sub-transaction of a target transaction from a reissue table, wherein the reissue table is generated when an unsuccessful sub-transaction exists in the target transaction, the unsuccessful sub-transaction comprises the first sub-transaction, the first reissue information comprises a first identifier, a first state and transaction data of the first sub-transaction, the first state is used for indicating that the first sub-transaction is in a reissuable state, and the first identifier is used for identifying a first block chain corresponding to the first sub-transaction; subsidizing the transaction data to the first blockchain based on the first reissue information; and responding to the successful uploading of the transaction data to the first block chain, modifying the first state in the first reissue information into a second state, and obtaining second reissue information, wherein the second reissue information comprises the second state, and the second state is used for indicating that the first sub-transaction is in a state of being unable to reissue. Therefore, by the method, when normal transaction is carried out, when the uplink sub-transaction of the target transaction fails, the reissue information of the sub-transaction which fails in transaction is recorded in the reissue table, the reissue information comprises the reissue state of the sub-transaction which fails in transaction, the reissue table is read, the sub-transaction which is in the reissue state is found out for reissuing, if the reissue is successful, the state is updated to be 'not reissue', and repeated reissue is avoided.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present invention, and it is obvious for those skilled in the art to obtain other drawings according to these drawings.
FIG. 1 is a schematic diagram of a system suitable for use with embodiments of the present application;
FIG. 2 is a schematic flow chart illustrating a method of transaction processing according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a transaction processing apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a transaction processing system according to an embodiment of the present disclosure.
Detailed Description
It should be noted that the method and apparatus for transaction processing provided by the present invention can be used in the field of computer technology, the field of block chain, or the field of finance. The above description is only an example, and does not limit the application field of the transaction processing method and apparatus provided by the present invention.
The method and the device for transaction processing can be used in the technical field of computers, the field of block chains, the financial field or other fields, for example, can be used in a business data evidence storage application scene in the financial field. Other fields are any fields other than the computer technology field, the blockchain field, the financial field. The above description is only an example, and does not limit the application field of the transaction processing method and apparatus provided by the present invention.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, embodiments accompanying figures and detailed description thereof are described in further detail below. It is to be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application. It should be noted that, for the convenience of description, only a part related to the present application is shown in the drawings, and not all structures are shown.
With the development of the blockchain technology, there are more and more scenarios in which a transaction is associated with multiple blockchains, for example, in a data evidence scenario, there is a need for a business system to store business data into multiple blockchains such as a notary chain, a judicial chain, and an arbitration chain. When any one blockchain or a plurality of blockchain sub-transactions fail, for example, when the transaction is overtime or unidentified, the data of a plurality of blockchain certificates associated with the transaction are inconsistent, the log of the whole transaction is checked manually, and after the transaction is determined to be totally unsuccessful, a new original transaction is manually resubmitted. However, the transaction processing method can only manually check the transaction log and manually resubmit a new original transaction, which is a heavy workload and consumes a large amount of resources.
Based on this, the embodiment of the present application provides a processing method for a transaction associated with multiple blockchains, which supports automatic reissue of a failed sub-transaction without re-initiating a complete original transaction. In a specific implementation, the method may include, for example: acquiring first reissue information of a first sub-transaction of a target transaction from a reissue table, wherein the reissue table is generated when an unsuccessful sub-transaction exists in the target transaction, the unsuccessful sub-transaction comprises the first sub-transaction, the first reissue information comprises a first identifier, a first state and transaction data of the first sub-transaction, the first state is used for indicating that the first sub-transaction is in a reissuable state, and the first identifier is used for identifying a first block chain corresponding to the first sub-transaction; subsidizing the transaction data to the first blockchain based on the first reissue information; and responding to the successful uploading of the transaction data to the first block chain, modifying the first state in the first reissue information into a second state, and obtaining second reissue information, wherein the second reissue information comprises the second state, and the second state is used for indicating that the first sub-transaction is in a state of being not reissued.
Therefore, by the method, when normal transaction is carried out, when the uplink sub-transaction of the target transaction fails, the reissue information of the sub-transaction which fails in transaction is recorded in the reissue table, the reissue information comprises the reissue state of the sub-transaction which fails in transaction, the reissue table is read, the sub-transaction which is in the reissue state is found out for reissuing, if the reissue is successful, the state is updated to be 'not reissue', and repeated reissue is avoided.
To facilitate understanding of a specific implementation of the transaction processing method provided by the embodiments of the present application, the following description is made with reference to the accompanying drawings.
A description will be given of a scenario to which the embodiment of the present application is applied. Referring to the system shown in fig. 1, the system may include a service client 11, a service client 12, a transaction processing device 20, a blockchain 31, a blockchain 32, and a blockchain 33. Wherein, the service client 11 and the service client 12 can transmit the service data to all or part of the blockchains 31, 32 and 33 through the transaction processing device 20. The process that a business client sends business data to a corresponding block chain is called a transaction, the transaction can be divided into a plurality of sub-transactions according to the number of the related block chains, the number of the sub-transactions is consistent with the number of the block chains related to the transaction, and the sub-transactions are in one-to-one correspondence with the block chains. For example, transaction 1 may refer to that the service client 11 may transmit service data a to the blockchain 31, the blockchain 32, and the blockchain 33 through the transaction processing device 20, and then transaction 1 may be divided into sub-transaction 11, sub-transaction 12, and sub-transaction 13, where sub-transaction 11 refers to that the service client 11 may transmit service data a to the blockchain 31 through the transaction processing device 20, sub-transaction 12 refers to that the service client 11 may transmit service data a to the blockchain 32 through the transaction processing device 20, and sub-transaction 13 refers to that the service client 11 may transmit service data a to the blockchain 33 through the transaction processing device 20.
It should be noted that the transaction processing device 20 may be understood as a device for executing the transaction processing method provided in the embodiment of the present application, and the transaction processing device 20 may be carried in an electronic device or a functional module of the electronic device. The electronic device in the embodiment of the present application may be any device capable of implementing the method for processing a transaction in the embodiment of the present application. Specifically, the detailed structural diagram of the transaction processing device 20 can be seen in the device 300 for transaction processing shown in fig. 3 below.
Fig. 2 is a flowchart illustrating a transaction processing method according to an embodiment of the present disclosure. The method may be applied to the apparatus for transaction processing 20 shown in fig. 1, or may be applied to the apparatus for transaction processing 300 shown in fig. 3, or may be applied to the electronic device 400 shown in fig. 4.
As shown in fig. 2, the method may include the following S201 to S203:
the method includes the steps of S201, obtaining first reissue information of a first sub-transaction of a target transaction from a reissue table, wherein the reissue table is generated when an unsuccessful sub-transaction exists in the target transaction, the unsuccessful sub-transaction includes the first sub-transaction, the first reissue information includes a first identifier, a first state and transaction data of the first sub-transaction, the first state is used for indicating that the first sub-transaction is in a reissuable state, and the first identifier is used for identifying a first block chain corresponding to the first sub-transaction.
It should be noted that the reissue table is a concept provided in the embodiment of the present application, and is used to record relevant information of sub-transactions in which a transaction fails due to reasons such as timeout and record lock in a transaction process, so as to provide a data basis for implementing the transaction reissue mechanism provided in the embodiment of the present application.
As an example, before S201, the method may further include: and S200, generating the supplementary table according to the log table. Wherein the log table includes first log information for the first sub-transaction, the first log information including: the first identification, the transaction data and first indication information, wherein the first indication information is used for indicating that the first sub-transaction fails. In particular, the first log information may be divided into a transmission table and a reception table according to actions performed by a device performing transaction processing of the method, wherein the transmission table may include the transaction data and the first identifier, and the reception table may include the first identifier and the first indication information.
The first identifier mentioned in the embodiments of the present application may include, but is not limited to: the system comprises a transaction code, a serial number and a serial number, wherein the transaction code is used for indicating interfaces of a plurality of blockchains related to the target transaction, the serial number is used for identifying the target transaction, and the serial number is used for identifying the first sub-transaction.
For example, assuming that the target transaction is initiated by the service client 11 in the system shown in fig. 1, the transaction code of the target transaction is T1, the external serial number is 1234, the sent request message 1 carries transaction data a, the serial number of the target transaction is 0, the serial number of the sub-transaction 1 is 1, the serial number of the sub-transaction 2 is 2, and the serial number of the sub-transaction 3 is 3, optionally, the transaction processing device 20 may further define an internal serial number 1 for the target transaction, and then the transaction processing device 20 may record a sending table (which may also be referred to as a sending log table) as shown in table 1 below:
TABLE 1
Internal running number Serial number Transaction code External running number Request message
1 0 T1 1234 -
1 1 T1 1234 Request message 1 (transaction data a)
1 2 T1 1234 Request message 1 (transaction data a)
1 3 T1 1234 Request message 1 (transaction data a)
If the sub-transaction 1 and the sub-transaction 2 fail, and the sub-transaction 3 succeeds, the return messages fed back to the transaction processing device 20 by the blockchain 31, the blockchain 32, and the blockchain 33 are the return message 1, the return message 2, and the return message 3, respectively, where for the sub-transaction that fails in transaction, the transaction processing device 20 may also not receive the return message for a preset time (e.g., 3 minutes), and the embodiment of the present application describes that the return message is received but the transaction fails. Optionally, the return message may also be recorded in a receiving table of the transaction processing apparatus 20, and the receiving table (also referred to as a receiving log table) recorded on the transaction processing apparatus 20 may be, for example, as shown in table 2 below:
TABLE 2
Figure BDA0003568841280000091
Then, the transaction processing device 20 may look up table 2 to determine the sub-transactions with the indication information of failure as sub-transaction 1 and sub-transaction 2, so as to record the related information (which may also be referred to as log information) of sub-transaction 1 and sub-transaction 2 into the reimbursement table, which may include: the external serial number, the transaction code, the serial number and the reissue status may optionally include any one or more of a request message, an internal serial number and a reissue serial number. The reissue table in this example can be seen, for example, in table 3 below:
TABLE 3
Figure BDA0003568841280000092
It should be noted that, when a target transaction is initiated, the request message sent by each uplink sub-transaction, the received return message, and the related information of each sub-transaction may be recorded in the sending table and the receiving table. When a certain uplink sub-transaction fails to be executed, the related information of the corresponding uplink sub-transaction can be synchronized to the reissue table, and the status is set as 'reissuable'. After the normal flow of all uplink sub-transactions of the target transaction, a reissue flow can be executed, namely, the reissue table is read to reissue the sub-transactions with the state of 'reissuable', if the reissue is successful, the state is updated to 'not reissue', and the repeated reissue is avoided; if the transaction fails after reissuing the preset number of times (such as 3 times), the transaction result of the target transaction failure, the related information of the sub-transaction causing the failure, and the like can be sent to the service client for subsequent processing.
Taking the system shown in fig. 1 as an example, the transaction processing apparatus 20 may store a corresponding relationship between the transaction code and an interface of the access block chain of the transaction processing apparatus 20, for example, T1 corresponds to interface 1 of the access block chain 31, interface 2 of the access block chain 32, and interface 3 of the access block chain 33, and in a normal flow of the target transaction, the transaction processing apparatus 20 may determine to forward the transaction data a from interface 1, interface 2, and interface 3 to block chain 31, block chain 32, and block chain 33, respectively, according to the transaction code T1 of the target transaction. In the reimbursement process, the transaction processing device 20 may determine to forward the transaction data a from the interface 1 to the blockchain 31 according to the transaction code T1 corresponding to the "reissuable" sub-transaction 1 in the reissue table, or may determine to forward the transaction data a from the interface 2 to the blockchain 32 according to the transaction code T1 corresponding to the "reissuable" sub-transaction 2 in the reissue table.
The external serial number is used to distinguish between different transactions, and even if the transaction codes are the same, the use of the external serial number can determine that the two transactions are different. For example, the transaction codes of transaction 1 and transaction 2 initiated by the service client 1 are both T1, the external serial number of transaction 1 is 1234, and the external serial number of transaction 2 is 4321, so that different contents of the two transactions can be distinguished based on the external serial numbers.
The sequence numbers are used for indicating different sub-transactions in the same transaction, and the sequence number of the sub-transaction of each transaction can be increased from 1 or can be designed according to the requirement.
The internal serial number, which may be defined for different streams within the transaction processing device, is an optional entry in the various tables used for recording in the embodiments of the present application.
S202, based on the first reissue information, reissuing the transaction data to the first block chain.
In a specific implementation, the transaction processing device may generate a request message of the first sub-transaction based on the first reissue information, and send the request message to the first block chain. Alternatively, the transaction processing device may obtain a request packet of the first sub-transaction in the normal flow based on the first reissue information, and send the request packet to the first block chain.
It should be noted that the first reissue information in the reissue table may not include the request message, and then the transaction processing device may obtain the request message corresponding to the first sub-transaction from the sending table based on other contents (such as the external serial number, the serial number, and the transaction code) in the first reissue information, and then send the request message to the first block chain.
S203, responding to the successful uploading of the transaction data to the first block chain, modifying the first state in the first reissue information into a second state, and obtaining second reissue information, wherein the second reissue information comprises the second state, and the second state is used for indicating that the first sub-transaction is in a state of non-reissue.
Therefore, the reissue is realized in a targeted manner aiming at the first sub-transaction which fails in the normal process, and after the first sub-transaction is successfully reissued, the state of the first sub-transaction in the reissue table is modified to be 'unremittable', so that the repeated reissue of the same sub-transaction is avoided, and the resource waste is avoided.
If the reissue table also includes third reissue information for a second sub-transaction of the target transaction, then the method may further include:
s204, obtaining third reissue information, wherein the third reissue information comprises a second identifier, a third state and the transaction data of the second sub-transaction, the third state is used for indicating that the second sub-transaction is in a reissuable state, and the second identifier is used for identifying a second block chain corresponding to the second sub-transaction;
s205, based on the third reissue information, reissuing the transaction data to the second block chain;
s206, responding to the successful uploading of the transaction data to the second block chain, modifying the third state in the third reissue information into a fourth state, and obtaining fourth reissue information, wherein the fourth reissue information comprises the fourth state, and the fourth state is used for indicating that the second sub-transaction is in a state of non-reissue.
The relevant description of S204 to S206 can refer to the above S201 to S203, and is not described herein again.
Wherein the second identifier may include: the system comprises a transaction code, a serial number and a serial number, wherein the transaction code is used for indicating interfaces of a plurality of blockchains related to the target transaction, the serial number is used for identifying the target transaction, and the serial number is used for identifying the second sub-transaction. The transaction code and serial number in the first identifier and the second identifier may be the same for the same target transaction.
The execution order of S204 to S206 and S201 to S203 is not limited, and S204 to S206 may be executed first and then S201 to S203 may be executed, S201 to S203 may be executed first and then S204 to S206 may be executed, or S204 to S206 and S201 to S203 may be executed simultaneously.
In some implementations, if all "reissuable" sub-transactions in the target transaction are completed in the reissue flow, the method may further include: and if the reissue information of all the sub-transactions of the target transaction in the reissue table indicates that the corresponding sub-transactions are in a non-reissue state, determining that the target transaction is finished.
It should be noted that, if a certain sub-transaction is subjected to one reissue, and the reissue is not successful, the state of the sub-transaction in the reissue table may not be modified, and the reissue may be continued. The transaction processing device may preset an upper limit of the reimbursement number of each sub-transaction (i.e., the preset number of times, e.g., 3 times), and if the reimbursement number of one sub-transaction reaches the upper limit of the reimbursement number, may send an alarm signal to the service client to notify the service client that the target transaction cannot be completed. It will be appreciated that different reissue operations for a sub-transaction may be assigned different reissue flow numbers to record the different processes of reissuing the sub-transaction.
Therefore, by the method, when normal transaction is carried out, when the uplink sub-transaction of the target transaction fails, the reissue information of the sub-transaction which fails in transaction is recorded in the reissue table, the reissue information comprises the reissue state of the sub-transaction which fails in transaction, the reissue table is read, the sub-transaction which is in the reissue state is found out for reissuing, if the reissue is successful, the state is updated to be 'not reissue', and repeated reissue is avoided.
Correspondingly, the embodiment of the present application further provides a device 300 for transaction processing, which is shown in fig. 3. The apparatus 300 comprises:
a first obtaining unit 301, configured to obtain, from a reimbursement table, first reimbursement information of a first sub-transaction of a target transaction, where the reimbursement table is generated when an unsuccessful sub-transaction is monitored in the target transaction, where the unsuccessful sub-transaction includes the first sub-transaction, the first reimbursement information includes a first identifier, a first state, and transaction data of the first sub-transaction, the first state is used to indicate that the first sub-transaction is in a reimburseable state, and the first identifier is used to identify a first block chain corresponding to the first sub-transaction;
a first reimbursement unit 302, configured to reissue the transaction data to the first blockchain based on the first reissue information;
a first modifying unit 303, configured to modify the first state in the first reissue information to a second state in response to the successful uploading of the transaction data to the first block chain, and obtain second reissue information, where the second reissue information includes the second state, and the second state is used to indicate that the first sub-transaction is in a non-reissuable state.
Optionally, the apparatus 300 further comprises:
a generating unit, configured to generate the replenishment table according to a log table, where the log table includes first log information of the first sub-transaction, and the first log information includes: the first identification, the transaction data and first indication information, wherein the first indication information is used for indicating that the first sub-transaction fails.
Optionally, the log table includes a sending table and a receiving table, the sending table includes the transaction data and the first identifier, and the receiving table includes the first identifier and the first indication information.
Optionally, the reissue table further includes third reissue information of a second sub-transaction of the target transaction, and the apparatus 300 further includes:
a second obtaining unit, configured to obtain third reissue information, where the third reissue information includes a second identifier, a third state, and the transaction data of the second sub-transaction, where the third state is used to indicate that the second sub-transaction is in a reissuable state, and the second identifier is used to identify a second block chain corresponding to the second sub-transaction;
a second reissue unit, configured to reissue the transaction data to the second block chain based on the third reissue information;
a second modifying unit, configured to modify the third state in the third reissue information to a fourth state in response to the successful uploading of the transaction data to the second block chain, so as to obtain fourth reissue information, where the fourth reissue information includes the fourth state, and the fourth state is used to indicate that the second sub-transaction is in a non-reissuable state.
Optionally, the apparatus 300 further comprises:
and the determining unit is used for determining that the target transaction is finished if the reissue information of all the sub-transactions of the target transaction in the reissue table indicates that the corresponding sub-transactions are in a state of being not reissued.
Optionally, the first identifier includes:
the system comprises a transaction code, a serial number and a serial number, wherein the transaction code is used for indicating interfaces of a plurality of blockchains related to the target transaction, the serial number is used for identifying the target transaction, and the serial number is used for identifying the first sub-transaction.
It should be noted that, for the specific implementation of the apparatus 300 and the achieved technical effect, reference may be made to the related description of the method shown in fig. 2.
In addition, an embodiment of the present application further provides an electronic device 400, as shown in fig. 4, the electronic device 400 includes a processor 401 and a memory 402:
the memory 402 is used for storing computer programs;
the processor 401 is configured to execute the method provided by the embodiment of the present application according to the computer program.
In addition, the embodiment of the present application also provides a computer-readable storage medium, which is used for storing a computer program, and the computer program is used for executing the method provided by the embodiment of the present application.
In addition, the embodiment of the present application further provides a transaction processing system 500, where the transaction processing system 500 includes a service client 501, a transaction processing module 502, and at least two block chains 503, where:
a service client 501, configured to send transaction data to the transaction processing module 502;
a transaction processing module 502, configured to execute the method provided in the embodiment of the present application, and send transaction data to at least two blockchains 503;
at least two blockchains 503 for receiving and storing transaction data.
It should be noted that the transaction processing module 502 can refer to the device 20 for transaction processing in fig. 1 and the related description of the device 300 for transaction processing in fig. 3.
As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by software plus a general hardware platform. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a storage medium, such as a read-only memory (ROM)/RAM, a magnetic disk, an optical disk, or the like, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network communication device such as a router) to execute the method according to the embodiments or some parts of the embodiments of the present application.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, system embodiments and device embodiments are substantially similar to method embodiments and are therefore described in a relatively simple manner, where relevant reference may be made to some descriptions of method embodiments. The above-described embodiments of the apparatus and system are merely illustrative, wherein modules described as separate parts may or may not be physically separate, and parts shown as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only a preferred embodiment of the present application and is not intended to limit the scope of the present application. It should be noted that, for a person skilled in the art, several improvements and modifications can be made without departing from the scope of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (14)

1. A method of transaction processing, comprising:
acquiring first reissue information of a first sub-transaction of a target transaction from a reissue table, wherein the reissue table is generated when an unsuccessful sub-transaction exists in the target transaction, the unsuccessful sub-transaction comprises the first sub-transaction, the first reissue information comprises a first identifier, a first state and transaction data of the first sub-transaction, the first state is used for indicating that the first sub-transaction is in a reissuable state, and the first identifier is used for identifying a first block chain corresponding to the first sub-transaction;
subsidizing the transaction data to the first blockchain based on the first reissue information;
and responding to the successful uploading of the transaction data to the first block chain, modifying the first state in the first reissue information into a second state, and obtaining second reissue information, wherein the second reissue information comprises the second state, and the second state is used for indicating that the first sub-transaction is in a state of being not reissued.
2. The method of claim 1, further comprising:
generating the replenishment table according to a log table, wherein the log table comprises first log information of the first sub-transaction, and the first log information comprises: the first identification, the transaction data and first indication information, wherein the first indication information is used for indicating that the first sub-transaction fails.
3. The method of claim 2, wherein the log table comprises a send table and a receive table, the send table comprising the transaction data and the first identifier, the receive table comprising the first identifier and the first indication information.
4. The method of claim 1, wherein the reissue table further comprises third reissue information for a second sub-transaction of the target transaction, the method further comprising:
acquiring third reissue information, wherein the third reissue information comprises a second identifier, a third state and the transaction data of the second sub-transaction, the third state is used for indicating that the second sub-transaction is in a reissuable state, and the second identifier is used for identifying a second block chain corresponding to the second sub-transaction;
subsidizing the transaction data to the second blockchain based on the third reissue information;
and in response to the successful uploading of the transaction data to the second block chain, modifying the third state in the third reissue information into a fourth state, and obtaining fourth reissue information, wherein the fourth reissue information comprises the fourth state, and the fourth state is used for indicating that the second sub-transaction is in a state of non-reissue.
5. The method according to any one of claims 1-4, further comprising:
and if the reissue information of all the sub-transactions of the target transaction in the reissue table indicates that the corresponding sub-transactions are in a non-reissue state, determining that the target transaction is finished.
6. The method according to any of claims 1-4, wherein the first identification comprises:
the system comprises a transaction code, a serial number and a serial number, wherein the transaction code is used for indicating interfaces of a plurality of blockchains related to the target transaction, the serial number is used for identifying the target transaction, and the serial number is used for identifying the first sub-transaction.
7. An apparatus for transaction processing, comprising:
a first obtaining unit, configured to obtain, from a reimbursement table, first reimbursement information of a first sub-transaction of a target transaction, where the reimbursement table is generated when an unsuccessful sub-transaction is monitored in the target transaction, where the unsuccessful sub-transaction includes the first sub-transaction, the first reimbursement information includes a first identifier, a first state, and transaction data of the first sub-transaction, the first state is used to indicate that the first sub-transaction is in a reimburseable state, and the first identifier is used to identify a first block chain corresponding to the first sub-transaction;
a first reissue unit, configured to reissue the transaction data to the first blockchain based on the first reissue information;
the first modification unit is used for modifying the first state in the first reissue information into a second state in response to the successful uploading of the transaction data to the first block chain, and obtaining second reissue information, wherein the second reissue information comprises the second state, and the second state is used for indicating that the first sub-transaction is in a non-reissuable state.
8. The apparatus of claim 7, further comprising:
a generating unit, configured to generate the replenishment table according to a log table, where the log table includes first log information of the first sub-transaction, and the first log information includes: the first identification, the transaction data and first indication information, wherein the first indication information is used for indicating that the first sub-transaction fails.
9. The apparatus of claim 8, wherein the log table comprises a send table and a receive table, wherein the send table comprises the transaction data and the first identifier, and wherein the receive table comprises the first identifier and the first indication information.
10. The apparatus of claim 7, wherein the reissue table further comprises third reissue information for a second sub-transaction of the target transaction, the apparatus further comprising:
a second obtaining unit, configured to obtain third reissue information, where the third reissue information includes a second identifier, a third state, and the transaction data of the second sub-transaction, where the third state is used to indicate that the second sub-transaction is in a reissuable state, and the second identifier is used to identify a second block chain corresponding to the second sub-transaction;
a second reissue unit, configured to reissue the transaction data to the second blockchain based on the third reissue information;
a second modifying unit, configured to modify the third state in the third reissue information to a fourth state in response to the successful uploading of the transaction data to the second block chain, so as to obtain fourth reissue information, where the fourth reissue information includes the fourth state, and the fourth state is used to indicate that the second sub-transaction is in a non-reissuable state.
11. The apparatus according to any one of claims 7-10, further comprising:
and the determining unit is used for determining that the target transaction is finished if the reissue information of all the sub-transactions of the target transaction in the reissue table indicates that the corresponding sub-transactions are in the state of being unable to be reissued.
12. The apparatus according to any of claims 7-10, wherein the first identifier comprises:
the system comprises a transaction code, a serial number and a serial number, wherein the transaction code is used for indicating interfaces of a plurality of blockchains related to the target transaction, the serial number is used for identifying the target transaction, and the serial number is used for identifying the first sub-transaction.
13. An electronic device, comprising a processor and a memory:
the memory is used for storing a computer program;
the processor is adapted to perform the method of any of claims 1-6 in accordance with the computer program.
14. A computer-readable storage medium, characterized in that the computer-readable storage medium is used to store a computer program for performing the method of any of claims 1-6.
CN202210312305.0A 2022-03-28 2022-03-28 Transaction processing method and device Pending CN114637758A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210312305.0A CN114637758A (en) 2022-03-28 2022-03-28 Transaction processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210312305.0A CN114637758A (en) 2022-03-28 2022-03-28 Transaction processing method and device

Publications (1)

Publication Number Publication Date
CN114637758A true CN114637758A (en) 2022-06-17

Family

ID=81949759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210312305.0A Pending CN114637758A (en) 2022-03-28 2022-03-28 Transaction processing method and device

Country Status (1)

Country Link
CN (1) CN114637758A (en)

Similar Documents

Publication Publication Date Title
CN108536532B (en) Batch task processing method and system
CN110581887B (en) Data processing method, device, block chain node and storage medium
CN107436799B (en) Method and device for realizing consistency of distributed transactions
CN110995851B (en) Message processing method, device, storage medium and equipment
CN112446786A (en) Abnormal transaction processing method and device, electronic equipment and readable storage medium
CN111367934B (en) Data consistency checking method, device, server and medium
CN111737055A (en) Service processing method, device, equipment and computer readable storage medium
CN114637758A (en) Transaction processing method and device
CN112995262A (en) Distributed transaction submission method, system and computing equipment
CN112131180B (en) Data reporting method, device and storage medium
CN111061576B (en) Method and system for creating entity object
CN113656374A (en) Method and device for processing service message with attachment
CN112950171A (en) Bank business processing system and method
CN109034768B (en) Financial reconciliation method, apparatus, computer device and storage medium
CN111488236A (en) Order abnormity processing method, server, storage medium and processing device
US10885014B2 (en) Assigning monitoring responsibilities in distributed systems using optimistic concurrency
CN111586841A (en) Terminal paging optimization method, system, device and readable storage medium
CN112099921A (en) Java application system preheating method and system based on JVM
CN108984285B (en) Data collision flow analysis method and device, storage medium and terminal
CN112732413B (en) Exception handling method, exception handling device, computer equipment and computer readable storage medium
CN116720818B (en) Warehouse processing method, device and computer equipment based on block chain
CN110209512B (en) Data checking method and device based on multiple data sources
CN111475306B (en) Micro service node, asynchronous task processing method, system and storage medium
CN116302652A (en) System alarm information processing method and device and electronic equipment
CN115499492A (en) Application service exception handling method, device, equipment and readable storage medium

Legal Events

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