CN114240651A - Cross-chain transaction sending method, device, equipment and storage medium - Google Patents

Cross-chain transaction sending method, device, equipment and storage medium Download PDF

Info

Publication number
CN114240651A
CN114240651A CN202111467182.XA CN202111467182A CN114240651A CN 114240651 A CN114240651 A CN 114240651A CN 202111467182 A CN202111467182 A CN 202111467182A CN 114240651 A CN114240651 A CN 114240651A
Authority
CN
China
Prior art keywords
cross
chain
link
transaction
serial number
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111467182.XA
Other languages
Chinese (zh)
Inventor
徐才巢
张强
梁智昊
李彭智
杨建航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hebei Xiong'an New Area Management Committee
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hebei Xiong'an New Area Management Committee
Hangzhou Qulian 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 Hebei Xiong'an New Area Management Committee, Hangzhou Qulian Technology Co Ltd filed Critical Hebei Xiong'an New Area Management Committee
Priority to CN202111467182.XA priority Critical patent/CN114240651A/en
Publication of CN114240651A publication Critical patent/CN114240651A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD

Landscapes

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

Abstract

The application discloses a method, a device, equipment and a storage medium for cross-chain transaction sending, and belongs to the technical field of block chains. The method is applied to the cross-link gateway and comprises the following steps: acquiring a serial number of a cross-chain transaction newly requested by an application chain system as a first cross-chain transaction serial number, and acquiring a serial number of a cross-chain transaction newly received by a relay chain system from the application chain system as a second cross-chain transaction serial number; determining a sequence number of the cross-chain transaction which is not forwarded to the relay chain system in the cross-chain transaction requested by the application chain system according to the first cross-chain transaction sequence number and the second cross-chain transaction sequence number as a third cross-chain transaction sequence number; and acquiring the cross-link transaction with the sequence number of the third cross-link transaction sequence number from the application chain system as the first target cross-link transaction and forwarding the first target cross-link transaction to the relay chain system. The cross-link gateway can accurately judge the forwarding condition of the cross-link transaction without recording the cross-link transaction state, ensures the efficient synchronization of the cross-link transaction between an application link system and a relay link system, and has strong expandability and mobility.

Description

