Block chain block synchronization method and system based on named data network
By adopting a blockchain block synchronization method based on named data networks in the blockchain network, and using a special request format to achieve efficient communication and data synchronization between nodes, the problems of low data synchronization efficiency and waste of bandwidth resources in large-scale network environments are solved, and more efficient data synchronization and resource utilization are achieved.
Patent Information
- Application Number
- CN202510103163.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-01-22
AI Technical Summary
There are performance bottlenecks in existing blockchain networks in data transmission and synchronization mechanisms in large-scale network environments, resulting in low data synchronization efficiency, excessive redundant requests and waste of bandwidth resources.
The blockchain block synchronization method based on a named data network is adopted to pull the special request formats of interest packets, interest packets in specific segments and data packets in specific segments to realize efficient communication and data synchronization between nodes, and update the target value and block data of the blockchain in the region.
It improves data synchronization efficiency, reduces redundant requests, makes full use of bandwidth resources, and enhances the push service capabilities of the blockchain network.
Smart Images

Figure CN119967007A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain block synchronization method and system based on a named data network. Background Art
[0002] Blockchain technology is a decentralized distributed ledger technology. Its core lies in achieving data immutability, transparency and high security through a decentralized network structure and consensus mechanism. Blockchain technology is widely used in many fields such as finance, supply chain, and the Internet of Things, especially in financial transactions, smart contracts, and data storage. However, with the expansion of the scale of blockchain networks, the limitations of its data transmission and synchronization mechanisms have gradually emerged, especially in large-scale network environments, where the communication method based on the TCP / IP architecture faces significant performance bottlenecks. Traditional blockchain networks use point-to-point (P2P) protocols for data transmission and synchronization. Data requests are independent of each other, resulting in the generation of redundant traffic and the inability to effectively utilize bandwidth resources, which in turn affects data synchronization efficiency and overall system performance. With the expansion of blockchain application scenarios, this problem has gradually become a bottleneck restricting the development of blockchain technology.
[0003] In blockchain applications, problems such as low data synchronization efficiency, excessive redundant requests and waste of bandwidth resources have become increasingly prominent, and existing technical solutions are difficult to meet the needs in large-scale network environments. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a blockchain block synchronization method based on a named data network to eliminate or improve one or more defects existing in the prior art.
[0005] One aspect of the present invention provides a blockchain block synchronization method based on a named data network, the method comprising the following steps:
[0006] For each blockchain node in the blockchain network, the initial state is set to an idle state. When the blockchain node is in an idle state, a state pull interest packet sent by other blockchain nodes is obtained. If the target value in the obtained state pull interest packet is greater than the local target value, the state of the blockchain node is updated to an update waiting state.
[0007] When the blockchain node is in an update waiting state, a specific segment block interest package is constructed and sent according to the target value in the acquired state pull interest package, so that other blockchain nodes can feedback a specific block segment data packet corresponding to the specific segment block interest package, and update the state of the blockchain node to the blockchain update state;
[0008] When a blockchain node receives a specific block segment data packet corresponding to a specific segment block interest packet fed back by other blockchain nodes, the blockchain node status is updated to a block synchronization status;
[0009] When a blockchain node is in a block synchronization state, it parses the data in a specific block segment data packet and updates the local blockchain based on the data in the data packet.
[0010] The above scheme is adopted. This scheme is a blockchain transmission architecture based on a named data network, which retains the existing distribution service characteristics of the network and enhances its push service capabilities. Through special request formats, such as state pull interest packages, specific segment block interest packages and specific block segment data packages, communication between nodes can be achieved, triggering the source node to push the data object to the target node in the application scenario. On the one hand, this scheme can update its own target value to the highest target value in the blockchain network through the state pull interest package; and it can build a specific segment block through the target value, and by sending a specific segment block interest package to request the data in the specific block segment data package, it can realize efficient update of the local blockchain, make full use of broadband resources, improve data synchronization efficiency, and reduce redundant requests.
[0011] In some embodiments of the present invention, the block synchronization state includes a synchronization start state and a synchronization end state;
[0012] When in the synchronization start state, the synchronization operation of the block data starts;
[0013] When in the synchronization end state, the block data in the specific block segment data packet is added to the local blockchain, and after the addition, the block data in the buffer is checked for availability. If the block data is available, the buffer data is updated.
[0014] In some embodiments of the present invention, the block synchronization state also includes a block cache state. When a new block cannot be added to the blockchain, it is in a block cache state. When in the block cache state, the node stores the new block data in the buffer according to the order of the block numbers.
[0015] In some embodiments of the present invention, the method further comprises:
[0016] When the target value in the state pull interest package obtained by the blockchain node is greater than the local target value, the local target value is updated;
[0017] The blockchain node enters the information pulling state every preset time slice or updates the local target value;
[0018] When the blockchain node is in an information pulling state, a state pulling interest package is constructed based on the local target value and published to the blockchain network.
[0019] In some embodiments of the present invention, the method further comprises:
[0020] When a blockchain node in the information pulling state receives a data packet containing a data value equal to the local target value or a state pulling interest packet less than the local highest block number, it returns to the idle state.
[0021] In some embodiments of the present invention, when the blockchain node is in an idle state, a state pull interest packet sent by other blockchain nodes is obtained. If the target value in the obtained state pull interest packet is greater than the local target value, the state of the blockchain node is updated to the update waiting state in the step, and the local target value is updated to the target value in the obtained state pull interest packet.
[0022] In some embodiments of the present invention, the blockchain network of the present method adopts the structure of a named data network, and the transmission structure used for data transmitted in the blockchain network includes a first transmission structure or a second transmission structure, the first transmission structure includes a target value of a local node, the second transmission structure includes a starting block number and a target block number, the state pull interest packet adopts the first transmission structure, and the specific block segment data packet adopts the second transmission structure.
[0023] In some embodiments of the present invention, the first transmission structure includes a common prefix, a name of the current node, a local target value, and an application name set in sequence; the second transmission structure includes a common prefix, a starting block number, a target block number, and an application name set in sequence.
[0024] In some embodiments of the present invention, when a blockchain node is in a block synchronization state, in the step of parsing data in a specific block segment data packet and updating the local blockchain based on the data in the data packet, if the parsed data is not within the update range of the local blockchain, the parsed data is cached.
[0025] The second aspect of the present invention also provides a blockchain block synchronization system based on a named data network, the system comprising a computer device, the computer device comprising a processor and a memory, the memory storing computer instructions, the processor being used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the system implements the steps implemented by the method described above.
[0026] The third aspect of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps implemented by the aforementioned blockchain block synchronization method based on a named data network.
[0027] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention can be specifically pointed out and obtained in the specification and the accompanying drawings.
[0028] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.
[0030] Figure 1 A schematic diagram of an implementation of a blockchain block synchronization method based on a named data network of the present invention;
[0031] Figure 2 A schematic diagram of the processing architecture of the blockchain block synchronization method based on the named data network of the present invention;
[0032] Figure 3 This is a schematic diagram of the state changes of this scheme;
[0033] Figure 4 This is a schematic diagram of the new node added in this solution;
[0034] Figure 5 This is the blockchain synchronization timing diagram of this solution;
[0035] Figure 6 This is a diagram of the naming rules for this scheme. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0037] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0038] like Figure 1 , 2 As shown in Figure 3, the present invention proposes a blockchain block synchronization method based on a named data network, and the steps of the method include:
[0039] Step S100, for each blockchain node in the blockchain network, the initial state is set to an idle state. When the blockchain node is in an idle state, a state pull interest packet sent by other blockchain nodes is obtained. If the target value in the obtained state pull interest packet is greater than the local target value, the state of the blockchain node is updated to an update waiting state.
[0040] In the specific implementation process, the idle state is the Idle state. In this state, the blockchain node is in an idle mode without performing any specific operations.
[0041] Step S200, when the blockchain node is in an update waiting state, a specific segment block interest package is constructed and sent according to the target value in the acquired state pull interest package, so that other blockchain nodes feedback a specific block segment data packet corresponding to the specific segment block interest package, and the state of the blockchain node is updated to the blockchain update state;
[0042] In the specific implementation process, the update waiting state is the UpdateWait state. When the node is in this state, it means that the highest block number in the entire network has been obtained, and the relevant update operation needs to be performed next.
[0043] In the specific implementation process, the node in the UpdateWait state will send a specific segment block interest packet (suffixed with updateSpecific) based on the new target value obtained, thereby entering the Updating state. After receiving the specific block segment interest packet, other nodes will parse out the block number contained in it. If the corresponding block is included, a specific block segment data packet containing the local target value and the corresponding block is sent; if the block is not included, it indicates that synchronization is required.
[0044] In the specific implementation process, the blockchain update state is the Updating state. In this state, the blockchain node is updating the local blockchain information.
[0045] Step S300, when the blockchain node receives a specific block segment data packet corresponding to a specific segment block interest packet fed back by other blockchain nodes, the blockchain node status is updated to a block synchronization status;
[0046] In the specific implementation process, the block synchronization state is the BlockSync state, and the node in this state will parse the received block data.
[0047] Step S400, when the blockchain node is in a block synchronization state, parse the data in a specific block segment data packet and update the local blockchain based on the data in the data packet.
[0048] In the specific implementation process, the node in the BlockSync state will parse the target value and block from the specific block segment data packet. If the block can be added to the local blockchain, the blockchain will be updated; if the block cannot be added to the local blockchain, it will be stored in the cache. After processing the block information, the node will determine whether the received target value is greater than the local target value. If a larger target value is obtained, it will enter the UpdateWait state; if a larger target value is not obtained, the state will be changed according to the target completion situation.
[0049] The above scheme is adopted. This scheme is a blockchain transmission architecture based on a named data network, which retains the existing distribution service characteristics of the network and enhances its push service capabilities. Through special request formats, such as state pull interest packages, specific segment block interest packages and specific block segment data packages, communication between nodes can be achieved, triggering the source node to push the data object to the target node in the application scenario. On the one hand, this scheme can update its own target value to the highest target value in the blockchain network through the state pull interest package; and it can build a specific segment block through the target value, and by sending a specific segment block interest package to request the data in the specific block segment data package, it can realize efficient update of the local blockchain, make full use of broadband resources, improve data synchronization efficiency, and reduce redundant requests.
[0050] In the blockchain transmission architecture based on the named data network (NDN), this solution needs to retain the existing distribution service characteristics of the network while enhancing its push service capabilities. Through a special request format, communication between nodes can be achieved, triggering the source node to push the data object to the target node in the application scenario. To this end, this solution designs a set of naming rules that conform to the characteristics of push behavior based on NDN, and introduces a new data structure to synchronize information with blocks. Figure 2 The system architecture diagram designed by this method is shown. The system integrates NDN into the blockchain network, enabling blockchain nodes to transmit data packets through NDN as the network layer, thereby efficiently completing key operations such as mining and on-chain data synchronization. Figure 1 The identity of a blockchain node can be a node with complete block information, a node that has just joined the network, or a node that has been offline for a period of time. This article uses a state diagram to clearly show the system's transition logic in different states, and closely links the state switching steps with the specific implementation process. At the same time, the timing diagram shows the steps in the entire data transmission process, clarifying the tasks completed by each node at different time points.
[0051] In some embodiments of the present invention, the block synchronization state includes a synchronization start state and a synchronization end state;
[0052] When in the synchronization start state, the synchronization operation of the block data starts;
[0053] When in the synchronization end state, the block data in the specific block segment data packet is added to the local blockchain, and after the addition, the block data in the buffer is checked for availability. If the block data is available, the buffer data is updated.
[0054] In some embodiments of the present invention, the block synchronization state also includes a block cache state. When a new block cannot be added to the blockchain, it is in a block cache state. When in the block cache state, the node stores the new block data in the buffer according to the order of the block numbers.
[0055] In the specific implementation process, the synchronization start state is SyncStart, the synchronization end state is SyncEnd, and the block cache state is BlockCaching.
[0056] In some embodiments of the present invention, the method further comprises:
[0057] When the target value in the state pull interest package obtained by the blockchain node is greater than the local target value, the local target value is updated;
[0058] The blockchain node enters the information pulling state every preset time slice or updates the local target value;
[0059] When the blockchain node is in an information pulling state, a state pulling interest package is constructed based on the local target value and published to the blockchain network.
[0060] In the specific implementation process, the information pulling state is the Pull state. The node in this state will make its own judgment, and its judgment basis is that it may not be a synchronization node and has not yet obtained the highest block number in the entire network.
[0061] In some embodiments of the present invention, the method further comprises:
[0062] When a blockchain node in the information pulling state receives a data packet containing a data value equal to the local target value or a state pulling interest packet less than the local highest block number, it returns to the idle state.
[0063] In the specific implementation process, if this node is not the latest node, then after receiving the interest packet, the node with the highest block number in the entire network, if it determines that other nodes need to be updated, will propagate the local target value in the network by sending interest packets and data packets with the suffix pullStatus, thereby triggering the update of blockchain data in the entire network. When a node in the Pull state receives a data packet containing a value equal to the local target value, it will return to the Idle state.
[0064] Specifically, when a node obtains the first data packet, it will return to the Idle state. This method cannot ensure that the node obtains the highest block value in the entire network. However, even if the node returns to the Idle state, the previously sent state pull interest packet may still prompt other nodes to send the highest block number to the entire network, thereby enabling the node to obtain the highest block number in the entire network.
[0065] In some embodiments of the present invention, when the blockchain node is in an idle state, a state pull interest packet sent by other blockchain nodes is obtained. If the target value in the obtained state pull interest packet is greater than the local target value, the state of the blockchain node is updated to the update waiting state in the step, and the local target value is updated to the target value in the obtained state pull interest packet.
[0066] In some embodiments of the present invention, the blockchain network of the present method adopts the structure of a named data network, and the transmission structure used for data transmitted in the blockchain network includes a first transmission structure or a second transmission structure, the first transmission structure includes a target value of a local node, the second transmission structure includes a starting block number and a target block number, the state pull interest packet adopts the first transmission structure, and the specific block segment data packet adopts the second transmission structure.
[0067] In some embodiments of the present invention, the first transmission structure includes a common prefix, a name of the current node, a local target value, and an application name set in sequence; the second transmission structure includes a common prefix, a starting block number, a target block number, and an application name set in sequence.
[0068] In the specific implementation process, based on the hierarchical naming mechanism of NDN-like URLs, this solution designs the naming rules into two main categories. The first category is the request for pulling the latest status (pullStatus), which is used to request the latest blockchain status information. The second category is the request for updating a specific block number range (updateSpecific), which is used to synchronize block data within a specified range in the network.
[0069] In these two naming rules, the first part follows the NDN naming standard, which represents the globally routable part and is used to identify basic network services; the second part is a customizable part, where users can define specific data names according to application requirements, such as block numbers, version numbers, etc. This flexible hierarchical naming mechanism can effectively support blockchain state synchronization and data updates. This mechanism ensures the uniqueness and readability of the naming, and facilitates efficient retrieval and management of content.
[0070] Both naming methods use "ndn.blockchain" as a common prefix. Figure 6(a) shows how to request the latest status, where the naming suffix includes {nameOfNode} representing the node name, {localTargetNum} representing the target value (i.e. the latest block number known locally), which should be greater than or equal to the latest local block number; {pullStatus} is the application name used to request data on the latest block number in the network. Figure 6 (b) shows how to request to update data in a specific block number range, where {originNum} represents the starting block number, {targetNum} represents the ending block number, and {updateSpecific} is the application name, which allows requesting a specific range of block data based on the starting and ending block numbers.
[0071] Using the above scheme, in order to efficiently request data for a specific block segment, the mechanism of this scheme is designed to use the start and end block numbers to request block data in segments. Since this request method will generate a large number of data requests for the same block number range in the network, the request aggregation and in-network cache characteristics of NDN are utilized. The naming of the specific block segment request does not contain {nameOfNode}. This design allows multiple nodes to merge requests for the same block number range, thereby reducing redundant traffic in the network and improving network efficiency and resource utilization.
[0072] In the specific implementation process, interest packets and data packets are the two basic communication units in NDN. The interest packet is sent by the node requesting data and contains the name or prefix of the data of interest. When other nodes in the network receive the interest packet, if there is matching data in the cache, the corresponding data packet will be returned. The data packet carries the actual data content and its verification information to ensure the integrity and security of the data. BSNDN contains 4 types of packet structures:
[0073] 1. The interest packet suffix is pullStatus: it carries the target value of this node;
[0074] 2. The interest packet suffix is updateSpecific: it carries the starting block number and the target block number;
[0075] 3. The data packet suffix is pullStatus: it carries the target value of this node;
[0076] 4. The data packet suffix is updateSpecific: it carries the block data corresponding to the target value of other nodes and the specific block number range;
[0077] All nodes will process the above four packet structures. The structured naming and content design of the data packet facilitates the parsing of subsequent nodes. Compared with the design scheme of the prior art, this scheme has unique characteristics. The node no longer obtains the highest block number in the entire network through the data packet corresponding to the latest status interest packet. Since one interest packet can only correspond to one data packet, the excess data packets will be discarded by the node. Therefore, it cannot be guaranteed that the first data packet received by the node after sending the interest packet contains the highest block number in the entire network. However, the node can receive interest packets multiple times, so it can pass the block number through the interest packet carrying a higher block number to help other nodes obtain the highest block number in the entire network. The node can pass the known highest block number (target value) through the pullStatus interest packet, pullStatus data packet and updateSpecific data packet, thereby speeding up the speed at which nodes in the entire network obtain the latest block number and improving the efficiency of blockchain status synchronization.
[0078] In order to reduce redundant traffic in the network, the node status needs to be classified to reduce the number of nodes that can send pullStatus interest packets and ensure that the block number in the network link is as large as possible. Since the name structure of the updateSpecific interest packet only contains the information of the required block number and does not contain the node name information, the probability of duplicate interest names appearing in the network is high, thereby improving the cache hit rate and effectively utilizing the cache characteristics of NDN. .
[0079] In some embodiments of the present invention, when a blockchain node is in a block synchronization state, in the step of parsing data in a specific block segment data packet and updating the local blockchain based on the data in the data packet, if the parsed data is not within the update range of the local blockchain, the parsed data is cached.
[0080] In this solution, a new node is added as follows Figure 4 As shown:
[0081] exist Figure 4 In the block synchronization example shown, the network topology presents a 3×3 grid structure, including 9 blockchain nodes, and the network connection between nodes is smooth. The number next to the node is the highest block number of the node. Node A is a new node joining the blockchain network, while nodes B, C, and D have been disconnected for a period of time, and some blocks are missing. The remaining nodes have completed synchronization and have all the blocks generated by the system.
[0082] When node A joins the network, it sends a latest status request interest packet containing its highest block number as the target value to its neighboring nodes. After receiving the interest packet, nodes B and C determine that they have a higher block number, so they send their own latest status request interest packets. At this point, node A can obtain their highest block numbers from the interest packets of nodes B and C.
[0083] Since nodes B and C send the latest status request to their neighbors, and these neighbors have a higher highest block number, the neighbors will reply with the latest status request interest packet containing the higher block number. After receiving these replies, nodes B and C will update their own target values.
[0084] This updated information will eventually be broadcast back to Node A, updating Node A’s target value to the highest block number in the entire network (i.e. 100). Node A then sends a specific block segment request, waiting to receive the missing blocks.
[0085] In one embodiment, Figure 5 An example of a blockchain node synchronization sequence diagram is shown, involving the data synchronization process between five nodes (node A, node B, node C, node D and other neighbor nodes). In this diagram, node A represents the node to be synchronized, node B and node C are nodes that have been disconnected for a period of time, node C represents the node containing all blocks, and other neighbor nodes are an abstract set of neighbor nodes. The highest block number of each node is: node D>node A>node B>node C. The specific synchronization process is as follows:
[0086] Node A first sends a request for interest in the latest status to node B. Since the request contains node A's target value, and node A's target value is greater than node B's highest block number, node B learns that it is not in the latest status, and requests the missing blocks from node A and node C based on A's target value. After receiving the request for a specific block interest, node A returns the corresponding block data. After receiving the request, node C finds that it is missing the required blocks, and therefore also determines that it is not in the latest status. Since C does not know the highest block number in the network (i.e., it has no target value), it sends a request for the latest status to its neighboring nodes. When C obtains the target value of other nodes, it will issue a specific block interest request based on the missing block number, and after receiving the response, it will update its local blockchain to synchronize to the latest status.
[0087] When node D receives the latest status interest request from node A, it finds that its highest block number is larger, so it determines that it may be the latest node in the entire network. At this time, D will not only respond to A's data request, but also send the latest status interest request containing its own target value to other neighboring nodes. After receiving D's latest status interest request, other nodes can parse out the target value and update to the latest status accordingly. If other nodes send a specific block interest request to D, D will return the corresponding data packet. By broadcasting its target value to the entire network through nodes with higher block numbers, each node in the network can gradually update its highest block number to achieve node status synchronization across the entire network.
[0088] An embodiment of the present invention also provides a blockchain block synchronization system based on a named data network, the system comprising a computer device, the computer device comprising a processor and a memory, the memory storing computer instructions, the processor being used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the system implements the steps implemented by the method described above.
[0089] The embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps implemented by the aforementioned blockchain block synchronization method based on a named data network. The computer-readable storage medium may 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.
[0090] 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 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 the present invention. 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 the present invention 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.
[0091] It should be clear that the present invention 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 invention 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 invention.
[0092] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or replace features of other embodiments.
[0093] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A blockchain block synchronization method based on a named data network, characterized in that: The steps of the method include: For each blockchain node in the blockchain network, the initial state is set to an idle state. When the blockchain node is in an idle state, a state pull interest packet sent by other blockchain nodes is obtained. If the target value in the obtained state pull interest packet is greater than the local target value, the state of the blockchain node is updated to an update waiting state. When the blockchain node is in an update waiting state, a specific segment block interest package is constructed and sent according to the target value in the acquired state pull interest package, so that other blockchain nodes can feedback a specific block segment data packet corresponding to the specific segment block interest package, and update the state of the blockchain node to the blockchain update state; When a blockchain node receives a specific block segment data packet corresponding to a specific segment block interest packet fed back by other blockchain nodes, the blockchain node status is updated to a block synchronization status; When a blockchain node is in a block synchronization state, it parses the data in a specific block segment data packet and updates the local blockchain based on the data in the data packet.
2. The method for synchronizing blockchain blocks based on a named data network according to claim 1, characterized in that: The block synchronization state includes a synchronization start state and a synchronization end state; When in the synchronization start state, the synchronization operation of the block data starts; When in the synchronization end state, the block data in the specific block segment data packet is added to the local blockchain, and after the addition, the block data in the buffer is checked for availability. If the block data is available, the buffer data is updated.
3. The method for synchronizing blockchain blocks based on a named data network according to claim 2, characterized in that: The block synchronization state also includes a block cache state. When a new block cannot be added to the blockchain, it is in a block cache state. When in the block cache state, the node will store the new block data in the buffer according to the order of the block numbers.
4. The blockchain block synchronization method based on the named data network according to any one of claims 1 to 3, characterized in that: The method further comprises the steps of: When the target value in the state pull interest package obtained by the blockchain node is greater than the local target value, the local target value is updated; The blockchain node enters the information pulling state every preset time slice or updates the local target value; When the blockchain node is in an information pulling state, a state pulling interest package is constructed based on the local target value and published to the blockchain network.
5. The method for synchronizing blockchain blocks based on a named data network according to claim 4, characterized in that: The method further comprises the steps of: When a blockchain node in the information pulling state receives a data packet containing a data value equal to the local target value or a state pulling interest packet less than the local highest block number, it returns to the idle state.
6. The method for synchronizing blockchain blocks based on a named data network according to claim 1, characterized in that: When the blockchain node is in an idle state, a state pull interest packet sent by other blockchain nodes is obtained. If the target value in the obtained state pull interest packet is greater than the local target value, the state of the blockchain node is updated to the update waiting state in the step, and the local target value is updated to the target value in the obtained state pull interest packet.
7. The method for synchronizing blockchain blocks based on a named data network according to claim 1, characterized in that: The blockchain network of the present method adopts the structure of a named data network. The transmission structure used for data transmitted in the blockchain network includes a first transmission structure or a second transmission structure. The first transmission structure includes a target value of a local node, and the second transmission structure includes a starting block number and a target block number. The state pull interest packet adopts the first transmission structure, and the specific block segment data packet adopts the second transmission structure.
8. The method for synchronizing blockchain blocks based on a named data network according to claim 7, characterized in that: The first transmission structure includes a common prefix, a name of the current node, a local target value and an application name which are arranged in sequence; the second transmission structure includes a common prefix, a starting block number, a target block number and an application name which are arranged in sequence.
9. A blockchain block synchronization system based on a named data network, characterized in that: The system includes a computer device, which includes a processor and a memory. The memory stores computer instructions. The processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps implemented by the method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the steps implemented by the method as claimed in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Blockchain node data synchronization method and device and storage medium
CN113364847A
Block chain data synchronization method and device, electronic equipment and readable storage medium
CN116028578A
Data distribution system and method based on block chain
CN117714538A
Method and apparatus for blockchain based on information-centric networking
US20220150169A1