CN112714158A - Transaction processing method, relay network, cross-link gateway, system, medium, and device - Google Patents
Transaction processing method, relay network, cross-link gateway, system, medium, and device Download PDFInfo
- Publication number
- CN112714158A CN112714158A CN202011521609.5A CN202011521609A CN112714158A CN 112714158 A CN112714158 A CN 112714158A CN 202011521609 A CN202011521609 A CN 202011521609A CN 112714158 A CN112714158 A CN 112714158A
- Authority
- CN
- China
- Prior art keywords
- relay
- application block
- block chain
- node
- cross
- 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.)
- Granted
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 34
- 238000004088 simulation Methods 0.000 claims abstract description 147
- 238000000034 method Methods 0.000 claims abstract description 71
- 238000012795 verification Methods 0.000 claims abstract description 45
- 238000012545 processing Methods 0.000 claims description 42
- 238000004590 computer program Methods 0.000 claims description 12
- 238000010586 diagram Methods 0.000 description 26
- 238000004891 communication Methods 0.000 description 13
- 230000004044 response Effects 0.000 description 11
- 230000008569 process Effects 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 5
- 230000005236 sound signal Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/562—Brokering proxy services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/63—Routing a service request depending on the request content or context
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer And Data Communications (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present disclosure relates to a transaction processing method, a relay network, a cross-link gateway, a system, a medium, and a device, and relates to the technical field of electronic information, wherein the method is applied to the relay network, and includes: the method comprises the steps that a transaction request sent by a client side is received through each relay node, a pre-execution request is sent to a cross-link gateway corresponding to each application block chain through a main node, a simulation execution result sent by the cross-link gateway corresponding to each application block chain is received through the main node, each simulation execution result is broadcasted to each relay node, each simulation execution result is verified through each relay node according to a relay intelligent contract corresponding to a relay network, and under the condition that each simulation execution result passes the verification of each relay node and each simulation execution result is successful, an execution request is sent to the cross-link gateway corresponding to each application block chain through the main node, so that the cross-link gateway corresponding to the application block chain executes the transaction request on the application block chain.
Description
Technical Field
The present disclosure relates to the field of electronic information technologies, and in particular, to a transaction processing method, a relay network, a cross-link gateway, a system, a medium, and a device.
Background
With the continuous development of electronic information technology and network communication, the transmission of service data through network communication has become a main technical means in each service field, and therefore, how to ensure that service data can be transmitted safely and reliably through network communication has become a research focus of electronic information technology. The Block chain technology is a distributed, decentralized and distrust-free network data consensus storage technology, and synchronous and reliable distributed computing is realized on the basis of a Block (Block) generation mechanism and an English (Peer-to-Peer networking, abbreviated as P2P network) communication mechanism.
Because the blockchains are relatively independent, when a transaction (which may be understood as one transaction involving multiple blockchains) crossing the blockchains is processed, in order to ensure consistency of the transaction, a two-phase commit or a hash time lock is often required to be implemented. However, both two-phase commit and hash time locking can degrade the processing performance of the transaction, resulting in slow response times.
Disclosure of Invention
The disclosure aims to provide a transaction processing method, a relay network, a cross-link gateway, a system, a medium and a device, which are used for solving the problems of low processing performance and slow response time when a cross-block-chain transaction is processed.
In order to achieve the above object, according to a first aspect of the embodiments of the present disclosure, there is provided a transaction processing method applied to a relay network, where the relay network is a peer-to-peer network and includes a first number of relay nodes, the method including:
receiving a transaction request sent by a client through each relay node, wherein the transaction request corresponds to a second number of application block chains;
sending a pre-execution request to a cross-chain gateway corresponding to each application block chain through a main node, so that the cross-chain gateway corresponding to the application block chain simulates and executes the transaction request on the application block chain, wherein the main node is any relay node;
receiving, by the master node, a simulation execution result sent by the inter-link gateway corresponding to each application block chain, and broadcasting each simulation execution result to each relay node;
verifying each simulation execution result through each relay node according to a relay intelligent contract corresponding to the relay network;
and sending an execution request to the cross-chain gateway corresponding to each application block chain through the main node under the condition that each simulation execution result passes the verification of each relay node and each simulation execution result is successful, so that the cross-chain gateway corresponding to the application block chain executes the transaction request on the application block chain.
Optionally, after the sending, by the master node, an execution request to the inter-chain gateway corresponding to each application block chain, the method further includes:
receiving, by the master node, execution results sent by the inter-link gateway corresponding to each of the application block chains, and broadcasting each of the execution results to each of the relay nodes;
and verifying each execution result through each relay node according to the relay intelligent contract, and sending each execution result to the client under the condition that each execution result passes the verification.
Optionally, before the sending, by the master node, a pre-execution request to the cross-chain gateway corresponding to each application block chain, the method further includes:
verifying the transaction request according to the relay intelligent contract through each relay node;
the sending, by the master node, a pre-execution request to the inter-chain gateway corresponding to each application block chain includes:
and sending the pre-execution request to the cross-chain gateway corresponding to each application block chain through the main node under the condition that the transaction request passes the verification of each relay node.
Optionally, the pre-execution request is configured to enable the cross-link gateway corresponding to each application blockchain to simulate and execute the transaction request on the application blockchain, and set target book data in the application blockchain to an occupied state, where the target book data is book data used when the transaction request is simulated and executed;
the execution request is used for enabling the cross-link gateway corresponding to each application block chain to execute the transaction request on the target account book data in the application block chain, and setting the target account book data in the application block chain to be in an idle state.
Optionally, the method further comprises:
and when each simulation execution result passes the verification of each relay node and at least one simulation execution result is failed, sending a rollback request to the cross-link gateway corresponding to each application block chain through the main node, so that the cross-link gateway corresponding to the application block chain sets the target account book data in the application block chain to be in an idle state.
Optionally, the method further comprises:
if the master node does not receive the simulation execution result sent by the cross-link gateway corresponding to each application block chain within a preset time length, a rollback request is sent to the cross-link gateway corresponding to each application block chain through the master node, so that the cross-link gateway corresponding to the application block chain sets the target account book data in the application block chain to be in an idle state.
Optionally, the method further comprises:
and under the condition that each simulation execution result passes the verification of each relay node and at least one simulation execution result is failed, the main node sends the pre-execution request to the cross-link gateway corresponding to each application block chain again.
Optionally, each relay node has a relay block chain stored thereon, and the method further includes:
receiving, by the master node, registration information sent by the inter-link gateway corresponding to each application block chain, and broadcasting the registration information to each relay node, where the registration information includes a first transaction tag of the application block chain;
verifying the registration information by each relay node according to the relay intelligent contract, and storing the registration information into the relay block chain under the condition that the registration information passes the verification of each relay node;
before the sending, by the master node, a pre-execution request to the cross-chain gateway corresponding to each application block chain, the method further includes:
determining, by the master node, a second number of the application block chains that match the first transaction tag with a second transaction tag included in the transaction request.
Optionally, the method further comprises:
storing, by each of the relay nodes, the transaction request, and/or the pre-execution request into the relay block chain;
and under the condition that each simulation execution result passes the verification of each relay node, storing each simulation execution result into the relay block chain through each relay node.
According to a second aspect of the embodiments of the present disclosure, a transaction processing method is provided, which is applied to a cross-chain gateway, where the cross-chain gateway corresponds to an application block chain; the method comprises the following steps:
receiving a pre-execution request sent by a master node in a relay network, wherein the relay network is a peer-to-peer network and comprises a plurality of relay nodes, the master node is any one of the relay nodes, and the pre-execution request is sent by the master node after each relay node receives a transaction request sent by a client;
simulating and executing the transaction request on the application block chain, and sending a simulation execution result to the main node;
and receiving an execution request sent by the main node, and executing the transaction request on the application block chain.
Optionally, the simulating executing the transaction request on the application blockchain includes:
simulating and executing the transaction request on the application block chain, and setting target book data in the application block chain to be in an occupied state, wherein the target book data is book data used when the transaction request is simulated and executed;
the executing the transaction request on the application block chain comprises:
and executing the transaction request on the application block chain, and setting the target ledger data to be in an idle state.
Optionally, the method further comprises:
and receiving a rollback request sent by the main node, and setting the target account book data to be in an idle state.
According to a third aspect of the embodiments of the present disclosure, a relay network is provided, where the relay network is a peer-to-peer network and includes a first number of relay nodes;
each relay node is used for receiving a transaction request sent by a client, wherein the transaction request corresponds to a second number of application block chains;
the main node is used for sending a pre-execution request to the cross-chain gateway corresponding to each application block chain so that the cross-chain gateway corresponding to the application block chain can simulate and execute the transaction request on the application block chain, and the main node is any relay node;
the master node is further configured to receive a simulation execution result sent by the inter-link gateway corresponding to each application block chain, and broadcast each simulation execution result to each relay node;
each relay node is further configured to verify each simulation execution result according to a relay intelligent contract corresponding to the relay network;
and when each simulation execution result passes the verification of each relay node and each simulation execution result is successful, the master node is further configured to send an execution request to the inter-link gateway corresponding to each application block chain, so that the inter-link gateway corresponding to the application block chain executes the transaction request on the application block chain.
Optionally, the master node is further configured to receive an execution result sent by the inter-chain gateway corresponding to each application block chain after sending an execution request to the inter-chain gateway corresponding to each application block chain, and broadcast each execution result to each relay node;
each relay node is further configured to check each execution result according to the relay intelligent contract, and send each execution result to the client when each execution result passes the check.
Optionally, each relay node is further configured to check the transaction request according to the relay intelligent contract before the master node sends a pre-execution request to the inter-link gateway corresponding to each application block chain;
the master node is configured to send the pre-execution request to the inter-chain gateway corresponding to each application block chain when the transaction request passes the check of each relay node.
Optionally, the pre-execution request is configured to enable the cross-link gateway corresponding to each application blockchain to simulate and execute the transaction request on the application blockchain, and set target book data in the application blockchain to an occupied state, where the target book data is book data used when the transaction request is simulated and executed;
the execution request is used for enabling the cross-link gateway corresponding to each application block chain to execute the transaction request on the target account book data in the application block chain, and setting the target account book data in the application block chain to be in an idle state.
Optionally, the master node is further configured to send a rollback request to the inter-chain gateway corresponding to each application block chain when each simulation execution result passes verification of each relay node and at least one simulation execution result is failed, so that the inter-chain gateway corresponding to the application block chain sets the target account book data in the application block chain to an idle state.
Optionally, the host node is further configured to send a rollback request to the inter-chain gateway corresponding to each application block chain if the host node does not receive the simulation execution result sent by the inter-chain gateway corresponding to each application block chain within a preset time length, so that the inter-chain gateway corresponding to the application block chain sets the target account book data in the application block chain to an idle state.
Optionally, the master node is further configured to send the pre-execution request to the inter-link gateway corresponding to each application block chain again when each simulation execution result passes verification of each relay node and at least one simulation execution result fails.
Optionally, each relay node stores a relay block chain;
the master node is further configured to receive registration information sent by the inter-link gateway corresponding to each application block chain, and broadcast the registration information to each relay node, where the registration information includes a first transaction tag of the application block chain;
each relay node is further configured to verify the registration information according to the relay intelligent contract, and store the registration information into the relay block chain when the registration information passes the verification of each relay node;
the master node is further configured to determine, according to a second transaction tag included in the transaction request, a second number of the application block chains that are matched with the first transaction tag and the second transaction tag before sending a pre-execution request to the inter-chain gateway corresponding to each application block chain.
Optionally, each relay node is further configured to store the transaction request and/or the pre-execution request into the relay block chain, and store each simulation execution result into the relay block chain when each simulation execution result passes the check of each relay node.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a cross-chain gateway, including:
the system comprises a receiving module, a pre-execution module and a processing module, wherein the receiving module is used for receiving a pre-execution request sent by a main node in a relay network, the relay network is a peer-to-peer network and comprises a plurality of relay nodes, the main node is any one of the relay nodes, and the pre-execution request is sent by the main node after each relay node receives a transaction request sent by a client;
the simulation execution module is used for simulating and executing the transaction request on the application block chain and sending a simulation execution result to the main node;
and the execution module is used for receiving the execution request sent by the main node and executing the transaction request on the application block chain.
Optionally, the simulation execution module is configured to simulate execution of the transaction request on the application block chain, and set target book data in the application block chain to an occupied state, where the target book data is book data used when the transaction request is simulated to be executed;
the execution module is configured to execute the transaction request on the application block chain, and set the target ledger data to an idle state.
Optionally, the cross-chain gateway further comprises:
and the rollback module is used for receiving a rollback request sent by the main node and setting the target account book data to be in an idle state.
According to a fifth aspect of embodiments of the present disclosure, there is provided a transaction processing system, the system comprising: the system comprises a relay network, a plurality of application block chains and a cross-link gateway corresponding to each application block chain;
the relay network is configured to perform the transaction processing method according to the first aspect of the embodiment of the present disclosure;
each of the cross-chain gateways is configured to execute the transaction processing method according to the second aspect of the embodiment of the present disclosure.
According to a sixth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect of embodiments of the present disclosure.
According to a seventh aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of the first aspect of an embodiment of the disclosure.
According to an eighth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, performs the steps of the method of the second aspect of the embodiments of the present disclosure.
According to a ninth aspect of embodiments of the present disclosure, there is provided an electronic apparatus including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of the second aspect of the embodiments of the present disclosure.
According to the technical scheme, the transaction processing method provided by the disclosure comprises the steps that transaction requests corresponding to a second number of application block chains and sent by a client side are received through a first number of relay nodes, then a pre-execution request is sent to a cross-chain gateway corresponding to each application block chain by a main node, the cross-chain gateway simulates execution of the transaction requests on the corresponding application block chains, and simulated execution results are sent to the main node. The main node broadcasts the received simulation execution result to each relay node, the relay nodes verify the simulation execution result according to the relay intelligent contract, and finally, the main node sends an execution request to each cross-link gateway under the condition that each simulation execution result passes the verification of each relay node and each simulation execution result is successful, and the cross-link gateway executes a transaction request on the corresponding application block chain. The method and the device coordinate among the application block chains through the peer relay nodes in the relay network, realize distributed relay, center removal and trust removal, simultaneously realize the execution of transaction requests on the application block chains through the cross-chain gateway corresponding to each application block chain, can quickly process cross-chain transactions on the premise of ensuring the consistency of the transactions, improve the processing performance and shorten the response time.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a schematic diagram illustrating a transaction processing system in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a method of transaction processing in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating another method of transaction processing in accordance with an illustrative embodiment;
FIG. 4 is a flow diagram illustrating another method of transaction processing in accordance with an illustrative embodiment;
FIG. 5 is a flow diagram illustrating another method of transaction processing in accordance with an illustrative embodiment;
FIG. 6 is a flow diagram illustrating another method of transaction processing in accordance with an illustrative embodiment;
FIG. 7 is a flow diagram illustrating another method of transaction processing in accordance with an illustrative embodiment;
FIG. 8 is a flow diagram illustrating another method of transaction processing in accordance with an illustrative embodiment;
FIG. 9 is a flow diagram illustrating another method of transaction processing in accordance with an illustrative embodiment;
FIG. 10 is a flow diagram illustrating a method of transaction processing in accordance with an exemplary embodiment;
FIG. 11 is a flow diagram illustrating another method of transaction processing in accordance with an illustrative embodiment;
fig. 12 is a schematic diagram illustrating a relay network in accordance with an example embodiment;
FIG. 13 is a block diagram illustrating a cross-chain gateway in accordance with an exemplary embodiment;
FIG. 14 is a block diagram illustrating another cross-chain gateway in accordance with an illustrative embodiment;
FIG. 15 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Before introducing the transaction processing method, the relay network, the cross-chain gateway, the system, the medium, and the device provided by the present disclosure, an application scenario related to various embodiments of the present disclosure is first introduced, where the application scenario may be a scenario for processing a transaction of a cross-block chain, and may be a transaction processing system, as shown in fig. 1, the transaction processing system includes the relay network, a second number of application block chains, and a cross-chain gateway corresponding to each application block chain (the second number is 2 in fig. 1 for example).
The relay network is a peer-to-peer network, and includes a plurality of nodes, each node is in a peer-to-peer position, the plurality of nodes may be divided into two categories, one category is a first number of relay nodes (which may be understood as endorsement nodes in the relay network) that store relay intelligent contracts corresponding to the relay network and have an endorsement function, and the other category is a third number of other nodes (the first number is 5 in fig. 1 for example) that store relay intelligent contracts. Further, a relay block chain may be stored in the relay network, and is used to record data in the relay network, that is, each node in the relay network stores the relay block chain. Specifically, the relay intelligent contract corresponding to the relay network may be understood as a code stored in each node and used for implementing access and control on data in the relay network. Each relay node can verify the information received by the relay network according to the relay intelligent contract, if the information passes the verification of each relay node, it indicates that each relay node agrees with the information, and the relay network can perform corresponding processing (i.e. execute a transaction) on the information. That is to say, the relay intelligent contract enables each relay node in the relay network to execute the transaction after reaching the consensus, so that the consistency of the transaction in the relay network can be ensured.
The second number of application blockchains, may be understood as blockchains to which transactions across blockchains are to involve. Transactions across blockchains may include asset transactions, asset transfers, and the like. For example, for an a transaction crossing a block chain, if a record "X is increased by 1" is added to an a application block chain and a record "Y is decreased by 1" is added to a b application block chain, the application block chains corresponding to the a transaction are the a application block chain and the b application block chain. Each application blockchain is stored on each application node in the corresponding application blockchain network, and each application node in each application blockchain network is in a peer-to-peer status.
And each application block chain is provided with a corresponding cross-chain gateway, and the cross-chain gateway can be understood as a proxy of the application block chain, can access and operate the application block chain, and can simultaneously carry out data communication with a relay network. It should be noted that the first number and the second number mentioned above are positive integers greater than 1, and the third number may be a natural number. The following description is directed to a specific implementation of the transaction processing method.
Fig. 2 is a flowchart illustrating a transaction processing method according to an exemplary embodiment, where the method is applied to a relay network, the relay network is a peer-to-peer network, and includes a first number of relay nodes, and includes the following steps:
For example, when a user needs to execute a transaction across a block chain, a transaction request for instructing execution of the transaction may be sent to each relay node in the relay network through the client. The transaction request may include the identifiers of the corresponding second number of application block chains, and may further include a transaction tag (that is, the second transaction tag mentioned later) of the transaction to be executed, a client identifier, a client identity credential, and the like. After each relay node receives the transaction request, the transaction request can be verified according to the relay intelligent contract, and if the transaction request passes the verification of each relay node, the fact that each relay node agrees with the transaction request is shown. After each relay node agrees on the transaction request, each relay node may record the transaction request, e.g., in a relay block chain. The client can be a mobile terminal with a display interface, such as a smart phone, a tablet computer, a smart television, a smart watch, a PDA (Personal Digital Assistant, English), a portable computer, and the like, or a fixed terminal, such as a desktop computer.
For example, after each relay node agrees on the transaction request, a pre-execution request may be sent to the inter-chain gateway corresponding to each application block chain through the master node. The master node may be any relay node, for example, a relay node that has more resources (e.g., power, uptime, maintenance, storage space, memory, etc.) and is derived from a first number of relay nodes. In the process of implementing the transaction processing method, the master node may be designated or updated in real time. Under the condition that the main node is designated, a long link can be established between the main node and the cross-link gateway corresponding to each application block chain, so that the efficiency of data transmission between the main node and the cross-link gateway corresponding to each application block chain is improved.
After receiving the pre-execution request, the cross-link gateway corresponding to each application blockchain may simulate an execution transaction request on the application blockchain to obtain a result of the simulation execution transaction request of the application blockchain, that is, a simulated execution result, where the simulated execution result may be success or failure. The simulation of executing the transaction request may be understood as performing transaction endorsement on the transaction request on the application blockchain, and only determining whether the transaction request can be executed on the application blockchain without affecting the ledger data on the application blockchain. After obtaining the simulation execution result of the application block chain, the cross-link gateway corresponding to the application block chain sends the simulation execution result to the host node.
And 103, receiving the simulation execution result sent by the cross-link gateway corresponding to each application block chain through the main node, and broadcasting each simulation execution result to each relay node.
And 104, verifying each simulation execution result through each relay node according to a relay intelligent contract corresponding to the relay network.
For example, after receiving the simulation execution result sent by the inter-chain gateway corresponding to each application blockchain, the master node may broadcast each simulation execution result to each relay node. After receiving the second number of simulation execution results, each relay node firstly checks each simulation execution result according to a relay intelligent contract. If the second number of simulation execution results pass the verification of each relay node, it indicates that each relay node agrees with the second number of simulation execution results.
And 105, when each simulation execution result passes the verification of each relay node and each simulation execution result is successful, sending an execution request to the cross-link gateway corresponding to each application block chain through the main node, so that the cross-link gateway corresponding to the application block chain executes a transaction request on the application block chain.
For example, after each relay node agrees with the second number of simulation execution results, each simulation execution result may be determined, and if each simulation execution result is successful, it indicates that the second number of application blockchains may all execute the transaction request, and at this time, the master node may send the execution request to the inter-link gateway corresponding to each application blockchain. After receiving the execution request, the cross-chain gateway corresponding to the application block chain may execute the transaction request on the application block chain, thereby implementing execution of the transaction request on a second number of application block chains. In this way, since the relay nodes in the relay network are peer-to-peer, the relay network coordinates among the second number of application blockchains through a distributed, decentralized, and distrusted framework, such that each application blockchain can maintain a distributed, decentralized, and distrusted framework. Meanwhile, a corresponding cross-link gateway is arranged for each application block chain, the cross-link gateway is used as a proxy of the application block chain to execute a transaction request on the application block chain, two-stage submission or hash time locking is not needed, cross-link transactions can be quickly processed on the premise of ensuring transaction consistency, processing performance is improved, and response time is shortened.
In summary, in the transaction processing method provided by the present disclosure, first, the first number of relay nodes receive transaction requests corresponding to the second number of application block chains, which are sent by the client, and then the master node sends a pre-execution request to the inter-link gateway corresponding to each application block chain, and the inter-link gateway simulates execution of the transaction requests on the corresponding application block chains and sends the simulated execution results to the master node. The main node broadcasts the received simulation execution result to each relay node, the relay nodes verify the simulation execution result according to the relay intelligent contract, and finally, the main node sends an execution request to each cross-link gateway under the condition that each simulation execution result passes the verification of each relay node and each simulation execution result is successful, and the cross-link gateway executes a transaction request on the corresponding application block chain. The method and the device coordinate among the application block chains through the peer relay nodes in the relay network, realize distributed relay, center removal and trust removal, simultaneously realize the execution of transaction requests on the application block chains through the cross-chain gateway corresponding to each application block chain, can quickly process cross-chain transactions on the premise of ensuring the consistency of the transactions, improve the processing performance and shorten the response time.
FIG. 3 is a flow diagram illustrating another method of transaction processing according to an example embodiment, as shown in FIG. 3, after step 105, the method may further include:
and 106, receiving the execution result sent by the cross-link gateway corresponding to each application block chain through the main node, and broadcasting each execution result to each relay node.
And 107, verifying each execution result through each relay node according to the relay intelligent contract, and sending each execution result to the client under the condition that each execution result passes the verification.
For example, after the cross-link gateway corresponding to each application blockchain executes the transaction request on the application blockchain, a result of executing the transaction request by the application blockchain, that is, an execution result, may be obtained, where the execution result may be success or failure. Executing the transaction request may be understood as performing a transaction on the application blockchain, that is, performing an operation on the ledger data on the application blockchain, for example, adding a record. After obtaining the execution result of the application block chain, the cross-link gateway corresponding to the application block chain sends the execution result to the host node.
After receiving the execution result sent by the inter-chain gateway corresponding to each application blockchain, the master node may broadcast each execution result to each relay node. After receiving the second number of execution results, each relay node checks each execution result according to the relay intelligent contract. If the second number of execution results pass the verification of each relay node, it indicates that each relay node agrees with the second number of execution results. In an implementation manner, after each relay node agrees with the second number of simulation execution results, each relay node may send the second number of execution results to the client, and if the second number of execution results sent by each relay node received by the client are the same, the second number of execution results may be confirmed. In another implementation, the main node may send the second number of execution results to the client, and the client directly confirms the second number of execution results.
FIG. 4 is a flow diagram illustrating another method of transaction processing, according to an example embodiment, as shown in FIG. 4, prior to step 102, the method further comprising:
and step 108, verifying the transaction request by each relay node according to the relay intelligent contract.
Accordingly, the implementation manner of step 102 may be:
and under the condition that the transaction request passes the verification of each relay node, sending a pre-execution request to a cross-chain gateway corresponding to each application block chain through the main node.
For example, before the master node sends the pre-execution request to the inter-link gateway corresponding to each application block chain, the relay network may check the transaction request according to a relay intelligent contract through each relay node, and if the transaction request passes the check of each relay node, it indicates that each relay node agrees with the transaction request. After each relay node agrees with the transaction request, each relay node may record the transaction request, and the master node may send a pre-execution request to the inter-link gateway corresponding to each application block chain.
In an application scenario, a pre-execution request is used to enable a cross-link gateway corresponding to each application blockchain to simulate an execution transaction request on the application blockchain, and set target ledger data in the application blockchain to an occupied state, where the target ledger data is ledger data used when the execution transaction request is simulated.
And the execution request is used for enabling the cross-link gateway corresponding to each application block chain to execute the transaction request on the target account book data in the application block chain and setting the target account book data in the application block chain to be in an idle state.
For example, to further ensure consistency of the transaction, the pre-execution request indicates the inter-link gateway corresponding to each application block chain, and indicates the inter-link gateway corresponding to the application block chain while simulating the execution of the transaction request on the application block chain, and sets the target ledger data in the application block chain to an occupied state, so that it can be ensured that the target ledger data is not modified by other transactions before the transaction request is executed on the target ledger data. The target ledger data is ledger data used when the transaction request is executed in a simulation mode, and can be understood as ledger data related to the transaction request.
Correspondingly, the execution request indicates the cross-link gateway corresponding to each application block chain, and the cross-link gateway corresponding to the application block chain also indicates the cross-link gateway corresponding to the application block chain to set the target account book data in the application block chain to an idle state while executing the transaction request on the target account book data in the application block chain. For example, if the target ledger data corresponding to the transaction request is "XX", then when the transaction request is executed using "XX" simulation, the storage status of "XX" may be set to "1" to indicate that "XX" is in the occupied status. After the transaction request is executed on "XX", the storage state of "XX" may be set to "0" to indicate that "XX" is in an idle state.
FIG. 5 is a flow diagram illustrating another method of transaction processing, according to an example embodiment, which may further include, as shown in FIG. 5:
and step 109, when each simulation execution result passes the verification of each relay node and at least one simulation execution result is failed, sending a rollback request to the cross-link gateway corresponding to each application block chain through the master node, so that the cross-link gateway corresponding to the application block chain sets the target account book data in the application block chain to be in an idle state.
In another application scenario, after each relay node agrees with a second number of simulation execution results, each simulation execution result is judged, if at least one simulation execution result is failed, it indicates that at least one application block chain possibly cannot execute a transaction request in the second number of application block chains, and a rollback request may be sent to a cross-chain gateway corresponding to each application block chain through a master node, so as to set target account book data in the application block chain to be in an idle state. If there is at least one application blockchain that cannot execute the transaction request, it means that the transaction request cannot be executed on a second number of application blockchains, and therefore the relay network does not send an execution request to the cross-chain gateway any more. Because the cross-link gateway sets the target book data in the application block chain to be in an occupied state when the cross-link gateway simulates and executes the transaction request on the corresponding application block chain, and then the transaction request is not executed any more, the target book data in the application block chain can be set to be in an idle state. Further, if at least one simulation execution result is failed, a prompt message can be sent to the client through the master node or each relay node to inform the client that the transaction request is not executed.
FIG. 6 is a flow diagram illustrating another method of transaction processing, according to an example embodiment, which may further include, as shown in FIG. 6:
and step 110, if the master node does not receive the simulation execution result sent by the cross-link gateway corresponding to each application block chain within the preset time length, sending a rollback request to the cross-link gateway corresponding to each application block chain through the master node, so that the cross-link gateway corresponding to the application block chain sets the target account book data in the application block chain to be in an idle state.
For example, since the master node needs to receive the simulation execution result sent by the cross-chain gateway corresponding to each application blockchain, which involves a second number of application blockchains, when the second number is larger, the problem of access timeout is easily caused. If the main node does not receive the second number of simulation execution results, the main node is always in a waiting state, which may cause the relay network to be in a blocking state, and the performance of the relay network is seriously influenced. Therefore, a preset time duration (which may be understood as a timeout time, for example, 2min) may be set, and if the master node does not receive the simulated execution result sent by the cross-link gateway corresponding to each application block chain within the preset time duration, it indicates that the simulated execution result returns to a timeout, and the transaction request cannot be executed on the second number of application block chains, the master node sends a rollback request to the cross-link gateway corresponding to each application block chain, so as to set the target ledger data in the application block chain to an idle state. Accordingly, the relay network does not send an execution request to the inter-link gateway any more. Because the cross-link gateway sets the target book data in the application block chain to be in an occupied state when the cross-link gateway simulates and executes the transaction request on the corresponding application block chain, and then the transaction request is not executed any more, the target book data in the application block chain can be set to be in an idle state. Therefore, the relay network can be prevented from being always blocked in a blocking state, and the processing performance of the transaction is ensured.
Further, if the master node does not receive the execution result sent by the inter-chain gateway corresponding to a certain application block chain within a specified time length (for example, 5min), it may query the inter-chain gateway corresponding to the application block chain again for whether there is an execution result at an interval (for example, 10 min).
FIG. 7 is a flow diagram illustrating another method of transaction processing, according to an example embodiment, which may further include, as shown in FIG. 7:
and step 111, when each simulation execution result passes the verification of each relay node and at least one simulation execution result fails, sending a pre-execution request to the cross-link gateway corresponding to each application block link again through the master node.
For example, after each relay node agrees with the second number of simulation execution results, each simulation execution result may be determined, and if at least one simulation execution result is failed, it indicates that at least one application block chain may not execute the transaction request in the second number of application block chains. If the master node directly sends the rollback request to the inter-link gateway corresponding to each application block chain at this time, the performance of the relay network may be affected, and the reason that the simulation execution result is failed may be due to network jitter, system congestion, and the like. Therefore, the pre-execution request may be sent again to the cross-chain gateway corresponding to each application block chain by the master node, and then step 103 to step 105 may be executed again. Further, the number of retries (for example, 3 times) for the master node to send the pre-execution request to the inter-link gateway corresponding to each application block chain may be limited, and the number of retries may be set according to the state of the relay network or may be set according to specific requirements.
Fig. 8 is a flowchart illustrating another transaction processing method according to an exemplary embodiment, where each relay node has a relay block chain stored thereon as shown in fig. 8, and the method may further include:
and step 112, receiving, by the master node, registration information sent by the inter-link gateway corresponding to each application block chain, and broadcasting the registration information to each relay node, where the registration information includes a first transaction tag of the application block chain.
And 113, verifying the registration information by each relay node according to the relay intelligent contract, and storing the registration information into the relay block chain under the condition that the registration information passes the verification of each relay node.
For example, a relay block chain may be included in the relay network for recording data in the relay network, and the relay block chain is stored in each node (including the relay node and other nodes) in the relay network. After the relay network is established, each application blockchain may be registered in the relay network through a corresponding inter-link gateway. For example, the inter-chain gateway corresponding to each application block chain may send registration information of the application block chain to the host node, where the registration information includes a first transaction tag of the application block chain, and may further include information such as an identity credential, a network address, a server interface, and an identity in a relay network of the application block chain. Wherein the first transaction tag can be understood as a tag for identifying the type of transaction that the application blockchain can handle. And then, the main node broadcasts the registration information of the application block chain to each relay node, each relay node verifies the registration information according to the relay intelligent contract, and if the registration information passes the verification of each relay node, each relay node is indicated to achieve consensus on the registration information. After each relay node agrees on the registration information, each relay node may record the registration information, for example, the registration information may be recorded in the relay block chain. It is to be understood that the relay block chain has stored therein registration information for each of a second number of application block chains.
Accordingly, prior to step 102, the method further comprises:
For example, before sending the pre-execution request to the cross-chain gateway corresponding to each application blockchain, the master node may determine a second number of application blockchains matching the second transaction tag included in the transaction request according to the second transaction tag included in the transaction request, thereby determining the cross-chain gateway corresponding to each application blockchain. Wherein the second transaction tag may be understood to identify the type of transaction to be processed by the transaction request. When the first transaction tag matches the second transaction tag (which may be understood to be the same), the number of application block chains involved in the transaction request may be determined.
FIG. 9 is a flow diagram illustrating another method of transaction processing, according to an example embodiment, which may further include, as shown in FIG. 9:
the transaction requests, and/or pre-execution requests, are stored 115 into the relay block chain by each relay node.
And step 116, storing each simulation execution result into the relay block chain through each relay node under the condition that each simulation execution result passes the verification of each relay node.
For example, in order to ensure the security and the credibility of the relay network and traceability, a transaction request received by the relay network, a pre-execution request sent by the relay network, and an execution request may be stored in the relay block chain through each relay node, and the client may query all operations in the relay network by accessing the relay block chain. Meanwhile, under the condition that each simulation execution result passes the verification of each relay node, each simulation execution result can be stored into a relay block chain through each relay node, so that when the relay nodes exit abnormally, the consistency of data can be ensured. Further, in the case that each execution result passes the check of each relay node, each execution result may also be stored in the relay block chain by each relay node.
In summary, in the transaction processing method provided by the present disclosure, first, the first number of relay nodes receive transaction requests corresponding to the second number of application block chains, which are sent by the client, and then the master node sends a pre-execution request to the inter-link gateway corresponding to each application block chain, and the inter-link gateway simulates execution of the transaction requests on the corresponding application block chains and sends the simulated execution results to the master node. The main node broadcasts the received simulation execution result to each relay node, the relay nodes verify the simulation execution result according to the relay intelligent contract, and finally, the main node sends an execution request to each cross-link gateway under the condition that each simulation execution result passes the verification of each relay node and each simulation execution result is successful, and the cross-link gateway executes a transaction request on the corresponding application block chain. The method and the device coordinate among the application block chains through the peer relay nodes in the relay network, realize distributed relay, center removal and trust removal, simultaneously realize the execution of transaction requests on the application block chains through the cross-chain gateway corresponding to each application block chain, can quickly process cross-chain transactions on the premise of ensuring the consistency of the transactions, improve the processing performance and shorten the response time.
Fig. 10 is a flowchart illustrating a transaction processing method according to an exemplary embodiment, where, as shown in fig. 10, the method is applied to a cross-chain gateway, and the cross-chain gateway corresponds to an application blockchain, it should be noted that the application blockchain here may be any application blockchain in a transaction processing system, and accordingly, the cross-chain gateway may be a cross-chain gateway corresponding to the application blockchain. That is, the cross-link gateway corresponding to each application blockchain in the transaction processing system is used for executing the transaction processing method, and the method includes the following steps:
For example, when a user needs to execute a transaction across the block chains, a transaction request for instructing execution of the transaction may be sent to each relay node in the relay network through the client, where the transaction request corresponds to a second number of application block chains. After each relay node receives the transaction request, the transaction request can be verified according to the relay intelligent contract, and if the transaction request passes the verification of each relay node, the fact that each relay node agrees with the transaction request is shown. After each relay node agrees with the transaction request, a pre-execution request can be sent to the cross-link gateway corresponding to each application block chain through the master node.
After receiving the pre-execution request, the cross-link gateway corresponding to each application blockchain may simulate an execution transaction request on the application blockchain to obtain a result of the simulation execution transaction request of the application blockchain, that is, a simulated execution result, where the simulated execution result may be success or failure. The simulation of executing the transaction request may be understood as performing transaction endorsement on the transaction request on the application blockchain, and only determining whether the transaction request can be executed on the application blockchain without affecting the ledger data on the application blockchain. After obtaining the simulation execution result of the application block chain, the cross-link gateway corresponding to the application block chain sends the simulation execution result to the host node.
For example, after receiving the simulation execution result sent by the inter-chain gateway corresponding to each application blockchain, the master node may broadcast each simulation execution result to each relay node. After receiving the second number of simulation execution results, each relay node firstly checks each simulation execution result according to a relay intelligent contract. If the second number of simulation execution results pass the verification of each relay node, it indicates that each relay node agrees with the second number of simulation execution results. After each relay node agrees with the second number of simulation execution results, each simulation execution result may be determined, and if each simulation execution result is successful, it indicates that the second number of application block chains may all execute the transaction request, and the master node may send the execution request to the inter-link gateway corresponding to each application block chain.
After receiving the execution request, the cross-chain gateway corresponding to the application block chain may execute the transaction request on the application block chain, thereby implementing execution of the transaction request on a second number of application block chains. After obtaining the execution result of the application block chain (i.e., the result of the transaction request executed by the application block chain), the cross-link gateway corresponding to the application block chain sends the execution result to the master node. So that the master node checks and/or stores each execution result. In this way, since the relay nodes in the relay network are peer-to-peer, the relay network coordinates among the second number of application blockchains through a distributed, decentralized, and distrusted framework, such that each application blockchain can maintain a distributed, decentralized, and distrusted framework. Meanwhile, a corresponding cross-link gateway is arranged for each application block chain, the cross-link gateway is used as a proxy of the application block chain to execute a transaction request on the application block chain, two-stage submission or hash time locking is not needed, cross-link transactions can be quickly processed on the premise of ensuring transaction consistency, processing performance is improved, and response time is shortened.
In an application scenario, the implementation manner of step 202 may be:
and simulating to execute the transaction request on the application block chain, and setting target book data in the application block chain to be in an occupied state, wherein the target book data is book data used when the transaction request is simulated to be executed.
The implementation of step 203 may be:
the transaction request is executed on the application blockchain and the target ledger data is set to an idle state.
For example, in order to further ensure consistency of transactions, after receiving the pre-execution request, the cross-link gateway may set the target ledger data in the corresponding application block chain to an occupied state while simulating execution of the transaction request on the corresponding application block chain, so that it can be ensured that the target ledger data is not modified by other transactions before the transaction request is executed on the target ledger data. The target ledger data is ledger data used when the transaction request is executed in a simulation mode, and can be understood as ledger data related to the transaction request.
Correspondingly, after receiving the execution request, the cross-chain gateway may execute the transaction request on the target ledger data in the corresponding application block chain, and set the target ledger data in the application block chain to an idle state, so that after executing the transaction request on the target ledger data, the target ledger data is restored to the idle state and may be modified by other transactions.
In another implementation, the method may further include:
and sending the registration information of the corresponding application block chain to the main node so as to register the application block chain in the relay network. The registration information may include the first transaction tag of the application blockchain, and may also include information such as an identity credential, a network address, a server interface, and an identity in a relay network of the application blockchain. Wherein the first transaction tag can be understood as a tag for identifying the type of transaction that the application blockchain can handle.
And then, the main node broadcasts the registration information of the application block chain to each relay node, each relay node verifies the registration information according to the relay intelligent contract, and if the registration information passes the verification of each relay node, each relay node is indicated to achieve consensus on the registration information. After each relay node agrees on the registration information, each relay node may record the registration information, for example, the registration information may be recorded in the relay block chain. In this way, before sending the pre-execution request to the inter-chain gateway corresponding to each application blockchain, the master node may determine, according to the second transaction tag included in the transaction request, a second number of application blockchains that match the transaction request, thereby determining the inter-chain gateway corresponding to each application blockchain. Wherein the second transaction tag may be understood to identify the type of transaction to be processed by the transaction request. When the first transaction tag matches the second transaction tag (which may be understood to be the same), the number of application block chains involved in the transaction request may be determined.
FIG. 11 is a flow diagram illustrating another method of transaction processing, according to an example embodiment, which may further include, as shown in FIG. 11:
and step 204, receiving a rollback request sent by the main node, and setting the target account book data to be in an idle state.
Further, after each relay node agrees with the second number of simulation execution results, if at least one simulation execution result is failed, it indicates that at least one application block chain may not execute the transaction request in the second number of application block chains, and a rollback request may be sent to the inter-chain gateway corresponding to each application block chain through the master node. After receiving the rollback request, the cross-link gateway may set the target ledger data in the corresponding application block link to an idle state. If there is at least one application blockchain that cannot execute the transaction request, it means that the transaction request cannot be executed on a second number of application blockchains, and therefore the relay network does not send an execution request to the cross-chain gateway any more. Because the cross-link gateway sets the target book data in the application block chain to be in an occupied state when the cross-link gateway simulates and executes the transaction request on the corresponding application block chain, and then the transaction request is not executed any more, the target book data in the application block chain can be set to be in an idle state.
It should be noted that a blockchain adapter may be disposed on the inter-chain gateway, where the blockchain adapter may be understood as a communication driver that the inter-chain gateway can access and operate a corresponding application blockchain, and the inter-chain gateway can call a pre-execution interface, an execution interface, and a rollback interface that are externally reserved by the application blockchain through the blockchain adapter. Specifically, when receiving the pre-execution request, the cross-link gateway may call the pre-execution interface through the blockchain adapter to simulate executing the transaction request on the application blockchain. The cross-chain gateway, upon receiving the execution request, may call an execution interface through the blockchain adapter to execute the transaction request on the application blockchain. Similarly, when receiving the rollback request, the cross-link gateway may call the rollback interface through the block link adapter to set the target ledger data to the idle state.
In summary, in the transaction processing method provided by the present disclosure, first, the first number of relay nodes receive transaction requests corresponding to the second number of application block chains, which are sent by the client, and then the master node sends a pre-execution request to the inter-link gateway corresponding to each application block chain, and the inter-link gateway simulates execution of the transaction requests on the corresponding application block chains and sends the simulated execution results to the master node. The main node broadcasts the received simulation execution result to each relay node, the relay nodes verify the simulation execution result according to the relay intelligent contract, and finally, the main node sends an execution request to each cross-link gateway under the condition that each simulation execution result passes the verification of each relay node and each simulation execution result is successful, and the cross-link gateway executes a transaction request on the corresponding application block chain. The method and the device coordinate among the application block chains through the peer relay nodes in the relay network, realize distributed relay, center removal and trust removal, simultaneously realize the execution of transaction requests on the application block chains through the cross-chain gateway corresponding to each application block chain, can quickly process cross-chain transactions on the premise of ensuring the consistency of the transactions, improve the processing performance and shorten the response time.
Fig. 12 is a schematic diagram illustrating a relay network according to an exemplary embodiment, where the relay network is a peer-to-peer network, and includes a first number of relay nodes, as shown in fig. 12.
Each relay node is used for receiving a transaction request sent by the client, and the transaction request corresponds to a second number of application block chains.
The master node is used for sending a pre-execution request to the cross-link gateway corresponding to each application block chain so that the cross-link gateway corresponding to the application block chain simulates an execution transaction request on the application block chain, and the master node is any relay node.
The master node is further configured to receive a simulation execution result sent by the inter-chain gateway corresponding to each application blockchain, and broadcast each simulation execution result to each relay node.
And each relay node is also used for verifying each simulation execution result according to the relay intelligent contract corresponding to the relay network.
And the master node is further configured to send an execution request to the inter-link gateway corresponding to each application block chain, so that the inter-link gateway corresponding to the application block chain executes a transaction request on the application block chain, when each simulation execution result passes the verification of each relay node and each simulation execution result is successful.
In an application scenario, the master node is further configured to receive an execution result sent by the inter-chain gateway corresponding to each application blockchain after sending the execution request to the inter-chain gateway corresponding to each application blockchain, and broadcast each execution result to each relay node.
Each relay node is further used for verifying each execution result according to the relay intelligent contract and sending each execution result to the client under the condition that each execution result passes the verification.
In another application scenario, each relay node is further configured to check the transaction request according to a relay intelligent contract before the master node sends a pre-execution request to the inter-link gateway corresponding to each application blockchain.
And the main node is used for sending a pre-execution request to the cross-chain gateway corresponding to each application block chain under the condition that the transaction request passes the verification of each relay node.
In another application scenario, the pre-execution request is used for enabling a cross-link gateway corresponding to each application blockchain to simulate an execution transaction request on the application blockchain, and setting target ledger data in the application blockchain to be in an occupied state, where the target ledger data is ledger data used when the execution transaction request is simulated.
And the execution request is used for enabling the cross-link gateway corresponding to each application block chain to execute the transaction request on the target account book data in the application block chain and setting the target account book data in the application block chain to be in an idle state.
In another application scenario, the master node is further configured to send a rollback request to the inter-link gateway corresponding to each application blockchain when each simulation execution result passes through the verification of each relay node and at least one simulation execution result is failed, so that the inter-link gateway corresponding to the application blockchain sets the target account book data in the application blockchain to an idle state.
In another application scenario, the master node is further configured to send a rollback request to the inter-link gateway corresponding to each application block chain if the master node does not receive a simulation execution result sent by the inter-link gateway corresponding to each application block chain within a preset time length, so that the inter-link gateway corresponding to the application block chain sets the target account book data in the application block chain to be in an idle state.
In another application scenario, the master node is further configured to send the pre-execution request to the inter-chain gateway corresponding to each application blockchain again when each simulation execution result passes the verification of each relay node and at least one simulation execution result fails.
In another application scenario, each relay node stores a relay block chain.
The master node is further configured to receive registration information sent by the inter-chain gateway corresponding to each application block chain, and broadcast the registration information to each relay node, where the registration information includes a first transaction tag of the application block chain.
Each relay node is also used for verifying the registration information according to the relay intelligent contract and storing the registration information into the relay block chain under the condition that the registration information passes the verification of each relay node.
The master node is further configured to determine a second number of application block chains, which are matched with the first transaction tags and the second transaction tags, according to the second transaction tags included in the transaction requests before sending the pre-execution request to the cross-chain gateway corresponding to each application block chain.
In another application scenario, each relay node is further configured to store the transaction request and/or the pre-execution request into the relay block chain, and store each simulation execution result into the relay block chain when each simulation execution result passes the check of each relay node.
With regard to the system in the above embodiment, the specific manner in which the relay network performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In summary, in the transaction processing method provided by the present disclosure, first, the first number of relay nodes receive transaction requests corresponding to the second number of application block chains, which are sent by the client, and then the master node sends a pre-execution request to the inter-link gateway corresponding to each application block chain, and the inter-link gateway simulates execution of the transaction requests on the corresponding application block chains and sends the simulated execution results to the master node. The main node broadcasts the received simulation execution result to each relay node, the relay nodes verify the simulation execution result according to the relay intelligent contract, and finally, the main node sends an execution request to each cross-link gateway under the condition that each simulation execution result passes the verification of each relay node and each simulation execution result is successful, and the cross-link gateway executes a transaction request on the corresponding application block chain. The method and the device coordinate among the application block chains through the peer relay nodes in the relay network, realize distributed relay, center removal and trust removal, simultaneously realize the execution of transaction requests on the application block chains through the cross-chain gateway corresponding to each application block chain, can quickly process cross-chain transactions on the premise of ensuring the consistency of the transactions, improve the processing performance and shorten the response time.
Fig. 13 is a block diagram illustrating a cross-chain gateway according to an example embodiment, and as shown in fig. 13, the cross-chain gateway 300 includes:
the receiving module 301 is configured to receive a pre-execution request sent by a master node in a relay network, where the relay network is a peer-to-peer network and includes multiple relay nodes, the master node is any one of the relay nodes, and the pre-execution request is sent by the master node after each relay node receives a transaction request sent by a client.
The simulation execution module 302 is configured to simulate an execution of the transaction request on the application blockchain, and send a simulation execution result to the master node.
The execution module 303 is configured to receive an execution request sent by the master node, and execute a transaction request on the application block chain.
In an application scenario, the simulation execution module 302 is configured to simulate an execution of a transaction request on an application blockchain, and set target ledger data in the application blockchain to an occupied state, where the target ledger data is ledger data used when the transaction request is simulated to be executed.
An executing module 303, configured to execute the transaction request on the application block chain, and set the target ledger data to an idle state.
Fig. 14 is a block diagram illustrating another cross-chain gateway according to an example embodiment, and as shown in fig. 14, the cross-chain gateway 300 may further include:
and a rollback module 304, configured to receive a rollback request sent by the master node, and set the target ledger data in an idle state.
With regard to the system in the above embodiment, the specific manner in which the cross-chaining gateway performs operations has been described in detail in the embodiment related to the method, and will not be elaborated here.
In summary, in the transaction processing method provided by the present disclosure, first, the first number of relay nodes receive transaction requests corresponding to the second number of application block chains, which are sent by the client, and then the master node sends a pre-execution request to the inter-link gateway corresponding to each application block chain, and the inter-link gateway simulates execution of the transaction requests on the corresponding application block chains and sends the simulated execution results to the master node. The main node broadcasts the received simulation execution result to each relay node, the relay nodes verify the simulation execution result according to the relay intelligent contract, and finally, the main node sends an execution request to each cross-link gateway under the condition that each simulation execution result passes the verification of each relay node and each simulation execution result is successful, and the cross-link gateway executes a transaction request on the corresponding application block chain. The method and the device coordinate among the application block chains through the peer relay nodes in the relay network, realize distributed relay, center removal and trust removal, simultaneously realize the execution of transaction requests on the application block chains through the cross-chain gateway corresponding to each application block chain, can quickly process cross-chain transactions on the premise of ensuring the consistency of the transactions, improve the processing performance and shorten the response time.
The present disclosure also provides a transaction processing system, which is schematically illustrated in fig. 1, and includes: the system comprises a relay network, a plurality of application block chains and a cross-link gateway corresponding to each application block chain.
The relay network is used for executing the transaction processing method applied to the relay network in the embodiment of the disclosure.
Each cross-link gateway is used for executing the transaction processing method of the cross-link gateway applied in the embodiment of the disclosure.
With regard to the system in the above embodiment, the specific manner in which the relay network and the cross-link gateway perform operations has been described in detail in the embodiment related to the method, and will not be elaborated here.
In summary, in the transaction processing method provided by the present disclosure, first, the first number of relay nodes receive transaction requests corresponding to the second number of application block chains, which are sent by the client, and then the master node sends a pre-execution request to the inter-link gateway corresponding to each application block chain, and the inter-link gateway simulates execution of the transaction requests on the corresponding application block chains and sends the simulated execution results to the master node. The main node broadcasts the received simulation execution result to each relay node, the relay nodes verify the simulation execution result according to the relay intelligent contract, and finally, the main node sends an execution request to each cross-link gateway under the condition that each simulation execution result passes the verification of each relay node and each simulation execution result is successful, and the cross-link gateway executes a transaction request on the corresponding application block chain. The method and the device coordinate among the application block chains through the peer relay nodes in the relay network, realize distributed relay, center removal and trust removal, simultaneously realize the execution of transaction requests on the application block chains through the cross-chain gateway corresponding to each application block chain, can quickly process cross-chain transactions on the premise of ensuring the consistency of the transactions, improve the processing performance and shorten the response time.
Fig. 15 is a block diagram illustrating an electronic device 400 according to an example embodiment. As shown in fig. 15, the electronic device 400 may include: a processor 401 and a memory 402. The electronic device 400 may also include one or more of a multimedia component 403, an input/output (I/O) interface 404, and a communications component 405.
The processor 401 is configured to control the overall operation of the electronic device 400, so as to complete all or part of the steps in the transaction processing method. The memory 402 is used to store various types of data to support operation at the electronic device 400, such as instructions for any application or method operating on the electronic device 400 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and so forth. The Memory 402 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 403 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 402 or transmitted through the communication component 405. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 404 provides an interface between the processor 401 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 405 is used for wired or wireless communication between the electronic device 400 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 405 may therefore include: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described transaction Processing methods.
In another exemplary embodiment, there is also provided a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the transaction processing method described above. For example, the computer readable storage medium may be the memory 402 comprising program instructions executable by the processor 401 of the electronic device 400 to perform the transaction processing method described above.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-mentioned transaction processing method when executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.
Claims (10)
1. A transaction processing method applied to a relay network, wherein the relay network is a peer-to-peer network and includes a first number of relay nodes, and the method includes:
receiving a transaction request sent by a client through each relay node, wherein the transaction request corresponds to a second number of application block chains;
sending a pre-execution request to a cross-chain gateway corresponding to each application block chain through a main node, so that the cross-chain gateway corresponding to the application block chain simulates and executes the transaction request on the application block chain, wherein the main node is any relay node;
receiving, by the master node, a simulation execution result sent by the inter-link gateway corresponding to each application block chain, and broadcasting each simulation execution result to each relay node;
verifying each simulation execution result through each relay node according to a relay intelligent contract corresponding to the relay network;
and sending an execution request to the cross-chain gateway corresponding to each application block chain through the main node under the condition that each simulation execution result passes the verification of each relay node and each simulation execution result is successful, so that the cross-chain gateway corresponding to the application block chain executes the transaction request on the application block chain.
2. The method of claim 1, wherein after the sending, by the master node, an execution request to the cross-chain gateway corresponding to each of the application block chains, the method further comprises:
receiving, by the master node, execution results sent by the inter-link gateway corresponding to each of the application block chains, and broadcasting each of the execution results to each of the relay nodes;
and verifying each execution result through each relay node according to the relay intelligent contract, and sending each execution result to the client under the condition that each execution result passes the verification.
3. The method of claim 1, wherein before the sending, by the master node, a pre-execution request to a cross-chain gateway corresponding to each of the application block chains, the method further comprises:
verifying the transaction request according to the relay intelligent contract through each relay node;
the sending, by the master node, a pre-execution request to the inter-chain gateway corresponding to each application block chain includes:
and sending the pre-execution request to the cross-chain gateway corresponding to each application block chain through the main node under the condition that the transaction request passes the verification of each relay node.
4. The method of claim 1, wherein the pre-execution request is used to enable the cross-link gateway corresponding to each application blockchain to simulate execution of the transaction request on the application blockchain, and set target ledger data in the application blockchain to an occupied state, where the target ledger data is ledger data used in simulation of execution of the transaction request;
the execution request is used for enabling the cross-link gateway corresponding to each application block chain to execute the transaction request on the target account book data in the application block chain, and setting the target account book data in the application block chain to be in an idle state.
5. A transaction processing method is applied to a cross-chain gateway, wherein the cross-chain gateway corresponds to an application block chain; the method comprises the following steps:
receiving a pre-execution request sent by a master node in a relay network, wherein the relay network is a peer-to-peer network and comprises a plurality of relay nodes, the master node is any one of the relay nodes, and the pre-execution request is sent by the master node after each relay node receives a transaction request sent by a client;
simulating and executing the transaction request on the application block chain, and sending a simulation execution result to the main node;
and receiving an execution request sent by the main node, and executing the transaction request on the application block chain.
6. A relay network, wherein the relay network is a peer-to-peer network comprising a first number of relay nodes;
each relay node is used for receiving a transaction request sent by a client, wherein the transaction request corresponds to a second number of application block chains;
the main node is used for sending a pre-execution request to the cross-chain gateway corresponding to each application block chain so that the cross-chain gateway corresponding to the application block chain can simulate and execute the transaction request on the application block chain, and the main node is any relay node;
the master node is further configured to receive a simulation execution result sent by the inter-link gateway corresponding to each application block chain, and broadcast each simulation execution result to each relay node;
each relay node is further configured to verify each simulation execution result according to a relay intelligent contract corresponding to the relay network;
and when each simulation execution result passes the verification of each relay node and each simulation execution result is successful, the master node is further configured to send an execution request to the inter-link gateway corresponding to each application block chain, so that the inter-link gateway corresponding to the application block chain executes the transaction request on the application block chain.
7. A cross-chain gateway, comprising:
the system comprises a receiving module, a pre-execution module and a processing module, wherein the receiving module is used for receiving a pre-execution request sent by a main node in a relay network, the relay network is a peer-to-peer network and comprises a plurality of relay nodes, the main node is any one of the relay nodes, and the pre-execution request is sent by the main node after each relay node receives a transaction request sent by a client;
the simulation execution module is used for simulating and executing the transaction request on the application block chain and sending a simulation execution result to the main node;
and the execution module is used for receiving the execution request sent by the main node and executing the transaction request on the application block chain.
8. A transaction processing system, the system comprising: the system comprises a relay network, a plurality of application block chains and a cross-link gateway corresponding to each application block chain;
the relay network is configured to perform the transaction processing method of any one of claims 1-4;
each of the cross-chain gateways is configured to perform the transaction processing method of claim 5.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of claims 1 to 4 or 5.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of claims 1-4 or 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011521609.5A CN112714158B (en) | 2020-12-21 | 2020-12-21 | Transaction processing method, relay network, cross-link gateway, system, medium and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011521609.5A CN112714158B (en) | 2020-12-21 | 2020-12-21 | Transaction processing method, relay network, cross-link gateway, system, medium and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112714158A true CN112714158A (en) | 2021-04-27 |
CN112714158B CN112714158B (en) | 2023-11-17 |
Family
ID=75544812
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011521609.5A Active CN112714158B (en) | 2020-12-21 | 2020-12-21 | Transaction processing method, relay network, cross-link gateway, system, medium and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112714158B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113242305A (en) * | 2021-05-13 | 2021-08-10 | 杭州趣链科技有限公司 | Cross-chain transaction processing method, device, computer equipment and medium |
CN113328997A (en) * | 2021-05-10 | 2021-08-31 | 东软集团股份有限公司 | Alliance chain cross-chain system and method |
CN114363416A (en) * | 2021-12-29 | 2022-04-15 | 杭州趣链科技有限公司 | Block chain-based cross-chain processing method and device, storage medium and server |
CN114760288A (en) * | 2022-03-18 | 2022-07-15 | 国网四川省电力公司天府新区供电公司 | Block chain-based file cross-chain transmission method |
CN115442420A (en) * | 2021-05-18 | 2022-12-06 | 京东科技控股股份有限公司 | Block chain cross-chain service management method and device |
WO2024021414A1 (en) * | 2022-07-29 | 2024-02-01 | 蚂蚁区块链科技(上海)有限公司 | Data transmission |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108900585A (en) * | 2018-06-15 | 2018-11-27 | 浙江华信区块链科技服务有限公司 | Across chain transaction consistency implementation method |
WO2018215874A1 (en) * | 2017-05-22 | 2018-11-29 | nChain Holdings Limited | Secure provision of undetermined data from an undetermined source into the locking script of a blockchain transaction |
CN109040029A (en) * | 2018-07-13 | 2018-12-18 | 上海点融信息科技有限责任公司 | The method and apparatus of affairs are executed in block chain |
CN109981679A (en) * | 2019-04-08 | 2019-07-05 | 上海点融信息科技有限责任公司 | The method and apparatus of affairs are executed in block chain network |
CN110650189A (en) * | 2019-09-20 | 2020-01-03 | 深圳供电局有限公司 | Relay-based block chain interaction system and method |
CN110866740A (en) * | 2019-11-14 | 2020-03-06 | 百度在线网络技术(北京)有限公司 | Processing method and device for block chain transaction request, electronic equipment and medium |
US20200294143A1 (en) * | 2019-07-15 | 2020-09-17 | Alibaba Group Holding Limited | Transaction processing in a service blockchain |
-
2020
- 2020-12-21 CN CN202011521609.5A patent/CN112714158B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018215874A1 (en) * | 2017-05-22 | 2018-11-29 | nChain Holdings Limited | Secure provision of undetermined data from an undetermined source into the locking script of a blockchain transaction |
CN108900585A (en) * | 2018-06-15 | 2018-11-27 | 浙江华信区块链科技服务有限公司 | Across chain transaction consistency implementation method |
CN109040029A (en) * | 2018-07-13 | 2018-12-18 | 上海点融信息科技有限责任公司 | The method and apparatus of affairs are executed in block chain |
CN109981679A (en) * | 2019-04-08 | 2019-07-05 | 上海点融信息科技有限责任公司 | The method and apparatus of affairs are executed in block chain network |
US20200294143A1 (en) * | 2019-07-15 | 2020-09-17 | Alibaba Group Holding Limited | Transaction processing in a service blockchain |
CN110650189A (en) * | 2019-09-20 | 2020-01-03 | 深圳供电局有限公司 | Relay-based block chain interaction system and method |
CN110866740A (en) * | 2019-11-14 | 2020-03-06 | 百度在线网络技术(北京)有限公司 | Processing method and device for block chain transaction request, electronic equipment and medium |
Non-Patent Citations (2)
Title |
---|
叶少杰;汪小益;徐才巢;孙建伶;: "BitXHub:基于侧链中继的异构区块链互操作平台", 计算机科学, no. 06 * |
赵会群;张隆龙;: "一种面向Fabric区块链应用软件的体系结构演化算法", 软件, no. 07 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113328997A (en) * | 2021-05-10 | 2021-08-31 | 东软集团股份有限公司 | Alliance chain cross-chain system and method |
CN113242305A (en) * | 2021-05-13 | 2021-08-10 | 杭州趣链科技有限公司 | Cross-chain transaction processing method, device, computer equipment and medium |
CN115442420A (en) * | 2021-05-18 | 2022-12-06 | 京东科技控股股份有限公司 | Block chain cross-chain service management method and device |
CN114363416A (en) * | 2021-12-29 | 2022-04-15 | 杭州趣链科技有限公司 | Block chain-based cross-chain processing method and device, storage medium and server |
CN114363416B (en) * | 2021-12-29 | 2024-01-23 | 杭州趣链科技有限公司 | Cross-chain processing method and device based on block chain, storage medium and server |
CN114760288A (en) * | 2022-03-18 | 2022-07-15 | 国网四川省电力公司天府新区供电公司 | Block chain-based file cross-chain transmission method |
CN114760288B (en) * | 2022-03-18 | 2024-02-06 | 国网四川省电力公司天府新区供电公司 | File cross-chain transmission method based on block chain |
WO2024021414A1 (en) * | 2022-07-29 | 2024-02-01 | 蚂蚁区块链科技(上海)有限公司 | Data transmission |
Also Published As
Publication number | Publication date |
---|---|
CN112714158B (en) | 2023-11-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107579848B (en) | Method for dynamically changing consensus node in practical Byzantine fault-tolerant consensus mechanism | |
CN112714158B (en) | Transaction processing method, relay network, cross-link gateway, system, medium and equipment | |
US12126732B2 (en) | Blockchain consensus method, device and system | |
CN111163182B (en) | Block chain-based device registration method and apparatus, electronic device, and storage medium | |
JP7551222B2 (en) | Data processing method, device and computer device based on blockchain network | |
CN110661658B (en) | Node management method and device of block chain network and computer storage medium | |
CN110400217B (en) | Rule change processing method and device for intelligent contract | |
CN111314172B (en) | Block chain-based data processing method, device, equipment and storage medium | |
CN110602108A (en) | Data communication method, device, equipment and storage medium based on block chain network | |
CN111831308A (en) | Firmware updating method and program for quick charging equipment, quick charging equipment and storage medium | |
EP3598333B1 (en) | Electronic device update management | |
US20230259930A1 (en) | Cross-chain transaction processing method and apparatus, electronic device, and storage medium | |
CN111597537B (en) | Block chain network-based certificate issuing method, related equipment and medium | |
CN112632573A (en) | Intelligent contract execution method, device and system, storage medium and electronic equipment | |
CN110442601B (en) | Openstack mirror image data parallel acceleration method and device | |
CN116566994A (en) | Cross-chain data transmission method between blockchains, blockchain system, electronic equipment and storage medium | |
CN108228280A (en) | The configuration method and device of browser parameters, storage medium, electronic equipment | |
CN111937013B (en) | Electronic device management | |
CN111404897A (en) | Message distribution method and device, storage medium and electronic equipment | |
CN111666590A (en) | Distributed file secure transmission method, device and system | |
US20230208659A1 (en) | Blockchain apparatus and method for mobile edge computing | |
US20240354878A1 (en) | Method and Apparatus for Data Verification | |
CN115964721A (en) | Program verification method and electronic equipment | |
CN113283891A (en) | Information processing method and device and electronic equipment | |
CN117540356B (en) | Block chain-based data processing 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |