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

By monitoring transaction data and calculating fission index in the cross-chain system, the new relay chain is dynamically expanded, and the blockage and delay problems of cross-chain system at high transaction load is solved, and more efficient cross-chain transaction processing is achieved.

CN119996493BActive Publication Date: 2025-06-27INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510443712.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-06-27
Estimated Expiration
2045-04-10

AI Technical Summary

Technical Problem

The existing cross-chain system cannot process it in time when a large number of transaction requests are suddenly increased, resulting in transaction congestion and increased delays, and even some transaction requests cannot be issued within the specified time.

Method used

By receiving monitoring requests from the relay domain, the cross-chain transaction data of the cross-chain gateway corresponding to the blockchain is monitored, and the fission index is calculated. When the fission index is greater than or equal to the preset expansion threshold, the new relay chain is expanded to undertake the transmission of some cross-chain transactions.

Benefits of technology

Dynamically expand the relay chain, disperse the cross-chain transaction load, reduce the transmission pressure of the original relay chain, improve cross-chain transaction efficiency, and reduce transaction delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119996493B_ABST
    Figure CN119996493B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, medium and program product for extending a relay chain for cross-chain interoperability, which relates to the field of blockchain technology. It includes: The monitoring request is initiated by any cross-chain gateway in the relay domain when it detects that its first average cross-chain load index is greater than or equal to the monitoring threshold. The cross-chain transactions initiated by the first average cross-chain load index corresponding to this cross-chain gateway can cause transmission blockages and lead to an increase in transmission delay. Therefore, it is necessary to monitor the cross-chain transaction data of the blockchains corresponding to at least one cross-chain gateway and calculate the fission index, so as to determine to extend a new relay chain in the relay domain based on the fission index. In the present application, after a new relay chain is extended, the new relay chain can undertake part of the cross-chain transaction transmission, thus dispersing the cross-chain transactions. Therefore, the transmission pressure is reduced, the delay during the cross-chain transaction process of the blockchain group is decreased, and the transaction efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a method, device, medium and program product for extending a relay chain for cross-chain interoperability. Background Art

[0002] With the development of industries such as finance and healthcare, heterogeneous blockchain ecosystems have emerged. A blockchain ecosystem may include multiple blockchains. Although each blockchain is independent, the need for collaboration between blockchains has been increasing, thus enabling cross-chain services.

[0003] In the related art, when initiating a blockchain, a transaction request needs to be sent to the corresponding cross-chain gateway. The cross-chain gateway then sends the transaction request to a specified relay chain, and the relay chain acts as a transfer station for the transaction request and sends the transaction request to the destination blockchain, so that the destination blockchain executes the transaction content in the transaction request. However, in the existing cross-chain system, when a large number of transaction requests suddenly increase, the cross-chain system may not be able to process each transaction request, resulting in transaction congestion and increased transaction latency; even some transaction requests cannot be sent within the specified time, causing the transaction requests to be suspended. Summary of the Invention

[0004] The present application provides a method, device, medium and program product for extending a relay chain for cross-chain interoperability to at least solve the problem of increased transaction latency in the related art.

[0005] In a first aspect, the present application provides a method for extending a relay chain for cross-chain interoperability, including:

[0006] Receiving a monitoring request corresponding to any relay domain, and monitoring cross-chain transaction data of at least one blockchain corresponding to a cross-chain gateway in the relay domain based on the monitoring request; the monitoring request is initiated by any cross-chain gateway in the relay domain when detecting that its first average cross-chain load index is greater than or equal to a monitoring threshold; cross-chain transactions initiated when the first average cross-chain load index is greater than or equal to the monitoring threshold may cause transmission congestion;

[0007] Calculating a second average cross-chain load index of at least one blockchain group based on the cross-chain transaction data corresponding to each blockchain; the blockchain group includes any two blockchains that generate transactions in the relay domain;

[0008] Calculating a fission index based on the second average cross-chain load index;

[0009] In response to the fission index being greater than or equal to a preset extension threshold, determining an initial node of a newly extended relay chain in the relay domain;

[0010] Controlling the initial node to start to extend a new relay chain in the relay domain; the new relay chain is used to undertake the transmission of part of the cross-chain transactions.

[0011] In a second aspect, the present application further provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any of the above cross-chain interoperable relay chain extension methods when executing the computer program.

[0012] In a third aspect, the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program implements the steps of any of the above cross-chain interoperable relay chain extension methods when executed by a processor.

[0013] In a fourth aspect, the present application further provides a computer program product including a computer program, and the computer program implements the steps of any of the above cross-chain interoperable relay chain extension methods when executed by a processor.

[0014] Through a cross-chain interoperable relay chain extension method, device, medium, and program product provided by the present application, a monitoring request corresponding to any relay domain is received, so as to monitor the cross-chain transaction data of the blockchain corresponding to at least one cross-chain gateway in the relay domain, and then a fission index is calculated based on the cross-chain transaction data. If the fission index is greater than or equal to a preset extension threshold, then the relay chain extension device (hereinafter referred to as the extension device) will determine the initial nodes of the newly extended relay chain, thereby extending a new relay chain. In the present application, the monitoring request is initiated by any cross-chain gateway in the relay domain when it detects that its first average cross-chain load index is greater than or equal to the monitoring threshold. At this time, in the entire cross-chain system, the cross-chain transactions generated by the first average cross-chain load index corresponding to this cross-chain gateway may cause congestion during the transmission of the cross-chain system. The cross-chain system includes a relay chain, and the relay domain serves as a transfer station. Therefore, when congestion occurs, it is very likely to cause cross-chain transaction delays and even make some cross-chain transactions unable to be processed. Therefore, in this solution, after the extension device receives the monitoring request, it can monitor the cross-chain transaction data of the blockchain corresponding to at least one cross-chain gateway therein and calculate the fission index, so as to decide whether to extend a new relay chain in the relay domain based on the size of the fission index; in the present application, after a new relay chain is extended, the relay domain includes the new relay chain and the previous relay chain, and each relay chain can undertake its own part of cross-chain transactions, that is, it can undertake the transactions between the blockchain groups it is connected to. Therefore, the new relay chain in the present application can undertake part of the cross-chain transaction transmission, thereby dispersing the cross-chain transactions. Each relay chain only undertakes a part of the cross-chain transactions, thus reducing the transmission pressure on the previous relay chain, reducing the delay during the cross-chain transaction process of the blockchain group, and improving the cross-chain transaction efficiency. It can be seen that the present application can dynamically extend the relay chain, so that in different application scenarios, according to the sudden increase in the number of cross-chain transactions, a new relay chain is dynamically extended, and the new relay chain undertakes part of the cross-chain transaction transmission. Description of the Drawings

[0015] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0016] Figure 1 It is a scenario diagram of a relay chain extension method for cross-chain interoperability provided by the present application;

[0017] Figure 2 It is a schematic flowchart of a relay chain extension method for cross-chain interoperability provided for Embodiment 1;

[0018] Figure 3 It is a schematic diagram of a cross-chain system provided for Embodiment 1;

[0019] Figure 4 It is a schematic diagram of relay chain extension provided for Embodiment 1;

[0020] Figure 5 It is a schematic diagram of the structure of an intelligent network card provided for Embodiment 3;

[0021] Figure 6 It is a schematic diagram of the structure of a relay chain extension device provided for Embodiment 13;

[0022] Figure 7 It is a schematic diagram of the structure of an electronic device provided by the present application. Specific Embodiments

[0023] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.

[0024] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device including a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.

[0025] In the related art, to initiate a blockchain, a transaction request needs to be sent to the corresponding cross-chain gateway. The cross-chain gateway then sends the transaction request to the specified relay chain. The relay chain, acting as a transfer station for transaction requests, distributes the transaction request to the destination blockchain, enabling the destination blockchain to execute the transaction content in the transaction request. However, in existing cross-chain systems, when a large number of transaction requests suddenly increase, the cross-chain system is unable to process each transaction request in a timely manner. The transaction requests are arranged in the order of arrival at the relay chain and wait, resulting in transaction congestion and increased transaction latency. Even some of the later transaction requests cannot be distributed to the corresponding destination blockchain within the specified time, causing the transaction requests to be suspended. Or the cross-chain gateway in the cross-chain system may not be able to transmit the transaction request in a timely manner, also leading to transmission congestion. The above ultimate results all lead to transmission congestion in the cross-chain system.

