Block chain network data transmission method and device and block chain network
By introducing named data networks (NDN) and interest packet directed forwarding mechanisms into the blockchain network, the problem of inefficient data synchronization and transmission in traditional blockchain networks is solved, and more efficient data transmission and synchronization is achieved.
Patent Information
- Application Number
- CN202510156394.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-02-12
AI Technical Summary
There are bottlenecks in data synchronization and transmission efficiency in existing blockchain networks, especially when the number of nodes is huge. Traditional IP address identification and broadcast propagation methods lead to redundancy of data packets and insufficient bandwidth utilization.
A named data network (NDN) is adopted as the underlying architecture of the blockchain network, efficient routing and distribution is performed through content names, and a targeted forwarding mechanism based on interest packets is designed to update synchronous forwarding tables to reduce redundant data transmission.
Through the content caching and directional forwarding mechanism of NDN, the data synchronization efficiency of the blockchain network is significantly improved, data redundancy is reduced, and the performance of the entire blockchain system is improved.
Smart Images

Figure CN119814807A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain network data transmission method, device and blockchain network. Background Art
[0002] As a decentralized distributed ledger technology, blockchain technology has been widely used in finance, supply chain, medical field, digital asset management and other fields. Its core features include decentralization, tamper-proof and transparency. However, as the scale of blockchain network continues to expand, the data synchronization efficiency and network performance between nodes have become further key issues restricting the development of blockchain. Given the limitations of the current network infrastructure architecture, most blockchain systems transmit and synchronize data on IP-based point-to-point transmission protocols, but this network model has significant bottlenecks.
[0003] The traditional blockchain system is based on the TCP / IP network architecture, and nodes identify themselves through IP addresses. The blockchain network uses broadcast or neighbor-based transmission methods, resulting in low network resource utilization. Especially when there are a large number of nodes, the traditional method is prone to data packet duplication, resulting in insufficient bandwidth utilization and low transmission efficiency.
[0004] Named Data Networking (NDN) is a new content-based network architecture that can efficiently route and distribute data through content names rather than IP addresses. This network architecture provides a new approach to solving blockchain network synchronization problems. Through NDN's content caching and name-based addressing features, data can be transmitted between nodes more efficiently, and NDN's natural support for broadcasting is more suitable for blockchains, reducing the redundancy and overhead of data transmission.
[0005] However, the existing research and practice of using NDN to replace the blockchain network layer is more focused on how to send and receive data. The naming design and transmission design are relatively simple, and the adaptation method lacks full utilization of NDN performance. Since the block data generation location is unknown, NDN will send a large number of request messages, occupying channel resources; the simple use of broadcast transmission strategy ignores the characteristics of blockchain node data transmission, and purposeless NDN data requests will also cause a certain degree of data redundancy. Summary of the invention
[0006] In view of this, the embodiments of the present application provide a blockchain network data transmission method, device and blockchain network to eliminate or improve one or more defects existing in the prior art.
[0007] One aspect of the present application provides a blockchain network data transmission method, comprising:
[0008] Obtain the target interest packet in the blockchain network. If it is confirmed that the target interest packet is obtained for the first time, update the local synchronization forwarding table according to the incoming node ID corresponding to the target interest packet and the node name of the source node that initiated the target interest packet generated in advance in the naming method of the named data network;
[0009] If it is confirmed that there are downstream neighbor nodes in the blockchain network, the target interest packet is broadcast to all the downstream neighbor nodes so that the target interest packet is eventually broadcast to the entire blockchain network;
[0010] If another interest packet returned by the downstream neighbor node is received, it is determined whether to update the block status of itself and each of the downstream neighbor nodes based on the other interest packet returned, or to send a data packet corresponding to the new block to the downstream neighbor node that returned the other interest packet.
[0011] In some embodiments of the present application, the interest package includes a corresponding application name, an interest type, interest information corresponding to the interest type, and additional information; the application name includes: a blockchain based on a named data network;
[0012] The interest types include: data request interest and interest announcement;
[0013] The interest information corresponding to the data request interest includes: information for indicating the requested block;
[0014] The interest information corresponding to the interest announcement includes: information used to indicate connection establishment, connection rejection, response status, update status, connection termination and new block generation;
[0015] The additional information includes: at least one of a node name, a block hash value, and a block status generated in a naming manner of a named data network; the block status includes: a block height;
[0016] The target interest packet refers to the interest packet containing information for indicating the establishment of the connection, the response status, the update status, the end of the connection, the generation of the new block or the request block;
[0017] If the target interest packet contains information for indicating the establishment of the connection, the target interest packet is the first interest packet;
[0018] If the target interest packet contains information for indicating the response status, the target interest packet is a second interest packet;
[0019] If the target interest packet contains information for indicating the request block, the target interest packet is a third interest packet;
[0020] If the target interest packet contains information for indicating the update status, the target interest packet is the fourth interest packet;
[0021] If the target interest packet contains information for indicating the generation of the new block, the target interest packet is the fifth interest packet.
[0022] In some embodiments of the present application, the target interest packet is obtained in the blockchain network. If it is confirmed that the target interest packet is obtained for the first time, the local synchronization forwarding table is updated according to the incoming node ID corresponding to the target interest packet and the node name of the source node that initiates the target interest packet generated in advance in the naming method of the named data network, including:
[0023] In the blockchain network, the node itself is used as a source node to generate a first interest packet containing information for indicating the establishment of the connection, or the node receives a first interest packet containing information for indicating the establishment of the connection broadcasted by its upstream neighbor node in the blockchain network;
[0024] Determine whether the first interest packet is obtained for the first time, and if so, add a table entry of the source node corresponding to the first interest packet in the local synchronization forwarding table, wherein the table entry is used to store the correspondence between the node name of the source node corresponding to the first interest packet generated in advance in the naming method of the named data network and the incoming node ID corresponding to the first interest packet, wherein if the first interest packet is generated locally, the incoming node ID is the ID of the source node; if the first interest packet is received from its own upstream neighbor node, the incoming node ID is the ID of the upstream neighbor node;
[0025] If it is confirmed that there are downstream neighbor nodes in the blockchain network, the ID of each downstream neighbor node is used as the outgoing node ID and added to the table entry of the source node corresponding to the first interest packet.
[0026] In some embodiments of the present application, if another interest packet returned by the downstream neighbor node is received, judging whether to update the block status of itself and each of the downstream neighbor nodes according to the returned another interest packet, or sending a data packet corresponding to the new block to the downstream neighbor node that returns the other interest packet, includes:
[0027] If a second interest packet including information indicating the response status is received and returned by the downstream neighbor node, determining whether the block height indicated by the additional information in the second interest packet is higher than its own current block height;
[0028] If so, a downstream neighbor node whose block height is higher than its current block height is determined as the current target node, and its known block height is updated according to the block height of the target node indicated by the additional information in the second interest packet, and a third interest packet containing information for representing the requested block is sent to the target node, so as to perform a local block update based on the data packet of the highest block returned by the target node; and a fourth interest packet containing information for representing the update status and the block height of the target node is broadcast to other downstream neighbor nodes except the target node, so that other downstream neighbor nodes except the target node update their known block heights according to the block height of the target node and continue to broadcast the fourth interest packet containing information for representing the update status and the block height of the target node to their respective downstream neighbor nodes, thereby synchronizing the block heights of all nodes in the blockchain network to the block height of the target node;
[0029] If not, and the block height indicated by the additional information in the second interest packet is lower than its current block height, the downstream neighbor node whose block height is lower than its current block height is determined as the current target node, and a fourth interest packet containing information for indicating the update status and its own block height is sent to the target node, so that the target node updates its known block height according to the block height of the target node and returns a third interest packet containing information for indicating the requested block; the third interest packet returned by the target node is received, and the data packet of its current highest block is sent to the target node, so that the target node performs a local block update according to the received data packet of the highest block and continues to send a fourth interest packet containing information for indicating the update status and the block height of the target node to its downstream neighbor node, thereby synchronizing the block heights of all nodes in the blockchain network to the block height of the target node.
[0030] In some embodiments of the present application, the blockchain network data transmission method further includes:
[0031] In the blockchain network, the node itself is used as a source node to generate a sixth interest packet containing information for indicating the end of the connection, or the node receives a sixth interest packet containing information for indicating the end of the connection broadcasted by its upstream neighbor node in the blockchain network;
[0032] Determine whether the sixth interest packet is obtained for the first time, and if so, delete the entry of the source node corresponding to the sixth interest packet in the local synchronization forwarding table;
[0033] If it is confirmed that there are downstream neighbor nodes in the blockchain network, the sixth interest packet is broadcast to all the downstream neighbor nodes so that the sixth interest packet is eventually broadcast to the entire blockchain network.
[0034] In some embodiments of the present application, the target interest packet is obtained in the blockchain network. If it is confirmed that the target interest packet is obtained for the first time, the local synchronization forwarding table is updated according to the incoming node ID corresponding to the target interest packet and the node name of the source node that initiates the target interest packet generated in advance in the naming method of the named data network, including:
[0035] In the blockchain network, the node itself is used as a source node to generate a fifth interest packet containing information indicating the generation of the new block, or the node receives a fifth interest packet containing information indicating the generation of the new block broadcasted by its upstream neighbor node in the blockchain network;
[0036] Determine whether the fifth interest packet is obtained for the first time, and if so, add a table entry of the source node corresponding to the fifth interest packet in the local synchronization forwarding table, wherein the table entry of the source node corresponding to the fifth interest packet is used to store the correspondence between the node name of the source node pre-generated in the naming method of the named data network and the incoming node ID corresponding to the fifth interest packet, wherein if the fifth interest packet is generated locally, the incoming node ID is the ID of the source node; if the fifth interest packet is received from its own upstream neighbor node, the incoming node ID is the ID of the upstream neighbor node;
[0037] If it is confirmed that there are downstream neighbor nodes in the blockchain network, the ID of each downstream neighbor node will be used as the outgoing node ID and added to the table entry of the source node corresponding to the fifth interest packet, and a third interest packet containing information for representing the requested block will be sent to the source node to obtain the corresponding new block data packet.
[0038] In some embodiments of the present application, if another interest packet returned by the downstream neighbor node is received, judging whether to update the block status of itself and each of the downstream neighbor nodes according to the returned another interest packet, or sending a data packet corresponding to the new block to the downstream neighbor node that returns the other interest packet, includes:
[0039] If a third interest packet containing information indicating the requested block is received and returned by the downstream neighbor node, a data packet of the new block pre-stored locally is sent to the downstream neighbor node.
[0040] In some embodiments of the present application, the blockchain network data transmission method further includes:
[0041] Obtain a target interest packet in the blockchain network. If it is confirmed that this is not the first time that the target interest packet is obtained, a seventh interest packet containing information indicating the rejection of the connection is sent to the upstream neighbor node that sent the target interest packet, so that the upstream neighbor node that received the seventh interest packet deletes the ID of the node that sent the seventh interest packet from the entry in its synchronization forwarding table.
[0042] Another aspect of the present application provides a blockchain network data transmission device, comprising:
[0043] A synchronization forwarding table update module is used to obtain a target interest packet in the blockchain network. If it is confirmed that the target interest packet is obtained for the first time, the local synchronization forwarding table is updated according to the incoming node ID corresponding to the target interest packet and the node name of the source node that initiated the target interest packet generated in advance in the naming method of the named data network;
[0044] The interest packet broadcast module, if it is confirmed that there are downstream neighbor nodes in the blockchain network, broadcasts the target interest packet to all the downstream neighbor nodes so that the target interest packet is eventually broadcast to the entire blockchain network;
[0045] The node and block synchronization module is used to determine whether to update the block status of itself and each of the downstream neighbor nodes based on the other interest packet returned if another interest packet is received from the downstream neighbor node, or to send a data packet corresponding to the new block to the downstream neighbor node that returns the other interest packet.
[0046] The third aspect of the present application provides a blockchain network, and each node constituting the blockchain network is used to execute the blockchain network data transmission method.
[0047] The fourth aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the blockchain network data transmission method is implemented when the processor executes the computer program.
[0048] The fifth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the blockchain network data transmission method when executed by a processor.
[0049] The sixth aspect of the present application provides a computer program product, including a computer program, which implements the blockchain network data transmission method when executed by a processor.
[0050] The blockchain network data transmission method provided by the present application obtains a target interest packet in the blockchain network. If it is confirmed that the target interest packet is obtained for the first time, the local synchronization forwarding table is updated according to the incoming node ID corresponding to the target interest packet and the node name of the source node that initiates the target interest packet, which is pre-generated in the naming method of the named data network; if it is confirmed that there are downstream neighbor nodes in the blockchain network, the target interest packet is broadcast to all the downstream neighbor nodes so that the target interest packet is finally broadcast to the entire blockchain network; if another interest packet returned by the downstream neighbor node is received, it is determined whether to update the block status of itself and each of the downstream neighbor nodes according to the returned another interest packet, or to send a data packet corresponding to the new block to the downstream neighbor node that returns the other interest packet, which can make full use of the naming method of the named data network to reduce data redundancy in blockchain network data transmission, improve block data synchronization efficiency and enhance blockchain system performance.
[0051] Additional advantages, purposes, and features of the present application will be partially described in the following description, and will become partially apparent to those skilled in the art after studying the following, or may be learned from the practice of the present application. The purposes and other advantages of the present application can be achieved and obtained by the structures specifically pointed out in the specification and the drawings.
[0052] Those skilled in the art will understand that the purposes and advantages that can be achieved by the present application are not limited to the above specific description, and the above and other purposes that can be achieved by the present application will be more clearly understood based on the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The drawings described herein are used to provide a further understanding of the present application, constitute a part of the present application, and do not constitute a limitation of the present application. The components in the drawings are not drawn to scale, but are only for the purpose of illustrating the principles of the present application. In order to facilitate the illustration and description of some parts of the present application, the corresponding parts in the drawings may be enlarged, that is, they may become larger relative to other components in the exemplary device actually manufactured according to the present application. In the drawings:
[0054] Figure 1 This is a first flow chart of a blockchain network data transmission method in one embodiment of the present application.
[0055] Figure 2 A schematic diagram showing an example of a naming design for a data packet provided in this application.
[0056] Figure 3 A schematic diagram showing an example of another data packet naming design provided for this application.
[0057] Figure 4This is a schematic diagram showing a comparison of data propagation between the interest transfer method proposed in this application and the existing interest broadcasting method.
[0058] Figure 5 This is a schematic diagram of the structure of the synchronous forwarding expression proposed in this application.
[0059] Figure 6 This is a second flow chart of the blockchain network data transmission method in one embodiment of the present application.
[0060] Figure 7 This is a third flow chart of the blockchain network data transmission method in one embodiment of the present application.
[0061] Figure 8 This is a schematic diagram of a new block propagation example in an application example of the present application.
[0062] Fig. 9 This is a system status diagram corresponding to the blockchain network in an application example of this application.
[0063] Fig.10 This is a schematic diagram of the structure of a blockchain network data transmission device in one embodiment of the present application. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the implementation modes and the accompanying drawings. Here, the illustrative implementation modes and descriptions of the present application are used to explain the present application, but are not intended to limit the present application.
[0065] It should also be noted here that in order to avoid obscuring the present application due to unnecessary details, only the structures and / or processing steps closely related to the scheme according to the present application are shown in the accompanying drawings, while other details that are not very relevant to the present application are omitted.
[0066] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0067] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection with an intermediate.
[0068] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0069] In the existing blockchain network, data transmission and synchronization are the core links to achieve the normal operation of the decentralized system. However, with the continuous expansion of the number and distribution scale of blockchain nodes, the traditional IP-based peer-to-peer (P2P) network architecture has exposed many problems when dealing with large-scale data transmission. The most prominent problem is the inefficiency caused by data redundancy in network data transmission, which directly affects the performance and stability of the entire blockchain system.
[0070] Since the blockchain network adopts a decentralized structure, each node needs to synchronize data from other nodes. In order to ensure data consistency, blockchain nodes often transmit data through a broadcast mechanism. Although this broadcast data transmission method can ensure that the data eventually reaches all nodes, it is easy to cause a lot of redundant transmission in a large-scale network. For example, when a new block needs to be synchronized by all nodes, multiple nodes may repeatedly receive the same data packets, which are redundant in nature and fail to effectively utilize network bandwidth. In addition, data synchronization between nodes often adopts a request-response mechanism, and some nodes may continuously request data from other nodes, resulting in frequent data transmission and repeated exchanges, further increasing the network burden.
[0071] Although some studies have attempted to combine NDN with blockchain technology in recent years to explore how to optimize blockchain data transmission and synchronization through NDN, most of these studies focus on data request mechanisms and data naming, and have not yet explored the potential for deep integration of NDN and blockchain. Existing research on the combination of NDN and blockchain mainly focuses on how to use NDN's content naming and content addressing characteristics to improve the data request and acquisition process in blockchain networks. For example, some studies have explored what naming method to use to obtain the highest block status and what name to use to obtain block data; some studies have proposed subscription methods to perform data transmission in order to overcome the problem that NDN cannot actively push data. However, these methods will also have the overhead of maintaining new structures. In general, there is still a lot of room for current solutions. In order to make full use of the characteristics of NDN to accelerate the data transmission performance of the blockchain network layer, this application designs and implements a low-redundancy NDN blockchain network efficient synchronization mechanism based on directional forwarding. The synchronization mechanism can send NDN interests in a directional manner according to the neighbor node list to form a full-network synchronization forwarding tree, thereby reducing a large number of redundant interest packets and corresponding response data packets caused by interest broadcasts. Finally, the design of this application has been proven to reduce network transmission redundancy and improve the performance of the blockchain system.
[0072] Named Data Networking is a new Internet architecture that inherits the hourglass structure of the IP architecture and improves the communication method based on IP addresses into a communication method based on the content itself. Named Data Networking names the data in the network according to the content, matches the name of the content data and retrieves information during the forwarding process. Therefore, this network architecture no longer cares about the storage location of the data and directly provides services to the data. The three data structures of the NDN forwarding process (NFD): pending interest table PIT, forwarding information base FIB and content cache CS table. PIT is used to record the interests to be satisfied and their corresponding interfaces, FIB stores routing information to control the forwarding of interests, and CS is used to cache incoming data packets. These three structures work together with the forwarding strategy module to implement the above interest forwarding and data response process. In NFD, the interface connecting the application and the network layer or network node is called a surface. When an NDN data packet arrives at a surface, NFD processes the data packet and sends the data packet to another surface in a certain way, so that it reaches the next hop of the data packet. The advantages of NDN such as data caching, local multicast, and adaptive forwarding can better solve the problems of low transmission efficiency and high data redundancy in blockchain systems. At the same time, each data packet is encrypted and signed in NDN, ensuring the integrity and authenticity of the data. Therefore, it has become a trend to use NDN as the underlying network architecture in blockchain systems.
[0073] The NDN-based blockchain network transmission strategy (i.e., BlockNDN mechanism) is an NDN network design for transaction blockchain systems. Its purpose is to use NDN's multicast-supporting feature to reduce the overhead of IP networks. This method is named for block propagation suitable for transaction systems. In the design of this strategy, interests are divided into three parts: application, function, and data summary. Nodes use data summaries to locate missing blocks and send back corresponding block data as response packets. When nodes update block status, they also broadcast interests, and broadcast the hash summary of the new block as part of the interest to inform other network nodes of the status of the new block.
[0074] The BoNDN mechanism takes into account the adaptability of the blockchain network layer to NDN, and supports the real-time broadcast of blockchain transaction information through interest broadcasting. Since the interest is small, it will not affect the network. In addition, considering that NDN does not support active push of data, this mechanism uses the subscription push method to support the broadcast of block data in the blockchain. Ordinary nodes subscribe to miner nodes through interests, and miner nodes maintain a subscription table to record subscription status. When a miner node generates a new block, it sends the block data back to the node that subscribed to it according to the information in the subscription table, thus solving the problem of active data push.
[0075] The focus of the anchor mechanism is also on communication overhead and redundant traffic. Considering the security and efficiency issues of the combination of simple blockchain and NDN, the mechanism introduces the concept of anchors, which connect nodes by trimming NDN and cascading two NDN systems. In the first layer, the anchor acts as a consumer, and each node acts as a potential producer; in the second layer, the anchor acts as a producer. Newly generated data is propagated to the anchor through the first layer of NDN, and the anchor is relayed to other nodes through the second layer of NDN.
[0076] Therefore, in this application, the advantages and disadvantages of the above strategies are comprehensively considered, and a new blockchain network layer synchronization strategy is designed and implemented. The embodiments of this application respectively provide a blockchain network data transmission method, a blockchain network data transmission device for executing the blockchain network data transmission method, a physical device, a computer-readable storage medium and a computer program product, and a blockchain network, which can make full use of the characteristics of NDN, reduce data redundancy in data transmission, and improve block data synchronization efficiency.
[0077] The details are described in detail through the following examples.
[0078] Based on this, the embodiment of the present application provides a blockchain network data transmission method that can be implemented by a blockchain network data transmission device, see Figure 1 , the blockchain network data transmission method specifically includes the following contents:
[0079] Step 100: Obtain the target interest packet in the blockchain network. If it is confirmed that the target interest packet is obtained for the first time, update the local synchronization forwarding table according to the incoming node ID corresponding to the target interest packet and the node name of the source node that initiated the target interest packet generated in advance in the naming method of the named data network.
[0080] In one or more embodiments of the present application, the blockchain network data transmission device is arranged in a node in the blockchain network.
[0081] It can be understood that if the first interest packet is generated locally, the incoming node ID is the ID of the source node; if the first interest packet is received from its own upstream neighbor node, the incoming node ID is the ID of the upstream neighbor node. In other words, the node where the blockchain network data transmission device that executes the blockchain network data transmission method is located can be the source node that generates the target interest packet, or it can be an intermediate node that receives the target interest packet broadcasted by its own upstream neighbor node in the blockchain network.
[0082] In one or more embodiments of the present application, the incoming node ID can be abbreviated as the incoming face ID or the incoming ID, the outgoing node ID mentioned in the subsequent embodiments can be abbreviated as the outgoing face ID or the outgoing ID, and the target interest packet refers to an interest packet containing information for indicating the establishment of a connection (pull_status), a response status (answer), an update status (update), a new block generation (newblock) or a request block (request_block); the other interest packet in step 300 refers to another target interest packet different from the target interest packet in step 100. On this basis, the interest packet in the embodiment of the present application may also contain information for indicating a rejection of the connection (occupied), which will be described in detail in the subsequent embodiments. Among them, the ID (Identity document) refers to a unique identifier of a node in the blockchain network, such as a code.
[0083] In one or more embodiments of the present application, the interest package may also be abbreviated as interest.
[0084] Step 200: If it is confirmed that there are downstream neighbor nodes in the blockchain network, the target interest packet is broadcast to all the downstream neighbor nodes so that the target interest packet is eventually broadcast to the entire blockchain network.
[0085] In step 200, if it is confirmed that there is no downstream neighbor node in the blockchain network, step 300 will no longer be executed, and the target interest packet containing information used to represent the response status of itself will be directly sent to the upstream neighbor node that sent the target interest packet. The additional information of the target interest packet containing information used to represent the response status of itself includes its current block status (such as block height).
[0086] Step 300: If another interest packet returned by the downstream neighbor node is received, determine whether to update the block status of itself and each of the downstream neighbor nodes based on the returned interest packet, or send a data packet corresponding to the new block to the downstream neighbor node that returned the other interest packet.
[0087] In step 300, if another interest packet currently received and returned by the downstream neighbor node contains a target interest packet containing information for indicating the response status, it means that it is currently in a new node synchronization state, and it is determined whether the block height indicated by the additional information in the target interest packet is higher than its current block height, and whether to update the block status of the local node and other downstream neighbor nodes except the downstream neighbor node according to the judgment result.
[0088] In step 300, if a target interest packet containing information representing the requested block is received from the downstream neighbor node, it indicates that the node is currently processing a new block synchronization state and sends a data packet of the new block pre-stored locally to the downstream neighbor node.
[0089] As can be seen from the above description, the blockchain network data transmission method provided in the embodiment of the present application belongs to a transmission mechanism for reducing data redundancy in a blockchain network. The mechanism is based on the NDN network and aims to optimize the efficiency of the existing blockchain network in the data synchronization process. The blockchain network data transmission method provided in the embodiment of the present application uses the naming method of NDN as a routing method to replace the fixed routing method based on IP addresses in traditional blockchains. By naming and identifying block data and block status, nodes can obtain different data through different types of interests. In the transmission mechanism of the present application, a new data structure called synchronization forwarding table is involved for storing synchronization status, and a design is made for request (interest) naming. The synchronization process can be divided into two parts: new node synchronization and new block propagation.
[0090] In order to further make full use of the naming method of named data networks to reduce data redundancy in blockchain network data transmission, in a blockchain network data transmission method provided in an embodiment of the present application, see Figure 2 and Figure 3 The interest package includes a corresponding application name, an interest type, interest information corresponding to the interest type, and additional information; the application name includes: a blockchain based on a named data network (ndnblockchain);
[0091] See also Figure 2 and Figure 3 , the interest types include: data request interest (request) and interest announcement (main);
[0092] The interest information corresponding to the data request interest includes: information for indicating a request block (request_block);
[0093] The interest information corresponding to the interest announcement includes: information used to indicate establishment of connection (pull_status), rejection of connection (occupied), response status (answer), update status (update), termination of connection (finish) and generation of new block (newblock);
[0094] The additional information includes: a node name (such as node1) generated in a named data network naming manner, a block hash value, and at least one of a block status; the block status includes: a block height (such as 3291, 3292, or 3295);
[0095] The target interest packet refers to the interest packet containing information for indicating the establishment of the connection, the response status, the update status, the end of the connection, the generation of the new block or the request block;
[0096] If the target interest packet contains information for indicating the establishment of the connection, the target interest packet is the first interest packet;
[0097] If the target interest packet contains information for indicating the response status, the target interest packet is a second interest packet;
[0098] If the target interest packet contains information for indicating the request block, the target interest packet is a third interest packet;
[0099] If the target interest packet contains information for indicating the update status, the target interest packet is the fourth interest packet;
[0100] If the target interest packet contains information for indicating the generation of the new block, the target interest packet is the fifth interest packet.
[0101] It can be understood that the embodiment of the present application also provides a sixth interest package and a seventh interest package that do not belong to the target interest package. The sixth interest package refers to an interest package containing information used to indicate the end of the connection; the seventh interest package refers to an interest package containing information used to indicate the end of the connection.
[0102] Specifically, the new data structure for synchronization provided by the embodiment of the present application records the forwarding of interests, and records the block height status of different forwarding planes are additionally added to adapt to the blockchain network transmission. In order to obtain the block status of the blockchain synchronization network, the present application also designs six naming methods, and there is also a separate naming design for block acquisition. The node newly added to the network first initiates synchronization of the entire network, broadcasts its own information to other nodes, and then collects the status of other nodes in the entire network in a specific way. After obtaining the status, a block request is sent to the surrounding nodes. In the scenario where a new block is generated, the node that generates the block informs the surrounding nodes of the generation of the new block through interest, and other nodes that receive the interest send it an interest in requesting the block, thereby broadcasting the new block to the entire network.
[0103] That is, see Figure 4When a node requests data, it will selectively send data requests to the nodes it is connected to, and send interests in a targeted manner based on the feedback information from downstream nodes, thereby reducing redundant requests in the network. That is to say, all nodes in the network will be connected through interest announcements. When a node initiates a synchronization request, it will pull the synchronization status of the entire network and keep all nodes in the network up to date. This is equivalent to the synchronization node that receives the interest later establishing a subscription relationship with the node that forwards or sends the interest. Routing in this way will also reduce redundant data transmission, because only nodes that receive synchronization interests will return data, and the intermediate routing nodes will aggregate the data, thereby reducing redundant traffic in the network. In short, by designing the naming method, applying new data structures, and combining the characteristics of NDN, an NDN blockchain synchronization method that can reduce redundancy has been implemented.
[0104] In order to achieve the function of inter-node status acquisition and data request, the interest package and data are named and designed. The name structure of the interest package consists of four parts: application name, interest type, type information, and additional information. The additional information may be the node name, block hash value, or block height. The interest type is used to distinguish between announcement-type interests and ordinary data request interests.
[0105] There are five types of interest announcements: establishment of connection (pull_status), rejection of connection (occupied), response status (answer), update status (update) and end of connection (finish). Therefore, the interest announcement needs to carry three kinds of information. The first kind of information is the type of interest announcement, which is used to indicate the role of the interest packet. The second kind of information is the identity information of the node that sends the interest packet, which is used to distinguish the interests sent by different nodes. The third kind is the interest for the update status and response status. The interest name must also carry the highest block number information.
[0106] In addition to the above five interest announcements, there is also a newblock type interest announcement used to notify the generation of new blocks. In this interest announcement, the additional information field named by the interest will carry the block number of the latest generated block.
[0107] Among them, the type information and corresponding naming examples of the six interest announcements are shown in Table 1:
[0108] Table 1
[0109] Type Information Naming Examples pull_status / ndnblockchain / main / pull_status / node1 Sorry, I have no idea what this is. / ndnblockchain / main / occupied / node2 answer / ndnblockchain / main / answer / 3291 update / ndnblockchain / main / update / 3292 finish / ndnblockchain / main / finish / node1 newblock / ndnblockchain / main / newblock / 3295
[0110] In one or more embodiments of the present application, the synchronization forwarding table is a data structure that each node maintains during synchronization. The structure of the synchronization forwarding table is defined as follows: each entry consists of the name of the node initiating synchronization, the incoming face ID (also referred to as the incoming ID), and the outgoing face list (also referred to as the outgoing list). In the outgoing face list, each entry is used to record the ID of the outgoing face (i.e., FaceID) and the block height of the node corresponding to the outgoing face (referred to as height for short). There may be multiple entries in the synchronization forwarding table of a node at the same time, for example Figure 5 The synchronization information 1 to the synchronization information n in the , where n is a positive integer greater than 2, corresponds to the synchronization information of multiple nodes being synchronized.
[0111] Based on this, in order to further reduce the redundancy of transmission data during the synchronization of new nodes, in a blockchain network data transmission method provided in an embodiment of the present application, see Figure 6 , step 100 of the blockchain network data transmission method specifically includes the following contents:
[0112] Step 110: In the blockchain network, the first interest packet containing information for indicating the establishment of the connection is generated with itself as the source node, or the first interest packet containing information for indicating the establishment of the connection is received from its upstream neighbor node in the blockchain network.
[0113] Step 120: Determine whether the first interest packet is obtained for the first time. If so, add a table entry of the source node corresponding to the first interest packet in the local synchronization forwarding table, wherein the table entry is used to store the correspondence between the node name of the source node corresponding to the first interest packet generated in advance in the naming method of the named data network and the incoming node ID corresponding to the first interest packet, wherein if the first interest packet is generated locally, the incoming node ID is the ID of the source node; if the first interest packet is received from its own upstream neighbor node, the incoming node ID is the ID of the upstream neighbor node;
[0114] Step 130: If it is confirmed that there are downstream neighbor nodes in the blockchain network, the ID of each downstream neighbor node is used as the outgoing node ID and added to the table entry of the source node corresponding to the first interest packet.
[0115] Correspondingly, in a blockchain network data transmission method provided in an embodiment of the present application, see Figure 6 , step 300 of the blockchain network data transmission method specifically includes the following contents:
[0116] Step 310: if a second interest packet including information indicating the response status returned by the downstream neighbor node is received, determine whether the block height indicated by the additional information in the second interest packet is higher than its current block height; if so, execute step 320; if not, execute step 330;
[0117] Step 320: determine a downstream neighbor node whose block height is higher than its current block height as the current target node, update its known block height according to the block height of the target node indicated by the additional information in the second interest packet, and send a third interest packet containing information for indicating the requested block to the target node, so as to perform a local block update based on the data packet of the highest block returned by the target node; and broadcast a fourth interest packet containing information for indicating the update status and the block height of the target node to other downstream neighbor nodes except the target node, so that other downstream neighbor nodes except the target node update their known block height according to the block height of the target node and continue to broadcast the fourth interest packet containing information for indicating the update status and the block height of the target node to their respective downstream neighbor nodes, so that the block heights of all nodes in the blockchain network are synchronized to the block height of the target node;
[0118] Step 330: If the block height indicated by the additional information in the second interest packet is lower than its current block height, a downstream neighbor node whose block height is lower than its current block height is determined as the current target node, and a fourth interest packet containing information indicating the update status and its own block height is sent to the target node, so that the target node updates its known block height according to the block height of the target node and returns a third interest packet containing information indicating the requested block; the third interest packet returned by the target node is received, and the data packet of its current highest block is sent to the target node, so that the target node performs a local block update according to the received data packet of the highest block and continues to send a fourth interest packet containing information indicating the update status and the block height of the target node to its downstream neighbor node, thereby synchronizing the block heights of all nodes in the blockchain network to the block height of the target node.
[0119] That is to say, if the block height indicated by the additional information in the second interest packet is the same as its current block height, no processing is performed.
[0120] In order to further reduce the redundancy of transmission data during the synchronization of new nodes, in a blockchain network data transmission method provided in an embodiment of the present application, see Figure 7The blockchain network data transmission method also specifically includes the following contents:
[0121] Step 410: In the blockchain network, the node itself is used as a source node to generate a sixth interest packet containing information for indicating the end of the connection, or the node receives a sixth interest packet containing information for indicating the end of the connection broadcasted by its upstream neighbor node in the blockchain network;
[0122] Step 420: Determine whether the sixth interest packet is obtained for the first time. If so, delete the entry of the source node corresponding to the sixth interest packet in the local synchronization forwarding table.
[0123] Step 430: If it is confirmed that there are downstream neighbor nodes in the blockchain network, the sixth interest packet is broadcast to all the downstream neighbor nodes so that the sixth interest packet is eventually broadcast to the entire blockchain network.
[0124] In order to further reduce the redundancy of transmitted data during the synchronization of new blocks, in a blockchain network data transmission method provided in an embodiment of the present application, see Figure 7 , step 100 in the blockchain network data transmission method further specifically includes the following contents:
[0125] Step 140: In the blockchain network, the node itself is used as the source node to generate a fifth interest packet containing information used to indicate the generation of the new block, or the node receives a fifth interest packet containing information used to indicate the generation of the new block broadcasted by its upstream neighbor node in the blockchain network.
[0126] Step 150: Determine whether the fifth interest packet is obtained for the first time. If so, add the table entry of the source node corresponding to the fifth interest packet in the local synchronization forwarding table, wherein the table entry of the source node corresponding to the fifth interest packet is used to store the correspondence between the node name of the source node pre-generated in the naming method of the named data network and the incoming node ID corresponding to the fifth interest packet, wherein if the fifth interest packet is generated locally, the incoming node ID is the ID of the source node; if the fifth interest packet is received from its own upstream neighbor node, the incoming node ID is the ID of the upstream neighbor node.
[0127] Step 160: If it is confirmed that there are downstream neighbor nodes in the blockchain network, the ID of each downstream neighbor node is used as the outgoing node ID and added to the table entry of the source node corresponding to the fifth interest packet, and a third interest packet containing information for representing the requested block is sent to the source node to obtain the corresponding new block data packet.
[0128] Correspondingly, in a blockchain network data transmission method provided in an embodiment of the present application, see Figure 7 , step 300 of the blockchain network data transmission method specifically includes the following contents:
[0129] Step 340: If a third interest packet containing information indicating the requested block is received and returned by the downstream neighbor node, a data packet of the new block pre-stored locally is sent to the downstream neighbor node.
[0130] In order to further reduce the redundancy of transmission data during the synchronization of new nodes, in a blockchain network data transmission method provided in an embodiment of the present application, see Figure 7 , the blockchain network data transmission method also specifically includes the following contents:
[0131] Step 500: Obtain a target interest packet in the blockchain network. If it is confirmed that this is not the first time that the target interest packet is obtained, a seventh interest packet containing information indicating the rejection of the connection is sent to the upstream neighbor node that sent the target interest packet, so that the upstream neighbor node that receives the seventh interest packet deletes the ID of the node that sent the seventh interest packet from the entry in its synchronization forwarding table.
[0132] Based on this, in order to further illustrate the above embodiment, the present application also provides a specific application example of the blockchain network data transmission method, which is described in detail through a new node synchronization method, a new block synchronization method and a system status, as follows:
[0133] (I) New node synchronization method
[0134] When a new node joins the network, it is not synchronized with the blockchain network, so it is necessary to initiate a synchronization in the network. The general process is as follows: the new node needs to initiate the whole network synchronization by sending a connection establishment (pull_status) request carrying the local node name. In order to ensure that it can get the real synchronized block height, the node needs to broadcast this interest. The node that receives the interest will establish a table entry in the synchronization forwarding table, and continue to forward the interest to other nodes, and use the broadcasted node as its downstream node, and start waiting for the height sent by the downstream node. When a node in the synchronization state does not have a downstream node with an unknown height, it returns its own block height to the upstream node. Therefore, through this two-step process of establishing synchronization-returning height, the node that initiates synchronization can obtain the latest block status in the current network, and send the interest of requesting blocks to a neighbor with the highest block in the network through the content of its own synchronization forwarding table. In this process, there may be other nodes in the network that are not in the highest state of the whole network. In this case, when receiving the interest with block height from upstream or downstream, it will also update its own state. The following is a detailed introduction to the message types involved:
[0135] (1) / pull_status / : When a node initiates synchronization, assuming that node M wants to initiate synchronization, it sends the pull_status interest to all neighbor nodes, requesting to establish a synchronization connection with the neighbor nodes. And establish a table entry with the local node as the identifier in the local synchronization forwarding table, and record all FaceIDs issued by the pull_status interest in the issuance list. When the neighboring node receives the pull_status request, it checks whether it has received the request synchronization interest sent by the same node. If not, that is, if it is the first time to receive the interest announcement, the neighboring node determines that it is currently joining the full network synchronization process, and regards the source of the interest as its upstream. It creates a new synchronization forwarding relationship table entry to maintain this synchronization relationship, and continues to broadcast the interest. The FaceID of the downstream neighbor node involved in its own broadcast is recorded in the outgoing face list of the table entry.
[0136] (2) / occupied / : When the node's synchronization forwarding table already has an entry for node M, it means that the node is already in the current synchronization relationship. When it receives a request to establish a synchronization relationship with the node identifier again, it needs to send an occupied type interest broadcast to the incoming side of the interest to refuse to establish a synchronization connection. Similarly, the node that receives the occupied type interest deletes the incoming side of the interest from the corresponding table entry list in the local synchronization forwarding table.
[0137] (3) / answer / {height} / : After the node has confirmed the status of all neighboring nodes, the node without any downstream nodes or the node that knows the status of all downstream nodes will return its highest block status to its "upstream" node in the name of the answer interest. The "upstream" node receives the answer interest with the block height, indicating that the child node has completed the message synchronization of all its child nodes in the synchronization relationship. It will first determine the difference between the height and its own known height. If it is higher than its own status, it will update its own known highest height and request the missing block from the downstream node. At the same time, it will use the update interest to notify its other downstream nodes to update their own highest block. If it is lower than its own known highest block, it will send an update interest with the highest block number to this downstream node to update the status of the downstream node.
[0138] (4) / update / {height} / : When a node receives an update interest, it indicates that its highest block status is lower than the highest block status of the upstream node. Therefore, it updates its own highest known block number and sends a request block request to the upstream node, and sends an update interest to other downstream nodes to update their highest known blocks.
[0139] (5) / finish_pull / : When all nodes except the node that initiated the synchronization request have fed back their own status to the upper node, the node that initiated the synchronization request will obtain the highest status of the entire network. Then the node that initiated the synchronization sends a finish_pull interest to all the egress faces in the synchronization forwarding table to indicate the end of the synchronization and delete the table entry. The node that receives the finish_pull interest also forwards the interest according to the egress face in the local table entry and deletes the table entry corresponding to the node in the local relationship table.
[0140] (II) New Block Synchronization Method
[0141] When a new block is generated, the node needs to announce it to the entire network. However, NDN itself does not support data broadcasting, so it is necessary to announce interests to notify other nodes of the generation of new blocks, so that other nodes can perform block verification and data requests. In the synchronization method of the present application, when a miner node mines a new block, it will first broadcast the message of the new block generation to other neighboring nodes through the interest / ndnblockchain / main / newblock / {number}. The node that receives the interest continues to broadcast this interest, and then broadcasts it to the entire network. Because in the scenario of new block broadcasting, it is not necessary to know the status of the interest outgoing node, so it is only necessary to record the ID of the incoming surface in the synchronization forwarding table, and send the interest of the request block to the incoming surface (such as / ndnblockchain / request / request_block / {number}) to obtain the latest block.
[0142] This method can reduce redundant interest broadcasts in the network and prevent multiple different nodes from generating response data to interests and affecting the propagation of valid blocks. Figure 8 As a propagation example, the new block generation node generates a new block and broadcasts it as follows:
[0143] It is assumed that node A is a new block generation node. When node A (nodeA) generates a new block, 1. Use interest / ndnblockchain / main / newblock / 3213 to notify the surrounding nodes of the generation of the new block. Node B (nodeB) and node C (nodeC) are the first to receive the interest of node A as neighbor nodes. After receiving it, 2. forward the newblock interest to their neighbors D and E respectively, record the incoming face ID of the interest sent by node A in the synchronization forwarding table, and under the guidance of the synchronization forwarding table, 2. send request_block interest to node A. After receiving the new block interest from nodes B and C, nodes D (nodeD) and node E (nodeE) will also update their own synchronization forwarding tables, and 3. send request_block interest to nodes B and C to request the block. Since node D is a neighbor node of B and C, it will receive the new block interest twice, but the second interest will be merged in the NDN node, so the node will only send the request block interest to node B in the end. After node E receives the newblock interest from node C, 4. it sends a request_block interest request to node C.
[0144] When the interest is returned, node A processes the requests from nodes B and C normally and returns the corresponding data. When node D sends interest to node C, since node C has already sent interest in the requested block, the interest is aggregated. When node C receives the corresponding data, it stores it in the local CS and forwards it to node D. When node E's interest reaches node C, since the local CS already has data that satisfies the interest, the data packet is returned directly from the CS table.
[0145] (III) System status
[0146] In the process of block synchronization, the system M can be roughly defined as:
[0147] M={Q,Σ,δ,Q0,ε}
[0148] Among them, see Fig. 9 , the state set Q is as follows:
[0149] Q=
[0150] {unsync,msgwaiting,requpdt,blockupdt,datawaiting,sync,reqblock,blockwaiting};
[0151] Among them, unsync can also be written as un-sync; msgwaiting can also be written as msg-waiting; requpdt can also be written as req-updt; blockupdt can also be written as block-updt; datawaiting can also be written as data-waiting; reqblock can also be written as req-block; blockwaiting can also be written as block-waiting. The specific meanings will be explained in detail later.
[0152] The un-sync state is the initial state Q_0, and the node running normally has no final state, so this application uses null to replace the final state set. When the system is in any of these states, when receiving the input Σ={E1,E2,…E11}, the state transition occurs in the manner. The explanation of the input Σ is shown in Table 3.
[0153] Table 3
[0154] enter explain E1 The node is started and receives the pull_status interest sent by itself E2 Receive pull_status interest E3 Receive an interest of type answer or update with a block not higher than the highest block known to it E4 Receive an answer or update type interest that is higher than the highest known block E5 Received requested block E6 Block processing completed E7 Received interest of type finish_pull E8 Data processing completed E9 Receive new block message or generate new block E10 Forwarding new block notification message completed E11 Receive new block data and add it to the local blockchain E12 Rejoining the blockchain network
[0155] The corresponding relationship between each state and input is shown in Table 4.
[0156] Table 4
[0157]
[0158] Among them, during the process of block synchronization, the nodes in the system can be roughly divided into seven states.
[0159] (1) un-sync: indicates that the node state of a newly joined node or a node that rejoins the network after a long period of disconnection due to network reasons is in the un-sync state. After joining the network, these nodes will actively send out a pull_status type interest to initiate full network synchronization and enter the msg-waiting state.
[0160] (2)msg-waiting: Indicates that nodes in the mmsg-waiting state are nodes that are in full network synchronization. These nodes will issue answer or update type interests based on the situation of receiving upstream and downstream messages. When a node in the message synchronization state receives an answer or update type interest, it will compare the block number carried by these interests with the highest known block locally. If E3. The received block number is not higher than the local answer or update interest, the message synchronization state is maintained to continue processing requests in the network; if E4. The received block number is higher than the local answer or update interest, it enters the req-updt state and sends a request block interest. If the finish_pull interest is received in the message synchronization state E7., it means that this round of synchronization has ended and enters the sync state.
[0161] (3) req-updt: Indicates that the node in the req-updt state has known the gap between its local block and other synchronization nodes, and sends the interest in requesting blocks according to the information in the synchronization information table. When E5. receives the requested block, it enters the block-updt state.
[0162] (4) block-updt: Indicates that a node in the block-updt state will wait to receive block data from other nodes, and will continue to process requests in other synchronization processes in the network. If it receives an answer or update interest in this state, it will also determine the difference between the local and interest block heights. If it receives an answer or update interest that is greater than the highest known local height, it will return to the req-updt state to update its request height. When node E6 receives all the requested block data, it will return to the msg-waiting state to continue participating in the full network synchronization, or if E7 receives a finish type interest, the node will enter the data-waiting state until it receives and completes the processing of the requested block.
[0163] (5) data-waiting: indicates that the node is aware of the highest state of the entire network, and the node will continue to process the received blocks in this state. When E8 receives and processes all requested blocks, it enters the sync state.
[0164] (6) sync: indicates that the synchronized state is the state of the vast majority of nodes in the network, and these nodes have the highest synchronized block in the entire network. A synchronized node can enter the message synchronization state when E2 receives a pull_status type interest and participates in the synchronization of the entire network; a synchronized node E9 generates a new block or receives an interest generated by a new block and enters the req-block state. Or if a node needs to rejoin the blockchain due to network reasons, it will enter the un-sync state and re-initiate synchronization.
[0165] (7) req-block: indicates that a new block is known to have been generated. In this state, the node will update its own synchronization interest table, record the direction of the interest received from the new block announcement, and continue to broadcast the interest. When E10. Modification of the synchronization interest table is completed, it enters the block-waiting state to prepare to request a new block.
[0166] (8) block-waiting: Indicates that the node in this state will send a new block request to the incoming ID of the new block synchronization interest in the synchronization interest table and wait for the block to be propagated. When node E11. receives the new block and adds it to the local blockchain, it returns to the sync state.
[0167] From the software level, the present application also provides a blockchain network data transmission device for executing all or part of the blockchain network data transmission method, see Fig.10 , the blockchain network data transmission device specifically includes the following contents:
[0168] The synchronization forwarding table update module 10 is used to obtain the target interest packet in the blockchain network. If it is confirmed that the target interest packet is obtained for the first time, the local synchronization forwarding table is updated according to the incoming node ID corresponding to the target interest packet and the node name of the source node that initiates the target interest packet generated in advance in the naming method of the named data network;
[0169] The interest packet broadcast module 20, if it is confirmed that there are downstream neighbor nodes in the blockchain network, broadcasts the target interest packet to all the downstream neighbor nodes so that the target interest packet is eventually broadcast to the entire blockchain network;
[0170] The node and block synchronization module 30 is used to determine whether to update the block status of itself and each of the downstream neighbor nodes based on the other interest packet returned if another interest packet is received from the downstream neighbor node, or to send a data packet corresponding to the new block to the downstream neighbor node that returns the other interest packet.
[0171] The embodiment of the blockchain network data transmission device provided in this application can be specifically used to execute the processing flow of the embodiment of the blockchain network data transmission method in the above-mentioned embodiment. Its functions will not be repeated here, and reference can be made to the detailed description of the above-mentioned blockchain network data transmission method embodiment.
[0172] The part of the blockchain network data transmission device that performs blockchain network data transmission can be completed in a node such as a server or a client device. The specific selection can be based on the processing capacity of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor for specific processing of blockchain network data transmission.
[0173] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.
[0174] The server and the client device may communicate with each other using any suitable network protocol, including network protocols that have not yet been developed on the date of filing this application. The network protocols may include, for example, TCP / IP, UDP / IP, HTTP, HTTPS, etc. Of course, the network protocols may also include, for example, RPC (Remote Procedure Call Protocol) and REST (Representational State Transfer) protocols used on top of the above protocols.
[0175] From the above description, it can be seen that the blockchain network data transmission device provided in the embodiment of the present application can make full use of the naming method of the named data network to reduce data redundancy in blockchain network data transmission, improve block data synchronization efficiency and enhance blockchain system performance.
[0176] An embodiment of the present application also provides a blockchain network, and each node constituting the blockchain network is used to execute the blockchain network data transmission method.
[0177] The embodiment of the present application also provides an electronic device, which may include a processor, a memory, a receiver and a transmitter, wherein the processor is used to execute the blockchain network data transmission method mentioned in the above embodiment, wherein the processor and the memory may be connected via a bus or other means, such as by bus connection. The receiver may be connected to the processor and the memory via wired or wireless means.
[0178] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0179] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the blockchain network data transmission method in the embodiment of the present application. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, that is, the blockchain network data transmission method in the above method embodiment is implemented.
[0180] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0181] The one or more modules are stored in the memory, and when executed by the processor, the blockchain network data transmission method in the embodiment is executed.
[0182] In some embodiments of the present application, the user equipment may include a processor, a memory, and a transceiver unit, which may include a receiver and a transmitter. The processor, memory, receiver, and transmitter may be connected through a bus system. The memory is used to store computer instructions, and the processor is used to execute the computer instructions stored in the memory to control the transceiver unit to send and receive signals.
[0183] As an implementation method, the functions of the receiver and the transmitter in the present application can be considered to be implemented through a transceiver circuit or a dedicated chip for transceiver, and the processor can be considered to be implemented through a dedicated processing chip, a processing circuit or a general chip.
[0184] As another implementation method, it is possible to use a general-purpose computer to implement the server provided in the embodiment of the present application, that is, to store the program code for implementing the functions of the processor, receiver, and transmitter in a memory, and the general-purpose processor implements the functions of the processor, receiver, and transmitter by executing the code in the memory.
[0185] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned blockchain network data transmission method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0186] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the aforementioned blockchain network data transmission method.
[0187] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is specifically performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0188] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0189] In the present application, features described and / or illustrated for one embodiment may be used in the same manner or in a similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0190] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the embodiments of the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A blockchain network data transmission method, characterized in that: include: Obtain the target interest packet in the blockchain network. If it is confirmed that the target interest packet is obtained for the first time, update the local synchronization forwarding table according to the incoming node ID corresponding to the target interest packet and the node name of the source node that initiated the target interest packet generated in advance in the naming method of the named data network; If it is confirmed that there are downstream neighbor nodes in the blockchain network, the target interest packet is broadcast to all the downstream neighbor nodes so that the target interest packet is eventually broadcast to the entire blockchain network; If another interest packet returned by the downstream neighbor node is received, it is determined whether to update the block status of itself and each of the downstream neighbor nodes based on the returned other interest packet, or to send a data packet corresponding to the new block to the downstream neighbor node that returned the other interest packet.
2. The blockchain network data transmission method according to claim 1, characterized in that: The interest package includes the corresponding application name, interest type, interest information corresponding to the interest type, and additional information; The application names include: blockchain based on named data network; The interest types include: data request interest and interest announcement; The interest information corresponding to the data request interest includes: information for indicating the requested block; The interest information corresponding to the interest announcement includes: information used to indicate connection establishment, connection rejection, response status, update status, connection termination and new block generation; The additional information includes: at least one of a node name, a block hash value, and a block status generated in a naming manner of a named data network; the block status includes: a block height; The target interest packet refers to the interest packet containing information for indicating the establishment of the connection, the response status, the update status, the end of the connection, the generation of the new block or the request block; If the target interest packet contains information for indicating the establishment of the connection, the target interest packet is the first interest packet; If the target interest packet contains information for indicating the response status, the target interest packet is a second interest packet; If the target interest packet contains information for indicating the request block, the target interest packet is a third interest packet; If the target interest packet contains information for indicating the update status, the target interest packet is the fourth interest packet; If the target interest packet contains information for indicating the generation of the new block, the target interest packet is the fifth interest packet.
3. The blockchain network data transmission method according to claim 2, characterized in that: The target interest packet is obtained in the blockchain network. If it is confirmed that the target interest packet is obtained for the first time, the local synchronization forwarding table is updated according to the incoming node ID corresponding to the target interest packet and the node name of the source node that initiates the target interest packet generated in advance in the naming method of the named data network, including: In the blockchain network, the node itself is used as a source node to generate a first interest packet containing information for indicating the establishment of the connection, or the node receives a first interest packet containing information for indicating the establishment of the connection broadcasted by its upstream neighbor node in the blockchain network; Determine whether the first interest packet is obtained for the first time, and if so, add a table entry of the source node corresponding to the first interest packet in the local synchronization forwarding table, wherein the table entry is used to store the correspondence between the node name of the source node corresponding to the first interest packet generated in advance in the naming method of the named data network and the incoming node ID corresponding to the first interest packet, wherein if the first interest packet is generated locally, the incoming node ID is the ID of the source node; if the first interest packet is received from its own upstream neighbor node, the incoming node ID is the ID of the upstream neighbor node; If it is confirmed that there are downstream neighbor nodes in the blockchain network, the ID of each downstream neighbor node is used as the outgoing node ID and added to the table entry of the source node corresponding to the first interest packet.
4. The blockchain network data transmission method according to claim 3 is characterized in that: If another interest packet returned by the downstream neighbor node is received, judging whether to update the block status of itself and each of the downstream neighbor nodes according to the returned another interest packet, or sending a data packet corresponding to the new block to the downstream neighbor node that returns the other interest packet, including: If a second interest packet including information indicating the response status is received and returned by the downstream neighbor node, determining whether the block height indicated by the additional information in the second interest packet is higher than its own current block height; If so, a downstream neighbor node whose block height is higher than its current block height is determined as the current target node, and its known block height is updated according to the block height of the target node indicated by the additional information in the second interest packet, and a third interest packet containing information for representing the requested block is sent to the target node, so as to perform a local block update based on the data packet of the highest block returned by the target node; and a fourth interest packet containing information for representing the update status and the block height of the target node is broadcast to other downstream neighbor nodes except the target node, so that other downstream neighbor nodes except the target node update their known block heights according to the block height of the target node and continue to broadcast the fourth interest packet containing information for representing the update status and the block height of the target node to their respective downstream neighbor nodes, thereby synchronizing the block heights of all nodes in the blockchain network to the block height of the target node; If not, and the block height indicated by the additional information in the second interest packet is lower than its current block height, the downstream neighbor node whose block height is lower than its current block height is determined as the current target node, and a fourth interest packet containing information for indicating the update status and its own block height is sent to the target node, so that the target node updates its known block height according to the block height of the target node and returns a third interest packet containing information for indicating the requested block; the third interest packet returned by the target node is received, and the data packet of its current highest block is sent to the target node, so that the target node performs a local block update according to the received data packet of the highest block and continues to send a fourth interest packet containing information for indicating the update status and the block height of the target node to its downstream neighbor node, thereby synchronizing the block heights of all nodes in the blockchain network to the block height of the target node.
5. The blockchain network data transmission method according to claim 2, characterized in that: Also includes: In the blockchain network, the node itself is used as a source node to generate a sixth interest packet containing information for indicating the end of the connection, or the node receives a sixth interest packet containing information for indicating the end of the connection broadcasted by its upstream neighbor node in the blockchain network; Determine whether the sixth interest packet is obtained for the first time, and if so, delete the entry of the source node corresponding to the sixth interest packet in the local synchronization forwarding table; If it is confirmed that there are downstream neighbor nodes in the blockchain network, the sixth interest packet is broadcast to all the downstream neighbor nodes so that the sixth interest packet is eventually broadcast to the entire blockchain network.
6. The blockchain network data transmission method according to claim 2, characterized in that: The target interest packet is obtained in the blockchain network. If it is confirmed that the target interest packet is obtained for the first time, the local synchronization forwarding table is updated according to the incoming node ID corresponding to the target interest packet and the node name of the source node that initiates the target interest packet generated in advance in the naming method of the named data network, including: In the blockchain network, the node itself is used as a source node to generate a fifth interest packet containing information indicating the generation of the new block, or the node receives a fifth interest packet containing information indicating the generation of the new block broadcasted by its upstream neighbor node in the blockchain network; Determine whether the fifth interest packet is obtained for the first time, and if so, add a table entry of the source node corresponding to the fifth interest packet in the local synchronization forwarding table, wherein the table entry of the source node corresponding to the fifth interest packet is used to store the correspondence between the node name of the source node pre-generated in the naming method of the named data network and the incoming node ID corresponding to the fifth interest packet, wherein if the fifth interest packet is generated locally, the incoming node ID is the ID of the source node; if the fifth interest packet is received from its own upstream neighbor node, the incoming node ID is the ID of the upstream neighbor node; If it is confirmed that there are downstream neighbor nodes in the blockchain network, the ID of each downstream neighbor node will be used as the outgoing node ID and added to the table entry of the source node corresponding to the fifth interest packet, and a third interest packet containing information for representing the requested block will be sent to the source node to obtain the corresponding new block data packet.
7. The blockchain network data transmission method according to claim 6, characterized in that: If another interest packet returned by the downstream neighbor node is received, judging whether to update the block status of itself and each of the downstream neighbor nodes according to the returned another interest packet, or sending a data packet corresponding to the new block to the downstream neighbor node that returns the other interest packet, including: If a third interest packet containing information indicating the requested block is received and returned by the downstream neighbor node, a data packet of the new block pre-stored locally is sent to the downstream neighbor node.
8. The blockchain network data transmission method according to any one of claims 2 to 7, characterized in that: Also includes: Obtain a target interest packet in the blockchain network. If it is confirmed that this is not the first time that the target interest packet is obtained, a seventh interest packet containing information indicating the rejection of the connection is sent to the upstream neighbor node that sent the target interest packet, so that the upstream neighbor node that received the seventh interest packet deletes the ID of the node that sent the seventh interest packet from the entry in its synchronization forwarding table.
9. A blockchain network data transmission device, characterized in that: include: A synchronization forwarding table update module is used to obtain a target interest packet in the blockchain network. If it is confirmed that the target interest packet is obtained for the first time, the local synchronization forwarding table is updated according to the incoming node ID corresponding to the target interest packet and the node name of the source node that initiated the target interest packet generated in advance in the naming method of the named data network; The interest packet broadcast module, if it is confirmed that there are downstream neighbor nodes in the blockchain network, broadcasts the target interest packet to all the downstream neighbor nodes so that the target interest packet is eventually broadcast to the entire blockchain network; The node and block synchronization module is used to determine whether to update the block status of itself and each of the downstream neighbor nodes based on the other interest packet returned if another interest packet is received from the downstream neighbor node, or to send a data packet corresponding to the new block to the downstream neighbor node that returns the other interest packet.
10. A blockchain network, characterized in that: Each node constituting the blockchain network is used to execute the blockchain network data transmission method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
NDN (Named Data Networking) interest packet reliable transmission method in wireless scene
CN109451080A
Caching method and device for Internet of Things
CN110012071A
Block chain data synchronization method and device, electronic equipment and readable storage medium
CN116028578A
Auto spraying apparatus having blower and solenoid valve
KR1020210148589A