CN108712506B - Block chain node communication method and device and block chain node - Google Patents

Block chain node communication method and device and block chain node Download PDF

Info

Publication number
CN108712506B
CN108712506B CN201810553155.6A CN201810553155A CN108712506B CN 108712506 B CN108712506 B CN 108712506B CN 201810553155 A CN201810553155 A CN 201810553155A CN 108712506 B CN108712506 B CN 108712506B
Authority
CN
China
Prior art keywords
target node
node
address
query
target
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
CN201810553155.6A
Other languages
Chinese (zh)
Other versions
CN108712506A (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.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN201810553155.6A priority Critical patent/CN108712506B/en
Publication of CN108712506A publication Critical patent/CN108712506A/en
Application granted granted Critical
Publication of CN108712506B publication Critical patent/CN108712506B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2517Translation of Internet protocol [IP] addresses using port numbers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2514Translation of Internet protocol [IP] addresses between local and global IP addresses

Abstract

The embodiment of the invention provides a block link point communication method and device and a block link node. The method comprises the following steps: the master storage node receives request information sent by a target node, wherein the request information indicates that the target node requests to become a slave storage node, and the request information comprises identification information of the target node; the main storage node compares whether the source IP address of the request information is the same as the IP address broadcast by the target node when the target node joins the block chain network; if the source IP address of the request information is different from the IP address broadcast by the target node when the target node joins the block chain network, the main storage node determines that the target node has no public network IP address; and the main storage node determines the public network IP address of the local area network where the target node is located and the port number mapped in the local area network by the target node according to the heartbeat message sent by the target node. The embodiment of the invention ensures that the node without the public network IP address can also become a slave storage node, thereby promoting the development of block chain service.

Description

Block chain node communication method and device and block chain node
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a block link point communication method and device and a block link node.
Background
In a blockchain network, a master storage node may store a complete blockchain ledger, a slave storage node may store a partial blockchain ledger, and the slave storage node may receive inquiry access of other nodes by providing inquiry services to the other nodes to obtain corresponding rewards.
In the prior art, in order to promote the block chain service, more nodes are required to become slave storage nodes, but the nodes are required to have public network IP addresses to become the slave storage nodes, but at present, many nodes do not have public network IP addresses, so that many nodes cannot become slave storage nodes, and the development of the block chain service is limited.
Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for block link point communication, and a block link node, so that a node without a public network IP address may also become a slave storage node, thereby promoting the development of a block link service.
In a first aspect, an embodiment of the present invention provides a block-node point communication method, including:
a master storage node receives request information sent by a target node, wherein the request information indicates that the target node requests to become a slave storage node, and the request information comprises identification information of the target node;
the main storage node compares whether the source IP address of the request information is the same as the IP address broadcast by the target node when the target node joins the block chain network;
if the source IP address of the request information is different from the IP address broadcast by the target node when the target node joins the block chain network, the main storage node determines that the target node has no public network IP address;
and the main storage node determines the public network IP address of the local area network where the target node is located and the port number mapped in the local area network by the target node according to the heartbeat message sent by the target node.
In a second aspect, an embodiment of the present invention provides a block link point communication device, including:
a receiving module, configured to receive request information sent by a target node, where the request information indicates that the target node requests to become a slave storage node, and the request information includes identification information of the target node;
the comparison module is used for comparing whether the source IP address of the request information is the same as the IP address broadcasted by the target node when the target node joins the block chain network;
a first determining module, configured to determine that the target node has no public network IP address if a source IP address of the request information is different from an IP address broadcast by the target node when joining a blockchain network;
and the second determining module is used for determining the public network IP address of the local area network where the target node is located and the port number mapped in the local area network by the target node according to the heartbeat message sent by the target node.
In a third aspect, an embodiment of the present invention provides a block link point, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, the computer program being executed by a processor to implement the method of the first aspect.
According to the block chain link point communication method, device and block chain node provided by the embodiment of the invention, request information sent by a target node is received through a main storage node, whether a source IP address of the request information is the same as an IP address broadcasted by the target node when the target node joins a block chain network is compared, so that whether the target node has a public network IP address is determined, and if the target node does not have the public network IP address, a heartbeat message sent by the target node is received, so that the public network IP address of a local area network where the target node is located and a port number mapped by the target node in the local area network are determined, so that the target node can become a slave storage node, the node without the public network IP address can also become the slave storage node, and the development of block chain service is promoted.
Drawings
Fig. 1 is a schematic diagram of an application scenario provided in an embodiment of the present invention;
fig. 2 is a flowchart of a block link point communication method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a block chain network according to an embodiment of the present invention;
fig. 4 is a flowchart of a block-node communication method according to another embodiment of the present invention;
fig. 5 is a flowchart of a block-node communication method according to another embodiment of the present invention;
fig. 6 is a schematic structural diagram of a block link point communication device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a blockchain node according to an embodiment of the present invention.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The block link point communication method provided by the invention can be applied to the communication system shown in fig. 1. As shown in fig. 1, the communication system includes: access network device 11, terminal device 12, and server 13. It should be noted that the communication System shown in fig. 1 may be applicable to different network formats, for example, may be applicable to Global System for Mobile communication (GSM), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division-Synchronous Code Division Multiple Access (TD-SCDMA), Long Term Evolution (Long Term Evolution, LTE), and future 5G network formats. Optionally, the communication system may be a system in a scenario of high-reliability and Low-Latency Communications (URLLC) transmission in a 5G communication system.
Therefore, optionally, the access Network device 11 may be a Base Station (BTS) and/or a Base Station Controller in GSM or CDMA, a Base Station (NodeB, NB) and/or a Radio Network Controller (RNC) in WCDMA, an evolved Node B (eNB or eNodeB) in LTE, or a relay Station or an access point, or a Base Station (gbb) in a future 5G Network, and the present invention is not limited thereto.
The terminal device 12 may be a wireless terminal or a wired terminal. A wireless terminal may refer to a device that provides voice and/or other traffic data connectivity to a user, a handheld device having wireless connection capability, or other processing device connected to a wireless modem. A wireless terminal, which may be a mobile terminal such as a mobile telephone (or "cellular" telephone) and a computer having a mobile terminal, for example, a portable, pocket, hand-held, computer-included, or vehicle-mounted mobile device, may communicate with one or more core Network devices via a Radio Access Network (RAN), and may exchange language and/or data with the RAN. For another example, the Wireless terminal may also be a Personal Communication Service (PCS) phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), and other devices. A wireless Terminal may also be referred to as a system, a Subscriber Unit (Subscriber Unit), a Subscriber Station (Subscriber Station), a Mobile Station (Mobile), a Remote Station (Remote Station), a Remote Terminal (Remote Terminal), an Access Terminal (Access Terminal), a User Terminal (User Terminal), a User Agent (User Agent), and a User Device or User Equipment (User Equipment), which are not limited herein. Optionally, the terminal device 12 may also be a smart watch, a tablet computer, or the like. In this embodiment, the terminal device 12 and the server 13 may be nodes in a blockchain network.
The invention provides a block link point communication method, which aims to solve the technical problems in the prior art.
The following describes the technical solutions of the present invention and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 2 is a flowchart of a block link point communication method according to an embodiment of the present invention. The embodiment of the invention provides a block chain node communication method aiming at the technical problems in the prior art, and the method comprises the following specific steps:
step 201, a master storage node receives request information sent by a target node, where the request information indicates that the target node requests to become a slave storage node, and the request information includes identification information of the target node.
As shown in fig. 3, 31 denotes a master storage node in the blockchain network, 32 denotes a target node in the blockchain network, the target node 32 requests to become a slave storage node, and the target node 32 has its own public network IP address. Another target node is indicated at 33, the target node 33 requests to become a slave storage node, the target node 33 has no public Network IP Address, the target node 33 communicates with the blockchain Network via Network Address Translation (NAT), NAT is indicated at 34, and a querying node in the blockchain Network is indicated at 35. In this embodiment, the query node 35 is provided with a query service by a slave storage node. The method is only illustrative and does not limit the specific network architecture of the blockchain network. In addition, the query node 35 may be a node under the NAT or may not be a node under the NAT.
When the target node 32 or the target node 33 first joins the block chain network, it is necessary to obtain the created blocks from the nodes adjacent to the target node 32 or the target node 33, and optionally, all the nodes in the block chain network store the created blocks. In order to ensure that the target node 32 or the target node 33 acquires a real created block, the target node 32 or the target node 33 may send created block query requests to a plurality of neighboring nodes, for example, the target node 32 or the target node 33 sends created block query requests to the neighboring node B and the neighboring node C, after receiving the created block query requests, the neighboring node B and the neighboring node C send respective locally stored created blocks to the target node 32 or the target node 33, the target node 32 or the target node 33 compares whether the created blocks fed back by the neighboring node B and the neighboring node C are consistent, and if the created blocks fed back by the neighboring node B and the neighboring node C are consistent, the target node 32 or the target node 33 locally stores the created blocks; if the created blocks fed back by the adjacent node B and the adjacent node C are not consistent, the target node 32 or the target node 33 may further continue to send created block query requests to the adjacent node D and the adjacent node E, and receive created blocks fed back by the adjacent node D and the adjacent node E, respectively, and if the created blocks fed back by adjacent nodes exceeding a preset proportion among the adjacent node B, the adjacent node C, the adjacent node D, and the adjacent node E are consistent, the target node 32 or the target node 33 determines that the created blocks are real. Optionally, if the created blocks fed back by more than fifty percent of the neighboring nodes, such as the neighboring node C, the neighboring node D, and the neighboring node E, are consistent, the target node 32 or the target node 33 determines that the created block fed back by the neighboring node C is real, and the created block fed back by the neighboring node B is false.
When the target node 32 or the target node 33 acquires the real created block, the created block is stored locally, and the IP address of the main storage node is acquired from the created block, and optionally, the created block stores IP addresses of one or more main storage nodes, and the target node 32 or the target node 33 may send request information to the one or more main storage nodes according to the IP addresses of the one or more main storage nodes, for example, the created block stores the IP address of the main storage node 31, the target node 32 sends request information to the main storage node 31, the request information is used to indicate that the target node 32 intends to become a slave storage node, and includes identification information of the target node 32 and a terminal device number corresponding to the target node 32. Or/and the target node 33 sends request information to the master storage node 31, wherein the request information is used for indicating that the target node 33 wants to become a slave storage node, and the request information comprises identification information of the target node 33 and a terminal equipment number corresponding to the target node 33.
Step 202, the master storage node compares whether the source IP address of the request message is the same as the IP address broadcast by the target node when joining the blockchain network.
When the main storage node 31 receives the request information sent by the target node 32, the main storage node 31 obtains a source IP address, for example, TTT, of the request information, and searches a blockchain ledger locally stored in the main storage node 31 for an IP address, for example, UUU, broadcast by the target node 32 when joining the blockchain network, and further compares whether the source IP address, for example, TTT, of the request information is the same as the IP address, for example, UUU, broadcast by the target node 32 when joining the blockchain network.
Similarly, when the main storage node 31 receives the request message sent by the target node 33, the main storage node 31 obtains the source IP address, e.g., TTT, of the request message, and searches the blockchain ledger locally stored in the main storage node 31 for the IP address, e.g., UUU, broadcast by the target node 33 when joining the blockchain network, and further compares whether the source IP address, e.g., TTT, of the request message is the same as the IP address, e.g., UUU, broadcast by the target node 33 when joining the blockchain network.
Step 203, if the source IP address of the request information is different from the IP address broadcast by the target node when joining the block chain network, the main storage node determines that the target node has no public network IP address.
As shown in fig. 3, the destination node 33 does not have its own public IP address, and therefore, the source IP address of the request message sent by the destination node 33 to the main storage node 31 may not be the own public IP address of the destination node 33, and the source IP address of the request message may be a public IP address allocated to the destination node 33 by an access point in a local area network corresponding to the destination node 33, and the source IP address of the request message may be different from the IP address broadcast by the destination node 33 when joining the blockchain network. Thus, when the primary storage node 31 compares the source IP address, e.g., TTT, of the request message sent by the target node 33 with the IP address, e.g., UUU, broadcast by the target node 33 when joining the blockchain network, the primary storage node 31 determines that the target node 33 is under NAT and that the target node 33 does not have its own public network IP address.
And step 204, the main storage node determines the public network IP address of the local area network where the target node is located and the port number mapped in the local area network by the target node according to the heartbeat message sent by the target node.
In this embodiment, since the target node 33 communicates with the blockchain network through the NAT, the target node 33 does not have a public network IP address; however, it is necessary to have a public network IP address as a slave storage node in order for the inquiring node to access the slave storage node based on the public network IP address. Therefore, in this embodiment, the target node 33 needs to send a heartbeat message to the main storage node 31 in real time or periodically, and it is assumed that the heartbeat message sent by the target node 33 and received by the main storage node 31 at a certain time is marked as a first heartbeat message, where the content included in the first heartbeat message may specifically be a content index, such as a block number, which can currently provide storage information query and is signed by the target node 33 using its own private key.
After the main storage node 31 receives the first heartbeat packet, according to the signed block number in the first heartbeat packet, the identity information of the target node 33 may be determined, and the source IP address and the source port number of the first heartbeat packet are further extracted, where the main storage node 31 may use the source IP address and the source port number of the first heartbeat packet as the address information of the target node 33, and optionally, the address information of the target node 33 includes: the public network IP address of the local area network or access point corresponding to the target node 33, such as a home gateway, and the port number mapped on the local area network or the access point by the target node 33. That is, the source IP address of the first heartbeat packet may be a public network IP address of a local area network or an access point, such as a home gateway, corresponding to the target node 33; the source port number of the first heartbeat packet may be the port number that the destination node 33 maps on the local area network or the access point.
Optionally, the method further includes: and the main storage node updates the locally recorded public network IP address of the local area network where the target node is located and the port number mapped in the local area network by the target node according to the heartbeat message periodically sent by the target node.
After sending the first heartbeat packet described in the above embodiment to the main storage node 31, the target node 33 sends a second heartbeat packet to the main storage node 31, where a source IP address of the second heartbeat packet may be different from a source IP address of the first heartbeat packet, and a source port number of the second heartbeat packet may also be different from a source port number of the first heartbeat packet, that is, the source IP address and the source port number of the heartbeat packet may be changed.
When the main storage node 31 receives the second heartbeat packet, the source IP address and the source port number of the second heartbeat packet may be used as new address information of the destination node 33.
Before the main storage node 31 receives the second heartbeat message, the main storage node 31 stores the identification information of the target node 33, the terminal equipment number corresponding to the target node 33, and the public network IP address and the port number of the local area network or the access point corresponding to the target node 33; after the main storage node 31 receives the second heartbeat packet, the source IP address of the second heartbeat packet is used as the new public network IP address of the target node 33, and the source port number of the second heartbeat packet is used as the new port number of the target node 33, so that the public network IP address and the port number of the local area network or the access point of the target node 33, which are already stored in the main storage node 31, are updated according to the new public network IP address and the new port number of the target node 33.
In addition, if the source IP address of the request information is the same as the IP address broadcast by the target node when joining the block chain network, when the main storage node receives an inquiry request sent by an inquiry node, the main storage node sends the source IP address and the source port number of the request information to the inquiry node, so that the inquiry node sends the inquiry request to the target node.
As shown in fig. 3, the destination node 32 has its own public network IP address, and therefore, the source IP address of the request message sent by the destination node 32 to the main storage node 31 is the own public network IP address of the destination node 32, and the source IP address of the request message is the same as the IP address broadcast by the destination node 32 when joining the blockchain network. Therefore, when the main storage node 31 compares the source IP address, e.g., TTT, of the request message sent by the target node 32 with the IP address, e.g., UUU, broadcast by the target node 32 when joining the blockchain network, and is the same, the main storage node 31 determines that the target node 32 is not under the NAT and the target node 32 has its own public network IP address, the source IP address of the request message sent by the target node 32 is the target node 32's own public network IP address, and the source port number of the request message sent by the target node 32 is the port number of the target node 32.
When the query node 35 needs to access the slave storage node in the block chain network, the query node 35 obtains the created blocks stored locally, and the method and process for storing the created blocks by the query node 35 are the same as those for storing the created blocks by the target node 32 or the target node 33, and are not described herein again. Optionally, the founding block locally stored by the query node 35 includes an IP address of the main storage node 31, the query node 35 sends a query request to the main storage node 31 according to the IP address of the main storage node 31, after the main storage node 31 receives the query request, the main storage node 31 sends the public network IP address, the port number, the identification information of the target node 32 and the terminal device number corresponding to the target node 32 to the query node 35, the query node 35 sends the query request to the target node 32 according to the public network IP address and the port number of the target node 32, and the target node 32 sends a query result to the query node 35.
The embodiment of the invention receives request information sent by a target node through a main storage node, compares whether a source IP address of the request information is the same as an IP address broadcasted by the target node when the target node joins a block chain network, thereby determining whether the target node has a public network IP address, and if the target node has no public network IP address, determines a public network IP address of a local area network where the target node is located and a port number mapped by the target node in the local area network by receiving a heartbeat message sent by the target node, thereby enabling the target node to be a slave storage node, enabling the node without the public network IP address to be a slave storage node, and promoting the development of block chain service.
Fig. 4 is a flowchart of a block-node communication method according to another embodiment of the present invention. On the basis of the foregoing embodiment, the block link point communication method provided in this embodiment specifically includes the following steps:
step 401, a master storage node receives request information sent by a target node, where the request information indicates that the target node requests to become a slave storage node, and the request information includes identification information of the target node.
The implementation manner of step 401 and step 201 is consistent with specific principles, and is not described herein again.
Step 402, the master storage node compares whether the source IP address of the request message is the same as the IP address broadcast by the target node when joining the blockchain network.
The implementation manner of step 402 and step 202 is consistent with specific principles, and will not be described herein.
Step 403, if the source IP address of the request message is different from the IP address broadcast by the target node when joining the block chain network, the main storage node determines that the target node has no public network IP address.
The implementation manner of step 403 and step 203 is consistent with specific principles, and will not be described herein.
Step 404, the primary storage node sends a connection request to the target node according to the source IP address and the source port number of the request information.
When the main storage node 31 determines that the target node 33 is under the NAT and the target node 33 does not have its own public network IP address, the main storage node 31 further determines the type of the NAT where the target node 33 is located, and the target node 33 may be under a normal NAT or a symmetric NAT. Specifically, the main storage node 31 sends a connection request, which may be a TCP connection request, to the target node 33 according to the source IP address, e.g. TTT, and the source port number, e.g. 4040, of the request information sent by the target node 33.
Step 405, the master storage node receives the connection response sent by the target node.
If the target node 33 receives the connection request sent by the main storage node 31 and sends a connection response to the main storage node 31, it indicates that the target node 33 is under normal NAT.
Step 406, the main storage node determines, according to the heartbeat packet sent by the target node, a public network IP address of a local area network where the target node is located and a port number mapped by the target node in the local area network.
The implementation manner of step 406 and step 204 is consistent with specific principles, and will not be described herein.
Step 407, the main storage node receives the query request sent by the query node.
For example, the master storage node 31 receives a query request sent by the query node 35.
Step 408, the master storage node sends the public network IP address of the local area network where the target node is located and the port number mapped by the target node in the local area network to the query node, so that the query node sends the query request to the target node.
The main storage node 31 sends the latest recorded public network IP address of the local area network where the target node 33 is located and the port number mapped by the target node 33 in the local area network to the query node 35, and the query node 35 sends the query request to the target node 33 according to the public network IP address of the local area network where the target node 33 is located and the port number mapped by the target node 33 in the local area network, so that the target node 33 sends the query result to the query node 35.
The embodiment of the invention receives request information sent by a target node through a main storage node, compares whether a source IP address of the request information is the same as an IP address broadcasted by the target node when the target node joins a block chain network, thereby determining whether the target node has a public network IP address, and if the target node has no public network IP address, determines a public network IP address of a local area network where the target node is located and a port number mapped by the target node in the local area network by receiving a heartbeat message sent by the target node, thereby enabling the target node to be a slave storage node, enabling the node without the public network IP address to be a slave storage node, and promoting the development of block chain service.
Fig. 5 is a flowchart of a block-node communication method according to another embodiment of the present invention. On the basis of the foregoing embodiment, the block link point communication method provided in this embodiment specifically includes the following steps:
step 501, a master storage node receives request information sent by a target node, where the request information indicates that the target node requests to become a slave storage node, and the request information includes identification information of the target node.
The implementation manner of step 501 and step 201 is consistent with specific principles, and is not described herein again.
Step 502, the master storage node compares whether the source IP address of the request message is the same as the IP address broadcast by the target node when joining the blockchain network.
The implementation manner of step 502 and step 202 is consistent with specific principles, and will not be described herein.
Step 503, if the source IP address of the request message is different from the IP address broadcast by the target node when joining the block chain network, the main storage node determines that the target node has no public network IP address.
The implementation manner of step 503 and step 203 is consistent with specific principles, and is not described herein again.
Step 504, the primary storage node sends a connection request to the target node according to the source IP address and the source port number of the request information.
The implementation manner of step 504 and step 404 is consistent with specific principles, and will not be described herein.
And 505, the master storage node does not receive the connection response sent by the target node within a preset time.
After the main storage node 31 sends the connection request to the target node 33 according to the source IP address, e.g., TTT, and the source port number, e.g., 4040, of the request information sent by the target node 33, if the main storage node 31 does not receive the connection response sent by the target node 33 within the preset time, the main storage node 31 may send the connection request to the target node 33 again, and if the main storage node 31 does not receive the connection response sent by the target node 33 within the preset time after sending the preset number of connection requests to the target node 33, it indicates that the target node 33 is under the symmetric NAT.
Step 506, the main storage node determines the public network IP address of the local area network where the target node is located and the port number mapped in the local area network by the target node according to the heartbeat packet sent by the target node.
The implementation manner of step 506 and step 204 is consistent with specific principles, and will not be described herein.
In step 507, the main storage node receives the query request sent by the query node.
For example, the master storage node 31 receives a query request sent by the query node 35.
Step 508, the main storage node sends the IP address and the port number of the query node and the query request to the target node according to the public network IP address of the local area network where the target node is located and the port number mapped by the target node in the local area network.
The main storage node 31 sends the IP address and the port number of the query node 35 and the query request to the target node 33 through a heartbeat channel maintained by the main storage node 31 and the target node 33, specifically, the main storage node 31 sends the IP address and the port number of the query node 35 and the query request to the target node 33 according to a newly recorded public network IP address of a local network in which the target node 33 is located and a port number mapped by the target node 33 in the local network, optionally, the IP address of the query node 35 may be a source IP address of the query request sent by the query node 35 and received by the main storage node 31, and the port number of the query node 35 may be a source port number of the query request sent by the query node 35 and received by the main storage node 31.
According to the embodiment of the invention, whether the target node which becomes the slave storage node has the public network IP address or not is requested, and when the target node has no public network IP address, the type of the NAT corresponding to the target node realizes different communication modes between the target node and the query node, so that the investment cost of a block chain network is saved.
Fig. 6 is a schematic structural diagram of a block link point communication device according to an embodiment of the present invention. The block link point communicator may be the main storage node in the above embodiments. As shown in fig. 6, the block link point communication device 60 includes: a receiving module 61, a comparing module 62, a first determining module 63 and a second determining module 64; the receiving module 61 is configured to receive request information sent by a target node, where the request information indicates that the target node requests to become a slave storage node, and the request information includes identification information of the target node; the comparing module 62 is configured to compare whether the source IP address of the request message is the same as the IP address broadcast by the target node when joining the blockchain network; the first determining module 63 is configured to determine that the target node has no public network IP address if the source IP address of the request information is different from the IP address broadcast by the target node when joining the blockchain network; the second determining module 64 is configured to determine, according to the heartbeat packet sent by the target node, a public network IP address of a local area network where the target node is located and a port number mapped by the target node in the local area network.
Optionally, the block link point communication device 60 further includes: a sending module 65; the sending module 65 is configured to send a connection request to the target node according to the source IP address and the source port number of the request information; the receiving module 61 is further configured to: receiving a connection response sent by the target node; receiving a query request sent by a query node; the sending module 65 is further configured to: and sending the public network IP address of the local area network where the target node is located and the port number mapped by the target node in the local area network to the query node so that the query node sends the query request to the target node.
Optionally, the sending module 65 is configured to send a connection request to the target node according to the source IP address and the source port number of the request information; the receiving module 61 does not receive the connection response sent by the target node within a preset time; the receiving module 61 is further configured to: receiving a query request sent by a query node; the sending module 65 is further configured to: and sending the IP address and the port number of the query node and the query request to the target node according to the public network IP address of the local area network where the target node is located and the port number mapped in the local area network by the target node.
Optionally, if the source IP address of the request information is the same as the IP address broadcast by the target node when joining the blockchain network, when the receiving module receives the query request sent by the query node, the sending module 65 is configured to send the source IP address and the source port number of the request information to the query node, so that the query node sends the query request to the target node.
Optionally, the block link point communication device 60 further includes: and the updating module 66, configured to update, according to the heartbeat packet periodically sent by the target node, a locally recorded public network IP address of a local area network where the target node is located and a port number mapped in the local area network by the target node.
The block link point communication apparatus of the embodiment shown in fig. 6 can be used to implement the technical solution of the above method embodiment, and the implementation principle and technical effect are similar, and are not described herein again.
Fig. 7 is a schematic structural diagram of a blockchain node according to an embodiment of the present invention. The block link point provided by the embodiment of the present invention may execute the processing procedure provided by the block link point communication method embodiment, as shown in fig. 7, the block link point 70 includes a memory 71, a processor 72, a computer program, and a communication interface 73; wherein a computer program is stored in the memory 71 and configured to be executed by the processor 72 for the block-link point communication method as described in the above embodiments.
The block link points of the embodiment shown in fig. 7 can be used to implement the technical solution of the above method embodiment, and the implementation principle and technical effect are similar, and are not described herein again.
In addition, the present embodiment also provides a computer-readable storage medium on which a computer program is stored, the computer program being executed by a processor to implement the block link point communication method described in the above embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1. A block-node communication method, comprising:
a master storage node receives request information sent by a target node, wherein the request information indicates that the target node requests to become a slave storage node, and the request information comprises identification information of the target node;
the main storage node compares whether the source IP address of the request information is the same as the IP address broadcast by the target node when the target node joins the block chain network;
if the source IP address of the request information is different from the IP address broadcast by the target node when the target node joins the block chain network, the main storage node determines that the target node has no public network IP address;
the main storage node determines a public network IP address of a local area network where the target node is located and a port number mapped in the local area network by the target node according to the heartbeat message sent by the target node;
after the main storage node determines that the target node has no public network IP address, the method further includes:
the main storage node sends a connection request to the target node according to the source IP address and the source port number of the request information;
the main storage node does not receive a connection response sent by the target node within a preset time;
after the main storage node determines the public network IP address of the local area network where the target node is located and the port number mapped by the target node in the local area network according to the heartbeat packet sent by the target node, the method further includes:
the main storage node receives a query request sent by a query node;
the main storage node sends the IP address and the port number of the query node and the query request to the target node according to the public network IP address of the local area network where the target node is located and the port number mapped in the local area network by the target node;
wherein the content of the first and second substances,
after the main storage node determines that the target node has no public network IP address, the method further includes:
the main storage node sends a connection request to the target node according to the source IP address and the source port number of the request information;
the main storage node receives a connection response sent by the target node;
after the main storage node determines the public network IP address of the local area network where the target node is located and the port number mapped by the target node in the local area network according to the heartbeat packet sent by the target node, the method further includes:
the main storage node receives a query request sent by a query node;
and the main storage node sends the public network IP address of the local area network where the target node is located and the port number mapped in the local area network by the target node to the query node, so that the query node sends the query request to the target node.
2. The method of claim 1, further comprising:
if the source IP address of the request information is the same as the IP address broadcast by the target node when the target node joins the block chain network, when the main storage node receives an inquiry request sent by an inquiry node, the main storage node sends the source IP address and the source port number of the request information to the inquiry node, so that the inquiry node sends the inquiry request to the target node.
3. The method of claim 1, further comprising:
and the main storage node updates the locally recorded public network IP address of the local area network where the target node is located and the port number mapped in the local area network by the target node according to the heartbeat message periodically sent by the target node.
4. A block-link point communication device, comprising:
a receiving module, configured to receive request information sent by a target node, where the request information indicates that the target node requests to become a slave storage node, and the request information includes identification information of the target node;
the comparison module is used for comparing whether the source IP address of the request information is the same as the IP address broadcasted by the target node when the target node joins the block chain network;
a first determining module, configured to determine that the target node has no public network IP address if a source IP address of the request information is different from an IP address broadcast by the target node when joining a blockchain network;
a second determining module, configured to determine, according to the heartbeat packet sent by the target node, a public network IP address of a local area network in which the target node is located and a port number mapped by the target node in the local area network;
a sending module, configured to send a connection request to the target node according to the source IP address and the source port number of the request information;
the receiving module does not receive the connection response sent by the target node within the preset time;
the receiving module is further configured to: receiving a query request sent by a query node;
the sending module is further configured to: sending the IP address and the port number of the query node and the query request to the target node according to the public network IP address of the local area network where the target node is located and the port number mapped by the target node in the local area network;
wherein the content of the first and second substances,
further comprising: a sending module, configured to send a connection request to the target node according to the source IP address and the source port number of the request information;
the receiving module is further configured to: receiving a connection response sent by the target node; receiving a query request sent by a query node;
the sending module is further configured to: and sending the public network IP address of the local area network where the target node is located and the port number mapped by the target node in the local area network to the query node so that the query node sends the query request to the target node.
5. The block-link point communication device of claim 4, further comprising: a sending module;
if the source IP address of the request message is the same as the IP address broadcast by the target node when joining the blockchain network, when the receiving module receives the query request sent by the query node, the sending module is configured to send the source IP address and the source port number of the request message to the query node, so that the query node sends the query request to the target node.
6. A block-link point communication device according to claim 4 or 5, further comprising: and the updating module is used for updating the locally recorded public network IP address of the local area network where the target node is located and the port number mapped in the local area network by the target node according to the heartbeat message periodically sent by the target node.
7. A block link point, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-3.
8. A computer-readable storage medium, having stored thereon a computer program for execution by a processor to perform the method according to any one of claims 1-3.
CN201810553155.6A 2018-05-31 2018-05-31 Block chain node communication method and device and block chain node Active CN108712506B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810553155.6A CN108712506B (en) 2018-05-31 2018-05-31 Block chain node communication method and device and block chain node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810553155.6A CN108712506B (en) 2018-05-31 2018-05-31 Block chain node communication method and device and block chain node

