Cross-chain interaction method and blockchain node

By configuring nodes with different processing delays in the blockchain system to handle cross-chain events, the problem of low efficiency in cross-chain interaction is solved, achieving efficient cross-chain event processing and system performance improvement, which is suitable for interaction between blockchain subnets with strong trust relationships.

CN116319943BActive Publication Date: 2026-01-20ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310342727.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2026-01-20
Estimated Expiration
2043-03-31

AI Technical Summary

Technical Problem

Cross-chain interactions between different blockchain systems suffer from inefficiency and resource redundancy. In particular, when processing cross-chain events, inconsistent processing latency between nodes leads to resource waste and performance bottlenecks.

Method used

By configuring different processing delays for multiple nodes in the first blockchain system, nodes are allowed to determine whether to process cross-chain events based on their own delays, generate cross-chain requests, and send indication information and cross-chain requests to other nodes, thereby reducing redundant processing and improving efficiency.

Benefits of technology

It enables efficient cross-chain event processing within the blockchain system, reduces resource waste, improves system performance, avoids dependence on the master node, and is suitable for interaction between blockchain subnets with strong trust relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116319943B_ABST
    Figure CN116319943B_ABST
Patent Text Reader

Abstract

A cross-chain interaction method and a blockchain node, the method is executed by any first blockchain node in a plurality of blockchain nodes included in a first blockchain system, the plurality of blockchain nodes are configured with different processing delays for cross-chain events. The method can include: determining whether a target cross-chain event obtained by the first blockchain node needs to be processed according to the processing delay configured by the first blockchain node itself; if yes, generating a cross-chain request according to the target cross-chain event; and sending indication information corresponding to the target cross-chain event to the remaining blockchain nodes in the first blockchain system, to indicate that the blockchain nodes receiving the indication information do not need to process the target cross-chain event; and sending the cross-chain request to a second blockchain system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present specification belong to the field of blockchains, and particularly relate to a cross-chain interaction method and a blockchain node. BACKGROUND

[0002] A blockchain technology is built on a transmission network (for example, a peer-to-peer network). A blockchain node in a blockchain system verifies and stores data by using a chain data structure, and generates and updates data by using a distributed node consensus algorithm. Different blockchain systems can be built to support the implementation of different types of businesses. In this technical scenario, there is a demand for interaction between different blockchain systems, so that some complex businesses are realized through cross-chain interaction. SUMMARY

[0003] The purpose of the present application is to provide a cross-chain interaction method and a blockchain node.

[0004] In a first aspect, a cross-chain interaction method is provided, which is executed by any first blockchain node in a plurality of blockchain nodes included in a first blockchain system, and the plurality of blockchain nodes are configured with different processing delays for cross-chain events. The method comprises: determining whether a target cross-chain event obtained by the first blockchain node needs to be processed according to a processing delay configured by the first blockchain node; if so, generating a cross-chain request according to the target cross-chain event; sending indication information corresponding to the target cross-chain event to the remaining blockchain nodes in the first blockchain system, to indicate that the blockchain nodes receiving the indication information do not need to process the target cross-chain event; and sending the cross-chain request to a second blockchain system.

[0005] In a second aspect, a first blockchain node is provided, which belongs to a plurality of blockchain nodes included in a first blockchain system, and the plurality of blockchain nodes are configured with different processing delays for cross-chain events. The first blockchain node comprises: a transaction determination unit configured to determine whether a target cross-chain event obtained by the first blockchain node needs to be processed according to a processing delay configured by the first blockchain node; a transaction processing unit configured to generate a cross-chain request according to the target cross-chain event if the target cross-chain event needs to be processed; and a communication processing unit configured to send indication information corresponding to the target cross-chain event to the remaining blockchain nodes in the first blockchain system, to indicate that the blockchain nodes receiving the indication information do not need to process the target cross-chain event; and the communication processing unit is further configured to send the cross-chain request to a second blockchain system.

[0006] In a third aspect, a computer readable storage medium is provided, which stores a computer program / instruction, when the computer program / instruction is executed in a computing device, the computing device executes the method in the first aspect.

[0007] In a fourth aspect, a computing device is provided, comprising a memory and a processor, wherein the memory stores executable code / instructions, and the processor executes the executable code / instructions to implement the method in the first aspect.

[0008] In the scheme of the embodiments of the present specification, the plurality of blockchain nodes in the first blockchain system are configured with different processing delays for cross-chain events, and for any first blockchain node in the plurality of blockchain nodes, it can determine whether it needs to process the target cross-chain event obtained by itself according to the processing delay configured by itself, if yes, generate a cross-chain request according to the target cross-chain event, and send indication information corresponding to the target cross-chain event to the remaining blockchain nodes in the first blockchain system, to instruct the blockchain nodes receiving the indication information not to process the target cross-chain event, and send the cross-chain request to the second blockchain system. In this way, the plurality of blockchain nodes in the first blockchain node do not need to process the same cross-chain event obtained by themselves respectively, and do not depend on the master node in the first blockchain system to be responsible for cross-chain interaction with the second blockchain system, which is beneficial to the first blockchain system to complete the processing of the cross-chain event more efficiently. BRIEF DESCRIPTION OF DRAWINGS

[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present specification, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments described in the present specification, and other drawings can also be obtained according to these drawings without creative labor.

[0010] Figure 1 An architecture diagram of a blockchain system provided in the embodiments of the present specification;

[0011] Figure 2 A flowchart of a cross-chain interaction method provided in the embodiments of the present specification;

[0012] Figure 3 A schematic diagram of a blockchain subnetwork formed based on a blockchain main network provided exemplarily;

[0013] Figure 4 A structural schematic diagram of a cross-chain request provided exemplarily;

[0014] Figure 5 A flowchart of a blockchain node updating its configured processing delay provided in the embodiments of the present specification;

[0015] Figure 6 A structural schematic diagram of a blockchain node provided in the embodiments of the present specification. DETAILED DESCRIPTION

[0016] In order to make the technical solutions in the specification better understood by those skilled in the art, the technical solutions in the specification will be clearly and completely described below in combination with the drawings in the embodiments of the specification. Obviously, the described embodiments are only part of the embodiments of the specification, not all the embodiments. Based on the embodiments in the specification, all other embodiments obtained by those skilled in the art without creative labor should belong to the protection scope of the specification.

[0017] Figure 1 An architecture diagram of a blockchain system is exemplarily provided in the embodiments of the specification. In the Figure 1 In the architecture diagram of the blockchain system shown, N blockchain nodes can be included in the blockchain system 100, for example, wherein Figure 1 Eight blockchain nodes, node 1-node 8, are exemplarily shown in the blockchain system 100. The connection between the nodes schematically represents a P2P (Peer to Peer) connection, and the aforementioned connection can be a TCP (Transmission Control Protocol) connection, for example.

[0018] A transaction in the blockchain system can refer to a task unit executed in the blockchain system and recorded in the blockchain system. The transaction usually includes a sending field (From), a receiving field (To) and a data field (Data). Among them, in the case of a transfer transaction, the From field represents the account address initiating the transaction (i.e. initiating the transfer task to another account), the To field represents the account address receiving the transaction (i.e. receiving the transfer), and the Data field includes the transfer amount.

[0019] The function of a smart contract can be provided in the blockchain system. The smart contract on the blockchain system is a contract that can be triggered and executed by a transaction on the blockchain system. The smart contract can be defined in the form of code. Invoking a smart contract in the blockchain system is to initiate a transaction pointing to the address of the smart contract, so that the nodes in the blockchain system distribute the smart contract code.

[0020] In the scenario of deploying a contract, for example, Bob sends a transaction containing information for creating a smart contract (i.e. deploying a contract) to the blockchain system 100, and the transaction is received by the node 1 in the blockchain system 100. Figure 1In the blockchain shown, the data field of the transaction includes the code (such as bytecode or machine code) of the contract to be created, and the to field of the transaction is empty, indicating that the transaction is used to deploy the contract. After the same is reached through the consensus mechanism among the nodes, the contract address "0x6f8ae93…" of the contract is determined, each node adds the contract account corresponding to the contract address of the smart contract in the state database, allocates the state storage corresponding to the contract account, stores the contract code, and saves the hash value of the contract code in the state storage of the contract, so that the contract creation is successful.

[0021] In the scenario of calling the contract, for example, Bob sends a transaction for calling the smart contract to the blockchain as Figure 1 In the blockchain shown, the from field of the transaction is the address of the account of the transaction initiator (i.e., Bob), the to field is, for example, "0x6f8ae93…" described above, that is, the address of the called smart contract, and the data field of the transaction includes the method and parameters of calling the smart contract. After the transaction is consensus in the blockchain, each node in the blockchain can execute the transaction respectively, so as to execute the contract respectively, and update the state database based on the execution of the contract.

[0022] It should be noted that in addition to the smart contract that can be created by the user, the system can also set the smart contract in the genesis block. Such a contract is generally referred to as a genesis contract. Generally, some data structures, parameters, attributes and methods of the blockchain system can be set in the genesis contract. In addition, an account with system administrator permission can create a system-level contract or modify a system-level contract (referred to as a system contract). In addition to the EVM in Ethereum, various virtual machines can also be used by different blockchain networks, which are not limited here.

[0023] After completing the execution of the transaction for calling the smart contract, the blockchain node in the blockchain system generates a corresponding receipt for recording information related to the execution of the smart contract. The blockchain node can obtain information related to the contract execution result by querying the receipt of the transaction. The contract execution result can be expressed as an event in the receipt, and the message mechanism can be used to realize the message passing of the event in the receipt, triggering the blockchain node to perform corresponding processing based on the event in the receipt. In addition to the transaction for calling the smart contract, other transactions such as a transfer transaction can also generate a receipt.

[0024] One or more events can be included in a single receipt. A single event can include multiple fields such as a topic and data. A blockchain node can listen to the topic of an event, so that in the case of listening to a predefined topic, a preset processing is performed, or the relevant content is read from the data field of the corresponding event and a preset processing is performed based on the read content.

[0025] There can be a need for cross-chain interaction between two different blockchain systems. For example, when a first blockchain system performs a business, it needs to use business data maintained by a second blockchain system; then the first blockchain system as a source blockchain system and the second blockchain system as a destination blockchain system can initiate a cross-chain request from the first blockchain system to the second blockchain system to obtain relevant business data from the second blockchain system to complete the execution of the related business.

[0026] Figure 2 A flowchart of a cross-chain interaction method provided in an embodiment of the present specification. The method exemplarily describes the process of cross-chain interaction between a first blockchain system and a second blockchain system, and the method can be executed by any first blockchain node included in a plurality of blockchain nodes of the first blockchain system. The plurality of blockchain nodes included in the first blockchain system can obtain the same cross-chain event by executing the same transaction. For example, a smart contract C corresponding to a business layer deployed in the first blockchain system is used to register a business account of a user for a related business, and the registration of the business account needs to use the identity information of the user, and the identity information of the user is stored in the second blockchain system. The user can initiate a cross-chain transaction TxA1 for calling the smart contract C to the first blockchain system, and the cross-chain transaction TxA1 includes the contract address of the smart contract C and the identifier of the second blockchain system and other information. The plurality of blockchain nodes in the first blockchain system can execute the smart contract C according to the cross-chain transaction TxA1, obtain the receipt of the transaction TxA1, and then obtain the same target cross-chain event event AB from the receipt by listening to the topic corresponding to the cross-chain event, and the data field of the event AB can include but is not limited to the following example of each subfield:

[0027] biz_id: business id;

[0028] request_id: request id / event identifier;

[0029] src_id: identifier of the source blockchain system, i.e. identifier of the first blockchain system generating the cross-chain event;

[0030] dest_id: identifier of the destination blockchain system, i.e. identifier of the second blockchain system for receiving the cross-chain event;

[0031] method: a method requested in the target blockchain system;

[0032] args: parameters of the call;

[0033] timestamp: a timestamp.

[0034] The plurality of blockchain nodes in the first blockchain system obtain the time of the target cross-chain event event AB, which should theoretically be the same or differ by a very small amount. On this basis, the plurality of blockchain nodes in the first blockchain system can configure different processing delays for the cross-chain event; for example, the processing delays configured by the plurality of blockchain nodes can increase by a predetermined time T according to the arrangement order of the plurality of blockchain nodes, where the processing delay configured by the blockchain node arranged in the first position can be, for example, 0 seconds, so as to facilitate the single blockchain node to be responsible for processing the target cross-chain event as much as possible.

[0035] Referring to Figure 2 The method can include, but is not limited to, some or all of the following steps S201-S215.

[0036] First, in step S201, it is determined whether the target cross-chain event obtained by the first blockchain node needs to be processed according to the processing delay configured by the first blockchain node itself.

[0037] For any ith blockchain node (i.e., the first blockchain node) Node i in the first blockchain system, after obtaining the target cross-chain event event AB at time t0, it can be determined whether the indication information corresponding to the target cross-chain event event AB is received within the processing delay ti configured by itself, and if not, it is determined that the target cross-chain event event AB needs to be processed. More specifically, after Node i obtains the target cross-chain event event AB at time t0, it can add the target cross-chain event event AB to the cross-chain event list: if Node i receives the indication information corresponding to the target cross-chain event event AB, such as the indication information containing the event identifier (i.e., request_id) of the target cross-chain event event AB, from the remaining blockchain nodes in the first blockchain system within the time interval (i.e., the processing delay ti) between time t0 and time t1, then Node i can delete the target cross-chain event event AB from the cross-chain event list stored by itself; if Node i fails to receive the indication information corresponding to the target cross-chain event event AB from the remaining blockchain nodes in the first blockchain system within the time interval between time t0 and time t1, then Node i can determine that it needs to process the target cross-chain event event AB when time t1 is reached.

[0038] In the case where the first blockchain node determines that it needs to process the processing target cross-chain event, step S203 is performed, and a cross-chain request is generated according to the target cross-chain event. The cross-chain request may, for example, include or indicate the target cross-chain event event AB.

[0039] Next, in step S205, indication information corresponding to the target cross-chain event is sent to the remaining blockchain nodes in the first blockchain system, for indicating that the blockchain nodes receiving the indication information do not need to process the target cross-chain event.

[0040] It should be noted that the first blockchain node may perform step S205 immediately after generating the cross-chain request according to the target cross-chain event event AB, or may perform step S205 after completing processing of the target cross-chain event event AB.

[0041] The indication information corresponding to the target cross-chain event event AB may include the request_id of the target cross-chain event event AB.

[0042] And, in step S207, the cross-chain request is sent to the second blockchain system.

[0043] When the first blockchain system and the second blockchain system satisfy a strong trust relationship, it is not necessary to focus on whether the blockchain nodes in the first blockchain system and the second blockchain system are malicious, but only to focus on whether the blockchain nodes in the first blockchain system and the second blockchain system have failed. On this basis, the first blockchain node can send the cross-chain request to at least F+1 blockchain nodes in the second blockchain system, F being the maximum number of faulty nodes allowed by the second blockchain system. In this way, it can be ensured that in the second blockchain system, one or more blockchain nodes that have not failed can accurately receive the cross-chain request from the first blockchain system.

[0044] A typical technical scenario that satisfies a strong trust relationship is, for example, that the first blockchain system and the second blockchain system are both blockchain subnets managed / created / established by a target blockchain system. The node device on which the blockchain node belonging to the first blockchain system is deployed has a blockchain node belonging to the target blockchain system deployed thereon; correspondingly, the node device on which the blockchain node belonging to the second blockchain system is deployed has a blockchain node belonging to the target blockchain system deployed thereon. The aforementioned target blockchain system may, for example, be a consortium chain involving multiple participating parties / node members.

[0045] Referring to Figure 3As shown, the target blockchain system (also referred to as a main blockchain network) is, for example, subnet0, which contains blockchain nodes such as nodeA, nodeB, nodeC, nodeD, and nodeE. It is assumed that the node members corresponding to nodeA, nodeB, nodeC, and nodeD respectively wish to form a blockchain subnet subnetl, and the node members corresponding to nodeA, nodeB, nodeC, and nodeE respectively wish to form a blockchain subnet subnet2. If nodeA is an administrator and only allows the administrator to initiate a transaction for forming a blockchain subnet, two subnet formation transactions for forming the blockchain subnets subnetl and subnet2 can be initiated by nodeA to subnet0, and subnet0 can trigger the corresponding node devices to create the blockchain subnets subnetl and subnet2 by executing the subnet formation transactions. For example, subnetl including blockchain nodes such as nodeAl, nodeBl, nodeCl, nodeDl, etc. is created, and subnet2 including blockchain nodes such as nodeA2, nodeB2, nodeC2, nodeE2, etc. is created.

[0046] In the process of establishing the blockchain subnet, the blockchain nodes belonging to the blockchain subnet are not directly involved in the establishment of the blockchain subnet, but need to be generated by the node device for deploying the blockchain nodes belonging to subnet0, and the blockchain nodes belonging to the blockchain subnet are involved in the establishment of the blockchain subnet. Among them, the blockchain nodes belonging to the blockchain subnet and a certain blockchain node belonging to subnet0 correspond to the same node member, such as the same alliance chain member in the alliance chain scenario, so that the node member can participate in the transactions of subnet0 and the blockchain subnet respectively; in addition, since subnet0 and the blockchain subnet belong to two independent blockchain systems, the blocks generated by the blockchain nodes belonging to subnet0 and the blocks generated by the blockchain nodes belonging to the blockchain subnet are respectively stored in different storages (such as databases) on the node device, which realizes the mutual isolation between the storages used by the blockchain nodes belonging to subnet0 and the blockchain nodes belonging to the blockchain subnet, so that the data generated by the blockchain subnet is only synchronized between the blockchain nodes in the blockchain subnet, so that only the node members participating in the blockchain mainnet cannot obtain the data generated on the blockchain subnet, realizing the data isolation between the blockchain mainnet and the blockchain subnet, and meeting the transaction demand between part of the node members (i.e. the node members participating in the blockchain subnet). Therefore, subnet1 and subnet2 can correspond to the first blockchain system and the second blockchain system described above; the node members / node devices to which the blockchain nodes in subnet1 and the blockchain nodes in subnet2 belong are respectively the node members / node devices to which the blockchain nodes in the blockchain mainnet subnet0 belong, so that subnet1 and subnet2 satisfy a strong trust relationship, and in the process of cross-chain interaction between subnet1 and subnet2, it is not necessary to pay attention to whether there is a malicious node in subnet1 and subnet2, but only to whether there is a faulty node in subnet1 and subnet2.

[0047] The process in which subnet1 obtains and sends a cross-chain request to subnet2 is described below.

[0048] Referring to Figure 4 As shown in the figure, the first blockchain node can sign the target cross-chain event event AB in the Signature Message layer (message signature layer) by calling the AM message component to authenticate the identity of the first blockchain node. Among them, the node_id field is used to store the node identifier of the first blockchain node, the msg field is used to store or indicate the target cross-chain event event AB, and the sign field is used to store the signature data of the msg field by the first blockchain node using its own node private key.

[0049] The first blockchain node can encrypt the data obtained by the Signature Message layer in the Envelope Message layer (message envelope layer) by calling the Envelope message component in the form of a digital envelope. Specifically, the first blockchain node can randomly generate a symmetric key K used by itself, and then encrypt the contents of the node_id field, msg field and sign field using the symmetric key K and store them in the encry_data field. At the same time, the Subnet system contract deployed in the blockchain main network subnet0 maintains the node public keys of the blockchain nodes in each blockchain subnet. Therefore, the first blockchain node can query the node public keys of at least F+1 blockchain nodes in subnet2 in the Subnet system contract through the identifier of subnet2, and then encrypt the symmetric key K used by itself using at least F+1 node public keys to obtain at least F+1 ciphertext form symmetric keys en_key1, en_key2, en_key3, etc., and store them in the encryped_key field.

[0050] The first blockchain node can encapsulate the data obtained by the Envelope Message layer into a cross-chain request in the P2P Message layer (communication layer) by calling the P2P message component. Specifically, the contents of the encryped_key field and the encry_data field are stored in the data field. At the same time, the cross-chain request also contains the following fields:

[0051] src_id: identifier of subnet1;

[0052] dest_id: identifier of subnet2;

[0053] msg_type: request type identifier of the cross-chain request.

[0054] At the same time, the Subnet system contract deployed in the blockchain main network subnet0 maintains the address information such as IP addresses and port numbers of the subnet nodes in each blockchain subnet. Therefore, the first blockchain node can query the address information of the aforementioned at least F+1 blockchain nodes in subnet2 in the Subnet system contract through the identifier of subnet2, so as to send the cross-chain request to the aforementioned at least F+1 blockchain nodes in subnet2 according to the address information after generating the cross-chain request.

[0055] Any blockchain node Node j in the second blockchain system receiving the cross-chain request can respond to the cross-chain request. For example, Node j can extract the relevant information included in the parameter field args and the method field method from the target cross-chain event event AB included or indicated by the cross-chain request, obtain the response result corresponding to the target cross-chain event event AB / cross-chain request based on the method indicated by the method field method corresponding to the information included in the parameter field args, and the response result includes, for example, the business data expected to be queried and used to support the first blockchain system to execute the related business.

[0056] For example, Node j in subnet2 also processes the received cross-chain request in the above layers in turn. Node j decrypts each ciphertext form of the symmetric key stored in the encryped_key field using its own node private key, can successfully decrypt the symmetric key encrypted using the node public key of Node j, and then decrypts the data stored in the encry_data field using the successfully decrypted symmetric key to obtain the relevant content of the node_id field, the msg field and the sign field. At this time, the validity of the first blockchain node and the validity of the signature can be verified. For example, the node identifier and the node public key of each blockchain node in subnet1 can be queried from the subnet system contract based on the src_id of the cross-chain request. Then, it is determined whether the queried node identifier contains the node identifier stored in the node_id field. When the queried node identifier contains the node identifier stored in the node_id field, it is determined that the validity verification of the first blockchain node passes. Then, the signature stored in the sign field is verified using the node public key corresponding to the node identifier stored in the node_id field, so that the signature verification of the first blockchain node passes when the verification passes. After verifying the validity of the first blockchain node and the validity of the signature, the content stored in the msg field can be read for response. For example, the corresponding operation is performed according to the indication of the method field and the content stored in the args field, the business data required by the smart contract C to be executed is read, and then the response result including the business data is returned to the first blockchain node. The process of Node j returning the response result to the first blockchain node is similar to the process of the first blockchain node sending the cross-chain request to Node j, which will not be described here.

[0057] Correspondingly, the first blockchain node sending the cross-chain request in the first blockchain system can correspondingly execute step S209 to receive the response result corresponding to the cross-chain request from the second blockchain node in the second blockchain system.

[0058] The second blockchain node refers to any blockchain node in the second blockchain system that receives and responds to the cross-chain request.

[0059] In addition to the business data for supporting the first blockchain system to perform the related business, the response result can further include other auxiliary information, such as including part or all of the information in the target cross-chain event event AB. In addition, referring to the foregoing, the first blockchain node can further receive, from the second blockchain node, a signature of the response result by the second blockchain node, and the first blockchain node can continue to perform subsequent processing using the response result from the second blockchain node only when the signature is verified.

[0060] Then, in step S211, a callback transaction corresponding to the target cross-chain event is generated according to the response result, and the callback transaction is used to call the smart contract deployed in the first blockchain system. Wherein, for the callback transaction (denoted as TxA2) generated by the first blockchain node, the smart contract requested to be called is, for example, the smart contract C described in the foregoing.

[0061] After the first blockchain node generates the callback transaction TxA2 corresponding to the target cross-chain event event AB, it means that the first blockchain node completes the processing of the target cross-chain event event AB. That is, as can be understood from the foregoing, the foregoing step S205 can also be executed after the first blockchain node completes the execution of step S211.

[0062] After the first blockchain system obtains the callback transaction TxA2 that calls the smart contract C, it needs to complete the related business by performing consensus and execution on the callback transaction TxA2. However, if there is a blockchain node with a small processing delay in the first blockchain system that fails to start processing the target cross-chain event event AB in time, or in other words, a blockchain node with a small processing delay fails to complete processing the target cross-chain event event AB in time, it can cause at least two blockchain nodes in the first blockchain system to execute the processes shown in the foregoing steps S201 to S211, respectively, thereby causing at least two identical callback transactions TxA2 to be generated at different times in the first blockchain system. In view of the above problem, in order to avoid the first blockchain system repeatedly processing the same callback transaction corresponding to the target cross-chain event event AB, the first blockchain node can further execute the following steps S213 and S215 before the first blockchain system starts processing the callback transaction TxA2 generated by the first blockchain node.

[0063] In step S213, before consensus is performed on the callback transaction, it is determined whether the callback transaction has been processed according to the event identifier list and the event identifier included in the callback transaction.

[0064] If no, step S215 is performed to add the event identifier included in the callback transaction to the event identifier list.

[0065] In processing the callback transaction TxA2 generated by the first blockchain node, for example, before the first blockchain system reaches consensus on the callback transaction, the first blockchain node can query the event identifier list to determine whether the event identifier of the target cross-chain event event AB included in the callback transaction TxA2 generated by the first blockchain node is included in the event identifier list. If yes, it means that other blockchain nodes have completed processing of the target cross-chain event event AB, and it also means that the first blockchain system may have already processed the callback transaction TxA2. The first blockchain node can directly discard the callback transaction TxA2 generated by the first blockchain node. On the contrary, if the event identifier of the target cross-chain event event AB is not included in the event identifier list, it means that the first blockchain system has not processed the callback transaction TxA2. The first blockchain node can add the event identifier of the target cross-chain event event AB included in the callback transaction TxA2 to the event identifier list, and allow the first blockchain system to continue processing the callback transaction TxA2, for example, allow the first blockchain system to reach consensus on the callback transaction TxA2.

[0066] When a blockchain node with a small processing delay fails or has other problems, causing it to fail to start processing or complete processing of a cross-chain event in time, it will cause the entire first blockchain system to take a long time to complete processing of a single cross-chain event, affecting the performance of the first blockchain system. To ensure that the first blockchain system can complete processing of each cross-chain event relatively quickly, in the case where the processing delays of the plurality of blockchain nodes included in the first blockchain system are configured to increase by a predetermined time T in the order of arrangement of the plurality of blockchain nodes, any first blockchain node that is not arranged in the first position among the plurality of blockchain nodes included in the first blockchain system can also update its configured processing delay according to a corresponding strategy.

[0067] Figure 5 A flowchart of a method for a blockchain node to update its configured processing delay is provided in an embodiment of the present specification. The method can be performed by any first blockchain node that is not arranged in the first position among the plurality of blockchain nodes included in the first blockchain system.

[0068] Referring to Figure 5 The method can include, but is not limited to, some or all of the following steps S501-S503.

[0069] In step S501, after the first blockchain node obtains the target cross-chain event, it determines whether it has received the indication information corresponding to the target cross-chain event within a predetermined time.

[0070] If no, continue to perform the following step S503 to determine whether the processing of the target cross-chain event by a plurality of blockchain nodes arranged before the first blockchain node is abnormal.

[0071] Then, in step S505, in the case that the processing of a preset number of cross-chain events successively obtained by the first blockchain node is abnormal in the plurality of blockchain nodes, the processing delay configured in the first blockchain node is decremented according to a predetermined time length.

[0072] Based on the same concept as the foregoing method embodiment, the first blockchain node in the embodiment of the present specification also belongs to a plurality of blockchain nodes 600 included in the first blockchain system, and the plurality of blockchain nodes 600 are configured with different processing delays for cross-chain events. Referring to Figure 6 As shown in the figure, the first blockchain node includes: a transaction determination unit 601, configured to determine whether a target cross-chain event obtained by the first blockchain node needs to be processed according to a processing delay configured in the first blockchain node; a transaction processing unit 603, configured to generate a cross-chain request according to the target cross-chain event in the case that the target cross-chain event needs to be processed; a communication processing unit 605, configured to send indication information corresponding to the target cross-chain event to the remaining blockchain nodes in the first blockchain system, for instructing the blockchain nodes receiving the indication information not to process the target cross-chain event; and the communication processing unit 605 is further configured to send the cross-chain request to a second blockchain system.

[0073] In a possible implementation, the communication processing unit 605 is configured to send the cross-chain request to at least F+1 blockchain nodes in the second blockchain system, where F is the maximum number of faulty nodes allowed by the second blockchain system.

[0074] In a possible implementation, the communication processing unit 605 is further configured to receive a response result corresponding to the cross-chain request from a second blockchain node in the second blockchain system; and the first blockchain node further includes a transaction generation unit 607, configured to generate a callback transaction according to the response result, where the callback transaction is used to invoke a smart contract deployed in the first blockchain system.

[0075] In a possible implementation, the callback transaction includes an event identifier of the target cross-chain event; and the first blockchain node further includes a transaction filtering unit 609, configured to determine whether the callback transaction has been processed according to an event identifier list and the event identifier included in the callback transaction before consensus of the callback transaction.

[0076] In a possible implementation, the processing delay of the plurality of blockchain nodes is configured to increase by a predetermined time length in the arrangement order of the plurality of blockchain nodes; and the transaction determination unit 603 is specifically configured to, after the first blockchain node obtains a target cross-chain event, determine whether the indication information corresponding to the target cross-chain event is received within the processing delay configured for the first blockchain node, and if not, determine that the target cross-chain event needs to be processed.

[0077] In a possible implementation, the first blockchain node further includes an exception processing unit 611 configured to, after the first blockchain node obtains a target cross-chain event, determine whether the indication information corresponding to the target cross-chain event is received within the predetermined time length, and if not, determine that the processing of the target cross-chain event by a plurality of blockchain nodes arranged before the first blockchain node is abnormal; and a delay updating unit 613 configured to, in a case where the processing of a preset number of cross-chain events obtained by the first blockchain node in succession is abnormal, decrease the processing delay configured in the first blockchain node according to the predetermined time length.

[0078] In a possible implementation, the first blockchain system is a first subnetwork managed by a target blockchain system, and the node device on which the blockchain node belonging to the first blockchain system is deployed is also deployed with a blockchain node belonging to the target blockchain system.

[0079] In a possible implementation, the second blockchain system is a second subnetwork managed by a target blockchain system, and the node device on which the blockchain node belonging to the second blockchain system is deployed is also deployed with a blockchain node belonging to the target blockchain system.

[0080] The embodiments of the present specification also provide a computer readable storage medium having computer programs / instructions stored thereon, which, when executed in a computer, cause the computer to perform the method described in each of the foregoing embodiments.

[0081] The embodiments of the present specification also provide a computing device including a memory and a processor, the memory having executable codes stored therein, and the processor, when executing the executable codes, implements the method described in each of the foregoing embodiments.

[0082] In the 1990s, it was quite obvious to distinguish whether an improvement in a technology was in hardware (e.g., improvement in circuit structures of diodes, transistors, switches, etc.) or in software (improvement in method flow). However, as technology has evolved, many improvements in method flow today can be considered as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structures by programming the improved method flow into hardware circuits. Therefore, it cannot be said that an improvement in a method flow cannot be implemented by hardware entity modules. For example, a programmable logic device (PLD) (e.g., a field programmable gate array (FPGA)) is an integrated circuit whose logic function is determined by user programming of the device. A digital system is "integrated" on a PLD by the designer programming it, rather than by asking a chip manufacturer to design and fabricate a custom integrated circuit chip. Moreover, instead of manually fabricating integrated circuit chips, this programming is now mostly implemented by "logic compiler" software, which is similar to software compilers used in program development, and the original code to be compiled is written in a specific programming language, which is called a hardware description language (HDL), and there are many such languages, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., and the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should be aware that, as long as the method flow is logically programmed in the above-mentioned hardware description languages and programmed into an integrated circuit, a hardware circuit implementing the logical method flow can be easily obtained.

[0083] The controller can be implemented in any suitable way, for example, the controller can take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code, such as 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 can also be implemented as part of the control logic of the memory. The skilled person will also appreciate that, in addition to implementing the controller in pure computer readable program code, it is possible to implement the controller in the form of logic gates, switches, an application specific integrated circuit, a programmable logic controller and an embedded microcontroller, etc. to perform the same functions by logically programming the method steps. Such a controller can therefore be considered to be a hardware component, and the means included therein to perform the various functions can also be considered to be structures within the hardware component. Alternatively, or even additionally, the means to perform the various functions can be considered to be both a software module implementing the method and a structure within a hardware component.

[0084] The systems, apparatuses, modules or units illustrated by the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, the present application does not exclude that with the development of computer technology in the future, computers implementing the functions of the above embodiments can be personal computers, laptop computers, vehicle human-computer interaction devices, cellular phones, camera phones, smart phones, personal digital assistants, media players, navigation devices, electronic mail devices, game consoles, tablet computers, wearable devices, or combinations of any of these devices.

[0085] Although the method operations of the embodiments of the present disclosure are described in a particular, sequential order, one or more of the method operations can be omitted, or the method operations can be performed in an order other than the described order. Additionally, one or more of the method operations can be performed concurrently, or with partial concurrence. Furthermore, one or more of the method operations can be performed by different entities, or over different time periods. The term "including" as used herein is intended to mean "comprising," such that the process, method, article, or apparatus that includes elements in addition to those specified. As used in this description, the term "coupled" means a direct or indirect connection, which can be physical or logical. The term "coupled" does not relate to a direct connection or wiring.

[0086] For the sake of description, the above-described apparatus is described as various modules to describe the functions of the apparatus. Of course, when implementing one or more embodiments of the present disclosure, the functions of the modules can be implemented in one or more software and / or hardware, or the modules implementing the same functions can be combined into a plurality of sub-modules or sub-units. The apparatus embodiments described above are merely illustrative, for example, the division of the units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.

[0087] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, apparatus (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each flow and / or block in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The term "means for" can include the one or more apparatuses or one or more components of the apparatuses with the specified functions of the one or more flows or the one or more blocks. Figure 1 The term "means for" can include the one or more apparatuses or one or more components of the apparatuses with the specified functions of the one or more flows or the one or more blocks.

[0088] These computer program instructions can 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 instructions which implement the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.

[0089] These computer program instructions can 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 Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.

[0090] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0091] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory. The memory is an example of computer-readable media.

[0092] Computer-readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules 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 disc (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 that can be used to store information accessible to computing devices. According to the definition herein, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.

[0093] Those skilled in the art will appreciate that the one or more embodiments described herein can be provided as a method, a system or a computer program product. Accordingly, the one or more embodiments described herein can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the one or more embodiments described herein can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer readable code.

[0094] The one or more embodiments described herein can 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. The one or more embodiments described herein can 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 can be located in both local and remote computer storage media including memory storage devices.

[0095] The various embodiments described in this specification are described in the context of progressive embodiments, with each embodiment building on the previous one. The same or similar parts between embodiments are cross-referenced as appropriate. Each embodiment focuses on the differences between that embodiment and the previous one. In particular, the system embodiments are described relatively simply, as they are substantially similar to the method embodiments. In the description of the specification, the use of the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" means that the particular feature, structure, material or characteristic being described is included in at least one embodiment or example of the specification. Illustrative descriptions of the above terms do not necessarily refer to the same embodiment or example in this specification. Moreover, the particular features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples. Furthermore, the skilled person can combine and combine the features of different embodiments or examples and characteristics of different embodiments or examples, without contradiction.

[0096] The above description merely provides examples of the one or more embodiments described in this specification and does not limit the one or more embodiments described in this specification. The one or more embodiments described in this specification can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the one or more embodiments described in this specification shall be included in the scope of the claims.

Claims

1. A cross-chain interaction method, performed by any first blockchain node of a plurality of blockchain nodes included in a first blockchain system, the plurality of blockchain nodes being configured with different processing delays for cross-chain events, the processing delays configured by the plurality of blockchain nodes being incremented by a predetermined time length in an arrangement order of the plurality of blockchain nodes, the method comprising: determining, after the first blockchain node obtains a target cross-chain event, whether indication information corresponding to the target cross-chain event is received within a processing delay configured for the first blockchain node, and determining that the target cross-chain event needs to be processed if the indication information is not received within the processing delay configured for the first blockchain node; generating a cross-chain request according to the target cross-chain event, if the target cross-chain event needs to be processed; sending indication information corresponding to the target cross-chain event to remaining blockchain nodes in the first blockchain system, for indicating that the blockchain nodes receiving the indication information do not need to process the target cross-chain event; and sending the cross-chain request to a second blockchain system.

8. The method of claim 7, further comprising: determining, before consensus is reached on the callback transaction, whether the callback transaction has been processed according to an event identifier list and the event identifier included in the callback transaction.

5. The method of claim 4, further comprising: determining, after the first blockchain node obtains a target cross-chain event, whether indication information corresponding to the target cross-chain event is received within the predetermined time length, and determining that processing of the target cross-chain event by a plurality of blockchain nodes arranged before the first blockchain node is abnormal if the indication information is not received within the predetermined time length; and decreasing the processing delay configured for the first blockchain node according to the predetermined time length, if processing of a preset number of cross-chain events obtained by the first blockchain node in succession is abnormal.

6. The method of claim 1, wherein: the first blockchain system is a first subnet managed by a target blockchain system, and node devices on which blockchain nodes belonging to the first blockchain system are deployed are also deployed with blockchain nodes belonging to the target blockchain system; and / or the second blockchain system is a second subnet managed by a target blockchain system, and node devices on which blockchain nodes belonging to the second blockchain system are deployed are also deployed with blockchain nodes belonging to the target blockchain system.

7. A first blockchain node, the first blockchain node belonging to a plurality of blockchain nodes included in a first blockchain system, the plurality of blockchain nodes being configured with different processing delays for cross-chain events, the processing delays configured by the plurality of blockchain nodes being incremented by a predetermined time length in an arrangement order of the plurality of blockchain nodes, the first blockchain node comprising:

2. The method of claim 1, the sending the cross-chain request to the second blockchain system comprising: ​ 3. The method of claim 1, further comprising: ​ 4. The method of claim 3, comprising an event identifier of the target cross-chain event in the callback transaction; wherein, ​ ​ ​ ​ ​ ​ ​ ​ The transaction determination unit is configured to determine whether the indication information corresponding to the target cross-chain event is received within a configured processing delay after the first blockchain node obtains the target cross-chain event, and determine that the target cross-chain event needs to be processed if the indication information is not received within the configured processing delay. The transaction processing unit is configured to generate a cross-chain request according to the target cross-chain event if the target cross-chain event needs to be processed. The communication processing unit is configured to send the indication information corresponding to the target cross-chain event to the remaining blockchain nodes in the first blockchain system, so as to instruct the blockchain nodes receiving the indication information not to process the target cross-chain event. The communication processing unit is further configured to send the cross-chain request to the second blockchain system.

8. The blockchain node of claim 7, wherein the communication processing unit is configured to send the cross-chain request to at least F+1 blockchain nodes in the second blockchain system, F being a maximum number of faulty nodes allowed by the second blockchain system.

9. The blockchain node of claim 7, wherein the communication processing unit is further configured to receive a response result corresponding to the cross-chain request from a second blockchain node in the second blockchain system. The first blockchain node further comprises a transaction generation unit configured to generate a callback transaction according to the response result, the callback transaction being configured to invoke a smart contract deployed in the first blockchain system.

10. The blockchain node of claim 9, wherein the callback transaction comprises an event identifier of the target cross-chain event, and the blockchain node further comprises a transaction filtering unit configured to determine whether the callback transaction has been processed according to an event identifier list and the event identifier comprised in the callback transaction before consensus of the callback transaction.

11. The blockchain node of claim 10, wherein the first blockchain node further comprises: an abnormality processing unit configured to determine whether the indication information corresponding to the target cross-chain event is received within the predetermined time length after the first blockchain node obtains the target cross-chain event, and determine that processing of the target cross-chain event by a plurality of blockchain nodes arranged before the first blockchain node is abnormal if the indication information is not received within the predetermined time length. a delay updating unit configured to decrease the processing delay configured in the first blockchain node according to the predetermined time length if processing of a preset number of cross-chain events obtained by the first blockchain node in succession is abnormal.

12. The blockchain node of claim 7, wherein: the first blockchain system is a first subnetwork managed by a target blockchain system, and the node device of the blockchain node belonging to the first blockchain system is deployed, and the node device of the blockchain node belonging to the target blockchain system is deployed; and / or the second blockchain system is a second subnetwork managed by a target blockchain system, and the node device of the blockchain node belonging to the second blockchain system is deployed, and the node device of the blockchain node belonging to the target blockchain system is deployed. ​ 13. A computer-readable storage medium having stored thereon a computer program, which, when executed in a computing device, causes the computing device to perform the method of any one of claims 1-6.

14. A computing device comprising a memory having stored therein executable code and a processor, which, when executing the executable code, implements the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Cross-chain interaction method and device

    CN114363335A