CN107317842B - Block chain synchronous method and device based on NDN - Google Patents

Block chain synchronous method and device based on NDN Download PDF

Info

Publication number
CN107317842B
CN107317842B CN201710400368.0A CN201710400368A CN107317842B CN 107317842 B CN107317842 B CN 107317842B CN 201710400368 A CN201710400368 A CN 201710400368A CN 107317842 B CN107317842 B CN 107317842B
Authority
CN
China
Prior art keywords
block
request packet
user equipment
packet
network node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710400368.0A
Other languages
Chinese (zh)
Other versions
CN107317842A (en
Inventor
雷凯
齐竹云
金彤
张丽珠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University Shenzhen Graduate School
Original Assignee
Peking University Shenzhen Graduate School
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Peking University Shenzhen Graduate School filed Critical Peking University Shenzhen Graduate School
Priority to CN201710400368.0A priority Critical patent/CN107317842B/en
Publication of CN107317842A publication Critical patent/CN107317842A/en
Application granted granted Critical
Publication of CN107317842B publication Critical patent/CN107317842B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a kind of block chain synchronous method and device based on NDN, belongs to field of communication technology.The described method includes: user equipment sends block synchronization request packet to network node, the title of the block synchronization request packet includes naming data network protocol mark, application identities, the status information for requesting Packet type and block chain, and the status information of the block chain is used to indicate the height of the highest block of height in the block chain of the user equipment storage;The synchronization packets that the network node returns are received, and extract the storage of the block in the synchronization packets to block chain database.The synchronous method is a kind of block catenary system communication implementation method based on NDN, it is possible to reduce Internet traffic reduces transmission delay, and improve data transfer efficiency.

Description

Block chain synchronous method and device based on NDN
Technical field
It is the present invention relates to field of communication technology, in particular to a kind of based on name data network (Named Data Networking, NDN) block chain synchronous method and device.
Background technique
Block chain (blockchain) system is a kind of decentralization, not modifiable shared distributed intelligence data Library.Block chain is born in bit coin earliest, is a kind of chain for being sequentially in time combined into block in such a way that sequence is connected Formula data structure provides technical support for bit coin system.Wherein, each block namely data block, each data The information of a bit coin network trading is contained in block, for verifying the validity (anti-fake) of its information and generating next area Block.
In block catenary system, after user equipment produces new block, block is broadcasted.Other use in network Family equipment can verify its legitimacy after receiving block;If local block is added in the block by user equipment by verifying In chain.In this way, each user equipment stores a block chain, and if system operation is correct, the block chain of these user equipmenies It is the same.
Currently, block catenary system is based primarily upon transmission control protocol/Internet Protocol (Transmission Control Protocol/Internet Protocol, TCP/IP) network architecture, the block chain based on the TCP/IP network architecture The generally existing following problems of system:
(1) it cannot achieve complete decentralization demand.Since business needs, there are many block catenary systems to have decentralization Demand.Such as one of project most mature at present, bit coin is theoretically the pure peer-to-peer network of a complete decentralization Network (Peer to Peer, P2P) system.But in practical implementations, it is contemplated that the difficulty of communication, developer increase in systems Super node, for distributing Various types of data to the user equipment of request connection.The setting of super node increases the peace of bit coin Full blast danger, because super node can join together to user equipment tissue fraudulent activities.Meanwhile this framework also result in it is super The problem of load excessive of grade node, presence service quality can not be improved with single-point collapse.
(2) it is difficult to realize nearest download function.According to design, certain customers' equipment of block catenary system can store current system The newest block chain of system, when there is new user equipment requests to obtain block chain, they can return to corresponding data, but such as The user equipment of He Rangxin can be from being stored with newest block chain and obtaining block chain in nearest user equipment, always The block chain based on the TCP/IP network architecture there are the problem of.
Summary of the invention
In order to solve the problems, such as that block chain technology exists in the prior art, the embodiment of the invention provides one kind to be based on NDN Block chain synchronous method and device.
In a first aspect, the embodiment of the invention provides a kind of block chain synchronous method based on name data network, it is described Method includes: user equipment to network node transmission block synchronization request packet, and the title of the block synchronization request packet includes life Name data network protocol mark, application identities, the status information for requesting Packet type and block chain, the status information of the block chain It is used to indicate the height of the highest block of height in the block chain of the user equipment storage;Receive what the network node returned Synchronization packets, and the storage of the block in the synchronization packets is extracted to block chain database.
The embodiment of the present invention passes through to be synchronized based on name data network progress block, since it is based on name data network Block chain framework does not need to avoid problem brought by setting super node in setting super node;Meanwhile in name number According in network, block synchronization request packet can be forwarded to multiple other users equipment simultaneously in repeating process, and away from Corresponding data packet can be returned at first from nearest user equipment, to realize the nearest downloading of block;In addition, name data Network node in network can search the content store of oneself when receiving block synchronization request packet, and will be corresponding Data packet is supplied to user equipment, and the multiplexing of data is realized using the content store of network node, reduces data transmission Amount and transmission delay.
In an implementation of the embodiment of the present invention, the user equipment sends block synchronization request to network node Packet, comprising: determine the highest block of height in the block chain of storage, and calculate its cryptographic Hash;Most by height in the block chain Status information of the cryptographic Hash of high block as the block chain, generates the block synchronization request packet;The block is same Step request packet is sent to the network node.
In this implementation, using the cryptographic Hash of the highest block of height in the block chain of storage as the block chain Status information, convenience of calculation.
In another implementation of the embodiment of the present invention, the method also includes: it is sent when in the user equipment When not receiving the synchronization packets in the setting time after the synchronization request packet, Xiang Suoshu network node sends block Searching request packet, the title of the block search request packet include name data network protocol mark, application identities, request packet class Type and block-identified, the height of a upper block for the block-identified block for being used to indicate the user equipment searches, it is described The height of a upper block for the block of user equipment searches is the highest block of height in the block chain of user equipment storage Height;When receiving the search data packet that the network node returns, the block storage in described search data packet is extracted To block chain database, then send new block search request packet, the new block search request packet it is block-identified with The block-identified difference of the block search request packet;When the search for not receiving the network node return in the given time When data packet, the block search request packet is retransmitted.
In another implementation of the embodiment of the present invention, the method also includes: receive the another of network node transmission The block synchronization request packet that one user equipment is sent;The area in block synchronization request packet sent according to another user equipment The status information of block chain determines the height of the highest block of height in the block chain of another user equipment storage;Compare really The height of the highest block of height and the user equipment store in the block chain for another user equipment storage made The height of the highest block of height in block chain determines that another user equipment needs synchronous block;According to described another User equipment needs synchronous block to generate synchronization packets, and returns to another user equipment.
In another implementation of the embodiment of the present invention, the method also includes: when the user equipment is successfully created When building block, the network node into network broadcasts the information of the block;Receive the block search request that network node is sent Packet, the block search request packet is for requesting the newly created block of the user equipment;It sends and searches for the network node Request packet, described search data packet include the newly created block of the user equipment.
Second aspect, the embodiment of the invention also provides a kind of block chain synchronous method based on name data network, institutes The method of stating includes: that network node receives the block synchronization request packet that user equipment is sent, the title of the block synchronization request packet Including name data network protocol mark, application identities, the status information for requesting Packet type and block chain, the shape of the block chain State information is used to indicate the height of the highest block of height in the block chain of the user equipment storage;It is looked into content store The corresponding synchronization packets of the block synchronization request packet are looked for, the synchronization packets include the area that the user equipment does not update Block;When finding the corresponding synchronization packets of the block synchronization request packet in the content store, by the synchronization Data packet returns to the user equipment;It is corresponding same when not finding the block synchronization request packet in the content store When step data packet, the corresponding entry of the block synchronization request packet is searched in the interest table undetermined of the network node;Work as institute It states when not finding the corresponding entry of the block synchronization request packet in the interest table undetermined of network node, in interest table undetermined Corresponding entry is added, and inquires interface corresponding with the block synchronization request packet in forwarding information table, by determining Interface forward the block synchronization request packet;It is asked when finding the block in the interest table undetermined of the network node and synchronizing When seeking the corresponding entry of packet, addition receives the interface of the block synchronization request packet in the entry found;When receiving When stating the corresponding synchronization packets of block synchronization request packet, the synchrodata is forwarded according to the entry in the interest table undetermined Packet.
The embodiment of the present invention passes through to be synchronized based on name data network progress block, since it is based on name data network Block chain framework does not need to avoid problem brought by setting super node in setting super node;Meanwhile in name number According in network, block synchronization request packet can be forwarded to multiple other users equipment simultaneously in repeating process, and away from Corresponding data packet can be returned at first from nearest user equipment, to realize the nearest downloading of block;In addition, network node When receiving block synchronization request packet, the content store of oneself can be searched, and corresponding data packet is supplied to user Equipment realizes the multiplexing of data using the content store of network node, reduces volume of transmitted data and transmission delay.
In an implementation of the embodiment of the present invention, the method also includes: receive user equipment send block Searching request packet, the title of the block search request packet include name data network protocol mark, application identities, request packet class Type and block-identified, the height of a upper block for the block-identified block for being used to indicate the user equipment searches;Inside It stores and searches the corresponding search data packet of the block search request packet in storage cavern, described search data packet includes that the user sets The block of standby search;When finding the corresponding search data packet of the block search request packet in the content store, Described search data packet is returned into the user equipment;It is requested when not finding the block search in the content store When wrapping corresponding search data packet, it is corresponding in the interest table undetermined of the network node to search the block search request packet Entry;When the corresponding entry of the block search request packet is not found in the interest table undetermined of the network node, to Corresponding entry is added in the interest table of Dingxing, and inquires interface corresponding with the block search request packet in forwarding information table, The block search request packet is forwarded by the interface determined;It is described when being found in the interest table undetermined of the network node When the corresponding entry of block search request packet, addition receives the interface of the block search request packet in the entry found; When receiving the corresponding search data packet of the block search request packet, institute is forwarded according to the entry in the interest table undetermined State search data packet.
In this implementation, network node can search the interior of oneself and store when receiving block search request packet Storage cavern, and corresponding data packet is supplied to user equipment, the multiplexing of data is realized using the content store of network node, Reduce volume of transmitted data and transmission delay.
In another implementation of the embodiment of the present invention, the method also includes: when in the forwarding information table When not inquiring interface corresponding with the block search request packet, the block search request packet is stored;When the network section The forwarding information table of point is updated, and includes that the block search request packet is corresponding in the updated forwarding information table When entry, interface corresponding with the block search request packet is inquired in forwarding information table;It is forwarded by the interface determined The block search request packet.
In this implementation, user equipment does not generate the block also in usual system when carrying out the search of new block, So having to wait for thering is user to produce the block in system and broadcasting block information, is then updated and turned according to the block information After photos and sending messages table, it can realize the forwarding of block search request packet and search for the return of data packet.
The third aspect, it is described the embodiment of the invention provides a kind of block chain synchronizing device based on name data network Device includes for realizing the unit of method described in first aspect, such as transmission unit and receiving unit.
Fourth aspect, it is described the embodiment of the invention provides a kind of block chain synchronizing device based on name data network Device includes for realizing the unit of method described in second aspect, such as receiving unit, searching unit, processing unit and transmission Unit.
5th aspect, the embodiment of the invention also provides a kind of block chain synchronizing device based on name data network, institutes Stating device includes: memory, the processor connecting with memory, transceiver, the memory for store software program and Module can be held when the processor is used to run or execute the software program and module of storage in the memory Method described in any implementation of row first aspect.
6th aspect, the embodiment of the invention also provides a kind of block chain synchronizing device based on name data network, institutes Stating device includes: memory, the processor connecting with memory, transceiver, the memory for store software program and Module can be held when the processor is used to run or execute the software program and module of storage in the memory Method described in any implementation of row second aspect.
7th aspect, the embodiment of the invention also provides a kind of computer readable storage medium, is deposited in the storage medium At least one instruction is contained, described instruction is as processor loads and executes to realize as described in any implementation of first aspect Block chain synchronous method based on name data network.
Eighth aspect is deposited in the storage medium the embodiment of the invention also provides a kind of computer readable storage medium At least one instruction is contained, described instruction is as processor loads and executes to realize as described in any implementation of second aspect Block chain synchronous method based on name data network.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is the network architecture schematic diagram of NDN provided in an embodiment of the present invention a kind of;
Fig. 2A is a kind of hardware structure diagram of block chain synchronizing device based on NDN provided in an embodiment of the present invention;
Fig. 2 B is a kind of hardware structure diagram of block chain synchronizing device based on NDN provided in an embodiment of the present invention;
Fig. 3 is a kind of flow chart of the block chain synchronous method based on NDN provided in an embodiment of the present invention;
Fig. 3 A is a kind of application scenario diagram of the block chain synchronous method based on NDN provided in an embodiment of the present invention;
Fig. 3 B is a kind of application scenario diagram of the block chain synchronous method based on NDN provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of the block chain synchronizing device based on NDN provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of the block chain synchronizing device based on NDN provided in an embodiment of the present invention.
Specific embodiment
Refer to the program or instruction stored in memory that can be realized certain functions in " module " being mentioned above;In " unit " mentioned in this article refers to the functional structure logically divided, should " unit " can by pure hardware realization, alternatively, Software and hardware is implemented in combination with.
In order to solve existing the problems of the block chain scheme based on TCP/IP framework, the embodiment of the invention provides A kind of block chain implementation based on NDN, specifically includes the block chain synchronous method based on NDN and the block chain based on NDN Synchronizing device.In order to make it easy to understand, existing below simply introduce first NDN.
Fig. 1 shows the network architecture of NDN provided in an embodiment of the present invention a kind of.As shown in Figure 1, the NDN 100 includes Multiple network nodes 101 (including network node A-E), user equipment 102 are connect with network node 101, and the user equipment 102 was both It is the consumer in the producer and NDN in NDN.Wherein, consumer is the request of data side for sending interest packet, the producer It is the data providing with data packet.
The user equipment 102 is terminal device, specifically can be computer, server, mobile terminal etc..
Network node 101 in NDN preserves three data structures: forwarding information table (Forwarding Information Base, FIB), interest table undetermined (Pending Interest Table, PIT) and content store (Content Store, CS).
Specifically, CS is used to store the data packet by the network node, and memory module is name+number of data packet According to as shown in the table:
Name Data
ndn/<App Name>/sync/<Blockchain State> ……
PIT is mainly used for the name for the interest packet that storage receives and receives the interface of the interest packet, memory module It is name+interface list of interest packet, as shown in the table:
Name Interface list
ndn/<App Name>/sync/<Blockchain State> 0,1
FIB is mainly used for routing forwarding, and for storing the corresponding forwarding interface of different names, memory module is name (or prefix)+interface list, as shown in the table:
Name Interface list
ndn/<App Name>/sync/<Blockchain State> 2
When the interest packet that consumer issues passes through some network node 101, which searches the interest in CS The data packet of request is wrapped, if returning to the data packet to consumer there are the data packet of interest packet request in CS;If CS In be not present the data packet, then in PIT inquiry whether there is the corresponding entry of interest packet.If there are the interest in PIT Corresponding entry is wrapped, then the interface for receiving the interest packet is added in the entry;If it is corresponding that there is no the interest packets in PIT Entry, then increase the corresponding entry of interest packet newly in PIT, which includes the interface for receiving the interest packet, network node 101 match the name of interest packet in FIB, and interface is selected to forward interest packet.
If in repeating process, there are when the data packet of interest packet request in the CS of another network node 101, then this is another One network node 101 is according to interest packet forward-path returned data packet.If in repeating process, the CS of each network node 101 In there is no the data packet of interest packet request, then the interest packet will be addressed to the producer of data packet, from the producer to disappearing The person's of expense returned data packet.During data packet returns, if network node 101 receives the data packet of interest packet request When, network node 101 sends the data packet according to the corresponding entry selection interface of the interest packet in PIT, to realize data Packet is sent to the consumer for requesting the data packet.Wherein, network node 101 is when carrying out the forwarding of interest packet, using longest-prefix Matching mechanisms determine forwarding interface.
Block synchronization scheme provided in an embodiment of the present invention is based on the above-mentioned NDN network architecture and realizes, is detailed in aftermentioned detailed Thin embodiment.
The synchronous dress of specific hardware configuration block chain based on NDN provided in an embodiment of the present invention to realization is first combined below It sets and is illustrated.
Fig. 2A, which is shown, realizes a kind of hardware knot of the block chain synchronizing device based on NDN provided in an embodiment of the present invention Structure, being somebody's turn to do the block chain synchronizing device based on NDN can be the user equipment in aforementioned network.It as shown in Figure 2 A, should be based on NDN's Block chain synchronizing device 120 includes: processor 11, transceiver 12, memory 13.
Processor 11 includes one or more than one processing core, and processor 11 passes through runs software program and mould Block, thereby executing various function application and information processing.
Transceiver 12, memory 13 and processor 11 are coupled by bus.Memory 13 can be used for storing software program And module.Memory can storage program area 14, the application program module of at least one function 15.Application program module 15 to It less include: sending module 151 and receiving module 152.
Optionally, processor 11 is realized for the modules in executing application module 15 as set in Fig. 3 by user The step of standby required execution.
It, can be by any kind of volatibility or non-volatile in addition, memory 13 is a kind of computer readable storage medium Property storage equipment or their combination realize that such as static to access memory (SRAM) at any time, electrically erasable is read-only to be deposited Reservoir (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or CD.
It will be understood by those skilled in the art that the structure of the block chain synchronizing device 120 shown in Fig. 2A based on NDN The restriction to terminal device is not constituted, may include than illustrating more or fewer components or the certain components of combination, or not Same component layout.
Fig. 2 B, which is shown, realizes a kind of hardware knot of the block chain synchronizing device based on NDN provided in an embodiment of the present invention Structure, being somebody's turn to do the block chain synchronizing device based on NDN can be the network node in aforementioned network.It as shown in Figure 2 B, should be based on NDN's Block chain synchronizing device 220 includes: processor 21, communication interface 22, memory 23.
Processor 21 includes one or more than one processing core, and processor 21 passes through runs software program and mould Block, thereby executing various function application and information processing.
Communication interface 22, memory 23 and processor 21 are coupled by bus.Memory 23 can be used for storing software journey Sequence and module.Memory can storage program area 24, the application program module of at least one function 25.Application program module 25 It includes at least: receiving module 251, searching module 252, processing module 253 and sending module 254.
Optionally, processor 21 is realized in such as Fig. 3 for the modules in executing application module 25 by network section The step of being executed required for point.
It, can be by any kind of volatibility or non-volatile in addition, memory 23 is a kind of computer readable storage medium Property storage equipment or their combination realize that such as static to access memory (SRAM) at any time, electrically erasable is read-only to be deposited Reservoir (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or CD.
It will be understood by those skilled in the art that the structure of the block chain synchronizing device 220 shown in Fig. 2 B based on NDN The restriction to terminal device is not constituted, may include than illustrating more or fewer components or the certain components of combination, or not Same component layout.
Fig. 3 is a kind of interaction figure of the block chain synchronous method based on NDN provided in an embodiment of the present invention, as shown in figure 3, The block chain synchronous method by Fig. 1 user equipment and network node execute, this method comprises:
S301: the first user equipment sends block synchronization request packet to network node.
Wherein, block synchronization request packet uses the format of interest packet, synchronous for carrying out block.The block synchronization request packet Title use have hierarchically structured variable-length identifier as naming rule, the name weighing-appliance of the block synchronization request packet Body may include NDN protocol-identifier, application identities, the status information for requesting Packet type and block chain, the status information of block chain It is used to indicate the height of the highest block of height in the block chain of user equipment storage.
Specifically, the title of block synchronization request packet can following ndn/<App Name>/sync/<Blockchain State>.Wherein, ndn/ is NDN protocol-identifier;<App Name>is application identities, such as is somebody's turn to do<App Name>and is specifically as follows blockndn;Sync is the type of request packet, for indicating that the request packet is block synchronization request packet;<Blockchain State > be block chain status information, carry the first user equipment storage block chain status information, specifically can be The eap-message digest of the highest block of height in the block chain of first user equipment storage, such as the block of the first user equipment storage The cryptographic Hash of the highest block of height in chain, the format of cryptographic Hash are following " 000000000000038cc0f7 ... ".
Wherein, block catenary system shows the scale of block chain with height, and the highly block for 0 is the first of the block chain A block, and so on, it is named to each block, the newest block received is the highest block of height.
Further, before step S301, this method further include:
Generate block synchronization request packet.
Specifically, the process for generating block synchronization request packet is as follows: the first user equipment determines high in the block chain of storage Highest block is spent, and calculates its cryptographic Hash;Block synchronization request packet is generated according to the cryptographic Hash.
It should be noted that the first user equipment, after newly access block catenary system, local block chain needs are updated, The first user equipment sends synchronization request packet to network node at this time.
S302: network node receives the block synchronization request packet, and it is corresponding same that the block synchronization request packet is searched in CS Step data packet.If find the corresponding synchronization packets of block synchronization request packet in CS, S303 is thened follow the steps;If When not finding the corresponding synchronization packets of block synchronization request packet in CS, S304 is thened follow the steps.
Due to the CS meeting storing data packet of network node, so if thering is other users equipment to set in the first user before It is synchronous that block was carried out under standby identical block chain state, then might have stored in network node and the block synchronization request packet pair The synchronization packets answered, corresponding synchronization packets directly can be sent back to the first user equipment by network node at this time.For example, with Requested block is synchronous before step S301 and obtains synchronization packets A by family equipment A, and synchronization packets A is stored in In network node, block chain height when user equipment A requests block synchronous is 40, if the first user equipment is in step Block chain height when requesting synchronous in S301 is also 40, then the network node for being stored with synchronization packets A at this time can should Synchronization packets A returns to the first user equipment.
S303: network node synchronization packets return to the first user equipment.
Specifically, the block synchronization request packet that network node finds and received in CS, then according to the reception area The interface of block synchronization request packet returns to the first user equipment.
S304: network node searches the corresponding entry of block synchronization request packet in the PIT of network node;Work as network node PIT in when not finding the corresponding entry of block synchronization request packet, corresponding entry is added in PIT, and execute step S305;When finding the corresponding entry of block synchronization request packet in the PIT of network node, adds and connect in the entry found Receive the interface of block synchronization request packet.
In this step, if network node does not find the corresponding entry of block synchronization request packet in PIT table, Illustrate that network node needs in PIT table at this time before this without the excessively identical block synchronization request packet of target node Add the corresponding entry of block synchronization request packet.The entry includes the title of block synchronization request packet and to receive the block same Walk the interface of request packet.
If network node finds the corresponding entry of block synchronization request packet in PIT table, illustrate before this There is the excessively identical block synchronization request packet of target node, network node only needs to add in corresponding entry at this time The interface of the block synchronization request packet is received, so that the item of PIT table can be passed through when subsequently received corresponding synchronization packets Mesh is transmitted to the first user equipment.
S305: network node inquires interface corresponding with block synchronization request packet in fib table, passes through the interface determined Forward block synchronization request packet.
Specifically, network node is matched in fib table using the title of block synchronization request packet, determines corresponding turn Send out interface;Then the forwarding of block synchronization request packet is carried out using the forwarding interface determined.Wherein, the format of fib table is as before Described in text, matching can be realized using longest match rule.
Network node inquires interface corresponding with block synchronization request packet in fib table, if inquired synchronous with block The corresponding interface of request packet then forwards block synchronization request packet by the interface determined.If do not found synchronous with block The corresponding interface of request packet then stores the block synchronization request packet, re-starts matching after FIB update, determines Corresponding forwarding interface.
Since in FIB, there may be multiple forwarding interfaces for the entry that the name-matches of block synchronization request packet arrive, therefore, Network node may simultaneously be forwarded the block synchronization request packet using multiple forwarding interfaces, so that the block is same Step request packet can be forwarded to different user equipmenies.
Due in NDN network there are multiple network nodes, during the forwarding of block synchronization request packet, each The network node for receiving the block synchronization request packet executes in the way of step S302-S305.
S306: second user equipment receives the block synchronization request packet, and returns to synchronization packets.
Specifically, second user equipment is after receiving the block synchronization request packet, according in the block synchronization request packet Block chain status information, determine that the first user equipment needs synchronous block;Synchronization is needed according to the first user equipment Block generates synchronization packets, and returns to the first user equipment.
Wherein, according to the status information of the block chain in the block synchronization request packet, it is same to determine that the first user equipment needs The process of the block of step is as follows: second user equipment extracts the state letter of block chain by the naming rule of block synchronization request packet Breath;The height of the highest block of height in the block chain of the first user equipment storage is determined according to the status information of the block chain; Compare the height and the storage of second user equipment of the highest block of height in the block chain for the first user equipment storage determined Block chain in the highest block of height height, determine that the first user equipment needs synchronous block.
For example, the highest area of height in the block chain for the first user equipment storage determined according to block synchronization request packet Block is the 40th block, and the highest block of height is the 80th block in the block chain of second user equipment storage, then the first user It is 41-80 block that equipment, which needs synchronous block,.
Wherein, the highest area of height in the block chain of the first user equipment storage is determined according to the status information of the block chain Block determines corresponding block specifically according to the cryptographic Hash of the highest block of height in the block chain of the first user equipment storage Process, which is not described herein again.
If the height of the highest block of height is less than or equal to the first user in the block chain of second user equipment storage The height of the highest block of height in the block chain of equipment storage then illustrates that second user equipment cannot mention for the first user equipment For block, second user equipment will not return to synchronization packets to the first user equipment at this time.
S307: network node receives the synchronization packets, and the synchronization packets are sent to the first user equipment.
Specifically, according to the entry in PIT table, the corresponding block of the lookup reception synchronization packets synchronizes asks network node Seek the interface of packet;Synchronization packets are forwarded by searching for the interface arrived.
After the completion of forwarding, corresponding entry is deleted from PIT table, avoids repeating to send same step number to the first user equipment According to packet.
Based on this forwarding mechanism, so that distance usually can be obtained most when the first user equipment requests synchronization packets The synchronization packets that close user equipment returns, the reason is as follows that: due between different user equipmenies and the first user equipment Distance may be different, thus the distance of the transmission of block synchronization request packet and synchronization packets is different, causes to return to synchronization Different the time required to data packet, the close user equipment of the first user equipment of distance first returns to synchronization packets, forwards the same step number According to the network node of packet after forwarding, entry corresponding in PIT table can be deleted, subsequent other users equipment returns same Step data packet can't be forwarded to the first user equipment again.
For the network shown in Fig. 3 A, Alice, Bob, Charles and Dave are four user equipmenies in network. Alice and Charles has had updated the newest block of the whole network, and block height has all reached 80, the two user equipmenies all prop up Synchronous service is held, Bob and the current block height of Dave are 40 and 0.The two node actual range length of length representative of black line segment. Bob and Dave sends the synchronization request packet with current highest block cryptographic Hash into NDN network respectively, not due to physical distance Together, Alice has responded the request of Bob, and specifically, Alice extracts the state of the block chain of Bob according to the name of synchronization request packet Information is simultaneously compared with the block chain of oneself, find its lack from height 41 to height 80 all blocks, then Alice by these Block, which is packed into synchronization packets, returns to Bob.Similarly, No. 1 to No. 80 block is also sent to Dave by Charles.By This, it is synchronous that Bob with Dave completes block.
Due in NDN network there are multiple network nodes, during synchronization packets forwarding, each reception Network node to the synchronization packets executes in the way of step S307.
S308: the first user equipment receives the synchronization packets, and extracts the storage of the block in synchronization packets to block Chain database.
Specifically, the first user equipment extracts the block in synchronization packets, then verifies the legal of the block extracted Property, if the legitimacy of these blocks by verifying, is stored in block chain database, directly loses if not conforming to rule It abandons.
First user equipment repeats step S301 and 308, does not receive when in setting time after step S301 When to synchronization packets, illustrates that the first user equipment has been synchronized all blocks, then follow the steps S309.
S309: the first user equipment sends block search request packet to network node.
Wherein, block search request packet uses the format of interest packet, for carrying out block search.The block search request packet Title use have hierarchically structured variable-length identifier as naming rule, the name weighing-appliance of the block search request packet Body may include NDN protocol-identifier, application identities, request Packet type and block-identified, block-identified to be used to indicate user equipment The height of a upper block for the block of search, the height of a upper block for the block of user equipment searches are user equipment storage The height of the highest block of height in block chain.For example, the block to be searched for of block search request packet is the 40th block, then should Block-identified the 39th block of correspondence.
Specifically, the title of block search request packet can following ndn/<App Name>/blocks/<Block ' s Digest>.Its wherein, ndn/ is NDN protocol-identifier;<App Name>is application identities, such as is somebody's turn to do<App Name>and specifically may be used Think blockndn;Blocks is the type of request packet, for indicating that the request packet is block search request packet, < Block ' s Digest > and to be block-identified, the message that specifically can be the highest block of height in the block chain of the first user equipment storage is plucked Want, for example, in the block chain of the first user equipment storage the highest block of height cryptographic Hash, the format of cryptographic Hash is as follows " 000000000000024b89b4 ... ", the cryptographic Hash are the cryptographic Hash for the block that height is 0, and the block with the cryptographic Hash is searched Rope request packet is used to search for the block that height is 1.
Further, before step S309, this method further include:
Generate block search request packet.
Specifically, the process for generating block search request packet is as follows: the first user equipment determines block to be searched, and counts Calculate its cryptographic Hash;Block search request packet is generated according to the cryptographic Hash.
In general, the block of the user equipment searches is newest block, such as the block of subsequent step S310-S314 meaning Search.Certainly, which can be used for the search existing block of user equipment, and doing so can be to existing The correctness of block is judged, before the receive process of the transmission of block search request packet at this time and search data packet are referred to The block synchronizing process of text.
S310: network node receives the block search request packet, searches this in CS block search request packet is corresponding and search Rope data packet.If find the corresponding search data packet of block search request packet in CS, S311 is thened follow the steps;If When not finding the corresponding search data packet of block search request packet in CS, S312 is thened follow the steps.
The detailed process of step S310 is referred to step S302.
S311: network node searches for data packet and returns to the first user equipment.
Since usual first user equipment is when sending searching request packet, in network also and there is no new blocks (than the The higher block of height of either block in the block chain of one user), so generally also corresponding without storing in network node Search for data packet.
S312: network node searches the corresponding entry of block search request packet in the PIT of network node;Work as network node PIT in when not finding the corresponding entry of block search request packet, corresponding entry is added in PIT, and execute step S313;When finding the corresponding entry of block search request packet in the PIT of network node, adds and connect in the entry found Receive the interface of block search request packet.
The detailed process of step S312 is referred to step S304.
S313: network node inquires interface corresponding with block search request packet in fib table, if inquired and block The corresponding interface of searching request packet then forwards block search request packet by the interface determined, then branches to step S317. If not finding interface corresponding with block search request packet, which is stored.
The detailed process of step S313 is referred to step S305.
S314: third user equipment creates new block.
Specifically, each user equipment in block chain is miner, i.e. the block producer, so each user equipment Block search request packet can be sent after having updated, it is also possible to generate new block while sending block search request packet.
It is worth noting that third user equipment here can be same user equipment with second user equipment, it can also Think different user devices.Here third user equipment can be same user equipment with the first user equipment, if third User equipment and the first user equipment are same user equipment, then will not return and search for the first user equipment in the follow-up process Request packet.
Further, can also to include: third user equipment be added local block chain for newly created block to this method.
S315: network node updates fib table, adds the entry of the corresponding new block.
Third user equipment belongs to the network node root of same local area network with third user equipment after creating new block According to local area network interactive information, the fib table item of itself is updated.Specifically, the entry of the corresponding new block is added in fib table.
And according to name state of data link Routing Protocol (Name-data Link State between network node Routing Protocol, NLSR) come synchronize respectively between fib table.That is, the FIB of each network node in NDN Table finally can all update the entry of the new block.
The entry of the corresponding new block includes the name and corresponding forwarding of search data packet corresponding with the block Interface.The name of the corresponding search data packet of the block can be with the name phase of the block search request packet for searching for the block Together.Therefore, which is also entry corresponding with block search request packet.
S316: network node determines interface corresponding with block search request packet according to updated FIB, by determining Interface forward block search request packet.
Since the purpose of block search request packet is to search for newly created block, and updated FIB just has updated The routing entry of new creation block, therefore network node is necessarily capable of determining that connect corresponding with block search request packet at this time Mouthful.
The detailed process of step S316 is referred to step S305.
S317: third user equipment generates the corresponding search data packet of the block search request packet, and returns to search data Packet.
Specifically, third user equipment receives the block search request packet, first judges whether to be capable of providing the block search Request packet requested search data packet when being capable of providing, generates and returns to the corresponding search data of the block search request packet Packet.
For example, third user equipment is after receiving the block search request packet, according in the block search request packet It is block-identified, determine the block of the first user equipment searches;Then, third user equipment is according to the height of the block chain itself stored Can degree judgement provide the block of the first user equipment searches;If the block of the first user equipment searches, basis can be provided The block of first user equipment searches generates search data packet, and returns to the first user equipment;Otherwise, it is not set to the first user It is standby to return to search data packet.Specifically, if the height of the highest block of height is small in the block chain of third user equipment storage In or equal to block-identified corresponding block height, then illustrate that third user equipment cannot provide area for the first user equipment Block.
For example, the block for the first user equipment searches that third user equipment is determined according to block search request packet is the 81 blocks, and third user equipment has the 81st block, then third user equipment returns to corresponding search to the first user equipment Data packet.
It is worth noting that since third user equipment here is the user equipment for creating new block, then at this time Three user equipmenies are necessarily capable of providing the new block of the first user equipment searches.
Since each user equipment in block catenary system can all send block search request packet, so, the block search During data packet returns, each user equipment of the meeting into block catenary system is returned, and is equivalent to and is broadcasted the area in network Block.
S318: network node receives the search data packet, and the search data packet is sent to the first user equipment.
Specifically, the details of step S318 may refer to step S307.
S319: the first user equipment receives the search data packet, and extracts the block storage in search data packet to block Chain database.
Specifically, the first user equipment extracts the block in search data packet, then verifies the legal of the block extracted Property, if the legitimacy of these blocks by verifying, is stored in block chain database, directly loses if not conforming to rule It abandons.
In order to save the last state of block chain, the first user equipment needs to repeat to send block search request packet.Specifically The block storage in search data packet is extracted when the first user equipment receives the search data packet of network node return in ground To block chain database, new block search request packet, the block-identified and block of new block search request packet are then sent The block-identified difference of searching request packet;When not receiving the search data packet of network node return in the given time, weight It is new to send block search request packet.Here predetermined time can be identical as setting time above, can also be different.
What needs to be explained here is that although network node can be recorded in PIT after receiving block search request packet In table, corresponding user equipment is returned to after getting corresponding search data packet.But since network node can Energy can periodically or the period removes PIT list item, if so the first user equipment does not receive network node in the given time and returns When the search data packet returned, it can be avoided by way of retransmitting block search request packet because network node removes PIT List item causes the case where being not received by search data packet.
As shown in Figure 3B, Ailce, Bob and Ted are three user equipmenies in network, and it is current that three stores the whole network 80 all blocks, and all block search request packet is sent to request the 81st block, block search request packet message simultaneously It is recorded in the PIT table of network node (such as router), by taking network node C as an example, the block of the 81st block is searched in PIT list item The corresponding interface of rope request packet is 0,1,2.At this point, the Ted as miner produces the new block that height is 81, Ted is first to net Network node in network broadcasts the block information of the block, and network node updates FIB according to the block information, then according to new Block search request is forwarded a packet to Ted by FIB, and Ted returns to search data to network according to the block search request packet received Packet, to realize the broadcast of the block.Network node C can forward data along 1,2 interface according to the record of PIT list item, Finally it is sent to Alice and Bob.
Block chain synchronous method provided in an embodiment of the present invention based on NDN, has the advantage that first, sets in user It is simpler compared with the block chain under existing TCP/IP framework is realized when standby progress block broadcast, the reason is as follows that: in TCP/ In order to ensure network node will not repeatedly receive the block obtained under IP framework, area is not directly transmitted between network node Block, but inv message is first sent by supplier (block provider) to neighbours, inform other side oneself have which block information for Downloading after neighbor node receives inv message, sends getdata message according to inv message (cryptographic Hash of block) and informs supplier Which block oneself is needed, then blocks message is returned to by supplier and allows neighbor user equipment that can download to block data;And this Inventive embodiments simplify above-mentioned steps, disappear not needing inv by " consumer's driving " feature of the NDN network architecture itself Broadcast is completed in the case where breath.Equally, complicated as under the no TCP/IP network architecture of broadcast under NDN.Second, make block Catenary system really realizes decentralization, no any super node of appearance in system.This provides effectively the fairness of system Guarantee.Third, block catenary system are based on NDN network, either browse the functions such as the synchronization of online user's equipment, or search Implementation method, process all do not need to pay close attention to the location informations such as IP address, port again.This characteristic largely reduces The pressure of Network application and development work.
Fig. 4 shows the block diagram of the block chain synchronizing device provided by one embodiment of the present invention based on NDN.This is based on The block chain synchronizing device of NDN can be by special hardware circuit, alternatively, software and hardware is implemented in combination with as the complete of user equipment Portion or a part.The block chain synchronizing device based on NDN includes transmission unit 401 and receiving unit 402.Wherein, it sends single For sending block synchronization request packet to network node, the title of block synchronization request packet includes NDN protocol-identifier, answers member 401 With mark, the status information of request Packet type and block chain, the status information of block chain is used to indicate the area of user equipment storage The height of the highest block of height in block chain;Receiving unit 402 is used to receive the synchronization packets of network node return, and extracts Block in synchronization packets is stored to block chain database.
Correlative detail is in combination with the embodiment of the method with reference to Fig. 3.
It should be noted that above-mentioned transmission unit 401, receiving unit 402 can be realized by transceiver or processor is matched Transceiver is closed to realize.
Fig. 5 shows the block diagram of the block chain synchronizing device provided by one embodiment of the present invention based on NDN.This is based on The block chain synchronizing device of NDN can be by special hardware circuit, alternatively, software and hardware is implemented in combination with as the complete of network node Portion or a part.Device includes receiving unit 501, searching unit 502, processing unit 503 and transmission unit 504.Wherein, it receives Unit 501 receives the block synchronization request packet that user equipment is sent for network node, and the title of block synchronization request packet includes NDN protocol-identifier, application identities, the status information for requesting Packet type and block chain, the status information of block chain are used to indicate use The height of the highest block of height in the block chain of family equipment storage;Searching unit 502 in the PIT of network node for searching The corresponding entry of block synchronization request packet;Processing unit 503, which is used to work as in the PIT of network node, does not find block synchronization request When wrapping corresponding entry, corresponding entry is added in PIT, and connect corresponding with block synchronization request packet is inquired in fib table Mouthful;When finding the corresponding entry of block synchronization request packet in the PIT of network node, adds and receive in the entry found The interface of block synchronization request packet;Transmission unit 504 is used to forward block synchronization request packet by the interface determined;It sends single Member 504 is also used to when receiving the corresponding search data packet of block synchronization request packet, searches for number according to the entry forwarding in PIT According to packet.
Correlative detail is in combination with the embodiment of the method with reference to Fig. 3.
It should be noted that above-mentioned searching unit 502 and processing unit 503 can be realized by processor alternatively, processor The program instruction in memory is executed to realize, above-mentioned receiving unit 501, transmission unit 504 can be realized by communication interface, or Person's processor cooperates communication interface to realize.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (16)

1. a kind of block chain synchronous method based on name data network, which is characterized in that the described method includes:
User equipment sends block synchronization request packet to network node, and the title of the block synchronization request packet includes name data Network protocol mark, application identities, the status information for requesting Packet type and block chain, the status information of the block chain is for referring to Show the height of the highest block of height in the block chain of the user equipment storage;
The synchronization packets that the network node returns are received, and extract the storage of the block in the synchronization packets to block chain Database.
2. being asked the method according to claim 1, wherein the user equipment is synchronized to network node transmission block Seek packet, comprising:
It determines the highest block of height in the block chain of storage, and calculates its cryptographic Hash;Height in the block chain is highest Status information of the cryptographic Hash of block as the block chain, generates the block synchronization request packet;The block is synchronized and is asked Packet is asked to be sent to the network node.
3. method according to claim 1 or 2, which is characterized in that the method also includes:
When the synchronization packets are not received in the setting time after user equipment sends the synchronization request packet When, Xiang Suoshu network node sends block search request packet, and the title of the block search request packet includes name data network Protocol-identifier, application identities, request Packet type and block-identified, it is described block-identified to be used to indicate the user equipment searches The height of a upper block for block, the height of a upper block for the block of the user equipment searches are user equipment storage Block chain in the highest block of height height;
When receiving the search data packet that the network node returns, the block extracted in described search data packet is stored to area Block chain database, then sends new block search request packet, the new block search request packet it is block-identified with it is described The block-identified difference of block search request packet;When the search data for not receiving the network node return in the given time Bao Shi retransmits the block search request packet.
4. method according to claim 1 or 2, which is characterized in that the method also includes:
Receive the block synchronization request packet that another user equipment that the network node is sent is sent;
The status information of the block chain in block synchronization request packet sent according to another user equipment, determines described another The height of the highest block of height in the block chain of user equipment storage;
Compare the height of the highest block of height and the user in the block chain for another user equipment storage determined The height of the highest block of height in the block chain of equipment storage determines that another user equipment needs synchronous block;
It needs synchronous block to generate synchronization packets according to another user equipment, and returns to another user and set It is standby.
5. method according to claim 1 or 2, which is characterized in that the method also includes:
When the user equipment successfully creates block, the network node into network broadcasts the information of the block;
The block search request packet that network node is sent is received, the block search request packet is for requesting the user equipment new The block of creation;
Searching request packet is sent to the network node, described search data packet includes the newly created block of the user equipment.
6. a kind of block chain synchronous method based on name data network, which is characterized in that the described method includes:
Network node receives the block synchronization request packet that user equipment is sent, and the title of the block synchronization request packet includes name The status information of data network protocol mark, application identities, the status information for requesting Packet type and block chain, the block chain is used The height of the highest block of height in the block chain for indicating the user equipment storage;
The corresponding synchronization packets of the block synchronization request packet are searched in content store, the synchronization packets include institute State the block that user equipment does not update;
When finding the corresponding synchronization packets of the block synchronization request packet in the content store, by the synchronization Data packet returns to the user equipment;It is corresponding same when not finding the block synchronization request packet in the content store When step data packet, the corresponding entry of the block synchronization request packet is searched in the interest table undetermined of the network node;
When not finding the corresponding entry of the block synchronization request packet in the interest table undetermined of the network node, undetermined Corresponding entry is added in interest table, and inquires interface corresponding with the block synchronization request packet in forwarding information table, is led to It crosses the interface determined and forwards the block synchronization request packet;When finding the area in the interest table undetermined of the network node When the corresponding entry of block synchronization request packet, addition receives the interface of the block synchronization request packet in the entry found;
When receiving the corresponding synchronization packets of the block synchronization request packet, turned according to the entry in the interest table undetermined Send out synchronization packets described.
7. according to the method described in claim 6, it is characterized in that, the method also includes:
The block search request packet that the user equipment is sent is received, the title of the block search request packet includes name data Network protocol mark, application identities, request Packet type and block-identified, it is described block-identified to be used to indicate the user equipment and search The height of a upper block for the block of rope;
The corresponding search data packet of the block search request packet is searched in content store, described search data packet includes institute State the block of user equipment searches;
When finding the corresponding search data packet of the block search request packet in the content store, by described search Data packet returns to the user equipment;When not finding in the content store, the block search request packet is corresponding to be searched When rope data packet, the corresponding entry of the block search request packet is searched in the interest table undetermined of the network node;
When not finding the corresponding entry of the block search request packet in the interest table undetermined of the network node, undetermined Corresponding entry is added in interest table, and inquires interface corresponding with the block search request packet in forwarding information table, is led to It crosses the interface determined and forwards the block search request packet;When finding the area in the interest table undetermined of the network node When the corresponding entry of block search request packet, addition receives the interface of the block search request packet in the entry found;
When receiving the corresponding search data packet of the block search request packet, turned according to the entry in the interest table undetermined Send out described search data packet.
8. the method according to the description of claim 7 is characterized in that the method also includes:
When not inquiring interface corresponding with the block search request packet in the forwarding information table, the block is stored Searching request packet;
It when the forwarding information table of the network node is updated, and include the block in the updated forwarding information table When the corresponding entry of searching request packet, interface corresponding with the block search request packet is inquired in forwarding information table;
The block search request packet is forwarded by the interface determined.
9. a kind of block chain synchronizing device based on name data network, which is characterized in that described device includes:
Transmission unit, for sending block synchronization request packet to network node, the title of the block synchronization request packet includes life Name data network protocol mark, application identities, the status information for requesting Packet type and block chain, the status information of the block chain It is used to indicate the height of the highest block of height in the block chain of user equipment storage;
Receiving unit, the synchronization packets returned for receiving the network node, and extract the area in the synchronization packets Block is stored to block chain database.
10. device according to claim 9, which is characterized in that described device further include:
Processing unit for determining the highest block of height in the block chain stored, and calculates its cryptographic Hash;By the block chain Status information of the cryptographic Hash of the middle highest block of height as the block chain, generates the block synchronization request packet.
11. device according to claim 9 or 10, which is characterized in that the transmission unit is also used to when in the user Equipment is sent when not receiving the synchronization packets in the setting time after the synchronization request packet, Xiang Suoshu network node Send block search request packet, the title of the block search request packet include name data network protocol mark, application identities, Request Packet type and block-identified, the height of a upper block for the block-identified block for being used to indicate the user equipment searches Degree, the height of a upper block for the block of the user equipment searches are height highest in the block chain of user equipment storage Block height;
The receiving unit is also used to extract described search number when receiving the search data packet that the network node returns According to the block storage in packet to block chain database;
The transmission unit is also used to after receiving the search data packet that the network node returns, sends new block and search Rope request packet, the block-identified difference of the block-identified and block search request packet of the new block search request packet; When not receiving the search data packet that the network node returns in the given time, the block search request is retransmitted Packet.
12. device according to claim 10, which is characterized in that the receiving unit is also used to receive the network section The block synchronization request packet that another user equipment that point is sent is sent;
The processing unit, the shape for the block chain in block synchronization request packet for being also used to be sent according to another user equipment State information determines the height of the highest block of height in the block chain of another user equipment storage;Compare the institute determined It states in the block chain of another user equipment storage in the height of the highest block of height and the block chain of user equipment storage The height of highly highest block determines that another user equipment needs synchronous block;According to another user equipment Synchronous block is needed to generate synchronization packets;
The transmission unit is also used to returning to the synchronization packets into another user equipment.
13. device according to claim 9 or 10, which is characterized in that the transmission unit is also used to set as the user For when successfully creating block, the network node into network broadcasts the information of the block;
The receiving unit, is also used to receive the block search request packet of network node transmission, and the block search request packet is used In the request newly created block of user equipment;
The transmission unit is also used to send searching request packet to the network node, and described search data packet includes the use The newly created block of family equipment.
14. a kind of block chain synchronizing device based on name data network, which is characterized in that described device includes:
Receiving unit receives the block synchronization request packet that user equipment is sent, the block synchronization request packet for network node Title include name data network protocol mark, application identities, request Packet type and block chain status information, the block The status information of chain is used to indicate the height of the highest block of height in the block chain of the user equipment storage;
Searching unit, it is described same for searching the corresponding synchronization packets of the block synchronization request packet in content store Step data packet includes the block that the user equipment does not update;
Transmission unit finds the corresponding synchronization packets of the block synchronization request packet for working as in the content store When, the synchronization packets are returned into the user equipment;
The searching unit is also used to corresponding same when not finding the block synchronization request packet in the content store When step data packet, the corresponding entry of the block synchronization request packet is searched in the interest table undetermined of the network node;
Processing unit, for corresponding when not finding the block synchronization request packet in the interest table undetermined of the network node When entry, corresponding entry is added in interest table undetermined, and inquiry and the block synchronization request packet in forwarding information table Corresponding interface;When finding the corresponding entry of the block synchronization request packet in the interest table undetermined of the network node, Addition receives the interface of the block synchronization request packet in the entry found;
The transmission unit is also used to forward the block synchronization request packet by the interface determined;
The transmission unit is also used to when receiving the corresponding synchronization packets of the block synchronization request packet, according to described Entry in interest table undetermined forwards the synchronization packets.
15. device according to claim 14, which is characterized in that the receiving unit is also used to receive the user and sets The block search request packet that preparation is sent, the title of the block search request packet include name data network protocol mark, application Mark, request Packet type and block-identified, block-identified mono- area block Shang for being used to indicate the user equipment searches The height of block;
The searching unit is also used to search the corresponding search data packet of the block search request packet in content store, Described search data packet includes the block of the user equipment searches;
The searching unit is also used to that the corresponding search of the block search request packet ought be found in the content store When data packet, described search data packet is returned into the user equipment;
The processing unit, is also used to when not finding in the content store that the block search request packet is corresponding to search When rope data packet, the corresponding entry of the block search request packet is searched in the interest table undetermined of the network node;Work as institute It states when not finding the corresponding entry of the block search request packet in the interest table undetermined of network node, in interest table undetermined Corresponding entry is added, and inquires interface corresponding with the block search request packet in forwarding information table;When the network When finding the corresponding entry of the block search request packet in the interest table undetermined of node, adds and connect in the entry found Receive the interface of the block search request packet;
The transmission unit is also used to forward the block search request packet by the interface determined;
The transmission unit is also used to when receiving the corresponding search data packet of the block search request packet, according to described Entry in interest table undetermined forwards described search data packet.
16. device according to claim 15, which is characterized in that the processing unit is also used to believe when in the forwarding When not inquiring interface corresponding with the block search request packet in breath table, the block search request packet is stored;
The processing unit is also used to be updated when the forwarding information table of the network node, and the updated forwarding In information table when entry corresponding including the block search request packet, inquires in forwarding information table and asked with the block search Seek the corresponding interface of packet;
The transmission unit is also used to forward the block search request packet by the interface determined.
CN201710400368.0A 2017-05-31 2017-05-31 Block chain synchronous method and device based on NDN Active CN107317842B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710400368.0A CN107317842B (en) 2017-05-31 2017-05-31 Block chain synchronous method and device based on NDN

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710400368.0A CN107317842B (en) 2017-05-31 2017-05-31 Block chain synchronous method and device based on NDN

Publications (2)

Publication Number Publication Date
CN107317842A CN107317842A (en) 2017-11-03
CN107317842B true CN107317842B (en) 2019-11-22

Family

ID=60182198

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710400368.0A Active CN107317842B (en) 2017-05-31 2017-05-31 Block chain synchronous method and device based on NDN

Country Status (1)

Country Link
CN (1) CN107317842B (en)

Families Citing this family (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108494812B (en) * 2018-01-22 2020-03-13 北京工业大学 NDN network communication method supporting block chain service
CN108600353B (en) * 2018-04-12 2021-01-12 北京天德科技有限公司 Parallel block synchronization method of block chain nodes
CN108696589B (en) * 2018-05-14 2022-04-08 百度在线网络技术(北京)有限公司 Block chain data transmission method, device, equipment and storage medium
CN110378694B (en) * 2018-05-21 2021-01-12 腾讯科技(深圳)有限公司 Block chain data processing method and device, computer equipment and storage medium
CN109165229B (en) * 2018-08-23 2020-06-05 京东数字科技控股有限公司 Method, device, equipment and storage medium for checking local block synchronization
CN109410049A (en) * 2018-09-18 2019-03-01 深圳周百通科技有限公司 Block chain bookkeeping methods, device, computer equipment and storage medium
CN109274754B (en) * 2018-10-11 2021-05-04 上海保险交易所股份有限公司 Method, apparatus, and storage medium for synchronizing data in a blockchain network
CN109474675A (en) * 2018-10-18 2019-03-15 尚维斯 A kind of block height split blade type date storage method based on block chain
CN109714412B (en) * 2018-12-25 2021-08-10 深圳前海微众银行股份有限公司 Block synchronization method, device, equipment and computer readable storage medium
CN110072196B (en) * 2019-03-29 2020-09-29 中国科学院计算技术研究所 Communication method and system for providing block chain oriented application for named data network
CN110096505B (en) * 2019-03-31 2021-05-11 杭州复杂美科技有限公司 Data storage method, system, equipment and storage medium
CN109977274B (en) * 2019-03-31 2021-05-11 杭州复杂美科技有限公司 Data query and verification method, system, equipment and storage medium
CN110113408B (en) * 2019-04-30 2020-08-14 杭州复杂美科技有限公司 Block synchronization method, equipment and storage medium
CN110401637B (en) * 2019-06-28 2021-03-02 中南民族大学 Name-based trust method in named data network
CN110688426B (en) * 2019-08-21 2021-12-10 北京邮电大学 Second-level heartbeat synchronization method for block chain big database
CN111212139A (en) * 2020-01-02 2020-05-29 支付宝(杭州)信息技术有限公司 Method and device for updating trust node information
CN111565175B (en) * 2020-04-22 2022-04-05 辽宁大学 IOTA-based planar named data network security defense method
CN111984733A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Data transmission method and device based on block chain and storage medium
CN112383610B (en) * 2020-11-11 2022-12-09 上海保险交易所股份有限公司 Synchronous processing method and system for block chain state data
CN112579301B (en) * 2020-12-28 2022-07-01 北京理工大学 NDN-based data transmission method for P2P distributed machine learning training system
CN113037852B (en) * 2021-03-22 2022-08-09 中国人民银行数字货币研究所 Block chain link point synchronization method and device
CN113328952B (en) * 2021-05-31 2022-06-07 北京工业大学 Block chain data transmission method based on NDN
CN113364847B (en) * 2021-05-31 2022-07-19 新疆大学 Data synchronization method and device of block chain nodes and storage medium
CN113765707B (en) * 2021-08-18 2022-10-28 北京工业大学 NDN-based block chain network service quality guarantee method
CN114048517B (en) * 2022-01-14 2022-05-20 北京大学深圳研究生院 Dual channel consensus system and method for blockchains, computer readable storage medium
CN115297009B (en) * 2022-07-08 2023-11-17 中电信数智科技有限公司 Digital encryption consistency optimization method based on blockchain distributed network
CN115460255B (en) * 2022-09-23 2024-03-29 电子科技大学 Named data networking system based on block chain
CN115495531B (en) * 2022-11-17 2023-03-24 山东区块链研究院 Block chain data synchronization method and system based on check point

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103118013A (en) * 2013-01-16 2013-05-22 西安电子科技大学 Method of sending data package and incidentally sending reverse interest package in content center network
CN103457999A (en) * 2013-08-06 2013-12-18 北京大学深圳研究生院 P2P document transmission method based on NDN network architecture
CN106157142A (en) * 2016-06-30 2016-11-23 惠众商务顾问(北京)有限公司 A kind of block chain common recognition and synchronous method, system and device
CN106649632A (en) * 2016-12-07 2017-05-10 北京众享比特科技有限公司 Data synchronism method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103118013A (en) * 2013-01-16 2013-05-22 西安电子科技大学 Method of sending data package and incidentally sending reverse interest package in content center network
CN103457999A (en) * 2013-08-06 2013-12-18 北京大学深圳研究生院 P2P document transmission method based on NDN network architecture
CN106157142A (en) * 2016-06-30 2016-11-23 惠众商务顾问(北京)有限公司 A kind of block chain common recognition and synchronous method, system and device
CN106649632A (en) * 2016-12-07 2017-05-10 北京众享比特科技有限公司 Data synchronism method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"命名数据网络下的移动性支持和数据同步应用";周子健;《中国优秀硕士学位论文全文数据库信息科技辑》;20150915;全文 *
Nikos Fotiou;George C. Polyzos."Decentralized name-based security for content distribution using blockchains".《2016 IEEE Conference on Computer Communications Workshops (INFOCOM WKSHPS)》.2016, *

Also Published As

Publication number Publication date
CN107317842A (en) 2017-11-03

Similar Documents

Publication Publication Date Title
CN107317842B (en) Block chain synchronous method and device based on NDN
CN100574252C (en) Be used for the deployment that topology is upgraded between the mobile router
Meddeb et al. AFIRM: Adaptive forwarding based link recovery for mobility support in NDN/IoT networks
CN108494812B (en) NDN network communication method supporting block chain service
CN107295600B (en) A kind of data transmission method in In-vehicle networking
CN105721311A (en) System and method for efficient name-based content routing using link-state information in information-centric networks
CN103339901A (en) Terminal and intermediate node in content oriented networking environment and communication method of terminal and intermediate node
Bian et al. Boosting named data networking for efficient packet forwarding in urban VANET scenarios
CN109327542A (en) Game service access response method, request retransmission method, connection method, device
CN103236971A (en) Route forwarding method for content internet
CN102404818B (en) Method for generating and updating routing list of satellite network
CN110166296A (en) A method of information centre&#39;s network architecture towards manned deep space exploration
KR20090098692A (en) Method for managing requests for obtaining peer identifiers to access stored contents in p2p mode, and associated management device and network equipment
Palazzi et al. An overview of opportunistic ad hoc communication in urban scenarios
CN105207885A (en) Method and device for displaying user information in session interface
CN110072196B (en) Communication method and system for providing block chain oriented application for named data network
Bayhan et al. On content indexing for off-path caching in information-centric networks
CN103888517A (en) Caching method for publishing and subscription system to achieve historical event subscription
CN103209196A (en) Portal access method and device
CN101584192B (en) Node registering method
Shin et al. Motion-MiX DHT for wireless mobile networks
Anastasiades et al. Content discovery in wireless information-centric networks
CN101237412B (en) Packet delivery and route selection method
CN100563188C (en) Communicating terminal inserts the method for routing of request in the communication network
Gu et al. A publish-subscribe networking architecture for future manned deep space exploration

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant