A method for parallel processing of cross-chain transactions in a multi-chain scenario
By grouping and processing transactions within the relay chain block in parallel, the problem of low verification efficiency of cross-chain transactions is solved, the execution efficiency and resource utilization of cross-chain transactions are improved, and the performance of the relay chain is enhanced.
Patent Information
- Application Number
- CN202310462897.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-04-26
AI Technical Summary
In multi-chain cross-chain scenarios under the relay chain architecture, the low efficiency of cross-chain transaction verification leads to a decline in relay chain performance. Especially in the case of frequent cross-chain transactions, the excessively long verification time becomes a bottleneck.
By grouping transactions within the relay chain block, unrelated transactions and cross-chain related transactions are executed separately and in parallel. Cross-chain transactions are also verified in groups, allowing cross-chain transactions without any intersection of cross-chain participants to be executed in parallel, thus ensuring the atomicity and consistency of cross-chain transactions.
It improves the execution efficiency and resource utilization of cross-chain transactions, reduces verification time, improves the performance of the relay chain, and provides a scalable performance foundation for the blockchain network.
Smart Images

Figure CN116501799B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the cross-chain neighborhood of relay architecture, and more particularly to a method for parallel processing of cross-chain transaction groups in a multi-chain scenario. Background Technology
[0002] Blockchain is a distributed ledger technology characterized by its trustworthy process and decentralization. It is mainly divided into permissioned and permissionless blockchains. Due to the immutability and global consensus characteristics of blockchain, communication between different blockchains is difficult. To overcome the problem of blockchain's closed nature, cross-chain technology has emerged.
[0003] In summary, most blockchain interoperability solutions in recent years are based on relay architectures, using third parties to address the issue of data silos within the blockchain. Currently, relay chain architectures enable interconnection between multiple chains, building a blockchain network that allows for asset exchange, data sharing, and contract calls between blockchains without excessively compromising the decentralized nature of the blockchain.
[0004] However, due to the characteristics of cross-chain technology, in multi-chain cross-chain scenarios under a relay chain architecture, verifying the existence, validity, and legality of cross-chain transactions becomes the most important and time-consuming part to ensure the security of participants. Because of the different underlying blockchain architectures, the relay chain needs to obtain the latest status of participants in real time to verify the existence of cross-chain transactions. This makes cross-chain transactions inefficient, and in scenarios with frequent cross-chain transactions, it can degrade the performance of the relay chain. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention proposes a method for parallel processing of cross-chain transactions in multi-chain scenarios. This invention is specifically implemented through the following technical solution:
[0006] A method for parallel processing of cross-chain transactions in a multi-chain scenario includes the following steps:
[0007] Step 1: After the relay chain block enters the execution module, the block transaction data within the relay chain block is obtained. Based on whether it is related to cross-chain, the block transaction data is divided into an unrelated transaction group and a cross-chain related transaction group. The unrelated transaction group and the cross-chain related transaction group are executed in parallel, while the transactions within the unrelated transaction group are executed serially.
[0008] Step 2: Divide cross-chain related transactions into ordinary transactions and cross-chain transactions according to transaction type, with each ordinary transaction forming a separate group; ordinary transactions and cross-chain transactions are executed serially;
[0009] Step 3: For multiple cross-chain transactions located between two ordinary transactions, check the intersection of their cross-chain participants. Cross-chain transactions with empty cross-chain participant intersections are grouped together. All cross-chain transactions within a group are executed in parallel during the verification information phase, while transactions between groups are executed serially.
[0010] Furthermore, in step three, the specific operation of grouping multiple cross-chain transactions located between two ordinary transactions is as follows:
[0011] In a multi-chain scenario, the cross-chain participants of each cross-chain transaction in ordinary transactions are taken to form a set, and intersection is determined from front to back according to the execution order until there are no cross-chain transactions.
[0012] If the intersection of the cross-chain participant sets of two adjacent cross-chain transactions is empty, then these two cross-chain transactions are grouped together, and the cross-chain participant sets of the two transactions are combined. This combined set is then combined with the cross-chain participant set of the next cross-chain transaction to find the intersection.
[0013] If the intersection of the cross-chain participant sets of two adjacent cross-chain transactions is not empty, the cross-chain transaction with the later execution order will be placed into a new transaction group, and the intersection of the cross-chain participant set of the cross-chain transaction with the cross-chain participant set of the next cross-chain transaction will continue to be found.
[0014] Furthermore, the ordinary transactions include cross-chain information management transactions and verification information management transactions.
[0015] Furthermore, after an application chain initiates a cross-chain related transaction, the contract packages the transaction, assigns its transaction type according to the transaction content, and carries corresponding verification information. The transaction types include: registration, invocation, freezing, and unfreezing. Among them, only the invocation type is a cross-chain transaction, while registration, freezing, and unfreezing are ordinary transactions. The data structures and information carried by unrelated transactions are different from those of cross-chain related transactions.
[0016] Furthermore, in step three, the verification information phase of the cross-chain transaction performs the following verification:
[0017] For cross-chain transactions that can be conducted in parallel, a verification information phase is performed simultaneously. This involves comparing the verification information provided by the cross-chain transaction participants with the corresponding verification information stored in the relay chain to verify whether the cross-chain participants have registered on the relay chain and are in a running state, as well as to verify whether the status of the cross-chain transaction initiator is consistent with the record in the relay chain.
[0018] Furthermore, the unrelated transactions need to be executed and then verified during the execution phase; the cross-chain related transactions need to be verified, executed, and then verified again during the execution phase; the verification after the execution of the unrelated transactions and the cross-chain related transactions is to ensure the consistency of the relay chain's state; while the verification before the execution of the cross-chain related transactions is to ensure the existence and validity of the cross-chain transactions.
[0019] The beneficial effects of this invention are as follows:
[0020] This invention is based on a multi-chain cross-chain scenario under a relay chain architecture. By grouping transactions within a relay chain block, it allows unrelated transactions and cross-chain related transactions to be executed in parallel. By grouping cross-chain related transactions, it allows cross-chain transactions without any intersection of cross-chain participants to be executed in parallel. While ensuring the atomicity and consistency of cross-chain transactions, it reduces the verification time of cross-chain transactions, improves the execution efficiency and resource utilization of cross-chain transactions, overcomes the bottleneck of long verification time for cross-chain transactions, improves the performance of the relay chain, and provides a scalable performance foundation for the development of blockchain networks. Attached Figure Description
[0021] Figure 1 This is a flowchart of the cross-chain transaction grouping parallel processing method in a multi-chain scenario according to the present invention. Detailed Implementation
[0022] The present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments. The objectives and effects of the present invention will become clearer as a result. The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0023] The cross-chain transaction grouping and parallel processing method in a multi-chain scenario specifically includes the following steps:
[0024] Step 1: After the relay chain block enters the execution module, it obtains the block transaction data, performs group preprocessing on the block transaction data, and divides the block transaction data into unrelated transaction group and cross-chain related transaction group according to whether it is related to cross-chain. The data structure and information carried by unrelated transactions and cross-chain related transactions are different; the unrelated transaction group and the cross-chain related transaction group are executed in parallel.
[0025] Compared to traditional blockchains, relay chains handle a larger proportion of cross-chain transactions. Therefore, relay chain transactions can be divided into two categories: First, native relay chain transactions, which are fewer in number and execute faster; these are grouped together as the unrelated transaction group. Second, cross-chain related transactions, which are more numerous and execute slower; these are grouped together as the cross-chain related transaction group. Both can be executed in parallel without causing ledger conflicts, thus improving block execution efficiency. Transactions within the unrelated transaction group are still executed serially, consistent with traditional blockchains, resulting in faster execution speeds.
[0026] Step Two: After the application chain initiates a cross-chain related transaction, the contract packages the transaction, assigns its transaction type based on the transaction content, and carries corresponding verification information. Transaction types include: registration, invocation, freezing, and unfreezing. Based on the transaction type, cross-chain related transactions are grouped into ordinary transactions and cross-chain transactions. Only invocation is a cross-chain transaction; registration, freezing, and unfreezing are ordinary transactions. Ordinary transactions include cross-chain information management transactions and verification information management transactions, with each ordinary transaction forming a separate group. Ordinary transactions and cross-chain transactions are executed sequentially.
[0027] There are many types of cross-chain related transactions on the relay chain. In multi-chain cross-chain scenarios, the relay chain needs to manage blockchain metadata and verification information, and perform cross-chain transaction verification and forwarding. Broadly speaking, cross-chain related transaction groups can be divided into two types: ordinary transactions and cross-chain transactions. Because ordinary transactions may change cross-chain information on the relay chain, their execution will alter the state of cross-chain participants, causing cross-chain transactions that could originally pass information verification to no longer be able to continue, such as chain freezing and chain deregistration. Therefore, each ordinary transaction is grouped separately, and ordinary transactions can only be executed serially.
[0028] Step 3: In a multi-chain cross-chain scenario with a relay architecture, it is crucial to strictly maintain the execution order of cross-chain transactions and ensure consistency among cross-chain participants. Due to the special nature of ordinary transactions, the verification results of cross-chain transactions can be altered. Therefore, cross-chain transactions before and after ordinary transactions do not meet the parallel condition; only cross-chain transactions between ordinary transactions can be processed in parallel. In a multi-chain scenario, for multiple cross-chain transactions located between two ordinary transactions, check the intersection of the cross-chain participants. Cross-chain transactions with an empty intersection are grouped together. The specific grouping method is as follows:
[0029] In a multi-chain scenario, the cross-chain participants of each cross-chain transaction in the ordinary transaction are taken to form a set, and intersection is determined from front to back according to the execution order until there are no cross-chain transactions.
[0030] If the intersection of the cross-chain participant sets of two adjacent cross-chain transactions is empty, the two cross-chain transactions can verify information in parallel and put them into the same group, which is called a subgroup; and the cross-chain participant sets of the two cross-chain transactions are combined into a union, and this union is then combined with the cross-chain participant set of the next cross-chain transaction to find the intersection.
[0031] If the intersection of the cross-chain participant sets of two adjacent cross-chain transactions is not empty, the cross-chain transaction with the later execution order will be placed into a new transaction group, and the intersection of the cross-chain participant set of the cross-chain transaction with the cross-chain participant set of the next cross-chain transaction will continue to be found.
[0032] For cross-chain transactions within subgroups, the verification information phase of cross-chain transactions can be executed in parallel. The parallel execution of cross-chain transaction verification information will not cause conflicts, and the parallel execution greatly increases the verification efficiency, thus improving the bottleneck of slow speed in the verification information phase of cross-chain transactions.
[0033] The verification information phase of cross-chain transactions performs the following verifications: For cross-chain transactions that can be performed in parallel, the verification information phase is performed synchronously, that is, the verification information provided by the cross-chain transaction participants is compared with the corresponding verification information stored in the relay chain to verify whether the cross-chain participants have been registered on the relay chain and are in a running state, and to verify whether the state of the cross-chain transaction initiator is consistent with the record in the relay chain.
[0034] Unrelated transactions need to be executed and then verified during the execution phase; cross-chain related transactions need to be verified, executed, and then verified again during the execution phase. The verification after the execution of unrelated transactions and cross-chain related transactions is to ensure the consistency of the relay chain's state, while the verification before the execution of cross-chain related transactions is to ensure the existence and validity of the cross-chain transactions.
[0035] like Figure 1 As shown, in practical applications, the method of the present invention sequentially judges the block transaction data within the relay chain block. The judgment process is as follows:
[0036] (1) Take a transaction Tx and determine whether the transaction data is an unrelated transaction. If it is, add it to the unrelated transaction group; if not, continue to determine whether the transaction data is a cross-chain related transaction. If it is, add it to the cross-chain related transaction group.
[0037] (2) Determine whether the transaction data is a normal transaction. If it is, add it to the newly created transaction group and record it as a separate group. If it is not, continue to determine whether the transaction data is a cross-chain transaction. If it is, take its cross-chain participant records as set B.
[0038] (3) Determine whether the transaction data that was previously added to the cross-chain related transaction group is a cross-chain transaction. If not, that is, the transaction data that was previously added to the cross-chain related transaction group is a normal transaction, then add the transaction data to the newly created transaction group. If so, then take the intersection of the cross-chain participant set A (if transaction Tx is the first transaction data, then set A is an empty set) of the group where the previous cross-chain transaction is located (i.e., the current group) and set B, and denote the result as set C.
[0039] (4) Determine whether set C is an empty set. If it is, add transaction Tx to the group where the previous cross-chain transaction is located, and the cross-chain participant set A of the group is A ∪ B. If not, add transaction Tx to the newly created transaction group, and denote set B as the cross-chain participant set A of the current group, i.e., A = B.
[0040] (5) Determine whether Tx is the last transaction. If yes, end the judgment and hand the obtained grouping result to the virtual machine for execution. If not, continue to take the next transaction and repeat steps (1) to (5).
[0041] It will be understood by those skilled in the art that the above descriptions are merely preferred examples of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art can still modify the technical solutions described in the foregoing examples or make equivalent substitutions for some of the technical features. All modifications and equivalent substitutions made within the spirit and principles of the invention should be included within the scope of protection of the invention.
Claims
1. A method for parallel processing of cross-chain transactions in a multi-chain scenario, characterized in that, Specifically, the steps include the following: Step 1: After the relay chain block enters the execution module, it obtains the block transaction data within the relay chain block and divides the block transaction data into unrelated transaction groups and cross-chain related transaction groups based on whether they are related to cross-chain. The unrelated transaction group and the cross-chain related transaction group are executed in parallel, while the transactions within the unrelated transaction group are executed serially. Step 2: Divide cross-chain related transactions into ordinary transactions and cross-chain transactions according to transaction type, with each ordinary transaction forming a separate group; ordinary transactions and cross-chain transactions are executed serially; Step 3: For multiple cross-chain transactions located between two ordinary transactions, check the intersection of their cross-chain participants. Cross-chain transactions with empty cross-chain participant intersections are grouped together. All cross-chain transactions within a group are executed in parallel during the verification information phase, while transactions between groups are executed serially.
2. The method for cross-chain transaction grouping and parallel processing in a multi-chain scenario according to claim 1, characterized in that, In step three, the specific operation of grouping multiple cross-chain transactions located between two ordinary transactions is as follows: In a multi-chain scenario, the cross-chain participants of each cross-chain transaction in ordinary transactions are taken to form a set, and intersection is determined from front to back according to the execution order until there are no cross-chain transactions. If the intersection of the cross-chain participant sets of two adjacent cross-chain transactions is empty, then these two cross-chain transactions are grouped together, and the cross-chain participant sets of the two transactions are combined. This combined set is then combined with the cross-chain participant set of the next cross-chain transaction to find the intersection. If the intersection of the cross-chain participant sets of two adjacent cross-chain transactions is not empty, the cross-chain transaction with the later execution order will be placed into a new transaction group, and the intersection of the cross-chain participant set of the cross-chain transaction with the cross-chain participant set of the next cross-chain transaction will continue to be found.
3. The method for cross-chain transaction grouping and parallel processing in a multi-chain scenario according to claim 1, characterized in that, The ordinary transactions include cross-chain information management transactions and verification information management transactions.
4. The method for cross-chain transaction grouping and parallel processing in a multi-chain scenario according to claim 1, characterized in that, After an application chain initiates a cross-chain related transaction, the contract packages the transaction, assigns its transaction type according to the transaction content, and carries the corresponding verification information. The transaction types include: registration, invocation, freezing, and unfreezing. Among them, only the invocation type is a cross-chain transaction, while registration, freezing, and unfreezing are ordinary transactions. The data structures and information carried by unrelated transactions are different from those of cross-chain related transactions.
5. The method for cross-chain transaction grouping and parallel processing in a multi-chain scenario according to claim 1, characterized in that, In step three, the verification information phase of cross-chain transactions performs the following verification: For cross-chain transactions that can be conducted in parallel, a verification information phase is performed simultaneously. This involves comparing the verification information provided by the cross-chain transaction participants with the corresponding verification information stored in the relay chain to verify whether the cross-chain participants have registered on the relay chain and are in a running state, as well as to verify whether the status of the cross-chain transaction initiator is consistent with the record in the relay chain.
6. The method for cross-chain transaction grouping and parallel processing in a multi-chain scenario according to claim 1, characterized in that, The unrelated transactions need to be executed and then verified during the execution phase; the cross-chain related transactions need to be verified, executed, and then verified again during the execution phase; the verification after the execution of the unrelated transactions and the cross-chain related transactions is to ensure the consistency of the relay chain's state; while the verification before the execution of the cross-chain related transactions is to ensure the existence and validity of the cross-chain transactions.
Citation Information
Patent Citations
DAG-based cross-chain interaction method and system for block chain
CN110941647A
UTXO-based cross-chain transaction and verification method and system
CN113760909A