Relay chain cross-chain asynchronous consensus method, readable storage medium and equipment

By determining the optimal cross-chain transaction matching solution in the relay chain, and sending batch transaction packets to the asynchronous consensus node group for asynchronous consensus processing, the problems of transaction duplication and processing delay in the existing asynchronous consensus mechanism are solved, and more efficient transaction processing and system stability are achieved.

CN119602928APending Publication Date: 2025-03-11NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411678633.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The asynchronous consensus mechanism of the existing relay chain is prone to transaction duplication when processing cross-chain transactions, resulting in increased load on asynchronous consensus nodes and delayed transaction processing.

Method used

By obtaining the transaction broadcasting performance of the batch transaction package and asynchronous consensus node group corresponding to the target cross-chain transaction, we determine the optimal cross-chain transaction matching solution that enables the asynchronous consensus node group to process the batch transaction package the fastest, and send the batch transaction package to the asynchronous consensus node group for asynchronous consensus processing.

Benefits of technology

It effectively reduces the load of the asynchronous consensus node group, improves the processing speed of the asynchronous consensus nodes on transaction packets, avoids transaction duplication, and improves the stability and efficiency of the overall system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119602928A_ABST
    Figure CN119602928A_ABST
Patent Text Reader

Abstract

The invention discloses a relay chain cross-chain asynchronous consensus method, a readable storage medium and equipment. The relay chain cross-chain asynchronous consensus method comprises the following steps: acquiring a batch transaction packet corresponding to a target cross-chain transaction and transaction broadcast performance of an asynchronous consensus node group; based on the size of the batch transaction packet and the transaction broadcast performance of the asynchronous consensus node group, determining an optimal cross-chain transaction matching scheme which enables the asynchronous consensus node group to process the batch transaction packet at the fastest speed; and according to the optimal cross-chain transaction matching scheme, sending the batch transaction packets to an asynchronous consensus node group for asynchronous consensus processing. According to the method, the optimal cross-chain transaction matching scheme which enables the asynchronous consensus node group to process the batch transaction packets at the fastest speed is determined by using the batch transaction packets corresponding to the target cross-chain transaction and the transaction broadcast performance of the asynchronous consensus node group; and according to the optimal cross-chain transaction matching scheme, the batch transaction packets corresponding to the target cross-chain transaction are sent to the asynchronous consensus node group for asynchronous consensus processing, so that the load of the asynchronous consensus node group is greatly reduced, and the transaction packet processing speed of the asynchronous consensus node is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a relay chain cross-chain asynchronous consensus method, a readable storage medium and a device, and belongs to the technical field of relay chains. Background Art

[0002] As a distributed ledger technology that realizes decentralized, secure, and trusted data storage and transactions, blockchain technology has made remarkable achievements in many years of development and promoted the solution of trust and security issues in cyberspace. However, due to the high heterogeneity between different blockchains, the interoperability problem between blockchains faces significant challenges. In order to solve the value island problem caused by a single chain, cross-chain technology came into being. Relay chain technology is a technology that uses a third-party blockchain to establish connections between different blockchains and realizes cross-chain interaction through a cross-chain messaging protocol. In order to ensure the security and stability of the relay chain and ensure the consistency and reliability between the connected sub-chains, the relay chain must adopt a suitable consensus mechanism to achieve these goals.

[0003] At present, most relay chains adopt a partially synchronous consensus mechanism. However, as the scale of the blockchain ecosystem expands, the consensus burden between different blockchains continues to increase, which may make it difficult for consensus nodes to achieve global consistency, limit the number of application chains that the relay chain can connect to, and ultimately affect the overall stability of the cross-chain system. In contrast, the asynchronous consensus mechanism has advantages in dealing with arbitrary transmission delays and network uncertainties between nodes, and can more flexibly adapt to changes in network conditions, improve the fault tolerance and stability of the entire relay chain cross-chain system, but the existing mainstream asynchronous consensus mechanisms all adopt the traditional distributed system to send transactions. The client needs to send all transactions with consensus requirements to the respective transaction buffers of all consensus nodes, and all asynchronous consensus nodes need to randomly extract and concurrently process batch transactions, which leads to the occurrence of transaction duplication. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a relay chain cross-chain asynchronous consensus method, a readable storage medium and a device, which have the effect of balancing the load of asynchronous consensus nodes broadcasting cross-chain transactions and improving the transaction processing speed, and solve the problem that transaction duplication occurs in the existing asynchronous consensus mechanism, resulting in increased load on asynchronous consensus nodes and delayed transaction processing.

[0005] In order to achieve the above purpose / solve the above technical problems, the present invention is implemented by adopting the following technical solutions: On one hand, the present invention provides a relay chain cross-chain asynchronous consensus method, including: Obtain the batch transaction package corresponding to the target cross-chain transaction and the transaction broadcast performance of the asynchronous consensus node group; Based on the batch transaction package size and the transaction broadcast performance of the asynchronous consensus node group, determine the optimal cross-chain transaction matching solution that enables the asynchronous consensus node group to process batch transaction packages the fastest; According to the optimal cross-chain transaction matching solution, batch transaction packages are sent to the asynchronous consensus node group for asynchronous consensus processing.

