WO2022148321A1 - Node communication methods, computer device, and storage medium - Google Patents

Node communication methods, computer device, and storage medium Download PDF

Info

Publication number
WO2022148321A1
WO2022148321A1 PCT/CN2021/143843 CN2021143843W WO2022148321A1 WO 2022148321 A1 WO2022148321 A1 WO 2022148321A1 CN 2021143843 W CN2021143843 W CN 2021143843W WO 2022148321 A1 WO2022148321 A1 WO 2022148321A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
local area
blockchain nodes
area network
current node
Prior art date
Application number
PCT/CN2021/143843
Other languages
French (fr)
Chinese (zh)
Inventor
李邦柱
王志文
吴思进
Original Assignee
杭州复杂美科技有限公司
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 杭州复杂美科技有限公司 filed Critical 杭州复杂美科技有限公司
Publication of WO2022148321A1 publication Critical patent/WO2022148321A1/en

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/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/668Internet protocol [IP] address subnets

Definitions

  • the present application relates to the field of blockchain technology, and in particular to a node communication method, computer equipment and storage medium.
  • the present invention provides a node communication method suitable for blockchain nodes, the method comprising:
  • the network card IP address includes a public network IP address and a local area network IP address
  • the present invention provides a node communication method suitable for blockchain nodes, the method comprising:
  • the network card IP address includes a public network IP address and a local area network IP address
  • the present invention also provides a computer apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform operations in accordance with the present invention Node communication methods provided by various embodiments.
  • the present invention further provides a storage medium storing a computer program, the computer program causing a computer to execute the node communication method provided according to each embodiment of the present invention.
  • the node communication method, computer equipment and storage medium provided by the various embodiments of the present invention save the IP addresses of each network card of the current node in the first address set; wherein, the network card IP address includes the public network IP address and the local area network IP address; An address set is broadcast to several blockchain nodes for each blockchain node: according to the first address set, determine whether it is in the same local area network as the current node: if yes, then establish a connection with the current node according to the IP address of the local area network; if not, according to The method of establishing a connection between the public network IP address and the current node improves the efficiency of data transmission.
  • FIG. 1 is a flowchart of a node communication method according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of another node communication method according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a node communication method according to an embodiment of the present invention. As shown in FIG. 1, in this embodiment, the present invention provides a node communication method suitable for blockchain nodes. The above method includes:
  • S12 Save the IP addresses of each network card of the current node into the first address set; wherein, the IP addresses of the network cards include a public network IP address and a local area network IP address;
  • to broadcast the first address set to several blockchain nodes includes "broadcasting the first address set to seed nodes for broadcasting the first address set to other blockchain nodes", the current node does not have a local area network IP address Take the LAN IP address as null as an example, assuming that there are blockchain nodes N1 to N25 in the blockchain network, where N1 and N2 are nodes in the A LAN, and N3 to N25 do not have LAN IP addresses;
  • N1 performs step S12, and saves the public network IP address (pubIP_N1:port) and local area network IP address (localIP_N1:port) of N1 in the address set [pubIP_N1:port,localIP_N1:port];
  • N1 broadcasts [pubIP_N1:port,localIP_N1:port] to the seed node seed1;
  • seed1 broadcasts [pubIP_N1:port,localIP_N1:port] to N2 ⁇ N25;
  • N2 ⁇ N25 judge whether they are in the same LAN as N1:
  • N2 and N1 are in the same local area network, and N2 establishes a connection with N1 according to localIP_N1:port;
  • N3-N25 and N1 are not in the same local area network, and N3-N5 establishes a connection with N1 according to pubIP_N1:port.
  • N3 performs step S12, and saves the public network IP address (pubIP_N3:port) and local area network IP address (null) of N3 in the address set [pubIP_N3:port,null];
  • N3 broadcasts [pubIP_N3:port,null] to the seed node seed1;
  • seed1 broadcasts [pubIP_N3:port,null] to N1, N2, N4 ⁇ N25;
  • N1, N2, N4 ⁇ N25 judge whether they are in the same LAN as N3 according to [pubIP_N3:port,null]:
  • N1, N2, N4-N25 and N3 are not in the same LAN.
  • N1, N2, N4-N25 establish connections with N3 according to pubIP_N3:port.
  • N4 to N25 are similar to those of N3, and are not repeated here.
  • broadcasting the first address set to several blockchain nodes can also be configured according to actual needs, for example, it is configured to obtain the connection methods of several blockchain nodes from the first cloud platform, and use the above connection By broadcasting the first address set to the corresponding blockchain nodes, the same technical effect can be achieved.
  • broadcasting the first address set to other blockchain nodes can also be configured according to actual needs, for example, it is configured to broadcast the first address set to a first number of blockchain nodes, which can achieve the same technical effect.
  • the screening method of the first number of blockchain nodes may be further limited.
  • the first number of blockchain nodes should be the blockchain nodes with the closest physical distance to the current node.
  • a number of blockchain nodes should be the blockchain nodes with the closest logical distance to the current node.
  • the local area network IP address in the address set can also be configured according to actual requirements, for example, the configuration is empty, or other identifiers used to indicate that the current node does not have a local area network IP address , can achieve the same technical effect.
  • the format of the IP address of the public network and the local area network can be configured according to actual requirements, for example, it can also be configured as: pubIP_N1:port:PID, localIP_N1:port:PID, or, pubIP_N1:port:PID: pubkey_N1, localIP_N1:port:PID:pubkey_N1, can achieve the same technical effect.
  • the above embodiments improve the efficiency of data dissemination among blockchain nodes in the same local area network.
  • broadcasting the first set of addresses to several blockchain nodes includes:
  • broadcasting the first set of addresses to several blockchain nodes includes:
  • the above embodiment makes the connection of each blockchain node more balanced.
  • the method further includes:
  • the first address set is used for other blockchain nodes to judge whether they are in the same local area network as the current node:
  • the above embodiment enables other blockchain nodes in the same local area network as the current node to establish connections with the current node through the local area network IP of the current node, further improving the efficiency of data dissemination between blockchain nodes in the same local area network.
  • FIG. 2 is a flowchart of another node communication method according to an embodiment of the present invention.
  • the present invention provides a node communication method suitable for blockchain nodes.
  • the above method includes:
  • step S262 establish a connection with the corresponding node according to the second local area network IP address in the second address set;
  • step S263 is executed: establish a connection with the corresponding node according to the second public network IP address in the second address set.
  • N1 performs step S22, and saves the public network IP address (pubIP_N1:port) and local area network IP address (localIP_N1:port) of N1 in the address set [pubIP_N1:port,localIP_N1:port];
  • N1 performs step S24, and broadcasts [pubIP_N1:port,localIP_N1:port] to the seed node seed1;
  • seed1 saves [pubIP_N1:port,localIP_N1:port];
  • seed1 returns the address set of N2 to N25 to N1;
  • N1 performs the following operations on the address sets of N2 to N25 respectively:
  • N1 executes S261: judges whether it is in the same local area network as N2 according to the address set of N2:
  • N1 Since N1 and N2 are in the same local area network, N1 performs step S262, and establishes a connection with N2 according to the local area network IP address in the address set of N2;
  • N1 executes S261: judges whether it is in the same local area network as N3 according to the address set of N3:
  • step S263 is executed: establish a connection with N3 according to the public network IP address in the address set of N3.
  • N4 to N25 are the same as N3, and are not repeated here.
  • N3 performs step S22, and saves the public network IP address (pubIP_N3:port) and local area network IP address (null) of N3 in the address set [pubIP_N1:port,null];
  • N3 performs step S24, and broadcasts [pubIP_N1:port,null] to seed1;
  • seed1 save[pubIP_N1:port,null];
  • seed1 returns the address set of N1, N2, N4 ⁇ N25 to N3;
  • N3 performs the following operations on the address sets of N1, N2, N4 to N25 respectively:
  • N3 executes step S261, and judges whether it is in the same local area network as N1 according to the address set of N1:
  • N3 Since N3 does not have a local area network address, and N3 and N1 are not in the same local area network, N3 performs step S263: establishes a connection with N1 according to the public network IP address in the address set of N1.
  • N4 to N25 are similar to those of N3, and are not repeated here.
  • returning the second address set of several first blockchain nodes to the current node can also be configured according to actual requirements, for example, configured to return the first number of first blockchain nodes to the current node.
  • the second set of addresses can achieve the same technical effect.
  • the screening method of the first number of first blockchain nodes may be further limited, for example, the first number of first blockchain nodes should be the blockchain nodes with the closest physical distance to the current node, For another example, the first number of first blockchain nodes should be the blockchain nodes with the closest logical distance to the current node.
  • the format of the IP address of the public network and the local area network can be configured according to actual requirements, for example, it can also be configured as: pubIP_N1:port:PID, localIP_N1:port:PID, or, pubIP_N1:port:PID:pubkey_N1 , localIP_N1:port:PID:pubkey_N1, can achieve the same technical effect.
  • server storing the second address set can also be configured according to actual requirements, for example, configured as the first cloud platform, which can achieve the same technical effect.
  • the above embodiments improve the efficiency of data dissemination among blockchain nodes in the same local area network.
  • returning the second address set of several first blockchain nodes to the current node includes:
  • the method further includes:
  • the second address set is used for other blockchain nodes to judge whether they are in the same local area network as the corresponding node:
  • the above embodiment enables other blockchain nodes in the same local area network as the current node to establish connections with the current node through the local area network IP of the current node, further improving the efficiency of data dissemination between blockchain nodes in the same local area network.
  • FIG. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
  • the present application also provides a computer device, comprising one or more central processing units (CPUs) 301 , which can operate according to a program stored in a read only memory (ROM) 302 or Various appropriate actions and processes are executed from the program loaded into the random access memory (RAM) 303 from the storage section 308 .
  • ROM read only memory
  • RAM random access memory
  • various programs and data necessary for the operation of the computer device are also stored.
  • the CPU 301 , the ROM 302 , and the RAM 303 are connected to each other through a bus 304 .
  • An input/output (I/O) interface 305 is also connected to bus 304 .
  • the following components are connected to the I/O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc. ; and a communication section 309 including a network interface card such as a LAN card, a modem, and the like. The communication section 309 performs communication processing via a network such as the Internet.
  • a drive 310 is also connected to the I/O interface 305 as needed.
  • a removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.
  • the method described in any of the above embodiments may be implemented as a computer software program.
  • embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing any of the methods described above.
  • the computer program may be downloaded and installed from the network via the communication portion 309 and/or installed from the removable medium 311 .
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be a computer-readable storage medium included in the apparatus of the foregoing embodiment; A computer readable storage medium in a computer device.
  • the computer-readable storage medium stores one or more programs that are used by one or more processors to perform the methods described in the present application.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by dedicated hardware-based systems that perform the specified functions or operations , or can be implemented by a combination of dedicated hardware and computer instructions.
  • the related units or modules described in the embodiments of the present application may be implemented in a software manner, and may also be implemented in a hardware manner.
  • the described units or modules may also be provided in the processor, for example, each of the units may be a software program provided in a computer or a mobile smart device, or may be a separately configured hardware device. Wherein, the names of these units or modules do not constitute limitations on the units or modules themselves under certain circumstances.

