CN108777710B - Inter-node communication method and device of block chain and block chain node - Google Patents

Inter-node communication method and device of block chain and block chain node Download PDF

Info

Publication number
CN108777710B
CN108777710B CN201810552880.1A CN201810552880A CN108777710B CN 108777710 B CN108777710 B CN 108777710B CN 201810552880 A CN201810552880 A CN 201810552880A CN 108777710 B CN108777710 B CN 108777710B
Authority
CN
China
Prior art keywords
node
target node
storage node
address
query
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
CN201810552880.1A
Other languages
Chinese (zh)
Other versions
CN108777710A (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 CN201810552880.1A priority Critical patent/CN108777710B/en
Publication of CN108777710A publication Critical patent/CN108777710A/en
Application granted granted Critical
Publication of CN108777710B publication Critical patent/CN108777710B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session

Abstract

The embodiment of the invention provides a method and a device for communication among block chain nodes and the block chain nodes. The method comprises the following steps: a main storage node receives a query request sent by a query node, wherein the query request comprises identification information of the query node; the master storage node acquires address information of at least one slave storage node according to the query request, and the at least one slave storage node is communicated with a block chain network through symmetrical network address translation; and the master storage node sends the query request to the at least one slave storage node according to the address information of the at least one slave storage node, so that the at least one slave storage node sends a query result to the query node. The embodiment of the invention receives the heartbeat message sent by the target node through the main storage node, and the heartbeat message comprises the address information of the target node, so that the node without the public network IP address can also become the slave storage node, and the development of the block chain service is promoted.

Description

Inter-node communication method and device of block chain and block chain node
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method and a device for communication among block chain nodes and the block chain nodes.
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 inter-node communication of block links, and a block link node, so that a node without a public network IP address may also become a slave storage node, thereby promoting development of a block link service.
In a first aspect, an embodiment of the present invention provides a method for inter-node communication of a block, including:
a main storage node receives a query request sent by a query node, wherein the query request comprises identification information of the query node;
the master storage node acquires address information of at least one slave storage node according to the query request, and the at least one slave storage node is communicated with a block chain network through symmetrical network address translation;
and the master storage node sends the query request to the at least one slave storage node according to the address information of the at least one slave storage node, so that the at least one slave storage node sends a query result to the query node.
In a second aspect, an embodiment of the present invention provides a block link inter-point communication apparatus, including:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a query request sent by a query node, and the query request comprises identification information of the query node;
the acquisition module is used for acquiring the address information of at least one slave storage node according to the query request, wherein the at least one slave storage node is communicated with the block chain network through symmetrical network address translation;
and the sending module is used for sending the query request to the at least one slave storage node according to the address information of the at least one slave storage node so that the at least one slave storage node sends a query result to the query 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 inter-block chain node communication method and device and the block chain node provided by the embodiment of the invention, the heartbeat message sent by the target node is received through the main storage node, the heartbeat message comprises the address information of the target node, so that the main storage node records the corresponding relation between the identification information of the target node and the address information of the target node, the target node can become a slave storage node in a block chain network, and therefore, a node without a public network IP address can also become a 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 method for inter-node communication of a block chain 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 method for inter-node communication of a block chain according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a communication apparatus between block chain nodes according to an embodiment of the present invention;
fig. 6 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 inter-node communication method of the block links 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 communication method between block chain nodes, 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 method for inter-node communication of a block chain according to an embodiment of the present invention. The embodiment of the invention provides a method for communication between block chain nodes aiming at the technical problems in the prior art, which comprises the following specific steps:
step 201, a main storage node receives a query request sent by a query node, where the query request includes identification information of the query node.
As shown in fig. 3, 31 denotes a master storage node in the blockchain Network, 32 denotes a slave storage node in the blockchain Network, 33 denotes a target node, the target node 33 requests to become the slave storage node, the target node 33 does not have a public Network IP Address, the target node 33 communicates with the blockchain Network through Network Address Translation (NAT), 34 denotes a NAT, 35 denotes an inquiring node in the blockchain Network, and in the present embodiment, the inquiring node 35 is provided with an inquiry service by the slave storage node. The method is only illustrative and does not limit the specific network architecture of the blockchain network.
When the query node 35 first joins the block chain network, it is necessary to obtain the created blocks from the nodes adjacent to the query node 35, and optionally, all the nodes in the block chain network store the created blocks. In order to ensure that the query node 35 obtains a real created block, the query node 35 may send created block query requests to a plurality of neighboring nodes, for example, the query node 35 sends created block query requests to the neighboring node B1 and the neighboring node C1, after receiving the created block query requests, the neighboring node B1 and the neighboring node C1 send respective locally stored created blocks to the query node 35, the query node 35 compares whether the created blocks fed back by the neighboring node B1 and the neighboring node C1 are consistent, and if the created blocks fed back by the neighboring node B1 and the neighboring node C1 are consistent, the query node 35 locally stores the created blocks; if the created blocks fed back by the neighboring node B1 and the neighboring node C1 are not consistent, the query node 35 may further continue to send created block query requests to the neighboring node D1 and the neighboring node E1, and receive created blocks fed back by the neighboring node D1 and the neighboring node E1, respectively, and if created blocks fed back by neighboring nodes exceeding a preset proportion among the neighboring node B1, the neighboring node C1, the neighboring node D1, and the neighboring node E1 are consistent, the query node 35 determines that the created blocks are real. Optionally, more than fifty percent of neighboring nodes, such as the neighboring node C1, the neighboring node D1, and the neighboring node E1, of the neighboring node B1, the neighboring node C1, the neighboring node D1, and the neighboring node E1 respectively feed back the same created blocks, and then the query node 35 determines that the created blocks fed back by the neighboring node C1 are real, and the created blocks fed back by the neighboring node B1 are false.
When the query node 35 acquires the real created block, the created block is stored locally, the IP address of the main storage node is acquired from the created block, and a query request for querying the secondary storage node is sent to the main storage node according to the IP address of the main storage node. For example, the querying node 35 sends a query request to the main storage node 31, the query request including identification information of the querying node 35.
Step 202, the master storage node obtains address information of at least one slave storage node according to the query request, and the at least one slave storage node communicates with a block chain network through symmetric network address translation.
In the present embodiment, the master storage node 31 locally stores a list including identification information of slave storage nodes corresponding to the master storage node 31 and public network IP addresses, for example, the list includes identification information of the slave storage node 32 and public network IP addresses.
When the main storage node 31 receives the request information sent by the target node 33, it is determined that the target node 33 does not have a public network IP address, but the target node 33 wants to become a slave storage node, the main storage node 31 records the identification information of the target node 33 and the terminal device number corresponding to the target node 33 in the list. The public key of the slave storage node 32 and the public key of the target node 33 may be stored in the list.
In this embodiment, since the slave storage node 32 does not communicate with the blockchain network through the NAT, the slave storage node 32 has a public network IP address, and the master storage node 31 locally stores the public network IP address of the slave storage node 32; the target node 33 communicates with the blockchain network through the NAT, and the target node 33 does not have a public network IP address, and the main storage node 31 does not locally have the public network IP address of the target node 33; 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: a public network IP address of the access point AP corresponding to the target node 33 and a port number mapped on the public network IP address by the target node 33. In addition, the public network IP address may also be a public network IP address of a local area network to which the target node 33 belongs. That is to say, the source IP address of the first heartbeat packet may be a public network IP address of an access point AP corresponding to the target node 33, or a public network IP address of a local area network to which the target node 33 belongs; the source port number of the first heartbeat packet may be the port number mapped on the public network IP address by the destination node 33.
The main storage node 31 records the identification information of the target node 33, the terminal device number corresponding to the target node 33, and the public network IP address and port number corresponding to the target node 33 in a local list.
After receiving the query request of the query node 35, the main storage node 31 determines whether the target node 33 is a node under the symmetric NAT, which includes the following specific steps: the main storage node 31 checks a locally stored blockchain account book, detects whether a node M exists in the blockchain account book, and during a communication process between the node M and the node a, the node M actively contacts the node a through an IP address of the node a, but not the node M that the node a contacts first, if the node M exists, the main storage node 31 determines that the target node 33 is not a node under the symmetric NAT, and if the node M does not exist, the main storage node 31 determines that the target node 33 is a node under the symmetric NAT, further, the main storage node 31 acquires a public network IP address and a port number corresponding to the target node 33 from a local list, and it can be understood that the public network IP address and the port number corresponding to the target node 33 are determined by the main storage node 31 through a heartbeat message reported by the target node 33.
Step 203, the master storage node sends the query request to the at least one slave storage node according to the address information of the at least one slave storage node, so that the at least one slave storage node sends the query result to the query node.
Specifically, the sending, by the master storage node, the query request to the at least one slave storage node according to the address information of the at least one slave storage node includes: and the main storage node sends the query request to the target node according to the address information of the target node, and the target node is communicated with a block chain network through symmetrical network address translation.
After the main storage node 31 acquires the public network IP address and the port number corresponding to the target node 33 from the local list, the main storage node 31 sends the query request sent by the query node 35 to the target node 33 according to the latest public network IP address and port number corresponding to the target node 33, that is, the main storage node 31 may send the query request sent by the query node 35 to the target node 33 through a heartbeat channel between the main storage node 31 and the target node 33, and after receiving the query request of the query node 35, the target node 33 sends the corresponding query result to the query node 35.
In the embodiment of the invention, the heartbeat message sent by the target node is received through the main storage node, and the heartbeat message comprises the address information of the target node, so that the main storage node records the corresponding relation between the identification information of the target node and the address information of the target node, and the target node can become a slave storage node in a block chain network, so that the node without a public network IP address can also become the slave storage node, and the development of block chain service is promoted.
Fig. 4 is a flowchart of a method for inter-node communication of a block chain according to another embodiment of the present invention. On the basis of the foregoing embodiment, before the main storage node receives an inquiry request sent by an inquiry node, where the inquiry request includes identification information of the inquiry node, the block inter-link node communication method provided in this embodiment further 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 and indication information of the target node, and the indication information is used to indicate that the target node has no public network IP address.
In this embodiment, when the target node 33 first joins the blockchain network, it is necessary to obtain the created blocks from the nodes adjacent to the target node 33, and optionally, all the nodes in the blockchain network store the created blocks. In order to ensure that the target node 33 obtains a real created block, the target node 33 may send created block query requests to a plurality of neighboring nodes, for example, 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 33, the target node 33 compares whether created blocks fed back by the neighboring node B and the neighboring node C are consistent, and if created blocks fed back by the neighboring node B and the neighboring node C are consistent, 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 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 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 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 33 acquires a real created block, the created block is stored locally, the IP address of the main storage node is acquired from the created block, and request information is sent to the main storage node according to the IP address of the main storage node, where the request information is used to indicate that the target node 33 wants to become a slave storage node, and the request information includes identification information of the target node 33, a terminal device number corresponding to the target node 33, and indication information used to indicate that the target node 33 has no public network IP address, and the indication information may be a field or a character agreed in advance in the block chain network.
Step 402, the master storage node records the identification information of the target node.
In this embodiment, the master storage node 31 locally stores a list including identification information of a slave storage node corresponding to the master storage node 31, a terminal device number corresponding to the slave storage node, and a public network IP address, for example, the list includes identification information of the slave storage node 32, a terminal device number corresponding to the slave storage node 32, and a public network IP address.
When the main storage node 31 receives the request information sent by the target node 33, it is determined that the target node 33 does not have a public network IP address, but the target node 33 wants to become a slave storage node, the main storage node 31 records the identification information of the target node 33 and the terminal device number corresponding to the target node 33 in the list. The public key of the slave storage node 32 and the public key of the target node 33 may be stored in the list.
Step 403, the main storage node receives a first heartbeat packet sent by the target node, where the first heartbeat packet includes address information of the target node.
Optionally, the address information of the target node includes: and the public network IP address of the access point AP corresponding to the target node and the port number mapped on the public network IP address by the target node.
In this embodiment, since the slave storage node 32 does not communicate with the blockchain network through the NAT, the slave storage node 32 has a public network IP address, and the master storage node 31 locally stores the public network IP address of the slave storage node 32; the target node 33 communicates with the blockchain network through the NAT, and the target node 33 does not have a public network IP address, and the main storage node 31 does not locally have the public network IP address of the target node 33; 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: a public network IP address of the access point AP corresponding to the target node 33 and a port number mapped on the public network IP address by the target node 33. In addition, the public network IP address may also be a public network IP address of a local area network to which the target node 33 belongs. That is to say, the source IP address of the first heartbeat packet may be a public network IP address of an access point AP corresponding to the target node 33, or a public network IP address of a local area network to which the target node 33 belongs; the source port number of the first heartbeat packet may be the port number mapped on the public network IP address by the destination node 33.
Step 404, the main storage node records the corresponding relationship between the identification information of the target node and the address information of the target node.
The main storage node 31 records the identification information of the target node 33, the terminal device number corresponding to the target node 33, and the public network IP address and port number corresponding to the target node 33 in a local list.
In addition, in another embodiment, after the main storage node records the correspondence between the identification information of the target node and the address information of the target node in step 404, the method further includes: the main storage node receives a second heartbeat message sent by the target node; and the main storage node updates the address information of the target node stored by the main storage node according to the address information of the target node included in the second heartbeat message.
In this embodiment, the target node 33 may send a heartbeat message to the main storage node 31 in real time or periodically, and it is assumed that after the target node 33 sends the first heartbeat message described in the above embodiment to the main storage node 31, a second heartbeat message is sent to the main storage node 31, a source IP address of the second heartbeat message may be different from a source IP address of the first heartbeat message, and a source port number of the second heartbeat message may also be different from a source port number of the first heartbeat message, that is, the source IP address and the source port number of the heartbeat message 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 locally stores identification information of the target node 33, a terminal equipment number corresponding to the target node 33, a public network IP address and a port number corresponding to the target node 33; after the main storage node 31 receives the second heartbeat message, the source IP address of the second heartbeat message is used as the new public network IP address of the target node 33, and the source port number of the second heartbeat message 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 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 the embodiment of the invention, the heartbeat message sent by the target node is received through the main storage node, and the heartbeat message comprises the address information of the target node, so that the main storage node records the corresponding relation between the identification information of the target node and the address information of the target node, and the target node can become a slave storage node in a block chain network, so that the node without a public network IP address can also become the slave storage node, and the development of block chain service is promoted.
Fig. 5 is a schematic structural diagram of an inter-block chain node communication apparatus according to an embodiment of the present invention, where the inter-block chain node communication apparatus is specifically a main storage node according to the above-mentioned embodiment. As shown in fig. 5, the inter-block chain node communication apparatus 50 according to an embodiment of the present invention may execute a processing procedure provided in the inter-block chain node communication method embodiment, and includes: a receiving module 51, an obtaining module 52 and a sending module 53; the receiving module 51 is configured to receive an inquiry request sent by an inquiry node, where the inquiry request includes identification information of the inquiry node; the obtaining module 52 is configured to obtain address information of at least one slave storage node according to the query request, where the at least one slave storage node communicates with a block chain network through symmetric network address translation; the sending module 53 is configured to send the query request to the at least one slave storage node according to the address information of the at least one slave storage node, so that the at least one slave storage node sends a query result to the querying node.
Optionally, the receiving module 51 is further configured to: receiving request information sent by a target node, wherein the request information indicates that the target node requests to become a slave storage node, the request information comprises identification information and indication information of the target node, and the indication information is used for indicating that the target node has no public network IP address; the inter-block chain node communication apparatus 50 further includes: a recording module 54; the recording module 54 is configured to record the identification information of the target node; the receiving module 51 is further configured to: receiving a first heartbeat message sent by the target node, wherein the first heartbeat message comprises address information of the target node; the recording module 54 is further configured to: and recording the corresponding relation between the identification information of the target node and the address information of the target node.
Optionally, the receiving module 51 is further configured to: receiving a second heartbeat message sent by the target node; the inter-block chain node communication apparatus 50 further includes: an update module 55; the updating module 55 is configured to update the address information of the target node, which is stored in the inter-block chain node communication apparatus, according to the address information of the target node included in the second heartbeat packet.
Optionally, the sending module 53 is specifically configured to: and sending the query request to the target node according to the address information of the target node, wherein the target node is communicated with a block chain network through symmetrical network address translation.
Optionally, the address information of the target node includes: and the public network IP address of the access point AP corresponding to the target node and the port number mapped on the public network IP address by the target node.
The inter-block chain node communication apparatus in the embodiment shown in fig. 5 may 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. 6 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 flow provided by the embodiment of the inter-block link node communication method, as shown in fig. 6, the block link point 60 includes a memory 61, a processor 62, a computer program, and a communication interface 63; wherein the computer program is stored in the memory 61 and is configured to be executed by the processor 62 for performing the inter-blockchain node communication method as described in the above embodiments.
The block link points 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.
In addition, the present embodiment also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the inter-block-chain-node communication method described in the above embodiment.
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 (10)

1. A method for inter-node communication in a block, comprising:
a main storage node receives a query request sent by a query node, wherein the query request comprises identification information of the query node;
the master storage node acquires address information of at least one slave storage node according to the query request, and the at least one slave storage node is communicated with a block chain network through symmetrical network address translation;
the master storage node sends the query request to the at least one slave storage node according to the address information of the at least one slave storage node, so that the at least one slave storage node sends a query result to the query node;
before the main storage node receives the query request sent by the query node, the method further includes:
the method comprises the steps that a main storage node receives request information sent by a target node, wherein the request information represents that the target node requests to become a slave storage node, the request information comprises identification information and indication information of the target node, and the indication information is used for indicating that the target node has no public network IP address;
the main storage node records the identification information of the target node;
the main storage node receives a first heartbeat message sent by the target node, wherein the first heartbeat message comprises address information of the target node;
and the main storage node records the corresponding relation between the identification information of the target node and the address information of the target node.
2. The method according to claim 1, wherein after the master storage node records the correspondence between the identification information of the target node and the address information of the target node, the method further comprises:
the main storage node receives a second heartbeat message sent by the target node;
and the main storage node updates the address information of the target node stored by the main storage node according to the address information of the target node included in the second heartbeat message.
3. The method according to claim 1 or 2, wherein the master storage node sends the query request to the at least one slave storage node according to the address information of the at least one slave storage node, comprising:
and the main storage node sends the query request to the target node according to the address information of the target node, and the target node is communicated with a block chain network through symmetrical network address translation.
4. The method of claim 3, wherein the address information of the target node comprises: and the public network IP address of the access point AP corresponding to the target node and the port number mapped on the public network IP address by the target node.
5. A block-link inter-point communication device, comprising:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a query request sent by a query node, and the query request comprises identification information of the query node;
the acquisition module is used for acquiring the address information of at least one slave storage node according to the query request, wherein the at least one slave storage node is communicated with the block chain network through symmetrical network address translation;
a sending module, configured to send the query request to the at least one slave storage node according to address information of the at least one slave storage node, so that the at least one slave storage node sends a query result to the querying node;
the receiving module is further configured to:
receiving request information sent by a target node, wherein the request information indicates that the target node requests to become a slave storage node, the request information comprises identification information and indication information of the target node, and the indication information is used for indicating that the target node has no public network IP address;
the inter-block chain node communication apparatus further includes: the recording module is used for recording the identification information of the target node;
the receiving module is further configured to: receiving a first heartbeat message sent by the target node, wherein the first heartbeat message comprises address information of the target node;
the recording module is further configured to: and recording the corresponding relation between the identification information of the target node and the address information of the target node.
6. The inter-block-link point communication device of claim 5, wherein the receiving module is further configured to:
receiving a second heartbeat message sent by the target node;
the inter-block chain node communication apparatus further includes: and the updating module is used for updating the address information of the target node stored by the inter-block chain node communication device according to the address information of the target node included in the second heartbeat message.
7. The inter-block-link-point communication device according to claim 5 or 6, wherein the sending module is specifically configured to: and sending the query request to the target node according to the address information of the target node, wherein the target node is communicated with a block chain network through symmetrical network address translation.
8. The inter-block-link-point communication device of claim 7, wherein the address information of the target node comprises: and the public network IP address of the access point AP corresponding to the target node and the port number mapped on the public network IP address by the target node.
9. 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-4.
10. A computer-readable storage medium, having stored thereon a computer program for execution by a processor to perform the method of any one of claims 1-4.
CN201810552880.1A 2018-05-31 2018-05-31 Inter-node communication method and device of block chain and block chain node Active CN108777710B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810552880.1A CN108777710B (en) 2018-05-31 2018-05-31 Inter-node communication method and device of block chain and block chain node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810552880.1A CN108777710B (en) 2018-05-31 2018-05-31 Inter-node communication method and device of block chain and block chain node

Publications (2)

Publication Number Publication Date
CN108777710A CN108777710A (en) 2018-11-09
CN108777710B true CN108777710B (en) 2021-06-08

Family

ID=64028363

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810552880.1A Active CN108777710B (en) 2018-05-31 2018-05-31 Inter-node communication method and device of block chain and block chain node

Country Status (1)

Country Link
CN (1) CN108777710B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109714398B (en) * 2018-12-11 2021-09-21 新华三技术有限公司 Data storage method and device
CN111355789A (en) * 2020-02-24 2020-06-30 洪心科技(广州)有限公司 Communication method and device between block chain nodes
CN113901144B (en) * 2021-10-15 2024-02-06 北京智融云河科技有限公司 Query method, device and storage medium under non-whole network consensus block chain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104580504A (en) * 2015-01-26 2015-04-29 北京迪创伟业科技有限公司 Network terminal information processing method used for remote meter reading and terminal information processing method
CN105142189A (en) * 2015-08-11 2015-12-09 深圳市华讯方舟科技有限公司 Method and device for roaming control of site
CN107079059A (en) * 2016-12-21 2017-08-18 深圳前海达闼云端智能科技有限公司 Block chain storage method and device and node equipment
CN107493340A (en) * 2017-08-23 2017-12-19 广州市易彩乐网络科技有限公司 Data distribution method of calibration in block chain network, apparatus and system
CN107911421A (en) * 2017-10-30 2018-04-13 上海点融信息科技有限责任公司 For configuring the method for internetwork communication, equipment and computer-readable storage medium in block chain

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101612475B1 (en) * 2010-04-19 2016-04-27 삼성전자주식회사 Apparatus and Method for establishing partnership of P2P service based on gossip

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104580504A (en) * 2015-01-26 2015-04-29 北京迪创伟业科技有限公司 Network terminal information processing method used for remote meter reading and terminal information processing method
CN105142189A (en) * 2015-08-11 2015-12-09 深圳市华讯方舟科技有限公司 Method and device for roaming control of site
CN107079059A (en) * 2016-12-21 2017-08-18 深圳前海达闼云端智能科技有限公司 Block chain storage method and device and node equipment
CN107493340A (en) * 2017-08-23 2017-12-19 广州市易彩乐网络科技有限公司 Data distribution method of calibration in block chain network, apparatus and system
CN107911421A (en) * 2017-10-30 2018-04-13 上海点融信息科技有限责任公司 For configuring the method for internetwork communication, equipment and computer-readable storage medium in block chain

Also Published As

Publication number Publication date
CN108777710A (en) 2018-11-09

Similar Documents

Publication Publication Date Title
CN108712506B (en) Block chain node communication method and device and block chain node
CN109451451B (en) Terminal roaming method, device and storage medium
JP7127118B2 (en) Wireless communication method, network device and terminal device
CN109067724B (en) Block chain data transaction method, device, equipment 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
CN108777710B (en) Inter-node communication method and device of block chain and block chain node
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
CN108200568B (en) Mobile communication electronic SIM card data processing method and device
CN102355751B (en) Self-organization network information transfer method, system and equipment
CN108777712B (en) Block chain node communication method and device and block chain node
EP3667995B1 (en) Synchronization signal block indication method and determining method, network device, and terminal device
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
CN108876611B (en) Transaction information processing method and device and block link points
CN109087096B (en) Block chain account checking method, device, equipment and 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
CN108777711B (en) Block chain node communication method and device and block chain node
CN108881414B (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