[0006] Furthermore, the optimal cross-chain transaction matching scheme that enables the asynchronous consensus node group to process the batch transaction package at the fastest speed based on the batch transaction package size and the transaction broadcast performance of the asynchronous consensus node group is determined, including: Constructing a mapping matrix between batch transaction packages and asynchronous consensus node groups in multiple rounds of asynchronous consensus : ; in: Elements in Represents an asynchronous consensus node j In the i The transaction package number corresponding to the round of asynchronous consensus, and each element No duplication; , Indicates any i , Indicates any j , K Indicates the number of batch transaction packages, Represents the total number of rounds of asynchronous consensus, Indicates the number of asynchronous consensus nodes in the asynchronous consensus node group. In the asynchronous consensus process, nodes with the same consensus round are assigned in sequence. N The transaction package is submitted to the asynchronous consensus node group for consensus; Constructing the expected time matrix of asynchronous consensus node groups in broadcasting batch transaction packages : ; in: Representing the transaction broadcast performance matrix of the asynchronous consensus node group:

[0007] Represents an asynchronous consensus node j The speed of broadcasting transaction packages of corresponding rounds during multiple rounds of asynchronous consensus; , Represents an asynchronous consensus node j exist q Broadcast during asynchronous consensus q The speed of transaction packets, Represents an asynchronous consensus node j Broadcast transaction packagez The size of Represents an asynchronous consensus node j Broadcast transaction package z the time spent; Represents the relationship matrix corresponding to the batch transaction package size: ; in: Indicates the size of transaction package z, represents transpose; Constructing the expected execution time matrix of transaction broadcasting of batch transaction packages in multiple rounds of asynchronous consensus : ; in: Indicates that the asynchronous consensus round is m The expected completion time of broadcast transactions in the asynchronous consensus process, , Represents an asynchronous consensus node j The first transaction in the batch buffer m The size of the transaction packet; Matrix-based ,matrix and matrix , determine the optimization goal of forming the best relationship mapping matrix between batch transaction packages and asynchronous consensus node groups in multiple rounds of asynchronous consensus; According to the optimization goal, determine the optimal cross-chain transaction matching solution that enables the asynchronous consensus node group to process batch transaction packages the fastest.

[0008] Furthermore, the matrix-based ,matrix and matrix , determine the optimization goal of forming the best relationship mapping matrix between batch transaction packages and asynchronous consensus node groups in multiple rounds of asynchronous consensus, including: Matrix-based and matrix , determine the first optimization goal of making asynchronous consensus nodes with fast broadcast speed process more transaction packets :

[0009] in: express K Cross-chain transaction packages are in l In the asynchronous consensus N The expected time matrix required for asynchronous consensus nodes to broadcast; ; Indicates the number uij The transaction package is in i In the round of asynchronous consensus, the node j the expected time required for the broadcast; Matrix-based , determine the second optimization goal of balancing the time it takes each asynchronous consensus node to broadcast transaction packets during each round of asynchronous consensus :

[0010] in: Representation Matrix The elements in Represents the total number of rounds of asynchronous consensus, c Indicates c Round of asynchronous consensus.

[0011] Furthermore, according to the optimal cross-chain transaction matching scheme, the batch transaction packages are sent to the asynchronous consensus node group for asynchronous consensus processing, including: Calculate the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packages; Based on the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packages, high-quality nodes that meet the quantity requirements are selected from the asynchronous consensus node group to form a high-quality node set; Obtain high-quality proposal vectors generated by a high-quality node set based on batch transaction packages; An asynchronous binary consensus protocol is executed based on the proposal vectors of high-quality nodes.

[0012] Furthermore, the calculation of the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packets includes: The communication delay of the asynchronous consensus node group in processing batch transaction packages is calculated by the following formula: ; in: Represents an asynchronous consensus node With asynchronous consensus nodes Communication delay between Represents an asynchronous consensus node i The moment the message was sent; Represents an asynchronous consensus node j The moment the message is received; The consensus delay of the asynchronous consensus node group in processing batch transaction packages is calculated by the following formula:

[0013] in: Represents an asynchronous consensus node jConsensus delay during asynchronous consensus of target round; Represents an asynchronous consensus node j Complete i The latency of the asynchronous consensus round, n Indicates a total of n Round asynchronous consensus; The consensus accuracy of the asynchronous consensus node group in processing batch transaction packages is calculated by the following formula:

[0014] in: Represents an asynchronous consensus node j Accuracy in asynchronous consensus; Represents an asynchronous consensus node j The number of correct values ​​input into the asynchronous binary consensus protocol in the target round of asynchronous consensus.

[0015] Furthermore, based on the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packets, high-quality nodes that meet the quantity requirements are selected from the asynchronous consensus node group to form a high-quality node set, including: Based on the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packages, high-quality node selection conditions are established; According to the high-quality node selection conditions, high-quality nodes that meet the quantity requirements are selected from the asynchronous consensus node group to form a high-quality node set.

[0016] Furthermore, the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packets are used to construct high-quality node selection conditions, including: Based on the communication delay of the asynchronous consensus node group in processing batch transaction packages, the average communication delay between the candidate high-quality node and other asynchronous consensus nodes is calculated; The average communication delay between the candidate high-quality node and other asynchronous consensus nodes is calculated by the following formula:

[0017] in: Represents the average communication delay between the selected high-quality node and other asynchronous consensus nodes; Indicates the high-quality nodes to be selected j With other asynchronous consensus nodes in the asynchronous consensus node group z Communication delay; S Represents a queue of high-quality nodes to be selected. X Represents an asynchronous consensus node group, Indicates the number of high-quality nodes to be selected, Indicates the number of asynchronous consensus nodes in the asynchronous consensus node group; Based on the consensus delay of the asynchronous consensus node group in processing batch transaction packages, the average consensus delay of the candidate high-quality nodes and other asynchronous consensus nodes is calculated; The average consensus delay between the candidate high-quality nodes and other asynchronous consensus nodes is calculated using the following formula:

[0018] in: Represents the average consensus delay between the candidate high-quality nodes and other asynchronous consensus nodes; Indicates the high-quality nodes to be selected j Consensus delay during asynchronous consensus of target round; Based on the consensus accuracy of the asynchronous consensus node group in processing batch transaction packages, calculate the average accuracy of the high-quality nodes to be selected; The average accuracy of the selected high-quality nodes is calculated by the following formula:

[0019] in: Represents the average accuracy of the high-quality nodes to be selected; Indicates the high-quality nodes to be selected j Accuracy in asynchronous consensus; Constructing high-quality node selection conditions according to the average communication delay, the average consensus delay, and the average consensus accuracy; The high-quality node selection condition is constructed by the following formula: ; in: Represents the set of all high-quality nodes to be selected that meet the high-quality node selection conditions; f Indicates the number of malicious nodes.

[0020] Furthermore, the step of obtaining a high-quality proposal vector generated by a high-quality node set based on a batch transaction package includes: Generate multiple consensus proposals based on batch transaction packages; Select a high-quality node from the high-quality node set, input multiple consensus proposals into the PB protocol and broadcast them to other high-quality nodes; Collect valid signatures of other high-quality nodes that meet the quantity requirements for the consensus proposal; Generate a threshold signature based on the collected valid signatures; According to the threshold signature, a high-quality proposal vector is obtained.

[0021] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the relay chain cross-chain asynchronous consensus method as described above is implemented.

[0022] The present invention also provides a computer device, comprising: A memory for storing instructions; A processor is used to execute the instructions so that the device implements the relay chain cross-chain asynchronous consensus method as described above.

[0023] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention utilizes the batch transaction packages corresponding to the target cross-chain transactions and the transaction broadcasting performance of the asynchronous consensus node group to determine the optimal cross-chain transaction matching scheme that enables the asynchronous consensus node group to process the batch transaction packages at the fastest speed, and sends the batch transaction packages corresponding to the target cross-chain transactions to the asynchronous consensus node group for asynchronous consensus processing according to the optimal cross-chain transaction matching scheme, which greatly reduces the load of the asynchronous consensus node group, improves the processing speed of the asynchronous consensus node for the transaction packages, and solves the problem that transaction duplication occurs in the existing asynchronous consensus mechanism, resulting in increased load on the asynchronous consensus node and delayed transaction processing.

[0024] 2. In the process of determining the optimal cross-chain transaction matching solution, the present invention uses the matrix ,matrix and matrix , determine the optimization goal of forming the best relationship mapping matrix between batch transaction packages and asynchronous consensus node groups in multiple rounds of asynchronous consensus. Through the optimization goal, when the asynchronous consensus node group processes the transaction packages sent through the optimal cross-chain transaction matching scheme, the nodes with fast broadcasting speed can process more transaction packages and all asynchronous consensus nodes can broadcast transaction packages more evenly in each round of asynchronous consensus. While reducing the load of some asynchronous consensus nodes, the transaction package processing speed is improved.

