A data transmission method, electronic device, and computer program product
By constructing a relay propagation network in the blockchain network and utilizing relay nodes in dense and sparse areas, the problems of slow block propagation speed and data redundancy are solved, and fast transmission and efficient synchronization of block data are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY
- Filing Date
- 2025-11-25
- Publication Date
- 2026-05-26
AI Technical Summary
The slow block propagation speed and high data redundancy in blockchain networks result in long block confirmation times, which limits transaction throughput and the response speed of real-time applications.
By identifying dense and sparse areas in the blockchain network, selecting first and second relay nodes to construct a relay propagation network, and using the QUIC protocol for communication, block data can be transmitted quickly between dense and sparse areas.
It improves the synchronization efficiency of block data, reduces redundant forwarding, and enhances the propagation speed and throughput of the blockchain network.
Smart Images

Figure CN122093483A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of blockchain technology, and in particular relates to a data transmission method, electronic device and computer program product. Background Technology
[0002] Due to the nature of globally distributed decentralized networks, blockchain networks often suffer from slow block propagation speeds and high data redundancy during block distribution, preventing further reductions in block confirmation time. Existing blockchain systems (such as Ethereum and Solana) experience average latency ranging from hundreds of milliseconds to several seconds between block generation by the leader node and confirmation by all validators under high load scenarios. This directly limits the improvement of transaction throughput (TPS) and the response speed of real-time applications (such as DeFi and NFT minting).
[0003] Block propagation in blockchain typically employs either peer-to-peer (P2P) network random communication or a Turbine Tree structure. P2P network random communication propagation involves dynamically randomized paths that adapt to the network topology. This randomness leads to accumulated latency (average 3-5 hops) and high redundancy (each block is forwarded O(N) times, where N is the number of nodes). Turbine Tree propagation, on the other hand, suffers from linear latency growth due to its multi-layered tree structure, which increases in depth (>5 layers) with a large node base. It also exhibits uneven fan-out, resulting in high load on hotspot nodes and vulnerability to eclipse attacks.
[0004] There is an urgent need for a low-redundancy, low-latency block propagation method. Summary of the Invention
[0005] In view of this, embodiments of this application provide a data transmission method, electronic device, and computer program product to improve the synchronization efficiency of block data in a blockchain network and reduce the occurrence of redundant block data forwarding.
[0006] The first aspect of this application provides a data propagation method, including: Identify multiple validator nodes in the blockchain network; Based on the location of the verifier node, multiple dense regions and multiple sparse regions are determined; Based on the multiple verifier nodes, a first relay node located in each of the dense regions and a second relay node located in each of the sparse regions are determined; A relay propagation network is constructed based on the first relay node and the second relay node; If new block data exists in the relay propagation network, the new block data is synchronized to each of the validator nodes based on the relay propagation network; The first relay nodes are interconnected; the relay propagation network is connected to edge nodes, which are the verifier nodes other than the first and second relay nodes among the plurality of verifier nodes.
[0007] In some implementations of the first aspect, the verifier node corresponds to initial latitude and longitude coordinates in multiple databases; the method further includes: Determine the different initial latitude and longitude corresponding to the same validator node in each of the aforementioned databases; Determine the weight value of each of the databases; The target latitude and longitude are obtained by weighting the weight values of each database and the initial latitude and longitude. The target latitude and longitude are determined as the location of the verifier node.
[0008] In some implementations of the first aspect, determining multiple dense regions and multiple sparse regions based on the location of the verifier node includes: Determine the parameters for the dense region and the sparse region; Based on the dense region parameters and the location, the multiple verifier nodes are clustered to determine multiple dense regions; Based on the sparse region parameters and the location, the multiple verifier nodes are clustered to determine multiple sparse regions; The parameters for the dense region include a first distance range and a first number of nodes; the parameters for the sparse region include a second distance range and a second number of nodes.
[0009] In some implementations of the first aspect, for each of the dense areas, the first relay node is determined through the following steps: Determine a first candidate location and a first data center within the dense area; In each of the first data centers whose distance from the first candidate location satisfies the third distance range, a first candidate relay node is determined; Determine the first attribute information of each of the first candidate relay nodes; Based on the first attribute information, determine the first relay node among each of the first candidate relay nodes; The first attribute information includes the average round-trip time between the first candidate relay node and each of the verifier nodes in the same dense area.
[0010] In some implementations of the first aspect, for each of the sparse regions, the second relay node is determined through the following steps: Determine a second candidate location and a second data center within the sparse region; In each of the second data centers, a second candidate relay node is determined from each of the second candidate locations whose distance from the second candidate location satisfies the fourth distance range; Determine the second attribute information of each of the second candidate relay nodes; Based on the second attribute information, a second relay node is determined from each of the second candidate relay nodes; The second attribute information includes the average round-trip time between the second candidate relay node and each of the verifier nodes in the same sparse region.
[0011] In some implementations of the first aspect, the construction of the relay propagation network based on the first relay node and the second relay node includes: Establish a communication connection between any one of the multiple first relay nodes and the remaining first relay nodes; For each of the second relay nodes, determine the corresponding target first relay node; The corresponding second relay nodes establish communication connections with the target first relay node to construct a relay propagation network.
[0012] In some implementations of the first aspect, the data propagation method further includes: In the presence of edge nodes to be connected, determine the delay information between each of the first relay nodes, each of the second relay nodes, and the edge nodes to be connected; Based on the delay information, one of the first relay node and the second relay node establishes a communication connection with the edge node to be connected.
[0013] In some implementations of the first aspect, the first relay nodes communicate with each other, and between the first relay node and the second relay node, based on the QUIC protocol.
[0014] A second aspect of this application provides a data transmission apparatus, including: The validator node determination module is used to determine multiple validator nodes in the blockchain network; The partitioning module is used to determine multiple dense regions and multiple sparse regions based on the location of the verifier node; The relay node determination module is used to determine, based on the plurality of verifier nodes, a first relay node located in each of the dense regions and a second relay node located in each of the sparse regions; The relay propagation network construction module is used to construct a relay propagation network based on the first relay node and the second relay node; The block propagation module is used to synchronize the new block data to each of the validator nodes based on the relay propagation network when new block data exists in the relay propagation network. The first relay nodes are interconnected; the relay propagation network is connected to edge nodes, which are the verifier nodes other than the first and second relay nodes among the plurality of verifier nodes.
[0015] A third aspect of this application provides an electronic device including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the data transmission method as described in the first aspect above.
[0016] A fourth aspect of this application provides a computer program product including a computer program that, when run, causes the data propagation method as described in the first aspect above to be executed.
[0017] A fifth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the data propagation method as described in the first aspect above.
[0018] This application embodiment determines multiple validator nodes in the blockchain network; based on the location of the validator nodes, it determines multiple dense areas and multiple sparse areas; based on the multiple validator nodes, it determines a first relay node located in each dense area and a second relay node located in each sparse area; based on the first relay node and the second relay node, it constructs a relay propagation network; when new block data exists in the relay propagation network, it synchronizes the new block data to each validator node based on the relay propagation network; this enables the rapid transmission of block data between dense and sparse areas, thereby achieving long-distance rapid transmission of block data, and the first relay node and the second relay node synchronize new block data with other validator nodes in their respective areas, thereby improving the synchronization efficiency of block data in the blockchain network while reducing the occurrence of redundant forwarding of block data. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of a data transmission method provided in an embodiment of this application; Figure 2 This is a schematic diagram of a relay propagation network distribution provided in an embodiment of this application; Figure 3 This is a schematic diagram of a data transmission device provided in an embodiment of this application; Figure 4 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0021] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0022] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0023] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0024] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0025] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0026] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0027] The technical solution of this application will be described below through specific embodiments.
[0028] Reference Figure 1 The diagram illustrates a data propagation method provided in an embodiment of this application, which may specifically include the following steps: Step 101: Identify multiple validator nodes in the blockchain network.
[0029] Validator nodes are key nodes participating in the consensus process of a blockchain network. Their core functions are to verify transactions and create new blocks, thereby maintaining the network's security, consistency, and decentralization. Typically, a blockchain has a large number of validator nodes distributed across multiple regions globally. When any validator node generates a new block, it is more efficient to synchronize that new block to other validator nodes in the blockchain.
[0030] In a blockchain, any node can access a designated database to obtain relevant information about each validator node. This information may include, but is not limited to, node identifiers and geographical information. The node identifier is used to uniquely identify a validator node. This application embodiment does not limit the method of generating the node identifier.
[0031] Step 102: Based on the location of the validator node, determine multiple dense regions and multiple sparse regions.
[0032] Based on the aforementioned geographical information, the location of each validator node can be determined, thus obtaining the distribution of all validator nodes in the blockchain. According to the distribution of validator nodes, the locations of the validator nodes can be divided into multiple regions, which can be designated as dense or sparse regions. The number of validator nodes per unit area in a dense region is greater than the number of validator nodes per unit area in a sparse region.
[0033] Step 103: Determine the first relay node located in each dense region and the second relay node located in each sparse region based on multiple validator nodes.
[0034] Dense and sparse regions contain multiple validator nodes. To improve the transmission efficiency of block data, a first relay node and a second relay node can be determined in the dense and sparse regions respectively. When synchronizing new block data, the first relay node can synchronize the block data to other validator nodes located in the same dense region, and the second relay node can synchronize the block data to other validator nodes located in the same sparse region. This can improve the propagation efficiency of block data. By synchronizing block data to other validator nodes in the same region through the first and second relay nodes, the redundant forwarding of block data can be effectively reduced, and the same validator node can be prevented from receiving multiple blocks that need to be synchronized, thus reducing the waste of network resources.
[0035] Step 104: Construct a relay propagation network based on the first relay node and the second relay node. A relay network is constructed by interconnecting the various first relay nodes and connecting second relay nodes to one of the first relay nodes. Block data can propagate between any two first relay nodes, or between a first relay node and a second relay node. In a global scenario, dense and sparse areas can be far apart. Communication between the first and second relay nodes can improve the transmission efficiency of block data over long distances. Dense areas can be located on different continents, enabling cross-continental transmission of block data in a single transmission through this relay network.
[0036] Step 105: If new block data exists in the relay network, synchronize the new block data to each validator node based on the relay network.
[0037] The relay propagation network is connected to the edge nodes, which are the validator nodes other than the first and second relay nodes among the multiple validator nodes.
[0038] When new block data is present in the relay propagation network (e.g., a first or second relay node receives or generates new block data), the block data can be transmitted in the relay propagation network to synchronize the new block data among all first and second relay nodes. Each first relay node then synchronizes the block data to multiple edge nodes in its dense region, and each second relay node synchronizes the block data to multiple edge nodes in its sparse region. This avoids redundant forwarding caused by the second relay node synchronizing the new block data to edge nodes in the same sparse region after the first relay node synchronizes it.
[0039] Since validator nodes are more densely distributed in dense regions than in sparse regions, the number of validator nodes that need to be synchronized in dense regions is often much greater than in sparse regions. Therefore, by interconnecting with the first relay node, the first relay node can achieve single-hop, enabling each dense region to receive new block data faster. Edge nodes in dense regions can enter the synchronization process more quickly, further improving the synchronization efficiency of block data in the blockchain.
[0040] This application embodiment determines multiple validator nodes in the blockchain network; based on the location of the validator nodes, it determines multiple dense areas and multiple sparse areas; based on the multiple validator nodes, it determines a first relay node located in each dense area and a second relay node located in each sparse area; based on the first relay node and the second relay node, it constructs a relay propagation network; when new block data exists in the relay propagation network, it synchronizes the new block data to each validator node based on the relay propagation network; this enables the rapid transmission of block data between dense and sparse areas, thereby achieving long-distance rapid transmission of block data, and the first relay node and the second relay node synchronize new block data with other validator nodes in their respective areas, thereby improving the synchronization efficiency of block data in the blockchain network while reducing the occurrence of redundant forwarding of block data.
[0041] In some implementations of the first aspect, the verifier node corresponds to the initial latitude and longitude in multiple databases; before step 102, the data propagation method further includes: determining different initial latitude and longitude corresponding to the same verifier node in each database; determining the weight value of each database; performing a weighted calculation based on the weight value corresponding to each database and the initial latitude and longitude to obtain the target latitude and longitude; and determining the target latitude and longitude as the location of the verifier node.
[0042] The relevant information of the verifier node can be obtained by acquiring information recorded in different databases. Since the positioning accuracy and coverage of different databases may differ, the latitude and longitude of the same verifier node may deviate in different databases. In this embodiment, a weighted fusion algorithm can be used to determine the latitude and longitude (target latitude and longitude) of each verifier node, and the target latitude and longitude can be used as the location of the verifier node to divide the dense area and sparse area.
[0043] For example: obtain latitude and longitude coordinates from three databases, namely LatDB1, LatDB2, and LatDB3, read the pre-set weight values w1, w2, and w3 for each database, and use the weighted average method to calculate the target latitude and longitude Latfinal. , where the sum of w1, w2, and w3 is 1.
[0044] In some implementations of this application, multiple dense regions and multiple sparse regions are determined based on the location of the verifier node, including: Determine the parameters for dense regions and sparse regions; cluster multiple validator nodes based on the parameters for dense regions and their locations to determine multiple dense regions; cluster multiple validator nodes based on the parameters for sparse regions and their locations to determine multiple sparse regions; the parameters for dense regions include a first distance range and a first range of the number of nodes; the parameters for sparse regions include a second distance range and a second range of the number of nodes.
[0045] Density clustering algorithms (such as DBSCAN or K-means) are used to analyze the positions of each validator node to obtain dense and sparse regions. Specifically, the parameters for dense and sparse regions can be determined first, and then the clustering algorithm can be used to process the positions of all validator nodes. The clustering algorithm automatically identifies and generates dense and sparse regions based on the distance between validator nodes, the dense region parameters, and the sparse region parameters.
[0046] As an example, the first distance range can be set to a radius of 50 kilometers and the first number of nodes can be set to a range of no less than 10 as parameters for dense regions; the first distance range can be set to a radius of 200 kilometers and the first number of nodes can be set to a range of no more than 10 as parameters for sparse regions.
[0047] In practical applications, since validator nodes can dynamically join or leave, an update cycle can be set to redetermine the current positions of each validator node, recalculate the target latitude and longitude, and redetermine dense and sparse areas.
[0048] Data centers within dense and sparse areas can be identified based on relevant information obtained from a database. Alternatively, data centers within dense and sparse areas can be identified using information provided by a specified organization. Data centers can serve as physical carriers for validator nodes. Compared to devices used by individual users to carry validator nodes, data centers typically offer higher communication performance (e.g., low latency, high bandwidth, high throughput). Embodiments of this application can utilize existing validator nodes in the data center or deploy new validator nodes within the data center as the first relay node in the dense area and the second relay node in the sparse area. The determination process for the first and second relay nodes is described below.
[0049] In some implementations of this application, for each dense area, the first relay node is determined by the following steps: determining a first candidate location and a first data center in the dense area; determining a first candidate relay node in each of the first data centers whose distance from the first candidate location meets a third distance range; determining first attribute information of each first candidate relay node; determining a first relay node in each of the first candidate relay nodes based on the first attribute information; the first attribute information includes the average round-trip time between the first candidate relay node and each validator node in the same dense area.
[0050] The first candidate location can be determined in the dense area in a predetermined manner. For example, the first candidate location can be the center of the dense area, or the dense area can be divided into multiple sub-regions of equal area, and the center of the sub-region with the highest unit density can be taken as the first candidate location.
[0051] Each first data center whose distance from the first candidate location meets the third distance range is designated as a first candidate data center, and the validator nodes deployed in these first candidate data centers (either previously deployed or newly deployed) are designated as first candidate relay nodes. Based on the first attribute information of the first candidate relay nodes, the first relay node is determined from among them. Regarding the first attribute information, since the first relay node needs to synchronize new block data to each validator node within the same dense area, to ensure synchronization efficiency, the average round-trip latency between the first candidate relay node and each validator node within the same dense area can be calculated, and this average round-trip latency can be used as one of the first attribute information of the first candidate relay node. For example, the first candidate relay node with the smallest average round-trip latency can be determined as the first relay node.
[0052] The first attribute information may also include the bandwidth value of the first candidate relay node, and the first relay node can be determined by combining the average round-trip delay and bandwidth value of each first candidate relay node.
[0053] For example, a dense area contains 15 primary data centers. After determining the primary candidate locations within the dense area, three primary data centers are identified that satisfy a third distance range from the primary candidate locations. For these three primary data centers: if a validator node already exists, it is used as the primary candidate relay node; if no validator node exists, a new validator node is created as the primary candidate relay node. Then, for each primary candidate relay node, the average round-trip time between the primary candidate relay node and all validator nodes within the same dense area is calculated as the primary attribute information of the primary candidate relay node. The primary candidate relay node with the smallest average round-trip time is then selected as the primary relay node.
[0054] In some other implementations, the first candidate relay node also includes several existing verifier nodes whose distance from the first candidate location satisfies a third distance range, and the first relay node is determined from among the several first candidate relay nodes in the manner described above.
[0055] In some implementations of this application, for each sparse region, the second relay node is determined by the following steps: determining a second candidate location and a second data center in the sparse region; determining a second candidate relay node in each data center whose distance from the second candidate location satisfies a fourth distance range; determining second attribute information for each second candidate relay node; determining a second relay node in each second candidate relay node based on the second attribute information; the second attribute information includes the average round-trip time between the second candidate relay node and each validator node in the same sparse region.
[0056] The second candidate location can be determined in the sparse region in a predetermined manner. For example, the second candidate location can be the center of the sparse region, or the sparse region can be divided into multiple sub-regions of equal area, and the center of the sub-region with the highest unit density can be used as the second candidate location.
[0057] Each second data center whose distance from the second candidate location meets the fourth distance range is designated as a second candidate data center, and the validator nodes deployed in these second candidate data centers (either previously deployed or newly deployed) are designated as second candidate relay nodes. Based on the second attribute information of the second candidate relay nodes, the second relay node is determined from among these candidates. Regarding the second attribute information, since the second relay center needs to synchronize new block data to each validator node within the same sparse area, to ensure synchronization efficiency, the average round-trip latency between the second candidate relay node and each validator node within the same sparse area is calculated, and this average round-trip latency is used as one of the second attribute information of the second candidate relay node. For example, the second candidate relay node with the smallest average round-trip latency can be determined as the second relay node.
[0058] The second attribute information may also include the bandwidth value of the second candidate relay node, and the second relay node can be determined by combining the average round-trip delay and bandwidth value of each second candidate relay node.
[0059] In some other implementations, the second candidate relay node also includes several existing verifier nodes whose distance from the second candidate location satisfies the fourth distance range, and the second relay node is determined from several second candidate relay nodes in the manner described above.
[0060] In some implementations of the embodiments of this application, a relay propagation network is constructed based on a first relay node and a second relay node, including: establishing a communication connection between any one of the multiple first relay nodes and the remaining first relay nodes; determining a corresponding target first relay node for each second relay node; and establishing a communication connection between the corresponding second relay nodes and the target first relay node to construct the relay propagation network.
[0061] To further improve the transmission speed between first relay nodes, a dedicated network can be established, allowing each first relay node to connect with all other first relay nodes, achieving single-hop for first relay nodes in dense areas. A delay model can be established to determine the delay between local nodes and each of the first relay nodes. Based on the delay module, each second relay node can be designated as a local node, and the first relay node with the lowest delay can be designated as the target first relay node for that local node. Communication connections can then be established between these corresponding local nodes and the target first relay nodes, thus connecting each second relay node to its corresponding target first relay node, completing the construction of the relay propagation network.
[0062] In some implementations of the embodiments of this application, the data propagation method further includes: when there is an edge node to be connected, determining the delay information between each first relay node, each second relay node and the edge node to be connected; based on the delay information, establishing a communication connection between one of the first relay node and the second relay node and the edge node to be connected.
[0063] To reduce the latency of the relay network receiving new block data and enable all validator nodes to synchronize new block data more quickly, the latency information between each first relay node, each second relay node, and the edge node to be connected can be determined based on the above latency model. The first relay node and the second relay node with the smallest latency to the edge node to be connected can be connected to the edge node to be connected. This enables the relay network to receive new block data in a timely and fast manner, further improving the efficiency of new block data synchronization.
[0064] In some implementations of the embodiments of this application, the first relay nodes communicate with each other, and the first relay node and the second relay node communicate with each other based on the QUIC protocol.
[0065] The QUIC (Quick UDP (User Datagram Protocol) Internet Connections) protocol features low latency, high throughput, and high security. By combining dedicated single-hop connections between first relay nodes and communication between first and second relay nodes based on the QUIC protocol, it can effectively solve the high latency problem in block propagation caused by the different distribution densities of validator nodes in blockchain networks.
[0066] An example is provided to further illustrate an embodiment of this application. (Refer to...) Figure 2 This diagram illustrates a relay propagation network distribution according to an embodiment of this application. The relay propagation network includes first relay nodes T1-1, T1-2, and T1-3, and second relay nodes T2-1, T2-2, T2-3, T2-4, T2-5, and T2-6. Edge node V is connected to the second relay node T2-1. Edge node V produces new block data and transmits it to the second relay node T2-1. At this time, the remaining edge nodes in the sparse area where the second relay node T2-1 is located can synchronize with the new block data. The new block data from the second relay node T2-1 is synchronized to the first relay node T1-1 connected to it. At this time, the remaining edge nodes in the dense area where the first relay node T1-1 is located can synchronize with the new block data. The first relay node T1-1 synchronizes the new block data to the remaining first relay nodes T1-2 and T1-3 globally via a (intercontinental) single-hop dedicated network, and also synchronizes the new block data to the remaining second relay nodes, namely the second relay node T2-2. The first relay nodes T1-2 and T1-3 synchronize the new block data to their respective connected edge nodes (not shown in the diagram) and the second relay nodes, including second relay nodes T2-3, T2-4, T2-5, and T2-6. The second relay nodes T2-3, T2-4, T2-5, and T2-6 then synchronize the new block data to the edge nodes in their respective regions, thus completing the global validator node synchronization of the new block data.
[0067] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0068] Reference Figure 3 The diagram illustrates a data transmission apparatus provided in an embodiment of this application, which may specifically include: The validator node determination module 301 is used to determine multiple validator nodes in the blockchain network. Partitioning module 302 is used to determine multiple dense regions and multiple sparse regions based on the location of the validator nodes; The relay node determination module 303 is used to determine the first relay node located in each dense region and the second relay node located in each sparse region based on multiple validator nodes; The relay propagation network construction module 304 is used to construct a relay propagation network based on the first relay node and the second relay node; The block propagation module 305 is used to synchronize new block data to each validator node based on the relay propagation network when new block data exists in the relay propagation network. The first relay nodes are interconnected; the relay propagation network is connected to the edge nodes, which are the validator nodes other than the first and second relay nodes among the multiple validator nodes.
[0069] In some implementations of this application, the verifier node corresponds to the initial latitude and longitude in multiple databases; the data propagation device further includes: The initial latitude and longitude determination module is used to determine the different initial latitude and longitude corresponding to the same validator node in various databases; The weight value determination module is used to determine the weight value of each database; The weighted fusion module is used to perform weighted calculations based on the weight values of each database and the initial latitude and longitude to obtain the target latitude and longitude. The location determination module is used to determine the location of the verifier node with the target latitude and longitude.
[0070] In some implementations of this application, the partitioning module 302 includes: The dense and sparse parameter determination submodule is used to determine the parameters of the dense region and the sparse region. The dense region clustering submodule is used to cluster multiple validator nodes based on dense region parameters and locations to determine multiple dense regions; The sparse region clustering submodule is used to cluster multiple validator nodes based on sparse region parameters and locations to determine multiple sparse regions; The parameters for dense regions include a first distance range and a first number of nodes; the parameters for sparse regions include a second distance range and a second number of nodes.
[0071] In some implementations of this application, for each dense area, the first relay node is determined by the following sub-modules, including: The first candidate location determination submodule is used to determine the first candidate location and the first data center in a dense area; The first candidate relay node determination submodule is used to determine the first candidate relay node in each first data center whose distance from the first candidate location meets the third distance range; The first attribute information determination submodule is used to determine the first attribute information of each first candidate relay node; The first relay node determination submodule is used to determine the first relay node from among the first candidate relay nodes based on the first attribute information; The first attribute information includes the average round-trip time between the first candidate relay node and each validator node in the same dense area.
[0072] In some implementations of this application, the second relay node is determined for each sparse region through the following sub-modules, including: The second candidate location determination submodule is used to determine the second candidate location and the second data center in the sparse region; The second candidate relay node determination submodule is used to determine the second candidate relay node in each data center whose distance from the second candidate location meets the fourth distance range; The second attribute information determination submodule is used to determine the second attribute information of each second candidate relay node; The second relay node determination submodule is used to determine the second relay node from among the various second candidate relay nodes based on the second attribute information; The second attribute information includes the average round-trip time between the second candidate relay node and each validator node in the same sparse region.
[0073] In some implementations of the embodiments of this application, the relay propagation network construction module 304 includes: The first relay node connection submodule is used to establish a communication connection between any one of the multiple first relay nodes and the other first relay nodes. The target first relay node determination submodule is used to determine the corresponding target first relay node for each second relay node; The second relay node connection submodule is used to establish communication connections between corresponding second relay nodes and the target first relay node in order to build a relay propagation network.
[0074] In some implementations of the embodiments of this application, the data transmission device further includes: The edge node delay determination module is used to determine the delay information between each first relay node, each second relay node and the edge node to be connected when there is an edge node to be connected. The edge node connection module is used to establish a communication connection between the first relay node and the second relay node and the edge node to be connected based on delay information.
[0075] In some implementations of the embodiments of this application, the first relay nodes communicate with each other, and the first relay node and the second relay node communicate with each other based on the QUIC protocol.
[0076] This application provides a data transmission device, which can be used to implement the steps in the aforementioned method embodiments.
[0077] As the apparatus embodiments are basically similar to the method embodiments, they are described in a relatively simple manner. For relevant details, please refer to the description in the method embodiment section.
[0078] Reference Figure 4 The diagram illustrates an electronic device according to an embodiment of this application. Figure 4 As shown, the electronic device 400 in this embodiment includes: a processor 410, a memory 420, and a computer program 421 stored in the memory 420 and executable on the processor 410. When the processor 410 executes the computer program 421, it implements the steps in the various embodiments of the data propagation method described above, for example... Figure 1 Steps 101 to 105 are shown. Alternatively, when the processor 410 executes the computer program 421, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 3 The functions of modules 301 to 305 are shown.
[0079] For example, the computer program 421 can be divided into one or more modules / units, which are stored in the memory 420 and executed by the processor 410 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which can be used to describe the execution process of the computer program 421 in the electronic device 400. For example, the computer program 421 can be divided into a validator node determination module, a partitioning module, a relay node determination module, a relay propagation network construction module, and a block propagation module, with the specific functions of each module as follows: The validator node determination module is used to determine multiple validator nodes in the blockchain network; The partitioning module is used to determine multiple dense regions and multiple sparse regions based on the location of the verifier node; A relay node determination module is used to determine, among the plurality of verifier nodes, a first relay node located in each of the dense regions and a second relay node located in each of the sparse regions; The relay propagation network construction module is used to construct a relay propagation network based on the first relay node and the second relay node; The block propagation module is used to synchronize the new block data to each of the validator nodes based on the relay propagation network when new block data exists in the relay propagation network. The first relay nodes are interconnected; the relay propagation network is connected to edge nodes, which are the verifier nodes other than the first and second relay nodes among the plurality of verifier nodes.
[0080] The electronic device 400 may be a desktop computer, a cloud server, or other computing device. The electronic device 400 may include, but is not limited to, a processor 410 and a memory 420. Those skilled in the art will understand that... Figure 4 This is merely one example of electronic device 400 and does not constitute a limitation on electronic device 400. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 400 may also include input / output devices, network access devices, buses, etc.
[0081] The processor 410 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0082] The memory 420 can be an internal storage unit of the electronic device 400, such as a hard disk or memory of the electronic device 400. The memory 420 can also be an external storage device of the electronic device 400, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD) card, flash card, etc., equipped on the electronic device 400. Furthermore, the memory 420 can include both internal and external storage units of the electronic device 400. The memory 420 is used to store the computer program 421 and other programs and data required by the electronic device 400. The memory 420 can also be used to temporarily store data that has been output or will be output.
[0083] This application also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the data propagation method as described in the foregoing embodiments.
[0084] This application also discloses a computer program product, including a computer program, which, when run, causes the data propagation method as described in the foregoing embodiments to be executed.
[0085] The embodiments described above are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A data transmission method, characterized in that, include: Identify multiple validator nodes in the blockchain network; Based on the location of the verifier node, multiple dense regions and multiple sparse regions are determined; Based on the multiple verifier nodes, a first relay node located in each of the dense regions and a second relay node located in each of the sparse regions are determined; A relay propagation network is constructed based on the first relay node and the second relay node; If new block data exists in the relay propagation network, the new block data is synchronized to each of the validator nodes based on the relay propagation network; The first relay nodes are interconnected; the relay propagation network is connected to edge nodes, which are the verifier nodes other than the first and second relay nodes among the plurality of verifier nodes.
2. The method according to claim 1, characterized in that, The verifier node corresponds to initial latitude and longitude coordinates in multiple databases; the method further includes: Determine the different initial latitude and longitude corresponding to the same validator node in each of the aforementioned databases; Determine the weight value of each of the databases; The target latitude and longitude are obtained by weighting the weight values of each database and the initial latitude and longitude. The target latitude and longitude are determined as the location of the verifier node.
3. The method according to claim 1 or 2, characterized in that, The determination of multiple dense regions and multiple sparse regions based on the location of the verifier nodes includes: Determine the parameters for the dense region and the sparse region; Based on the dense region parameters and the location, the multiple verifier nodes are clustered to determine multiple dense regions; Based on the sparse region parameters and the location, the multiple verifier nodes are clustered to determine multiple sparse regions; The parameters for the dense region include a first distance range and a first number of nodes; the parameters for the sparse region include a second distance range and a second number of nodes.
4. The method according to claim 1 or 2, characterized in that, For each of the aforementioned dense areas, the first relay node is determined through the following steps: Determine a first candidate location and a first data center within the dense area; In each of the first data centers whose distance from the first candidate location satisfies the third distance range, a first candidate relay node is determined; Determine the first attribute information of each of the first candidate relay nodes; Based on the first attribute information, determine the first relay node among each of the first candidate relay nodes; The first attribute information includes the average round-trip time between the first candidate relay node and each of the verifier nodes in the same dense area.
5. The method according to claim 1 or 2, characterized in that, The second relay node for each of the sparse regions is determined through the following steps: Determine a second candidate location and a second data center within the sparse region; In each of the second data centers, a second candidate relay node is determined from each of the second candidate locations whose distance from the second candidate location satisfies the fourth distance range; Determine the second attribute information of each of the second candidate relay nodes; Based on the second attribute information, a second relay node is determined from each of the second candidate relay nodes; The second attribute information includes the average round-trip time between the second candidate relay node and each of the verifier nodes in the same sparse region.
6. The method according to any one of claims 1-3, characterized in that, The construction of the relay propagation network based on the first relay node and the second relay node includes: Establish a communication connection between any one of the multiple first relay nodes and the remaining first relay nodes; For each of the second relay nodes, determine the corresponding target first relay node; The corresponding second relay nodes establish communication connections with the target first relay node to construct a relay propagation network.
7. The method according to claim 1, characterized in that, The method further includes: In the presence of edge nodes to be connected, determine the delay information between each of the first relay nodes, each of the second relay nodes, and the edge nodes to be connected; Based on the delay information, one of the first relay node and the second relay node establishes a communication connection with the edge node to be connected.
8. The method according to claim 1, characterized in that, The first relay nodes communicate with each other, and between the first relay node and the second relay node, based on the QUIC protocol.
9. An electronic device, characterized in that, The device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device performs the method as described in any one of claims 1-8.
10. A computer program product, characterized in that, Includes a computer program, which, when run, causes the method as described in any one of claims 1-8 to be performed.