CN114785800A - Cross-link communication method and device - Google Patents

Cross-link communication method and device Download PDF

Info

Publication number
CN114785800A
CN114785800A CN202210335217.2A CN202210335217A CN114785800A CN 114785800 A CN114785800 A CN 114785800A CN 202210335217 A CN202210335217 A CN 202210335217A CN 114785800 A CN114785800 A CN 114785800A
Authority
CN
China
Prior art keywords
cross
data
message
node
chain
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
CN202210335217.2A
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.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai 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 Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202210335217.2A priority Critical patent/CN114785800A/en
Publication of CN114785800A publication Critical patent/CN114785800A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1059Inter-group management mechanisms, e.g. splitting, merging or interconnection of groups
    • 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/3247Cryptographic 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 involving digital signatures

Abstract

The present specification provides a method and apparatus for cross-link communication, the method being performed by a relay device; the method comprises the following steps: receiving a cross-chain message sent by a first node in a first blockchain and a first signature of the cross-chain message by the first node; determining whether first to-be-sent data associated with the cross-link message is stored in advance; the first pending data comprises the cross-chain message and a signature of the cross-chain message by one or more nodes in the first blockchain; if the first to-be-transmitted data are determined to be stored, adding the first signature to the first to-be-transmitted data; when a preset time condition is met, the first data to be transmitted is transmitted to each node of a second block chain; enabling each node of the second blockchain to verify the cross-chain message based on the signature in the first to-be-transmitted data.

Description