Publications (2)

Publication Number Publication Date
CN108712506A CN108712506A (en) 2018-10-26
CN108712506B true CN108712506B (en) 2021-02-02

Family

ID=63870999

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810553155.6A Active CN108712506B (en) 2018-05-31 2018-05-31 Block chain node communication method and device and block chain node

Country Status (1)

Country Link
CN (1) CN108712506B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3549324B1 (en) 2018-11-16 2020-10-07 Alibaba Group Holding Limited A domain name management scheme for cross-chain interactions in blockchain systems
AU2018347193B2 (en) 2018-11-16 2020-05-14 Advanced New Technologies Co., Ltd. Cross-chain interactions using a domain name scheme in blockchain systems
CN109639848A (en) * 2018-12-20 2019-04-16 全链通有限公司 Method, equipment, system and the storage medium of domain name are issued in block chain
CN109862135B (en) * 2019-03-19 2021-06-01 全链通有限公司 Group communication method based on domain name block chain, block chain link point and medium
CN110677462B (en) * 2019-09-09 2022-07-12 上海共链信息科技有限公司 Access processing method, system, device and storage medium for multi-block chain network
CN111464963B (en) * 2020-04-01 2021-11-09 中国联合网络通信集团有限公司 Registration method of card-free terminal and identity registration server
CN112866365A (en) * 2021-01-11 2021-05-28 杭州复杂美科技有限公司 Node communication method, computer device, and storage medium
CN113132378A (en) * 2021-04-15 2021-07-16 无锡全面互链科技有限公司 Block chain link point equipment and block chain network system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1697452A (en) * 2005-06-17 2005-11-16 中兴通讯股份有限公司 Method for protecting access security of IP multimedia subsystem based on IPSec passing through NAT
CN101141420A (en) * 2007-09-05 2008-03-12 杭州华三通信技术有限公司 Method and system for performing data communication between private network and public network
CN101350825A (en) * 2008-08-22 2009-01-21 中兴通讯股份有限公司 Method and system for crossing network address conversion, stream media server, set-top box
CN103200281A (en) * 2013-01-24 2013-07-10 中国联合网络通信集团有限公司 Method, device and system for accessing intranet server
CN104125145A (en) * 2014-08-12 2014-10-29 中国联合网络通信集团有限公司 Web browser based communication method, web browser based communication equipment and web browser based communication system
CN106716421A (en) * 2016-12-30 2017-05-24 深圳前海达闼云端智能科技有限公司 Data query method, device and node apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10318546B2 (en) * 2016-09-19 2019-06-11 American Express Travel Related Services Company, Inc. System and method for test data management

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1697452A (en) * 2005-06-17 2005-11-16 中兴通讯股份有限公司 Method for protecting access security of IP multimedia subsystem based on IPSec passing through NAT
CN101141420A (en) * 2007-09-05 2008-03-12 杭州华三通信技术有限公司 Method and system for performing data communication between private network and public network
CN101350825A (en) * 2008-08-22 2009-01-21 中兴通讯股份有限公司 Method and system for crossing network address conversion, stream media server, set-top box
CN103200281A (en) * 2013-01-24 2013-07-10 中国联合网络通信集团有限公司 Method, device and system for accessing intranet server
CN104125145A (en) * 2014-08-12 2014-10-29 中国联合网络通信集团有限公司 Web browser based communication method, web browser based communication equipment and web browser based communication system
CN106716421A (en) * 2016-12-30 2017-05-24 深圳前海达闼云端智能科技有限公司 Data query method, device and node apparatus