Landscapes

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

Abstract

The present invention provides node communication methods, a computer device, and a storage medium. The method comprises: saving network card IP addresses of a current node into a first address set, the network card IP addresses comprising public network IP addresses and local area network (LAN) IP addresses; broadcasting the first address set to several blockchain nodes for each blockchain node to: determine, according to the first address set, whether same is in the same LAN as the current node: if so, then establishing a connection with the current node according to the LAN IP address; and if not, then establishing a connection with the current node according to the public network IP address. The present application improves data transmission efficiency.

Description

节点通信方法、计算机设备和存储介质Node communication method, computer device and storage medium 技术领域technical field
本申请涉及区块链技术领域,具体涉及一种节点通信方法、计算机设备和存储介质。The present application relates to the field of blockchain technology, and in particular to a node communication method, computer equipment and storage medium.
背景技术Background technique
在现有技术中,两个在相同局域网中的节点要互相广播信息,需要通过彼此的公网IP进行广播,大大降低数据传输效率。In the prior art, if two nodes in the same local area network want to broadcast information to each other, they need to broadcast information through each other's public network IP, which greatly reduces the data transmission efficiency.
发明内容SUMMARY OF THE INVENTION
鉴于现有技术中的上述缺陷或不足,期望提供一种提高传播效率的节点通信方法、计算机设备和存储介质。In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a node communication method, computer device and storage medium that improve propagation efficiency.
第一方面,本发明提供一种适用于区块链节点的节点通信方法,上述方法包括:In a first aspect, the present invention provides a node communication method suitable for blockchain nodes, the method comprising:
将当前节点的各网卡IP地址保存到第一地址集合中;其中,网卡IP地址包括公网IP地址和局域网IP地址;Save each network card IP address of the current node in the first address set; wherein, the network card IP address includes a public network IP address and a local area network IP address;
将第一地址集合广播至若干区块链节点,以供各区块链节点:Broadcast the first set of addresses to several blockchain nodes for each blockchain node:
根据第一地址集合判断是否与当前节点在同一局域网中:Determine whether it is in the same local area network as the current node according to the first address set:
是,则根据局域网IP地址与当前节点建立连接;If yes, establish a connection with the current node according to the LAN IP address;
否,则根据公网IP地址与当前节点建立连接。If not, establish a connection with the current node according to the public network IP address.
第二方面,本发明提供一种适用于区块链节点的节点通信方法,上述方法包括:In a second aspect, the present invention provides a node communication method suitable for blockchain nodes, the method comprising:
将当前节点的各网卡IP地址保存到第一地址集合中;其中,网卡IP地址包括公网IP地址和局域网IP地址;Save each network card IP address of the current node in the first address set; wherein, the network card IP address includes a public network IP address and a local area network IP address;
将第一地址集合广播至种子节点,以供:Broadcast the first set of addresses to seed nodes for:
保存第一地址集合;save the first address set;
向当前节点返回若干第一区块链节点的第二地址集合;Return the second address set of several first blockchain nodes to the current node;
分别对各第二地址集合执行如下操作:Perform the following operations on each of the second address sets respectively:
根据第二地址集合判断是否与对应的节点在同一局域网中:Determine whether it is in the same local area network as the corresponding node according to the second address set:
是,则根据第二地址集合中的第二局域网IP地址与对应的节点建立连接;If yes, then establish a connection with the corresponding node according to the second local area network IP address in the second address set;
否,则根据第二地址集合中的第二公网IP地址与对应的节点建立连接。If not, establish a connection with the corresponding node according to the second public network IP address in the second address set.
第三方面,本发明还提供一种计算机设备,包括一个或多个处理器和存储器,其中存储器包含可由该一个或多个处理器执行的指令以使得该一个或多个处理器执行根据本发明各实施例提供的节点通信方法。In a third aspect, the present invention also provides a computer apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform operations in accordance with the present invention Node communication methods provided by various embodiments.
第四方面,本发明还提供一种存储有计算机程序的存储介质,该计算机程序使计算机执行根据本发明各实施例提供的节点通信方法。In a fourth aspect, the present invention further provides a storage medium storing a computer program, the computer program causing a computer to execute the node communication method provided according to each embodiment of the present invention.
本发明诸多实施例提供的节点通信方法、计算机设备和存储介质通过将当前节点的各网卡IP地址保存到第一地址集合中;其中,网卡IP地址包括公网IP地址和局域网IP地址;将第一地址集合广播至若干区块链节点,以供各区块链节点:根据第一地址集合判断是否与当前节点在同一局域网中:是,则根据局域网IP地址与当前节点建立连接;否,则根据公网IP地址与当前节点建立连接的方法,提高数据传输效率。The node communication method, computer equipment and storage medium provided by the various embodiments of the present invention save the IP addresses of each network card of the current node in the first address set; wherein, the network card IP address includes the public network IP address and the local area network IP address; An address set is broadcast to several blockchain nodes for each blockchain node: according to the first address set, determine whether it is in the same local area network as the current node: if yes, then establish a connection with the current node according to the IP address of the local area network; if not, according to The method of establishing a connection between the public network IP address and the current node improves the efficiency of data transmission.
附图说明Description of drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
图1为本发明一实施例提供的一种节点通信方法的流程图。FIG. 1 is a flowchart of a node communication method according to an embodiment of the present invention.
图2为本发明一实施例提供的另一种节点通信方法的流程图。FIG. 2 is a flowchart of another node communication method according to an embodiment of the present invention.
图3为本发明一实施例提供的一种计算机设备的结构示意图。FIG. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发 明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与发明相关的部分。The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the related invention, but not to limit the invention. In addition, it should be noted that, for the convenience of description, only the parts related to the invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that the embodiments in the present application and the features of the embodiments may be combined with each other in the case of no conflict. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
图1为本发明一实施例提供的一种节点通信方法的流程图。如图1所示,在本实施例中,本发明提供一种适用于区块链节点的节点通信方法,上述方法包括:FIG. 1 is a flowchart of a node communication method according to an embodiment of the present invention. As shown in FIG. 1, in this embodiment, the present invention provides a node communication method suitable for blockchain nodes. The above method includes:
S12:将当前节点的各网卡IP地址保存到第一地址集合中;其中,网卡IP地址包括公网IP地址和局域网IP地址;S12: Save the IP addresses of each network card of the current node into the first address set; wherein, the IP addresses of the network cards include a public network IP address and a local area network IP address;
S14:将第一地址集合广播至若干区块链节点,以供各区块链节点:S14: Broadcast the first address set to several blockchain nodes for each blockchain node:
根据第一地址集合判断是否与当前节点在同一局域网中:Determine whether it is in the same local area network as the current node according to the first address set:
是,则根据局域网IP地址与当前节点建立连接;If yes, establish a connection with the current node according to the LAN IP address;
否,则根据公网IP地址与当前节点建立连接。If not, establish a connection with the current node according to the public network IP address.
具体地,以将第一地址集合广播至若干区块链节点包括“将第一地址集合广播至种子节点,以供将第一地址集合广播至其它区块链节点”,当前节点没有局域网IP地址时将局域网IP地址设为null为例,假设区块链网络中有区块链节点N1~N25,其中N1、N2均为A局域网中的节点,N3~N25没有局域网IP地址;Specifically, to broadcast the first address set to several blockchain nodes includes "broadcasting the first address set to seed nodes for broadcasting the first address set to other blockchain nodes", the current node does not have a local area network IP address Take the LAN IP address as null as an example, assuming that there are blockchain nodes N1 to N25 in the blockchain network, where N1 and N2 are nodes in the A LAN, and N3 to N25 do not have LAN IP addresses;
以N1为例:Take N1 as an example:
N1执行步骤S12,将N1的公网IP地址(pubIP_N1:port)和局域网IP地址(localIP_N1:port)保存到地址集合中[pubIP_N1:port,localIP_N1:port];N1 performs step S12, and saves the public network IP address (pubIP_N1:port) and local area network IP address (localIP_N1:port) of N1 in the address set [pubIP_N1:port,localIP_N1:port];
N1将[pubIP_N1:port,localIP_N1:port]广播至种子节点seed1;N1 broadcasts [pubIP_N1:port,localIP_N1:port] to the seed node seed1;
seed1将[pubIP_N1:port,localIP_N1:port]广播至N2~N25;seed1 broadcasts [pubIP_N1:port,localIP_N1:port] to N2~N25;
N2~N25根据[pubIP_N1:port,localIP_N1:port]判断是否与N1在同一局域网中:According to [pubIP_N1:port,localIP_N1:port], N2~N25 judge whether they are in the same LAN as N1:
N2与N1在同一局域网中,N2根据localIP_N1:port与N1建立连接;N2 and N1 are in the same local area network, and N2 establishes a connection with N1 according to localIP_N1:port;
N3~N25与N1不在同一局域网中,N3~N5根据pubIP_N1:port与 N1建立连接。N3-N25 and N1 are not in the same local area network, and N3-N5 establishes a connection with N1 according to pubIP_N1:port.
N2与N1的原理相似,此处不再赘述。The principles of N2 and N1 are similar, and will not be repeated here.
以N3为例:Take N3 as an example:
N3执行步骤S12,将N3的公网IP地址(pubIP_N3:port)和局域网IP地址(null)保存到地址集合中[pubIP_N3:port,null];N3 performs step S12, and saves the public network IP address (pubIP_N3:port) and local area network IP address (null) of N3 in the address set [pubIP_N3:port,null];
N3将[pubIP_N3:port,null]广播至种子节点seed1;N3 broadcasts [pubIP_N3:port,null] to the seed node seed1;
seed1将[pubIP_N3:port,null]广播至N1、N2、N4~N25;seed1 broadcasts [pubIP_N3:port,null] to N1, N2, N4~N25;
N1、N2、N4~N25根据[pubIP_N3:port,null]判断是否与N3在同一局域网中:N1, N2, N4~N25 judge whether they are in the same LAN as N3 according to [pubIP_N3:port,null]:
由于N3的局域网IP地址为null,则N1、N2、N4~N25与N3均不在同一局域网中,N1、N2、N4~N25根据pubIP_N3:port与N3建立连接。Since the LAN IP address of N3 is null, N1, N2, N4-N25 and N3 are not in the same LAN. N1, N2, N4-N25 establish connections with N3 according to pubIP_N3:port.
N4~N25与N3的原理相似,此处不再赘述。The principles of N4 to N25 are similar to those of N3, and are not repeated here.
在更多实施例中,将第一地址集合广播至若干区块链节点还可以根据实际需求进行配置,例如配置为,从第一云平台获取若干区块链节点的连接方式,并通过上述连接方式向对应的区块链节点广播第一地址集合,可实现相同的技术效果。In more embodiments, broadcasting the first address set to several blockchain nodes can also be configured according to actual needs, for example, it is configured to obtain the connection methods of several blockchain nodes from the first cloud platform, and use the above connection By broadcasting the first address set to the corresponding blockchain nodes, the same technical effect can be achieved.
在更多实施例中,将第一地址集合广播至其它区块链节点还可以根据实际需求进行配置,例如配置为,将第一地址集合广播至第一数量个区块链节点,可实现相同的技术效果。进一步的,还可以对第一数量个区块链节点的筛选方式进行进一步限定,例如,第一数量个区块链节点应当为与当前节点的物理距离最近的区块链节点,又比如,第一数量个区块链节点应当为与当前节点的逻辑距离最近的区块链节点。In more embodiments, broadcasting the first address set to other blockchain nodes can also be configured according to actual needs, for example, it is configured to broadcast the first address set to a first number of blockchain nodes, which can achieve the same technical effect. Further, the screening method of the first number of blockchain nodes may be further limited. For example, the first number of blockchain nodes should be the blockchain nodes with the closest physical distance to the current node. A number of blockchain nodes should be the blockchain nodes with the closest logical distance to the current node.
在更多实施例中,在当前节点没有局域网IP地址时,地址集合中的局域网IP地址还可以根据实际需求进行配置,例如配置为空,或,其它用于指示当前节点没有局域网IP地址的标识,可实现相同的技术效果。In more embodiments, when the current node does not have a local area network IP address, the local area network IP address in the address set can also be configured according to actual requirements, for example, the configuration is empty, or other identifiers used to indicate that the current node does not have a local area network IP address , can achieve the same technical effect.
本领域技术人员应当理解,公网和局域网的IP地址的格式可以根据实际需求进行配置,例如还可以配置为:pubIP_N1:port:PID、localI P_N1:port:PID,或,pubIP_N1:port:PID:pubkey_N1、localIP_N1:port:PID:pubkey_N1,可实现相同的技术效果。Those skilled in the art should understand that the format of the IP address of the public network and the local area network can be configured according to actual requirements, for example, it can also be configured as: pubIP_N1:port:PID, localIP_N1:port:PID, or, pubIP_N1:port:PID: pubkey_N1, localIP_N1:port:PID:pubkey_N1, can achieve the same technical effect.
上述实施例提高了同一局域网中的区块链节点间传播数据的效率。The above embodiments improve the efficiency of data dissemination among blockchain nodes in the same local area network.
优选地,将第一地址集合广播至若干区块链节点包括:Preferably, broadcasting the first set of addresses to several blockchain nodes includes:
将第一地址集合广播至种子节点,以供将第一地址集合广播至若干区块链节点。Broadcasting the first set of addresses to seed nodes for broadcasting the first set of addresses to several blockchain nodes.
上述实施例的节点通信原理可参考图1所示的方法,此处不再赘述。For the node communication principle in the foregoing embodiment, reference may be made to the method shown in FIG. 1 , which will not be repeated here.
进一步优选地,将第一地址集合广播至若干区块链节点包括:Further preferably, broadcasting the first set of addresses to several blockchain nodes includes:
收集若干区块链节点的节点连接数量信息;Collect information on the number of node connections of several blockchain nodes;
将第一地址集合广播至节点连接数量不足的若干区块链节点。Broadcast the first set of addresses to several blockchain nodes with insufficient node connections.
上述实施例使得各区块链节点的连接更为均衡。The above embodiment makes the connection of each blockchain node more balanced.
优选地,根据局域网IP地址与当前节点建立连接,或,根据公网IP地址与当前节点建立连接后,还包括:Preferably, after establishing the connection with the current node according to the local area network IP address, or after establishing the connection with the current node according to the public network IP address, the method further includes:
保存第一地址集合;save the first address set;
其中,第一地址集合用于供其它区块链节点判断是否与当前节点在同一局域网中:Among them, the first address set is used for other blockchain nodes to judge whether they are in the same local area network as the current node:
是,则根据局域网IP地址与当前节点建立连接;If yes, establish a connection with the current node according to the LAN IP address;
否,则根据公网IP地址与当前节点建立连接。If not, establish a connection with the current node according to the public network IP address.
上述实施例使得其它与当前节点处于同一局域网的区块链节点,也可以通过当前节点的局域网IP与当前节点建立连接,进一步提高了同一局域网中的区块链节点间传播数据的效率。The above embodiment enables other blockchain nodes in the same local area network as the current node to establish connections with the current node through the local area network IP of the current node, further improving the efficiency of data dissemination between blockchain nodes in the same local area network.
图2为本发明一实施例提供的另一种节点通信方法的流程图。如图2所示,在本实施例中,本发明提供一种适用于区块链节点的节点通信方法,上述方法包括:FIG. 2 is a flowchart of another node communication method according to an embodiment of the present invention. As shown in FIG. 2, in this embodiment, the present invention provides a node communication method suitable for blockchain nodes. The above method includes:
S22:将当前节点的各网卡IP地址保存到第一地址集合中;其中,网卡IP地址包括公网IP地址和局域网IP地址;S22: Save each network card IP address of the current node in the first address set; wherein, the network card IP address includes a public network IP address and a local area network IP address;
S24:将第一地址集合广播至种子节点,以供:S24: Broadcast the first address set to the seed node for:
保存第一地址集合;save the first address set;
向当前节点返回若干第一区块链节点的第二地址集合;Return the second address set of several first blockchain nodes to the current node;
分别对各第二地址集合执行如下操作:Perform the following operations on each of the second address sets respectively:
S261:根据第二地址集合判断是否与对应的节点在同一局域网中:S261: Determine whether it is in the same local area network as the corresponding node according to the second address set:
是,则执行步骤S262:根据第二地址集合中的第二局域网IP地址与对应的节点建立连接;If yes, then perform step S262: establish a connection with the corresponding node according to the second local area network IP address in the second address set;
否,则执行步骤S263:根据第二地址集合中的第二公网IP地址与对应的节点建立连接。If no, step S263 is executed: establish a connection with the corresponding node according to the second public network IP address in the second address set.
具体地,以向当前节点返回若干第一区块链节点的第二地址集合为“向当前节点返回其它区块链节点的第二地址集合”,当前节点没有局域网IP地址时将局域网IP地址设为null为例;假设区块链网络中有区块链节点N1~N25,其中N1、N2均为A局域网中的节点;N3~N25没有局域网IP地址;Specifically, taking the second address set of returning several first blockchain nodes to the current node as "returning the second address set of other blockchain nodes to the current node", when the current node does not have a local area network IP address, set the local area network IP address to Take null as an example; it is assumed that there are blockchain nodes N1 to N25 in the blockchain network, where N1 and N2 are nodes in the local area network of A; N3 to N25 do not have local area network IP addresses;
以N1为例;Take N1 as an example;
N1执行步骤S22,将N1的公网IP地址(pubIP_N1:port)和局域网IP地址(localIP_N1:port)保存到地址集合中[pubIP_N1:port,localIP_N1:port];N1 performs step S22, and saves the public network IP address (pubIP_N1:port) and local area network IP address (localIP_N1:port) of N1 in the address set [pubIP_N1:port,localIP_N1:port];
N1执行步骤S24,将[pubIP_N1:port,localIP_N1:port]广播至种子节点seed1;N1 performs step S24, and broadcasts [pubIP_N1:port,localIP_N1:port] to the seed node seed1;
seed1保存[pubIP_N1:port,localIP_N1:port];seed1 saves [pubIP_N1:port,localIP_N1:port];
seed1向N1返回N2~N25的地址集合;seed1 returns the address set of N2 to N25 to N1;
N1分别对N2~N25的地址集合执行如下操作:N1 performs the following operations on the address sets of N2 to N25 respectively:
对于N2:For N2:
N1执行S261:根据N2的地址集合判断是否与N2在同一局域网中:N1 executes S261: judges whether it is in the same local area network as N2 according to the address set of N2:
由于N1与N2在同一局域网中,则N1执行步骤S262,根据N2的地址集合中的局域网IP地址与N2建立连接;Since N1 and N2 are in the same local area network, N1 performs step S262, and establishes a connection with N2 according to the local area network IP address in the address set of N2;
对于N3:For N3:
N1执行S261:根据N3的地址集合判断是否与N3在同一局域网中:N1 executes S261: judges whether it is in the same local area network as N3 according to the address set of N3:
由于N1与N3不在同一局域网中,则执行步骤S263:根据N3的地址集合中的公网IP地址与N3建立连接。Since N1 and N3 are not in the same local area network, step S263 is executed: establish a connection with N3 according to the public network IP address in the address set of N3.
N4~N25与N3相同,此处不再赘述。N4 to N25 are the same as N3, and are not repeated here.
N2与N1的原理相似,此处不再赘述。The principles of N2 and N1 are similar, and will not be repeated here.
以N3为例:Take N3 as an example:
N3执行步骤S22,将N3的公网IP地址(pubIP_N3:port)和局域网IP地址(null)保存到地址集合中[pubIP_N1:port,null];N3 performs step S22, and saves the public network IP address (pubIP_N3:port) and local area network IP address (null) of N3 in the address set [pubIP_N1:port,null];
N3执行步骤S24,将[pubIP_N1:port,null]广播至seed1;N3 performs step S24, and broadcasts [pubIP_N1:port,null] to seed1;
seed1保存[pubIP_N1:port,null];seed1 save[pubIP_N1:port,null];
seed1向N3返回N1、N2、N4~N25的地址集合;seed1 returns the address set of N1, N2, N4~N25 to N3;
N3分别对N1、N2、N4~N25的地址集合执行如下操作:N3 performs the following operations on the address sets of N1, N2, N4 to N25 respectively:
对于N1:For N1:
N3执行步骤S261,根据N1的地址集合判断是否与N1在同一局域网中:N3 executes step S261, and judges whether it is in the same local area network as N1 according to the address set of N1:
由于N3没有局域网地址,N3与N1不在同一局域网中,则N3执行步骤S263:根据N1的地址集合中的公网IP地址与N1建立连接。Since N3 does not have a local area network address, and N3 and N1 are not in the same local area network, N3 performs step S263: establishes a connection with N1 according to the public network IP address in the address set of N1.
N4~N25与N3的原理相似,此处不再赘述。The principles of N4 to N25 are similar to those of N3, and are not repeated here.
在更多实施例中,向当前节点返回若干第一区块链节点的第二地址集合还可以根据实际需求进行配置,例如配置为,向当前节点返回第一数量个第一区块链节点的第二地址集合,可实现相同的技术效果。进一步的,还可以对第一数量个第一区块链节点的筛选方式进行进一步限定,例如,第一数量个第一区块链节点应当为与当前节点的物理距离最近的区块链节点,又比如,第一数量个第一区块链节点应当为与当前节点的逻辑距离最近的区块链节点。In more embodiments, returning the second address set of several first blockchain nodes to the current node can also be configured according to actual requirements, for example, configured to return the first number of first blockchain nodes to the current node. The second set of addresses can achieve the same technical effect. Further, the screening method of the first number of first blockchain nodes may be further limited, for example, the first number of first blockchain nodes should be the blockchain nodes with the closest physical distance to the current node, For another example, the first number of first blockchain nodes should be the blockchain nodes with the closest logical distance to the current node.
本领域技术人员应当理解,公网和局域网的IP地址的格式可以根据实际需求进行配置,例如还可以配置为:pubIP_N1:port:PID、localIP_N1:port:PID,或,pubIP_N1:port:PID:pubkey_N1、localIP_N1:port:PID:pubkey_N1,可实现相同的技术效果。Those skilled in the art should understand that the format of the IP address of the public network and the local area network can be configured according to actual requirements, for example, it can also be configured as: pubIP_N1:port:PID, localIP_N1:port:PID, or, pubIP_N1:port:PID:pubkey_N1 , localIP_N1:port:PID:pubkey_N1, can achieve the same technical effect.
本领域技术人员应当理解,还可以根据实际需求配置存储有第二 地址集合的服务器,例如配置为第一云平台,可实现相同的技术效果。Those skilled in the art should understand that the server storing the second address set can also be configured according to actual requirements, for example, configured as the first cloud platform, which can achieve the same technical effect.
上述实施例提高了同一局域网中的区块链节点间传播数据的效率。The above embodiments improve the efficiency of data dissemination among blockchain nodes in the same local area network.
优选地,向当前节点返回若干第一区块链节点的第二地址集合包括:Preferably, returning the second address set of several first blockchain nodes to the current node includes:
收集若干区块链节点的节点连接数量信息;Collect information on the number of node connections of several blockchain nodes;
向当前节点返回若干节点连接数量不足的第一区块链节点的第二地址集合。Return to the current node the second set of addresses of the first blockchain nodes with insufficient number of node connections.
上述实施例的节点通信原理可参考图2所示的方法,此处不再赘述。For the node communication principle in the foregoing embodiment, reference may be made to the method shown in FIG. 2 , which will not be repeated here.
优选地,根据第二地址集合中的第二局域网IP地址与对应的节点建立连接,或,根据第二地址集合中的第二公网IP地址与对应的节点建立连接后,还包括:Preferably, after establishing the connection with the corresponding node according to the second local area network IP address in the second address set, or, after establishing the connection with the corresponding node according to the second public network IP address in the second address set, the method further includes:
保存第二地址集合;save the second address set;
其中,第二地址集合用于供其它区块链节点判断是否与对应的节点在同一局域网中:Among them, the second address set is used for other blockchain nodes to judge whether they are in the same local area network as the corresponding node:
是,则根据第二局域网IP地址与对应的节点建立连接;If yes, then establish a connection with the corresponding node according to the IP address of the second local area network;
否,则根据第二公网IP地址与对应的节点建立连接。If not, establish a connection with the corresponding node according to the second public network IP address.
上述实施例使得其它与当前节点处于同一局域网的区块链节点,也可以通过当前节点的局域网IP与当前节点建立连接,进一步提高了同一局域网中的区块链节点间传播数据的效率。The above embodiment enables other blockchain nodes in the same local area network as the current node to establish connections with the current node through the local area network IP of the current node, further improving the efficiency of data dissemination between blockchain nodes in the same local area network.
图3为本发明一实施例提供的一种计算机设备的结构示意图。FIG. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
如图3所示,作为另一方面,本申请还提供了一种计算机设备,包括一个或多个中央处理单元(CPU)301,其可以根据存储在只读存储器(ROM)302中的程序或者从存储部分308加载到随机访问存储器(RAM)303中的程序而执行各种适当的动作和处理。在RAM303中,还存储有计算机设备操作所需的各种程序和数据。CPU301、ROM302以及RAM303通过总线304彼此相连。输入/输出(I/O)接口305也连接至总线304。As shown in FIG. 3 , as another aspect, the present application also provides a computer device, comprising one or more central processing units (CPUs) 301 , which can operate according to a program stored in a read only memory (ROM) 302 or Various appropriate actions and processes are executed from the program loaded into the random access memory (RAM) 303 from the storage section 308 . In the RAM 303, various programs and data necessary for the operation of the computer device are also stored. The CPU 301 , the ROM 302 , and the RAM 303 are connected to each other through a bus 304 . An input/output (I/O) interface 305 is also connected to bus 304 .
以下部件连接至I/O接口305:包括键盘、鼠标等的输入部分306; 包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分307;包括硬盘等的存储部分308;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分309。通信部分309经由诸如因特网的网络执行通信处理。驱动器310也根据需要连接至I/O接口305。可拆卸介质311,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器310上,以便于从其上读出的计算机程序根据需要被安装入存储部分308。The following components are connected to the I/O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc. ; and a communication section 309 including a network interface card such as a LAN card, a modem, and the like. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I/O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.
特别地,根据本公开的实施例,上述任一实施例描述的方法可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括有形地包含在机器可读介质上的计算机程序,所述计算机程序包含用于执行上述任一方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分309从网络上被下载和安装,和/或从可拆卸介质311被安装。In particular, according to an embodiment of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing any of the methods described above. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 309 and/or installed from the removable medium 311 .
作为又一方面,本申请还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例的装置中所包含的计算机可读存储介质;也可以是单独存在,未装配入计算机设备中的计算机可读存储介质。计算机可读存储介质存储有一个或者一个以上程序,该程序被一个或者一个以上的处理器用来执行描述于本申请提供的方法。As yet another aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium may be a computer-readable storage medium included in the apparatus of the foregoing embodiment; A computer readable storage medium in a computer device. The computer-readable storage medium stores one or more programs that are used by one or more processors to perform the methods described in the present application.
附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这根据所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以通过执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以通过专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by dedicated hardware-based systems that perform the specified functions or operations , or can be implemented by a combination of dedicated hardware and computer instructions.
描述于本申请实施例中所涉及到的单元或模块可以通过软件的方 式实现,也可以通过硬件的方式来实现。所描述的单元或模块也可以设置在处理器中,例如,各所述单元可以是设置在计算机或移动智能设备中的软件程序,也可以是单独配置的硬件装置。其中,这些单元或模块的名称在某种情况下并不构成对该单元或模块本身的限定。The related units or modules described in the embodiments of the present application may be implemented in a software manner, and may also be implemented in a hardware manner. The described units or modules may also be provided in the processor, for example, each of the units may be a software program provided in a computer or a mobile smart device, or may be a separately configured hardware device. Wherein, the names of these units or modules do not constitute limitations on the units or modules themselves under certain circumstances.
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离本申请构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present application and an illustration of the applied technical principles. It should be understood by those skilled in the art that the scope of the invention involved in this application is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features. Other technical solutions formed by any combination of its equivalent features. For example, a technical solution is formed by replacing the above features with the technical features disclosed in this application (but not limited to) with similar functions.