Cross-link communication method and device
Technical Field
One or more embodiments of the present disclosure relate to the field of block chain technologies, and in particular, to a method and an apparatus for cross-chain communication.
Background
A block chain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The data blocks are combined into a chain data structure in a block chain in a time sequence and a sequential connection mode, and the data blocks are guaranteed to be not falsified and not forged in a cryptographic mode. Because the blockchain has the characteristics of decentralization, information non-tampering, autonomy and the like, the blockchain is also paid more and more attention and is applied by people.
Currently, there is a need for a method of efficient communication between two different blockchains.
Disclosure of Invention
One or more embodiments of the present specification provide a method and apparatus for cross-link communication.
According to a first aspect, there is provided a method of cross-chain communication, the method being performed by a relay device; the method comprises the following steps:
receiving a cross-chain message sent by a first node in a first blockchain and a first signature of the cross-chain message by the first node;
determining whether first to-be-sent data associated with the cross-link message is stored in advance; the first pending data comprises the cross-chain message and a signature of the cross-chain message by one or more nodes in the first blockchain;
if the first to-be-transmitted data are determined to be stored, adding the first signature to the first to-be-transmitted data;
when a preset time condition is met, the first data to be transmitted is transmitted to each node of a second block chain; enabling each node of the second blockchain to verify the cross-chain message based on the signature in the first pending data.
According to a second aspect, there is provided a cross-chain communication apparatus, the apparatus being deployed at a relay device; the device comprises:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a cross-chain message sent by a first node in a first block chain and a first signature of the first node on the cross-chain message;
the determining module is used for determining whether first to-be-sent data associated with the cross-link message is stored in advance; the first to-be-sent data comprises the cross-chain message and a signature of one or more nodes in the first blockchain on the cross-chain message;
the adding module is used for adding the first signature to the first to-be-transmitted data when the first to-be-transmitted data is determined to be stored;
the sending module is used for sending the first data to be sent to each node of a second block chain when a preset time condition is met; enabling each node of the second blockchain to verify the cross-chain message based on the signature in the first to-be-transmitted data.
According to a third aspect, there is provided a computer-readable storage medium storing a computer program which, when executed by a processor, performs the method of any one of the first to third aspects.
According to a fourth aspect, there is provided a computing device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of the first aspects when executing the program.
The technical scheme provided by the embodiment of the specification can have the following beneficial effects:
according to the cross-link communication method and device provided by the embodiment of the specification, the received cross-link messages with the same content are merged through the relay equipment arranged between the block chains which are communicated with each other, the to-be-sent data including the signatures of the sending nodes are obtained, and the to-be-sent data are sent to the target node when the preset time condition is met, so that the communication efficiency between different block chains is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and it is obvious for a person skilled in the art to obtain other drawings based on these drawings without inventive labor.
FIG. 1 is a block chain architecture diagram applied in an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a scenario of a cross-chain communication shown in the present specification according to an exemplary embodiment;
FIG. 3 is a flowchart of a method of cross-chain communication shown in the present specification according to an exemplary embodiment;
FIG. 4A is a block diagram illustrating the structure of a type of data to be sent in accordance with an illustrative embodiment;
FIG. 4B is a block diagram illustrating another example of data pending according to an illustrative embodiment of the present disclosure;
FIG. 4C is a block diagram illustrating another alternative data structure shown in accordance with an exemplary embodiment;
FIG. 4D is a block diagram illustrating another example of data pending according to one illustrative embodiment of the present disclosure;
fig. 5 is a block diagram of a cross-chain communication device shown in the present specification according to an example embodiment.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without making any creative effort shall fall within the protection scope of the present specification.
Fig. 1 is a block chain architecture diagram applied in the embodiment of the present disclosure.
In fig. 1, the block chain includes, for example, 6 nodes from node 1 to node 6. Each node may be implemented as any device having computing, processing, capabilities, server or cluster of devices, etc. The lines between the nodes schematically represent P2P (Peer-to-Peer) connections. All the nodes store the full-amount accounts, namely the states of all the blocks and all the accounts. Wherein each node in the blockchain generates the same state in the blockchain by performing the same transaction, each node in the blockchain storing the same state database. Each node may be responsible for receiving transactions from clients and initiating consensus proposals to each slave node, including information such as the number of transactions in the tile to be blocked (e.g., tile H1) and the order of submission of each transaction. After the node in the blockchain successfully agrees on the consensus proposal, each node may perform the multiple transactions according to the order of submission in the consensus proposal, thereby generating block H1.
It is to be appreciated that the blockchain shown in fig. 1 is merely exemplary and that embodiments of the present description are not limited to application to the blockchain shown in fig. 1. In addition, although fig. 1 shows that the blockchain 101 includes 6 nodes, the embodiments of the present specification are not limited thereto, and may include other numbers of nodes. Specifically, the nodes included in the block chain can meet the Byzantine Fault Tolerance (BFT) requirement. The byzantine fault tolerance requirement can be understood as that byzantine nodes can exist in a block chain, and the block chain does not show the byzantine behavior to the outside. Generally, some Byzantine Fault-tolerant algorithms require the number of nodes to be greater than 3f +1, where f is the number of Byzantine nodes, such as the practical Byzantine Fault-tolerant algorithm pbft (practical Byzantine Fault tolerance).
A transaction in the blockchain domain may refer to a unit of a task that is performed in the blockchain and recorded in the blockchain. The transaction typically includes a send field (From), a receive field (To), and a Data field (Data). Where the transaction is a transfer transaction, the From field indicates the address of the account From which the transaction was initiated (i.e., From which a transfer task To another account was initiated), the To field indicates the address of the account From which the transaction was received (i.e., From which a transfer was received), and the Data field includes the transfer amount. In the case of a transaction calling an intelligent contract in a blockchain, a From field represents an account address for initiating the transaction, a To field represents an account address of the contract called by the transaction, and a Data field includes Data such as a function name in the calling contract and incoming parameters To the function, so as To obtain code of the function From the blockchain and execute the code of the function when the transaction is executed.
The block chain may provide the functionality of an intelligent contract. An intelligent contract on a blockchain is a contract that can be executed by a transaction trigger on the blockchain system. An intelligent contract may be defined in the form of code. Calling an intelligent contract in a blockchain initiates a transaction directed to an intelligent contract address, so that the intelligent contract code is run in a distributed manner by each node in the blockchain. It should be noted that, in addition to the creation of the intelligent contract by the user, the intelligent contract may also be set by the system in the creation block. Such contracts are generally referred to as foundational contracts. In general, the data structure, parameters, attributes and methods of some blockchains may be set in the startup contract. Further, an account with system administrator privileges may create a contract at the system level, or modify a contract at the system level (simply a system contract). Wherein the system contract is usable to add data structures for different services in a blockchain.
In the scenario of contract deployment, for example, Bob sends a transaction containing information to create an intelligent contract (i.e., a deployment contract) into the blockchain as shown in fig. 1, the data field of the transaction includes the code (e.g., bytecode or machine code) of the contract to be created, and the to field of the transaction is null to indicate that the transaction is for contract deployment. After the agreement is achieved among the nodes through a consensus mechanism, a contract address '0 x6f8ae93 …' of the contract is determined, each node adds a contract account corresponding to the contract address of the intelligent contract in a state database, allocates a state storage corresponding to the contract account, and stores a contract code in the state storage of the contract, so that the contract creation is successful.
In the scenario of invoking a contract, for example, Bob sends a transaction for invoking an intelligent contract into the blockchain as shown in fig. 1, the from field of the transaction is the address of the account of the transaction initiator (i.e., Bob), the "0 x6f8ae93 …" in the to field represents the address of the intelligent contract being invoked, and the data field of the transaction includes the method and parameters for invoking the intelligent contract. After the transaction is identified in the blockchain, each node in the blockchain can execute the transaction respectively, so that the contract is executed respectively, and the state database is updated based on the execution of the contract.
At present, due to the decentralized characteristic of the block chain, all nodes in the block chain maintain the same block data, and the special requirements of some nodes cannot be met. Taking an existing federation chain as an example, nodes of the federation chain are deployed on node devices of all federation members (i.e., node members in the federation), and a block chain can be formed, that is, all federation members respectively have corresponding block chain nodes in the block chain, and all transactions and related data occurring on the block chain can be obtained through the corresponding block chain nodes. In some cases, however, there may be some federating members who wish to complete a small range of transactions with privacy requirements, and who wish to be able to both verify the transactions on the blockchain or to take advantage of other advantages of blockchain technology, and to avoid other federating members viewing the transactions and related data.
To this end, in the related art, a blockchain networking system that is participated by a plurality of members has appeared, which includes, on a hardware level, a node device of each member, at least one node being deployed on the node device of each member, different nodes deployed on the node device of the same member belonging to different blockchains. Meanwhile, the blockchain networking system has a tree structure in a software layer, wherein the blockchain main network is used as a root node, and each blockchain sub-network is respectively used as other nodes (the nodes and the nodes are different concepts, the nodes are concepts in the meaning of blockchain and refer to the nodes in the blockchain, and the nodes are concepts in the tree structure and refer to one blockchain network in the tree structure in the text). Through the blockchain networking system, individual members can self establish blockchain sub-networks to conduct small-range transactions, and the blockchain networks (whether main networks or sub-networks) in the system are mutually isolated in data.
Due to the advent of the blockchain networking system, cross-chain communication between different blockchains (e.g., between different subnets) has increased substantially. In a related art, a mechanism of multiple signatures is adopted to realize cross-chain communication. However, the mechanism causes the complexity of the cross-link message to be high, the resource of each node of the blockchain is fixed, and due to frequent interaction among the blockchain nodes, the message with high complexity in cross-link communication occupies a great bandwidth, thereby affecting the consensus efficiency of the subnets in the blockchain networking and also reducing the communication efficiency.
The embodiment of the specification provides a method for communication between two different block chains. As shown in fig. 2, fig. 2 is a schematic view of a scenario of cross-link communication. The block chain architecture of the block chain 1 and the block chain 2 is shown in fig. 1. One or more relay devices are disposed between the blockchain 1 and the blockchain 2 (it should be noted that fig. 2 only exemplarily shows one relay device, but the number of the relay devices may be one or multiple, and the embodiments of the present specification are not limited thereto), and the relay devices may be configured to integrate and forward cross-chain messages. When the block chain 1 and the block chain 2 perform cross-chain communication, each sending node sending the cross-chain message may send the cross-chain message to the relay device first, and the relay device obtains to-be-sent data including the signature of each sending node by combining the received cross-chain messages with the same content, and sends the to-be-sent data to the target node when a preset time condition is met, so that the communication efficiency between different block chains is improved.
The embodiments provided in the present specification will be described in detail with reference to specific examples.
As shown in fig. 3, fig. 3 is a flow diagram illustrating a method of cross-chain communication, which may be performed by a relay device, which may be implemented as any computing, processing capable device, platform, server, or cluster of devices, according to an example embodiment. The method describes a process of sending a cross-chain message from a blockchain 1 to a blockchain 2, and comprises the following steps:
in step 301, the relay device receives a cross-link message sent by any node in the blockchain 1 and a signature of the node on the cross-link message. The cross-chain message may be a cross-chain query message, or a cross-chain synchronization message, and the like, which is not limited in this aspect. The address information of blockchain 2 and the message body of the cross-chain message can be included in the cross-chain message. The address information of the block chain 2 may include, for example, an address list of each node in the block chain 2.
In step 303, the relay device searches for the pre-stored data to be transmitted, and determines whether the data to be transmitted associated with the cross-link message is stored therein. The data to be sent associated with the cross-link message includes the cross-link message and the signature of one or more nodes in the blockchain 1 on the cross-link message.
Specifically, the identification code corresponding to the cross-link message may be generated based on the cross-link message, for example, the cross-link message is calculated by using a preset hash algorithm, and a calculation result is used as the identification code corresponding to the cross-link message. It is to be understood that the identification code corresponding to the cross-chain message may also be generated by any other reasonable algorithm, and the generation of the identification code depends on the cross-chain message, so that the cross-chain message corresponds to the identification code one to one. And then, searching the data to be sent associated with the identification code from the prestored data to be sent. Each pre-stored data to be sent is associated with an identification code, the data to be sent and the identification codes are stored in a key value mode, the identification codes are keys, and the data to be sent are values. The identification codes associated with the data to be transmitted can be traversed, and if the data to be transmitted associated with the identification code corresponding to the cross-chain message is found, the data to be transmitted can be determined as the data to be transmitted associated with the cross-chain message.
Alternatively, the pre-stored data to be transmitted may include an address field for recording a target block chain address, a content field for recording a message body, a signature field for recording a signature, and a time field for recording a message reception time. In one implementation, the time field may be used to record the initial time of receipt of the cross-chain message. In another implementation, the time field may also be used to record the most recent time of receipt of the cross-chain message.
In step 305, if the relay device determines that the pending data associated with the cross-link message is stored, the signature of the node on the cross-link message may be added to the pending data associated with the cross-link message. In particular, the signature may be added under a signature field of the data to be sent associated with the cross-chain message. Optionally, if the time field is used to record the latest receiving time of the cross-link message, the receiving time in the time field of the data to be sent may also be updated with the time of receiving the cross-link message.
If the relay device determines that the data to be transmitted associated with the cross-link message is not stored, the associated data to be transmitted may be generated and stored based on the cross-link message. Specifically, the generated identification code, the cross-link message and the signature of the node on the cross-link message can be associatively stored as the data to be sent. For example, the generated identification code may be used as a key, and the cross-link message, the signature of the node on the cross-link message, and the time of receiving the cross-link message may be used as values, which are stored in association with each other as the pending data by means of the key.
In step 307, when a preset time condition is met, sending the data to be sent associated with the cross-chain message to each node of the blockchain 2, so that each node of the blockchain 2 verifies the cross-chain message based on the signature in the data to be sent.
For example, the receiving time recorded in the time field of the data to be sent may be obtained, a difference between the current time and the initial receiving time may be calculated, and if the difference is greater than a preset value, the data to be sent may be sent to each node of the block chain 2. It should be noted that, in one implementation, the time field of the data to be sent is used to record the initial receiving time of the cross-chain message, and in another implementation, the time field of the data to be sent is used to record the latest receiving time of the cross-chain message. The preset values in these two cases are different, and the specific values of the preset values can be set according to experience.
In this embodiment, after each node of the blockchain 2 receives the pending data, the cross-chain message may be verified based on a signature in the pending data. Specifically, each node of the blockchain 2 verifies each signature included in the to-be-sent data, and for any node of the blockchain 2, if the verification of more than n signatures in the to-be-sent data is successful, the node determines that the to-be-sent data is authentic. Wherein, n may be the number determined according to the consensus mechanism adopted by the blockchain, taking the consensus mechanism of the practical byzantine fault-tolerant algorithm as an example, n may be f1+1, and f1 is the number of byzantine nodes of the blockchain 1. If more than m nodes in the blockchain 2 determine that the pending data is authentic, the pending data includes a cross-chain message as a valid message (e.g., m may be f2+1, and f2 is the number of byzantine nodes of blockchain 2).
It should be noted that the blockchain 1 and the blockchain 2 may be two independent blockchains, or two subnets in a blockchain networking, and this embodiment is not limited in this respect.
In the cross-link communication method provided in the foregoing embodiment of the present specification, the relay device disposed between the block chains that communicate with each other merges the received cross-link messages with the same content, obtains the data to be sent that includes the signature of each sending node, and sends the data to be sent to the target node when a preset time condition is satisfied, thereby improving communication efficiency between different block chains.
It should be noted that although in the above embodiments, the operations of the methods of the embodiments of this specification are described in a particular order, this does not require or imply that these operations must be performed in that particular order, or that all of the illustrated operations must be performed, in order to achieve desirable results. Rather, the steps depicted in the flowcharts may change order of execution. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
The embodiments of one or more embodiments of the present disclosure are schematically illustrated below with reference to a complete application example.
The application scenario may be: procedure for blockchain 1 to query for cross-chain data from blockchain 2. The block chain 1 may include a node a, a node b, a node c, and a node d.
Specifically, first, each node in the blockchain 1 determines a cross-chain query message Q, and signs the query message Q by using a respective private key to obtain a signature Sa of the node a, a signature Sb of the node b, a signature Sc of the node c, and a signature Sd of the node d. Wherein the query message Q includes a message body B1 and an IP list L1 of each node in the blockchain 2. Each node in the block chain 1 then sends a query message Q and its respective signature to the relay device.
The relay device receives a query message Q and a signature Sa sent by a node a at the moment Ta, and processes the query message Q by the relay device through a preset hash algorithm to obtain an identification code M1. Then, it is searched from the pre-stored data to be sent, whether the data to be sent associated with the identification code M1 is stored D1. Fig. 4A is a schematic structural diagram of the data to be transmitted stored by the relay device before the time Ta, and as shown in fig. 4A, the data to be transmitted D1 associated with the identification code M1 is not stored in the pre-stored data to be transmitted. Therefore, the data to be sent corresponding to the query message Q can be added to the data to be sent. Specifically, the identifier M1 is used as a key (key), the query message Q, the signature Sa and the time Ta are used as values (value), and the data to be sent D1 is added to the data to be sent in a key mode. As shown in fig. 4B, fig. 4B is a schematic structural diagram of the data to be sent after the data to be sent D1 is added.
Next, the relay device receives the query message Q and the signature Sc sent by the node c at time Tc, and the relay device processes the query message Q to obtain the identification code M1. Then, it is searched from the data to be transmitted whether the data to be transmitted associated with the identification code M1 is stored D1. As can be seen from fig. 4B, the pre-stored data to be issued stores data to be issued D1 associated with the identification code M1. Therefore, the signature Sc and Tc times may be added to the data-to-send D1 to update the data-to-send D1. As shown in fig. 4C, fig. 4C is a schematic structural diagram of the data to be sent after the data to be sent D1 is updated.
Then, the relay device receives the query message Q and the respective signatures Sd and Sb sent by the node D and the node b, respectively, at the time Td and the time Tb (after the time Tb), and updates the to-be-sent data D1. At the time Tz, the relay device determines that the difference value of Tz-Tb is greater than or equal to the preset difference value T, so that the relay device sends the data to be sent D1 to each node of the block chain 2, and deletes the stored data to be sent D1. As shown in fig. 4D, fig. 4D is a schematic structural diagram of the data to be sent before the data to be sent D1 is sent.
After each node of the block chain 2 receives the data D1 to be sent, the signature of each signature included in the data is checked, and the query message Q is determined to be a valid message according to the result of the signature checking. Then, each node of the block chain 2 performs a query operation based on the query message Q, and obtains target data respectively. And respectively sending the obtained target data to the relay device, and returning the target data to each node in the block chain 1 by the relay device. The step of returning the target data to each node in the block chain 1 is similar to the process of sending the query message Q, and is not described herein again.
In the cross-link communication method provided in the foregoing embodiment of this specification, the relay device is arranged between the block chains that communicate with each other, the relay device performs merging processing on the cross-link messages with the same content, to obtain data to be sent that includes the signature of each sending node, and sends the data to be sent to the target node when a preset time condition is met, thereby improving communication efficiency between different block chains.
Therefore, by applying the scheme, the relay equipment is arranged between two different block chains which are communicated with each other, the relay equipment combines the received cross-link messages with the same content to obtain the data to be sent which comprises the signature of each sending node, and the data to be sent is sent to the target node when the preset time condition is met, so that the communication efficiency between different block chains is improved.
Corresponding to the foregoing embodiments of the cross-chain communication method, the present specification also provides embodiments of a cross-chain communication apparatus.
As shown in fig. 5, fig. 5 is a block diagram of a cross-link communication apparatus according to an exemplary embodiment, where the apparatus is deployed in a relay device, and the apparatus may include: a receiving module 501, a determining module 502, an adding module 503 and a sending module 504.
The receiving module 501 is configured to receive a cross-link message sent by a first node in a first blockchain and a first signature of the first node on the cross-link message.
A determining module 502, configured to determine whether a first pending data associated with the cross-chain message is pre-stored, where the first pending data includes the cross-chain message and a signature of the cross-chain message by one or more nodes in the first blockchain.
An adding module 503, configured to add the first signature to the first to-be-transmitted data when it is determined that the first to-be-transmitted data is stored.
A sending module 504, configured to send the first to-be-sent data to each node of the second blockchain when a preset time condition is met, so that each node of the second blockchain verifies the cross-chain message based on a signature in the first to-be-sent data.
In some embodiments, the cross-chain message includes address information of the second blockchain and a message body of the cross-chain message.
In other embodiments, the determining module 502 may include: a generation submodule and a lookup submodule (not shown in the figure).
And the generation submodule is used for generating an identification code based on the cross-chain message.
And the searching submodule is used for searching the first to-be-transmitted data associated with the identification code from the pre-stored to-be-transmitted data.
In further embodiments, the generation submodule is configured to: and calculating the cross-chain message by using a preset hash algorithm to obtain the identification code.
In some embodiments, the apparatus may further comprise: a memory module (not shown).
And the storage module is used for generating and storing the first to-be-transmitted data based on the cross-chain message when the first to-be-transmitted data is determined not to be stored.
In other embodiments, the storage module is configured to: and storing the identification code, the cross-chain message and the first signature as first to-be-sent data in an associated manner.
In other embodiments, the storage module stores the identification code, the cross-chain message, and the first signature as the first data to be sent in an associated manner as follows: and taking the identification code as a key, taking the cross-link message and the first signature as values, and storing the cross-link message and the first signature as first to-be-sent data in a key value mode.
In other embodiments, the first pending data may further include a most recent message receipt time.
Wherein, the device still includes: and the updating module is used for updating the latest message receiving time included in the first to-be-sent data by using the time for receiving the cross-chain message after the first to-be-sent data is determined to be stored.
In other embodiments, the sending module is configured to: and calculating a first difference value between the current moment and the latest message receiving time, and sending the first data to be sent to each node of the second block chain when the first difference value is greater than a first preset value.
In some embodiments, the first to-be-transmitted data further includes an initial message receiving time of a first cross-chain message corresponding to the first to-be-transmitted data. Wherein the sending module is configured to: and calculating a second difference value between the current moment and the initial message receiving time, and if the second difference value is greater than a second preset value, sending the first data to be sent to each node of the second block chain.
In some embodiments, the first blockchain and the second blockchain are subnets based on a third blockchain, the first node and a third node in the third blockchain are deployed in the same computing device, and the second node in the second blockchain and a fourth node in the third blockchain are deployed in the same computing device.
It should be understood that the above-mentioned apparatus may be preset in the relay device, and may also be loaded into the relay device by downloading or the like. Respective modules in the above-described apparatus may cooperate with modules in the relay device to implement a cross-link communication scheme.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the 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 modules can be selected according to actual needs to achieve the purpose of one or more embodiments of the present specification. One of ordinary skill in the art can understand and implement it without inventive effort.
One or more embodiments of the present specification further provide a computer-readable storage medium storing a computer program, where the computer program is operable to execute the cross-chain communication method provided in any one of the embodiments of fig. 3.
One or more embodiments of the present specification further provide a computing device, which includes a memory and a processor, where the memory stores executable codes, and the processor executes the executable codes to implement the cross-chain communication method provided in any one of the embodiments of fig. 3.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to the software compiler used in program development, but the original code before compiling is also written in a specific Programming Language, which is called Hardware Description Language (HDL), and the HDL is not only one kind but many kinds, such as abel (advanced boot Expression Language), ahdl (alternate Language Description Language), communication, CUPL (computer universal Programming Language), HDCal (Java Hardware Description Language), langa, Lola, mylar, HDL, PALASM, rhydl (runtime Description Language), vhjhdul (Hardware Description Language), and vhygl-Language, which are currently used commonly. It will also be apparent to those skilled in the art that hardware circuitry for implementing the logical method flows can be readily obtained by a mere need to program the method flows with some of the hardware description languages described above and into an integrated circuit.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be regarded as a hardware component and the means for performing the various functions included therein may also be regarded as structures within the hardware component. Or even means for performing the functions may be conceived to be both a software module implementing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a server system. Of course, this application does not exclude that with future developments in computer technology, the computer implementing the functionality of the above described embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device or a combination of any of these devices.
Although one or more embodiments of the present description provide method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of sequences, and does not represent a unique order of performance. When an actual apparatus or end product executes, it may execute sequentially or in parallel (e.g., parallel processors or multi-threaded environments, or even distributed data processing environments) according to the method shown in the embodiment or the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, article, or apparatus that comprises the recited elements is not excluded. For example, if the terms first, second, etc. are used to denote names, they do not denote any particular order.
For convenience of description, the above devices are described as being divided into various modules by functions, which are described separately. Of course, when implementing one or more of the present description, the functions of each module may be implemented in one or more software and/or hardware, or the modules implementing the same functions may be implemented by a combination of a plurality of sub-modules or sub-units, etc. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. 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.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
One skilled in the art will appreciate that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
One or more embodiments of the present description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
All the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points. In the description of the specification, reference to the description of "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the specification. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Moreover, various embodiments or examples and features of various embodiments or examples described in this specification can be combined and combined by one skilled in the art without being mutually inconsistent.
The above description is merely exemplary of one or more embodiments of the present disclosure and is not intended to limit the scope of one or more embodiments of the present disclosure. Various modifications and alterations to one or more embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement made within the spirit and principle of the present specification shall be included in the scope of the claims.