[0025] 3. Based on the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packages, the present invention selects high-quality nodes that meet the quantity requirements from the asynchronous consensus node group to form a high-quality node set, and improves the asynchronous consensus efficiency through the high-quality node set. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a flow chart of a relay chain cross-chain asynchronous consensus method according to an embodiment of the present invention; Figure 2 It is a flow chart of determining the optimal cross-chain transaction matching solution in a relay chain cross-chain asynchronous consensus method in an embodiment of the present invention; Figure 3 It is a line chart comparing transaction delays of a relay chain cross-chain asynchronous consensus method under different transaction batch sizes and different numbers of asynchronous nodes in an embodiment of the present invention; Figure 4This is a throughput comparison bar chart of a relay chain cross-chain asynchronous consensus method under different transaction batch sizes and different numbers of asynchronous nodes in an embodiment of the present invention; Figure 5 It is a line chart comparing transaction delays of a relay chain cross-chain asynchronous consensus method under different transaction batch sizes and different asynchronous consensus rounds in an embodiment of the present invention; Figure 6 It is a line chart comparing the throughput of a relay chain cross-chain asynchronous consensus method and an existing asynchronous consensus algorithm under 5 asynchronous consensus nodes and different transaction batch sizes in an embodiment of the present invention; Figure 7 It is a line chart comparing the throughput of a relay chain cross-chain asynchronous consensus method and an existing asynchronous consensus algorithm under 10 asynchronous consensus nodes and different transaction batch sizes in an embodiment of the present invention; Figure 8 It is a line chart comparing the throughput of a relay chain cross-chain asynchronous consensus method and an existing asynchronous consensus algorithm under 15 asynchronous consensus nodes and different transaction batch sizes in an embodiment of the present invention; Fig. 9 It is a line chart comparing the throughput of a relay chain cross-chain asynchronous consensus method and an existing asynchronous consensus algorithm under 20 asynchronous consensus nodes and different transaction batch sizes in an embodiment of the present invention; Fig.10 This is a peak throughput comparison bar chart of a relay chain cross-chain asynchronous consensus method and an existing asynchronous consensus algorithm under different numbers of asynchronous consensus nodes in an embodiment of the present invention; Fig.11 It is a basic delay comparison line chart of a relay chain cross-chain asynchronous consensus method and an existing asynchronous consensus algorithm under different numbers of asynchronous consensus nodes in an embodiment of the present invention; Fig.12 This is a throughput comparison bar chart of a relay chain cross-chain asynchronous consensus method according to an embodiment of the present invention and an existing asynchronous consensus algorithm under different malicious node ratios. DETAILED DESCRIPTION

[0027] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention. Example 1

[0028] like Figure 1 As shown, a relay chain cross-chain asynchronous consensus method includes: Obtain the batch transaction package corresponding to the target cross-chain transaction and the transaction broadcast performance of the asynchronous consensus node group; Based on the batch transaction package size and the transaction broadcast performance of the asynchronous consensus node group, determine the optimal cross-chain transaction matching solution that enables the asynchronous consensus node group to process batch transaction packages the fastest. Specifically: like Figure 2 As shown in Figure 1, the relationship mapping matrix between batch transaction packages and asynchronous consensus node groups in multiple rounds of asynchronous consensus is constructed. : in: Elements in Represents an asynchronous consensus node j In the i The transaction package number corresponding to the round of asynchronous consensus, and each element No duplication; , Indicates any i , Indicates any j , K Indicates the number of batch transaction packages, Indicates the round of asynchronous consensus, Indicates the number of asynchronous consensus nodes in the asynchronous consensus node group. In the asynchronous consensus process, nodes with the same consensus round are assigned in sequence. N The transaction package is submitted to the asynchronous consensus node group for consensus; Constructing the expected time matrix of asynchronous consensus node groups in broadcasting batch transaction packages : ; in: Representing the transaction broadcast performance matrix of the asynchronous consensus node group:

[0029] Represents an asynchronous consensus node j The speed of broadcasting transaction packages of corresponding rounds during multiple rounds of asynchronous consensus; , Represents an asynchronous consensus node j exist q Broadcast during asynchronous consensus q The speed of transaction packets, Represents an asynchronous consensus node j Broadcast transaction package z The size of Represents an asynchronous consensus node j Broadcast transaction package z the time spent; Represents the relationship matrix corresponding to the batch transaction package size: ; in: Indicates the size of transaction package z, represents transpose; Constructing the expected execution time matrix of transaction broadcasting of batch transaction packages in multiple rounds of asynchronous consensus : ; in: Indicates that the asynchronous consensus round is m The expected completion time of broadcast transactions in the asynchronous consensus process, , Represents an asynchronous consensus node j The first transaction in the batch buffer m The size of the transaction packet; Matrix-based ,matrix and matrix , determine the optimization goal of forming the best relationship mapping matrix between batch transaction packages and asynchronous consensus node groups in multiple rounds of asynchronous consensus, including: Matrix-based and matrix , determine the first optimization goal of making asynchronous consensus nodes with fast broadcast speed process more transaction packets :

[0030] in: express K Cross-chain transaction packages are in l In the asynchronous consensus N The expected time matrix required for asynchronous consensus nodes to broadcast, ; Indicates the number u ij The transaction package is in i In the round of asynchronous consensus, the node j the expected time required for the broadcast; Matrix-based , determine the second optimization goal of balancing the time it takes each asynchronous consensus node to broadcast transaction packets during each round of asynchronous consensus :

[0031] in: Representation Matrix The elements in Represents the total number of rounds of asynchronous consensus, c Indicates c Round asynchronous consensus; According to the first optimization goal and the second optimization goal , determine the optimal cross-chain transaction matching solution that enables the asynchronous consensus node group to process batch transaction packages the fastest.

[0032] According to the optimal cross-chain transaction matching solution, the batch transaction package is sent to the asynchronous consensus node group for asynchronous consensus processing. Specifically: Calculate the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packages, including: The communication delay of the asynchronous consensus node group in processing batch transaction packages is calculated by the following formula: ; in: Represents an asynchronous consensus node With asynchronous consensus nodes Communication delay between Represents an asynchronous consensus node i The moment the message was sent; Represents an asynchronous consensus node j The moment the message is received; The consensus delay of the asynchronous consensus node group in processing batch transaction packages is calculated by the following formula:

[0033] in: Represents an asynchronous consensus node j Consensus delay during asynchronous consensus of target round; Represents an asynchronous consensus node j Complete i The latency of the asynchronous consensus round, n Indicates a total of n Round asynchronous consensus; The consensus accuracy of the asynchronous consensus node group in processing batch transaction packages is calculated by the following formula:

[0034] in: Represents an asynchronous consensus node j Accuracy in asynchronous consensus; Represents an asynchronous consensus node j The number of correct values ​​entered into the asynchronous binary consensus protocol in the target round of asynchronous consensus; Based on the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packages, high-quality nodes that meet the quantity requirements are selected from the asynchronous consensus node group to form a high-quality node set, including: Based on the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packages, the high-quality node selection conditions are constructed, where: Based on the communication delay of the asynchronous consensus node group in processing batch transaction packages, the average communication delay between the candidate high-quality node and other asynchronous consensus nodes is calculated; The average communication delay between the candidate high-quality node and other asynchronous consensus nodes is calculated by the following formula:

[0035] Represents the average communication delay between the selected high-quality node and other asynchronous consensus nodes; Indicates the high-quality nodes to be selected j With other asynchronous consensus nodes in the asynchronous consensus node group z Communication delay; S Represents a queue of high-quality nodes to be selected. X Represents an asynchronous consensus node group, Indicates the number of high-quality nodes to be selected, Indicates the number of asynchronous consensus nodes in the asynchronous consensus node group; Based on the consensus delay of the asynchronous consensus node group in processing batch transaction packages, the average consensus delay of the candidate high-quality nodes and other asynchronous consensus nodes is calculated; The average consensus delay between the candidate high-quality nodes and other asynchronous consensus nodes is calculated using the following formula:

[0036] Represents the average consensus delay between the candidate high-quality nodes and other asynchronous consensus nodes; Indicates the high-quality nodes to be selected j Consensus delay during asynchronous consensus of target round; Based on the consensus accuracy of the asynchronous consensus node group in processing batch transaction packages, calculate the average accuracy of the high-quality nodes to be selected; The average accuracy of the selected high-quality nodes is calculated by the following formula:

[0037] in: Represents the average accuracy of the high-quality nodes to be selected; Indicates the high-quality nodes to be selected j Accuracy in asynchronous consensus; Construct high-quality node selection conditions based on average communication delay, average consensus delay, and average consensus accuracy; The high-quality node selection condition is constructed by the following formula: ; in: Represents the set of all high-quality nodes to be selected that meet the high-quality node selection conditions; f Indicates the number of malicious nodes; According to the high-quality node selection conditions, high-quality nodes that meet the quantity requirements are selected from the asynchronous consensus node group to form a high-quality node set; Get high-quality proposal vectors generated by high-quality node sets based on batch transaction packages, specifically: Generate multiple consensus proposals based on batch transaction packages; Select a high-quality node from the high-quality node set, input multiple consensus proposals into the PB protocol and broadcast them to other high-quality nodes; Collect valid signatures of other high-quality nodes that meet the quantity requirements for the consensus proposal; Generate a threshold signature based on the collected valid signatures; According to the threshold signature, a high-quality proposal vector is obtained.

[0038] The dataset used in the embodiment is the blockchain dataset in XBlock-EOS, which is the real on-chain data from the EOSIO platform and is the first to provide the most comprehensive well-processed on-chain EOSIO data and well-processed EOSIO dataset; the dataset contains detailed data of various activities on the EOS blockchain, including about 380 million block records, 19 billion transaction records, tens to hundreds of millions of smart contract call records each year, and more than 1.5 million account information; This example uses the following indicators to verify the effect: Transaction throughput , transaction throughput It refers to the total amount of cross-chain transactions processed by the asynchronous consensus node group per second. The transaction throughput is calculated by the following formula: :

[0039] in: U Indicates the number of cross-chain transactions; Indicates cross-chain transactions i processing time; Transaction delay , transaction delay It represents the time interval from the generation of cross-chain transactions in the relay chain to their packaging into blocks. The transaction delay is calculated by the following formula: :

[0040] in: express d The time when a cross-chain transaction is packaged into a block; express d The time when the transaction was generated.