[0026] To solve the problem of increased transaction latency in the related art, the inventors of this solution have proposed a method for expanding the relay chain for cross-chain interoperability through a series of improvements. Specifically, when a monitoring request is received, a fission index is calculated, and based on the size of the fission index, it is determined whether to expand a new relay chain. When the fission index is greater than or equal to a preset expansion threshold, a new relay chain is expanded. Thus, this solution can dynamically expand new relay chains. In addition, in this solution, the monitoring request is initiated when any cross-chain gateway detects that its first average cross-chain load index is greater than or equal to the monitoring threshold. The cross-chain transactions generated by the first average cross-chain load index may cause congestion in the relay chain corresponding to the cross-chain gateway during transaction transmission, or congestion in the cross-chain gateway, ultimately leading to congestion in the cross-chain system. Therefore, in this solution, a new relay chain needs to be expanded to undertake some cross-chain transactions, thereby alleviating the transmission pressure on the remaining relay chains in the relay domain. Among them, some cross-chain transactions can be the cross-chain transactions corresponding to the current situation when the first average cross-chain load index is greater than or equal to the monitoring threshold, or cross-chain transactions generated in subsequent transaction tasks.

[0027] It should be noted that in the entire relay domain, a new diversion strategy is established for some cross-chain gateways, and each cross-chain gateway connects to the new relay chain based on the new diversion strategy. The new relay chain is connected to the corresponding cross-chain gateway, and each cross-chain gateway is connected to the corresponding blockchain, enabling the new relay chain to undertake transactions between some blockchain groups. Among them, some cross-chain gateways represent some blockchain groups. The diversion strategy refers to the strategy for the corresponding cross-chain gateway to connect to the new relay chain. The cross-chain gateway that receives the diversion strategy can disconnect the current connection line with the relay chain and connect to the line of the new relay chain based on the diversion strategy.

[0028] To enable those skilled in the art of this technology to better understand the solution of this application, the following provides a further detailed description of this application in conjunction with the accompanying drawings and specific implementation manners.

[0029] In combination with the specific application environment architecture or specific hardware architecture on which the execution of the relay chain extension method for cross-chain interoperability depends, the specific application environment architecture or specific hardware architecture is described herein. Refer to Figure 1 , Figure 1 FIG. is an application scenario diagram of a relay chain extension method for cross-chain interoperability provided by this application. As Figure 1 shown, it includes an electronic device 101, a relay domain 102, a relay chain 103, a cross-chain gateway 104, and a blockchain 105.

[0030] Among them, the electronic device 101 can be a management device, and the management device can be a device such as a computer or a server, which is not limited herein.

[0031] Among them, the electronic device 101 is communicatively connected to the relay domain 102, and the communication connection method can be a wired method or a wireless method.

[0032] Among them, the relay domain 102 includes a relay chain 103, and there are four cross-chain gateways 104 below the relay chain 103, and each of the four cross-chain gateways 104 corresponds to a blockchain 105 below.

[0033] Among them, the four cross-chain gateways 104 are all connected to the relay chain 103, that is, the transactions of the corresponding four blockchains 105 are all transmitted through the relay chain 103, that is, relayed.

[0034] Specifically in this scenario, any one of the cross-chain gateways in the relay domain 102 sends a monitoring request to the electronic device 101, and the electronic device 101 receives the monitoring request and monitors the cross-chain transaction data of the blockchains 105 corresponding to each cross-chain gateway 104 based on the monitoring request.

[0035] Further, the electronic device 101 calculates a fission index based on the cross-chain transaction data. If the fission index is greater than or equal to a preset expansion threshold, a new relay chain is expanded from the relay domain 102.

[0036] Embodiment 1

[0037] The execution subject of Embodiment 1 to Embodiment 12 of this application is a relay chain extension device (hereinafter referred to as the extension device), and the extension device is located in the electronic device.

[0038] Figure 2 FIG. is a schematic flowchart of a relay chain extension method for cross-chain interoperability provided for Embodiment 1. As Figure 2 shown, it includes the following steps:

[0039] S201, receive a monitoring request corresponding to any relay domain, and monitor the cross-chain transaction data of at least one cross-chain gateway corresponding blockchain in the relay domain based on the monitoring request; the monitoring request is initiated by any cross-chain gateway in the relay domain when it detects that its first average cross-chain load index is greater than or equal to the monitoring threshold; cross-chain transactions initiated when the first average cross-chain load index is greater than or equal to the monitoring threshold may cause transmission blockage.

[0040] Among them, the monitoring request is initiated by any cross-chain gateway in any relay domain, and is used to instruct the electronic device to monitor the cross-chain transaction data of a blockchain corresponding to a cross-chain gateway.

[0041] Among them, the cross-chain gateway is an important part of the relay chain technology.

[0042] Among them, the first average cross-chain load index refers to the cross-chain load used to initiate the monitoring request in the corresponding cross-chain gateway. Among them, the first average cross-chain load index can be the data about transactions received or sent by the cross-chain gateway within any monitoring period (that is, the cross-chain transaction data within the monitoring period). Among them, the data about transactions includes the average monitoring delay data and the average number of monitored transactions corresponding to the blockchain within any monitoring period. The monitoring period can be every 1 minute or 2 minutes. There can be multiple monitoring periods. The monitoring period can start monitoring after receiving the monitoring request. The number of monitoring periods is not limited. Until the first average cross-chain load index of any monitoring period of any of the above cross-chain gateways is greater than or equal to the monitoring threshold, then any of the above cross-chain gateways generates a monitoring request and sends it to the electronic device to instruct the electronic device to continue monitoring the cross-chain transaction data corresponding to all cross-chain gateways.

[0043] Among them, the monitoring threshold refers to a threshold set in advance for whether to initiate a monitoring request.

[0044] Among them, the relay chain is a transfer station for blockchain groups to conduct transactions.

[0045] Among them, the relay domain includes the corresponding organization, specifically including: the corresponding blockchain, cross-chain gateway, and relay chain. The blockchain is connected to the corresponding cross-chain gateway, and the cross-chain gateway is connected to the relay chain. It should be noted that there can also be multiple relay domains in the entire cross-chain system. The blockchains in each relay domain can conduct transactions. At this time, the relay domain can also include another cross-chain gateway, which is connected to the global relay chain, and the global relay chain can realize the transmission of transactions of blockchains in different relay domains.

[0046] Figure 3 It is a schematic diagram of a cross-chain system provided for Embodiment 1.

[0047] Such as Figure 3Among them, the cross-chain system includes an electronic device 101, a first relay domain 302, and a second relay domain 303.

[0048] Among them, the first relay domain 302 includes a first blockchain 3021 and a second blockchain 3022. Among them, the first blockchain 3021 is connected to a first cross-chain gateway 3023, and the second blockchain 3022 is connected to a second cross-chain gateway 3024. Among them, both the first cross-chain gateway 3023 and the second cross-chain gateway 3024 are connected to a first relay chain 3025. Among them, the first relay chain 3025 is connected to a fifth cross-chain gateway 3026.

[0049] Among them, the second relay domain 303 includes a third blockchain 3031 and a fourth blockchain 3032. Among them, the third blockchain 3031 is connected to a third cross-chain gateway 3033, and the fourth blockchain 3032 is connected to a fourth cross-chain gateway 3034. Among them, both the third cross-chain gateway 3033 and the fourth cross-chain gateway 3034 are connected to a second relay chain 3035. Among them, the second relay chain 3035 is connected to a sixth cross-chain gateway 3036.

[0050] Among them, both the fifth cross-chain gateway 3026 and the sixth cross-chain gateway 3036 are connected to a third relay chain 304.

[0051] Among them, the third relay chain 304 is a secondary relay chain, the first relay chain 3025 and the second relay chain 3035 are primary relay chains, and each blockchain is a business blockchain.

[0052] Among them, the third relay chain 304 is a global relay chain.

[0053] In Figure 3 Among them, each relay domain is only shown with two blockchains as an example. In actual applications, the number of blockchains in each relay domain can be greater than 2. The pictures or exemplary examples in this application are only for simple illustration and do not represent the actual scenario applications.

[0054] Among them, cross-chain transaction data refers to the transaction data related to the received or sent corresponding blockchains. It should be noted that the transactions in this application are cross-chain transactions, that is, transactions between blockchains are realized. Among them, the transaction data includes delay data, transaction serial numbers, transaction times, and other data related to transactions.

[0055] It can be understood that when the first average cross-chain load index is greater than or equal to the monitoring threshold, the corresponding number of transactions may be relatively large, which may lead to the corresponding relay chain being unable to ensure fast transmission when realizing transaction transmission, so it may cause congestion.

[0056] S202. Calculate the second average cross-chain load index of at least one blockchain group based on the cross-chain transaction data corresponding to each blockchain; the blockchain group includes any two blockchains that generate transactions in the relay domain.

