Block chain cross-chain transaction method and computer readable storage medium

By determining the optimal transaction allocation plan in the blockchain, cross-chain transaction packets are allocated to local slices, the problem of reduced transaction throughput of relay chains caused by unbalanced shard load and cross-shaft transactions is solved, and the matching of shard load and performance and system scalability is achieved.

CN119718623APending Publication Date: 2025-03-28NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 1 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, shard load imbalance and cross-shash transactions lead to the problem of reduced transaction throughput of relay chains.

Method used

By obtaining the cross-chain transaction packets and historical cross-chain transaction information of the target parachain, the optimal transaction allocation scheme for load balancing of the local slices for cross-chain transaction packets is determined, and based on this scheme, the cross-chain transaction packets are allocated to each local slice to generate a cross-chain transaction queue.

Benefits of technology

Ensure that the shard load matches the shard performance, solves the problem of blockchain shard load imbalance and the reduction in transaction throughput of relay chains caused by cross-sanding transactions, and improves the scalability and transaction processing efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718623A_ABST
    Figure CN119718623A_ABST
Patent Text Reader

Abstract

The invention discloses a block chain cross-chain transaction method and a computer readable storage medium, and belongs to the technical field of block chains, the block chain cross-chain transaction method comprises the following steps: obtaining a cross-chain transaction packet and historical cross-chain transaction information of a target parallel chain; according to the historical cross-chain transaction information of the target parallel chain, determining an optimal transaction distribution scheme for balancing the local fragment load; and based on the optimal transaction distribution scheme, distributing the cross-chain transaction packet to each local fragment to generate a cross-chain transaction queue. According to the method, the optimal transaction distribution scheme for balancing the local fragment load is generated through the historical cross-chain transaction information of the target parallel chain, the fragment load is ensured to be matched with the fragment performance, the cross-chain transaction packet is distributed to each local fragment through the optimal transaction distribution scheme, the cross-chain transaction queue is generated, and the transaction efficiency is improved. The problem that the transaction throughput of the relay chain is reduced due to unbalanced fragment load of the current block chain and cross-fragment transaction is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a blockchain cross-chain transaction method and a computer-readable storage medium, and belongs to the technical field of blockchain. Background Art

[0002] At present, there is a performance bottleneck in the improvement of relay chain scalability by sharding technology. Cross-shard transactions and load imbalance are the main reasons for this bottleneck. Among them, the existence of cross-shard transactions increases the communication overhead in the cross-chain transaction processing process, and the load imbalance problem will cause the shard load to exceed the processing capacity of the shard.

[0003] To solve the problem of shard load imbalance, Li et al. dynamically balanced the transaction load on different shards by regularly migrating active accounts from shards with more transactions to shards with fewer transactions. However, they ignored the following issues: This method only focused on the load balancing problem of shards, and did not consider the impact of cross-shard transactions on blockchain transaction throughput. At the same time, this method did not consider the problem that a sudden increase in transactions generated by an account would cause a surge in shard load, thereby increasing the transaction processing time. In order to solve the problem of unbalanced shard load and reduce cross-shard transactions, Xu et al. analyzed account relationships based on historical transaction patterns and constructed an account relationship graph, assigned frequently interacting accounts to the same shard, and balanced the number of transactions in each shard to balance the shard load. However, this method has problems: it does not consider the relationship between shard load and shard performance. Shard performance that does not meet shard load requirements will lead to reduced shard transaction throughput. At the same time, this method of reducing cross-shard transactions is not suitable for relay chain shards. The generation of cross-shard transactions in relay chain shards is mainly due to the dependency between transactions rather than account allocation. Cross-chain transactions in parallel chains are packaged by collection nodes in the parallel chains and forwarded to the relay chain. Cross-shard transactions cannot be reduced through account allocation. Summary of the invention