[0041] Relay chain transaction batch size of the method proposed in this embodiment B ( Batchsize ) is set to 10000, 50000, and 100000, and three groups of experiments are conducted respectively: Randomly generate batch cross-chain transactions in the relay chain transaction pool lN transaction packages and use the optimal cross-chain transaction matching algorithm to assign the corresponding transaction packages to the corresponding asynchronous consensus nodes for asynchronous consensus. The number of malicious nodes f satisfy N = 3 f +1; like Figure 3 As shown, when the number of asynchronous nodes N Set to 5, 10, 15, the number of batch transactions in the relay chain transaction pool B The transaction delays when set to 10000, 50000, and 100000 are all less than 100s. When the number of nodes exceeds 15, the asynchronous consensus delays under different transaction batch sizes increase with the increase in the number of nodes. The reason is that the larger the number of consensus nodes, the more nodes need to wait to complete the task, which will increase the overall waiting time. When the number of nodes N = 40, the transaction delay reaches the maximum but is still less than 100s. like Figure 4 As shown in the figure, when the transaction batch size B is 10000 and 50000, the throughput decreases with the increase of the number of nodes; when the transaction batch size B is 100000 and the number of nodes N is 10, the asynchronous consensus throughput reaches the maximum value of 2.0×104 tx / s. It can be seen that the transaction delay and throughput of the method proposed in this example are good under different numbers of nodes; it can be seen that the method proposed in this example is N = 10, B = 100000, the performance is best; In order to evaluate the processing efficiency of the method proposed in this embodiment, N = 10, f = 3. Batch transaction size B The 9 asynchronous consensus rounds from 1 to 9 were evaluated under the conditions of 10000, 50000, and 100000 respectively. Among them, in the asynchronous consensus rounds 1, 2, and 3, the batch transactions are evenly distributed to each asynchronous consensus node and the asynchronous consensus node is randomly selected from all nodes for asynchronous binary consensus. In rounds 4, 5, 6, 7, 8, and 9, the method proposed in this embodiment is adopted, such as Figure 5 As shown, the asynchronous consensus algorithms of rounds 4, 5, 6, 7, 8, and 9 have lower transaction delays than the first three rounds and gradually stabilize.

[0042] In order to demonstrate the superiority of the method proposed in this embodiment, the following existing asynchronous consensus algorithms are used for comparison: Dumbo: Dumbo is the first asynchronous consensus mechanism suitable for blockchain environments. This example uses Dumbo2 as a comparison method; compared to HoneyBadgerBFT, this asynchronous consensus mechanism significantly improves latency and throughput by reducing the number of ABA (asynchronous binary consensus) instances to 1, especially when the system scale reaches a medium size, the performance improvement is particularly significant; Chronos: This asynchronous consensus mechanism implements an asynchronous common subset variant based on HoneyBadgerBFT and is the first Byzantine ordered consensus protocol in an asynchronous network model. TortoiseBFT: This asynchronous consensus mechanism builds on Dumbo by determining the order of transactions and requesting missing transactions to significantly reduce communication overhead, implementing a high-performance asynchronous consensus mechanism with three stages; Speeding Dumbo: The core of this asynchronous consensus mechanism is to propose a new multi-valued Byzantine protocol, which implements a faster multi-valued Byzantine consensus protocol design method based on Dumbo. Compared with Dumbo, it reduces the latency by half and achieves double the throughput. The transaction batch size is set to 1000, 5000, 10000, 50000, 100000, and gradually increases. f satisfy N = 3 f +1: like Figure 6 , Figure 7 , Figure 8 and Fig. 9 As shown in the figure, sDumbo represents Speeding Dumbo, and Theproposed represents the method proposed in this embodiment. Regardless of the number of asynchronous consensus nodes and the batch transaction size in the relay chain, the throughput of the method proposed in this embodiment is improved several times compared with other asynchronous consensus mechanisms, especially when the transaction batch size is 100,000; when N = 5, N = 10, N = 15, N = 30, under different transaction batch sizes, the throughput of the method proposed in this embodiment is significantly higher than that of Chronos, Dumbo, and TortoiseBFT; when N= 15, B = 100000, the throughput of the method proposed in this embodiment is nearly twice that of Speeding and Dumbo. The reason is that in the other three asynchronous consensus mechanisms, all transactions are forwarded to the transaction buffers of all asynchronous consensus nodes, and each asynchronous consensus node randomly selects batch transactions from its own buffer for asynchronous consensus. There is a phenomenon that different nodes select the same transaction for consensus. It can be seen that avoiding consensus on the same transaction in the asynchronous consensus mechanism and achieving transaction deduplication are crucial to improving the throughput of the asynchronous consensus algorithm. like Fig.10 As shown in the figure, as the number of nodes increases, the throughput of all asynchronous consensus mechanisms will decrease due to the unavoidable communication throughput and communication overhead. However, Speeding Dumbo and the method proposed in this embodiment always maintain a higher throughput than Chronos, Dumbo, and TortoiseBFT. At the same time, under different numbers of asynchronous consensus nodes, the maximum throughput of the method proposed in this embodiment is always higher than the maximum throughput of Speeding Dumbo. It can be seen that the method proposed in this embodiment is highly efficient. like Fig.11 As shown in Figure 2, the basic latency of different asynchronous consensus mechanisms increases with the number of nodes. However, the basic latency of Chronos is significantly higher than that of the other three asynchronous consensus mechanisms. This is because the asynchronous binary module of Chronos still requires N ABA instances require a large number of threshold signature verifications, which slows down the asynchronous consensus process; Dumbo, TortoiseBFT, Speeding Dumbo and the method proposed in this embodiment all reduce the number of ABA instances to 1, which significantly reduces the threshold signature overhead and maintains a low basic delay under different numbers of nodes. In addition, the basic delay of the method proposed in this embodiment is N The time is always below 3s in the range of 5-40; like Fig.12 As shown, since TortoiseBFT uses the reputation mechanism in the asynchronous consensus mechanism to evaluate the asynchronous consensus nodes, it effectively reduces the impact of malicious nodes, so its throughput is not easily affected by malicious nodes; at the same time, the method proposed in this embodiment limits the selection of transaction subsets to high-quality nodes, so its throughput is also less affected by malicious nodes, while the throughput of the Chronos, Dumbo and Speeding Dumbo asynchronous consensus mechanisms is easily fluctuated due to the size of the malicious node ratio. Example 2