[0057] Among them, the blockchain group refers to two blockchains that generate transactions. Exemplarily, in Figure 3 , assuming that the first blockchain 3021 and the second blockchain 3022 generate transactions, then the above two blockchains form a blockchain group. It should be noted that the above blockchain group is in the same relay domain. In actual situations, blockchains in different relay domains can also form a blockchain group, which will not be elaborated here.

[0058] Among them, the second average cross-chain load index refers to the cross-chain load corresponding to the blockchain group.

[0059] Exemplarily, assume that there are a total of three blockchains in a relay domain, namely blockchain 1, blockchain 2, and blockchain 3. Transactions are generated pairwise between each blockchain, thus forming three blockchain groups, namely blockchain group (1,2), blockchain group (1,3), and blockchain group (2,3).

[0060] Furthermore, the expansion device calculates the second average cross-chain load index corresponding to the above three blockchain groups based on the cross-chain transaction data.

[0061] S203. Calculate the fission index based on the second average cross-chain load index.

[0062] Among them, the fission index is used to evaluate whether a new relay chain needs to be expanded in this relay domain.

[0063] S204. In response to the fission index being greater than or equal to the preset expansion threshold, determine the initial node of the newly expanded relay chain in the relay domain.

[0064] Among them, the preset expansion threshold is the expansion criterion. As long as the fission index is greater than or equal to the preset expansion threshold, it is determined that a new relay chain needs to be expanded, that is, the first step is to determine the initial node of the expanded relay chain.

[0065] Among them, the initial node is the computing node, etc. in the relay chain.

[0066] It can be understood that the relay chain is actually composed of nodes.

[0067] It can be understood that the number of nodes included in different relay chains can be inconsistent, which is not restricted here.

[0068] S205. Control the initial node to start to expand a new relay chain in the relay domain; the new relay chain is used to undertake the transmission of part of the cross-chain transactions.

[0069] It should be noted that when the initial node is controlled to start and the initial node goes online at this time, a new relay chain is formed.

[0070] Figure 4 It is a schematic diagram of the expansion of a relay chain provided for the first embodiment. As Figure 4 shown, it includes before and after expansion. Figure 4 It is the expansion of the A relay domain 400.

[0071] Among them, Figure 4 before expansion, it includes the initial relay chain 401, four cross-chain gateways 402, and four blockchains 403.

[0072] Among them, the four cross-chain gateways 402 include the A cross-chain gateway 4021, the B cross-chain gateway 4022, the C cross-chain gateway 4023, and the D cross-chain gateway 4024.

[0073] Among them, the four blockchains 403 include the A blockchain 4031, the B blockchain 4032, the C blockchain 4033, and the D blockchain 4034.

[0074] Figure 4 after expansion, it includes the new relay chain 404.

[0075] Figure 4 Before expansion, each blockchain 403 is respectively connected to its own cross-chain gateway 402, and each cross-chain gateway 402 is connected to the initial relay chain 401.

[0076] Figure 4 After expansion, each blockchain 403 is respectively connected to its own cross-chain gateway 402. Among them, the A cross-chain gateway 4021 and the B cross-chain gateway 4022 are both connected to the initial relay chain 401, and the C cross-chain gateway 4023 and the D cross-chain gateway 4024 are both connected to the new relay chain 404.

[0077] In Figure 4 it should be noted that before expansion, each cross-chain gateway 402 is connected to the initial relay chain 401. Furthermore, the blockchain group formed by the four blockchains 403 conducts transaction transmission through the initial relay chain 401.

[0078] In this application, if any cross-chain gateway 402 in the A relay domain 400 issues a monitoring request, then the electronic device monitors all the cross-chain gateways 402 in the A relay domain 400, calculates the fission index, determines the relay chain that needs to be extended based on the fission index, and thus obtains a new relay chain 404. It can be seen that in this embodiment, as long as the monitoring request sent by any cross-chain gateway 402 is responded to, the electronic device needs to monitor all the cross-chain gateways, and then complete the extension of the new relay chain. Therefore, in this embodiment, it is not necessary for all cross-chain gateways or two or more cross-chain gateways to send monitoring requests to instruct the electronic device to monitor all cross-chain gateways, so the threshold for monitoring can be reduced.

[0079] This embodiment provides a method for extending a relay chain for cross-chain interoperability. In this embodiment, when a monitoring request corresponding to any relay domain is received, the cross-chain transaction data of at least one cross-chain gateway corresponding blockchain in the relay domain is monitored, and the fission index is calculated based on the cross-chain transaction data. If the fission index is greater than or equal to the preset extension threshold, then the relay chain extension device (hereinafter referred to as the extension device) will determine the initial node of the newly extended relay chain, and thus extend a new relay chain. In this embodiment, the monitoring request is initiated by any cross-chain gateway in the relay domain when it detects that its first average cross-chain load index is greater than or equal to the monitoring threshold. At this time, in the entire cross-chain system, the transactions generated by the first average cross-chain load index corresponding to this cross-chain gateway can cause congestion in the transmission of the relay chain connected to this cross-chain gateway. Since this relay chain serves as a transfer station in this relay domain, when congestion occurs, it is very likely to cause transaction delays and even make some transactions unable to be processed. Therefore, in this solution, after the extension device receives the monitoring request, it can monitor the cross-chain transaction data of at least one cross-chain gateway corresponding blockchain and calculate the fission index, and then determine whether a new relay chain needs to be extended in the relay domain based on the size of the fission index; in this embodiment, after a new relay chain is extended, the new relay chain and the previous relay chain are included in this relay domain, and each relay chain can undertake its own part of the cross-chain transactions, that is, it can undertake the cross-chain transactions between the blockchain groups it is connected to. Therefore, in this embodiment, the new relay chain can undertake part of the cross-chain transaction transmission, thus dispersing the cross-chain transactions. Each relay chain only undertakes a part of the cross-chain transactions, so the transmission pressure on the previous relay chain is reduced, the delay during the transaction process of the blockchain group is reduced, and the cross-chain transaction efficiency is improved. It can be seen that in this embodiment, dynamic extension of the relay chain can be achieved, so that in different application scenarios, according to the sudden increase in the number of transactions, a new relay chain can be dynamically extended, and the new relay chain undertakes part of the cross-chain transaction transmission.

[0080] Embodiment 2

[0081] This embodiment is a further refinement of any of the above embodiments. This embodiment is an optional way to monitor the cross-chain transaction data of the blockchains corresponding to at least one cross-chain gateway in the relay domain based on a monitoring request, including:

[0082] Monitor and obtain the cross-chain transaction data of the corresponding blockchains within a preset time period from at least one cross-chain gateway based on the monitoring request.

[0083] Among them, the preset time period refers to a pre-set time period. For example, the preset time period can be a period closest to the current time, or a time after the period closest to the current time, and there is no limit here.

[0084] It should be noted that assuming there are three cross-chain gateways, namely cross-chain gateway 1, cross-chain gateway 2, and cross-chain gateway 3, the electronic device needs to obtain the cross-chain transaction data 1 of the corresponding blockchain 1 from cross-chain gateway 1. The cross-chain transaction data 1 includes the transaction data of at least one blockchain group to which blockchain 1 belongs. Among them, the at least one blockchain group to which blockchain 1 belongs can include blockchain group (1,2) and blockchain group (1,3). Among them, blockchain group (1,2) refers to the blockchain group composed of blockchain 1 and blockchain 2.

[0085] Similarly, the electronic device can also obtain the cross-chain transaction data 2 of the corresponding blockchain 2 from cross-chain gateway 2. Among them, the cross-chain transaction data 2 includes the transaction data of at least one blockchain group to which blockchain 2 belongs. Among them, the at least one blockchain group to which blockchain 2 belongs can be blockchain group (1,2) and blockchain group (2,3).

[0086] This embodiment also includes an optional way to calculate the second average cross-chain load index of at least one blockchain group based on the monitoring request. Specifically:

[0087] Step 1, calculate the cross-chain load index of each blockchain group within the preset time period based on each cross-chain transaction data.

[0088] Among them, the cross-chain load index refers to the comprehensive index of the cross-chain load of the blockchain group to which the corresponding blockchain belongs obtained in the cross-chain gateway.

[0089] It should be noted that in each cross-chain gateway, the cross-chain transaction data corresponding to at least one blockchain group to which the corresponding blockchain belongs can be obtained, and the cross-chain load corresponding to at least one blockchain group to which the corresponding blockchain belongs can be calculated respectively based on the cross-chain transaction data. Among them, the cross-chain load can be delay data and the total number of completed transactions, specifically the first total delay data and the first total number of completed transactions in this application.

[0090] Step 2, calculate the second average cross-chain load index based on the cross-chain load index.

[0091] Further, by averaging the above cross-chain load indexes, a second average cross-chain load index can be obtained.

