CN111953754B - Cross-chain transaction method, electronic device and readable storage medium - Google Patents

Cross-chain transaction method, electronic device and readable storage medium Download PDF

Info

Publication number
CN111953754B
CN111953754B CN202010758625.XA CN202010758625A CN111953754B CN 111953754 B CN111953754 B CN 111953754B CN 202010758625 A CN202010758625 A CN 202010758625A CN 111953754 B CN111953754 B CN 111953754B
Authority
CN
China
Prior art keywords
private
network
link network
execution result
target transaction
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.)
Active
Application number
CN202010758625.XA
Other languages
Chinese (zh)
Other versions
CN111953754A (en
Inventor
李成才
刘昱
高勇
邓柯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Quality Starker Technology Co Ltd
Original Assignee
Chengdu Quality Starker Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Quality Starker Technology Co Ltd filed Critical Chengdu Quality Starker Technology Co Ltd
Priority to CN202010758625.XA priority Critical patent/CN111953754B/en
Publication of CN111953754A publication Critical patent/CN111953754A/en
Application granted granted Critical
Publication of CN111953754B publication Critical patent/CN111953754B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Marketing (AREA)
  • Signal Processing (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention provides a cross-chain transaction method, electronic equipment and a readable storage medium, aiming at improving the reliability of cross-chain transaction. The cross-chain transaction method comprises the following steps: the public link network judges whether the first private link network and the second private link network both agree to execute the target transaction, if so, an execution prompt is generated; the first private network obtains the execution prompt and pre-executes the target transaction to obtain a first pre-execution result, and the second private network obtains the execution prompt and pre-executes the target transaction to obtain a second pre-execution result; the public link network obtains a first pre-execution result and a second pre-execution result to judge whether the first private link network and the second private link network successfully pre-execute the target transaction, if so, the target transaction is executed to obtain an execution result; the first private network obtains the execution result and chains the first pre-execution result, and the second private network obtains the execution result and chains the second pre-execution result.

Description

Cross-chain transaction method, electronic device and readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method for performing a cross-link transaction, an electronic device, and a readable storage medium.
Background
The block chain technology is built on a transmission network (such as a point-to-point network), distributed nodes in the transmission network verify and store data by using a chain data structure, and a distributed node consensus algorithm is adopted to generate and update the data, so that a mechanism for preventing data tampering is realized.
The block chain technology has a wide application prospect, and is currently applied to various fields such as finance, insurance, medical treatment, asset management, supply chain and the like. However, due to the natural characteristics of the blockchain technology, it is difficult to communicate between different blockchain networks, and multiple information islands are formed by multiple blockchain networks, thereby limiting the further development of the blockchain technology. In the related art, a cross-chain communication method is provided, and cross-chain transaction can be realized based on the cross-chain communication method. However, the existing cross-chain transaction method is not mature, transaction errors are easy to generate, and the reliability of the transaction process is low.
Disclosure of Invention
The embodiment of the invention aims to provide a cross-chain transaction method, electronic equipment and a readable storage medium, and aims to improve the reliability of cross-chain transaction. The specific technical scheme is as follows:
in a first aspect of embodiments of the present invention, a method for cross-chain transaction is provided, where the method is applied to a blockchain network system, where the blockchain network system includes a public-chain network, a first private-chain network, and a second private-chain network, and the method includes:
the public link network obtains a first consensus vote of the first private link network on a target transaction and a second consensus vote of the second private link network on the target transaction, and judges whether the first private link network and the second private link network agree to execute the target transaction according to the first consensus vote and the second consensus vote, if so, an execution prompt is generated, and the execution prompt is used for representing that the target transaction is allowed to be executed;
after the first private network obtains the execution prompt, the target transaction is pre-executed to obtain a first pre-execution result, and after the second private network obtains the execution prompt, the target transaction is pre-executed to obtain a second pre-execution result;
the public link network obtains the first pre-execution result and the second pre-execution result, and judges whether the first private link network and the second private link network successfully pre-execute the target transaction according to the first pre-execution result and the second pre-execution result, if so, the target transaction is executed, and an execution result is obtained;
the first private network obtains the execution result, records the first pre-execution result through a blockchain of the first private network when the execution result represents that the public network successfully executes the target transaction, obtains the execution result through the second private network, and records the second pre-execution result through a blockchain of the second private network when the execution result represents that the public network successfully executes the target transaction.
Optionally, the execution hint is recorded in a new block of the public link network; the method further comprises the following steps:
the first private chain network synchronizes new blocks generated by the public chain network according to the ascending sequence of the block heights, and detects whether the execution prompt is recorded in each new block so as to acquire the execution prompt;
after the first private link network obtains the execution prompt from a new block, the first private link network locks a first target account book corresponding to the target transaction;
after the first private link network records the first pre-execution result through the blockchain thereof, the first private link network unlocks the first target account book;
the second private chain network synchronizes the new blocks generated by the public chain network according to the ascending sequence of the block heights, and detects whether the execution prompt is recorded in each new block so as to acquire the execution prompt;
after the second private link network obtains the execution prompt from a new block, the second private link network locks a second target account book corresponding to the target transaction;
after the second private link network records the second pre-execution result through its blockchain, the second private link network unlocks the second target book.
In a second aspect of the embodiments of the present invention, there is provided another cross-link transaction method, applied to a node in a first private-link network, where the first private-link network belongs to a blockchain network system, and the blockchain network system further includes a public-link network and a second private-link network, the method including:
sending a first consensus vote to the public link network for a target transaction, the first consensus vote characterizing whether the first private link network agrees to perform the target transaction;
obtaining an execution hint for the public-link network, the execution hint generated by the public-link network if both the first private-link network and the second private-link network agree to execute the target transaction;
responding to the execution prompt, pre-executing the target transaction to obtain a first pre-execution result, and sending the first pre-execution result to the public link network;
obtaining an execution result of the public link network, wherein the execution result is obtained after the public link network executes the target transaction under the condition that the first private link network and the second private link network both successfully pre-execute the target transaction;
and recording the first pre-execution result into a block in response to the execution result so as to record the first pre-execution result through a block chain.
Optionally, the execution hint is recorded in a new block of the public link network; the obtaining of the execution prompt of the public link network includes:
and synchronizing the new blocks generated by the public link network according to the ascending sequence of the block heights, and detecting whether the execution prompt is recorded in each synchronized new block so as to acquire the execution prompt from the new block.
Optionally, the method further comprises:
after obtaining an execution prompt from a new block, locking a first target account book corresponding to the target transaction;
unlocking the first target book after logging the first pre-execution result into a block.
Optionally, the method further comprises:
detecting whether the locking of the first target account book is overtime, and sending an unlocking transaction to the public link network under the condition that the locking is overtime;
and obtaining an execution result of the public link network for the unlocking transaction, and responding to the execution result to unlock the first target account book.
Optionally, before sending the first consensus vote to the public link network, the method further comprises:
sending the target transaction to the second private link network;
obtaining the first consensus vote of the first private network for the target transaction, and receiving a second consensus vote of the second private network for the target transaction sent by the second private network, the second consensus vote characterizing whether the second private network agrees to perform the target transaction;
the sending the first consensus vote for the target transaction to the public link network comprises:
sending the first consensus vote, the second consensus vote, and the target transaction together to the public link network.
Optionally, before sending the first pre-execution result to the public link network, the method further includes:
receiving a second pre-execution result which is sent by the second private network and is obtained after the second private network pre-executes the target transaction;
the sending the first pre-execution result to the public link network includes:
and sending the first pre-execution result and the second pre-execution result to the public link network.
In a third aspect of the embodiments of the present invention, there is provided a further cross-link transaction method applied to a node in a second private-link network, where the second private-link network belongs to a blockchain network system, and the blockchain network system further includes a public-link network and a first private-link network, the method including:
sending a second consensus vote for a target transaction to the first private network, the second consensus vote characterizing whether the second private network agrees to perform the target transaction;
obtaining an execution hint for the public-link network, the execution hint generated by the public-link network if both the first private-link network and the second private-link network agree to execute the target transaction;
in response to the execution prompt, pre-executing the target transaction to obtain a second pre-execution result, and sending the second pre-execution result to the first private link network;
obtaining an execution result of the public link network, wherein the execution result is obtained after the public link network executes the target transaction under the condition that the first private link network and the second private link network both successfully pre-execute the target transaction;
and recording the second pre-execution result into a block in response to the execution result so as to record the second pre-execution result through a block chain.
Optionally, the execution hint is recorded in a new block of the public link network; the obtaining of the execution prompt of the public link network includes:
according to the ascending sequence of the block heights, synchronizing new blocks generated by the public link network, and detecting whether the execution prompt is recorded in each synchronized new block so as to acquire the execution prompt from the new block;
the method further comprises the following steps:
after obtaining an execution prompt from a new block, locking a second target account book corresponding to the target transaction;
unlocking the second target book after logging the second pre-execution result into a block.
Optionally, the method further comprises:
obtaining an execution result of the public link network for unlocking transaction, and responding to the execution result to unlock the second target account book;
the unlocking transaction is a transaction sent to the public link network after the first private link network detects that the locking of a first target account book corresponding to the target transaction is overtime.
In a fourth aspect of the embodiments of the present invention, there is provided a further cross-link transaction method applied to a node in a public link network, where the public link network belongs to a blockchain network system, and the blockchain network system further includes a first private link network and a second private link network, the method including:
obtaining a first consensus vote of the first private link network for a target transaction and a second consensus vote of the second private link network for the target transaction;
judging whether the first private link network and the second private link network both agree to execute the target transaction according to the first consensus vote and the second consensus vote, if so, generating an execution prompt, wherein the execution prompt is used for representing that the target transaction is allowed to be executed;
obtaining a first pre-execution result and a second pre-execution result, wherein the first pre-execution result is an execution result of the first private link network after the target transaction is pre-executed after the execution prompt is obtained, and the second pre-execution result is an execution result of the second private link network after the target transaction is pre-executed after the execution prompt is obtained;
and judging whether the first private chain network and the second private chain network successfully pre-execute the target transaction according to the first pre-execution result and the second pre-execution result, if so, executing the target transaction to obtain an execution result, and sending the execution result to the first private chain network and the second private chain network.
Optionally, an execution hint is recorded in a new block of the public link network; the method further comprises the following steps:
synchronizing new blocks to the first private network in an increasing order of block heights;
synchronizing new blocks to the second private network in order of increasing block height.
Optionally, the obtaining a first consensus vote of the first private network for a target transaction and a second consensus vote of the second private network for the target transaction includes:
receiving a first consensus vote of the first private network for a target transaction, a second consensus vote of the second private network for the target transaction, and the target transaction, sent by the first private network;
the obtaining the first pre-execution result and the second pre-execution result includes:
and receiving the first pre-execution result and the second pre-execution result sent by the first private network.
Optionally, the method further comprises:
obtaining an unlocking transaction sent by the first private network, wherein the unlocking transaction is a transaction generated by the first private network after the first private network detects that the locking of a first target account book corresponding to the target transaction is overtime;
ordering the unlocking transaction and other transactions received by the public link network, and executing each transaction in sequence according to the ordering;
and after the unlocking transaction is executed, obtaining an execution result of the unlocking transaction, and sending the execution result to the first private chain network and the second private chain network.
In a fifth aspect of the embodiments of the present invention, an electronic device is provided, which includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor is used for realizing the cross-chain transaction method provided by any embodiment of the invention when executing the program stored on the memory.
In a sixth aspect of the embodiments of the present invention, there is provided a computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the cross-chain transaction method provided by any of the embodiments of the present invention.
By applying the cross-link transaction method provided by the invention, the public link network can obtain a first consensus vote of the first private link network and a second consensus vote of the second private link network, wherein the first consensus vote represents whether the first private link network agrees to execute the target transaction, and the second consensus vote represents whether the second private link network agrees to execute the target transaction. The public link network can judge whether the first private link network and the second private link network both agree to execute the target transaction according to the first consensus vote and the second consensus vote, and if yes, the public link network generates an execution prompt, namely, the target transaction is determined to be allowed to be executed. In this way, the public link network serves as an observer, and the target transaction is determined to be allowed to be executed under the condition that the first private link network and the second private link network both agree to execute the target transaction, so that the target transaction can be prevented from being executed mistakenly when opinions of both parties are not matched, and further, the transaction error can be avoided.
In addition, after the first private network obtains the execution prompt, that is, after the first private network knows that the public network allows executing the target transaction, the first private network executes the target transaction by using the pre-executed policy. Similarly, after the second private network obtains the execution prompt, that is, after the second private network knows that the public network allows executing the target transaction, the second private network executes the target transaction by using the pre-executed policy. And the public link network executes the target transaction under the condition that the first private link network and the second private link network are judged to be successfully executed in advance, and sends the execution result to the first private link network and the second private link network. And each private chain network links and stores the pre-execution result thereof only when determining that the public chain network is successfully executed.
In this way, the target transaction is executed only when the public link network determines that the first private link network and the second private link network both execute the target transaction successfully in advance, and the first private link network and the second private link network only uplink and store the respective pre-execution results when the public link network executes the target transaction successfully. Therefore, the transaction execution result can be prevented from being linked up and stored under the condition that one private network fails to execute the transaction and the other private network succeeds in executing the transaction. Therefore, transaction errors can be further avoided, and reliability of cross-link transaction is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a block chain network system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a pre-submission target transaction phase, as set forth in one embodiment of the invention;
FIG. 3 is a diagram illustrating a pre-execution target transaction phase according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a transaction result uplink phase according to an embodiment of the present invention;
fig. 5 is a schematic diagram of timeout unlocking according to an embodiment of the present invention;
FIG. 6 is a flow chart of a cross-chain transaction method according to an embodiment of the invention;
FIG. 7 is a flow chart of a cross-chain transaction method according to an embodiment of the invention;
FIG. 8 is a flow chart of a cross-chain transaction method according to an embodiment of the invention;
FIG. 9 is a flow chart of a cross-chain transaction method according to an embodiment of the invention;
fig. 10 is a schematic diagram of an electronic device according to an embodiment of the invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The block chain technology is built on a transmission network (such as a point-to-point network), distributed nodes in the transmission network verify and store data by using a chain data structure, and a distributed node consensus algorithm is adopted to generate and update the data, so that a mechanism for preventing data tampering is realized. However, due to the natural characteristics of the blockchain technology, it is difficult to communicate between different blockchain networks, and multiple information islands are formed by multiple blockchain networks, thereby limiting the further development of the blockchain technology.
In the related art, a cross-chain communication method is provided, and cross-chain transaction can be realized based on the cross-chain communication method. However, the existing cross-chain transaction method is not mature, transaction errors are easy to generate, and the reliability of the transaction process is low.
Therefore, the invention provides a cross-link transaction method, an electronic device and a readable storage medium through the following embodiments, and cross-link transactions between a first private link network and a second private link network are controlled and witnessed through a public link network, so as to improve reliability of the cross-link transactions.
Referring to fig. 1, fig. 1 is a schematic diagram of a blockchain network system according to an embodiment of the invention. As shown in fig. 1, the blockchain network system includes: the system comprises a public link network and a plurality of private link networks, wherein each private link network is in communication connection with the public link network. Between two private link networks, cross-link transactions may be conducted. For ease of understanding, the two private networks that conduct the cross-chain transaction are referred to as the first private network and the second private network, respectively, and the cross-chain transaction is referred to as the target transaction.
In the present invention, the term "private chain" does not limit that a private network must be private to a certain person or a certain organization. That is, a blockchain network connected to a public-link network may be referred to as a private-link network.
As shown in fig. 1, a public link network includes a plurality of distributed nodes (hereinafter, simply referred to as nodes), and each private link network also includes a plurality of distributed nodes (hereinafter, simply referred to as nodes). In some embodiments of the present invention, each of the plurality of private networks is configured with a corresponding gateway, each private network is communicatively connected to the public link network through its gateway, and two private networks may also communicate with each other through their respective gateways. In particular, a gateway of a private network enables communication with the private network by communicating with one or more nodes within the private network. A gateway corresponding to a private link network communicates with a public block link network by communicating with one or more nodes in the public link network. And the gateways of the two private link networks are communicated with each other, so that the communication between the two private link networks is realized.
In the present invention, a cross-link transaction between a first private network and a second private network (hereinafter, the cross-link transaction is referred to as a target transaction) can be mainly divided into three stages, which are respectively: pre-submitting a target transaction, pre-executing the target transaction, and submitting an upper chain of transaction results.
The pre-submission target transaction stage mainly realizes the following processes: the first private link network carries out consensus voting for the target transaction, and the consensus voting result of the first private link network (hereinafter referred to as the first consensus voting) is used for reflecting whether the first private link network agrees to execute the target transaction; the first private link network submits the target transaction to a second private link network, so that the second private link network carries out consensus voting on the target transaction, and the consensus voting result (hereinafter referred to as second consensus voting) of the second private link network is used for reflecting whether the second private link network agrees to execute the target transaction.
The pre-execution target transaction stage mainly realizes the following processes: the public link network obtains a first consensus vote and a second consensus vote, and judges whether the first private link network and the second private link network both agree to execute the target transaction according to the first consensus vote and the second consensus vote; if yes, determining that the target transaction is allowed to be executed; if not, determining not to execute the target transaction. Further, the first private network and the second private network pre-execute the target transaction in a case where the target transaction is allowed to be executed.
The transaction result submitting and uplink stage mainly realizes the following processes: the public link network obtains a pre-execution result of the first private link network and a pre-execution result of the second private link network, and judges whether the first private link network and the second private link network successfully pre-execute the target transaction according to the first pre-execution result and the second pre-execution result; if yes, executing the target transaction, obtaining an execution result, and storing the execution result to a block chain of the public chain network; if not, the target transaction is not executed, or the transaction result can be directly identified as failure, and the failure reason is recorded. In addition, if the public link network executes the target transaction and obtains the execution result, the execution result needs to be fed back to the first private link network, so that the first private link network submits the pre-execution result to be stored in the blockchain thereof or rolls back the target transaction according to the execution result of the public link network. Similarly, the public link network also needs to feed back the execution result to the second private link network, so that the second private link network submits the pre-execution result thereof to be saved to the blockchain thereof or rolls back the target transaction according to the execution result of the public link network.
Referring to fig. 2, fig. 2 is a schematic diagram of a pre-submission target transaction phase according to an embodiment of the invention. As shown in fig. 2, the upper layer application (e.g. the decentralized application DAPP or the browser) sends the target transaction TX to the first private network. The first private network responds to the target transaction TX, on one hand, the first private network adopts partial or all nodes to vote for the target transaction TX according to a preset cross-link transaction strategy, and the voting of each node is used for representing whether a maintenance main body where the node is located agrees to execute the target transaction TX or not. On the other hand, the target transaction TX is distributed to each node in the first private link network, and each node stores the target transaction TX so as to execute the target transaction TX in a pre-execution target transaction stage described below. The maintenance main body where the node is located is an organization and a mechanism for operating and maintaining the node, and the plurality of nodes of the first private link network can be operated and maintained by the plurality of maintenance main bodies respectively. For convenience of understanding, it is assumed that the first private network includes 21 nodes, and the 20 nodes are respectively operated and maintained by three maintenance agents, wherein the first maintenance agent operates and maintains 8 nodes, the second maintenance agent operates and maintains 9 nodes, and the third maintenance agent operates and maintains 4 nodes.
In addition, the first private network also sends the target transaction TX to a second private network, the second private network responds to the target transaction TX, on one hand, the second private network adopts partial or all nodes to vote for the target transaction TX according to a preset cross-link transaction strategy, and the voting of each node is used for representing whether a maintenance main body where the node is located agrees to execute the target transaction TX or not. On the other hand, the target transaction TX is distributed to each node in the second private link network, and each node stores the target transaction TX so as to execute the target transaction TX in a pre-execution target transaction stage described below.
In particular implementation, as shown in fig. 2, an upper layer application (e.g., a decentralized app DAPP or browser) sends a target transaction TX to a node (e.g., node1-1) in a first private network. Node1-1 is responsive to the target transaction TX, and on one hand, requests a corresponding node in the first private chain network (i.e. a node defined in the cross-chain transaction policy) to vote for the target transaction according to a cross-chain transaction policy preset in the first private chain network, where the vote of each node is used to characterize whether a maintenance subject in which the node is located agrees to execute the target transaction TX. On the other hand, node1-1 collects votes from the nodes to obtain a first consensus vote of the first private link network, node1-1 transmits the target transaction TX and the first consensus vote to node1-2, and node1-2 is a master node (also called master node, which is one node elected from the nodes in the blockchain network) in the first private link network.
After receiving the target transaction TX, node1-2 distributes the target transaction TX to other nodes in the first private link network. In addition, node1-2 submits the target transaction TX to a node in the second private network (e.g., node2-4) through gateway 1 and gateway 2.
Node2-4 is responsive to the target transaction TX, and on the one hand, requests the corresponding node in the second private network (i.e. the node defined in the second voting rule) to vote for the target transaction according to the second voting rule preset in the second private network, and the vote of each node is used to characterize whether the node agrees to execute the target transaction TX. On the other hand, node2-4 collects votes from the nodes to obtain a second consensus vote of the second private link network, node2-4 sends the target transaction TX and the second consensus vote to node2-2, and node2-2 is the master node in the second private link network.
Node2-2 receives the target transaction TX and the second consensus vote and distributes the target transaction TX to other nodes in the second private network. In addition, node2-2 transmitted the second consensus vote to the master node in the first private network (i.e., node1-2) through gateway 2 and gateway 1, and the second consensus vote for the second private network had been transmitted to the public network through node 1-2.
It should be noted that the specific implementation shown in fig. 2 is only one example of various alternative implementations of the present invention, and the implementation of the present invention is not limited to the specific implementation shown in fig. 2. For example, after receiving the target transaction TX sent by the upper application or the gateway, the node in the private link network may directly distribute the target transaction TX to other nodes instead of distributing the target transaction TX to other nodes through the master node. Or, for example, the master node of the second private network does not have to send the second consensus vote to the first private network, but directly sends the second consensus vote to the public link network.
Referring to fig. 3, fig. 3 is a schematic diagram of a pre-execution target transaction phase according to an embodiment of the invention. As shown in fig. 3, the public link network obtains the first consensus vote and the second consensus vote, and determines whether both the first private link network and the second private link network agree to perform the target transaction TX according to the first consensus vote and the second consensus vote and according to a determination condition preset in the public link network. If so, the public link network determines that the target transaction TX is allowed to be performed. In addition, after the first private network knows that the target transaction TX is allowed to be executed, the target transaction TX is pre-executed, and a first pre-execution result is obtained. After the second private network obtains permission to execute the target transaction TX, the target transaction TX is pre-executed, resulting in a second pre-execution result.
In a specific implementation, as shown in fig. 3, after receiving the second consensus vote returned by the second private network, the master node (i.e., node1-2) in the first private network encapsulates the first consensus vote, the second consensus vote, and the target transaction TX into a transaction TX1, and submits the transaction TX1 to one node (e.g., node p-6) in the public link network through the gateway 1.
Node nodeP-6 distributes the transaction tx1 to various nodes in the public link network in response to the transaction tx 1. After receiving the transaction TX1, each node needs to extract a first consensus vote and a second consensus vote from the transaction TX1, and determine whether both the first private network and the second private network agree to execute the target transaction TX according to a preset first determination condition. For example, the preset first determination condition may be: determining that the first private network agrees to perform the target transaction TX only if all nodes of the first private network vote in favor of a vote; it is only determined that the second private network agrees to perform the target transaction TX when all nodes of the second private network vote in favor.
Or, for example, as previously described, in some embodiments, multiple nodes of a private link network may be operated and maintained by multiple maintenance agents, each for operating and maintaining one or more nodes. The preset first judgment condition may be: determining that the first private network agrees to perform the target transaction TX only if all maintenance subjects participating in the voting in the first private network agree to perform the target transaction TX; it is determined that the second private network agrees to perform the target transaction TX only when all maintenance subjects participating in the voting in the second private network agree to perform the target transaction TX. Wherein, as long as one node in each maintenance subject votes for approval, it indicates that the maintenance subject approves to execute the target transaction TX.
If a node determines that both the first private network and the second private network agree to perform the target transaction TX, the node determines that the target transaction TX is allowed to be performed. Otherwise, the node determines that the target transaction TX is not allowed to be executed, or may directly mark the execution result as a failure.
In order to make the first private network and the second private network accurately and securely known: the public link network already allows the target transaction TX to be performed. Each node in the public link network, after determining that the target transaction TX is allowed to be executed, may generate an execution hint, which characterizes that the target transaction TX is allowed to be executed. Thus, as long as the first private network and the second private network obtain the execution prompt, it can know that the target transaction TX is allowed to be executed, and then start to execute the target transaction TX.
It should be noted that the form of the execution hint may be selected in many ways, and the specific form of the execution hint is not limited in the present invention. For example, each node in the public link network, after determining that the target transaction TX is allowed to be executed, may store the target transaction TX in the newly generated block to store the target transaction TX through the block chain of the public link network. As such, the target transaction TX in the new block may be considered an execution hint. In addition, each private link network also continuously synchronizes a new block generated by the public link network, and when the first private link network synchronizes to the new block of the public link network and detects that the target transaction TX is recorded in the new block, the execution prompt of the public link network is received, so that the target transaction TX is known to be allowed to be executed. Similarly, when the second private network synchronizes to a new block of the public network and detects that the target transaction TX is recorded in the new block, it is equivalent to receiving an execution prompt of the public network, so as to know that the target transaction TX is allowed to be executed.
When the first private network knows that the target transaction TX is allowed to be executed, each node in the first private network starts to pre-execute the target transaction TX and obtains a first pre-execution result. Similarly, when the second private network knows that the target transaction TX is allowed to be executed, each node in the second private network starts to pre-execute the target transaction TX and obtains a second pre-execution result. The pre-execution means: the target transaction TX is executed but the execution result is not uplinked temporarily. Accordingly, the pre-execution result means: the execution result of the temporary non-uplink is saved.
Further, the master node (i.e., node1-2) in the first private network collects the first pre-execution results of the nodes in the first private network. A master node (i.e., node2-2) in the second private chain network collects second pre-execution results of nodes in the second private chain network, node2-2 sends the collected second pre-execution results to the master node (i.e., node1-2) in the first private chain network through gateway 2 and gateway 1, and the second pre-execution results of the second private chain network have been sent to the public chain network through node 1-2.
It should be noted that the specific implementation shown in fig. 3 is only one example of various alternative implementations of the present invention, and the implementation of the present invention is not limited to the specific implementation shown in fig. 3. For example, in order to send the execution hint to the private network, the public network does not need to store the execution hint in a new block, so that the private network obtains the execution hint by synchronizing the new block, but can directly send the execution hint to the private network. Or, for example, the master node of the second private network does not have to send the second pre-execution result to the first private network, but directly sends the second pre-execution result to the public network.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating a transaction result uplink submitting stage according to an embodiment of the present invention. As shown in fig. 4, the public link network obtains a first pre-execution result and a second pre-execution result. And the public link network judges whether the first private link network and the second private link network successfully pre-execute the target transaction TX according to the first pre-execution result and the second pre-execution result. If yes, the public link network executes the target transaction TX to obtain an execution result. If not, the public link network does not execute the target transaction TX and may directly mark the execution result as a failure.
In addition, after obtaining the execution result, the public link network sends the execution result to the first private link network and the second private link network. And after the first private network obtains the execution result, judging whether the public network successfully executes the target transaction TX according to the execution result. If yes, the first pre-execution result is linked up and stored, if not, the first pre-execution result is not linked up and stored, the target transaction TX is rolled back, and transaction execution failure and a failure reason can be marked. Similarly, after the second private link network obtains the execution result, whether the public link network successfully executes the target transaction TX is judged according to the execution result, if yes, the second pre-execution result is linked up and stored, if not, the second pre-execution result is not linked up and stored, the target transaction TX can be rolled back, and the transaction execution failure and the reason for the failure can be marked.
In specific implementation, as shown in fig. 4, after the node1-2 collects the first pre-execution result and the second pre-execution result, the first consensus result, the first pre-execution result, the second consensus result, and the second pre-execution result are encapsulated into the transaction tx2, and the transaction tx2 is sent to a node (e.g., node p-6) in the public link network through the gateway 1. Note that the transaction ID of the transaction tx2 at this time is the same as the transaction ID of the transaction tx1, so that the public link network can associate the transaction tx2 with the transaction tx1, and the public link network can know that the transaction tx2 and the transaction tx1 are the same series of transactions.
Node nodeP-6 distributes the transaction tx2 to various nodes in the public link network in response to the transaction tx 2. After receiving the transaction TX2, each node needs to extract a first pre-execution result and a second pre-execution result from the transaction TX2, and determine whether the first private network and the second private network both successfully pre-execute the target transaction TX according to a preset second determination condition.
For example, the preset second determination condition may be: determining that the first private network successfully pre-executes the target transaction TX only when the first pre-execution results of all nodes of the first private network are successfully executed; only when the second pre-execution results of all the nodes of the second private network are successfully executed, it is determined that the second private network successfully pre-executes the target transaction TX.
Or, for example, the preset second determination condition may be: determining that the first private network successfully pre-executes the target transaction TX only if more than half of the first pre-execution results of the first private network are execution successes; the second private network is determined to be successful in pre-executing the target transaction TX only if more than half of the second pre-execution results of the second private network are successful in execution.
In addition, in order to further avoid the malicious party from performing a network attack, as described above, the transaction tx2 may further include the first consensus result and the second consensus result. The first consensus result is signed by a corresponding private key of the first private network and the second consensus result is signed by a corresponding private key of the second private network. Each node, after receiving the transaction tx2, may also extract a first consensus result and a second consensus result from the transaction tx 2. And then, respectively carrying out signature verification on the first consensus result and the second consensus result by using respective corresponding public keys of the first private network and the second private network. In case of passing signature verification, it is determined, again based on the aforementioned first determination condition, whether both the first and second private networks agree to execute the target transaction TX.
If a node has obtained the following decision and verification results after the above-mentioned decision and verification steps, the node starts to execute the target transaction TX. Otherwise, the node does not perform the target transaction TX.
And judging and verifying results: (1) judging that the first private link network and the second private link network both successfully pre-execute the target transaction TX; and (2) the first consensus result and the second consensus result both pass signature verification; and (3) determining that both the first private link network and the second private link network agree to perform the target transaction TX.
In addition, after each node in the public link network executes the target transaction TX to obtain the execution result, the public link network recalls the execution result to the first private link network and the second private link network. After receiving the execution result of the public link network, the master node (i.e., node1-2) of the first private link network notifies each node of the first private link network of the execution result. After each node receives the execution result, whether the public link network successfully executes the target transaction TX is verified according to the execution result, and if the node determines that the public link network successfully executes the target transaction TX, the node determines that the first pre-execution result can be uplink stored. Thus, when the plurality of nodes of the first private link network all determine that the first pre-execution result can be uplink-stored, the plurality of nodes uplink-store the first pre-execution result based on the preset consensus algorithm.
Similarly, the master node (i.e., node2-2) of the second private network receives the execution result of the public link network and distributes the execution result to each node of the second private network. After each node receives the execution result, whether the public link network successfully executes the target transaction TX is judged according to the execution result, and if the node determines that the public link network successfully executes the target transaction TX, the node determines that the second pre-execution result can be stored in an uplink mode. Thus, when the plurality of nodes of the second private link network all determine that the second pre-execution result can be uplink-stored, the plurality of nodes uplink-store the second pre-execution result based on the preset consensus algorithm.
It should be noted that the specific implementation shown in fig. 4 is only one example of various alternative implementations of the present invention, and the implementation of the present invention is not limited to the specific implementation shown in fig. 4. For example, in order to feed back the execution result to the private network, the public network may also store the execution result in a newly generated block, and the private network synchronizes the new block of the public network to obtain the execution result of the public network.
By applying the cross-link transaction method provided by the invention, the public link network can obtain a first consensus vote of the first private link network and a second consensus vote of the second private link network, wherein the first consensus vote represents whether the first private link network agrees to execute the target transaction, and the second consensus vote represents whether the second private link network agrees to execute the target transaction. The public link network can judge whether the first private link network and the second private link network both agree to execute the target transaction according to the first consensus vote and the second consensus vote, and if yes, the public link determines that the target transaction is allowed to be executed. In this way, the public link network serves as an observer, and the target transaction is determined to be allowed to be executed under the condition that the first private link network and the second private link network both agree to execute the target transaction, so that the target transaction can be prevented from being executed mistakenly when opinions of both parties are not matched, and further, the transaction error can be avoided.
In addition, after the first private network obtains the execution prompt, that is, after the first private network knows that the public network allows executing the target transaction, the first private network executes the target transaction by using the pre-executed policy. Similarly, after the second private network obtains the execution prompt, that is, after the second private network knows that the public network allows executing the target transaction, the second private network executes the target transaction by using the pre-executed policy. And the public link network executes the target transaction under the condition that the first private link network and the second private link network are judged to be successfully executed in advance, and sends the execution result to the first private link network and the second private link network. And each private chain network links and stores the pre-execution result thereof only when determining that the public chain network is successfully executed.
In this way, the target transaction is executed only when the public link network determines that the first private link network and the second private link network both execute the target transaction successfully in advance, and the first private link network and the second private link network only uplink and store the respective pre-execution results when the public link network executes the target transaction successfully. Therefore, the transaction execution result can be prevented from being linked up and stored under the condition that one private network fails to execute the transaction and the other private network succeeds in executing the transaction. Therefore, transaction errors can be further avoided, and reliability of cross-link transaction is improved.
Further, consider that: the first private network and the second private network both need to synchronize new blocks of the public link network, and for various reasons (e.g., network delay and network instability), the blocks synchronized by the first private network and the blocks synchronized by the second private network may be different blocks at the same time. For example, at a certain time, the blocks synchronized by the first dedicated link network are: the block with the block height of 1851 (hereinafter referred to as block 1851), i.e., the 1851-th block of the public link network. And the blocks synchronized by the second private network are: the block with the block height of 1853 (hereinafter referred to as block 1853), i.e., the 1853 rd block of the public link network. However, in general, the data status recorded in different blocks is different from each other, for example, in block 1851, some account data is frozen, and in block 1853, the account data has been unfrozen.
Since the data states of different tiles are different, if the first and second private networks pre-execute target transactions based on different tiles, respectively, the following situation may result: one private network successfully pre-executes the target transaction and the other private network fails to successfully pre-execute the target transaction.
Alternatively, consider: during application of the present invention, there may be multiple transactions for the same ledger within a short time (e.g., 2 seconds). For ease of understanding, assume that the balance recorded in a certain ledger in the first private link network is 1000. At a first time, the first private network receives a cross-chain transaction 1 for the ledger, cross-chain transaction 1 being used to roll out 800 from the ledger. Assume that the first private link network receives in turn internal transaction 2 during execution of cross-link transaction 1, internal transaction 2 being used to roll 500 out of the account. If the first private link network has executed internal transaction 2 first when cross-link transaction 1 has not been executed, then the balance of the account record is changed to 500. Thus, since the balance of the ledger record is 500, which is less than 800 required for cross-chain transaction 1, the first private chain network will not be able to successfully perform cross-chain transaction 1 against the ledger. Then, in some cases, the second private network participating in cross-chain transaction 1 may have successfully pre-executed cross-chain transaction 1. As such, the second private network subsequently requires transaction rollback. It can be seen that, in this case, not only the cross-link transaction fails, but also the second private network needs to roll back the transaction, which increases the data processing pressure of the second private network.
In order to avoid the situation and improve the execution success rate of the target transaction, the invention considers that the related account book is locked at a proper time.
Specifically, as shown in fig. 3, when the first private link network knows that the target transaction TX is allowed to be executed, that is, when the first private link network detects an execution prompt from a new block of the public link network, the first private link network locks a first target account book corresponding to the target transaction TX, where the first target account book is an account book for participating in the target transaction TX, and the first target account book exists in the first private link network. Similarly, when the second private-link network knows that the target transaction TX is allowed to be executed, that is, when the second private-link network detects an execution prompt from a new block of the public-link network, the second private-link network locks a second target account book corresponding to the target transaction TX, where the second target account book is an account book for participating in the target transaction TX, and the second target account book exists in the second private-link network.
After the first target account book is locked, the following effects can be achieved: the first target ledger cannot participate in performing other transactions until the target transaction TX is performed for the first target ledger. Similarly, after the second target account book is locked, the following effects can be achieved: the second target ledger cannot participate in performing other transactions until the target transaction TX is performed for the second target ledger.
It should be added that, in order to achieve the above effect, the first private network may lock the entire first private network, that is, lock all the ledgers (including the first target ledger) in the first private network, in addition to locking the first target ledger alone.
For ease of understanding, assume that the public link network determines that the target transaction TX is allowed to be executed and stores the target transaction TX in a newly generated block having a block height of 1851 (hereinafter, the block is referred to as block 1851). Then after the first private network synchronizes to block 1851, a target transaction TX (corresponding to an execution hint) is detected therein, and the first private network locks a first target ledger corresponding to the target transaction TX. Similarly, when the second private network detects the target transaction TX (corresponding to the execution prompt) after synchronizing to block 1851, the second private network locks the second target account book corresponding to the target transaction TX. In this way, the first private network and the second private network pre-execute the target transaction TX based on the same block (i.e., block 1851) when pre-executing the target transaction TX, thereby advantageously improving the success rate of executing the target transaction.
In addition, as shown in fig. 4, after the first private link network records the first pre-execution result through its blockchain (i.e. after the first pre-execution result is uplink-stored), the first private link network unlocks the first target account book. As such, the first private network may continue to process other transactions for the first target ledger. Similarly, as shown in fig. 4, after the second private-link network records the second pre-execution result through its blockchain (i.e. after the second pre-execution result is uplink-stored), the second private-link network unlocks the second target account book. As such, the second private network may continue to process other transactions for the second target ledger.
In addition, it is also considered that in some cases, the public link network may fail to return the execution result to the private network for a long time, so that the private network cannot link up the pre-execution result and cannot unlock the ledger. To this end, the present invention contemplates seeking active unlocking through an unlocking transaction.
Referring to fig. 5, fig. 5 is a schematic diagram of a timeout unlocking according to an embodiment of the present invention. As shown in fig. 5, after the first target ledger is locked, the master node in the first private network starts timeout detection, generates an unlock transaction tx after detecting the lock timeout, and submits the unlock transaction tx to a node (e.g., node nodeP-6) of the public network through the gateway 1.
Node nodeP-6 distributes the unlock transaction tx to various nodes in the public link network in response to the unlock transaction tx. And each node executes the unlocking transaction tx and performs consensus confirmation on the execution result. And finally, the public link network recalls the execution result of the unlocking transaction tx to the first private link network and the second private link network. After receiving the execution result of the unlocking transaction tx, the master node (i.e., node1-2) of the first private chain network notifies each node of the first private chain network to unlock, so that the first target book is unlocked. Similarly, the master node (i.e., node2-2) of the second private network receives the execution result of the unlock transaction tx, and notifies each node of the second private network to unlock, so that the second target ledger is unlocked.
In addition, it is further considered that, in some cases, after the public link network receives the unlock transaction TX, not only the unlock transaction TX is executed to obtain the execution result a of the unlock transaction TX, but also the original target transaction TX may be executed to obtain the execution result B of the target transaction TX. The public link network returns the transaction results to the first private link network, possibly in the following order: the execution result a of the unlock transaction TX is returned first, and then the execution result B of the target transaction TX is returned. And the public link network returns the transaction result to the second private link network, possibly in the following order: the execution result B of the target transaction TX is returned first, and then the execution result a of the unlock transaction TX is returned. Thus, when the first private network first receives the execution result a of the unlock transaction TX, the unlock operation is executed, and the first private network rolls back the target transaction TX and avoids linking up the first pre-execution result of the target transaction TX. When the second private network first receives the execution result B of the target transaction TX, the second pre-execution result of the target transaction TX is linked up and stored, and an unlocking operation is performed. As can be seen, the first private network does not uplink the pre-execution result, and the second private network uplink the pre-execution result, which is equivalent to the first private network does not execute the target transaction TX finally, and the second private network executes the target transaction TX finally. As such, cross-chain transaction errors result.
To further avoid the above, the present invention contemplates ordering transactions. Specifically, when a plurality of transactions are received by the public link network (for example, the plurality of transactions include a target transaction TX and an unlocked transaction TX), the plurality of transactions are sorted, and the transactions are executed in sequence according to the sorting of the transactions, and the transaction results are returned in sequence. Therefore, a plurality of transaction results received by each private network in sequence can be ensured to have the same sequence, so that the situation is avoided, the possibility of error occurrence of cross-link transaction is further reduced, and the reliability of the cross-link transaction is improved.
In the above, the present invention provides a preferred embodiment of the cross-chain transaction method in detail through fig. 2 to 5. In the following, the present invention provides a plurality of cross-chain transaction methods based on the same inventive concept through a plurality of embodiments, and the cross-chain transaction methods include some technical features in the above preferred embodiments.
Referring to fig. 6, fig. 6 is a flowchart of a cross-chain transaction method applied to a blockchain network system (as shown in fig. 1) including a public-chain network, a first private-chain network, and a second private-chain network, according to an embodiment of the present invention. As shown in fig. 6, the cross-chain transaction method includes the following steps:
step S61: the public link network obtains a first consensus vote of the first private link network on a target transaction and a second consensus vote of the second private link network on the target transaction, and judges whether the first private link network and the second private link network agree to execute the target transaction according to the first consensus vote and the second consensus vote, if so, an execution prompt is generated, and the execution prompt is used for representing that the target transaction is allowed to be executed.
As previously described, the first consensus vote is used to characterize: whether the first private network agrees to perform the target transaction. The second consensus vote is used to characterize: whether the second private network agrees to perform the target transaction.
As described above, in some embodiments of the present invention, after obtaining the first consensus vote and the second consensus vote, the public link network determines whether both the first private link network and the second private link network agree to perform the target transaction according to a determination condition preset in the public link network. If so, the public link network determines that the target transaction is allowed to be performed. If not, the public link network determines that the target transaction is not allowed to be performed. In this way, the public link network serves as the witness, and the target transaction is determined to be allowed to be executed under the condition that the first private link network and the second private link network both agree to execute the target transaction, so that the target transaction can be prevented from being executed mistakenly when opinions of both parties are not good, and further, the transaction error can be avoided.
As previously mentioned, in some embodiments of the invention, the execution hint is recorded in a new tile of the public link network. In particular, the public link network may post the target transaction to the newly generated block if it is determined that the target transaction is allowed to be executed. Thus, the target transaction recorded in the new block is equivalent to the execution prompt. The private link network is synchronized to a new block of the public link network, and when the target transaction is detected to be recorded in the new block, the execution prompt of the public link network is received by the private link network.
Step S62: the first private network obtains the execution prompt and pre-executes the target transaction to obtain a first pre-execution result, and the second private network obtains the execution prompt and pre-executes the target transaction to obtain a second pre-execution result.
As described above, the pre-execution means: the target transaction is executed, but the execution result is not temporarily uplink saved. Accordingly, the pre-execution result means: the execution result of the temporary non-uplink is saved.
As described above, in some embodiments of the present invention, the first private link network synchronizes new blocks generated by the public link network according to an increasing order of block heights, and detects whether the new block has the execution hint recorded therein for each new block synchronized to obtain the execution hint. Similarly, the second private link network synchronizes the new blocks generated by the public link network according to the ascending order of the block heights, and detects whether the execution hint is recorded in each new block synchronized to obtain the execution hint.
Specifically, when the first private network is synchronized to a new block of the public network and the target transaction is detected to be recorded in the new block, it is equivalent to receiving an execution prompt of the public network, so as to know that the target transaction is allowed to be executed. Similarly, when the second private network synchronizes to a new block of the public network and detects that the target transaction is recorded in the new block, it is equivalent to receiving an execution prompt of the public network, so as to know that the target transaction is allowed to be executed.
Step S63: and the public link network obtains the first pre-execution result and the second pre-execution result, judges whether the first private link network and the second private link network successfully pre-execute the target transaction according to the first pre-execution result and the second pre-execution result, and executes the target transaction to obtain an execution result if the target transaction is successfully pre-executed by the public link network and the second private link network.
As described above, in some embodiments of the present invention, after obtaining the first pre-execution result and the second pre-execution result, the public link network determines whether both the first private link network and the second private link network successfully pre-execute the target transaction according to a predetermined determination condition in the public link network. If yes, the public link network executes the target transaction to obtain an execution result. If not, the public link network does not execute the target transaction.
Step S64: the first private network obtains the execution result, records the first pre-execution result through a blockchain of the first private network when the execution result represents that the public network successfully executes the target transaction, obtains the execution result through the second private network, and records the second pre-execution result through a blockchain of the second private network when the execution result represents that the public network successfully executes the target transaction.
As previously described, in some embodiments of the present invention, if the public link network performs the target transaction and obtains the execution result, the public link network transmits the execution result to the first private link network and the second private link network. And after the first private network obtains the execution result, judging whether the public network successfully executes the target transaction according to the execution result. If yes, the first pre-execution result is linked up and stored, and if not, the first pre-execution result is not linked up and stored. Similarly, after the second private chain network obtains the execution result, whether the public chain network successfully executes the target transaction is judged according to the execution result, if yes, the second pre-execution result is linked up and stored, and if not, the second pre-execution result is not linked up and stored.
For avoiding repetition, reference may be made to the above preferred embodiments for specific implementation manners of the steps S61 through S64, which are not repeated herein.
In addition, based on the same considerations as those in the above preferred embodiment, after the first private link network obtains the execution prompt from a new block, the first private link network locks the first target account book corresponding to the target transaction. Similarly, when the second private-link network obtains an execution prompt from a new block, the second private-link network locks a second target account book corresponding to the target transaction. Therefore, the success rate of cross-link transaction can be effectively improved. And after the first private link network records the first pre-execution result through the blockchain, the first private link network unlocks the first target account book. Similarly, after the second private-link network records the second pre-execution result through its blockchain, the second private-link network unlocks the second target book.
For avoiding repetition, reference may be made to the above preferred embodiment for a specific implementation manner of the above locking step and the unlocking step, which is not described herein again.
Referring to fig. 7, fig. 7 is a flowchart of a cross-link transaction method according to an embodiment of the present invention, where the cross-link transaction method is applied to a node in a first private link network. The first private link network belongs to a block link network system (as shown in fig. 1), which includes a public link network and a second private link network in addition to the first private link network. As shown in fig. 7, the cross-chain transaction method includes the following steps:
step S71: sending a first consensus vote to the public link network for a target transaction, the first consensus vote characterizing whether the first private link network agrees to perform the target transaction.
Step S72: obtaining an execution hint for the public-link network, the execution hint generated by the public-link network if both the first private-link network and the second private-link network agree to execute the target transaction.
As previously described, in some embodiments of the invention, execution hints are recorded in a new tile of the public link network. In order to obtain the execution prompt of the public link network, the first private link network synchronizes new blocks generated by the public link network according to the ascending order of the block heights, and detects whether the execution prompt is recorded in each new block so as to obtain the execution prompt from the new block.
Step S73: and responding to the execution prompt, pre-executing the target transaction to obtain a first pre-execution result, and sending the first pre-execution result to the public link network.
As described above, the pre-execution means: the target transaction is executed, but the execution result is not temporarily uplink saved. Accordingly, the pre-execution result means: the execution result of the temporary non-uplink is saved.
Step S74: and obtaining an execution result of the public link network, wherein the execution result is obtained after the public link network executes the target transaction under the condition that the first private link network and the second private link network both successfully execute the target transaction in advance.
Step S75: and recording the first pre-execution result into a block in response to the execution result so as to record the first pre-execution result through a block chain.
To avoid repetition, reference may be made to the above preferred embodiments for specific implementation manners of steps S71 to S75, which are not repeated herein.
In addition, based on the same consideration as the above preferred embodiment, after the first private link network obtains the execution prompt from a new block, the first private link network locks the first target account book corresponding to the target transaction; after the first private link network records the first pre-execution result into the block, the first target account book is unlocked. Therefore, the success rate of cross-link transaction can be effectively improved. In addition, the first private network also detects whether the locking of the first target account book is overtime, and sends an unlocking transaction to the public network under the condition that the locking is overtime; the first private network also receives an execution result of the public network for the unlocking transaction, and unlocks the first target ledger in response to the execution result.
For avoiding repetition, reference may be made to the above preferred embodiment for a specific implementation manner of the above locking step and the unlocking step, which is not described herein again.
As previously mentioned, in some embodiments of the invention, the first private network may also send the target transaction to the second private network before sending the first consensus vote to the public network; the first private network obtains the first consensus vote of the first private network for the target transaction and receives a second consensus vote of the second private network for the target transaction sent by the second private network, the second consensus vote representing whether the second private network agrees to perform the target transaction.
The first private link network obtains the first consensus vote of the first private link network for the target transaction, specifically, a node (e.g., a master node) in the first private link network for collecting votes, and obtains votes of each node of the first private link network for the target transaction.
When the first private link network sends the first consensus vote to the public link network, specifically, the first private link network sends the collected first consensus vote, the collected second consensus vote and the target transaction one to the public link network.
In this embodiment, the second consensus vote of the second private network is collected via the first private network, and the first consensus vote and the second consensus vote are sent to the public link network as a transaction. In this way, the public link network may determine whether both the first private link network and the second private link network agree to perform the target transaction based on the first consensus vote and the second consensus vote in the transaction. It can be seen that the operation of the public link network is simpler, and the data processing pressure of the nodes is lower. On the contrary, if the first private link network and the second private link network respectively send respective consensus votes to the public link network through different transactions (two transactions in total), the public link network first needs to match the two transactions, then extracts the consensus votes from the two transactions, and finally executes corresponding judgment. Thus, the operation of the public link network is complex, and the data processing pressure of the nodes is large.
As described above, in some embodiments of the present invention, before the first pre-execution result is sent to the public network, the first private network may further receive a second pre-execution result obtained after the second private network pre-executes the target transaction, where the second pre-execution result is sent by the second private network.
When the first private link network sends the first pre-execution result to the public link network, specifically, the first private link network sends the first pre-execution result and the first pre-execution result to the public link network.
In this embodiment, the first pre-execution result of the first private network is collected by the first private network, and the first pre-execution result and the second pre-execution result are sent to the public link network as a transaction. In this way, the public link network may determine whether the first private link network and the second private link network both successfully pre-execute the target transaction based on the first pre-execution result and the second pre-execution result in the transaction. It can be seen that the operation of the public link network is simpler, and the data processing pressure of the nodes is lower. On the contrary, if the first private link network and the second private link network respectively send respective pre-execution results to the public link network through different transactions (two transactions in total), the public link network first needs to match the two transactions, then extracts the pre-execution results from the two transactions, and finally executes corresponding judgment. Thus, the operation of the public link network is complex, and the data processing pressure of the nodes is large.
Referring to fig. 8, fig. 8 is a flowchart of a cross-link transaction method according to an embodiment of the present invention, where the cross-link transaction method is applied to a node in a second private link network. The second private link network belongs to a block link network system (as shown in fig. 1), which includes a public link network and a first private link network in addition to the second private link network. As shown in fig. 8, the cross-chain transaction method includes the following steps:
step S81: sending a second consensus vote to the first private network for a target transaction, the second consensus vote characterizing whether the second private network agrees to perform the target transaction.
Step S82: obtaining an execution hint for the public-link network, the execution hint generated by the public-link network if both the first private-link network and the second private-link network agree to execute the target transaction.
As previously described, in some embodiments of the invention, execution hints are recorded in a new tile of the public link network. In order to obtain the execution prompt of the public link network, the second private link network synchronizes the new blocks generated by the public link network according to the ascending order of the block heights, and detects whether the execution prompt is recorded in each new block so as to obtain the execution prompt from the new block.
Step S83: and responding to the execution prompt, pre-executing the target transaction to obtain a second pre-execution result, and sending the second pre-execution result to the first private link network.
As described above, the pre-execution means: the target transaction is executed, but the execution result is not temporarily uplink saved. Accordingly, the pre-execution result means: the execution result of the temporary non-uplink is saved.
Step S84: and obtaining an execution result of the public link network, wherein the execution result is obtained after the public link network executes the target transaction under the condition that the first private link network and the second private link network both successfully execute the target transaction in advance.
Step S85: and recording the second pre-execution result into a block in response to the execution result so as to record the second pre-execution result through a block chain.
To avoid repetition, reference may be made to the above preferred embodiments for specific implementation manners of steps S81 to S85, which are not repeated herein.
In addition, based on the same consideration as the above preferred embodiment, after the second private-link network obtains the execution prompt from a new block, the second private-link network locks the second target account book corresponding to the target transaction; and after the second private link network records the second pre-execution result into the block, the second private link network unlocks the second target account book. Therefore, the success rate of cross-link transaction can be effectively improved. In addition, the second private network may also obtain an execution result of the public network for the unlocking transaction, and unlock the second target ledger in response to the execution result. And the unlocking transaction is a transaction sent to the public link network after the first private link network detects that the locking of the first target account book corresponding to the target transaction is overtime.
For avoiding repetition, reference may be made to the above preferred embodiment for a specific implementation manner of the above locking step and the unlocking step, which is not described herein again.
Referring to fig. 9, fig. 9 is a flowchart of a cross-link transaction method according to an embodiment of the present invention, where the cross-link transaction method is applied to a node in a public link network. The public link network belongs to a block chain network system (as shown in fig. 1), and the block chain network system comprises a first private link network and a second private link network in addition to the public link network. As shown in fig. 9, the cross-chain transaction method includes the following steps:
step S91: a first consensus vote of the first private link network for a target transaction and a second consensus vote of the second private link network for the target transaction are obtained.
As previously mentioned, the first consensus vote is used to characterize whether the first private network agrees to perform the target transaction, and the second consensus vote characterizes whether the second private network agrees to perform the target transaction.
Step S92: and judging whether the first private link network and the second private link network both agree to execute the target transaction according to the first consensus vote and the second consensus vote, if so, generating an execution prompt, wherein the execution prompt is used for representing that the target transaction is allowed to be executed.
As described above, in some embodiments of the present invention, after obtaining the first consensus vote and the second consensus vote, the link network determines whether both the first private network and the second private network agree to perform the target transaction according to a determination condition preset in the public link network. If yes, the public link network determines that the target transaction is allowed to be executed and generates a corresponding execution prompt. If not, the public link network determines that the target transaction is not allowed to be performed. In this way, the public link network serves as the witness, and the target transaction is determined to be allowed to be executed under the condition that the first private link network and the second private link network both agree to execute the target transaction, so that the target transaction can be prevented from being executed mistakenly when opinions of both parties are not good, and further, the transaction error can be avoided.
Step S93: and obtaining a first pre-execution result and a second pre-execution result, wherein the first pre-execution result is an execution result of the first private link network after the target transaction is pre-executed after the execution prompt is obtained, and the second pre-execution result is an execution result of the second private link network after the target transaction is pre-executed after the execution prompt is obtained.
As described above, the pre-execution means: the target transaction is executed, but the execution result is not temporarily uplink saved. Accordingly, the pre-execution result means: the execution result of the temporary non-uplink is saved.
Step S94: and judging whether the first private chain network and the second private chain network successfully pre-execute the target transaction according to the first pre-execution result and the second pre-execution result, if so, executing the target transaction to obtain an execution result, and sending the execution result to the first private chain network and the second private chain network.
As described above, in some embodiments of the present invention, after obtaining the first pre-execution result and the second pre-execution result, the public link network determines whether both the first private link network and the second private link network successfully pre-execute the target transaction according to a predetermined determination condition in the public link network. If yes, the public link network executes the target transaction to obtain an execution result. If not, the public link network does not execute the target transaction.
To avoid repetition, reference may be made to the above preferred embodiments for specific implementation manners of steps S91 to S94, which are not repeated herein.
Furthermore, as previously mentioned, in some embodiments of the invention, execution hints are recorded in new tiles of the public-link network, and the public-link network synchronizes new tiles to the first private-link network in order of increasing tile height. Similarly, the public link network synchronizes new tiles to the second private link network in order of increasing tile height.
Further, as mentioned above, in some embodiments of the present invention, when obtaining the first consensus vote and the second consensus vote, the public link network receives, in particular, the first private link network transmitted by: a first consensus vote of the first private link network for a target transaction, a second consensus vote of the second private link network for the target transaction, and the target transaction.
Furthermore, as mentioned above, in some embodiments of the present invention, when the public link network obtains the first pre-execution result and the second pre-execution result, specifically, the public link network receives the first pre-execution result and the second pre-execution result sent by the first private network.
Furthermore, as mentioned above, in some embodiments of the present invention, the public link network may further obtain an unlock transaction sent by the first private network, where the unlock transaction is a transaction generated by the first private network after the first private network detects a lock timeout to a first target ledger corresponding to a target transaction.
And the public link network sequences the unlocking transaction and other transactions received by the public link network, and executes each transaction in turn according to the sequence.
And after the public link network executes the unlocking transaction, obtaining an execution result of the unlocking transaction, and sending the execution result to the first private link network and the second private link network.
For avoiding repetition, reference may be made to the above preferred embodiment for a specific implementation manner of the unlocking transaction, which is not described herein again.
Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, as shown in fig. 10, including a processor 101, a communication interface 102, a memory 103, and a communication bus 104, where the processor 101, the communication interface 102, and the memory 103 complete communication with each other through the communication bus 104.
The memory 103 is used for storing computer programs;
the processor 101 is configured to implement the following steps when executing the program stored in the memory 103:
sending a first consensus vote to the public link network for a target transaction, the first consensus vote characterizing whether the first private link network agrees to perform the target transaction;
obtaining an execution hint for the public-link network, the execution hint generated by the public-link network if both the first private-link network and the second private-link network agree to execute the target transaction;
responding to the execution prompt, pre-executing the target transaction to obtain a first pre-execution result, and sending the first pre-execution result to the public link network;
obtaining an execution result of the public link network, wherein the execution result is obtained after the public link network executes the target transaction under the condition that the first private link network and the second private link network both successfully pre-execute the target transaction;
and recording the first pre-execution result into a block in response to the execution result so as to record the first pre-execution result through a block chain.
Or, the following steps are implemented:
sending a second consensus vote for a target transaction to the first private network, the second consensus vote characterizing whether the second private network agrees to perform the target transaction;
obtaining an execution hint for the public-link network, the execution hint generated by the public-link network if both the first private-link network and the second private-link network agree to execute the target transaction;
in response to the execution prompt, pre-executing the target transaction to obtain a second pre-execution result, and sending the second pre-execution result to the first private link network;
obtaining an execution result of the public link network, wherein the execution result is obtained after the public link network executes the target transaction under the condition that the first private link network and the second private link network both successfully pre-execute the target transaction;
and recording the second pre-execution result into a block in response to the execution result so as to record the second pre-execution result through a block chain.
Or, the following steps are implemented:
obtaining a first consensus vote of the first private link network for a target transaction and a second consensus vote of the second private link network for the target transaction;
judging whether the first private link network and the second private link network both agree to execute the target transaction according to the first consensus vote and the second consensus vote, if so, generating an execution prompt, wherein the execution prompt is used for representing that the target transaction is allowed to be executed;
obtaining a first pre-execution result and a second pre-execution result, wherein the first pre-execution result is an execution result of the first private link network after the target transaction is pre-executed after the execution prompt is obtained, and the second pre-execution result is an execution result of the second private link network after the target transaction is pre-executed after the execution prompt is obtained;
and judging whether the first private chain network and the second private chain network successfully pre-execute the target transaction according to the first pre-execution result and the second pre-execution result, if so, executing the target transaction to obtain an execution result, and sending the execution result to the first private chain network and the second private chain network.
Alternatively, the steps of the cross-chain transaction method provided by the other method embodiments of the present invention above are implemented.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment of the present invention, there is also provided a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to perform the cross-chain transaction method described in any of the above embodiments.
In yet another embodiment, a computer program product containing instructions is also provided, which when run on a computer, causes the computer to perform the method of cross-chain trading as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (15)

1. A cross-chain transaction method is applied to a block chain network system, wherein the block chain network system comprises a public chain network, a first private chain network and a second private chain network, and the method comprises the following steps:
the public link network obtains a first consensus vote of the first private link network on a target transaction and a second consensus vote of the second private link network on the target transaction, and judges whether the first private link network and the second private link network agree to execute the target transaction according to the first consensus vote and the second consensus vote, if so, an execution prompt is generated, and the execution prompt is used for representing that the target transaction is allowed to be executed;
after the first private network obtains the execution prompt, the target transaction is pre-executed to obtain a first pre-execution result, and after the second private network obtains the execution prompt, the target transaction is pre-executed to obtain a second pre-execution result; wherein the execution hint is recorded in a new block of the public link network; the first private link network obtains the execution hint by: the first private chain network synchronizes new blocks generated by the public chain network according to the ascending sequence of the block heights, and detects whether the execution prompt is recorded in each new block so as to acquire the execution prompt; the second private network obtains the execution hint by: the second private chain network synchronizes the new blocks generated by the public chain network according to the ascending sequence of the block heights, and detects whether the execution prompt is recorded in each new block so as to acquire the execution prompt;
the public link network obtains the first pre-execution result and the second pre-execution result, and judges whether the first private link network and the second private link network successfully pre-execute the target transaction according to the first pre-execution result and the second pre-execution result, if so, the target transaction is executed, and an execution result is obtained;
the first private network obtains the execution result, records the first pre-execution result through a blockchain of the first private network when the execution result represents that the public network successfully executes the target transaction, obtains the execution result through the second private network, and records the second pre-execution result through a blockchain of the second private network when the execution result represents that the public network successfully executes the target transaction.
2. The method of claim 1, further comprising:
after the first private link network obtains the execution prompt from a new block, the first private link network locks a first target account book corresponding to the target transaction;
after the first private link network records the first pre-execution result through the blockchain thereof, the first private link network unlocks the first target account book;
after the second private link network obtains the execution prompt from a new block, the second private link network locks a second target account book corresponding to the target transaction;
after the second private link network records the second pre-execution result through its blockchain, the second private link network unlocks the second target book.
3. A method for cross-link transaction, applied to a node in a first private-link network, the first private-link network belonging to a blockchain network system, the blockchain network system further comprising a public-link network and a second private-link network, the method comprising:
sending a first consensus vote to the public link network for a target transaction, the first consensus vote characterizing whether the first private link network agrees to perform the target transaction;
obtaining an execution hint for the public-link network, the execution hint generated by the public-link network if both the first private-link network and the second private-link network agree to execute the target transaction; wherein the execution hint is recorded in a new block of the public link network; the obtaining of the execution prompt of the public link network includes: according to the ascending sequence of the block heights, synchronizing new blocks generated by the public link network, and detecting whether the execution prompt is recorded in each synchronized new block so as to acquire the execution prompt from the new block;
responding to the execution prompt, pre-executing the target transaction to obtain a first pre-execution result, and sending the first pre-execution result to the public link network;
obtaining an execution result of the public link network, wherein the execution result is obtained after the public link network executes the target transaction under the condition that the first private link network and the second private link network both successfully pre-execute the target transaction;
and recording the first pre-execution result into a block in response to the execution result so as to record the first pre-execution result through a block chain.
4. The method of claim 3, further comprising:
after obtaining an execution prompt from a new block, locking a first target account book corresponding to the target transaction;
unlocking the first target book after logging the first pre-execution result into a block.
5. The method of claim 4, further comprising:
detecting whether the locking of the first target account book is overtime, and sending an unlocking transaction to the public link network under the condition that the locking is overtime;
and obtaining an execution result of the public link network for the unlocking transaction, and responding to the execution result to unlock the first target account book.
6. The method of any of claims 3 to 5, wherein prior to sending the first consensus vote to the public link network, the method further comprises:
sending the target transaction to the second private link network;
obtaining the first consensus vote of the first private network for the target transaction, and receiving a second consensus vote of the second private network for the target transaction sent by the second private network, the second consensus vote characterizing whether the second private network agrees to perform the target transaction;
the sending the first consensus vote for the target transaction to the public link network comprises:
sending the first consensus vote, the second consensus vote, and the target transaction together to the public link network.
7. The method of any of claims 3 to 5, wherein prior to sending the first pre-execution result to the public link network, the method further comprises:
receiving a second pre-execution result which is sent by the second private network and is obtained after the second private network pre-executes the target transaction;
the sending the first pre-execution result to the public link network includes:
and sending the first pre-execution result and the second pre-execution result to the public link network.
8. A method for cross-link transaction, applied to a node in a second private-link network belonging to a blockchain network system, the blockchain network system further including a public-link network and a first private-link network, the method comprising:
sending a second consensus vote for a target transaction to the first private network, the second consensus vote characterizing whether the second private network agrees to perform the target transaction;
obtaining an execution hint for the public-link network, the execution hint generated by the public-link network if both the first private-link network and the second private-link network agree to execute the target transaction; wherein the execution hint is recorded in a new block of the public link network; the obtaining of the execution prompt of the public link network includes: according to the ascending sequence of the block heights, synchronizing new blocks generated by the public link network, and detecting whether the execution prompt is recorded in each synchronized new block so as to acquire the execution prompt from the new block;
in response to the execution prompt, pre-executing the target transaction to obtain a second pre-execution result, and sending the second pre-execution result to the first private link network;
obtaining an execution result of the public link network, wherein the execution result is obtained after the public link network executes the target transaction under the condition that the first private link network and the second private link network both successfully pre-execute the target transaction;
and recording the second pre-execution result into a block in response to the execution result so as to record the second pre-execution result through a block chain.
9. The method of claim 8, further comprising:
after obtaining an execution prompt from a new block, locking a second target account book corresponding to the target transaction;
unlocking the second target book after logging the second pre-execution result into a block.
10. The method of claim 9, further comprising:
obtaining an execution result of the public link network for unlocking transaction, and responding to the execution result to unlock the second target account book;
the unlocking transaction is a transaction sent to the public link network after the first private link network detects that the locking of a first target account book corresponding to the target transaction is overtime.
11. A method for cross-link transaction, applied to a node in a public link network, wherein the public link network belongs to a blockchain network system, and the blockchain network system further comprises a first private link network and a second private link network, the method comprising:
obtaining a first consensus vote of the first private link network for a target transaction and a second consensus vote of the second private link network for the target transaction;
judging whether the first private link network and the second private link network both agree to execute the target transaction according to the first consensus vote and the second consensus vote, if so, generating an execution prompt, wherein the execution prompt is used for representing that the target transaction is allowed to be executed;
obtaining a first pre-execution result and a second pre-execution result, wherein the first pre-execution result is an execution result of the first private link network after the target transaction is pre-executed after the execution prompt is obtained, and the second pre-execution result is an execution result of the second private link network after the target transaction is pre-executed after the execution prompt is obtained;
judging whether the first private chain network and the second private chain network successfully pre-execute the target transaction according to the first pre-execution result and the second pre-execution result, if so, executing the target transaction to obtain an execution result, and sending the execution result to the first private chain network and the second private chain network;
wherein the execution hint is recorded in a new block of the public link network, the method further comprising:
synchronizing new blocks to the first private network in an increasing order of block heights;
synchronizing new blocks to the second private network in order of increasing block height.
12. The method of claim 11, wherein obtaining the first consensus vote for the target transaction by the first private link network and the second consensus vote for the target transaction by the second private link network comprises:
receiving a first consensus vote of the first private network for a target transaction, a second consensus vote of the second private network for the target transaction, and the target transaction, sent by the first private network;
the obtaining the first pre-execution result and the second pre-execution result includes:
and receiving the first pre-execution result and the second pre-execution result sent by the first private network.
13. The method according to claim 11 or 12, characterized in that the method further comprises:
obtaining an unlocking transaction sent by the first private network, wherein the unlocking transaction is generated by the following steps: after the first private link network detects that the locking of a first target account book corresponding to the target transaction is overtime, the first private link network generates the unlocking transaction;
ordering the unlocking transaction and other transactions received by the public link network, and executing each transaction in sequence according to the ordering;
and after the unlocking transaction is executed, obtaining an execution result of the unlocking transaction, and sending the execution result to the first private chain network and the second private chain network.
14. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
the memory is used for storing a computer program;
the processor, when executing a program stored on the memory, is adapted to carry out the method steps of any of claims 3 to 7, or to carry out the method steps of any of claims 8 to 10, or to carry out the method steps of any of claims 11 to 13.
15. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method steps of any of the claims 3 to 7, or carries out the method steps of any of the claims 8 to 10, or carries out the method steps of any of the claims 11 to 13.
CN202010758625.XA 2020-07-31 2020-07-31 Cross-chain transaction method, electronic device and readable storage medium Active CN111953754B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010758625.XA CN111953754B (en) 2020-07-31 2020-07-31 Cross-chain transaction method, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010758625.XA CN111953754B (en) 2020-07-31 2020-07-31 Cross-chain transaction method, electronic device and readable storage medium

Publications (2)

Publication Number Publication Date
CN111953754A CN111953754A (en) 2020-11-17
CN111953754B true CN111953754B (en) 2021-06-08

Family

ID=73339837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010758625.XA Active CN111953754B (en) 2020-07-31 2020-07-31 Cross-chain transaction method, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN111953754B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112488834B (en) * 2020-11-24 2024-03-19 成都质数斯达克科技有限公司 Node management method, node management device, electronic equipment and readable storage medium
CN112700314A (en) * 2020-12-21 2021-04-23 布比(北京)网络技术有限公司 Auction method and system based on mixed block chain
CN112671908B (en) * 2020-12-25 2023-03-21 成都质数斯达克科技有限公司 Network management method and device, electronic equipment and readable storage medium
CN113409145B (en) * 2021-06-18 2022-04-22 支付宝(杭州)信息技术有限公司 Cross-block-chain transaction synchronization method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110020860A (en) * 2019-04-09 2019-07-16 湖南天河国云科技有限公司 Across the chain assets transfer method of one kind, system and computer readable storage medium
CN110210917A (en) * 2019-06-03 2019-09-06 杭州云象网络技术有限公司 A kind of electronic invoice system construction method based on multichain configuration
CN111010394A (en) * 2019-08-15 2020-04-14 腾讯科技(深圳)有限公司 Block chain multi-chain management method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108288159A (en) * 2018-03-07 2018-07-17 物数(上海)信息科技有限公司 Across chain method of commerce, system, equipment and storage medium based on multi-tiling chain
CN109345387A (en) * 2018-09-04 2019-02-15 湖南宸瀚信息科技有限责任公司 Across the chain method of commerce of block chain, across chain communication device and storage medium
WO2020133333A1 (en) * 2018-12-29 2020-07-02 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for a hierarchical blockchain network
CN111080449B (en) * 2019-12-03 2023-12-19 深圳前海微众银行股份有限公司 Cross-chain transaction method of blockchain, management node and blockchain network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110020860A (en) * 2019-04-09 2019-07-16 湖南天河国云科技有限公司 Across the chain assets transfer method of one kind, system and computer readable storage medium
CN110210917A (en) * 2019-06-03 2019-09-06 杭州云象网络技术有限公司 A kind of electronic invoice system construction method based on multichain configuration
CN111010394A (en) * 2019-08-15 2020-04-14 腾讯科技(深圳)有限公司 Block chain multi-chain management method and device

Also Published As

Publication number Publication date
CN111953754A (en) 2020-11-17

Similar Documents

Publication Publication Date Title
CN111953754B (en) Cross-chain transaction method, electronic device and readable storage medium
US11733991B2 (en) Data processing method based on intelligent contract, device, and storage medium
CN109002732B (en) Data evidence storage method, equipment and system and data evidence obtaining method
CN107193490B (en) Distributed data storage system and method based on block chain
CN111612613B (en) Block chain network with centralized system
CN110493198A (en) A method of it is attacked based on Sybil in PBFT algorithm defence block chain is improved
US11403281B2 (en) Parallel blockchain processing
CN112671881B (en) Node organization management method and device, electronic equipment and readable storage medium
CN112671908B (en) Network management method and device, electronic equipment and readable storage medium
CN112202564B (en) Transaction transfer method and device, electronic equipment and readable storage medium
CN110321730A (en) A kind of method, block chain node and the storage medium of operation data processing
CN112488834B (en) Node management method, node management device, electronic equipment and readable storage medium
CN114172680B (en) Operation method of block chain system based on node reputation mechanism
CN112396427B (en) Cross-chain interchange operation method for general scenes
CN114090683A (en) Intelligent contract management method, equipment and storage medium based on alliance administration
CN112037062B (en) Transaction consensus method, device, electronic equipment and readable storage medium
CN111598389B (en) Transaction system for preventing bill market risk based on blockchain
CN112202863B (en) Data synchronization method and device, electronic equipment and readable storage medium
CN112272114A (en) Method, device, equipment and storage medium for sending information across block chain network
CN112600874B (en) Node joining method and device, electronic equipment and readable storage medium
CN111222991A (en) Method and system for crossing chains between block chains
CN115941693B (en) Method, device, equipment and medium for accessing chain group into blockchain
CN111222876A (en) Method and system for solving cross-chain coupling
CN116708463B (en) Information processing method, device, equipment and medium based on multi-block chain
CN113313584B (en) Service processing method and processing device

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