[0043] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the following method: Obtain the batch transaction package corresponding to the target cross-chain transaction and the transaction broadcast performance of the asynchronous consensus node group; Based on the batch transaction package size and the transaction broadcast performance of the asynchronous consensus node group, determine the optimal cross-chain transaction matching solution that enables the asynchronous consensus node group to process batch transaction packages the fastest; According to the optimal cross-chain transaction matching solution, batch transaction packages are sent to the asynchronous consensus node group for asynchronous consensus processing. Example 3

[0044] A computer device comprising: A memory for storing instructions; The processor is configured to execute the instructions so that the device performs the steps of implementing the following method: Obtain the batch transaction package corresponding to the target cross-chain transaction and the transaction broadcast performance of the asynchronous consensus node group; Based on the batch transaction package size and the transaction broadcast performance of the asynchronous consensus node group, determine the optimal cross-chain transaction matching solution that enables the asynchronous consensus node group to process batch transaction packages the fastest; According to the optimal cross-chain transaction matching solution, batch transaction packages are sent to the asynchronous consensus node group for asynchronous consensus processing.

[0045] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0046] The present application is described with reference to the flowcharts of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process in the flowchart 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 device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0047] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A function specified in a process or multiple processes.

[0048] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 The steps of a specified function in a process or multiple processes.

[0049] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.

Claims

1. A relay chain cross-chain asynchronous consensus method, characterized in that: include: Obtain the batch transaction package corresponding to the target cross-chain transaction and the transaction broadcast performance of the asynchronous consensus node group; Based on the batch transaction package size and the transaction broadcast performance of the asynchronous consensus node group, determine the optimal cross-chain transaction matching solution that enables the asynchronous consensus node group to process batch transaction packages the fastest; According to the optimal cross-chain transaction matching solution, batch transaction packages are sent to the asynchronous consensus node group for asynchronous consensus processing.

2. The relay chain cross-chain asynchronous consensus method according to claim 1, characterized in that: The method of determining the optimal cross-chain transaction matching scheme that enables the asynchronous consensus node group to process the batch transaction package at the fastest speed based on the batch transaction package size and the transaction broadcast performance of the asynchronous consensus node group includes: Constructing a mapping matrix between batch transaction packages and asynchronous consensus node groups in multiple rounds of asynchronous consensus : ; in: Elements in Represents an asynchronous consensus node j In the i The transaction package number corresponding to the round of asynchronous consensus, and each element No duplication; , Indicates any i , Indicates any j , K Indicates the number of batch transaction packages, Represents the total number of rounds of asynchronous consensus, Indicates the number of asynchronous consensus nodes in the asynchronous consensus node group. In the asynchronous consensus process, nodes with the same consensus round are assigned in sequence. N The transaction package is submitted to the asynchronous consensus node group for consensus; Constructing the expected time matrix of asynchronous consensus node groups in broadcasting batch transaction packages : ;in: Representing the transaction broadcast performance matrix of the asynchronous consensus node group: Represents an asynchronous consensus node j The speed of broadcasting transaction packages of corresponding rounds during multiple rounds of asynchronous consensus; , Represents an asynchronous consensus node j exist q Broadcast during asynchronous consensus q The speed of transaction packets, Represents an asynchronous consensus node j Broadcast transaction package z The size of Represents an asynchronous consensus node j Broadcast transaction package z the time spent; Represents the relationship matrix corresponding to the batch transaction package size: ;in: Indicates the size of transaction package z, represents transpose; Constructing the expected execution time matrix of transaction broadcasting of batch transaction packages in multiple rounds of asynchronous consensus : ;in: Indicates that the asynchronous consensus round is m The expected completion time of broadcast transactions in the asynchronous consensus process, , Represents an asynchronous consensus node j The first batch of transaction packets in the buffer m The size of the transaction packet; Matrix-based ,matrix and matrix , determine the optimization goal of forming the best relationship mapping matrix between batch transaction packages and asynchronous consensus node groups in multiple rounds of asynchronous consensus; According to the optimization goal, determine the optimal cross-chain transaction matching solution that enables the asynchronous consensus node group to process batch transaction packages the fastest.

3. The relay chain cross-chain asynchronous consensus method according to claim 2 is characterized in that: The matrix-based ,matrix and matrix , determine the optimization goal of forming the best relationship mapping matrix between batch transaction packages and asynchronous consensus node groups in multiple rounds of asynchronous consensus, including: Matrix-based and matrix , determine the first optimization goal of making asynchronous consensus nodes with fast broadcast speed process more transaction packets : in: express K Cross-chain transaction packages are in l In the asynchronous consensus N The expected time matrix required for asynchronous consensus nodes to broadcast; ; Indicates the number u ij The transaction package is in i In the round of asynchronous consensus, the node j the expected time required for the broadcast; Matrix-based , determine the second optimization goal of balancing the time it takes each asynchronous consensus node to broadcast transaction packets during each round of asynchronous consensus : in: Representation Matrix The elements in Represents the total number of rounds of asynchronous consensus, c Indicates c Round of asynchronous consensus.