Claims (9)

  1. 一种节点通信方法,其特征在于,所述方法适用于区块链节点,所述方法包括:A node communication method, characterized in that the method is suitable for blockchain nodes, and the method includes:
    将当前节点的各网卡IP地址保存到第一地址集合中;其中,所述网卡IP地址包括公网IP地址和局域网IP地址;Save each network card IP address of the current node in the first address set; wherein, the network card IP address includes a public network IP address and a local area network IP address;
    将所述第一地址集合广播至若干区块链节点,以供各所述区块链节点:Broadcast the first set of addresses to several blockchain nodes for each of the blockchain nodes to:
    根据所述第一地址集合判断是否与当前节点在同一局域网中:Determine whether the current node is in the same local area network according to the first address set:
    是,则根据所述局域网IP地址与当前节点建立连接;If yes, then establish a connection with the current node according to the local area network IP address;
    否,则根据所述公网IP地址与当前节点建立连接。If not, establish a connection with the current node according to the public network IP address.
  2. 根据权利要求1所述的方法,其特征在于,所述将所述第一地址集合广播至若干区块链节点包括:The method of claim 1, wherein the broadcasting the first set of addresses to several blockchain nodes comprises:
    将所述第一地址集合广播至种子节点,以供将所述第一地址集合广播至若干区块链节点。The first set of addresses is broadcast to seed nodes for broadcasting the first set of addresses to several blockchain nodes.
  3. 根据权利要求2所述的方法,其特征在于,所述将所述第一地址集合广播至若干区块链节点包括:The method of claim 2, wherein the broadcasting the first set of addresses to several blockchain nodes comprises:
    收集若干区块链节点的节点连接数量信息;Collect information on the number of node connections of several blockchain nodes;
    将所述第一地址集合广播至节点连接数量不足的若干区块链节点。Broadcasting the first set of addresses to several blockchain nodes with insufficient node connections.
  4. 根据权利要求1-4任一项所述的方法,其特征在于,所述根据所述局域网IP地址与当前节点建立连接,或,所述根据所述公网IP地址与当前节点建立连接后,还包括:The method according to any one of claims 1-4, wherein the connection is established with the current node according to the local area network IP address, or, after the connection is established with the current node according to the public network IP address, Also includes:
    保存所述第一地址集合;save the first address set;
    其中,所述第一地址集合用于供其它区块链节点判断是否与当前节点在同一局域网中:Wherein, the first address set is used for other blockchain nodes to judge whether they are in the same local area network as the current node:
    是,则根据所述局域网IP地址与当前节点建立连接;If yes, then establish a connection with the current node according to the local area network IP address;
    否,则根据所述公网IP地址与当前节点建立连接。If not, establish a connection with the current node according to the public network IP address.
  5. 一种节点通信方法,其特征在于,所述方法适用于区块链节点,所述方法包括:A node communication method, characterized in that the method is suitable for blockchain nodes, and the method includes:
    将当前节点的各网卡IP地址保存到第一地址集合中;其中,所述网卡IP地址包括公网IP地址和局域网IP地址;Save each network card IP address of the current node in the first address set; wherein, the network card IP address includes a public network IP address and a local area network IP address;
    将所述第一地址集合广播至种子节点,以供:Broadcast the first set of addresses to seed nodes for:
    保存所述第一地址集合;save the first address set;
    向当前节点返回若干第一区块链节点的第二地址集合;Return the second address set of several first blockchain nodes to the current node;
    分别对各所述第二地址集合执行如下操作:Perform the following operations on each of the second address sets respectively:
    根据所述第二地址集合判断是否与对应的节点在同一局域网中:Determine whether it is in the same local area network as the corresponding node according to the second address set:
    是,则根据所述第二地址集合中的第二局域网IP地址与对应的节点建立连接;If yes, then establish a connection with the corresponding node according to the second local area network IP address in the second address set;
    否,则根据所述第二地址集合中的第二公网IP地址与对应的节点建立连接。If not, establish a connection with the corresponding node according to the second public network IP address in the second address set.
  6. 根据权利要求5所述的方法,其特征在于,所述向当前节点返回若干第一区块链节点的第二地址集合包括:The method according to claim 5, wherein the returning the second address set of several first blockchain nodes to the current node comprises:
    收集若干区块链节点的节点连接数量信息;Collect information on the number of node connections of several blockchain nodes;
    向当前节点返回若干节点连接数量不足的第一区块链节点的第二地址集合。Return to the current node the second set of addresses of the first blockchain nodes with insufficient number of node connections.
  7. 根据权利要求5或6所述的方法,其特征在于,所述根据所述第二地址集合中的第二局域网IP地址与对应的节点建立连接,或,所述根据所述第二地址集合中的第二公网IP地址与对应的节点建立连接后,还包括:The method according to claim 5 or 6, wherein, establishing a connection with a corresponding node according to a second local area network IP address in the second address set, or, according to the second address set After establishing a connection with the corresponding node, the second public IP address of the
    保存所述第二地址集合;saving the second set of addresses;
    其中,所述第二地址集合用于供其它区块链节点判断是否与对应 的节点在同一局域网中:Wherein, the second address set is used for other blockchain nodes to judge whether it is in the same local area network as the corresponding node:
    是,则根据所述第二局域网IP地址与对应的节点建立连接;If yes, then establish a connection with the corresponding node according to the second local area network IP address;
    否,则根据所述第二公网IP地址与对应的节点建立连接。If not, establish a connection with the corresponding node according to the second public network IP address.
  8. 一种计算机设备,其特征在于,所述设备包括:A computer device, characterized in that the device comprises:
    一个或多个处理器;one or more processors;
    存储器,用于存储一个或多个程序,memory for storing one or more programs,
    当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器执行如权利要求1-7中任一项所述的方法。The one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-7.
  9. 一种存储有计算机程序的存储介质,其特征在于,该程序被处理器执行时实现如权利要求1-7中任一项所述的方法。A storage medium storing a computer program, characterized in that, when the program is executed by a processor, the method according to any one of claims 1-7 is implemented.