[0092] This embodiment provides a method for expanding a relay chain for cross-chain interoperability. In this embodiment, cross-chain transaction data of a corresponding blockchain within a preset time is obtained from at least one cross-chain gateway, and then a second average cross-chain load index can be calculated.

[0093] Embodiment III

[0094] This embodiment is a further refinement of any of the above embodiments. This embodiment is an optional way to monitor and obtain cross-chain transaction data of a corresponding blockchain within a preset time period based on a monitoring request, including:

[0095] Obtaining cross-chain transaction data of a corresponding blockchain within a preset time period from a smart network card in at least one cross-chain gateway based on a monitoring request; the smart network card includes a monitoring management unit, and the monitoring management unit is used to monitor the transmission data of the corresponding blockchain; the transmission data includes cross-chain transaction data.

[0096] It should be noted that another innovation point in this application is that the cross-chain gateway in this application has an additional smart network card compared with the cross-chain gateway in the related art. The smart network card is located in the hardware device of the cross-chain gateway. The cross-chain gateway in this application may further include a performance detection module, which is not available in the related art. The performance detection module can read the cross-chain transaction data within a monitoring period, and then calculate a first average cross-chain load index based on the cross-chain transaction data within the monitoring period, and compare the first average cross-chain load index with a monitoring threshold. If the first average cross-chain load index is greater than or equal to the monitoring threshold, the performance detection module generates a monitoring request, and the above monitoring request is used to instruct the electronic device to monitor the cross-chain transaction data of all cross-chain gateways in the relay domain. In this application, when the first average cross-chain load index is greater than or equal to the monitoring threshold, it is considered that the transmission performance of the corresponding relay chain has reached a bottleneck. It should be noted that the performance detection module can read the cross-chain transaction data within the monitoring period in the smart network card.

[0097] In this application, the smart network card includes a monitoring management unit, and the monitoring management unit can monitor the transmission data of the corresponding blockchain, and the transmission data includes cross-chain transaction data.

[0098] It should be noted that since the cross-chain gateway in this application newly deploys a performance detection module, it can read the cross-chain transaction data in the smart network card, and then detect its own first average cross-chain load index, and then generate a monitoring request, thereby triggering the electronic device to monitor at least one cross-chain gateway in the relay domain.

[0099] Figure 5 Schematic diagram of an intelligent network card provided for Embodiment 3. As Figure 5 shown, the intelligent network card includes: a bus interface 501, a transmit memory 502, a receive memory 503, a transmit direct memory access channel 504, a receive direct memory access channel 505, a direct memory access channel control and status register 506, a media transport layer transmit first-in-first-out controller 507, a media transport layer receive first-in-first-out controller 508, a media transport layer control and status register 509, a media access control transmit module 510, a media access control receive module 511, a media access control and status register 512, and a physical layer 513.

[0100] Among them, a monitoring and management unit 514 is included in the transmit direct memory access channel 504 and the receive direct memory access channel 505.

[0101] It should be noted that the monitoring and management unit included in the intelligent network card in this application can read the transceiver data, so that the transceiver data can be included in the corresponding memory, and then the performance detection module can obtain the cross-chain transaction data from the corresponding memory.

[0102] This embodiment provides a method for extending a relay chain for cross-chain interoperability. In this embodiment, the intelligent network card includes a monitoring and management unit, and the monitoring and management unit monitors the transmission data of the corresponding blockchain, so that the electronic device can obtain the cross-chain transaction data within a preset time period in the intelligent network card, realizing the intelligence of the cross-chain gateway.

[0103] Embodiment 4

[0104] This embodiment is a further refinement of any of the above embodiments. In this embodiment, the cross-chain transaction data includes the completion transaction sub-delay data and the completion transaction serial number of each blockchain group to which the corresponding blockchain belongs.

[0105] This embodiment is an optional way to calculate the cross-chain load index of each blockchain group within a preset time period based on each cross-chain transaction data, and includes the following steps:

[0106] Step 1, for each blockchain, calculate the corresponding first total delay data of each blockchain group to which the blockchain belongs within a preset time period; the first total delay data is the sum of the completion transaction sub-delay data in the blockchain group to which the blockchain belongs.

[0107] It should be noted that for each blockchain, calculate the first total delay data of at least one blockchain group corresponding to each blockchain.

[0108] Exemplarily, for blockchain 1, corresponding to two blockchain groups (1, 2) and blockchain group (1, 3), for the blockchain group (1, 2) corresponding to blockchain 1, add up at least one completed transaction sub-delay data corresponding to the blockchain group (1, 2) to obtain the first total delay data A corresponding to the blockchain group (1, 2) within a preset time period; similarly, for the blockchain group (1, 3) corresponding to blockchain 1, add up at least one completed transaction sub-delay data corresponding to the blockchain group (1, 3) to obtain the first total delay data B corresponding to the blockchain group (1, 3) within a preset time period.

[0109] Exemplarily, for blockchain 2, corresponding to two blockchain groups (1, 2) and blockchain group (2, 3), for the blockchain group (1, 2) corresponding to blockchain 2, add up at least one completed transaction sub-delay data corresponding to the blockchain group (1, 2) to obtain the first total delay data C corresponding to the blockchain group (1, 2) within a preset time period.

[0110] It can be understood that after the above steps, for the cross-chain transaction data of different blockchains, the first total delay data of the corresponding blockchain groups can be obtained. And since two blockchains are included in the blockchain group, the first total delay data of the corresponding blockchain groups can be calculated respectively for the above two blockchains. Thus, it can be seen that the blockchain group corresponds to two first total delay data. As can be seen from the above, both the first total delay data A and the first total delay data C are the first total delay data of the blockchain group (1, 2), which are two.

[0111] Step 2: For each blockchain, calculate respectively the first total number of completed transactions corresponding to each blockchain group of the blockchain within a preset time period; the first total number of completed transactions is the number of completed transaction serial numbers in the blockchain group to which the blockchain belongs.

[0112] Calculate the first total number of completed transactions corresponding to each blockchain group according to the same method as in Step 1 above.

[0113] It should be noted that when a transaction is completed, the cross-chain gateway can record the corresponding transaction serial number, and then the electronic device can calculate the number of completed transaction serial numbers, which can represent the first total number of completed transactions.

[0114] Among them, the first total number of completed transactions is a type of cross-chain load.

[0115] Step 3: For each blockchain group, calculate respectively the cross-chain load index of the blockchain group within a preset time period based on the first total delay data and the first total number of completed transactions of the blockchain group.

[0116] Based on the above, taking the blockchain group as a benchmark, the corresponding cross-chain load index can be calculated respectively based on the corresponding first total delay data.

[0117] It should be noted that after calculating the first total delay data and the first total number of completed transactions, a cross-chain two-dimensional table can be generated to represent the first total delay data and the first total number of completed transactions of the blockchain group to which each blockchain belongs in the above cross-chain two-dimensional table.

[0118] Table 1 is illustrated by taking three blockchains as an example, including blockchain group (1, 2), blockchain group (1, 3), and blockchain group (2, 3).

[0119] Table 1: A schematic cross-chain two-dimensional table.

[0120]

[0121] In Table 1, D(1, 2) refers to the first total delay data corresponding to the blockchain group (1, 2) to which blockchain 1 belongs (i.e., for blockchain 1). D(2, 1) refers to the first total delay data corresponding to the blockchain group (1, 2) to which blockchain 2 belongs (i.e., for blockchain 2). T(1, 2) refers to the first total number of completed transactions corresponding to the blockchain group (1, 2) to which blockchain 1 belongs (i.e., for blockchain 1), and the rest will not be elaborated.

[0122] Table 2 is illustrated by taking n blockchains as an example. When there are n blockchains and cross-chain transactions occur between each blockchain, forming blockchain groups pairwise, then according to Table 2, taking blockchain 1 as a benchmark, it includes the first total delay data and the first total number of completed transactions corresponding to the blockchain groups (1, 2) and (1, n) to which it belongs. This will not be elaborated here.

[0123] Table 2: Cross-chain two-dimensional table for n blockchains.

[0124]

[0125] This embodiment provides a method for extending the relay chain for cross-chain interoperability. In this embodiment, first taking the blockchain as a benchmark, the first total delay data and the first total number of completed transactions of the blockchain groups to which each blockchain belongs are calculated respectively, and then the cross-chain load index within a preset time period can be calculated. It should be noted that for a blockchain group, although transactions occur between two blockchains, due to information delay, it may cause one blockchain to determine that the transaction has been completed, while the other blockchain determines that the transaction has not been completed. Therefore, it is necessary to calculate the first total delay data and the first total number of completed transactions of the corresponding blockchain groups of each blockchain respectively based on the blockchain, which will make the cross-chain load index more accurate.