Cross-chain transaction sending method, device, equipment and storage medium
Technical Field
The present application relates to the field of cross-chain technologies, and in particular, to a method, an apparatus, a device, and a storage medium for sending a cross-chain transaction.
Background
With the continuous development of blockchain technology, more and more blockchain systems adopt cross-chain technology for interoperative access and cooperation. The cross-chain technology refers to connecting homogeneous or heterogeneous block chain systems to realize information intercommunication between block chains.
Currently, a relay link technology is adopted to realize chain spanning. Specifically, the source application chain system forwards the cross-chain transaction to the relay chain system through one cross-chain gateway, the relay chain system verifies the cross-chain transaction, and after the verification is passed, the cross-chain transaction is forwarded to the destination application chain system through another cross-chain gateway.
In the above manner, the cross-link gateway needs to record the cross-link transaction state, that is, it is a stateful cross-link gateway. The cross-chain transaction state is used for indicating which cross-chain transactions from the source application chain system are forwarded to the relay chain system and which cross-chain transactions are not forwarded to the relay chain system, and indicating which cross-chain transactions received by the relay chain system and sent to the destination application chain system are forwarded to the destination application chain system and which cross-chain transactions are not forwarded to the destination application chain system. Therefore, the stateful cross-chain gateway can realize normal forwarding of cross-chain transaction according to the recorded cross-chain transaction state.
However, when a plurality of stateful cross-link gateways need to be deployed, cross-link transaction states in the stateful cross-link gateways are inconsistent, and a situation that coordination is difficult occurs, so that scalability of the stateful cross-link gateways is poor. In addition, when a new stateful cross-chain gateway needs to be deployed, synchronization needs to be performed on cross-chain transaction states in the original stateful cross-chain gateway, so that the migratability of the stateful cross-chain gateway is poor.
Disclosure of Invention
The application provides a cross-chain transaction sending method, device, equipment and storage medium, which can improve the expandability and the mobility of a cross-chain gateway. The technical scheme is as follows:
in a first aspect, a cross-chain transaction sending method is provided, which is applied to a cross-chain gateway, and the method includes:
acquiring a first cross-link transaction serial number and a second cross-link transaction serial number, wherein the first cross-link transaction serial number is a serial number of a cross-link transaction which is newly requested by an application chain system, and the second cross-link transaction serial number is a serial number of a cross-link transaction which is newly received by a relay chain system and comes from the application chain system;
determining a third cross-chain transaction serial number according to the first cross-chain transaction serial number and the second cross-chain transaction serial number, wherein the third cross-chain transaction serial number is a serial number of a cross-chain transaction which is not forwarded to the relay chain system in the cross-chain transaction requested by the application chain system;
acquiring a cross-chain transaction with the sequence number being the third cross-chain transaction sequence number from the application chain system as a first target cross-chain transaction;
forwarding the first target cross-link transaction to the relay link system.
In the application, the cross-link gateway acquires a sequence number of a cross-link transaction newly requested by an application link system as a first cross-link transaction sequence number, and acquires a sequence number of a cross-link transaction from the application link system newly received by a relay link system as a second cross-link transaction sequence number. And then, the cross-link gateway determines the sequence number of the cross-link transaction which is not forwarded to the relay link system in the cross-link transaction requested by the application link system according to the first cross-link transaction sequence number and the second cross-link transaction sequence number, namely, determines a third cross-link transaction sequence number. And the cross-link gateway acquires the cross-link transaction with the sequence number of the third cross-link transaction sequence number from the application link system as a first target cross-link transaction, and forwards the first target cross-link transaction to the relay link system so as to realize the synchronization of the cross-link transaction in the relay link system and the application link system. The cross-link gateway in the embodiment of the application can accurately judge the forwarding condition of the cross-link transaction only by acquiring and analyzing the cross-link transaction serial numbers in the application link system and the relay link system without recording the cross-link transaction state, so that the high-efficiency synchronization of the cross-link transaction between the application link system and the relay link system can be ensured, and the normal execution of the cross-link transaction can be further ensured. The cross-link gateway has strong expandability and mobility.
Optionally, the determining a third cross-chain transaction sequence number according to the first cross-chain transaction sequence number and the second cross-chain transaction sequence number includes:
if the first cross-chain transaction serial number is greater than the second cross-chain transaction serial number, determining each cross-chain transaction serial number which is greater than the second cross-chain transaction serial number and less than or equal to the first cross-chain transaction serial number as the third cross-chain transaction serial number.
Optionally, the obtaining the first cross-chain transaction serial number and the second cross-chain transaction serial number includes:
and when the mobile terminal is started, or every preset time length, or after forwarding a cross-chain transaction to the relay chain system, acquiring the first cross-chain transaction serial number and the second cross-chain transaction serial number.
Optionally, the method further comprises:
acquiring a fourth cross-link transaction serial number and a fifth cross-link transaction serial number, wherein the fourth cross-link transaction serial number is a serial number of a cross-link transaction which is received by the relay link system and calls the application link system latest, and the fifth cross-link transaction serial number is a serial number of a cross-link transaction which is received by the application link system latest;
determining a sixth cross-chain transaction serial number according to the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number, wherein the sixth cross-chain transaction serial number is a serial number of a cross-chain transaction which is received by the relay chain system and is not forwarded to the application chain system in a cross-chain transaction calling the application chain system;
acquiring a cross-link transaction with the cross-link transaction serial number as the sixth cross-link transaction serial number from the relay link system as a second target cross-link transaction;
forwarding the second target cross-chain transaction to the application chain system.
Optionally, the determining a sixth cross-chain transaction sequence number according to the fourth cross-chain transaction sequence number and the fifth cross-chain transaction sequence number includes:
if the fifth cross-chain transaction serial number is greater than the sixth cross-chain transaction serial number, determining each cross-chain transaction serial number which is greater than the sixth cross-chain transaction serial number and less than or equal to the fifth cross-chain transaction serial number as the sixth cross-chain transaction serial number.
Optionally, the obtaining the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number includes:
and when the mobile terminal is started, or every preset time length, or after forwarding a cross-chain transaction to the application chain system, acquiring the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number.
In a second aspect, a cross-chain transaction sending method is provided, which is applied to a cross-chain gateway, and the method includes:
acquiring a fourth cross-link transaction serial number and a fifth cross-link transaction serial number, wherein the fourth cross-link transaction serial number is a serial number of a cross-link transaction which is received by a relay link system and calls an application link system latest, and the fifth cross-link transaction serial number is a serial number of a cross-link transaction which is received by the application link system latest;
determining a sixth cross-chain transaction serial number according to the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number, wherein the sixth cross-chain transaction serial number is a serial number of a cross-chain transaction which is received by the relay chain system and is not forwarded to the application chain system in a cross-chain transaction calling the application chain system;
acquiring a cross-link transaction with the cross-link transaction serial number as the sixth cross-link transaction serial number from the relay link system as a second target cross-link transaction;
forwarding the second target cross-chain transaction to the application chain system.
In the application, the inter-link gateway acquires the serial number of the inter-link transaction for calling the application link system, which is received by the relay link system latest, as a fourth inter-link transaction serial number, and acquires the serial number of the inter-link transaction, which is received by the application link system latest, as a fifth inter-link transaction serial number. And then, the inter-link gateway determines, according to the fourth inter-link transaction sequence number and the fifth inter-link transaction sequence number, the sequence number of the inter-link transaction which is not forwarded to the application link system in the inter-link transaction which calls the application link system and is received by the relay link system, that is, determines a sixth inter-link transaction sequence number. And the cross-link gateway acquires the cross-link transaction with the serial number being the sixth cross-link transaction serial number from the relay link system as a second target cross-link transaction, and forwards the second target cross-link transaction to the application link system so as to realize the synchronization of the relay link system and the cross-link transaction in the application link system. The cross-link gateway in the embodiment of the application can accurately judge the forwarding condition of the cross-link transaction only by acquiring and analyzing the cross-link transaction serial numbers in the application link system and the relay link system without recording the cross-link transaction state, so that the high-efficiency synchronization of the cross-link transaction between the application link system and the relay link system can be ensured, and the normal execution of the cross-link transaction can be further ensured. The cross-link gateway has strong expandability and mobility.
In a third aspect, an apparatus for sending a cross-link transaction is provided, which is applied to a cross-link gateway, and includes:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first cross-chain transaction serial number and a second cross-chain transaction serial number, the first cross-chain transaction serial number is a serial number of a cross-chain transaction which is newly requested by an application chain system, and the second cross-chain transaction serial number is a serial number of a cross-chain transaction which is newly received by a relay chain system and comes from the application chain system;
a first determining module, configured to determine a third cross-chain transaction serial number according to the first cross-chain transaction serial number and the second cross-chain transaction serial number, where the third cross-chain transaction serial number is a serial number of a cross-chain transaction that has not been forwarded to the relay chain system in a cross-chain transaction that has been requested by the application chain system;
a second obtaining module, configured to obtain, from the application chain system, a cross-chain transaction with a sequence number that is the third cross-chain transaction sequence number as a first target cross-chain transaction;
a first sending module, configured to forward the first target cross-link transaction to the relay link system.
Optionally, the first determining module is configured to:
if the first cross-chain transaction serial number is greater than the second cross-chain transaction serial number, determining each cross-chain transaction serial number which is greater than the second cross-chain transaction serial number and less than or equal to the first cross-chain transaction serial number as the third cross-chain transaction serial number.
Optionally, the first obtaining module is configured to:
and when the mobile terminal is started, or every preset time length, or after forwarding a cross-chain transaction to the relay chain system, acquiring the first cross-chain transaction serial number and the second cross-chain transaction serial number.
Optionally, the apparatus further comprises:
a third obtaining module, configured to obtain a fourth cross-link transaction serial number and a fifth cross-link transaction serial number, where the fourth cross-link transaction serial number is a serial number of a cross-link transaction that is newly received by the relay link system and calls the application link system, and the fifth cross-link transaction serial number is a serial number of a cross-link transaction that is newly received by the application link system;
a second determining module, configured to determine a sixth cross-chain transaction serial number according to the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number, where the sixth cross-chain transaction serial number is a serial number of a cross-chain transaction that has been received by the relay chain system and has not been forwarded to the application chain system in a cross-chain transaction that calls the application chain system;
a fourth obtaining module, configured to obtain, from the relay link system, a cross-link transaction with a cross-link transaction serial number that is the sixth cross-link transaction serial number as a second target cross-link transaction;
and the second sending module is used for forwarding the second target cross-chain transaction to the application chain system.
Optionally, the second determining module is configured to:
if the fifth cross-chain transaction serial number is greater than the sixth cross-chain transaction serial number, determining each cross-chain transaction serial number which is greater than the sixth cross-chain transaction serial number and less than or equal to the fifth cross-chain transaction serial number as the sixth cross-chain transaction serial number.
Optionally, the third obtaining module is configured to:
and when the mobile terminal is started, or every preset time length, or after forwarding a cross-chain transaction to the application chain system, acquiring the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number.
In a fourth aspect, an apparatus for sending a cross-link transaction is provided, which is applied to a cross-link gateway, and includes:
the first obtaining module is configured to obtain a fourth cross-link transaction serial number and a fifth cross-link transaction serial number, where the fourth cross-link transaction serial number is a serial number of a cross-link transaction calling an application chain system that is newly received by a relay chain system, and the fifth cross-link transaction serial number is a serial number of a cross-link transaction that is newly received by the application chain system;
a determining module, configured to determine a sixth cross-chain transaction serial number according to the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number, where the sixth cross-chain transaction serial number is a serial number of a cross-chain transaction that has been received by the relay chain system and has not been forwarded to the application chain system in a cross-chain transaction that calls the application chain system;
a second obtaining module, configured to obtain, from the relay link system, a cross-link transaction with a cross-link transaction serial number that is the sixth cross-link transaction serial number as a second target cross-link transaction;
and the sending module is used for forwarding the second target cross-chain transaction to the application chain system.
In a fifth aspect, a computer device is provided, the computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the computer program, when executed by the processor, implementing the cross-chain transaction sending method of the first aspect.
In a sixth aspect, a computer device is provided, the computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the computer program, when executed by the processor, implementing the cross-chain transaction sending method according to the second aspect.
In a seventh aspect, a computer-readable storage medium is provided, where the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method for sending a cross-chain transaction according to the first aspect.
In an eighth aspect, a computer-readable storage medium is provided, which stores a computer program, and the computer program, when executed by a processor, implements the cross-chain transaction sending method according to the second aspect.
In a ninth aspect, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the steps of the method for sending cross-chain transactions of the first aspect described above.
In a tenth aspect, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the steps of the cross-chain transaction sending method of the second aspect described above.
It is to be understood that, for the beneficial effects of the second aspect, the third aspect, the fourth aspect and the fifth aspect, reference may be made to the description of the first aspect, and details are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a blockchain system according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a block chain according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a block chain network according to an embodiment of the present application;
fig. 4 is a schematic diagram of a single-layer blockchain network according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a multi-level block chain network according to an embodiment of the present disclosure;
fig. 6 is a flowchart of a method for sending a cross-chain transaction according to an embodiment of the present application;
fig. 7 is a flowchart of another method for sending a cross-chain transaction according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a cross-chain transaction sending device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of another cross-chain transaction sending device provided in the embodiment of the present application;
fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be understood that reference to "a plurality" in this application means two or more. In the description of the present application, "/" means "or" unless otherwise stated, for example, a/B may mean a or B; "and/or" herein is only an association relationship describing an associated object, and means that there may be three relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, for the convenience of clearly describing the technical solutions of the present application, the terms "first", "second", and the like are used to distinguish the same items or similar items having substantially the same functions and actions. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
Before explaining the embodiments of the present application, the related contents of the block chain will be described.
Fig. 1 is a schematic structural diagram of a blockchain system according to an embodiment of the present disclosure.
Referring to fig. 1, a blockchain system 100 refers to a system for data sharing between nodes, and a plurality of nodes 101 may be included in the blockchain system 100. Each node 101 may receive input information while operating normally and maintain shared data within the blockchain system 100 based on the received input information. In order to ensure information intercommunication in the blockchain system 100, there may be an information connection between each node 101 in the blockchain system 100, and information transmission between the nodes 101 may be performed through the information connection. For example, when an input message is received by any node 101 in the blockchain system 100, other nodes 101 in the blockchain system 100 acquire the input message according to the consensus algorithm, and store the input message as data in the shared data, so that the data stored in all nodes 101 in the blockchain system 100 are consistent.
Each node 101 in the blockchain system 100 stores one identical blockchain. Fig. 2 is taken as an example to describe a possible structure of the blockchain, but in practical applications, the structure of the blockchain may also be different according to different scenarios, and this is not limited in this embodiment of the present invention.
Referring to fig. 2, a block chain is composed of a plurality of blocks, and a starting block includes a block header and a block body. As an example, the block header stores an input information characteristic value, a version number, a timestamp, and a difficulty value, and the block body stores input information; the next block of the starting block takes the starting block as a parent block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the parent block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, and the safety of the input information in the block is ensured.
The blockchain system 100 has computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, etc. The blockchain system 100 is a distributed shared ledger and database, and has the characteristics of decentralization, non-tampering, whole-course trace-keeping, traceability, collective maintenance, public transparency and the like. The characteristics ensure that the block chain is shared openly, real and complete, safe and reliable.
Before explaining the cross-chain transaction sending method provided by the embodiment of the present application in detail, terms related to the embodiment of the present application will be explained.
The application chain system: the application chain system is a blockchain system responsible for specific business applications, and can perform cross-chain transactions.
The relay chain system: the relay chain system is a block chain system. The relay chain system can access the application chain system to realize the verification of cross-chain transaction.
And (3) cross-chain gateway: the cross-link gateway assumes the role of collecting and propagating transactions between the application link system and the relay link system. The cross-link gateway can capture cross-link transactions generated by the application link system and submit the cross-link transactions to the relay link system; or, the cross-link gateway may receive the cross-link transaction verified by the relay link system, and submit the cross-link transaction to the application link system.
Cross-chain transaction: the cross-chain transaction is a transaction between two application chain systems, and may include data such as a source application chain identifier, a destination application chain identifier, a cross-chain transaction serial number, and call information. A source application chain in a cross-chain transaction identifies a source application chain system for identifying the cross-chain transaction. A destination application chain in a cross-chain transaction identifies a destination application chain system for identifying the cross-chain transaction. The application chain identifier may be a Media Access Control (MAC) address, an Internet Protocol (IP) address, and the like of the application chain system identified by the application chain identifier, which is not limited uniquely in this embodiment of the present application. The cross-chain transaction serial number in the cross-chain transaction is used for uniquely identifying the cross-chain transaction, and whether the cross-chain transaction is submitted before can be determined according to the cross-chain transaction serial number, so that replay attack can be prevented. The call information in the cross-chain transaction may specify the number of tokens (tokens) that need to be transferred, or specify the function that needs to be called and the call parameters, or specify the binary code of the contract.
The following describes a blockchain network related to embodiments of the present application.
Fig. 3 is a schematic diagram of a blockchain network according to an embodiment of the present invention. Referring to fig. 3, the blockchain network may include: an application chain system 301, a cross-chain gateway 302 and a relay chain system 303.
The cross-chain gateway 302 is a cross-chain gateway that interfaces with the application chain system 301. The cross-link gateway 302 may communicate with the application link system 301 through a wired connection or a wireless connection, and the cross-link gateway 302 may also communicate with the relay link system 303 through a wired connection or a wireless connection.
Both the application chain system 301 and the relay chain system 303 are blockchain systems, which may be blockchain systems 100 as described above with respect to the embodiments of fig. 1-2.
Application chain system 301 has cross-chain transactions with other application chain systems.
For this cross-chain transaction, the application chain system 301 may be a source application chain system and the other application chain systems may be destination application chain systems. That is, the cross-chain transaction may be a transaction initiated by a user of the application chain system 301 that needs to be sent to other application chain systems. In this case, the application chain system 301 may send the cross-chain transaction to the relay chain system 303 through the cross-chain gateway 302, and the relay chain system 303 verifies the cross-chain transaction, and sends the cross-chain transaction to other application chain systems after the verification is passed. In particular, the user device may invoke a cross-chain contract deployed on application chain system 301 to initiate a cross-chain transaction to application chain system 301. After receiving the cross-chain transaction, the application chain system 301 executes the cross-chain transaction to store the cross-chain transaction to the blockchain configured by the application chain system 301. Thereafter, the application chain system 301 throws a cross-chain event that includes the cross-chain transaction. The application chain plug-in polls or subscribes to the cross-chain event and then sends the cross-chain event to cross-chain gateway 302. In this way, the cross-link gateway 302 may obtain the cross-link transaction requested by the application link system 301, then may send the cross-link transaction to the relay link system 303, and the relay link system 303 verifies the cross-link transaction, and after the verification is passed, sends the cross-link transaction to another application link system.
Alternatively, for the cross-chain transaction, the application chain system 301 may be a destination application chain system and the other application chain systems may be source application chain systems. That is, the cross-chain transaction may be a transaction initiated by a user of the other application chain system that needs to be sent to the application chain system 301. In this case, the other application chain system may send the cross-chain transaction to the relay chain system 303, the relay chain system 303 verifies the cross-chain transaction, and after the verification is passed, the cross-chain transaction is sent to the application chain system 301 through the cross-chain gateway 302.
In the above case, the cross-link gateway 302 may execute the cross-link transaction sending method described in the embodiment of fig. 6 or the embodiment of fig. 7 below to implement forwarding of the cross-link transaction between the application link system 301 and the relay link system 303.
Fig. 4 is a schematic diagram of a single-layer blockchain network according to an embodiment of the present disclosure. Referring to fig. 4, the single-level block chain network may include: a first application chain system 401, a first cross-chain gateway 402, a relay chain system 403, a second cross-chain gateway 404, and a second application chain system 405.
The first cross-link gateway 402 is a cross-link gateway that interfaces with the first application link system 401, and the first cross-link gateway 402 may communicate with the first application link system 401 through a wired connection or a wireless connection. The second cross-chain gateway 404 is a cross-chain gateway that interfaces with a second application chain system 405, and the second cross-chain gateway 404 may communicate with the second application chain system 405 through a wired connection or a wireless connection.
The relay link system 403 is located between the first cross-link gateway 402 and the second cross-link gateway 404. The relay link system 403 may communicate with the first inter-link gateway 402 via a wired or wireless connection, and may also communicate with the second inter-link gateway 404 via a wired or wireless connection.
The first application chain system 401, the second application chain system 405, and the relay chain system 403 are all a blockchain system, which may be the blockchain system 100 as described above in the embodiments of fig. 1-2.
There is a cross-chain transaction between the first application chain system 401 and the second application chain system 405.
For this cross-chain transaction, the first application chain system 401 may be a source application chain system and the second application chain system 405 may be a destination application chain system. That is, the cross-chain transaction may be a transaction initiated by a user of the first application chain system 401 that needs to be sent to the second application chain system 405. In this case, the first application chain system 401 may send the cross-chain transaction to the relay chain system 403 through the first cross-chain gateway 402, the relay chain system 403 verifies the cross-chain transaction, and after the verification is passed, the cross-chain transaction is sent to the second application chain system 405 through the second cross-chain gateway 404.
Alternatively, for the cross-chain transaction, the first application chain system 401 may be a destination application chain system and the second application chain system 405 may be a source application chain system. That is, the cross-chain transaction may be a transaction initiated by a user of the second application chain system 405 that needs to be sent to the first application chain system 401. In this case, the second application chain system 405 may send the cross-chain transaction to the relay chain system 403 through the second cross-chain gateway 404, the relay chain system 403 verifies the cross-chain transaction, and after the verification is passed, the cross-chain transaction is sent to the first application chain system 401 through the first cross-chain gateway 402.
In the above case, the first cross-link gateway 402 may execute a cross-link transaction sending method described in the embodiment of fig. 6 or the embodiment of fig. 7 below to implement forwarding of the cross-link transaction between the first application link system 401 and the relay link system 403. The second cross-link gateway 404 may also execute a cross-link transaction sending method described in the embodiment of fig. 6 or the embodiment of fig. 7 below, so as to implement forwarding of the cross-link transaction between the second application link system 405 and the relay link system 403.
The single-level block chain network is formed by a relay chain system. In some embodiments, a multi-level blockchain network may also be formed from multiple relay chain systems, as described below.
Fig. 5 is a schematic diagram of a multi-level block chain network according to an embodiment of the present disclosure. For a multi-level block chain network formed by a plurality of relay chain systems, different relay chain systems communicate with each other through cross-link routers. Specifically, referring to fig. 5, the multi-level blockchain network may include: a first application chain system 501, a first cross-chain gateway 502, a first relay chain system 503, a second cross-chain gateway 504, a second application chain system 505, a cross-link router 506, a second relay chain system 507, a third cross-chain gateway 508, and a third application chain system 509.
The first cross-link gateway 502 is a cross-link gateway that interfaces with the first application link system 501, and the first cross-link gateway 502 may communicate with the first application link system 501 through a wired connection or a wireless connection. The second cross-link gateway 504 is a cross-link gateway that interfaces with a second application-link system 505, and the second cross-link gateway 504 may communicate with the second application-link system 505 through a wired connection or a wireless connection. The third inter-link gateway 508 is an inter-link gateway interfacing with the third application link system 509, and the third inter-link gateway 508 may communicate with the third application link system 509 through a wired connection or a wireless connection.
A first relay link system 503 is located between the first cross-link gateway 502 and the second cross-link gateway 504. The first relay link system 503 may communicate with the first inter-link gateway 502 through a wired or wireless connection, and may also communicate with the second inter-link gateway 504 through a wired or wireless connection. The second relay link system 507 may communicate with the third cross-link gateway 508 through a wired connection or a wireless connection.
The cross-link router 506 is located between the first relay-link system 503 and the second relay-link system 507, and the cross-link router 506 may communicate with the first relay-link system 503 through a wired connection or a wireless connection, and may also communicate with the second relay-link system 507 through a wired connection or a wireless connection.
The first application chain system 501, the second application chain system 505, the third application chain system 509, the first relay chain system 503, and the second relay chain system 507 are all block chain systems, which may be the block chain system 100 as described above in the embodiments of fig. 1-2.
Any two of the first application chain system 501, the second application chain system 505, and the third application chain system 509 may have cross-chain transactions between them.
For a cross-chain transaction between a first application chain system 501 and a second application chain system 505, the first application chain system 501 may be a source application chain system and the second application chain system 505 may be a destination application chain system. That is, the cross-chain transaction may be a transaction initiated by a user of the first application chain system 501 that needs to be sent to the second application chain system 505. In this case, the first application chain system 501 may send the cross-chain transaction to the first relay chain system 503 through the first cross-chain gateway 502, the first relay chain system 503 verifies the cross-chain transaction, and after the verification is passed, the cross-chain transaction is sent to the second application chain system 505 through the second cross-chain gateway 504.
Alternatively, for a cross-chain transaction between the first application chain system 501 and the second application chain system 505, the first application chain system 501 may be a destination application chain system and the second application chain system 505 may be a source application chain system. That is, the cross-chain transaction may be a transaction initiated by a user of the second application chain system 505 that needs to be sent to the first application chain system 501. In this case, the second application chain system 505 may send the cross-chain transaction to the first relay chain system 503 through the second cross-chain gateway 504, the first relay chain system 503 verifies the cross-chain transaction, and after the verification is passed, the cross-chain transaction is sent to the first application chain system 501 through the first cross-chain gateway 502.
In the above case, the first cross-link gateway 502 may execute a cross-link transaction sending method described in the embodiment of fig. 6 or the embodiment of fig. 7 below to implement forwarding of the cross-link transaction between the first application link system 501 and the first relay link system 503. The second cross-link gateway 504 may execute a cross-link transaction sending method described in the embodiment of fig. 6 or the embodiment of fig. 7 below to implement forwarding of the cross-link transaction between the second application link system 505 and the first relay link system 503.
For a cross-chain transaction between the first application chain system 501 (or the second application chain system 505) and the third application chain system 509, the first application chain system 501 (or the second application chain system 505) may be a source application chain system and the third application chain system 509 may be a destination application chain system. That is, the cross-chain transaction may be a transaction initiated by a user of the first application chain system 501 (or the second application chain system 505) that needs to be sent to the third application chain system 509. In this case, the first application chain system 501 (or the second application chain system 505) may send the cross-chain transaction to the first relay chain system 503 through the first cross-chain gateway 502 (or the second cross-chain gateway 504), the first relay chain system 303 verifies the cross-chain transaction, and after the verification is passed, the cross-chain transaction is sent to the second relay chain system 507 through the cross-link router 506. The second relay chain system 507 sends the cross-chain transaction to the third application chain system 509 through the third cross-chain gateway 508.
Alternatively, for a cross-chain transaction between the first application chain system 501 (or the second application chain system 505) and the third application chain system 509, the first application chain system 501 (or the second application chain system 505) may be a destination application chain system and the third application chain system 509 may be a source application chain system. That is, the cross-chain transaction may be a transaction initiated by a user of the third application chain system 509 that needs to be sent to the first application chain system 501 (or the second application chain system 505). In this case, the third application chain system 509 may send the cross-chain transaction to the second relay chain system 507 through the third cross-chain gateway 508, the second relay chain system 507 verifies the cross-chain transaction, and after the verification is passed, the cross-chain transaction is sent to the first relay chain system 503 through the cross-link router 506. The first relay chain system 503 sends the cross-chain transaction to the first application chain system 501 (or the second application chain system 505) through the first cross-chain gateway 502 (or the second cross-chain gateway 504).
In the above case, the first inter-link gateway 502 (or the second inter-link gateway 504) may execute the inter-link transaction sending method described in the embodiment of fig. 6 or the embodiment of fig. 7 below to implement forwarding of the inter-link transaction between the first application link system 501 (or the second application link system 505) and the first relay link system 503. The third cross-link gateway 508 may execute a cross-link transaction sending method described in the embodiment of fig. 6 or the embodiment of fig. 7 below to implement forwarding of the cross-link transaction between the third application link system 509 and the second relay link system 507.
The cross-chain transaction sending method provided by the embodiment of the present application is explained in detail below.
Fig. 6 is a flowchart of a method for sending a cross-chain transaction according to an embodiment of the present application. Referring to fig. 6, the method includes the following steps.
Step 601: and the cross-link gateway acquires a first cross-link transaction serial number and a second cross-link transaction serial number.
The cross-link gateway is positioned between the application link system and the relay link system and used for realizing the forwarding of cross-link transactions between the application link system and the relay link system. The application chain system generally carries a serial number when generating the cross-chain transaction, and the serial number is incremented every time a cross-chain transaction is newly generated.
The first cross-chain transaction sequence number is the sequence number of the cross-chain transaction that was most recently requested by the application chain system. The cross-chain transaction requested by the application chain system is a cross-chain transaction of the application chain system taking the application chain system as a source, namely, a cross-chain transaction generated by the application chain system and needing to be sent to other application chain systems. The newly requested cross-chain transaction of the application chain system is the newly generated cross-chain transaction of the application chain system, which needs to be sent to other application chain systems. The cross-chain gateway may obtain a first cross-chain transaction sequence number from the application chain system.
The second cross-link transaction serial number is the serial number of the cross-link transaction from the application chain system that is newly received by the relay chain system. The cross-link transaction from the application chain system received by the relay chain system is a cross-link transaction of the application chain system using the application chain system as a source, that is, a cross-link transaction generated by the application chain system and required to be sent to other application chain systems. The inter-chain gateway may obtain a second inter-chain transaction sequence number from the relay chain system.
Step 602: and the cross-link gateway determines a third cross-link transaction serial number according to the first cross-link transaction serial number and the second cross-link transaction serial number.
The third cross-chain transaction sequence number is a sequence number of a cross-chain transaction which has not been forwarded to the relay chain system in a cross-chain transaction which has been requested by the application chain system. Since the first cross-link transaction serial number is the serial number of the cross-link transaction newly requested by the application link system, and the second cross-link transaction serial number is the serial number of the cross-link transaction from the application link system newly received by the relay link system, the cross-link gateway can determine which cross-link transactions have been forwarded to the relay link system by itself and which cross-link transactions have not been forwarded to the relay link system by itself in the cross-link transaction requested by the application link system according to the first cross-link transaction serial number and the second cross-link transaction serial number, that is, can determine the serial number of the cross-link transaction which has not been forwarded to the relay link system by itself in the cross-link transaction requested by the application link system, that is, the third cross-link transaction serial number.
Specifically, if the first cross-link transaction serial number is greater than the second cross-link transaction serial number, it is indicated that there is a cross-link transaction that has not been forwarded to the relay link system in the cross-link transaction that has been requested by the application link system, specifically, a cross-link transaction whose serial number is between the second cross-link transaction serial number (not including the second cross-link transaction serial number) and the first cross-link transaction serial number (including the first cross-link transaction serial number) has not been forwarded to the relay link system. The inter-chain gateway may determine each inter-chain transaction sequence number that is greater than the second inter-chain transaction sequence number and less than or equal to the first inter-chain transaction sequence number as a third inter-chain transaction sequence number.
If the first cross-link transaction serial number is equal to the second cross-link transaction serial number, which indicates that all the cross-link transactions requested by the application link system are forwarded to the relay link system, the cross-link gateway does not need to determine the third cross-link transaction serial number, and the operation is directly ended.
Step 603: and the cross-link gateway acquires the cross-link transaction with the sequence number being the third cross-link transaction sequence number from the application link system as the first target cross-link transaction.
Since the third cross-link transaction serial number is a serial number of a cross-link transaction which is not yet forwarded to the relay link system in a cross-link transaction which has been requested by the application link system, in order to ensure normal execution of the cross-link transaction, the cross-link gateway needs to acquire the cross-link transaction with the serial number being the third cross-link transaction serial number from the application link system, and subsequently forward the cross-link transaction to the relay link system, so that the relay link system can verify the cross-link transaction, and after the verification is passed, the cross-link transaction is sent to other application link systems for execution by the other application link systems.
Step 604: the cross-link gateway forwards the first target cross-link transaction to the relay link system.
It is to be noted that the cross-link transaction sending method provided in the embodiment of the present application may be executed when the cross-link gateway is powered on, or executed every preset time, or executed every time a cross-link transaction is forwarded to the relay link system. That is, the inter-link gateway may execute the above steps 601 to 604 when starting up, or every preset time, or after forwarding an inter-link transaction to the relay link system, to determine whether all the inter-link transactions requested by the application link system have been forwarded to the relay link system, so as to ensure normal forwarding of the inter-link transaction between the application link system and the relay link system.
It should be noted that, in the cross-chain gateway provided in the embodiment of the present application, it is not necessary to record the cross-chain transaction state, that is, the cross-chain gateway is a stateless cross-chain gateway. The cross-link gateway can accurately judge the forwarding condition of the cross-link transaction by acquiring and analyzing the cross-link transaction serial numbers in the application link system and the relay link system, thereby ensuring the efficient synchronization of the cross-link transaction between the application link system and the relay link system and further ensuring the normal execution of the cross-link transaction. Under the condition, when a plurality of cross-link gateways need to be deployed, each cross-link gateway only needs to collect and analyze the cross-link transaction condition of the application link system and the relay link system, so that the cross-link transaction can be accurately executed without worrying about the condition of inconsistent states, and the expandability is strong. And when a new cross-link gateway needs to be deployed, automatic judgment of the forwarding condition of cross-link transaction can be quickly realized without data synchronization operation, so that the migration is strong. That is, since the stateless inter-link gateway does not involve data and state synchronization of itself, under the condition that the inter-link gateway needs to be re-deployed or under the condition that a plurality of inter-link gateways work in parallel, rapid online and efficient operation of the inter-link gateway can be realized. The stateless cross-link gateway has strong universality and can meet the construction requirement of a cross-link system.
In the embodiment of the application, the cross-link gateway acquires a sequence number of a cross-link transaction newly requested by an application link system as a first cross-link transaction sequence number, and acquires a sequence number of a cross-link transaction from the application link system newly received by a relay link system as a second cross-link transaction sequence number. And then, the cross-link gateway determines the sequence number of the cross-link transaction which is not forwarded to the relay link system in the cross-link transaction requested by the application link system according to the first cross-link transaction sequence number and the second cross-link transaction sequence number, namely, determines a third cross-link transaction sequence number. And the cross-link gateway acquires the cross-link transaction with the sequence number of the third cross-link transaction sequence number from the application link system as a first target cross-link transaction, and forwards the first target cross-link transaction to the relay link system so as to realize the synchronization of the cross-link transaction in the relay link system and the application link system. The cross-link gateway in the embodiment of the application can accurately judge the forwarding condition of the cross-link transaction only by acquiring and analyzing the cross-link transaction serial numbers in the application link system and the relay link system without recording the cross-link transaction state, so that the high-efficiency synchronization of the cross-link transaction between the application link system and the relay link system can be ensured, and the normal execution of the cross-link transaction can be further ensured. The cross-link gateway has strong expandability and mobility.
Fig. 7 is a flowchart of a method for sending a cross-chain transaction according to an embodiment of the present application. Referring to fig. 7, the method includes the following steps.
Step 701: and the cross-link gateway acquires a fourth cross-link transaction serial number and a fifth cross-link transaction serial number.
The cross-link gateway is positioned between the application link system and the relay link system and used for realizing the forwarding of cross-link transactions between the application link system and the relay link system. The application chain system generally carries a serial number when generating the cross-chain transaction, and the serial number is incremented every time a cross-chain transaction is newly generated.
The fourth cross-link transaction serial number is the serial number of the cross-link transaction which is newly received by the relay link system and calls the application link system. The cross-chain transaction for calling the application chain system is the cross-chain transaction of the application chain system with the application chain system as a target, namely the cross-chain transaction generated by other application chain systems and needing to be sent to the application chain system. The cross-link transaction which is newly received by the relay link system and calls the application link system is the cross-link transaction which is newly received by the relay link system and needs to be sent to the application link system. The inter-link gateway may obtain a fourth inter-link transaction sequence number from the relay link system.
The fifth cross-chain transaction sequence number is the sequence number of the cross-chain transaction that the application chain system newly receives. The cross-chain transaction received by the application chain system is the cross-chain transaction of the application chain system with the application chain system as a target, namely, the cross-chain transaction generated by other application chain systems and sent to the application chain system. The cross-chain gateway may obtain a fifth cross-chain transaction sequence number from the application chain system.
Step 702: and the cross-link gateway determines a sixth cross-link transaction serial number according to the fourth cross-link transaction serial number and the fifth cross-link transaction serial number.
The sixth cross-chain transaction sequence number is a sequence number of a cross-chain transaction which is received by the relay chain system and is not forwarded to the application chain system in the cross-chain transaction for calling the application chain system. Since the fourth cross-link transaction serial number is the serial number of the cross-link transaction which is received by the relay link system most recently and calls the application link system, and the fifth cross-link transaction serial number is the serial number of the cross-link transaction which is received by the application link system most recently, the cross-link gateway can determine which cross-link transactions have been forwarded to the application link system and which cross-link transactions have not been forwarded to the application link system in the cross-link transaction which calls the application link system and which cross-link transactions have not been forwarded to the application link system by itself according to the fourth cross-link transaction serial number and the fifth cross-link transaction serial number, that is, can determine the serial number of the cross-link transaction which has not been forwarded to the application link system in the cross-link transaction which calls the application link system and has been received by the relay link system, that is the sixth cross-link transaction serial number.
Specifically, if the fourth cross-link transaction serial number is greater than the fifth cross-link transaction serial number, it is indicated that there is a cross-link transaction that has not been forwarded to the application chain system in the cross-link transaction that calls the application chain system and that has been received by the relay chain system, specifically, a cross-link transaction whose serial number is between the fifth cross-link transaction serial number (not including the fifth cross-link transaction serial number) and the fourth cross-link transaction serial number (including the fourth cross-link transaction serial number) has not been forwarded to the application chain system. The inter-chain gateway may determine each inter-chain transaction sequence number that is greater than the fifth inter-chain transaction sequence number and less than or equal to the fourth inter-chain transaction sequence number as the sixth inter-chain transaction sequence number.
If the fourth cross-link transaction serial number is equal to the fifth cross-link transaction serial number, which indicates that all cross-link transactions, which are received by the relay link system and call the application link system, are forwarded to the application link system, the cross-link gateway does not need to determine the sixth cross-link transaction serial number, and the operation is directly ended.
Step 703: and the cross-link gateway acquires the cross-link transaction with the serial number being the sixth cross-link transaction serial number from the relay link system as a second target cross-link transaction.
Since the sixth cross-link transaction serial number is a serial number of a cross-link transaction that has not been forwarded to the application chain system in a cross-link transaction that has been received by the relay chain system and calls the application chain system, in order to ensure normal execution of the cross-link transaction, the cross-link gateway needs to acquire the cross-link transaction with the serial number being the sixth cross-link transaction serial number from the relay chain system, and subsequently forward the cross-link transaction serial number to the application chain system for execution by the application chain system.
Step 704: the cross-link gateway forwards the second target cross-link transaction to the application link system.
It is to be noted that the cross-chain transaction sending method provided in the embodiment of the present application may be executed when the cross-chain gateway is powered on, or executed every preset time, or executed after forwarding a cross-chain transaction to the application chain system. That is, the inter-link gateway may execute the above steps 701 to 704 when starting up, or every preset time, or after forwarding an inter-link transaction to the application link system, to determine whether all the inter-link transactions that have been received by the relay link system and call the application link system have been forwarded to the application link system, so as to ensure normal forwarding of the inter-link transactions between the application link system and the relay link system.
It should be noted that, in the cross-chain gateway provided in the embodiment of the present application, it is not necessary to record the cross-chain transaction state, that is, the cross-chain gateway is a stateless cross-chain gateway. The cross-link gateway can accurately judge the forwarding condition of the cross-link transaction by acquiring and analyzing the cross-link transaction serial numbers in the application link system and the relay link system, thereby ensuring the efficient synchronization of the cross-link transaction between the application link system and the relay link system and further ensuring the normal execution of the cross-link transaction. Under the condition, when a plurality of cross-link gateways need to be deployed, each cross-link gateway only needs to collect and analyze the cross-link transaction condition of the application link system and the relay link system, so that the cross-link transaction can be accurately executed without worrying about the condition of inconsistent states, and the expandability is strong. And when a new cross-link gateway needs to be deployed, automatic judgment of the forwarding condition of cross-link transaction can be quickly realized without data synchronization operation, so that the migration is strong. That is, since the stateless inter-link gateway does not involve data and state synchronization of itself, under the condition that the inter-link gateway needs to be re-deployed or under the condition that a plurality of inter-link gateways work in parallel, rapid online and efficient operation of the inter-link gateway can be realized. The stateless cross-link gateway has strong universality and can meet the construction requirement of a cross-link system.
In this embodiment of the present application, the inter-link gateway acquires a serial number of an inter-link transaction that is received by the relay link system most recently and calls the application link system as a fourth inter-link transaction serial number, and acquires a serial number of an inter-link transaction that is received by the application link system most recently as a fifth inter-link transaction serial number. And then, the inter-link gateway determines, according to the fourth inter-link transaction sequence number and the fifth inter-link transaction sequence number, the sequence number of the inter-link transaction which is not forwarded to the application link system in the inter-link transaction which calls the application link system and is received by the relay link system, that is, determines a sixth inter-link transaction sequence number. And the cross-link gateway acquires the cross-link transaction with the serial number being the sixth cross-link transaction serial number from the relay link system as a second target cross-link transaction, and forwards the second target cross-link transaction to the application link system so as to realize the synchronization of the relay link system and the cross-link transaction in the application link system. The cross-link gateway in the embodiment of the application can accurately judge the forwarding condition of the cross-link transaction only by acquiring and analyzing the cross-link transaction serial numbers in the application link system and the relay link system without recording the cross-link transaction state, so that the high-efficiency synchronization of the cross-link transaction between the application link system and the relay link system can be ensured, and the normal execution of the cross-link transaction can be further ensured. The cross-link gateway has strong expandability and mobility.
For ease of understanding, the cross-chain transaction sending method provided by the embodiments of fig. 6 and 7 above is illustrated below in conjunction with the blockchain network shown in fig. 3.
Referring to fig. 3, cross-link gateway 302 accesses application chain system 301 when running. The cross-link gateway 302 is responsible for forwarding cross-link transactions requested by the application link system 301 to the relay link system 303 and forwarding cross-link transactions received by the relay link system 303 that invoke the application link system 301 to the application link system 301. Meanwhile, cross-link gateway 302 may query for cross-link transactions on application link system 301 and relay link system 303.
Illustratively, the cross-link gateway 302 may implement forwarding of the cross-link transaction between the application link system 301 and the relay link system 303 through the following steps (1) to (4).
(1) The cross-chain gateway 302 obtains the sequence number a of the cross-chain transaction that was most recently requested by the application chain system 301 from the application chain system 301 and obtains the sequence number B of the cross-chain transaction from the application chain system 301 that was most recently received by the relay chain system 303 from the relay chain system 303.
(2) If a is greater than B, the inter-link gateway 302 obtains the inter-link transaction with sequence numbers from B +1 to a from the application link system 301 and forwards the inter-link transaction to the relay link system 303 for verification by the relay link system 303. If A equals B, the cross-link gateway 302 ends the operation.
(3) The cross-link gateway 302 obtains the sequence number C of the cross-link transaction calling the application link system 301 that is newly received by the relay link system 303, and obtains the sequence number D of the cross-link transaction that is newly received by the application link system 301.
(4) If C is greater than D, the inter-chain gateway 302 obtains the inter-chain transaction with sequence numbers D +1 to C from the relay chain system 303 and forwards the inter-chain transaction to the application chain system 301 for execution by the application chain system 301.
The cross-chain transaction sending method provided by the embodiments of fig. 6 and fig. 7 above is exemplified below with reference to the single-level blockchain network shown in fig. 4.
Referring to fig. 4, for a single-layer blockchain network that implements cross-chain transactions through one relay chain system, a first application chain system 401 and a second application chain system 405 respectively initiate a cross-chain transaction that invokes the other side, and the working processes of a first cross-chain gateway 402 and a second cross-chain gateway 404 are as follows:
(1) the first application chain system 401 initiates a cross-chain transaction ct 1. The second application chain system 405 initiates a cross-chain transaction ct 2.
(2) The first cross-link gateway 402 obtains the sequence number a1 of the cross-link transaction that was most recently requested by the first application link system 401 from the first application link system 401 and obtains the sequence number B1 of the cross-link transaction from the first application link system 401 that was most recently received by the relay link system 403 from the relay link system 403.
(3) If a1 is greater than B1, assuming a1-B1 are equal to 1, the first inter-link gateway 402 acquires ct1 from the first application link system 401 and forwards it to the relay link system 403.
The relay chain system 403 verifies ct1, and after the verification is passed, ct1 is forwarded to the second application chain system 405 through the second cross-chain gateway 404.
(4) The second inter-chain gateway 404 obtains the sequence number C1 of the inter-chain transaction that the relay chain system 403 newly received and calls the second application chain system 405, and obtains the sequence number D1 of the inter-chain transaction that the second application chain system 405 newly received.
(5) If C1 is greater than D1, assuming C1-D1 is equal to 1, the second inter-link gateway 404 obtains ct1 from the relay link system 403 and forwards to the second application link system 405 for execution by the second application link system 405.
(6) The second cross-link gateway 404 obtains the sequence number a2 of the cross-link transaction that was most recently requested by the second application link system 405 from the second application link system 405 and obtains the sequence number B2 of the cross-link transaction from the second application link system 405 that was most recently received by the relay link system 403 from the second application link system 405.
(7) If a2 is greater than B2, assuming a2-B2 is equal to 1, the second inter-link gateway 404 obtains ct2 from the second application link system 405 and forwards it to the relay link system 403.
The relay link system 403 verifies ct2, and after the verification is passed, ct2 is forwarded to the first application link system 401 through the first cross-link gateway 402.
(8) The first cross-link gateway 402 obtains the sequence number C2 of the cross-link transaction that the relay link system 403 newly received to invoke the first application link system 401, and obtains the sequence number D2 of the cross-link transaction that the first application link system 401 newly received.
(9) If C2 is greater than D2, assuming C2-D2 are equal to 1, the first inter-link gateway 402 acquires ct2 from the relay link system 403 and forwards it to the first application link system 401 for execution by the first application link system 401.
The cross-chain transaction sending method provided by the embodiments of fig. 6 and fig. 7 above is exemplified below with reference to the multi-level blockchain network shown in fig. 5.
Referring to fig. 5, for a multi-level blockchain network formed by a plurality of relay chain systems, different relay chain systems communicate with each other through cross-link routers. At this time, the first application chain system 501 and the third application chain system 509 respectively initiate a cross-chain transaction for calling the other side, and the working processes of the first cross-chain gateway 502 and the third cross-chain gateway 508 are as follows:
(1) the first application chain system 501 initiates a cross-chain transaction ct 1. The third application chain system 509 initiates a cross-chain transaction ct 3.
(2) The first cross-link gateway 502 obtains the sequence number a1 of the most recently requested cross-link transaction by the first application link system 501 from the first application link system 501 and obtains the sequence number B1 of the most recently received cross-link transaction from the first application link system 501 by the first relay link system 503 from the first relay link system 503.
(3) If a1 is greater than B1, assuming a1-B1 is equal to 1, the first inter-link gateway 502 obtains ct1 from the first application link system 501 and forwards it to the first relay link system 503.
The first relay link system 503 verifies ct1, and after the verification is passed, sends ct1 to the second relay link system 507 through the cross-link router 506. The second relay-link system 507 forwards ct1 to the third application-link system 509 through the third cross-link gateway 508.
(4) The third cross-link gateway 508 obtains the sequence number C3 of the cross-link transaction that the second relay-link system 507 received most recently and calls the third application-link system 509, and obtains the sequence number D3 of the cross-link transaction that the third application-link system 509 received most recently.
(5) If C3 is greater than D3, assuming C3-D3 is equal to 1, the third inter-link gateway 508 obtains ct1 from the second relay-link system 507 and forwards it to the third application-link system 509 for execution by the third application-link system 509.
(6) The third cross-link gateway 508 obtains the sequence number a3 of the cross-link transaction that was most recently requested by the third application link system 509 from the third application link system 509 and obtains the sequence number B3 of the cross-link transaction from the third application link system 509 that was most recently received by the second relay link system 507 from the second relay link system 507.
(7) If A3 is greater than B3, assuming A3-B3 is equal to 1, the third inter-link gateway 508 obtains ct3 from the third application-link system 509 and forwards it to the second relay-link system 507.
The second relay link system 507 verifies ct3, and after the verification is passed, ct3 is sent to the first relay link system 503 through the cross-link router 506. The first relay link system 503 forwards ct3 to the first application link system 501 through the first cross-link gateway 502.
(8) The first cross-link gateway 502 obtains the sequence number C2 of the cross-link transaction that the first relay-link system 503 newly received to invoke the first application-link system 501, and obtains the sequence number D2 of the cross-link transaction that the first application-link system 501 newly received.
(9) If C2 is greater than D2, assuming C2-D2 is equal to 1, the first inter-link gateway 502 obtains ct3 from the first relay-link system 503 and forwards it to the first application-link system 501 for execution by the first application-link system 501.
Fig. 8 is a schematic structural diagram of a cross-chain transaction sending apparatus according to an embodiment of the present application. The apparatus may be implemented in part or in whole by software, hardware, or a combination of both as a computer device, which may be the computer device shown in fig. 10 below, which may be a cross-chain gateway. Referring to fig. 8, the apparatus includes: a first obtaining module 801, a first determining module 802, a second obtaining module 803, and a first sending module 804.
A first obtaining module 801, configured to obtain a first cross-link transaction serial number and a second cross-link transaction serial number, where the first cross-link transaction serial number is a serial number of a cross-link transaction that is newly requested by an application chain system, and the second cross-link transaction serial number is a serial number of a cross-link transaction that is newly received by a relay chain system and is from the application chain system;
a first determining module 802, configured to determine a third cross-chain transaction serial number according to the first cross-chain transaction serial number and the second cross-chain transaction serial number, where the third cross-chain transaction serial number is a serial number of a cross-chain transaction that has not been forwarded to the relay chain system in a cross-chain transaction that has been requested by the application chain system;
a second obtaining module 803, configured to obtain, from the application chain system, a cross-chain transaction with a sequence number that is a third cross-chain transaction sequence number as a first target cross-chain transaction;
a first sending module 804, configured to forward the first target cross-link transaction to the relay link system.
Optionally, the first determining module 802 is configured to:
and if the first cross-chain transaction serial number is greater than the second cross-chain transaction serial number, determining each cross-chain transaction serial number which is greater than the second cross-chain transaction serial number and less than or equal to the first cross-chain transaction serial number as a third cross-chain transaction serial number.
Optionally, the first obtaining module 801 is configured to:
when the system is started, or every preset time length, or after forwarding one cross-link transaction to the relay link system, a first cross-link transaction serial number and a second cross-link transaction serial number are obtained.
Optionally, the apparatus further comprises:
the third acquisition module is used for acquiring a fourth cross-link transaction serial number and a fifth cross-link transaction serial number, wherein the fourth cross-link transaction serial number is a serial number of a cross-link transaction for calling the application chain system which is newly received by the relay chain system, and the fifth cross-link transaction serial number is a serial number of a cross-link transaction which is newly received by the application chain system;
the second determining module is used for determining a sixth cross-chain transaction serial number according to the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number, wherein the sixth cross-chain transaction serial number is a serial number of a cross-chain transaction which is received by the relay chain system and is not forwarded to the application chain system in the cross-chain transaction of the calling application chain system;
the fourth acquisition module is used for acquiring the cross-chain transaction with the cross-chain transaction serial number being the sixth cross-chain transaction serial number from the relay chain system as the second target cross-chain transaction;
and the second sending module is used for forwarding the second target cross-chain transaction to the application chain system.
Optionally, the second determining module is configured to:
and if the fifth cross-chain transaction serial number is greater than the sixth cross-chain transaction serial number, determining each cross-chain transaction serial number which is greater than the sixth cross-chain transaction serial number and less than or equal to the fifth cross-chain transaction serial number as the sixth cross-chain transaction serial number.
Optionally, the third obtaining module is configured to:
and when the mobile terminal is started, or every preset time length, or after forwarding a cross-chain transaction to the application chain system, acquiring a fourth cross-chain transaction serial number and a fifth cross-chain transaction serial number.
In the embodiment of the application, the cross-link gateway acquires a sequence number of a cross-link transaction newly requested by an application link system as a first cross-link transaction sequence number, and acquires a sequence number of a cross-link transaction from the application link system newly received by a relay link system as a second cross-link transaction sequence number. And then, the cross-link gateway determines the sequence number of the cross-link transaction which is not forwarded to the relay link system in the cross-link transaction requested by the application link system according to the first cross-link transaction sequence number and the second cross-link transaction sequence number, namely, determines a third cross-link transaction sequence number. And the cross-link gateway acquires the cross-link transaction with the sequence number of the third cross-link transaction sequence number from the application link system as a first target cross-link transaction, and forwards the first target cross-link transaction to the relay link system so as to realize the synchronization of the cross-link transaction in the relay link system and the application link system. The cross-link gateway in the embodiment of the application can accurately judge the forwarding condition of the cross-link transaction only by acquiring and analyzing the cross-link transaction serial numbers in the application link system and the relay link system without recording the cross-link transaction state, so that the high-efficiency synchronization of the cross-link transaction between the application link system and the relay link system can be ensured, and the normal execution of the cross-link transaction can be further ensured. The cross-link gateway has strong expandability and mobility.
Fig. 9 is a schematic structural diagram of a cross-chain transaction sending apparatus according to an embodiment of the present application. The apparatus may be implemented in part or in whole by software, hardware, or a combination of both as a computer device, which may be the computer device shown in fig. 10 below, which may be a cross-chain gateway. Referring to fig. 9, the apparatus includes: a first obtaining module 901, a determining module 902, a second obtaining module 903, and a sending module 904.
A first obtaining module 901, configured to obtain a fourth cross-link transaction serial number and a fifth cross-link transaction serial number, where the fourth cross-link transaction serial number is a serial number of a cross-link transaction that is newly received by the relay link system and calls the application link system, and the fifth cross-link transaction serial number is a serial number of a cross-link transaction that is newly received by the application link system;
a determining module 902, configured to determine a sixth cross-chain transaction serial number according to the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number, where the sixth cross-chain transaction serial number is a serial number of a cross-chain transaction that has not been forwarded to the application chain system in a cross-chain transaction that calls the application chain system and is received by the relay chain system;
a second obtaining module 903, configured to obtain, from the relay link system, a cross-link transaction with a cross-link transaction serial number that is a sixth cross-link transaction serial number as a second target cross-link transaction;
a sending module 904, configured to forward the second target cross-chain transaction to the application chain system.
In this embodiment of the present application, the inter-link gateway acquires a serial number of an inter-link transaction that is received by the relay link system most recently and calls the application link system as a fourth inter-link transaction serial number, and acquires a serial number of an inter-link transaction that is received by the application link system most recently as a fifth inter-link transaction serial number. And then, the inter-link gateway determines, according to the fourth inter-link transaction sequence number and the fifth inter-link transaction sequence number, the sequence number of the inter-link transaction which is not forwarded to the application link system in the inter-link transaction which calls the application link system and is received by the relay link system, that is, determines a sixth inter-link transaction sequence number. And the cross-link gateway acquires the cross-link transaction with the serial number being the sixth cross-link transaction serial number from the relay link system as a second target cross-link transaction, and forwards the second target cross-link transaction to the application link system so as to realize the synchronization of the relay link system and the cross-link transaction in the application link system. The cross-link gateway in the embodiment of the application can accurately judge the forwarding condition of the cross-link transaction only by acquiring and analyzing the cross-link transaction serial numbers in the application link system and the relay link system without recording the cross-link transaction state, so that the high-efficiency synchronization of the cross-link transaction between the application link system and the relay link system can be ensured, and the normal execution of the cross-link transaction can be further ensured. The cross-link gateway has strong expandability and mobility.
It should be noted that: in the cross-chain transaction sending device provided in the above embodiment, when sending a cross-chain transaction, only the division of the above functional modules is used for illustration, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions.
Each functional unit and module in the above embodiments may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present application.
The cross-chain transaction sending device provided by the above embodiment and the cross-chain transaction sending method embodiment belong to the same concept, and for specific working processes of units and modules and technical effects brought by the units and the modules in the above embodiment, reference may be made to the method embodiment section, and details are not described here.
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 10, the computer apparatus 10 includes: a processor 100, a memory 101 and a computer program 102 stored in the memory 101 and operable on the processor 100, the steps in the cross-chain transaction sending method in the above embodiments being implemented when the computer program 102 is executed by the processor 100.
Computer device 10 may be a cross-chain gateway. Those skilled in the art will appreciate that fig. 10 is merely an example of the computer device 10 and is not intended to limit the computer device 10 and may include more or less components than those shown, or some components may be combined, or different components may be included, such as input output devices, network access devices, etc.
Processor 100 may be a Central Processing Unit (CPU), and Processor 100 may also be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or any conventional processor.
The storage 101 may be an internal storage unit of the computer device 10 in some embodiments, such as a hard disk or a memory of the computer device 10. The memory 101 may also be an external storage device of the computer device 10 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the computer device 10. Further, the memory 101 may also include both an internal storage unit and an external storage device of the computer device 10. The memory 101 is used for storing an operating system, an application program, a Boot Loader (Boot Loader), data, and other programs. The memory 101 may also be used to temporarily store data that has been output or is to be output.
An embodiment of the present application further provides a computer device, where the computer device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the various method embodiments described above when executing the computer program.
The embodiments of the present application also provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
The embodiments of the present application provide a computer program product, which when run on a computer causes the computer to perform the steps of the above-described method embodiments.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above method embodiments may be implemented by a computer program, which may be stored in a computer readable storage medium and used by a processor to implement the steps of the above method embodiments. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or apparatus capable of carrying computer program code to a photographing apparatus/terminal device, a recording medium, computer Memory, ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, optical data storage device, etc. The computer-readable storage medium referred to herein may be a non-volatile storage medium, in other words, a non-transitory storage medium.
It should be understood that all or part of the steps for implementing the above embodiments may be implemented 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. The computer instructions may be stored in the computer-readable storage medium described above.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/computer device and method may be implemented in other ways. For example, the above-described apparatus/computer device embodiments are merely illustrative, and for example, a module or a unit may be divided into only one logical function, and may be implemented in other ways, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (11)