PCT/CN2021/143843 2021-01-11 2021-12-31 Node communication methods, computer device, and storage medium WO2022148321A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110029000.4 2021-01-11
CN202110029000.4A CN112866365A (en) 2021-01-11 2021-01-11 Node communication method, computer device, and storage medium

Publications (1)

Publication Number Publication Date
WO2022148321A1 true WO2022148321A1 (en) 2022-07-14

Family

ID=76002216

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/143843 WO2022148321A1 (en) 2021-01-11 2021-12-31 Node communication methods, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN112866365A (en)
WO (1) WO2022148321A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112866365A (en) * 2021-01-11 2021-05-28 杭州复杂美科技有限公司 Node communication method, computer device, and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297324A (en) * 2013-05-13 2013-09-11 山东省计算中心 Method for local area network positioning in instantaneous network data transmission
CN105721570A (en) * 2016-02-04 2016-06-29 福建星网锐捷通讯股份有限公司 Point to point data transmission method and device
CN108712506A (en) * 2018-05-31 2018-10-26 中国联合网络通信集团有限公司 block chain node communication method, device and block chain node
CN109314723A (en) * 2017-04-27 2019-02-05 华为技术有限公司 A kind of method, apparatus and terminal for realizing data service
CN109995660A (en) * 2017-12-29 2019-07-09 深圳市优必选科技有限公司 Flow-medium transmission method, device, terminal device and computer readable storage medium
CN112866365A (en) * 2021-01-11 2021-05-28 杭州复杂美科技有限公司 Node communication method, computer device, and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003079709A1 (en) * 2002-03-15 2003-09-25 Meshnetworks, Inc. System and method for auto-configuration and discovery of ip to mac address mapping and gateway presence
CN106559508A (en) * 2015-09-29 2017-04-05 深圳市潮流网络技术有限公司 A kind of automatic switching method of server public affairs private network IP address
CN108900601B (en) * 2018-06-27 2020-09-29 掌阅科技股份有限公司 File transfer method, computer device and storage medium
CN109363586A (en) * 2018-12-26 2019-02-22 江苏美的清洁电器股份有限公司 Sweeping robot and its communication means, device and system and mobile terminal
CN110535977B (en) * 2019-09-29 2022-04-01 深圳市网心科技有限公司 File distribution method and device, computer device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297324A (en) * 2013-05-13 2013-09-11 山东省计算中心 Method for local area network positioning in instantaneous network data transmission
CN105721570A (en) * 2016-02-04 2016-06-29 福建星网锐捷通讯股份有限公司 Point to point data transmission method and device
CN109314723A (en) * 2017-04-27 2019-02-05 华为技术有限公司 A kind of method, apparatus and terminal for realizing data service
CN109995660A (en) * 2017-12-29 2019-07-09 深圳市优必选科技有限公司 Flow-medium transmission method, device, terminal device and computer readable storage medium
CN108712506A (en) * 2018-05-31 2018-10-26 中国联合网络通信集团有限公司 block chain node communication method, device and block chain node
CN112866365A (en) * 2021-01-11 2021-05-28 杭州复杂美科技有限公司 Node communication method, computer device, and storage medium