Also Published As

Publication number Publication date
CN108712506A (en) 2018-10-26

Similar Documents

Publication Publication Date Title
CN108712506B (en) Block chain node communication method and device and block chain node
EP3668134B1 (en) Wireless communication method, network device, and terminal device
CN109451451B (en) Terminal roaming method, device and storage medium
CN108810120B (en) Block chain node communication method and device and block chain node
CN109640274B (en) Short message sending method and device based on block chain and computer readable storage medium
CN108769142B (en) Transaction information processing method and block generation node
CN109118360B (en) Block chain account checking method, device, equipment and storage medium
CN108683727B (en) Block processing method and main node
CN108989043B (en) Block processing method and device and block link points
CN110138580B (en) PDU session updating method and network side equipment
CN108200568B (en) Mobile communication electronic SIM card data processing method and device
EP3046351A1 (en) Method and device for realizing terminal wifi talkback
CN108777710B (en) Inter-node communication method and device of block chain and block chain node
CN108777712B (en) Block chain node communication method and device and block chain node
US10390210B2 (en) Access method, user equipment and server
CN108243631B (en) Network access method and equipment
CN108876611B (en) Transaction information processing method and device and block link points
CN109087096B (en) Block chain account checking method, device, equipment and storage medium
CN108848144B (en) Method and device for accessing nodes in block chain and block chain link point
CN109639715B (en) Method, device and equipment for avoiding double-flower attack and computer readable storage medium
CN108898419B (en) Reward information processing method and device and block link points
CN108833513B (en) Inter-node communication method and device of block chain and block chain node
CN108768733B (en) Block chain account book processing method and device and block chain link points
CN108712507B (en) Block link point access method and device and block link point
CN108810186B (en) Block chain node communication method and device and block chain node

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