[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a blockchain cross-chain transaction method and a computer-readable storage medium to ensure that the shard load matches the shard performance, thereby solving the problem that the current blockchain shard load is unbalanced and cross-shard transactions will lead to a reduction in relay chain transaction throughput.

[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 blockchain cross-chain transaction method, comprising: Obtain the cross-chain transaction package and historical cross-chain transaction information of the target parallel chain; Based on the historical cross-chain transaction information of the target parachain, determine the optimal transaction allocation scheme that balances the load of cross-chain transaction packets processed by local shards; Based on the optimal transaction allocation plan, the cross-chain transaction packages are allocated to each local shard to generate a cross-chain transaction queue.

[0006] Furthermore, the method of determining the optimal transaction allocation scheme for balancing the load of cross-chain transaction packets processed by the local shards based on the historical cross-chain transaction information of the target parallel chain includes: Calculate the local shard load value and the local shard remaining load value based on the historical cross-chain transaction information of the target parallel chain; According to the local shard load value and the local shard remaining load value, the optimal transaction allocation scheme for balancing the local shard load is determined.

[0007] Furthermore, the calculation of the local shard load value and the local shard remaining load value according to the historical cross-chain transaction information of the target parallel chain includes: Determine the number and size of cross-chain transactions based on the historical cross-chain transaction information of the target parachain; Obtain the number of remaining transactions in the local shard, the size of remaining transactions, and the transaction throughput of the local shard; The local shard load value and the local shard residual load value are calculated based on the number of cross-chain transactions, the size of cross-chain transactions, the number of remaining transactions in the local shard, the size of the remaining transactions, and the transaction throughput of the local shard.

[0008] Furthermore, the calculation of the local shard load value and the local shard remaining load value according to the number of cross-chain transactions, the size of cross-chain transactions, the number of remaining transactions in the local shard, the size of remaining transactions, and the transaction throughput of the local shard includes: According to the number and size of cross-chain transactions, a multi-attribute description matrix of the load caused by cross-chain transactions on local shards is constructed. The multi-attribute description matrix of the load is shown in the following formula: ; in: Represents the multi-attribute description matrix of the load, Indicates i The number of transactions that will be generated in the parachain, Indicates i The size of the transactions that will be generated in each parachain, , Indicates the number of parallel chains; According to the number of remaining transactions in the local shards, the size of the remaining transactions, and the transaction throughput of the local shards, a multi-attribute description matrix of the remaining load in the local shards is constructed. The multi-attribute description matrix of the remaining load is shown in the following formula: ; in: Represents the multi-attribute description matrix of the residual load, Indicates i The number of remaining transactions in each local shard, Indicates i The size of the remaining transactions in each local shard, Indicates i The transaction throughput of each local shard, , Indicates the total number of local fragments; Based on the multi-attribute description matrix of load and the multi-attribute description matrix of residual load, the weight of each attribute of the number of cross-chain transactions, the size of cross-chain transactions, the number of remaining transactions in the local shards, the size of remaining transactions, and the transaction throughput of the local shards are calculated: The multi-attribute description matrix of the load and the multi-attribute description matrix of the remaining load are standardized by the following formula: ; ; in: express The standardized matrix of the matrix after unifying the indicator type, Representation Matrix Middle i +1 line j +1 column elements, , , The matrix after unified indicators is: ; express The matrix after unified indicators; Represents a standardized matrix Middle i +1 line j +1 column elements, , j =0, Indicates the value of the unified indicator type for the number of cross-chain transactions. j =1, Indicates the value after the cross-chain transaction size is unified into the indicator type. ; express The standardized matrix of the matrix after unifying the indicator type, Represents a standardized matrix Middle i +1 line j +1 column elements, , , The matrix after unified indicators is: ; express The matrix after unified indicators; Represents a standardized matrix D Middle i +1 line j +1 column elements, , j =0, represents the number of remaining transactions in the local shard, j =1, Indicates the size of the remaining transactions, j =2, Indicates the value of the transaction throughput of the local shard after unifying the indicator type. ; The final weight of each attribute is calculated by the following formula: ; ; ; ; ; in: Represents the weight of the number of cross-chain transactions, The weight representing the size of the cross-chain transaction; Information entropy representing different attributes of cross-chain transactions, ; Indicates the probability values ​​of the two attributes of cross-chain transaction quantity and cross-chain transaction size generated by the parallel chain. ; The weight representing the number of remaining transactions in the local shard, represents the weight of the remaining transaction size in the local shard, The weight representing the transaction throughput of the local shard; The information entropy representing the number of remaining transactions in the local shard, the remaining transaction size, and the transaction throughput of the local shard, ; Represents the probability value of the number of remaining transactions in the local shard, the remaining transaction size and the transaction throughput of the local shard, ; Based on the final weight of each attribute, the optimal attribute optimistic distance and the worst attribute pessimistic distance of each attribute are calculated: According to the final weight of each attribute, construct a weighted matrix and weight matrixU , where the weight matrix Middle i Line j The elements of the column are represented as , ; Weighting matrix U Middle i Line j The elements of the column are represented as , ; By Collection Represents a standardized matrix , standardized matrix The optimal attribute set for each column element in , , through the collection Represents a standardized matrix , standardized matrix The worst attribute set of each column element in , ;when hour, Represents the weight matrix Middle i +1 maximum value of the column elements, represents the weight matrix i +1 minimum value of the column elements; when hour, Represents the weight matrix Middle i -1 The maximum value of the column elements, Represents the weighted matrix i -1 The minimum value of the column elements; The weighting matrix is ​​calculated by the following formula Optimistic distance between the median attribute value and the optimal attribute value : ; when hour, Represents the weight matrix Middle j +1 maximum value of the column elements, represents the weight matrix j +1 minimum value of the column elements; Represents the weight matrix Middle i- 1st row j Elements of a column; The weighting matrix is ​​calculated by the following formula Pessimistic distance between the median attribute value and the worst attribute value : ; The weighting matrix is ​​calculated by the following formulaU Optimistic distance between the median attribute value and the optimal attribute value : ; when hour, Represents the weight matrix Middle j +1 maximum value of the column elements, represents the weight matrix j +1 minimum value of the column elements; Represents the weight matrix U Middle i- 1st row j Elements of a column; The weighting matrix is ​​calculated by the following formula U Pessimistic distance between the median attribute value and the worst attribute value : ; The local slice load value is calculated by the following formula : ; in: represents the selection factor, , , Indicates to be assigned, when the weight matrix and weight matrix U When the distance between the attribute value of each row in and the corresponding optimal attribute value is greater than the distance between the attribute value and the corresponding worst attribute value, Assign a value of 1, otherwise Assign a value of 0; Indicates the threshold for selecting optimistic or pessimistic distance calculation; The remaining load value of each local slice is calculated by the following formula: : ; represents the selection factor, , .

[0009] Furthermore, determining the optimal transaction allocation scheme for balancing the load of the local shards according to the local shard load value and the local shard remaining load value includes: using a spider bee optimization algorithm to determine the optimal transaction allocation scheme, wherein: make Spider Wasp h Daizhongdi i A distribution scheme for cross-chain transactions on parallel chains. , q ijIndicates i The first j A spider, j ∈{1, 2,…, M}, M Indicates the number of parallel chains; Initializing the spider wasp population using the local slice load value and the local slice residual load value; Calculate the population fitness of the initialized spider wasp population; Select the individual with the smallest fitness in each population and store the selected individual in an array; Use the array as the optimal trade allocation scheme.

[0010] Furthermore, the calculation of the population fitness of the initialized spider wasp population includes: taking the load variance between local fragments as the population fitness, wherein: The average load value is calculated based on the local slice load value and the local slice residual load value. The average load value is calculated by the following formula: ; in: Indicates the average load value, Indicates r The load value caused by each parallel chain to the local shard, Indicates r The remaining load value of each local slice, Indicates the number of parallel chains, N Indicates the number of local fragments; Based on the average load value, calculate the load variance between local slices. The load variance between local slices is calculated by the following formula: ; in: Represents the load variance between local slices; Indicates k The load value caused by each parachain on the local shard; Represents the judgment factor, when q jk =r hour, =1, indicating the k Transactions of parachains are assigned to local shards r ,when q jk ≠ r hour, =0, indicating the k Parachain transactions are not assigned to local shards r .

[0011] Furthermore, the cross-chain transaction packages are distributed to each local shard based on the optimal transaction allocation scheme to generate a cross-chain transaction queue, including: Obtain cross-chain transaction packages and distribute them to the transaction queues in each local shard; Perform stability analysis on transaction queues to identify unstable queues; Fine-tune transactions in the unstable queue between local shards to obtain a stable cross-chain transaction queue.

[0012] Furthermore, the performing stability analysis on the transaction queue to determine the unstable queue includes: The real-time length of the transaction queue is calculated by the following formula: ; in: Indicates i local segments in time slots v +1 transaction queue length at the start; Indicates i local segments in time slots v The length of the transaction queue at the beginning; Indicates time slot v Inside i The number of transactions processed by each local shard; Indicates time slot v Arrival within i The number of transactions that are sharded and waiting in the transaction queue; According to the real-time length of the transaction queue, determine the total transaction queue backlog scalar of all local shards; calculate the total transaction queue backlog scalar of all local shards by the following formula: ; in: Indicates the total transaction queue in time slot v The backlog scalar; , Indicates that the local segment is in the time slot v The set of transaction queue lengths at the start, , N Indicates the number of local fragments; Determine queue stability based on the change in the total transaction queue backlog scalar, where: like , then the queue is unstable; represents mathematical expectation; Indicates the change in the total transaction queue backlog scalar, , Indicates the total transaction queue in time slot v +1 for the backlog scalar.

[0013] Furthermore, the transactions in the unstable queue are fine-tuned between local shards to obtain a stable cross-chain transaction queue, including: Get the number of sub-transactions in the unstable queue and the number of transactions waiting to be processed in the queue; According to the number of sub-transactions in the unstable queue and the number of transactions waiting to be processed in the queue, the number of transactions that need to be fine-tuned in the unstable queue is determined. The number of transactions that need to be fine-tuned in the unstable queue is calculated by the following formula: ; in: Indicates i local segments in time slots The number of trades that need to be fine-tuned at the beginning, Indicates the i local segments in time slots v +1 transaction queue length at the start; Indicates i The number of sub-transactions in the transaction queue of each local shard; Selecting the appropriate local shard transfer requires fine-tuning transactions if the local shard to be selected satisfies the following formula: ; in: Indicates time slot v Inside i The number of transactions processed by each local shard; Indicates time slot v Arrival within i The number of transactions that are sharded and waiting in the transaction queue; Then the local slice to be selected is a suitable local slice; Transfer transactions that need fine-tuning to the appropriate local shards to obtain a stable cross-chain transaction queue.

[0014] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned blockchain cross-chain transaction method is implemented.

[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention generates an optimal transaction allocation scheme that balances the load of local shards through the historical cross-chain transaction information of the target parallel chain, ensures that the shard load matches the shard performance, and distributes cross-chain transaction packages to each local shard through the optimal transaction allocation scheme, generates a cross-chain transaction queue, and solves the current problem of unbalanced blockchain shard load and cross-shard transactions will lead to a reduction in relay chain transaction throughput.

[0016] 2. The present invention adopts the spider wasp optimization algorithm to determine the optimal transaction allocation plan, uses the local fragment load value and the local fragment residual load value to initialize the spider wasp population, takes the load variance between local fragments as the population fitness, and selects the individual with the smallest population fitness in each population. The set of all individuals with the smallest population fitness is used as the optimal transaction allocation plan, thereby avoiding falling into the local optimum when obtaining the optimal transaction allocation plan.

[0017] 3. The present invention performs stability analysis on the transaction queue, determines the stability of the queue by the change in the backlog scalar of the total transaction queue, and determines the number of transactions that need to be fine-tuned in the unstable queue based on the number of sub-transactions in the unstable queue and the number of transactions waiting to be processed in the queue. Finally, the number of transactions that need to be fine-tuned is transferred to the appropriate local shards to obtain a stable cross-chain transaction queue, thereby reducing the delay of transactions waiting to be processed in the queue. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is a flowchart of a blockchain cross-chain transaction method according to an embodiment of the present invention; Figure 2 It is a flow chart of determining an optimal transaction allocation scheme for balancing the load of local shards in a blockchain cross-chain transaction method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the relationship between block size and transaction throughput in a blockchain cross-chain transaction method according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the relationship between the number of nodes and the transaction processing success rate in a blockchain cross-chain transaction method according to an embodiment of the present invention; Figure 5 This is a comparison chart of transaction processing time under different local shards between a blockchain cross-chain transaction method according to an embodiment of the present invention and an existing method; Figure 6 This is a comparison chart of transaction throughput and processing delay between a blockchain cross-chain transaction method according to an embodiment of the present invention and an existing method. DETAILED DESCRIPTION

[0019] 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

[0020] like Figure 1 As shown, a blockchain cross-chain transaction method includes: Obtain the cross-chain transaction package and historical cross-chain transaction information of the target parallel chain; like Figure 2As shown in the figure, based on the historical cross-chain transaction information of the target parallel chain, the optimal transaction allocation scheme is determined to balance the load of cross-chain transaction packets processed by the local shards. Specifically: Calculate the local shard load value and the local shard remaining load value according to the historical cross-chain transaction information of the target parallel chain, including: determine the number of cross-chain transactions and the size of cross-chain transactions according to the historical cross-chain transaction information of the target parallel chain; Obtain the number of remaining transactions in the local shard, the size of remaining transactions, and the transaction throughput of the local shard; The local shard load value and the local shard residual load value are calculated based on the number of cross-chain transactions, the size of cross-chain transactions, the number of remaining transactions in the local shard, the size of remaining transactions, and the transaction throughput of the local shard, where: According to the number and size of cross-chain transactions, a multi-attribute description matrix of the load caused by cross-chain transactions on local shards is constructed. The multi-attribute description matrix of the load is shown as follows: ; Represents the multi-attribute description matrix of the load, Indicates i The number of transactions that will be generated in the parachain, Indicates i The size of the transactions that will be generated in each parachain, , Indicates the number of parallel chains; According to the number of remaining transactions in the local shards, the size of remaining transactions and the transaction throughput of the local shards, a multi-attribute description matrix of the remaining load in the local shards is constructed. The multi-attribute description matrix of the remaining load is shown in the following formula: ; Represents the multi-attribute description matrix of the residual load, Indicates i The number of remaining transactions in each local shard, Indicates i The size of the remaining transactions in each local shard, Indicates i The transaction throughput of each local shard, , Indicates the total number of local fragments; Based on the multi-attribute description matrix of load and the multi-attribute description matrix of remaining load, the weight of each attribute of the number of cross-chain transactions, the size of cross-chain transactions, the number of remaining transactions in the local shards, the size of remaining transactions, and the transaction throughput of the local shards are calculated, and the multi-attribute description matrix of load and the multi-attribute description matrix of remaining load are standardized by the following formula: ; ; express The standardized matrix of the matrix after unifying the indicator type, Representation Matrix Middle i +1 line j +1 column elements, , ; The matrix after unified indicators is: ; express The matrix after unified indicators; Represents a standardized matrix Middle i +1 line j +1 column elements, , j =0, Indicates the value of the unified indicator type for the number of cross-chain transactions. j =1, Indicates the value after the cross-chain transaction size is unified into the indicator type. ; express The standardized matrix of the matrix after unifying the indicator type, Represents a standardized matrix Middle i +1 line j +1 column elements, , , The matrix after unified indicators is: ; express The matrix after unified indicators; Represents a standardized matrix D Middle i +1 line j +1 column elements, , j =0, represents the number of remaining transactions in the local shard, j =1, Indicates the size of the remaining transactions, j =2, Indicates the value of the transaction throughput of the local shard after unifying the indicator type. ; The final weight of each attribute is calculated by the following formula: ; ; ; ; ; Represents the weight of the number of cross-chain transactions, The weight representing the size of the cross-chain transaction; Information entropy representing different attributes of cross-chain transactions, ; Indicates the probability values ​​of the two attributes of cross-chain transaction quantity and cross-chain transaction size generated by the parallel chain. ; The weight representing the number of remaining transactions in the local shard, represents the weight of the remaining transaction size in the local shard, The weight representing the transaction throughput of the local shard; The information entropy representing the number of remaining transactions in the local shard, the remaining transaction size, and the transaction throughput of the local shard, ; Represents the probability value of the number of remaining transactions in the local shard, the remaining transaction size and the transaction throughput of the local shard ; Based on the final weight of each attribute, the optimal attribute optimistic distance and the worst attribute pessimistic distance of each attribute are calculated: According to the final weight of each attribute, construct a weighted matrix and weight matrix U , weighted matrix Middle i Line j The elements of the column are represented as , ; Weighting matrix U The element in row i and column j in is represented as , ; By Collection Represents a standardized matrix , standardized matrix The optimal attribute set for each column element in , , through the collection Represents a standardized matrix , standardized matrix The worst attribute set of each column element in , ;when hour, Represents the weight matrix Middle i The maximum value of the column elements, represents the weight matrix i The minimum value of the column elements; when hour, Represents the weight matrix Middle i - The maximum value of the 2 column elements, represents the weight matrix i -2 The minimum value of the column elements; The weighting matrix is ​​calculated by the following formula Optimistic distance between the median attribute value and the optimal attribute value : ; hour, Represents the weight matrix Middle j +1 maximum value of the column elements, represents the weight matrix j +1 minimum value of the column elements; Represents the weight matrix Middle i- 1st row j Elements of a column; The weighting matrix is ​​calculated by the following formula Pessimistic distance between the median attribute value and the worst attribute value : ; The weighting matrix is ​​calculated by the following formula U Optimistic distance between the median attribute value and the optimal attribute value : ; hour, Represents the weight matrix Middle j +1 maximum value of the column elements, represents the weight matrix j +1 minimum value of the column elements; Represents the weight matrix U Middle i- 1st row j Elements of a column; The weighting matrix is ​​calculated by the following formula U Pessimistic distance between the median attribute value and the worst attribute value : ; The local slice load value is calculated by the following formula : ; represents the selection factor, , , Indicates to be assigned, when the weight matrix and weight matrix U When the distance between the attribute value of each row in and the corresponding optimal attribute value is greater than the distance between the attribute value and the corresponding worst attribute value, Assign a value of 1, otherwise Assign a value of 0; Indicates the threshold for selecting optimistic or pessimistic distance calculation; The remaining load value of each local slice is calculated by the following formula: : ; represents the selection factor, , ; According to the local shard load value and the local shard remaining load value, determine the optimal transaction allocation plan that balances the local shard load, where: the spider bee optimization algorithm is used to determine the optimal transaction allocation plan, let Spider Wasp h Daizhongdi i A distribution scheme for cross-chain transactions between parallel chains; , q ij Indicates i The first j A spider, j ∈{1,2,…, M}, M Indicates the number of parallel chains; Initializing the spider wasp population using the local slice load value and the local slice residual load value; Calculate the population fitness of the initialized spider wasp population, where: the load variance between local fragments is used as the population fitness, and the average load value is calculated according to the local fragment load value and the local fragment residual load value. The average load value is calculated by the following formula: ; in: Indicates the average load value, Indicates r The load value caused by each parallel chain to the local shard, Indicates r The remaining load value of each local slice, Indicates the number of parallel chains, N Indicates the number of local fragments; Based on the average load value, calculate the load variance between local slices. The load variance between local slices is calculated by the following formula: ; in: Represents the load variance between local slices; Indicates k The load value caused by each parachain on the local shard; Represents the judgment factor, when q jk =r hour, =1, indicating the k Transactions of parachains are assigned to local shards r ,when q jk ≠ r hour, =0, indicating the k Parachain transactions are not assigned to local shards r ; Select the individual with the smallest fitness in each population and store the selected individual in an array; Use the array as the optimal trade allocation scheme.

[0021] Based on the optimal transaction allocation scheme, the cross-chain transaction packages are allocated to each local shard to generate a cross-chain transaction queue. Specifically: Obtain cross-chain transaction packages and distribute them to the transaction queues in each local shard; Perform stability analysis on the transaction queue to determine the unstable queue, including: Calculate the real-time length of the transaction queue by the following formula: ; Indicates i local segments in time slots v +1 transaction queue length at the start; Indicates time slot v Inside i The number of transactions processed by each local shard; Indicates time slot v Arrival within i The number of transactions that are sharded and waiting in the transaction queue; Indicates i local segments in time slots v The length of the transaction queue at the beginning; According to the real-time length of the transaction queue, determine the total transaction queue backlog scalar of all local shards; calculate the total transaction queue backlog scalar of all local shards by the following formula: ; in: Indicates the total transaction queue in time slot v The backlog scalar; , , N represents the number of local fragments, Indicates that the local segment is in the time slot v A collection of transaction queue lengths at the start; Determine the queue stability based on the change in the total transaction queue backlog scalar. , then the queue is unstable; represents mathematical expectation; Indicates the change in the total transaction queue backlog scalar, , Indicates the total transaction queue in time slot v +1 for the backlog scalar; Fine-tune the transactions in the unstable queue between local shards to obtain a stable cross-chain transaction queue, including: Get the number of sub-transactions in the unstable queue and the number of transactions waiting to be processed in the queue; According to the number of sub-transactions in the unstable queue and the number of transactions waiting to be processed in the queue, the number of transactions that need to be fine-tuned in the unstable queue is determined. The number of transactions that need to be fine-tuned in the unstable queue is calculated by the following formula: ; Indicates i local segments in time slots The number of trades that need to be fine-tuned at the beginning, Indicates the i local segments in time slots v +1 transaction queue length at the start; Indicates i The number of sub-transactions in the transaction queue of each local shard; Selecting the appropriate local shard transfer requires fine-tuning transactions if the local shard to be selected satisfies the following formula: ; Indicates time slot v Inside i The number of transactions processed by each local shard; Indicates time slot v Arrival within i The number of transactions that are sharded and waiting in the transaction queue; The local shard to be selected is a suitable local shard, and the transaction that needs fine-tuning is transferred to the suitable local shard to obtain a stable cross-chain transaction queue. This embodiment takes a relay chain with 10 parallel chains and 8 local shards as an example, assuming that the information of parallel chain cross-chain transactions and the information of shards are as shown in Table 1 and Table 2:

[0022] Table 1 Parallel chain transaction information

[0023] Table 2 Fragmentation information The load generated by cross-chain transactions on local shards and the remaining load of local shards are calculated based on the data in Table 1 and Table 2. Since the number of parallel chains is greater than the number of local shards, some local shards may be assigned transactions from multiple parallel chains. After multiple iterations of the cross-chain transaction allocation algorithm, the solution with the smallest fitness value is obtained as the cross-chain transaction allocation solution for the parallel chain, that is, { B 1 → C 1 , B 2 → C 6 , B 3 → C 7 , B 4 → C 4 , B 5 → C 2 , B 6 → C 5 , B 7 → C 3 , B 8 → C 8 , B 9 → C 7 , B 10 → C 3}.

[0024] Taking the parallel chain cross-chain transaction allocation scheme as an example, if the transaction queue length set is {400, 250, 200, 200, 300, 400, 100, 500}, the number of transactions arriving at the local shard and waiting in the transaction queue is {900, 1200, 1300, 800, 950, 1100, 1400, 700}, and the number of transactions processed by the local shard is {1000, 1300, 1300, 900, 1100, 1200, 1400, 800}, the calculated set of changes in the total transaction queue backlog scalar is {-35000, -25000, 0, -15000, -33740, -35000, -45000}, at this time, the change in the total transaction queue backlog scalar of the relay chain system as a whole is negative, which is in a stable state and each transaction queue is also in a stable state; if the last element of the set of waiting transactions in the transaction queue is 1100 instead of 700, then the local sharding C 8 The transaction queue backlog is 195,000, and the relay chain is in an unstable state as a whole and this state is caused by local fragmentation. C 8 As a result, it is necessary to split the local C 8 Adjust the transaction queue in.

[0025] In order to analyze that the method proposed in the embodiment can balance the transaction processing time of different local shards and ensure that the local shard load and performance match, this embodiment selects LB-Chain and EFSHARD as comparison methods. Both methods study the shard load in the shard, which is consistent with this example; in order to analyze that the method proposed in the embodiment is superior to other methods in improving the scalability of the cross-chain system, the latest methods for improving transaction processing efficiency in different cross-chain technologies are selected for comparison, including CrossChannel, Notary and RAC-Chain; LB-Chain: This model is a novel sharding system. It analyzes the reason why sharding performance is limited is the unbalanced load on different shards. It proposes an efficient and secure account and transaction migration scheme and an account allocation algorithm to dynamically balance the load on different shards by regularly migrating active accounts from heavily loaded shards to lightly loaded shards. EFSHARD: This model is an efficient state sharding blockchain system that distributes transactions to shards with lower loads in real time to ensure load balancing across shards. CrossChannel: This model uses off-chain payment channels to facilitate cross-chain transactions, and introduces chain relay protocols and asset management mechanisms to address the security and availability challenges brought about by the separation between blockchains. At the same time, the model designs a channel snapshot mechanism to ensure the efficiency of chain relays and improve scalability; Notary: This model is a new reputation value calculation and node selection model based on verifiable random numbers, enhanced EigenTrust algorithm and cumulative probability. It is proposed to address the problem that nodes are not active in maintaining cross-chain value, which affects the efficiency and security of the cross-chain mechanism. It is designed to ensure node participation and improve the operating efficiency and security of the cross-chain mechanism. RAC-Chain: This model is a consortium chain cross-chain model based on relay chain and asynchronous consensus. It solves the scalability limitation of a single blockchain that is difficult to support large-scale data. It uses asynchronous BFT to support more application chains to connect to the relay chain to ensure the consistency of the transaction status of both parties across the chain. In order to compare the method proposed in this embodiment with other methods, the following indicators are used: transaction processing delay, transaction throughput and transaction processing success rate, where: The transaction processing delay is calculated by the following formula : ; and Respectively represent transactions The generation time and the time when it is confirmed to be received are recorded in the timestamp of the cross-chain transaction data structure. Assuming that the local sharding is processed transactions, this patent uses the average value of transaction processing delay as the experimental indicator; The transaction throughput is calculated by the following formula : ; Indicates local fragment C i In time The number of transactions completed within the transaction period; The transaction processing success rate is calculated by the following formula : ; Indicates the relay chain at time The total number of transactions that need to be processed within a period.

[0026] like Figure 3As shown, under different numbers of nodes, the transaction throughput first increases and then decreases as the block size increases. When the block size is less than 500KB, as the number of transactions in the block increases, more transactions are forwarded to the relay chain per unit time, and the relay chain can process more transactions at a time, thereby improving the processing efficiency of the relay chain. Therefore, the transaction throughput increases with the increase of the block size; when the block size is greater than 500KB, the delay in propagating blocks between nodes increases and the node bandwidth is limited, resulting in a decrease in transaction throughput as the block size increases. Therefore, selecting a suitable block size can optimize the transaction throughput of the relay chain. The method proposed in this embodiment sets the block size to 500KB according to the change in transaction throughput; like Figure 4 As shown in the figure, after the relay chain is sharded, malicious nodes are divided into multiple shards, so the fault tolerance of the relay chain is determined by the fault tolerance of the shards; the method proposed in this embodiment uses the PBFT consensus algorithm to reach consensus on transactions. The fault tolerance of the PBFT consensus algorithm is closely related to the number of nodes and can only tolerate 1 / 3 of malicious nodes; the number of nodes in each shard determines the number of malicious nodes that the system can tolerate. Therefore, it is necessary to analyze the impact of the number of nodes on the success rate of transaction processing through experiments. In order to analyze this impact under different circumstances, the relay chain is set The malicious nodes are 0.15, 0.2, 0.25, 0.3, 0.35 and 0.4, and the malicious nodes are randomly assigned to the shards. As the proportion of malicious nodes in the relay chain increases, although there are small fluctuations, the overall transaction processing success rate shows a downward trend; when the malicious node ratio is less than 1 / 3, the larger the number of nodes, the greater the transaction success rate, because when the number of nodes is large, the possibility of more than 2 / 3 nodes in the shard reaching a consensus is higher; when the node ratio is greater than 1 / 3, more malicious nodes may be assigned to the same shard, causing the shard to crash; When the number of nodes is 120 and the proportion of malicious nodes is less than 0.35, the transaction processing success rate is at a higher level compared to other situations. However, when the number of nodes is 120, the advantage of transaction processing success rate is not enough to make up for the throughput defect; When the number of nodes is 60, the transaction processing success rate is lower in most cases than when the number of nodes is 80 and 100. When the number of nodes is 80, the transaction processing success rate is generally greater than the success rate when the number of nodes is 100, and when the number of nodes is 80, the transaction throughput is at a high level, so the number of nodes in each shard is determined to be 80, that is, the number of nodes in the relay chain is 640, and the number of nodes is set to 640 in subsequent experiments.

[0027] like Figure 5As shown, in order to verify the advantages of the method proposed in this embodiment in the transaction allocation method, the method proposed in this embodiment selects random allocation strategy, LB-Chain and EFSHARD as comparison methods in the experiment, and compares the time taken by different local shards to process the allocated transactions under the same transaction arrival rate and transaction quantity; Due to the different performance of different local shards, the random allocation method randomly allocates transactions to different local shards, which does not match the processing capacity of the local shards. There are large differences in transaction processing time between local shards, and the resources of local shards cannot be reasonably utilized; LB-Chain mainly considers the difference in the number of transactions between different shards. Although the transaction processing time balancing effect is greatly improved compared with the random allocation method, it does not consider the performance difference between different shards and the impact of transaction size on processing time; although the transaction processing time of different shards in EFSHARD is relatively balanced, the transaction processing time is always higher than that of the patent method because the real-time allocation of transactions increases the delay in transaction allocation; the method proposed in this embodiment considers the transaction size, number and performance of the shards when calculating the load value, which can balance the time for local shards to process transactions. It can be seen from the figure that the transaction processing time of different local shards is close and the fluctuation is small, so the method proposed in this embodiment is feasible.

[0028] like Figure 6 As shown, in order to verify that the method proposed in this embodiment can reduce transaction processing delay and has advantages in cross-chain transaction throughput, the method proposed in this embodiment counts transaction processing delay and transaction throughput under the above-mentioned optimal block size and number of nodes, and selects CrossChannel, Notary and RAC-Chain as comparison methods; The transaction processing delay of the method proposed in this embodiment is lower than that of CrossChannel, Notary and RAC-Chain, and the transaction throughput is higher than the three comparative methods; CrossChannel uses an off-chain micropayment channel to realize cross-chain asset exchange, and uses a channel snapshot mechanism to include all channel-related information in short content for relaying to improve the scalability of chain relays; however, it takes a long time to create and close off-chain channels, which affects the cross-chain transaction throughput; Notary designs a new reputation value calculation and node selection model to improve node enthusiasm and improve the efficiency of processing cross-chain transactions, but this model It mainly targets the reputation of nodes and reduces the occurrence of malicious behaviors. When facing a large number of transactions, communication delay overhead and transaction processing time will still affect the cross-chain transaction throughput. RAC-Chain is a cross-chain model based on relay chain and asynchronous consensus. Asynchronous consensus can tolerate extreme delays and effectively handle transactions with extreme delays. At the same time, the scalability of the cross-chain system is effectively improved through relay chains and multiple cross-chain gateways, which can achieve fast transmission of cross-chain transactions. Its throughput is higher than CrossChannel and Notary, but RAC-Chain does not consider the waiting time and communication delay of transactions and cannot process transactions in parallel. The method proposed in this embodiment shards the relay chain, improves the transaction allocation method, fully considers the performance of the shards and the load caused by the transaction when allocating transactions, considers the impact of the transaction size and the number of transactions on the communication delay, allocates the transaction to the appropriate shard, and fully utilizes the resources of each shard; at the same time, the method proposed in this embodiment performs a stability analysis of the transaction queue during the transaction processing process, fine-tunes the transactions in the unstable queue in a fine-grained manner, and avoids long waiting times for some transactions; the method proposed in this embodiment reduces the transaction processing delay by fully utilizing the shard resources and reducing the transaction waiting time; therefore, the method proposed in this embodiment can process a large number of concurrent transactions in parallel, reduce transaction processing delays, and improve the transaction throughput of the system.

[0029] Example 2 A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the following method: Obtain the cross-chain transaction package and historical cross-chain transaction information of the target parallel chain; Based on the historical cross-chain transaction information of the target parachain, determine the optimal transaction allocation plan to balance the load of local shards; Based on the optimal transaction allocation plan, the cross-chain transaction packages are allocated to each local shard to generate a cross-chain transaction queue.

[0030] 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.

[0031] 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.

[0032] 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 including an instruction device, which implements the process Figure 1 A function specified in a process or multiple processes.

[0033] 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 in the computer or other programmable device. Figure 1 The steps of a specified function in a process or multiple processes.

[0034] 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 blockchain cross-chain transaction method, characterized in that: include: Obtain the cross-chain transaction package and historical cross-chain transaction information of the target parallel chain; Based on the historical cross-chain transaction information of the target parachain, determine the optimal transaction allocation scheme that balances the load of cross-chain transaction packets processed by local shards; Based on the optimal transaction allocation plan, the cross-chain transaction packages are allocated to each local shard to generate a cross-chain transaction queue.

2. The blockchain cross-chain transaction method according to claim 1, characterized in that: Determining the optimal transaction allocation scheme for balancing the load of cross-chain transaction packets processed by local shards based on the historical cross-chain transaction information of the target parallel chain includes: Calculate the local shard load value and the local shard remaining load value based on the historical cross-chain transaction information of the target parachain; According to the local shard load value and the local shard remaining load value, the optimal transaction allocation scheme for balancing the local shard load is determined.

3. The blockchain cross-chain transaction method according to claim 2, characterized in that: The calculating of the local shard load value and the local shard remaining load value according to the historical cross-chain transaction information of the target parallel chain includes: Determine the number and size of cross-chain transactions based on the historical cross-chain transaction information of the target parachain; Obtain the number of remaining transactions in the local shard, the size of remaining transactions, and the transaction throughput of the local shard; The local shard load value and the local shard residual load value are calculated based on the number of cross-chain transactions, the size of cross-chain transactions, the number of remaining transactions in the local shard, the size of the remaining transactions, and the transaction throughput of the local shard.

4. The blockchain cross-chain transaction method according to claim 3, characterized in that: The calculating of the local shard load value and the local shard remaining load value according to the number of cross-chain transactions, the size of cross-chain transactions, the number of remaining transactions in the local shard, the size of remaining transactions, and the transaction throughput of the local shard includes: According to the number and size of cross-chain transactions, a multi-attribute description matrix of the load caused by cross-chain transactions on local shards is constructed. The multi-attribute description matrix of the load is shown in the following formula: ; in: Represents the multi-attribute description matrix of the load, Indicates i The number of transactions that will be generated in the parachain, Indicates i The size of the transactions that will be generated in each parachain, , Indicates the number of parallel chains; According to the number of remaining transactions in the local shards, the size of the remaining transactions, and the transaction throughput of the local shards, a multi-attribute description matrix of the remaining load in the local shards is constructed. The multi-attribute description matrix of the remaining load is shown in the following formula: ; in: Represents the multi-attribute description matrix of the residual load, Indicates i The number of remaining transactions in each local shard, Indicates i The size of the remaining transactions in each local shard, Indicates i The transaction throughput of each local shard, , Indicates the total number of local fragments; Based on the multi-attribute description matrix of load and the multi-attribute description matrix of residual load, the weight of each attribute of the number of cross-chain transactions, the size of cross-chain transactions, the number of remaining transactions in the local shards, the size of remaining transactions, and the transaction throughput of the local shards are calculated: The multi-attribute description matrix of the load and the multi-attribute description matrix of the remaining load are standardized by the following formula: ; ; in: express The standardized matrix of the matrix after unifying the indicator type, Representation Matrix Middle i +1 line j +1 column elements, , , The matrix after unified indicators is: ; express The matrix after unified indicators; Represents a standardized matrix Middle i +1 line j +1 column elements, , j =0, Indicates the value of the unified indicator type for the number of cross-chain transactions. j =1, Indicates the value after the cross-chain transaction size is unified into the indicator type. ; express The standardized matrix of the matrix after unifying the indicator type, Represents a standardized matrix Middle i +1 line j +1 column elements, , , The matrix after unified indicators is: ; express The matrix after unified indicators; Represents a standardized matrix D Middle i +1 line j +1 column elements, , j =0, represents the number of remaining transactions in the local shard, j =1, Indicates the size of the remaining transactions, j =2, Indicates the value of the transaction throughput of the local shard after unifying the indicator type. ; The final weight of each attribute is calculated by the following formula: ; ; ; ; ; in: Represents the weight of the number of cross-chain transactions, The weight representing the size of the cross-chain transaction; Information entropy representing different attributes of cross-chain transactions, ; Indicates the probability values ​​of the two attributes of cross-chain transaction quantity and cross-chain transaction size generated by the parallel chain. ; The weight representing the number of remaining transactions in the local shard, represents the weight of the remaining transaction size in the local shard, The weight representing the transaction throughput of the local shard; The information entropy representing the number of remaining transactions in the local shard, the remaining transaction size, and the transaction throughput of the local shard, ; Represents the probability value of the number of remaining transactions in the local shard, the remaining transaction size and the transaction throughput of the local shard, ; Based on the final weight of each attribute, the optimal attribute optimistic distance and the worst attribute pessimistic distance of each attribute are calculated: According to the final weight of each attribute, construct a weighted matrix and weight matrix U , where the weight matrix Middle i Line j The elements of the column are represented as , ; Weighting Matrix U Middle i Line j The elements of the column are represented as , ; By Collection Represents a standardized matrix , standardized matrix The optimal attribute set for each column element in , , through the collection Represents a standardized matrix , standardized matrix The worst attribute set of each column element in , ;when hour, Represents the weight matrix Middle i +1 maximum value of the column elements, Represents the weighted matrix i +1 minimum value of the column elements; when hour, Represents the weight matrix Middle i -1 The maximum value of the column elements, Represents the weighted matrix i -1 The minimum value of the column elements; The weighting matrix is ​​calculated by the following formula Optimistic distance between the median attribute value and the optimal attribute value : ; hour, Represents the weight matrix Middle j +1 maximum value of the column elements, Represents the weighted matrix j +1 minimum value of the column elements; Represents the weight matrix Middle i- 1st row j Elements of a column; The weighting matrix is ​​calculated by the following formula Pessimistic distance between the median attribute value and the worst attribute value : ; The weighting matrix is ​​calculated by the following formula U Optimistic distance between the median attribute value and the optimal attribute value : ; hour, Represents the weight matrix Middle j +1 maximum value of the column elements, Represents the weighted matrix j +1 minimum value of the column elements; Represents the weight matrix U Middle i- 1st row j Elements of a column; The weighting matrix is ​​calculated by the following formula U Pessimistic distance between the median attribute value and the worst attribute value : ; The local slice load value is calculated by the following formula : ; in: represents the selection factor, , , Indicates to be assigned, when the weight matrix and weight matrix U When the distance between the attribute value of each row in and the corresponding optimal attribute value is greater than the distance between the attribute value and the corresponding worst attribute value, Assign a value of 1, otherwise Assign a value of 0; Indicates the threshold for selecting optimistic or pessimistic distance calculation; The remaining load value of each local slice is calculated by the following formula: : ;in: represents the selection factor, , .

5. The blockchain cross-chain transaction method according to claim 2, characterized in that: Determining the optimal transaction allocation scheme for balancing the load of the local shards according to the local shard load value and the local shard remaining load value includes: using a spider bee optimization algorithm to determine the optimal transaction allocation scheme, wherein: make Spider Wasp h Daizhongdi i A distribution scheme for cross-chain transactions on parallel chains. , q ij Indicates i The first j A spider, j ∈{1, 2,…, M }, M Indicates the number of parallel chains; Initializing the spider wasp population using the local slice load value and the local slice residual load value; Calculate the population fitness of the initialized spider wasp population; Select the individual with the smallest fitness in each population and store the selected individual in an array; Use the array as the optimal trade allocation scheme.

6. The blockchain cross-chain transaction method according to claim 5, characterized in that: The calculating of the population fitness of the initialized spider wasp population includes: taking the load variance between local fragments as the population fitness, wherein: The average load value is calculated based on the local slice load value and the local slice residual load value. The average load value is calculated by the following formula: ; in: Indicates the average load value, Indicates r The load value caused by each parallel chain to the local shard, Indicates r The remaining load value of each local slice, Indicates the number of parallel chains, N Indicates the number of local fragments; Based on the average load value, calculate the load variance between local slices. The load variance between local slices is calculated by the following formula: ; in: Represents the load variance between local slices; Indicates k The load value caused by each parachain on the local shard; Represents the judgment factor, when q jk =r hour, =1, indicating the k Transactions of parachains are assigned to local shards r ,when q jk ≠ r hour, =0, indicating the k Parachain transactions are not assigned to local shards r .

7. The blockchain cross-chain transaction method according to claim 1, characterized in that: Based on the optimal transaction allocation scheme, the cross-chain transaction packages are allocated to each local shard to generate a cross-chain transaction queue, including: Obtain cross-chain transaction packages and distribute them to the transaction queues in each local shard; Perform stability analysis on transaction queues to identify unstable queues; Fine-tune transactions in the unstable queue between local shards to obtain a stable cross-chain transaction queue.

8. The blockchain cross-chain transaction method according to claim 7, characterized in that: The stability analysis of the transaction queue to determine the unstable queue includes: The real-time length of the transaction queue is calculated by the following formula: ; in: Indicates i local segments in time slots v +1 transaction queue length at the start; Indicates i local segments in time slots v The length of the transaction queue at the beginning; Indicates time slot v Inside i The number of transactions processed by each local shard; Indicates time slot v Arrival within i The number of transactions that are sharded and waiting in the transaction queue; According to the real-time length of the transaction queue, determine the total transaction queue backlog scalar of all local shards; calculate the total transaction queue backlog scalar of all local shards by the following formula: ; in: Indicates the total transaction queue in time slot v The backlog scalar; , Indicates that the local segment is in the time slot v The set of transaction queue lengths at the start, , N Indicates the number of local fragments; Determine the queue stability based on the change in the total transaction queue backlog scalar, where: , then the queue is unstable; represents mathematical expectation; Indicates the change in the total transaction queue backlog scalar, , Indicates the total transaction queue in time slot v +1 for the backlog scalar.

9. The blockchain cross-chain transaction method according to claim 7, characterized in that: The transactions in the unstable queue are fine-tuned between local shards to obtain a stable cross-chain transaction queue, including: Get the number of sub-transactions in the unstable queue and the number of transactions waiting to be processed in the queue; According to the number of sub-transactions in the unstable queue and the number of transactions waiting to be processed in the queue, the number of transactions that need to be fine-tuned in the unstable queue is determined. The number of transactions that need to be fine-tuned in the unstable queue is calculated by the following formula: ; in: Indicates i local segments in time slots The number of trades that need to be fine-tuned at the beginning, Indicates the i local segments in time slots v +1 transaction queue length at the start; Indicates i The number of sub-transactions in the transaction queue of each local shard; Selecting the appropriate local shard transfer requires fine-tuning transactions if the local shard to be selected satisfies the following formula: ; in: Indicates time slot v Inside i The number of transactions processed by each local shard; Indicates time slot v Arrival within i The number of transactions that are sharded and waiting in the transaction queue; Then the local slice to be selected is a suitable local slice; Transfer transactions that need fine-tuning to the appropriate local shards to obtain a stable cross-chain transaction queue.

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

Citation Information

Cited By

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

    CN119996493A