Also Published As

Publication number Publication date
CN112866365A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
WO2023005133A1 (en) Federated learning modeling optimization method and device, and readable storage medium and program product
WO2019153490A1 (en) Method and device for real estate transaction, computer-readable storage medium, and terminal device
US8316123B2 (en) Managing boot images in a retail store environment
WO2021196768A1 (en) Transaction broadcasting method, and device and storage medium
WO2020135435A1 (en) Main chain and parallel chain architecture system, block synchronization method, device, and storage medium
CN111198751B (en) Service processing method and device
WO2017161956A1 (en) Database expansion system, equipment, and method of expanding database
US9727524B2 (en) Remote direct memory access (RDMA) optimized high availability for in-memory data storage
CN110998554B (en) Real-time cloud-based messaging system
WO2022148321A1 (en) Node communication methods, computer device, and storage medium
CN111858641A (en) Transaction processing method and device, electronic equipment and readable storage medium
WO2019041670A1 (en) Method, device and system for reducing frequency of functional page requests, and storage medium
WO2020244027A1 (en) Quality of service inspection method and system for cdn system
CN109151033B (en) Communication method and device based on distributed system, electronic equipment and storage medium
CN114513552A (en) Data processing method, device, equipment and storage medium
CN113596085A (en) Data processing method, system and device
CN111611317B (en) Block chain distributed storage grouping method, device and storage medium
EP3896931A1 (en) Spark shuffle-based remote direct memory access system and method
WO2022048409A1 (en) Performance measurement method, broadcast performance adjustment method, device, and storage medium
CN114760360B (en) Request response method, request response device, electronic equipment and computer readable storage medium
CN112988738B (en) Data slicing method and device for block chain
CN110750602A (en) Method and device for determining site to which order address belongs
CN115292635A (en) Page floor data display method, device, equipment and computer readable medium
CN116503005A (en) Method, device, system and storage medium for dynamically modifying flow
CN112804366A (en) Method and device for resolving domain name

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21917360

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21917360

Country of ref document: EP

Kind code of ref document: A1