1. A method for sending a cross-chain transaction is applied to a cross-chain gateway, and comprises the following steps:
acquiring a first cross-link transaction serial number and a second cross-link transaction serial number, wherein the first cross-link transaction serial number is a serial number of a cross-link transaction which is newly requested by an application chain system, and the second cross-link transaction serial number is a serial number of a cross-link transaction which is newly received by a relay chain system and comes from the application chain system;
determining a third cross-chain transaction serial number according to the first cross-chain transaction serial number and the second cross-chain transaction serial number, wherein the third cross-chain transaction serial number is a serial number of a cross-chain transaction which is not forwarded to the relay chain system in the cross-chain transaction requested by the application chain system;
acquiring a cross-chain transaction with the sequence number being the third cross-chain transaction sequence number from the application chain system as a first target cross-chain transaction;
forwarding the first target cross-link transaction to the relay link system.
2. The method of claim 1, wherein determining a third cross-chain transaction sequence number from the first cross-chain transaction sequence number and the second cross-chain transaction sequence number comprises:
if the first cross-chain transaction serial number is greater than the second cross-chain transaction serial number, determining each cross-chain transaction serial number which is greater than the second cross-chain transaction serial number and less than or equal to the first cross-chain transaction serial number as the third cross-chain transaction serial number.
3. The method of claim 1 or 2, wherein obtaining the first and second cross-chain transaction sequence numbers comprises:
and when the mobile terminal is started, or every preset time length, or after forwarding a cross-chain transaction to the relay chain system, acquiring the first cross-chain transaction serial number and the second cross-chain transaction serial number.
4. The method of claim 1, wherein the method further comprises:
acquiring a fourth cross-link transaction serial number and a fifth cross-link transaction serial number, wherein the fourth cross-link transaction serial number is a serial number of a cross-link transaction which is received by the relay link system and calls the application link system latest, and the fifth cross-link transaction serial number is a serial number of a cross-link transaction which is received by the application link system latest;
determining a sixth cross-chain transaction serial number according to the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number, wherein the sixth cross-chain transaction serial number is a serial number of a cross-chain transaction which is received by the relay chain system and is not forwarded to the application chain system in a cross-chain transaction calling the application chain system;
acquiring a cross-link transaction with the cross-link transaction serial number as the sixth cross-link transaction serial number from the relay link system as a second target cross-link transaction;
forwarding the second target cross-chain transaction to the application chain system.
5. The method of claim 4, wherein determining a sixth cross-chain transaction sequence number from the fourth cross-chain transaction sequence number and the fifth cross-chain transaction sequence number comprises:
if the fifth cross-chain transaction serial number is greater than the sixth cross-chain transaction serial number, determining each cross-chain transaction serial number which is greater than the sixth cross-chain transaction serial number and less than or equal to the fifth cross-chain transaction serial number as the sixth cross-chain transaction serial number.
6. The method of claim 4 or 5, wherein obtaining the fourth and fifth cross-chain transaction sequence numbers comprises:
and when the mobile terminal is started, or every preset time length, or after forwarding a cross-chain transaction to the application chain system, acquiring the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number.
7. A method for sending a cross-chain transaction is applied to a cross-chain gateway, and comprises the following steps:
acquiring a fourth cross-link transaction serial number and a fifth cross-link transaction serial number, wherein the fourth cross-link transaction serial number is a serial number of a cross-link transaction which is received by a relay link system and calls an application link system latest, and the fifth cross-link transaction serial number is a serial number of a cross-link transaction which is received by the application link system latest;
determining a sixth cross-chain transaction serial number according to the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number, wherein the sixth cross-chain transaction serial number is a serial number of a cross-chain transaction which is received by the relay chain system and is not forwarded to the application chain system in a cross-chain transaction calling the application chain system;
acquiring a cross-link transaction with the cross-link transaction serial number as the sixth cross-link transaction serial number from the relay link system as a second target cross-link transaction;
forwarding the second target cross-chain transaction to the application chain system.
8. A cross-chain transaction sending device applied to a cross-chain gateway, the device comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first cross-chain transaction serial number and a second cross-chain transaction serial number, the first cross-chain transaction serial number is a serial number of a cross-chain transaction which is newly requested by an application chain system, and the second cross-chain transaction serial number is a serial number of a cross-chain transaction which is newly received by a relay chain system and comes from the application chain system;
a determining module, configured to determine a third cross-chain transaction serial number according to the first cross-chain transaction serial number and the second cross-chain transaction serial number, where the third cross-chain transaction serial number is a serial number of a cross-chain transaction that has not been forwarded to the relay chain system in a cross-chain transaction that has been requested by the application chain system;
a second obtaining module, configured to obtain, from the application chain system, a cross-chain transaction with a sequence number that is the third cross-chain transaction sequence number as a first target cross-chain transaction;
a sending module, configured to forward the first target cross-link transaction to the relay link system.
9. A cross-chain transaction sending device applied to a cross-chain gateway, the device comprising:
the first obtaining module is configured to obtain a fourth cross-link transaction serial number and a fifth cross-link transaction serial number, where the fourth cross-link transaction serial number is a serial number of a cross-link transaction calling an application chain system that is newly received by a relay chain system, and the fifth cross-link transaction serial number is a serial number of a cross-link transaction that is newly received by the application chain system;
a determining module, configured to determine a sixth cross-chain transaction serial number according to the fourth cross-chain transaction serial number and the fifth cross-chain transaction serial number, where the sixth cross-chain transaction serial number is a serial number of a cross-chain transaction that has been received by the relay chain system and has not been forwarded to the application chain system in a cross-chain transaction that calls the application chain system;
a second obtaining module, configured to obtain, from the relay link system, a cross-link transaction with a cross-link transaction serial number that is the sixth cross-link transaction serial number as a second target cross-link transaction;
and the sending module is used for forwarding the second target cross-chain transaction to the application chain system.
10. A computer device, characterized in that the computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, which computer program, when executed by the processor, implements the method according to any of claims 1 to 7.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any one of claims 1 to 7.
CN202111467182.XA 2021-12-02 2021-12-02 Cross-chain transaction sending method, device, equipment and storage medium Pending CN114240651A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111467182.XA CN114240651A (en) 2021-12-02 2021-12-02 Cross-chain transaction sending method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111467182.XA CN114240651A (en) 2021-12-02 2021-12-02 Cross-chain transaction sending method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114240651A true CN114240651A (en) 2022-03-25

