CN108848144B - Method and device for accessing nodes in block chain and block chain link point - Google Patents
Method and device for accessing nodes in block chain and block chain link point Download PDFInfo
- Publication number
- CN108848144B CN108848144B CN201810552807.4A CN201810552807A CN108848144B CN 108848144 B CN108848144 B CN 108848144B CN 201810552807 A CN201810552807 A CN 201810552807A CN 108848144 B CN108848144 B CN 108848144B
- Authority
- CN
- China
- Prior art keywords
- node
- address
- storage node
- target node
- address information
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 238000013519 translation Methods 0.000 claims abstract description 8
- 238000004590 computer program Methods 0.000 claims description 11
- 238000011161 development Methods 0.000 abstract description 6
- 230000001737 promoting effect Effects 0.000 abstract description 2
- 238000004891 communication Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols 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]
Abstract
The embodiment of the invention provides a method and a device for accessing nodes in a block chain and a block chain link point. The method comprises the following steps: the main storage node receives an inquiry request sent by an inquiry node, wherein the inquiry request comprises first indication information which is used for indicating that the inquiry node has no public network IP address; the main storage node determines the address information of the inquiry node according to the source IP address and the source port number of the inquiry request; the master storage node obtaining address information of at least one slave storage node, the at least one slave storage node communicating with a blockchain network through network address translation; and sending the query request and the address information of the query node 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 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
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method and a device for accessing nodes in a block chain and a block chain link point.
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 accessing a node in a block chain, and a block chain node, so that a node without a public network IP address can also become a slave storage node, thereby promoting the development of a block chain service.
In a first aspect, an embodiment of the present invention provides a method for accessing a node in a blockchain, where the method includes:
a main storage node receives an inquiry request sent by an inquiry node, wherein the inquiry request comprises first indication information, and the first indication information is used for indicating that the inquiry node has no public network IP address;
the main storage node determines the address information of the inquiry node according to the source IP address and the source port number of the inquiry request;
the master storage node acquires address information of at least one slave storage node, and the at least one slave storage node is communicated with a block chain network through network address translation;
and the master storage node sends the query request and the address information of the query node 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 an apparatus for accessing a node in a blockchain, 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, the query request comprises first indication information, and the first indication information is used for indicating that the query node does not have a public network IP address;
a determining module, configured to determine address information of the query node according to a source IP address and a source port number of the query request;
an acquisition module for acquiring address information of at least one slave storage node, the at least one slave storage node communicating with a blockchain network through network address translation;
and the sending module is used for sending the query request and the address information of the query node 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 method, the device and the block chain link point for accessing the nodes in the block chain, provided by 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.
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 accessing a node in a blockchain 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 accessing a node in a blockchain according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a node access device in a blockchain 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 access method for the nodes in the block chain provided by the invention can be applied to the communication system shown in figure 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 method for accessing nodes in a block chain, 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 accessing a node in a blockchain according to an embodiment of the present invention. The embodiment of the invention provides a method for accessing nodes in a block chain, aiming at the technical problems in the prior art, and the method comprises the following specific steps:
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. In some embodiments, the query node 35 may also sign the query request with its own private key to obtain a signed query request, and send the signed query request to the main storage node 31. For example, the querying node 35 sends a query request to the main storage node 31, the query request requesting first indication information indicating that the querying node 35 does not have a public network IP address.
When the main storage node 31 determines that the querying node 35 has no public network IP address according to the querying request sent by the querying node 35, the main storage node 31 may determine address information of the querying node 35 according to a source IP address and a source port number of the querying request, optionally, the main storage node 31 may use the source IP address of the querying request as the public network IP address of the querying node 35, and the main storage node 31 may use the source port number of the querying request as the mapping port number of the querying node 35.
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.
Optionally, the obtaining, by the master storage node, address information of at least one slave storage node includes: and the main storage node acquires the address information of the target node.
When the master storage node 31 receives the query request sent by the querying node 35, the address information of the slave storage node 32 may be obtained from a locally stored list, or the address information of a node under NAT, for example, the target node 33, may be obtained from a locally stored list. 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.
And step 204, the master storage node sends the query request and the address information of the query node 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.
If the master storage node 31 obtains the address information of the slave storage node 32 from the locally stored list, the master storage node 31 sends the query request and the address information of the query node 35 to the slave storage node 32.
Optionally, the sending, by the master storage node, the query request and the address information of the query node 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 and the address information of the query node to the target node according to the address information of the target node.
Assuming that the main storage node 31 obtains the address information of the target node 33 from the locally stored list in the present embodiment, the main storage node 31 sends the query request and the address information of the query node 35 to the target node 33, that is, the main storage node 31 sends the query request and the address information of the query node 35 to the target node 33 through the heartbeat channel between the main storage node 31 and the target node 33. After receiving the query request and the address information of the query node 35, the target node 33 sends the query result to the query node 35 according to the address information of 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 accessing a node in a blockchain according to another embodiment of the present invention. On the basis of the foregoing embodiment, before the main storage node receives the query request sent by the query node, the method for accessing nodes in a blockchain provided in this embodiment further includes the following steps:
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.
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.
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.
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 a node access apparatus in a blockchain according to an embodiment of the present invention. As shown in fig. 5, the access device 50 in the blockchain may perform the processing procedure provided in the access method for a node in the blockchain according to the embodiment of the present invention, and includes: a receiving module 51, a determining module 52, an obtaining module 53 and a sending module 54; the receiving module 51 is configured to receive an inquiry request sent by an inquiry node, where the inquiry request includes first indication information, and the first indication information is used to indicate that the inquiry node does not have a public network IP address; the determining module 52 is configured to determine address information of the querying node according to the source IP address and the source port number of the querying request; the obtaining module 53 is configured to obtain address information of at least one slave storage node, where the at least one slave storage node communicates with the blockchain network through network address translation; the sending module 54 is configured to send the query request and the address information of the querying node 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 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 of the target node and second indication information, and the second indication information is used for indicating that the target node has no public network IP address; the node access means 50 in the blockchain further comprises: a recording module 55, where the recording module 55 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 55 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 node access means 50 in the blockchain further comprises: an update module 56; the updating module 56 is configured to update the address information of the target node, which is stored by the node access device in the blockchain, according to the address information of the target node included in the second heartbeat packet.
Optionally, the obtaining module 53 is specifically configured to: acquiring address information of the target node; the sending module 54 is specifically configured to: and sending the query request and the address information of the query node to the target node according to the 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.
The node access device in the block chain in the embodiment shown in fig. 5 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. 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 procedure provided by the embodiment of the node access method in the block chain, 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 a computer program is stored in the memory 61 and is configured to be executed by the processor 62 for performing the method for accessing nodes in a blockchain 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 method for accessing a node in a blockchain according to the foregoing 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 accessing a node in a blockchain, comprising:
a main storage node receives an inquiry request sent by an inquiry node, wherein the inquiry request comprises first indication information, and the first indication information is used for indicating that the inquiry node has no public network IP address;
the main storage node determines the address information of the inquiry node according to the source IP address and the source port number of the inquiry request;
the master storage node acquires address information of at least one slave storage node, and the at least one slave storage node is communicated with a block chain network through network address translation;
the master storage node sends the query request and the address information of the query node 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, the request information indicates that the target node requests to become a slave storage node, the request information comprises identification information of the target node and second indication information, and the second 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 of claim 2, wherein the master storage node obtaining address information of at least one slave storage node comprises:
the main storage node acquires the address information of the target node;
the master storage node sends the query request and the address information of the query node to the at least one slave storage node according to the address information of the at least one slave storage node, and the method comprises the following steps:
and the main storage node sends the query request and the address information of the query node to the target node according to the address information of the target node.
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. An apparatus for accessing a node in a blockchain, 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, the query request comprises first indication information, and the first indication information is used for indicating that the query node does not have a public network IP address;
a determining module, configured to determine address information of the query node according to a source IP address and a source port number of the query request;
an acquisition module for acquiring address information of at least one slave storage node, the at least one slave storage node communicating with a blockchain network through network address translation;
a sending module, configured to send the query request and the address information of the querying node 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;
wherein 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 of the target node and second indication information, and the second indication information is used for indicating that the target node has no public network IP address;
the device for accessing the nodes in the blockchain further comprises: 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 apparatus of claim 5, wherein the receiving module is further configured to: receiving a second heartbeat message sent by the target node;
the device for accessing the nodes in the blockchain further comprises: and the updating module is used for updating the address information of the target node stored by the node access device in the block chain according to the address information of the target node included in the second heartbeat message.
7. The apparatus of claim 6, wherein the obtaining module is specifically configured to: acquiring address information of the target node;
the sending module is specifically configured to: and sending the query request and the address information of the query node to the target node according to the address information of the target node.
8. The apparatus 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.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810552807.4A CN108848144B (en) | 2018-05-31 | 2018-05-31 | Method and device for accessing nodes in block chain and block chain link point |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810552807.4A CN108848144B (en) | 2018-05-31 | 2018-05-31 | Method and device for accessing nodes in block chain and block chain link point |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108848144A CN108848144A (en) | 2018-11-20 |
CN108848144B true CN108848144B (en) | 2021-03-30 |
Family
ID=64211126
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810552807.4A Active CN108848144B (en) | 2018-05-31 | 2018-05-31 | Method and device for accessing nodes in block chain and block chain link point |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108848144B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112039930B (en) * | 2019-06-03 | 2023-04-07 | 本无链科技(深圳)有限公司 | Method and system for constructing mobile block chain based on large nodes |
CN110445850A (en) * | 2019-07-24 | 2019-11-12 | 深圳壹账通智能科技有限公司 | Block chain node access method and device, storage medium, electronic equipment |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102063486A (en) * | 2010-12-28 | 2011-05-18 | 东北大学 | Multi-dimensional data management-oriented cloud computing query processing method |
CN102082837A (en) * | 2010-12-31 | 2011-06-01 | 华为技术有限公司 | Method and device for distributing public network address for IP (Internet protocol) terminal |
CN103906037A (en) * | 2012-12-25 | 2014-07-02 | 中兴通讯股份有限公司 | Method and device for completing network address translation keep-alive by adopting port control protocol |
CN104980528A (en) * | 2015-06-26 | 2015-10-14 | 广州华多网络科技有限公司 | Method, system and apparatus for realizing communication between nodes |
CN105610999A (en) * | 2016-03-30 | 2016-05-25 | 上海斐讯数据通信技术有限公司 | Method, device, server and system for implementing P2P communication by penetrating NAT (network address translator) |
CN106598490A (en) * | 2016-11-25 | 2017-04-26 | 深圳前海微众银行股份有限公司 | Access method for block chain data and block chain management system |
CN106850724A (en) * | 2015-12-07 | 2017-06-13 | 中兴通讯股份有限公司 | Data push method and device |
CN107733950A (en) * | 2016-08-11 | 2018-02-23 | 百度在线网络技术(北京)有限公司 | Method and apparatus for accessing website |
CN107911421A (en) * | 2017-10-30 | 2018-04-13 | 上海点融信息科技有限责任公司 | For configuring the method for internetwork communication, equipment and computer-readable storage medium in block chain |
-
2018
- 2018-05-31 CN CN201810552807.4A patent/CN108848144B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102063486A (en) * | 2010-12-28 | 2011-05-18 | 东北大学 | Multi-dimensional data management-oriented cloud computing query processing method |
CN102082837A (en) * | 2010-12-31 | 2011-06-01 | 华为技术有限公司 | Method and device for distributing public network address for IP (Internet protocol) terminal |
CN103906037A (en) * | 2012-12-25 | 2014-07-02 | 中兴通讯股份有限公司 | Method and device for completing network address translation keep-alive by adopting port control protocol |
CN104980528A (en) * | 2015-06-26 | 2015-10-14 | 广州华多网络科技有限公司 | Method, system and apparatus for realizing communication between nodes |
CN106850724A (en) * | 2015-12-07 | 2017-06-13 | 中兴通讯股份有限公司 | Data push method and device |
CN105610999A (en) * | 2016-03-30 | 2016-05-25 | 上海斐讯数据通信技术有限公司 | Method, device, server and system for implementing P2P communication by penetrating NAT (network address translator) |
CN107733950A (en) * | 2016-08-11 | 2018-02-23 | 百度在线网络技术(北京)有限公司 | Method and apparatus for accessing website |
CN106598490A (en) * | 2016-11-25 | 2017-04-26 | 深圳前海微众银行股份有限公司 | Access method for block chain data and block chain management 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 |
---|---|
CN108848144A (en) | 2018-11-20 |
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 | |
US11057761B2 (en) | Cloud SIM card management server, binding device, management method, binding method and system | |
JP7127118B6 (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 | |
CN109118360B (en) | Block chain account checking method, device, equipment and storage medium | |
US9572032B2 (en) | Method and system for terminal to access network and terminal | |
CN108769142B (en) | Transaction information processing method and block generation node | |
CN108777710B (en) | Inter-node communication method and device of block chain and block chain node | |
CN108989043B (en) | Block processing method and device and block link points | |
CN108683727B (en) | Block processing method and main node | |
CN108200568B (en) | Mobile communication electronic SIM card data processing method and device | |
TWI640214B (en) | Network access method, related equipment and system | |
CN108877290B (en) | Parking space scheduling method, device, equipment and storage medium | |
CN108848144B (en) | Method and device for accessing nodes in block chain and block chain link point | |
US10390210B2 (en) | Access method, user equipment and server | |
CN108777712B (en) | Block chain node communication method and device and block chain node | |
CN108876611B (en) | Transaction information processing method and device and block link points | |
CN108243631B (en) | Network access method and equipment | |
CN109087096B (en) | Block chain account checking method, device, equipment and storage medium | |
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 | |
CN108712507B (en) | Block link point access method and device and block link point |
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 |