Claims (24)

1. A method of cross-link communication, the method being performed by a relay device; the method comprises the following steps:
receiving a cross-chain message sent by a first node in a first blockchain and a first signature of the cross-chain message by the first node;
determining whether first to-be-sent data associated with the cross-link message is stored in advance; the first pending data comprises the cross-chain message and a signature of the cross-chain message by one or more nodes in the first blockchain;
if the first to-be-transmitted data are determined to be stored, adding the first signature to the first to-be-transmitted data;
when a preset time condition is met, the first data to be sent is sent to each node of a second block chain; enabling each node of the second blockchain to verify the cross-chain message based on the signature in the first pending data.
2. The method of claim 1, wherein the cross-chain message comprises address information of the second blockchain and a message body of the cross-chain message.
3. The method of claim 1, the determining whether first pending data associated with the cross-chain message is pre-stored, comprising:
generating an identification code based on the cross-chain message;
and searching the first data to be transmitted associated with the identification code from the prestored data to be transmitted.
4. The method of claim 3, wherein the generating an identification code based on the cross-chain message comprises:
and calculating the cross-chain message by using a preset hash algorithm to obtain the identification code.
5. The method of claim 3, wherein the method further comprises:
and if the first to-be-sent data are determined not to be stored, generating and storing the first to-be-sent data based on the cross-chain message.
6. The method of claim 5, wherein the generating and storing the first pending data based on the cross-chain message comprises:
and associatively storing the identification code, the cross-chain message and the first signature as the first to-be-sent data.
7. The method of claim 6, wherein the associatively storing the identification code, the cross-chain message, and the first signature as the first pending data comprises:
and taking the identification code as a key, taking the cross-link message and the first signature as values, and storing the cross-link message and the first signature as the first to-be-sent data in a key value mode.
8. The method of claim 1, wherein the first pending data further comprises a most recent message receipt time;
after determining that the first to-be-transmitted data is stored, the method further comprises the following steps:
and updating the latest message receiving time included in the first to-be-transmitted data by using the time for receiving the cross-chain message.
9. The method according to claim 8, wherein the sending the first data to be sent to each node of the second blockchain when a preset time condition is met comprises:
calculating a first difference between the current moment and the latest message receiving time;
and if the first difference is larger than a first preset value, the first data to be transmitted is transmitted to each node of a second block chain.
10. The method according to claim 1, wherein the first data to be transmitted further includes an initial message receiving time of a first cross-chain message corresponding to the first data to be transmitted;
when a preset time condition is met, the sending the first data to be sent to each node of a second block chain includes:
calculating a second difference between the current moment and the initial message receiving time;
and if the second difference is larger than a second preset value, sending the first data to be sent to each node of a second block chain.
11. The method of claim 1, the first blockchain and the second blockchain being subnets based on a third blockchain, the first node being deployed in the same computing device as a third node in the third blockchain, the second node in the second blockchain being deployed in the same computing device as a fourth node in the third blockchain.
12. A cross-link communication apparatus, the apparatus being deployed at a relay device; the device comprises:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a cross-chain message sent by a first node in a first block chain and a first signature of the first node on the cross-chain message;
the determining module is used for determining whether first to-be-sent data associated with the cross-link message is stored in advance; the first pending data comprises the cross-chain message and a signature of the cross-chain message by one or more nodes in the first blockchain;
the adding module is used for adding the first signature to the first to-be-transmitted data when the first to-be-transmitted data is determined to be stored;
the sending module is used for sending the first data to be sent to each node of a second block chain when a preset time condition is met; enabling each node of the second blockchain to verify the cross-chain message based on the signature in the first to-be-transmitted data.
13. The apparatus of claim 12, wherein the cross-chain message comprises address information of the second blockchain and a message body of the cross-chain message.
14. The apparatus of claim 12, the determining means comprising:
the generation submodule is used for generating an identification code based on the cross-chain message;
and the searching submodule is used for searching the first to-be-transmitted data associated with the identification code from the pre-stored to-be-transmitted data.
15. The apparatus of claim 14, wherein the generation submodule is configured to: and calculating the cross-chain message by using a preset hash algorithm to obtain the identification code.
16. The apparatus of claim 14, wherein the apparatus further comprises:
and the storage module is used for generating and storing the first to-be-sent data based on the cross-chain message when the first to-be-sent data is determined not to be stored.
17. The apparatus of claim 16, wherein the storage module is configured to: and associatively storing the identification code, the cross-chain message and the first signature as the first to-be-sent data.
18. The apparatus of claim 17, wherein the storage module associatively stores the identification code, the cross-chain message, and the first signature as the first pending data by: and taking the identification code as a key, taking the cross-link message and the first signature as values, and storing the cross-link message and the first signature as the first to-be-sent data in a key value mode.
19. The apparatus of claim 12, wherein the first pending data further comprises a most recent message reception time;
wherein the apparatus further comprises: and the updating module is used for updating the latest message receiving time included by the first to-be-sent data by using the time for receiving the cross-chain message after the first to-be-sent data is determined to be stored.
20. The apparatus of claim 19, wherein the transmitting module is configured to:
the calculation submodule is used for calculating a first difference value between the current moment and the latest message receiving time;
and the sending submodule is used for sending the first data to be sent to each node of the second block chain when the first difference value is larger than a first preset value.
21. The apparatus of claim 12, wherein the first pending data further comprises an initial message receiving time of a first cross-link message corresponding to the first pending data;
wherein the sending module is configured to:
calculating a second difference between the current moment and the initial message receiving time;
and if the second difference is larger than a second preset value, the first data to be transmitted is transmitted to each node of a second block chain.
22. The apparatus of claim 12, the first blockchain and the second blockchain being subnetworks based on a third blockchain, the first node being deployed in a same computing device as a third node in the third blockchain, the second node in the second blockchain being deployed in a same computing device as a fourth node in the third blockchain.
23. A computer-readable storage medium, on which a computer program is stored which, when executed in a computer, causes the computer to carry out the method of any one of claims 1-11.
24. A computing device comprising a memory having executable code stored therein and a processor that, when executing the executable code, implements the method of any of claims 1-11.
CN202210335217.2A 2022-03-31 2022-03-31 Cross-link communication method and device Pending CN114785800A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210335217.2A CN114785800A (en) 2022-03-31 2022-03-31 Cross-link communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210335217.2A CN114785800A (en) 2022-03-31 2022-03-31 Cross-link communication method and device