Family

ID=80753063

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111467182.XA Pending CN114240651A (en) 2021-12-02 2021-12-02 Cross-chain transaction sending method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114240651A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785853A (en) * 2022-03-31 2022-07-22 蚂蚁区块链科技(上海)有限公司 Method and apparatus for cross-link communication in a system of block chains

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785853A (en) * 2022-03-31 2022-07-22 蚂蚁区块链科技(上海)有限公司 Method and apparatus for cross-link communication in a system of block chains
CN114785853B (en) * 2022-03-31 2024-04-19 蚂蚁区块链科技(上海)有限公司 Method, apparatus, storage medium and computing device for cross-chain communication in a blockchain system

Similar Documents

Publication Publication Date Title
CN112615871B (en) Method and device for transmitting authenticatable message across chains
CN107332876B (en) Method and device for synchronizing block chain state
CN111741114A (en) System, method and equipment capable of monitoring cross-chain interaction based on block chain
CN109656873B (en) Block chain-based data archiving method and device and terminal equipment
CN110875850B (en) Firmware upgrading method and system, readable storage medium and terminal equipment
CN110597918B (en) Account management method, account management device and computer readable storage medium
CN111147403B (en) Message processing method and device, storage medium and electronic device
CN110602250A (en) Data synchronization method and device, server and terminal equipment
CN105939297A (en) TCP message reassembling method and TCP message reassembling device
CN112751733A (en) Link detection method, device, equipment, system and switch
CN112184436B (en) Data synchronization method, electronic device and readable storage medium
WO2021147793A1 (en) Data processing method, apparatus and system, electronic device and computer storage medium
CN107204924B (en) Link discovery method and device
CN114240651A (en) Cross-chain transaction sending method, device, equipment and storage medium
CN106789446B (en) Node peer-to-peer cluster distributed test system and method
CN114926163A (en) Resource cross-chain transfer method and device
CN112615868B (en) Method and device for transmitting authenticatable message across chains
WO2019041747A1 (en) Sip information analysis method, device, server, and medium
CN107609197A (en) A kind of method of data synchronization, data synchronization unit and mobile terminal
CN112165505A (en) Decentralized data processing method, electronic device and storage medium
CN110888892A (en) Block synchronization method, device and storage medium
CN113114465B (en) Method and device for processing attribution authority, storage medium and electronic device
CN114125812A (en) Data synchronization method, device, server and storage medium
WO2021155529A1 (en) Resource deletion method, apparatus, and device, and storage medium
CN108805741B (en) Fusion method, device and system of power quality data

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