Block chain network data transmission method and system
The K-bucket and binary tree are constructed through the Geohash encoding mechanism, and the P2P topology of the blockchain network is optimized, which solves the problem of data propagation delay and redundancy in cross-region communication, and realizes efficient and reliable data transmission.
Patent Information
- Application Number
- CN202510537889.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-01
AI Technical Summary
The existing blockchain network has problems such as high data propagation delay, lots of redundant data and low network efficiency in cross-regional communication and high-density coverage scenarios. Geohash encoding has not been deeply integrated into the routing strategy, which limits the improvement of network efficiency.
The Geohash encoding mechanism is used to organize nodes at a hierarchical level, and the k-bucket and data propagation strategies based on Geohash binary tree are constructed through XOR distance calculation, and the P2P topology is optimized to realize the geographic management of nodes and efficient data propagation.
It improves data propagation efficiency, reduces network communication overhead, enhances the robustness and reliability of the network, and supports efficient data transmission in high dynamic environments.
Smart Images

Figure CN120416259A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and particularly to a blockchain network data transmission method and system combined with Geohash encoding, aiming to improve the efficiency of data and block propagation in the blockchain network, reduce communication overhead, optimize the network topology structure, and improve the overall network performance. Background Art
[0002] The data dissemination in the blockchain network mainly relies on the P2P (peer-to-peer) topology structure and usually uses flooding for data transmission, resulting in significant defects in cross-regional communication and high-density coverage scenarios. Specifically, the existing mechanism calculates the node levels depending on the XOR distance rather than the actual geographical distance, leading to a relatively high query latency for cross-continental nodes; the data dissemination mode of full-network broadcasting is prone to generating a large amount of redundant data, especially with low efficiency in sparse network areas. Although some research attempts to introduce Geohash encoding to optimize geographical location management, it has not been deeply integrated into the blockchain network layer design and failed to achieve an organic combination with the routing strategy, thus restricting the further improvement of network efficiency. Therefore, there is an urgent need for a data transmission method integrating geographical encoding to solve the bottleneck problems of the traditional architecture in terms of routing efficiency, redundancy control, and scalability. Summary of the Invention
[0003] The object of the present invention is to propose a blockchain network data transmission strategy based on Geohash encoding. By introducing the Geohash encoding mechanism, the nodes in the blockchain network (hereinafter referred to as nodes) are hierarchically organized geographically, the P2P topology structure is optimized, and the data dissemination efficiency is improved.
[0004] To achieve the above object, the main technical solutions of the present invention include:
[0005] I. Dynamical K-bucket construction driven by Geohash
[0006] Initial neighbor connection: Each node randomly selects x nodes as initial neighbors. Geohash is a method of encoding geographical coordinates into a string. The specific operation is to input the latitude and longitude (lat, lon) and the number of digits n to obtain the Geohash encoding. The process of Geohash encoding can be expressed as:
[0007] Geohash(lat, lon, n) → geohash
[0008] XOR distance calculation: Perform an XOR operation on its own Geohash encoding and the Geohash encodings of these x initial neighbors to obtain the XOR distance. The XOR distance is used to measure the "distance" between two nodes. The smaller the XOR distance, the "closer" the two nodes are.
[0009] k - Bucket Construction: These neighbor nodes are placed into different k - buckets according to the XOR distance. A k - bucket is a data structure used to store nodes within different distance ranges. Meanwhile, for nodes with an XOR distance of 0 (i.e., nodes with the same Geohash encoding), a separate area is set aside for storage.
[0010] Node Discovery and Update: A node sends a FindNode query request to the DHT network to query its own ID. The node that receives the request will return the information of the k nodes with the closest XOR distance stored in its own k - bucket (including IP address, port, etc.). The node that initiates the request adds the received node information to its own k - bucket and updates the relevant information. Thereafter, the node sends query requests to the newly received above - mentioned nodes and continuously iterates until no closer nodes are returned, at which point the construction of the k - bucket is completed.
[0011] K - Bucket Guarantee: The k - bucket mechanism ensures that each node can gradually fill a complete k - bucket after multiple queries, so that there are at least several nodes in each range (each row), thus ensuring the diversity of neighbor distribution and network connectivity. During this process, the node will continuously perform search and replacement operations, giving priority to neighbors with higher quality, avoiding excessive concentration of neighbors in a certain range, and ensuring a balanced distribution of near and far neighbors.
[0012] II. Data Propagation Optimization Method Based on Region Partitioning
[0013] 1. Construction of the Region Tree:
[0014] Region Tree Construction Method: Each character of Geohash is composed of 5 - bit binary encoding, that is, there are 2 5 = 32 possibilities for the binary of a character. Each node recursively constructs a 5 - layer binary tree based on each character of Geohash, and finally forms n binary trees (determined by the number of encoding bits), and each tree represents a different - level geographical division.
[0015] The first tree constructs a 5 - layer binary tree based on the 1st bit of Geohash. The leaf nodes at the bottom layer represent a geographical area, and this area may contain multiple nodes (with the same Geohash prefix).
[0016] The second tree further expands based on the 2nd bit of Geohash and further divides the area on the basis of the first tree.
[0017] And so on, a total of n binary trees (determined by the number of encoding bits) are constructed. Each tree is refined layer by layer on the basis of the previous tree, and finally a complete node coverage is formed.
[0018] 2. Data Diffusion
[0019] Regional propagation tree construction method: The initial data initiation node not only constructs a broad propagation tree based on the first character, but also gradually refines the tree based on the region where the character resides. Each leaf node ultimately represents a specific region, which contains multiple nodes with the same prefix. The nodes in the k-bucket form the finest-grained propagation hierarchy, ensuring data propagation to geographically close nodes while maintaining network connectivity.
[0020] Diffusion propagation method. Assume that the node ID contains n characters. During the first round of broadcast, the data is diffused from the initiating node through the first binary tree to the representative node in the area corresponding to the first leaf node corresponding to the first character of the current node ID. Thereafter, when the data is diffused level by level based on the propagation tree, the representative node that receives the data in each area will propagate it level by level along the second, third, fourth, ... nth tree based on its own propagation tree. The representative node in the leaf area of each tree is responsible for propagating the data to the representative node in the leaf area of the next tree. The data eventually reaches the node with the smallest XOR distance in the k-bucket, ensuring that the data can reach the representative node in the leaf area of the nth tree. For nodes with exactly the same Geohash, the data is sent directly to all nodes in the group by constructing a k-ary tree.
[0021] The beneficial effects of the present invention are:
[0022] Reduce data propagation delay: Adopt a hierarchical binary tree data transmission strategy based on Geohash coding, so that data can be efficiently spread throughout the network in a shorter number of hops, thereby reducing data confirmation time and improving system throughput.
[0023] Reduce network communication overhead: Through region partitioning and binary tree recursive broadcasting, data is only transmitted to neighboring nodes that match the Geohash code of the current node, avoiding unnecessary redundant broadcasts and optimizing bandwidth utilization.
[0024] Improve data transmission reliability: By setting up multiple downstream nodes for each region, redundancy is enhanced to ensure that data can still be successfully transmitted even if some nodes are offline or faulty, improving the robustness and reliability of the network.
[0025] Applicable to highly dynamic network environments: This method supports the dynamic joining and exit of nodes, and can quickly rebuild the propagation path based on Geohash coding, ensuring that the blockchain network can still maintain efficient data transmission capabilities in a highly dynamic environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying 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 accompanying drawings can be obtained based on these drawings.
[0027] Figure 1 It is a schematic diagram of a blockchain network data dissemination method provided by an embodiment of the present invention;
[0028] Figure 2 It is a schematic diagram of a five - bit encoding tree in an embodiment of the present invention;
[0029] Figure 3 It is a schematic diagram of a hierarchical structure of a region tree expanded layer by layer in an embodiment of the present invention;
[0030] Figure 4 It is a schematic diagram of a dissemination tree corresponding to each region tree in an embodiment of the present invention;
[0031] Figure 5 It is a schematic diagram of a k - ary tree with k = 2 in an embodiment of the present invention. Detailed implementation manners
[0032] The following uses specific examples to illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation manners. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present invention schematically. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0033] Figure 1 It is a schematic diagram of a blockchain network data transmission method provided by an embodiment of the present invention. As Figure 1 shown, the blockchain network data transmission method includes the following steps. Among them, the data information can be transaction information or block information:
[0034] I. Construction of k - buckets based on Geohash
[0035] Step 1: Initialization
[0036] When each node starts, randomly select 10 nodes as initial neighbors. At the same time, obtain its own geographical location information and convert it into a 5 - bit Geohash code.
[0037] Step 2: Exclusive - OR distance calculation and k - bucket construction
[0038] Suppose the Geohash code of node A1 is wwwkp. Node A1 performs an exclusive OR operation on its own Geohash code with the Geohash codes of 10 initial neighbors (e.g., nodes A2 - A10) respectively to obtain the exclusive OR distance. The initial neighbor nodes are placed into different k - buckets according to the exclusive OR distance. In this example, n is taken as 5, that is, a total of 5 * 5 = 25 bits, then the number of k - bucket numbers is 26, and the nodes with smaller exclusive OR distances are placed in the k - buckets with smaller numbers. For the nodes with an exclusive OR distance of 0, a separate area is allocated for storage.
[0039] Step 3: Node discovery and update
[0040] Node A sends a findnode request to its neighbor nodes, and the request content is to query its own Geohash code wwwkp. After receiving the request, the neighbor nodes search for the k nodes with the closest exclusive OR distance to wwwkp in their own neighbor lists, and return the information of these nodes as listnode to node A1. After receiving listnode, node A1 adds the nodes in it to its own k - buckets and updates the k - bucket structure. Then, node A1 sends a query request to the nodes in listnode, repeating the above process to ensure that there is node information in the area where each tree is first broadcast.
[0041] II. Data transmission based on Geohash binary tree
[0042] Step 1: Construction of area tree and propagation tree.
[0043] Binary tree construction. Each node constructs a 5 - layer binary tree for each character according to its 5 - bit Geohash code. Taking the first character as an example, it is converted into a 5 - bit binary code, and the path of the binary tree is constructed according to the exclusive OR result of the binary code corresponding to the Geohash of other nodes and its own binary code. If a certain bit is 0, it means a closer distance, then it branches to the left; if it is 1, it means a farther distance, then it branches to the right. The leaf nodes of the same tree represent an area, and an area may contain multiple nodes. A complete encoding tree is as Figure 2 shown, the hierarchical structure of the area tree expanded layer by layer is as Figure 3 shown, and the propagation tree corresponding to each area tree is as Figure 4 shown.
[0044] Step 2: Data diffusion
[0045] When a node needs to send a piece of data, it performs diffusion according to the following steps:
[0046] Step 101, according to the 5 - layer binary tree constructed by the first character w, the data is sent to an actual node in each area corresponding to the leaf nodes, that is, propagated toFigure 4 All nodes (such as x, y, s, n, etc.) in the corresponding propagation tree on the right side.
[0047] Step 102: In the same way, the data is diffused to each area according to the 5-layer binary tree constructed successively based on the second character w, the third character w, the fourth character k, and the fifth character p. Other nodes receiving this data information will also recursively construct a propagation tree locally according to the same strategy to ensure that the data covers all areas. The data propagation strategy in the embodiments of the present invention is as follows:
[0048] Geohash code = wwwkp
[0049] The first 5-layer binary tree: ______ -> Diffused to all areas
[0050] The second 5-layer binary tree: w____ -> Diffused to all areas starting with "w"
[0051] The third 5-layer binary tree: ww___ -> Further diffused to areas starting with "wx"
[0052] The fourth 5-layer binary tree: www__ -> Further narrow the scope
[0053] The fifth 5-layer binary tree: wwwk_ -> More precise propagation
[0054] Local broadcast: wwwkp -> Broadcast to all nodes of the Geohash through a k-ary tree
[0055] Step 103: For those with the same Geohash code as their own (the XOR distance is 0), if the total number of nodes m in the area ≥ 10, the data is forwarded through the constructed k-ary tree as shown Figure 5 If m < 10, A directly broadcasts to all nodes in this area.
[0056] Specifically, in the process of k-ary tree forwarding, node A sorts other nodes in the same area according to the node id, always ensuring that it is the root node of the k-ary tree, that is, the position of 0 in the figure, and the other nodes are sorted in sequence according to the id as 1, 2, 3, 4..., 10, 11. Taking k = 2, the node at position 0 will forward the data to 0 + 2 0 , 0 + 2 1 , 0 + 2 2 , 0 + 2 3 , (0 + 2 4=16>12, terminate) This means the data is sent to nodes at positions 1, 2, 4, and 8, and a corresponding task list is sent to each node. The tasks for node 1 are: {1:3,5,9}, the tasks for node 2 are {2:6,10}, and the tasks for node 3 are {3:7,11}}. The task for node 3 is first sent to node 1, which then forwards it. Nodes that only receive the data but not the task information will no longer forward it.
[0057] Accordingly, an embodiment of the present invention provides a blockchain network data transmission system, which is applied to a blockchain network composed of multiple blockchain nodes:
[0058] Each node in the system recursively constructs a multi-layer binary tree based on each character of the Geohash code, eventually forming n binary trees, each tree representing a different level of geographical division;
[0059] During the first round of broadcast, the data information is diffused from the initiating node through the first binary tree to the representative node in the corresponding area of the first leaf node corresponding to the first character of the current node; thereafter, when the data is diffused level by level based on the propagation tree, the representative node receiving the data in each area will propagate it level by level along the second, third, fourth, ... nth tree based on its own propagation tree. The representative node in the leaf area of each tree is responsible for propagating the data to the representative node in the leaf area of the next tree; the data finally reaches the node with the smallest XOR distance in the k-bucket, ensuring that the data information reaches the representative node in the leaf area of the nth tree.
[0060] The embodiment of the present invention introduces a Geohash encoding mechanism to organize network nodes in a geographically hierarchical manner, optimize the P2P topology, and improve data transmission efficiency.
[0061] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for data transmission in a blockchain network, characterized in that, The following steps are involved: Each node recursively constructs a multi-layer binary tree based on each character of the Geohash code, eventually forming n binary trees, each tree representing a different level of geographical division; During the first round of broadcast, the data information is spread from the initiating node through the first binary tree to the representative node in the area corresponding to the first tree child node corresponding to the first character of the current node; After that, when the data is diffused step by step based on the propagation tree, the representative node that receives the data in each area will propagate it step by step along the second, third, fourth, ... nth tree based on its own propagation tree. The representative node in the leaf area of each tree is responsible for propagating the data to the representative node in the leaf area of the next tree; the data information finally reaches the node with the smallest XOR distance in the k-bucket, ensuring that the data information reaches the representative node in the leaf area of the nth tree.
2. The method according to claim 1, characterized in that, Each node recursively constructs a multi-layer binary tree based on each character of the Geohash code, and finally forms n binary trees, including: Each block node builds a 5-layer binary tree for each character based on Geohash coding. Taking the first character as an example, it is converted into a 5-bit binary code, and the path of the binary tree is constructed based on the XOR result of the corresponding binary codes of other nodes' Geohash and its own binary code. If a bit is 0, it branches to the left; if it is 1, it branches to the right. The leaf nodes of the same tree represent an area.
3. The method according to claim 2, wherein The k-bucket is constructed by the following steps: Each node randomly selects x nodes as its initial neighbors; at the same time, it obtains its own geographic location information and converts it into a five-bit Geohash code; Each node performs an XOR operation on its own Geohash code and the Geohash codes of its x initial neighbors to obtain the XOR distance. The XOR distance is used to measure the "closeness" of two nodes. The smaller the XOR distance, the closer the two nodes are. These neighbor nodes are placed into different k-buckets according to the XOR distance. At the same time, a separate area is opened for storing nodes with an XOR distance of 0. A node sends a FindNode query request to the DHT network to query its own ID. The node that receives the request returns the information of the k nodes closest to it in its own k-bucket. The node that initiates the request adds the received node information to its own k-bucket and updates the relevant information. The node then sends a query request to the newly received nodes, and the cycle continues until no closer nodes are returned, at which point the construction of the k-bucket is completed.
4. The method according to claim 1, wherein For the same Geohash code as itself, if the total number of nodes in the area m ≥ 10, the data is forwarded by constructing a k-ary tree. If m < 10, it is directly broadcast to the nodes in the area.
5. The method according to claim 1, wherein Data information is transaction information or block information.
6. A blockchain network data transmission system, applied to a blockchain network consisting of multiple blockchain nodes, characterized by: Each node recursively constructs a multi-layer binary tree based on each character of the Geohash code, eventually forming n binary trees, each tree representing a different level of geographical division; During the first-round broadcast, the data information is diffused from the initiating node to the representative node within the area corresponding to the leaf node of the first binary tree corresponding to the first character of the current node through the first binary tree; When diffusing step by step based on the propagation tree thereafter, each representative node that receives the data within each area will propagate step by step along the second, third, fourth, …, nth tree based on its own propagation tree. The representative nodes within the leaf area of each tree are responsible for propagating the data to the representative nodes within the leaf area of the next tree; The data finally reaches the node with the smallest XOR distance in the k-buckets, ensuring that the data information reaches the representative node within the leaf area of the nth tree.
7. The system according to claim 6, wherein The step of each node recursively constructing multiple binary trees based on each character of the Geohash encoding to finally form n binary trees includes: each block point node constructs a 5-layer binary tree for each character in sequence based on the Geohash encoding; taking the first character as an example, it is converted into a 5-bit binary encoding, and the path of the binary tree is constructed according to the XOR result of the binary encoding corresponding to the Geohash of other nodes and its own binary encoding; if a certain bit is 0, it means the distance is closer, then branch to the left; if it is 1, it means the distance is farther, then branch to the right; the leaf nodes of the same tree represent an area, and an area may contain multiple nodes.
8. The system according to claim 6, wherein The k-buckets are constructed through the following steps: Each node randomly selects x nodes as initial neighbors; at the same time, obtains its own geographical location information and converts it into a 5-bit Geohash encoding; Each node performs an XOR operation on its own Geohash encoding and the Geohash encodings of these x initial neighbors to obtain the XOR distance; the XOR distance is used to measure the "distance" between two nodes, and the smaller the XOR distance, the "closer" the two nodes are; These neighbor nodes are placed into different k-buckets according to the XOR distance; at the same time, for the nodes with an XOR distance of 0, a separate area is set aside for storage; The node sends a FindNode query request to the DHT network to query its own ID; the node that receives the request will return the information of the k nodes with the closest XOR distance saved in its own k-bucket; the node that initiates the request adds the received node information to its own k-bucket and updates the relevant information; thereafter, the node sends a query request to the above-mentioned nodes newly received, and continuously loops and iterates until no closer node returns, at which time the construction of the k-bucket is completed.
9. The system according to claim 6, wherein For those with the same Geohash encoding as itself, if the total number of nodes m in the area is ≥10, the data is forwarded through constructing a k-ary tree, and if m < 10, it is directly broadcast to the nodes within the area.
10. The system according to claim 6, wherein The data information is transaction information or block information.