Publications (1)

Publication Number Publication Date
CN114785800A true CN114785800A (en) 2022-07-22

Family

ID=82426347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210335217.2A Pending CN114785800A (en) 2022-03-31 2022-03-31 Cross-link communication method and device

Country Status (1)

Country Link
CN (1) CN114785800A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701410A (en) * 2023-08-07 2023-09-05 北京大学 Method and system for storing memory state data for data language and digital networking system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200184473A1 (en) * 2019-07-23 2020-06-11 Alibaba Group Holding Limited Managing transactions on blockchain networks
CN112272114A (en) * 2020-10-28 2021-01-26 成都质数斯达克科技有限公司 Method, device, equipment and storage medium for sending information across block chain network
CN112417046A (en) * 2020-11-23 2021-02-26 宙通科技(南京)有限公司 Parallelization Byzantine fault-tolerant method applied to block chain consensus mechanism
CN112633885A (en) * 2020-12-31 2021-04-09 深圳前海益链网络科技有限公司 Multi-signature transaction implementation method and related device
CN113191900A (en) * 2021-05-11 2021-07-30 预言机(重庆)科技有限公司 Trans-block chain equity transfer method and system based on relay chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200184473A1 (en) * 2019-07-23 2020-06-11 Alibaba Group Holding Limited Managing transactions on blockchain networks
CN112272114A (en) * 2020-10-28 2021-01-26 成都质数斯达克科技有限公司 Method, device, equipment and storage medium for sending information across block chain network
CN112417046A (en) * 2020-11-23 2021-02-26 宙通科技(南京)有限公司 Parallelization Byzantine fault-tolerant method applied to block chain consensus mechanism
CN112633885A (en) * 2020-12-31 2021-04-09 深圳前海益链网络科技有限公司 Multi-signature transaction implementation method and related device
CN113191900A (en) * 2021-05-11 2021-07-30 预言机(重庆)科技有限公司 Trans-block chain equity transfer method and system based on relay chain

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701410A (en) * 2023-08-07 2023-09-05 北京大学 Method and system for storing memory state data for data language and digital networking system
CN116701410B (en) * 2023-08-07 2023-11-14 北京大学 Method and system for storing memory state data for data language of digital networking