4. The relay chain cross-chain asynchronous consensus method according to claim 1, characterized in that: According to the optimal cross-chain transaction matching scheme, the batch transaction package is sent to the asynchronous consensus node group for asynchronous consensus processing, including: Calculate the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packages; Based on the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packages, high-quality nodes that meet the quantity requirements are selected from the asynchronous consensus node group to form a high-quality node set; Obtain high-quality proposal vectors generated by a high-quality node set based on batch transaction packages; An asynchronous binary consensus protocol is executed based on the proposal vectors of high-quality nodes.

5. The relay chain cross-chain asynchronous consensus method according to claim 4 is characterized in that: The calculation of the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packets includes: The communication delay of the asynchronous consensus node group in processing batch transaction packages is calculated by the following formula: ;in: Represents an asynchronous consensus node With asynchronous consensus nodes Communication delay between Represents an asynchronous consensus node i The moment the message was sent; Represents an asynchronous consensus node j The moment the message is received; The consensus delay of the asynchronous consensus node group in processing batch transaction packages is calculated by the following formula: in: Represents an asynchronous consensus node j Consensus delay during asynchronous consensus of target round; Represents an asynchronous consensus node j Complete i The latency of the asynchronous consensus round, n Indicates a total of n Round asynchronous consensus; The consensus accuracy of the asynchronous consensus node group in processing batch transaction packages is calculated by the following formula: in: Represents an asynchronous consensus node j Accuracy in asynchronous consensus; Represents an asynchronous consensus node j The number of correct values ​​input into the asynchronous binary consensus protocol in the target round of asynchronous consensus.

6. The relay chain cross-chain asynchronous consensus method according to claim 4, characterized in that: The method of selecting high-quality nodes that meet the quantity requirements from the asynchronous consensus node group based on the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packets to form a high-quality node set includes: Based on the communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packages, high-quality node selection conditions are established; According to the high-quality node selection conditions, high-quality nodes that meet the quantity requirements are selected from the asynchronous consensus node group to form a high-quality node set.

7. The relay chain cross-chain asynchronous consensus method according to claim 6, characterized in that: The communication delay, consensus delay and consensus accuracy of the asynchronous consensus node group in processing batch transaction packages to construct high-quality node selection conditions include: Based on the communication delay of the asynchronous consensus node group in processing batch transaction packages, the average communication delay between the candidate high-quality node and other asynchronous consensus nodes is calculated; The average communication delay between the candidate high-quality node and other asynchronous consensus nodes is calculated by the following formula: in: Represents the average communication delay between the selected high-quality node and other asynchronous consensus nodes; Indicates the high-quality nodes to be selected j With other asynchronous consensus nodes in the asynchronous consensus node group z Communication delay; S Represents a queue of high-quality nodes to be selected. X Represents an asynchronous consensus node group, Indicates the number of high-quality nodes to be selected, Indicates the number of asynchronous consensus nodes in the asynchronous consensus node group; Based on the consensus delay of the asynchronous consensus node group in processing batch transaction packages, the average consensus delay of the candidate high-quality nodes and other asynchronous consensus nodes is calculated; The average consensus delay between the candidate high-quality nodes and other asynchronous consensus nodes is calculated using the following formula: in: Represents the average consensus delay between the candidate high-quality nodes and other asynchronous consensus nodes; Indicates the high-quality nodes to be selected j Consensus delay during asynchronous consensus of target round; Based on the consensus accuracy of the asynchronous consensus node group in processing batch transaction packages, calculate the average accuracy of the high-quality nodes to be selected; The average accuracy of the selected high-quality nodes is calculated by the following formula: in: Represents the average accuracy of the high-quality nodes to be selected; Indicates the high-quality nodes to be selected j Accuracy in asynchronous consensus; Constructing high-quality node selection conditions according to the average communication delay, the average consensus delay, and the average consensus accuracy; The high-quality node selection condition is constructed by the following formula: ;in: Represents the set of all high-quality nodes to be selected that meet the high-quality node selection conditions; f Indicates the number of malicious nodes.

8. The relay chain cross-chain asynchronous consensus method according to claim 4, characterized in that: The step of obtaining a high-quality proposal vector generated by a high-quality node set based on a batch transaction package includes: Generate multiple consensus proposals based on batch transaction packages; Select a high-quality node from the high-quality node set, input multiple consensus proposals into the PB protocol and broadcast them to other high-quality nodes; Collect valid signatures of other high-quality nodes that meet the quantity requirements for the consensus proposal; Generate a threshold signature based on the collected valid signatures; According to the threshold signature, a high-quality proposal vector is obtained.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the relay chain cross-chain asynchronous consensus method as described in any one of claims 1 to 8 is implemented.

10. A computer device, characterized in that: include: A memory for storing instructions; A processor is used to execute the instructions so that the device implements the relay chain cross-chain asynchronous consensus method as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Relay chain extension method and device for cross-chain interoperation, medium and program product

    CN119996493A

  • Relay Chain Extension Method, Device, Medium and Program Product for Cross-Chain Interoperability

    CN119996493B