[0126] Example 5

[0127] This embodiment is a further refinement of any of the above embodiments. In this embodiment, the cross-chain load index includes the second total delay data corresponding to the blockchain group and the total number of completed transactions in the second.

[0128] This embodiment is an optional way to calculate the cross-chain load index of each blockchain group within a preset time period based on the first total delay data and the total number of completed transactions in the first of the blockchain group, including:

[0129] Step 1, for each blockchain group, calculate the second total delay data within the preset time period based on the first total delay data corresponding to the blockchain group; there are two pieces of first total delay data corresponding to the blockchain group; the second total delay data is the sum of the two pieces of first total delay data of the corresponding blockchain.

[0130] Exemplarily according to Table 1, for the first total delay data corresponding to the blockchain group (1, 2) being D(1, 2) and D(2, 1), calculate the second total delay data of the blockchain group (1, 2) within the preset time period, that is, D(1, 2) + D(2, 1).

[0131] Step 2, for each blockchain group, calculate the second total number of completed transactions within the preset time period based on the first total number of completed transactions corresponding to the blockchain group; there are two pieces of first total number of completed transactions corresponding to the blockchain group; the second total number of completed transactions is the sum of the two pieces of first total number of completed transactions of the corresponding blockchain.

[0132] Exemplarily according to Table 1, for the first total number of completed transactions corresponding to the blockchain group (1, 2) being T(1, 2) and T(2, 1), calculate the second total number of completed transactions of the blockchain group (1, 2) within the preset time period, that is, T(1, 2) + T(2, 1).

[0133] This embodiment provides a method for extending the relay chain for cross-chain interoperability. In this embodiment, taking the overall situation as the priority, calculate the sum of the first total delay data and the first total number of completed transactions corresponding to each blockchain group respectively, that is, obtain the second total delay data and the second total number of completed transactions.

[0134] Example 6

[0135] This embodiment is a further refinement of any of the above embodiments. In this embodiment, the cross-chain load index includes the second total delay data and the second total number of completed transactions.

[0136] This embodiment is an optional way to calculate the second average cross-chain load index based on the cross-chain load index, including:

[0137] Step 1: For each blockchain group, calculate the average delay data based on the second total delay data of the blockchain group.

[0138] Exemplarily according to the above Embodiment 5, for the second total delay data corresponding to the blockchain group (1, 2) within a preset time period, averaging is required to characterize the delay data of the blockchain group (1, 2), that is, averaging the second total delay data D(1, 2) + D(2, 1), i.e., D’(1, 2) = (D(1, 2) + D(2, 1)) / 2.

[0139] Among them, D’(1, 2) refers to the average delay data corresponding to the blockchain group (1, 2) within a preset time period.

[0140] Step 2: For each blockchain group, calculate the average transaction quantity based on the second total number of completed transactions of the blockchain group; the second average cross-chain load index includes the average delay data and the average transaction quantity.

[0141] Among them, the average transaction quantity refers to the average number of completed transactions.

[0142] Similarly, the second total number of completed transactions T’(1, 2) = (T(1, 2) + T(2, 1)) / 2. Among them, T’(1, 2) refers to the average transaction quantity corresponding to the blockchain group (1, 2) within a preset time period.

[0143] This embodiment provides a method for expanding a relay chain for cross-chain interoperability. In this embodiment, for each blockchain group, the average delay data and the average transaction quantity are respectively calculated based on the second total delay data and the second total number of completed transactions. In this embodiment, the above second total delay data and the second completed transactions are averaged, and the second average cross-chain load index of the blockchain group can be accurately obtained.

[0144] Embodiment 7

[0145] This embodiment is a further refinement of any of the above embodiments. This embodiment is an optional way to calculate the fission index based on the second average cross-chain load index, including the following steps:

[0146] Step 1: In response to any average delay data being greater than a preset delay threshold, calculate the average value of the overloaded delay connection counts based on the average delay data.

[0147] Among them, the preset delay threshold is a delay threshold set in advance.

[0148] Among them, the average value of the overloaded delay connection counts refers to the average overloaded delay corresponding to the blockchain group where the average delay data is greater than the preset delay threshold. Specifically, the average overloaded delay refers to the average value of the excess of the preset delay threshold for all blockchain groups where the average delay data is greater than or equal to the preset delay threshold.

[0149] Step 2: In response to any average transaction quantity being greater than a preset transaction quantity threshold, calculate the average value of overloaded transaction connection numbers based on the average transaction quantity.

[0150] The average value of overloaded transaction connection numbers refers to the average value of overloaded transaction connection numbers corresponding to the blockchain group where the average transaction quantity is greater than the preset transaction quantity threshold. Specifically, the average value of overloaded transaction connection numbers refers to the average value of the excess of the blockchain groups whose all average transaction quantities are greater than or equal to the preset transaction quantity over the preset transaction quantity threshold.

[0151] Step 3: Calculate a fission index based on the average value of overloaded delay connection numbers and the average value of overloaded transaction connection numbers. The fission index is used to characterize the fission degree generated by the average value of overloaded delay connection numbers and the overloaded transaction connection numbers.

[0152] It should be noted that the greater the average value of overloaded delay connection numbers and the overloaded transaction connection numbers, the greater the fission index, and thus the greater the fission degree. The greater the fission degree, the greater the need to expand the relay domain.

[0153] This embodiment provides a method for expanding a relay chain for cross-chain interoperability. In this embodiment, the average value of overloaded delay connection numbers and the average value of overloaded transaction connection numbers are calculated to represent the overloaded amount. Furthermore, based on the overloaded amount, the fission index can be calculated. The fission index can represent the impact of the overloaded amount on the expansion demand. If the overloaded amount is too large, the fission index may be greater, and then the expansion demand will be greater.

[0154] Embodiment 8

[0155] This embodiment is a further refinement of any of the above embodiments. This embodiment provides an optional method before calculating the average value of overloaded delay connection numbers based on average delay data, including:

[0156] Obtain at least one first overloaded delay connection number corresponding to a first preset period before a preset time period; the first overloaded delay connection number is the number of delay blockchain groups corresponding to each first preset period; there are at least one delay blockchain group; each delay blockchain group is a blockchain group whose average delay data within the corresponding first preset period is greater than a preset delay threshold; the delay period includes the period corresponding to the preset time period and the first preset period.

[0157] The first overloaded delay connection number refers to the number of blockchain groups whose average delay data within the corresponding first preset period is greater than the preset delay threshold.

[0158] It should be noted that in this embodiment, the obtaining / calculation method of the average delay data within the first preset period is the same as that of the average delay data within the preset time period, and will not be elaborated here.

[0159] Among them, the first preset period refers to the number of periods for preset calculation of the first overload delay connection number, and this period is a delay period.

[0160] Exemplarily according to the above embodiments, assume that the first preset period is 2. Taking the first first preset period as an example, assume that in the first preset period, the delayed blockchain groups are two of the three blockchain groups, namely blockchain group (1, 2) and blockchain group (1, 3). Then the electronic device obtains the first overload delay connection number corresponding to the first first preset period before the preset time period, denoted as the first overload delay connection number A. Among them, the first overload delay connection number A includes blockchain group (1, 2) and blockchain group (1, 3). Therefore, the first overload delay connection number A is 2. At the same time, for the second first preset period, assume that the corresponding delayed blockchain groups are blockchain group (1, 2), blockchain group (1, 3), and blockchain group (2, 3). Then the first overload delay connection number B corresponding to the second first preset period is 3. Among them, the period corresponding to the first preset period is one of the delay periods.

[0161] Among them, the first overload delay connection number A is the number of delayed blockchain groups corresponding to the first first preset period.

[0162] Among them, the first overload delay connection number B is the number of delayed blockchain groups corresponding to the second first preset period.

[0163] According to the above, in this embodiment, the first overload delay connection numbers corresponding to the first preset period are obtained, namely the first overload delay connection number A (2) and the first overload delay connection number B (3) respectively.

[0164] It should be noted that the interval corresponding to the first preset period may be the same as or different from the interval of the preset time period, and no limitation is made here.

[0165] In this embodiment, the cross-chain transaction data corresponding to the first preset period can be obtained from the smart network card, and the first overload delay connection number is calculated based on the cross-chain transaction data corresponding to the first preset period to obtain the first overload delay connection number.

[0166] Embodiment Nine

[0167] This embodiment is a further refinement of any of the above embodiments. This embodiment is an optional method for calculating the average value of the overload delay connection number based on the average delay data, and includes the following steps:

[0168] Step 1, within the preset time period, calculate the number of delays of the blockchain groups whose average delay data is greater than the preset delay threshold, and determine the number of delays as the corresponding second overload delay connection number.

[0169] Among them, the second overloaded delay connection number refers to the number of blockchain groups with average delay data greater than a preset delay threshold within a preset time period.

[0170] Among them, the delay number refers to the number of delayed blockchain groups. In this embodiment, a blockchain group with average delay data greater than the preset delay threshold is also a delayed blockchain group.

[0171] Among them, the preset delay threshold is the maximum number of delayed blockchain groups that can be borne within a preset time period (or delay period) set in advance. It should be noted that exceeding the preset delay threshold means that a relatively large part of the blockchain groups in the cross-chain system are delayed blockchain groups, and the transactions generated may cause the relay chain to be blocked.

[0172] Among them, the period corresponding to the preset time period is also a type of delay period.

[0173] Exemplarily, assume that the number of delays within the preset time period is 2, that is, the second overloaded delay connection number is 2.

[0174] Step 2: Calculate the third overloaded delay connection number; the third overloaded delay connection number is the sum of the corresponding first overloaded delay connection number and the second overloaded delay connection number within each delay period; the delay period includes the period corresponding to the preset time period and the first preset period.

[0175] Among them, the third overloaded delay connection number is the sum of the corresponding overloaded delay connection numbers within each delay period, that is, the sum of the first overloaded delay connection number corresponding to the first preset period and the second overloaded delay connection number corresponding to the period of the preset time period. It can be seen that in this embodiment, the delay period includes the period corresponding to the preset time period and the first preset period.

[0176] According to the above example, the first overloaded delay connection numbers corresponding to the first preset period include the first overloaded delay connection number A (2) and the first overloaded delay connection number B (3), and the second overloaded delay connection number corresponding to the period of the preset time period is 2. Therefore, calculating the third overloaded delay connection number is 2 + 3 + 2 = 7.

[0177] Step 3: Calculate the first average value based on the third overloaded delay connection number and the number of delay periods; the first average value is the average value of the overloaded delay connection numbers within the delay period.

[0178] According to the above example, the above delay period includes 2 first preset periods and the period corresponding to the preset time period, that is, the delay period is 3, so as to determine that the number of delay periods is 3. Then calculate the ratio of the third overloaded delay connection number to the number of delay periods, that is, average it, and obtain the first average value.

[0179] Among them, the first average value is the average value of all overload delay connection numbers within the delay period.

[0180] It should be noted that the overload delay connection number refers to the number of blockchain groups whose average delay data is greater than the preset delay threshold.

[0181] Among them, a connection refers to a connection generated between any two blockchains due to a transaction. If the number of connections is 1, it refers to a blockchain group.

[0182] This embodiment provides a method for extending a relay chain for cross-chain interoperability. In this embodiment, in order to improve generalization, first, the third overload delay connection number is calculated. The third overload delay connection number is the sum of the corresponding overload delay connection numbers within each delay period. In this embodiment, when the average delay data is greater than the preset delay threshold within the preset time period, not only the overload delay connection number within the preset time period is considered. For greater accuracy and to reduce the situation where the third overload delay connection number is generated due to accidents, the first overload delay data of the first preset period before the preset time period is also considered, and averaging is performed based on the number of delay periods to obtain the first average value, so the accuracy is improved and it is more in line with the actual situation.

[0183] Embodiment Ten

[0184] This embodiment is a further refinement of any of the above embodiments. In this embodiment, the blockchain groups with an average transaction number greater than the preset transaction number threshold are target blockchain groups; there is at least one target blockchain group.

[0185] This embodiment provides an optional method before calculating the average value of the overload transaction connection number based on the average transaction number, including:

[0186] Obtain the first overload transaction connection numbers corresponding to at least one second preset period before the preset time period; the first overload transaction connection number is the number of transaction blockchain groups corresponding to each second preset period; there is at least one transaction blockchain group; each transaction blockchain group is a blockchain group with an average transaction number greater than the preset transaction threshold within the corresponding second preset period.

[0187] Among them, the first overload transaction connection number refers to the number of blockchain groups with an average transaction number greater than the preset transaction threshold within the corresponding second preset period.

[0188] It should be noted that in this embodiment, the obtaining / calculation method of the average transaction number within the second preset period is the same as that of the average transaction number within the preset time period, and will not be elaborated here.

[0189] Among them, the second preset period refers to the number of periods for preset calculation of the first overload transaction connection number, and this period is a transaction period.

[0190] Exemplarily according to the above embodiments, assuming that the second preset period is 2, taking the first second preset period as an example, assuming that in the first preset period, the transaction blockchain groups are two of the three blockchain groups, namely blockchain group (1, 2) and blockchain group (1, 3), the electronic device obtains the first overloaded transaction connection number corresponding to the first second preset period before the preset time period, denoted as the first overloaded transaction connection number A. Among them, the first overloaded transaction connection number A includes blockchain group (1, 2) and blockchain group (1, 3), so the first overloaded transaction connection number A is 2. At the same time, for the second second preset period, assuming that the corresponding transaction blockchain groups are blockchain group (1, 2), blockchain group (1, 3) and blockchain group (2, 3), the first overloaded transaction connection number B corresponding to the second second preset period is 3. Among them, the period corresponding to the second preset period is one of the transaction periods.

[0191] Among them, the first overloaded transaction connection number A is the number of transaction blockchain groups corresponding to the first second preset period.

[0192] Among them, the first overloaded transaction connection number B is the number of transaction blockchain groups corresponding to the second second preset period.

[0193] According to the above, in this embodiment, the first overloaded transaction connection numbers corresponding to the second preset period are obtained, namely the first overloaded transaction connection number A (2) and the first overloaded transaction connection number B (3) respectively.

[0194] It should be noted that the interval corresponding to the second preset period may be the same as or different from the interval of the preset time period, and no limitation is made here.

[0195] In this embodiment, the cross-chain transaction data corresponding to the second preset period can be obtained from the smart network card, and the first overloaded transaction connection number is calculated based on the cross-chain transaction data corresponding to the second preset period to obtain the first overloaded transaction connection number.

[0196] Embodiment XI

[0197] This embodiment is a further refinement of any of the above embodiments. This embodiment provides an optional method for calculating the average value of overloaded transaction connection numbers based on the average transaction quantity, including:

[0198] Step 1, within the preset time period, calculate the number of transactions of the blockchain groups whose average transaction quantity is greater than the preset transaction threshold, and determine the number of transactions as the corresponding second overloaded transaction connection number.

[0199] Among them, the second overloaded transaction connection number refers to the number of blockchain groups whose average transaction quantity is greater than the preset transaction threshold within the preset time period.

[0200] Among them, the number of transactions refers to the number of transaction blockchain groups. In this embodiment, a blockchain group with an average transaction data greater than a preset transaction threshold is also a transaction blockchain group.

[0201] Among them, the preset transaction threshold is the maximum number of transaction blockchain groups that can be carried within a preset time period (or transaction cycle). It should be noted that exceeding the preset transaction threshold means that a relatively large part of the blockchain groups in the cross-chain system are transaction blockchain groups, and the generated transactions may cause the relay chain to be blocked.

[0202] Exemplarily, assume that the number of transactions within the preset time period is 2, that is, the second overloaded transaction connection number is 2.

[0203] Step 2, calculate the third overloaded transaction connection number; the third overloaded transaction connection number is the sum of the corresponding first overloaded transaction connection numbers and the second overloaded transaction connection numbers within each transaction cycle; the transaction cycle includes the cycle corresponding to the preset time period and the second preset cycle.

[0204] Among them, the third overloaded transaction connection number is the sum of the corresponding overloaded transaction connection numbers within each transaction cycle, that is, the sum of the first overloaded transaction connection number corresponding to the second preset cycle and the second overloaded transaction connection number corresponding to the cycle of the preset time period. It can be seen that in this embodiment, the transaction cycle includes the cycle corresponding to the preset time period and the second preset cycle.

[0205] According to the above example, the first overloaded transaction connection numbers corresponding to the second preset cycle include the first overloaded transaction connection number A (2) and the first overloaded transaction connection number B (3), and the second overloaded transaction connection number corresponding to the cycle of the preset time period is 2. Therefore, calculating the third overloaded transaction connection number is 2 + 3 + 2 = 7.

[0206] Step 3, calculate the second average value based on the third overloaded transaction connection number and the number of transaction cycles; the second average value is the average value of the overloaded transaction connection numbers within the transaction cycle.

[0207] According to the above example, the above transaction cycle includes 2 second preset cycles and the cycle corresponding to the preset time period, that is, the number of transaction cycles is 3. Then, calculate the ratio of the third overloaded transaction connection number to the number of transaction cycles, that is, the averaging is achieved, and the second average value is obtained.