Similar Documents

Publication Publication Date Title
CN114679457B (en) Node grouping method in block chain and block chain link point
CN114281893A (en) Processing method, device and equipment for block chain transaction
CN114936092A (en) Method for executing transaction in block chain and main node of block chain
CN114936094A (en) Method for executing transaction in block chain, master node and slave node of block chain
CN114785800A (en) Cross-link communication method and device
CN114374699A (en) Cross-chain interaction method and cross-chain interaction auditing method
CN113935737A (en) Random number generation method and device based on block chain
CN116366666A (en) Chain state updating method and block link point in block chain system
CN115150409A (en) Method for executing transaction in block chain system, block chain system and node
CN115098114A (en) Block chain-based distributed application deployment method and device
CN114782016A (en) Creditor data processing method and device based on intelligent contract and block chain system
CN109032804B (en) Data processing method and device and server
CN114785853A (en) Method and apparatus for cross-link communication in a system of block chains
CN114780973A (en) Method and device for managing accounts in block chain system
CN115174573B (en) Data broadcasting method in block chain system, node and block chain system
WO2024066014A1 (en) Blockchain system transaction execution method and node
CN114331447B (en) Cross-link message submitting method and device
CN115174572B (en) Data multicasting method in blockchain, blockchain node and storage medium
WO2024066006A1 (en) Consensus method and consensus node in blockchain system, and blockchain system
WO2024066019A1 (en) Transaction execution method in blockchain system, consensus node, and blockchain system
CN115714652A (en) Transaction execution method and block link point
CN116319943A (en) Cross-chain interaction method and block chain link point
CN115880071A (en) Method for processing digital resources and nodes of block chain
CN116366706A (en) Cross-chain interaction method and block chain link point
CN114780994A (en) Data processing method based on intelligent contract and block link point

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