[0208] Among them, the second average value is the average value of all the overloaded transaction connection numbers within the transaction cycle.

[0209] It should be noted that the overloaded transaction connection number refers to the number of blockchain groups with an average transaction quantity greater than the preset transaction threshold.

[0210] This embodiment provides a method for extending a relay chain for cross-chain interoperability. In this embodiment, in order to improve generalization, first, the third overloaded transaction connection number is calculated, which is the sum of the overloaded transaction connection numbers corresponding to each transaction cycle. In this embodiment, when the average transaction data is greater than the preset transaction threshold within a preset time period, not only the overloaded transaction connection number within the preset time period is considered. For greater accuracy and to reduce the situation of the third overloaded transaction connection number caused by accidents, the first overloaded transaction data in the second preset cycle before the preset time period is also taken into account and averaged based on the number of transaction cycles to obtain the second average value, thus improving the accuracy and being more in line with the actual situation.

[0211] Embodiment Twelve

[0212] This embodiment is a further refinement of any of the above embodiments. This embodiment is an optional way to calculate the fission index based on the average value of overloaded delay connection numbers and the average value of overloaded transaction connection numbers, including:

[0213] Input the average value of overloaded delay connection numbers, the average value of overloaded transaction connection numbers, and the total connection number into a preset fission index algorithm to calculate the fission index; the total connection number is the number of blockchain groups.

[0214] Among them, the preset fission index algorithm is a pre-set fission index calculation algorithm. As shown in (1):

[0215] (1)

[0216] Among them, represents the fission index, represents the average value of overloaded transaction connection numbers, represents the average value of overloaded delay connection numbers, represents the number of all blockchain groups, that is, the total connection number, represents the preset transaction weight index, represents the preset delay weight index.

[0217] Among them, the total connection number is the number of all blockchains.

[0218] In practical applications, the fission index can be adjusted according to the pre-set and regulate the fission index.

[0219] According to the above (1), the fission index can be calculated.

[0220] Furthermore, the electronic device determines the magnitude relationship between the fission index and the preset expansion threshold. If it is determined that the fission index is greater than or equal to the preset expansion threshold, the electronic device determines the initial node of the new relay chain in the relay domain.

[0221] It should be noted that during the initial configuration of the relay domain, it can include at least one node. Thus, when the cross-chain system needs to be expanded, the electronic device determines the initial nodes of the new relay chain from at least one node.

[0222] In one way, the electronic device can randomly determine the initial nodes from at least one node; the above initial nodes are at least one.

[0223] In one way, the electronic device determines the initial nodes that meet the above degree from at least one node according to the degree to which the fission index exceeds the preset expansion threshold; the initial nodes meet the transmission requirements for some cross-chain transactions.

[0224] Furthermore, after the electronic device determines the initial nodes, it generates a relay chain genesis block, and then sends the relay chain genesis block to the corresponding initial nodes to instruct the initial nodes to expand a new relay chain by themselves. Among them, the relay chain genesis block includes the identifiers of each initial node.

[0225] Furthermore, after receiving the relay chain genesis block, the initial nodes are aware that they will be used to expand into a new relay chain.

[0226] Furthermore, the electronic device controls the initial nodes to start, so that each initial node starts and forms a new relay chain.

[0227] Furthermore, the electronic device generates a shunt strategy. Among them, the shunt strategy includes cross-chain gateways connected to the new relay chain, and determines these cross-chain gateways as shunt gateways. Each pair of shunt gateways can form a blockchain group.

[0228] The electronic device sends the shunt strategy to the corresponding shunt gateways to instruct the shunt gateways to disconnect the currently connected relay chain based on the shunt strategy and form a new connection, which is connected to the new relay chain, thus forming a new network connection, achieving shunt, and enabling the new relay chain to undertake the transmission of some cross-chain transactions.

[0229] In one way, the shunt strategy generated by the electronic device can achieve average shunt of the blockchain group, or determine the cross-chain gateways that need to be shunted based on the proximity of the connection relationships, which is not limited here.

[0230] Among them, average shunt means that if there are 4 blockchains in the relay domain, after averaging, blockchain 1 and blockchain 2 correspond to one relay chain, and blockchain 3 and blockchain 4 correspond to one relay chain, and it can be randomly determined that the relay chain corresponding to blockchain 3 and blockchain 4 is the new relay chain.

[0231] Among them, determining the cross-chain gateway that needs to be shunted based on the proximity of the connection relationship can be that if after blockchain 3 and blockchain 4 are connected to the new relay chain, the generated connection route is closer than that of blockchain 1 and blockchain 2, then it is determined that the relay chains corresponding to blockchain 3 and blockchain 4 are the new relay chains.

[0232] In this embodiment, it should be noted that when the new relay chain runs, taking the above description as an example, assuming that blockchain 3 and blockchain 4 correspond to the new relay chain, and a certain transaction has blockchain 3 as the initiating chain and blockchain 4 as the destination chain, then the transaction request is sent from blockchain 3 through the corresponding cross-chain gateway to the new relay chain, and then from the new relay chain to the cross-chain gateway corresponding to blockchain 4, and then from this cross-chain gateway to blockchain 4.

[0233] Specifically, when the transaction request is transmitted in the path, blockchain 3 needs to package the transaction request based on the cross-chain protocol contract. After packaging, a data packet is formed and sent to the corresponding cross-chain gateway 3. Thus, cross-chain gateway 3 determines the evidence that the data packet reaches an agreement in blockchain 3. Subsequently, this cross-chain gateway 3 shunts the data packet and the evidence to the new relay chain according to the shunting strategy. The relay chain verifies that the data packet reaches an agreement in blockchain 3 based on the evidence through the cross-chain protocol contract, obtains the verification result, and writes the verification result into the new relay chain to achieve endorsement. Further, the cross-chain gateway 4 corresponding to blockchain 4 monitors the new relay chain, obtains the data packet and the endorsement, and then sends the data packet to blockchain 4 in the form of a transaction. Thus, blockchain 4 parses the data packet through the cross-chain protocol contract and verifies the endorsement of the transaction request by the new relay chain, thereby indirectly verifying that the transaction request reaches an agreement on blockchain 3. Furthermore, blockchain 4 calls the corresponding application contract to execute the transaction, generates a transaction response, and returns the transaction response to blockchain 3 in the same way. In this embodiment, the transaction request is transmitted through the method of hop-by-hop transmission and cross-chain protocol contract verification.

[0234] Through the description of the above implementation manners, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation manner.

[0235] Embodiment Thirteen

[0236] Figure 6 It is a structural schematic diagram of a relay chain extension device provided for Embodiment Thirteen. As Figure 6 shown, the relay chain extension device 600 includes the following modules:

[0237] A receiving module 601 for receiving a monitoring request corresponding to any relay domain, and a monitoring module 602 for monitoring cross-chain transaction data of blockchains corresponding to at least one cross-chain gateway in the relay domain based on the monitoring request; the monitoring request is initiated by any cross-chain gateway in the relay domain when detecting that its first average cross-chain load index is greater than or equal to a monitoring threshold; cross-chain transactions initiated when the first average cross-chain load index is greater than or equal to the monitoring threshold may cause transmission blockage;

[0238] A calculation module 603 for calculating a second average cross-chain load index of at least one blockchain group based on the cross-chain transaction data corresponding to each blockchain; the blockchain group includes any two blockchains that generate transactions in the relay domain;

[0239] The calculation module 603 for calculating a fission index based on the second average cross-chain load index;

[0240] A determination module 604 for determining an initial node of a newly extended relay chain in the relay domain in response to the fission index being greater than or equal to a preset expansion threshold;

[0241] A control module 605 for controlling the initial node to start to extend a new relay chain in the relay domain; the new relay chain is used to undertake the transmission of part of the cross-chain transactions.

[0242] For the description of the features in the embodiments corresponding to the relay chain extension device, reference can be made to the relevant descriptions in the embodiments corresponding to the relay chain extension method for cross-chain interoperability, which will not be elaborated here one by one.

[0243] Figure 7 This is a schematic structural diagram of the electronic device provided by the present application. As Figure 7 shown, the electronic device 101 provided in this embodiment includes: at least one processor 701 and a memory 702. Optionally, the electronic device 101 further includes a communication component 703. Among them, the processor 701, the memory 702, and the communication component 703 are connected through a bus 704.

[0244] In a specific implementation process, at least one processor 701 executes computer execution instructions stored in the memory 702, so that at least one processor 701 executes the above-mentioned embodiments of the relay chain extension method for cross-chain interoperability.

[0245] For the specific implementation process of the processor 701, reference can be made to the above method embodiments, and their implementation principles and technical effects are similar, which will not be elaborated here in this embodiment.

[0246] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the application can be directly implemented by the execution of the hardware processor, or can be implemented by the combination of the hardware and software modules in the processor.

[0247] The memory may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory.

[0248] The bus may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0249] The embodiments of the present application also provide a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any of the above embodiments of the relay chain extension method for cross-chain interoperability when running.

[0250] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs and other media that can store computer programs.

[0251] The embodiments of the present application also provide a computer program product, the above computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments of the relay chain extension method for cross-chain interoperability are implemented.

[0252] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in any of the above-described embodiments of the relay chain extension method for cross-chain interoperability are implemented.

[0253] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled artisans can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present application.

[0254] The above has introduced in detail a relay chain extension method for cross-chain interoperability provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A cross-chain interoperable relay chain extension method, characterized in that: include: Receive a monitoring request corresponding to any relay domain, and monitor the cross-chain transaction data of the blockchain corresponding to at least one cross-chain gateway in the relay domain based on the monitoring request; The monitoring request is initiated by any cross-chain gateway in the relay domain when it detects that its first average cross-chain load index is greater than or equal to the monitoring threshold; the cross-chain transaction initiated when the first average cross-chain load index is greater than or equal to the monitoring threshold may cause transmission congestion; Calculate a second average cross-chain load index of at least one blockchain group based on the cross-chain transaction data corresponding to each blockchain; the blockchain group includes any two blockchains generating transactions in the relay domain; Calculating a fission index based on the second average cross-chain load index; In response to the fission index being greater than or equal to a preset expansion threshold, determining an initial node of a newly expanded relay chain in the relay domain; Controlling the initial node to start up, so as to expand a new relay chain in the relay domain; the new relay chain is used to undertake the transmission of part of the cross-chain transactions; The second average cross-chain load index includes average delay data and average transaction quantity; the calculation of the fission index based on the second average cross-chain load index includes: In response to any of the average delay data being greater than a preset delay threshold, calculating an average value of the number of overload delay connections based on the average delay data; In response to any of the average transaction numbers being greater than a preset transaction number threshold, an average value of the overloaded transaction connection number is calculated based on the average transaction number; the fission index is calculated based on the average value of the overloaded delay connection number and the average value of the overloaded transaction connection number; the fission index is used to characterize the degree of fission caused by the average value of the overloaded delay connection number and the overloaded transaction connection number.

2. The method according to claim 1, characterized in that Monitoring the cross-chain transaction data of the blockchain corresponding to at least one cross-chain gateway in the relay domain based on the monitoring request includes: Based on the monitoring request, monitor and obtain cross-chain transaction data of the corresponding blockchain within a preset time period from at least one cross-chain gateway; The calculating a second average cross-chain load index of at least one blockchain group based on the cross-chain transaction data corresponding to each blockchain includes: Calculate the cross-chain load index of each blockchain group within the preset time period based on each cross-chain transaction data; The second average cross-chain load index is calculated based on the cross-chain load index.

3. The method according to claim 2, characterized in that The monitoring and obtaining the cross-chain transaction data of the corresponding blockchain within a preset time period from at least one cross-chain gateway based on the monitoring request includes: Based on the monitoring request, cross-chain transaction data of the corresponding blockchain within a preset time period is obtained from the smart network card in at least one cross-chain gateway; the smart network card includes a monitoring management unit, and the monitoring management unit is used to monitor the transmission data of the corresponding blockchain; the transmission data includes cross-chain transaction data.

4. The method according to claim 2, characterized in that: The cross-chain transaction data includes each completed transaction sub-delay data and the completed transaction serial number of at least one blockchain group to which the corresponding blockchain belongs; The calculating the cross-chain load index of each blockchain group within the preset time period based on each cross-chain transaction data includes: For each blockchain, respectively calculate the first total delay data corresponding to each blockchain group to which the blockchain belongs within the preset time period; the first total delay data is the sum of the sub-delay data of each completed transaction in the blockchain group to which the blockchain belongs; For each blockchain, respectively calculate the total number of first completed transactions corresponding to each blockchain group to which the blockchain belongs within the preset time period; the first total number of completed transactions is the number of completed transaction serial numbers in the blockchain group to which the blockchain belongs; For each blockchain group, a cross-chain load index of the blockchain group within the preset time period is calculated based on the first total delay data and the first total number of completed transactions of the blockchain group.

5. The method according to claim 4, characterized in that The cross-chain load index includes the second total delay data and the second total number of completed transactions corresponding to the blockchain group; The step of calculating, for each blockchain group, the cross-chain load index of the blockchain group within the preset time period based on the first total delay data and the first total number of completed transactions of the blockchain group, includes: For each blockchain group, the second total delay data within the preset time period is calculated based on the first total delay data corresponding to the blockchain group; there are two first total delay data corresponding to the blockchain group; the second total delay data is the sum of the two first total delay data of the corresponding blockchain; For each blockchain group, the second total number of completed transactions within the preset time period is calculated based on the first total number of completed transactions corresponding to the blockchain group; the first total number of completed transactions corresponding to the blockchain group is two; the second total number of completed transactions is the sum of the two first total numbers of completed transactions of the corresponding blockchain.

6. The method according to claim 2, characterized in that The cross-chain load index includes the second total delay data and the second total number of completed transactions; The method further comprises: For each blockchain group, calculating average delay data based on the second total delay data of the blockchain group; For each blockchain group, the average transaction number is calculated based on the total number of second completed transactions of the blockchain group.

7. The method according to claim 6, characterized in that Before calculating the average value of the number of overload delay connections based on the average delay data, the method includes: Obtain the first overload delay connection number corresponding to at least one first preset period before the preset time period; the first overload delay connection number is the number of delay blockchain groups corresponding to each of the first preset periods; there is at least one delay blockchain group; each delay blockchain group is a blockchain group whose average delay data in the corresponding first preset period is greater than a preset delay threshold.

8. The method according to claim 7, wherein the calculating the average value of the number of overload delay connections based on the average delay data comprises: Within a preset time period, the number of delays of blockchain groups whose average delay data is greater than a preset delay threshold is calculated, and the number of delays is determined as the corresponding second overload delay connection number; Calculate the third overload delay connection number; the third overload delay connection number is the sum of the first overload delay connection number and the second overload delay connection number corresponding to each delay period; the delay period includes the period corresponding to the preset time period and the first preset period; A first average value is calculated based on the third number of overload delay connections and the number of delay periods; the first average value is the average value of the number of overload delay connections within the delay period.

9. The method according to claim 6, characterized in that Before calculating the average number of overloaded transaction connections based on the average number of transactions, the method includes: Obtain a first overload transaction connection number corresponding to at least one second preset period before the preset time period; the first overload transaction connection number is the number of transaction blockchain groups corresponding to each of the second preset periods; there is at least one transaction blockchain group; each of the transaction blockchain groups is a blockchain group whose average transaction number in the corresponding second preset period is greater than a preset transaction threshold.

10. The method according to claim 9, characterized in that The calculating the average number of overloaded transaction connections based on the average number of transactions includes: Within a preset time period, calculating the number of transactions of a blockchain group whose average number of transactions is greater than a preset transaction threshold, and determining the number of transactions as the corresponding second overload transaction connection number; Calculating a third number of overloaded transaction connections; the third number of overloaded transaction connections is the sum of the first number of overloaded transaction connections and the second number of overloaded transaction connections corresponding to each transaction cycle; the transaction cycle includes the cycle corresponding to the preset time period and the second preset cycle; A second average value is calculated based on the third number of overloaded transaction connections and the number of transaction cycles; the second average value is an average value of the number of overloaded transaction connections within the transaction cycle.

11. The method according to claim 6, characterized in that The calculating the fission index based on the average number of overloaded delay connections and the average number of overloaded transaction connections includes: The average value of the overload delay connection number, the average value of the overload transaction connection number and the total number of connections are input into a preset fission index algorithm to calculate the fission index; the total number of connections is the number of blockchain groups; The preset fission index algorithm is as follows: in, represents the fission index, Indicates the average number of overloaded transaction connections. Indicates the average number of overload delay connections. Indicates the total number of connections. Indicates the preset transaction weight index, Indicates the preset delay weight index.

12. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the relay chain extension method for cross-chain interoperability as described in any one of claims 1 to 11 when executing the computer program.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the cross-chain interoperable relay chain extension method as described in any one of claims 1 to 11.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the relay chain extension method for cross-chain interoperability as described in any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Relay chain-based cross-chain gateway redundancy switching method and system

    CN118827336A

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

    CN119602928A