A communication method and network system based on structured P2P relay network

The structured P2P relay network addresses efficiency drops in large-scale P2P networks by using relay nodes and relay network routing to optimize message forwarding, ensuring efficient communication across multiple P2P physical networks.

CN116232971BActive Publication Date: 2024-12-20HANGZHOU ANT KUAI TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211610725.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-14
Publication Date
2024-12-20
Estimated Expiration
2042-12-14

AI Technical Summary

Technical Problem

Structured P2P networks face efficiency drops due to large scales and excessive routing entries when the number of nodes increases, leading to inefficient message forwarding.

Method used

A structured P2P relay network is introduced, comprising relay nodes across multiple structured P2P physical networks, utilizing relay network routing tables to forward messages efficiently across these networks, maintaining high efficiency by controlling the number of nodes and using logical distances to determine routing paths.

Benefits of technology

The solution maintains high communication efficiency even with a large network scale by limiting the number of nodes and using relay nodes to optimize message forwarding, ensuring efficient communication within and across structured P2P physical networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116232971B_ABST
    Figure CN116232971B_ABST
Patent Text Reader

Abstract

The present specification provides a communication method and network system based on a structured P2P relay network, wherein the nodes in the structured P2P relay network are relay nodes in different structured P2P physical networks, and the method comprises: a first node in a first structured P2P physical network sends a communication message to a first relay node according to the shortest path based on a first physical network routing table learned in the first structured P2P physical network; the first relay node sends a communication message to a second relay node according to the shortest path based on the relay network routing table learned in the structured P2P relay network; and the second relay node sends a communication message to a second node according to the shortest path based on a second physical network routing table learned in a second structured P2P physical network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification belong to the field of computer network technology, and more particularly, to a communication method and network system based on a structured P2P relay network. Background Art

[0002] A structured P2P network is a P2P (Peer to Peer) network with a certain structure. Each node in the network has a logically determined position in the network, and the position of any node in the network determined by a preset algorithm is fixed. One advantage of a structured P2P network is that the nodes in it can follow the shortest path algorithm to forward messages while preserving limited routing entries. Therefore, the structured P2P network can be used to achieve efficient message forwarding. For example, the structured P2P network can be used as the underlying network architecture of a blockchain network that maintains NFTs (Non-Fungible Tokens) or digital collections, thereby accelerating the message forwarding efficiency in the blockchain network.

[0003] However, the actual forwarding efficiency of messages in structured P2P networks is also limited by the number of nodes in the network. If there are too many nodes in a structured P2P network, it will also lead to too many routing entries saved by a single node and low overall communication efficiency. In particular, the efficiency of small-scale communication will drop significantly due to the large scale of the network, and the original advantage of efficient forwarding of structured P2P networks cannot be brought into play. Summary of the invention

[0004] The object of the present invention is to provide a communication method and a network system based on a structured P2P relay network.

[0005] According to a first aspect of one or more embodiments of this specification, a communication method based on a structured P2P relay network is proposed, wherein nodes in the structured P2P relay network are relay nodes in different structured P2P physical networks, and the method includes:

[0006] The first node in the first structured P2P physical network sends the communication message to the first relay node in the first structured P2P physical network according to the shortest path in the first structured P2P physical network based on the first physical network routing table learned in the first structured P2P physical network;

[0007] The first relay node sends the communication message to a second relay node in a second structured P2P physical network according to the shortest path in the structured P2P relay network based on the relay network routing table learned in the structured P2P relay network;

[0008] The second relay node sends the communication message to the second node in the second structured P2P physical network along the shortest path in the second structured P2P physical network based on the second physical network routing table learned in the second structured P2P physical network.

[0009] According to a second aspect of one or more embodiments of the present specification, a communication device based on a structured P2P relay network is provided, wherein nodes in the structured P2P relay network are relay nodes in different structured P2P physical networks, and the device comprises:

[0010] The first structured P2P physical network forwarding unit is configured to enable the first node in the first structured P2P physical network to send the communication message to the first relay node in the first structured P2P physical network according to the shortest path in the first structured P2P physical network based on the first physical network routing table learned in the first structured P2P physical network;

[0011] A structured P2P relay network forwarding unit, configured to enable the first relay node to send the communication message to a second relay node in a second structured P2P physical network according to the shortest path in the structured P2P relay network based on a relay network routing table learned in the structured P2P relay network;

[0012] The second structured P2P physical network forwarding unit is used to enable the second relay node to send the communication message to the second node in the second structured P2P physical network along the shortest path in the second structured P2P physical network based on the second physical network routing table learned in the second structured P2P physical network.

[0013] According to a third aspect of one or more embodiments of this specification, a network system is provided, the network system comprising a structured P2P relay network and at least two structured P2P physical networks, wherein:

[0014] The nodes in the structured P2P relay network are relay nodes in different structured P2P physical networks, and the nodes in the structured P2P relay network are used to implement message forwarding according to the shortest path in the structured P2P relay network based on the relay network routing table learned in the structured P2P relay network;

[0015] The nodes in any structured P2P network are used to implement message forwarding according to the shortest path in any structured P2P physical network based on the physical network routing table learned in the any structured P2P physical network.

[0016] According to a fourth aspect of one or more embodiments of this specification, an electronic device is provided, including:

[0017] processor;

[0018] a memory for storing processor-executable instructions;

[0019] The processor implements the method as described in any one of the first aspects by running the executable instructions.

[0020] According to a fifth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in any one of the first aspects are implemented.

[0021] It can be seen from the above embodiments that the embodiments of this specification propose the concept of a structured P2P relay network, which is an upper-layer network built on multiple structured P2P physical networks. It closely connects multiple structured P2P physical networks together and realizes the interconnection between multiple structured P2P physical networks. Specifically, the structured P2P relay network is a structured P2P network reorganized by relay nodes in each structured P2P physical network, which also has the property of being able to efficiently forward messages within a certain network scale; the structured P2P relay network and multiple structured P2P physical networks together constitute a composite network system. Since the composite network system includes multiple structured P2P physical networks, it can accommodate more nodes and has a larger network scale as a whole. However, the network scale of the structured P2P relay network or each structured P2P physical network in the composite network system is relatively limited and controllable, and the overall communication efficiency will not be affected by the excessive number of nodes in the composite network system. For example, the structured P2P relay network at the upper layer is dedicated to message forwarding across different structured P2P physical networks, and its message forwarding efficiency is only related to the number of structured P2P physical networks. Since the number of structured P2P physical networks is much smaller than the total number of nodes in the composite network system, even if the overall network scale is large, the message forwarding efficiency within the structured P2P relay network will not be significantly affected. At the same time, the internal communication of any structured P2P physical network at the lower layer is still carried out independently by the structured P2P physical network, without the participation of the structured P2P relay network, and the message forwarding efficiency within the structured P2P physical network will not be affected by the overall larger network scale. Therefore, even if the overall number of nodes in the composite network system is large, in the process of sending a communication message from a first node in a first structured P2P physical network to a second node in a second structured P2P physical network, the sub-process of forwarding within the first structured P2P physical network, the sub-process of forwarding within the structured P2P relay network, and the sub-process of forwarding within the second structured P2P physical network involved can all maintain a relatively high message forwarding efficiency, thereby maintaining a relatively high overall communication efficiency when the overall network scale is large. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0023] Figure 1It is a schematic diagram of a logical distance between nodes in a structured P2P network provided by an exemplary embodiment.

[0024] Figure 2 It is a system architecture diagram of a network system provided by an exemplary embodiment.

[0025] Figure 3 It is a flow chart of a communication method based on a structured P2P relay network provided by an exemplary embodiment.

[0026] Figure 4 It is a structural schematic diagram of a device provided by an exemplary embodiment.

[0027] Figure 5 It is a block diagram of a communication device based on a structured P2P relay network provided by an exemplary embodiment. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0029] P2P (Peer to Peer) network is a point-to-point network; the structured P2P network described in this specification is a point-to-point network with a certain structure. Each node in the network has a logically determined position in the network, and the position of any node in the network determined by a preset algorithm is fixed.

[0030] A structured P2P network includes multiple network nodes (hereinafter referred to as nodes). Taking a structured P2P network established based on the Kademlia algorithm as an example, each node has a corresponding node identifier. The node identifier of any node can be the public key of the node or the summary of its public key (such as hash), etc. This specification does not limit this. For each node in the network, a hash function can be used to calculate the fixed-length hash value corresponding to each node identifier, so that each node identifier is mapped to each hash value. The list used to record the hash value (such as using the hash value as an index) is called a hash table. Based on the above hash value, the logical distance between each node can be further determined, and the tree distance table corresponding to each node can be drawn based on the logical distance. Of course, the hash value corresponding to each node obtained above can also be used as the node identifier of each node at the same time.

[0031] For any node, it can maintain a hash table for recording the node information of its neighboring nodes. The hash table can record the node information of other nodes with the hash value corresponding to the node identifier of each neighboring node (that is, the node identifier itself when the node identifier includes the hash value) as the index. Assume that the node identifier of each node in the structured P2P network can be converted into a three-bit binary code, where the binary codes corresponding to the node identifiers of nodes A to G are 111, 110, 101, 100, 010, 001 and 000 respectively. On this basis, for node B with a binary code of 110, its corresponding tree distance table can be found in Figure 1 , Figure 1 It is a schematic diagram of a logical distance between nodes in a structured P2P network provided by an exemplary embodiment.

[0032] like Figure 1 As shown, the logical distance between any two nodes can be calculated by calculating the binary codes corresponding to the two nodes, specifically by performing an XOR operation on the two binary codes, and taking the number of bits of the binary number after removing the high-order "0" in the obtained value as the logical distance between the two nodes. For example, the logical distance between node B and other nodes can be calculated in the following way: perform an XOR operation on "111" corresponding to node A and "110" corresponding to node B to obtain "001", remove the highest "0" in "001" to obtain the binary number "1", the number of bits of which is 1, so the logical distance between node A and node B is 1; perform an XOR operation on "111" corresponding to node C or "100" corresponding to node D and "101" corresponding to node B to obtain "010" and "011" respectively, remove the high-order "0" to obtain the binary numbers "10" and "11", the number of bits of these two binary numbers are both 2, so the logical distances between nodes C~D and node B are both 2; similarly, the logical distances between nodes E~G and node B can be calculated to be 3. Among them, when the structured P2P network is constructed based on a distributed hash table DHT (distributed hash table), and the DHT is implemented by the Kademlia algorithm, the nodes with different logical distances mentioned above can be represented by the concept of K-bucket. For example, for node B, the subtree with bucket = 1 (that is, the logical distance is 1, the same below) is the subtree where the node A on the right is located, the subtree with bucket = 2 is the subtree where nodes C~D are located, and the subtree with bucket = 3 is the subtree where nodes E~G are located.

[0033] Based on the above logical distance, node B can maintain a node list (i.e., the aforementioned hash table) locally, which can be used to record the node information of other nodes (such as node A and nodes C~G) in the structured P2P network. For example, node B can record the node information of each node in the node list according to the logical distance, and each node information therefore has a corresponding logical distance as an index, so the corresponding node information can be quickly found based on the logical distance. For example, node B can record the node information of node A in K-bucket 1, the node information of nodes C~D in K-bucket 2, and the node information of nodes E~G in K-bucket 3, so it can quickly index to the corresponding K-bucket through the logical distance and find the node information recorded therein. Among them, the node information of up to K nodes can be recorded in any K-bucket, and the specific value of K can be pre-set according to the actual situation, and this specification does not limit this.

[0034] It should be noted that after any node obtains the node information of any other node through the node discovery mechanism, it usually does not save all of it in the locally maintained node list, but calculates the logical distance between itself and the node in the aforementioned manner. If the node information of the node has been saved in the K-bucket corresponding to the logical distance or the number of saved node information has reached K, the node information will be discarded; only when the node information has not been saved in the K-bucket corresponding to the logical distance and the number of saved node information has not reached K, the node information will be saved in this K-bucket. In addition, any node can further determine the network connection status between itself and any other node based on the node information, and save the node information when the connection between the two is normal; if the connection is abnormal, the information is usually not saved.

[0035] As can be seen from the above process, the logical distance between any two nodes is determined only by their node identifiers, and has nothing to do with their actual network connection relationship (physical direct connection relationship) in the structured P2P network. Of course, the node identifiers (hash values) of each node can also be set according to the physical direct connection relationship, so that the above logical distance can also characterize the relationship between the corresponding nodes in the structured P2P network in the world network connection to a certain extent. Therefore, each node corresponding to each node information recorded in the node list of node B can be any node in the structured P2P network. Of course, in view of the fact that the recorded nodes may be used by node B for message transmission, in order to ensure the reliable transmission of messages, each node recorded in the node list of node B can also be a neighbor node of node B. The neighbor node of node B is a node with which it can establish a connection, has established a connection, or has a physical direct connection relationship. In other words, node B can communicate with its neighbor nodes. For example, when only neighbor nodes are recorded in the node list, node B can directly regard the node list as a network routing table maintained by itself, and implement message routing according to the node list. When it is necessary to forward a message, the destination node corresponding to the message is used to determine that the node is the next hop node with which it has established a connection.

[0036] It can be understood that the above process only takes nodes A to G as an example. In fact, each node in the structured P2P network can maintain its own corresponding node list. Moreover, the number of K-buckets recorded in the node list of any node can be determined according to the number of bits of the hash value after the node identifier is converted. If the node identifier of each node in the structured P2P network is 32 bits, then the logical distance between any node in node B and other nodes ranges from [1,32]. At this time, the node list of any node can record up to 32 K-buckets, and any K-bucket can record the node information of K nodes.

[0037] The node information of any other node recorded in any node may include the node identifier of any other node, the hash value corresponding to the node identifier, the network address of the node (such as IP address, port number, etc.), the identity information of the node (such as public key), etc., which is not limited in this specification. In fact, each node in the structured P2P network can determine the forwarding path according to the node list maintained separately, that is, the node list is used as a routing table, and the node information in the node list is used as a routing entry for message forwarding according to the node information recorded therein.

[0038] Normally, nodes in a structured P2P network can forward messages following the shortest path algorithm. There may be multiple forwarding paths from any node in a structured P2P network to another node, and any forwarding path may need to pass through an intermediate node, such as the forwarding path between node A and node B may be ACDEB, or ACDGFB, etc. Among the multiple forwarding paths mentioned above, the path that passes through the least number of nodes is the shortest path between the two. Obviously, the shortest path between any two nodes is the forwarding path with the least number of nodes between them, and any shortest path may have at least one intermediate node, or may not contain any intermediate node. Nodes in a structured P2P network can forward messages according to the shortest path algorithm. Specifically, when any node receives a message whose destination node is not itself, it will first calculate the logical distance between the destination node and any of the nodes, and find several (K) routing entries (node ​​information) corresponding to the logical distance in the node list maintained by itself. If there is a routing entry corresponding to the destination node among these routing entries, it will directly forward the message according to the routing entry. If there is no routing entry corresponding to the destination node among these routing entries, it will randomly select a routing entry from these routing entries for forwarding. In the above-mentioned path selection strategy (routing strategy), each time a node forwards, the logical distance to the destination node will be reduced by at least 1, so the overall forwarding efficiency can be ensured to be high, and the forwarding path generated at the same time belongs to the above-mentioned shortest path.

[0039] At the same time, it is not difficult to find that if the number of nodes in the structured P2P network is larger, the more possible logical distance values ​​there are between two nodes in the network, which means that each node needs to maintain more routing entries in the node list (because a number of routing entries will be maintained for different possible logical distance values. When the possible logical distance values ​​increase, the number of routing entries that need to be maintained will naturally increase accordingly); at the same time, the more nodes in the structured P2P network are larger, the maximum possible logical distance between two nodes in the network will be larger. Therefore, the number of nodes required to pass through when forwarding messages according to the routing strategy of the above-mentioned shortest path algorithm will increase (because each node forwarding can only ensure that the fixed logical distance with the destination node is reduced, and when the maximum logical distance in the network increases, the logical distance with the destination node is reduced to a preset threshold. In order to find the routing entry of the destination node, the number of times the logical distance is reduced is more, that is, more node forwarding processes are required), which means that the overall forwarding efficiency is lower. It can be seen that in order to avoid the problem of too many routing entries stored by a single node and low overall communication efficiency, it is necessary to control the number of nodes in the structured P2P network so that it is within a certain controllable range, so as to maintain a high communication efficiency.

[0040] At this point, the network characteristics of the structured P2P network have been introduced. Now, the network system involved in the present application and the communication method based on the structured P2P relay network will be described.

[0041] Figure 2 FIG. 1 is a system architecture diagram of a network system provided by an exemplary embodiment. Figure 2 As shown, the network system includes a structured P2P relay network and at least two structured P2P physical networks, wherein:

[0042] The nodes in the structured P2P relay network are relay nodes in different structured P2P physical networks, and the nodes in the structured P2P relay network are used to implement message forwarding according to the shortest path in the structured P2P relay network based on the relay network routing table learned in the structured P2P relay network;

[0043] The nodes in any structured P2P network are used to implement message forwarding according to the shortest path in any structured P2P physical network based on the physical network routing table learned in the any structured P2P physical network.

[0044] like Figure 2 As shown, Figure 2 The network system shown includes a structured P2P relay network and three structured P2P physical networks, wherein the structured P2P physical network 1 includes a relay node and four ordinary nodes, the structured P2P physical network 2 includes two relay nodes and three ordinary nodes, and the structured P2P physical network 3 includes three relay nodes and four ordinary nodes. The above-mentioned total of 6 relay nodes re-constitute a structured P2P network called a structured P2P relay network, that is, the 6 relay nodes included in the structured P2P relay network are respectively derived from each structured P2P physical network.

[0045] The relay nodes involved in the embodiments of this specification are nodes that are both node members of a certain structured P2P physical network and node members of a structured P2P relay network, while the common nodes involved in the embodiments of this specification are nodes other than relay nodes in the network system, specifically nodes that are only node members of a certain structured P2P physical network but not node members of a structured P2P relay network in the network system. Both relay nodes and common nodes are physically real nodes or instances.

[0046] The structured P2P relay network and any structured P2P physical network involved in the embodiments of this specification belong to the aforementioned structured P2P network and have the same properties as the structured P2P network, for example, they all have the property of efficiently forwarding messages. Figure 2As shown, each node in the structured P2P physical network 1 maintains a physical network routing table learned in the structured P2P physical network 1, so that the efficient forwarding of messages can be achieved within the structured P2P physical network 1 through the aforementioned shortest path algorithm. Similarly, the nodes in the structured P2P physical network 2 and the structured P2P physical network 3 also maintain physical network routing tables learned in their respective structured P2P physical networks, and each achieves efficient forwarding of messages within the structured P2P physical network. The message forwarding involved in each structured P2P physical network is carried out independently of each other, and its forwarding efficiency is only related to the number of nodes in each structured P2P physical network, and is not limited by the scale of the number of all nodes in the network system as a whole.

[0047] In the embodiments of the present specification, although the structured P2P relay network belongs to a structured P2P network in nature, it still has certain differences from the traditional structured P2P network: in the traditional structured P2P network, such as the structured P2P physical network, the routing strategy of each node is to calculate the logical distance between the node where the node is located and the destination node, and determine the routing entry based on the logical distance between the nodes. The routing entry only contains the node information of one node, that is, it indicates that the only node in the routing entry should be forwarded next; while the routing strategy of each relay node in the structured P2P relay network is also based on the logical distance to determine the routing entry, but each relay node calculates the logical distance between the structured P2P physical network where the node is located and the destination structured P2P physical network, and determines the routing entry based on the logical distance between the networks. Different from the traditional routing entry, the routing entry finally determined by the relay node in the structured P2P relay network may contain the node information of one or more relay nodes (the one or more relay nodes are derived from the same structured P2P physical network), that is, it indicates that the message should be forwarded to any one of the one or more relay nodes next. It can be seen that in a structured P2P relay network, the relay nodes in the same structured P2P physical network are equivalent. When the relay node performs routing based on the relay network routing table learned in the structured P2P relay network, it actually regards all relay nodes in the same structured P2P physical network as a virtual node to execute the routing strategy. Therefore, its forwarding efficiency is actually only related to the number of virtual nodes, that is, the number of structured P2P physical networks involved, and has no necessary relationship with the number of relay nodes actually included in the structured P2P relay network. Of course, the message forwarding efficiency involved in the structured P2P relay network will not be limited by the scale of all nodes in the network system as a whole. Each relay node in the structured P2P relay network maintains the relay network routing table learned in the structured P2P relay network, so as to realize efficient message forwarding within the structured P2P relay network.

[0048] Each node in any structured P2P physical network knows the network address of the relay node in the structured P2P physical network and the network identifier of the structured P2P physical network. When a node needs to send a communication message to a node in other structured P2P networks outside the structured P2P physical network, the communication message must first be sent to the relay node in the structured P2P physical network, and then forwarded by the relay node.

[0049] The embodiment of this specification proposes the concept of a structured P2P relay network, which is an upper layer network built on multiple structured P2P physical networks. It closely connects multiple structured P2P physical networks together and realizes the interconnection between multiple structured P2P physical networks. Specifically, the structured P2P relay network is a structured P2P network reorganized by relay nodes in each structured P2P physical network, which also has the property of being able to efficiently forward messages within a certain network scale; the structured P2P relay network and multiple structured P2P physical networks together constitute a composite network system. Since the composite network system includes multiple structured P2P physical networks, it can accommodate more nodes and has a larger network scale as a whole. However, the network scale of the structured P2P relay network or each structured P2P physical network in the composite network system is relatively limited and controllable, and the overall communication efficiency will not be affected by the excessive number of nodes in the composite network system. Next, a method for implementing a communication method based on a structured P2P relay network involved in the embodiment of this specification is introduced in detail.

[0050] See also Figure 3 , Figure 3 FIG. 1 is a flow chart of a communication method based on a structured P2P relay network provided by an exemplary embodiment. Figure 2 As shown, the nodes in the structured P2P relay network are relay nodes in different structured P2P physical networks. Figure 3 As shown, the method includes:

[0051] S302: The first node in the first structured P2P physical network sends the communication message to the first relay node in the first structured P2P physical network along the shortest path in the first structured P2P physical network based on the first physical network routing table learned in the first structured P2P physical network.

[0052] In an embodiment of the present specification, the index of any routing entry contained in the physical network routing table learned by any node in any structured P2P physical network in the structured P2P relay network includes: the logical distance between the node and the node corresponding to the routing entry, and the content of the routing entry includes: the network address of the node corresponding to the routing entry. For example, the range of nodes corresponding to the routing entry in the physical network routing table learned by any node in the first structured P2P physical network in the first structured P2P physical network does not exceed the nodes in the first structured P2P physical network, which means that the physical network routing table learned in the first structured P2P physical network can only be used to guide the routing forwarding of internal messages in the first structured P2P physical network. Similarly, the range of nodes corresponding to the routing entry in the physical network routing table learned by any node in the second structured P2P physical network in the second structured P2P physical network does not exceed the nodes in the second structured P2P physical network, which means that the physical network routing table learned in the second structured P2P physical network can only be used to guide the routing forwarding of internal messages in the second structured P2P physical network.

[0053] In an embodiment of the present specification, the communication message includes a network identifier corresponding to the second structured P2P physical network as a destination network identifier, and a node identifier corresponding to the second node as a destination node identifier. The communication message is sent to the first relay node in the first structured P2P physical network according to the shortest path in the first structured P2P physical network, including: when it is determined that the destination network identifier is not the network identifier corresponding to the first structured P2P physical network, the communication message is sent to the first relay node according to the shortest path in the first structured P2P physical network; the method also includes: when it is determined that the destination network identifier is the network identifier corresponding to the first structured P2P physical network, based on the first physical network routing table, the communication message is sent to the second node corresponding to the destination node identifier in the first structured P2P physical network according to the shortest path in the first structured P2P physical network. When the first node needs to send a communication message, it will first learn the structured P2P physical network where the communication message should eventually arrive based on the destination network identifier carried in the communication message, and only when the destination network identifier is not the network identifier corresponding to the first structured P2P physical network, will the communication message be sent to the first relay node based on the pre-maintained network address of the first relay node. Otherwise, when the destination network identifier is the network identifier corresponding to the first structured P2P physical network, it means that the communication message is only sent to the second node inside the first structured P2P physical network, so it is suitable for communication inside the first structured P2P physical network, and is directly sent to the second node corresponding to the destination node identifier in the first structured P2P physical network according to the shortest path in the first structured P2P physical network, without the participation of the structured P2P relay network, with high forwarding efficiency, and will not affect the message forwarding efficiency inside the structured P2P physical network due to the overall larger network scale.

[0054] In an embodiment of the present specification, the sending of the communication message to the first relay node in the first structured P2P physical network according to the shortest path in the first structured P2P physical network includes: searching for at least one corresponding routing entry in the first physical network routing table based on the logical distance between the first node and the first relay node, sending the communication message to a node corresponding to any routing entry in the at least one routing entry, and the network path between the first node and the node corresponding to any routing entry is included in the shortest path between the first node and the first relay node in the first structured P2P physical network.

[0055] by Figure 1For example, assume that node 1 is the first node, node 2 is the first relay node, node 3 is the second relay node, and node 4 is the second node. After node 1 obtains the communication message, it will first check the target network identifier included therein, and find that the target network identifier is the network identifier of the structured P2P physical network 2, which is different from the network identifier of the structured P2P physical network 1 where node 1 is located. This means that the communication message needs to be communicated across networks, so the communication message is sent to node 2, which is a relay node in the structured P2P physical network 1, by default. Next, node 1 needs to execute a routing strategy to determine how to send the communication message to node 2. Each routing entry in the first physical network routing table maintained by node 1 contains an index about the logical distance. The logical distance corresponding to any routing entry is the logical distance between any node and the node corresponding to any routing entry. Therefore, when node 1 searches for a routing entry in the first physical network routing table, it can calculate the logical distance between node 1 and node 2, and then first index the corresponding one or more routing entries (such as the corresponding K-bucket) through the logical distance, and then select one of the one or more routing entries as the basis for forwarding the communication message, and the routing entry stores the network address of the next hop node. Finally, node 1 can send the communication message to the node corresponding to the routing entry based on the found routing entry. The above process is based on the routing entries determined by the shortest path algorithm, so the network path between the first node and the node corresponding to any routing entry is included in the shortest path between the first node and the first relay node in the first structured P2P physical network.

[0056] In the embodiments of the present specification, the structured P2P relay network, the first structured P2P physical network, the second structured P2P physical network or any other structured P2P physical network all belong to the structured P2P network mentioned above in the present specification. Among them, any structured P2P physical network includes at least one relay node to be used as a node member of the structured P2P relay network, and the routing strategy of the nodes in any structured P2P physical network is based on the logical distance between the nodes; the nodes included in the structured P2P relay network are all relay nodes belonging to each structured P2P physical network, and since the number of relay nodes in any structured P2P physical network may be one or more, the number of relay nodes from different structured P2P physical networks in the structured P2P relay network may be different. The routing strategy of the nodes in the structured P2P relay network is based on the logical distance between the structured P2P physical networks.

[0057] In one embodiment, the logical distance between any two nodes is determined by performing an XOR operation on the node identifiers corresponding to the two nodes. The node identifier corresponding to any node is composed of a binary code with a fixed number of bits. The node identifiers corresponding to different nodes are different. Each node in any structured P2P physical network maintains the node identifier of the relay node in the structured P2P physical network. As mentioned above, in a structured P2P network, the node identifier corresponding to the node can be determined when the node joins the network, and the node identifier of the node will not change thereafter. For example, the node identifier of each node is set to a binary code with a fixed number of bits. In this way, the XOR value of the node identifiers corresponding to any two nodes can be calculated, and the number of bits of the binary number after the XOR value eliminates the high bit 0 is used as the logical distance between the two nodes. This method is also a general networking method based on the Kademlia algorithm, which will not be repeated here. Each node in any structured P2P physical network maintains the node identification of the relay node in the structured P2P physical network, so that when a communication message needs to be sent across the network, the logical distance can be calculated based on the node identification of the relay node in the structured P2P physical network and the subsequent routing strategy can be executed.

[0058] In another embodiment, the logical distance between any two nodes is determined by performing a similarity operation on the word vector features corresponding to the two nodes, and the word vector features corresponding to any node are generated by a semantic model, and the semantic model is generated by training the network path contained in the structured P2P network, and any network path is composed of a directed node sequence, and the nodes adjacent to each other on the node sequence are physically directly connected. In the embodiment of this specification, each node in any structured P2P physical network is assigned a dynamically changing word vector feature as the basis for calculating the logical distance between any two nodes. The word vector feature is obtained by training a semantic model (such as a word2vec model). During the training process of the semantic model, the network path contained in any structured P2P physical network is trained as a sentence in the training set, where the network path refers to a physically directly connected node sequence, and the nodes on the node sequence are represented by text codes. For example, the training set may include: ABGDC, GCDBDE, DCBCGE..., where the letter text is used to represent the node, and the adjacent nodes indicate that the two nodes are physically directly connected. The network paths in the above training set are randomly generated from the physical network architecture of the entire structured P2P physical network after obtaining it. These network paths can be looped or even repeated, and the length of each network path is unlimited. By sending the network paths in the structured P2P network as "sentences" into the semantic model for training, the word vector features corresponding to each node (i.e., each text code, such as A, B, C, etc.) are obtained after multiple iterations. There is a certain connection between the word vector features generated by these semantic models in the semantic space, and this connection can be extracted through similarity operations. Since the "sentences" used in training the semantic model are essentially a set of expressions of the physical connection relationships of any structured P2P physical network, the word vector features corresponding to each node finally obtained will also contain information about their respective feature positions in any structured P2P physical network, and the feature positions corresponding to nodes with similar word vector features in any structured P2P physical network (including actual physical positions, topological connection relationships with other nodes, etc.) are also similar, that is, the semantic space where the word vector features of each node are located has internalized the physical connection relationships of the structured P2P physical network to a certain extent, so that the logical distance between different nodes can be judged by judging the similarity of the word vector features corresponding to different nodes, and the nodes with closer logical distances have closer feature positions in any structured P2P physical network, and the two are generally physically closer.Since any structured P2P physical network may have new nodes added, the network architecture of any structured P2P physical network may change, which will affect the network connection relationship between each node and ultimately affect the word vector features corresponding to each node. Therefore, the word vector features of any node involved in this embodiment will be in dynamic change, which also means that the routing table maintained by any node will also be updated according to the constantly changing logical distance between it and other nodes.

[0059] Any structured P2P physical network or the structured P2P relay network described in this specification may be constructed based on algorithms such as Kademlia, Chord, Pastry, and Tapestry, and this specification does not limit this.

[0060] In addition, any structured P2P physical network can be a blockchain network, in which case the nodes in any structured P2P network are blockchain nodes in the blockchain network. Any node can also be implemented as a P2P module in the corresponding blockchain node. And, the first structured P2P physical network and the second structured P2P physical network belong to the same or different blockchain networks. When the first structured P2P physical network and the second structured P2P physical network belong to the same blockchain network, the network system involved in the embodiments of this specification can achieve efficient communication within the same blockchain network; when the first structured P2P physical network and the second structured P2P physical network belong to different blockchain networks, the network system involved in the embodiments of this specification can achieve efficient communication within each blockchain network, as well as efficient cross-chain communication between different blockchain networks. When any structured P2P physical network is used as a blockchain network, NFT or digital collections can be maintained, that is, a trusted digital rights certificate with unique characteristics in the blockchain network, which is a data object with multi-dimensional and complex attributes that can be recorded and processed on the blockchain. Since NFT or digital collections have tradable attributes and NFT or digital collections rely on the infrastructure of the blockchain network, the embodiments of this specification optimize the communication of the blockchain network, which means that the efficiency of NFT or digital collections in various links such as production, maintenance and trading can be improved.

[0061] S304: The first relay node sends the communication message to a second relay node in a second structured P2P physical network along the shortest path in the structured P2P relay network based on the relay network routing table learned in the structured P2P relay network.

[0062] In an embodiment of the present specification, the index of any routing entry contained in the relay network routing table learned by any relay node in the structured P2P relay network includes: the logical distance between the structured P2P physical network to which any relay node belongs and the structured P2P physical network corresponding to any routing entry, and the content of any routing entry includes: the network address of the relay node in the structured P2P physical network corresponding to any routing entry.

[0063] The range of nodes corresponding to the routing entries in the relay network routing table learned by any node in the structured P2P relay network does not exceed the nodes in the structured P2P relay network, which means that the relay network routing table learned in the structured P2P relay network can only be used to guide the routing forwarding of messages within the structured P2P relay network. The content of any routing entry in any relay network routing table includes: the network addresses of all relay nodes in the structured P2P physical network corresponding to the any routing entry, which means that a routing entry may contain the network addresses of multiple relay nodes. When the first relay node executes the routing strategy and finally determines the routing entry, it can randomly select from the routing entry or select any relay node according to the preset rules as the node to be sent to the next hop.

[0064] In an embodiment of the present specification, the sending of the communication message to the second relay node in the second structured P2P physical network according to the shortest path in the structured P2P relay network includes: searching for at least one corresponding routing entry in the relay network routing table based on the logical distance between the first structured P2P physical network and the second structured P2P physical network, sending the communication message to the relay node corresponding to any routing entry in the at least one routing entry, and the network path between the first relay node and the relay node corresponding to any routing entry is included in the shortest path between the first relay node and the second relay node in the second structured P2P relay network.

[0065] Similar to the logical distance between nodes, the logical distance between any two structured P2P physical networks is determined by performing an XOR operation on the network identifiers corresponding to the two structured P2P physical networks. The network identifier corresponding to any structured P2P physical network is composed of a fixed-bit binary code, and the network identifiers corresponding to different structured P2P physical networks are different. In a structured P2P relay network, when a node joins the network, as an alternative to determining a corresponding node identifier for the node, the node can maintain a corresponding network identifier, which is the network identifier corresponding to the structured P2P physical network where the node is located. After that, the network identifier corresponding to the node will not change again, so the network identifiers maintained by the relay nodes in the same structured P2P physical network are the same. For example, the network identifier corresponding to each structured P2P physical network is set to a fixed-bit binary code. In this way, the XOR value of the network identifiers corresponding to any two structured P2P physical networks can be calculated, and the number of bits of the binary number after the XOR value eliminates the high bit 0 is used as the logical distance between the two structured P2P physical networks.

[0066] by Figure 1For example, assume that node 1 is the first node, node 2 is the first relay node, node 3 is the second relay node, and node 4 is the second node. After obtaining the communication message, node 2 will first check the target network identifier included therein, and find that the target network identifier is the network identifier of the structured P2P physical network 2, so it is determined that the communication message needs to be sent to the relay node in the structured P2P physical network 2. Next, node 2 needs to execute the routing strategy to determine how to send the communication message to the relay node in the structured P2P physical network 2. Each routing entry in the relay network routing table maintained by node 2 contains an index about the logical distance. The logical distance corresponding to any routing entry is the logical distance between the structured P2P physical network to which any node belongs and the structured P2P physical network corresponding to any routing entry. Therefore, when node 2 searches for routing entries in the relay network routing table, it can calculate the logical distance between the structured P2P physical network 1 to which node 2 belongs and the structured P2P physical network 2, and then first index the corresponding one or more routing entries (such as the corresponding K-bucket) through the logical distance, and then select one of the one or more routing entries as the basis for forwarding the communication message. The content of the routing entry may contain the network addresses of multiple nodes, and one of the nodes can be randomly selected as the next hop node to be sent. Finally, node 2 can send the communication message to any relay node corresponding to the routing entry based on the found routing entry. The above process is based on the routing entry determined by the shortest path algorithm, so the network path between the first relay node and the relay node corresponding to any routing entry is included in the shortest path between the first relay node and the second relay node in the second structured P2P relay network.

[0067] S306: The second relay node sends the communication message to the second node in the second structured P2P physical network along the shortest path in the second structured P2P physical network based on the second physical network routing table learned in the second structured P2P physical network.

[0068] In an embodiment of the present specification, the sending of the communication message to the second node in the second structured P2P physical network according to the shortest path in the second structured P2P physical network includes: searching for at least one corresponding routing entry in the second physical network routing table based on the logical distance between the second relay node and the second node, sending the communication message to a node corresponding to any routing entry in the at least one routing entry, and the network path between the second relay node and the node corresponding to any routing entry is included in the shortest path between the second relay node and the second node in the second structured P2P physical network.

[0069] by Figure 1For example, assume that node 1 is the first node, node 2 is the first relay node, node 3 is the second relay node, and node 4 is the second node. After obtaining the communication message, node 3 will first check the target network identifier included therein, and find that the target network identifier is the network identifier of the structured P2P physical network 2, which is the same as the network identifier of the structured P2P physical network 2 where node 3 is located. This means that the communication message only involves the communication within the structured P2P physical network 2, so the destination node identifier included in the communication message is further checked, and it is found that the communication message needs to be sent to node 4 in the structured P2P physical network 2. Next, node 3 needs to execute the routing strategy to determine how to send the communication message to node 4. Each routing entry in the second physical network routing table maintained by node 3 contains an index about the logical distance. The logical distance corresponding to any routing entry is the logical distance between any node and the node corresponding to any routing entry. Therefore, when node 3 searches for routing entries in the second physical network routing table, it can calculate the logical distance between node 3 and node 4, and then first index the corresponding one or more routing entries (such as the corresponding K-bucket) through the logical distance, and then select one of the one or more routing entries as the basis for forwarding the communication message, and the network address of the next hop node is stored in the routing entry. Finally, node 3 can send the communication message to the node corresponding to the routing entry based on the found routing entry. The above process is based on the routing entries determined by the shortest path algorithm, so the network path between the second relay node and the node corresponding to any routing entry is included in the shortest path between the second relay node and the second node in the second structured P2P physical network.

[0070] In the embodiments of this specification, the number of nodes corresponding to any structured P2P physical network does not exceed the performance threshold corresponding to the structured P2P physical network, and the number of structured P2P physical networks to which the relay nodes in the structured P2P relay network belong does not exceed the performance threshold. As mentioned above, the forwarding efficiency of a structured P2P network is affected by the number of its nodes. The more nodes a structured P2P network has, the slower the forwarding efficiency of its internal messages. In order to give full play to the advantages of the original efficient forwarding of the structured P2P network, while ensuring that the structured P2P network has a suitable network scale, it is necessary to balance the network scale with the forwarding efficiency. The embodiments of this specification propose the concept of a performance threshold corresponding to a structured P2P physical network, which refers to the number of nodes that cannot be exceeded in a structured P2P network in order to maintain a relatively efficient forwarding efficiency. When the number of nodes in a structured P2P network exceeds this performance threshold, the forwarding efficiency will be greatly affected. When the number of nodes in a structured P2P network does not exceed this performance threshold, a high forwarding efficiency can be maintained. Since the structured P2P relay network executes the routing strategy based on the logical distance between the structured P2P physical networks, its forwarding efficiency is only related to the number of virtual nodes it contains (i.e., the structured P2P physical network to which the relay nodes in the structured P2P relay network belong). Therefore, for the structured P2P relay network, it is only necessary to limit the number of its virtual nodes to not exceed the performance threshold to maintain a high forwarding efficiency within the structured P2P relay network. For example, as an empirical value, the performance threshold corresponding to the structured P2P physical network can be set to 1024, and the number of nodes corresponding to any structured P2P physical network can be set to the performance threshold corresponding to the structured P2P physical network, and the number of structured P2P physical networks to which the relay nodes in the structured P2P relay network belong can be set to the performance threshold. This can maintain the overall high forwarding efficiency of the network system while making the total number of nodes in the network system reach 1024*1024=1048576, thus realizing a million-scale network system with high forwarding efficiency.

[0071] It can be seen from the above embodiments that the embodiments of this specification propose the concept of a structured P2P relay network, which is an upper-layer network built on multiple structured P2P physical networks. It closely connects multiple structured P2P physical networks together and realizes the interconnection between multiple structured P2P physical networks. Specifically, the structured P2P relay network is a structured P2P network reorganized by relay nodes in each structured P2P physical network, which also has the property of being able to efficiently forward messages within a certain network scale; the structured P2P relay network and multiple structured P2P physical networks together constitute a composite network system. Since the composite network system includes multiple structured P2P physical networks, it can accommodate more nodes and has a larger network scale as a whole. However, the network scale of the structured P2P relay network or each structured P2P physical network in the composite network system is relatively limited and controllable, and the overall communication efficiency will not be affected by the excessive number of nodes in the composite network system. For example, the structured P2P relay network at the upper layer is dedicated to message forwarding across different structured P2P physical networks, and its message forwarding efficiency is only related to the number of structured P2P physical networks. Since the number of structured P2P physical networks is much smaller than the total number of nodes in the composite network system, even if the overall network scale is large, the message forwarding efficiency within the structured P2P relay network will not be significantly affected. At the same time, the internal communication of any structured P2P physical network at the lower layer is still carried out independently by the structured P2P physical network, without the participation of the structured P2P relay network, and the message forwarding efficiency within the structured P2P physical network will not be affected by the overall larger network scale. Therefore, even if the overall number of nodes in the composite network system is large, in the process of sending a communication message from a first node in a first structured P2P physical network to a second node in a second structured P2P physical network, the sub-process of forwarding within the first structured P2P physical network, the sub-process of forwarding within the structured P2P relay network, and the sub-process of forwarding within the second structured P2P physical network involved can all maintain a relatively high message forwarding efficiency, thereby maintaining a relatively high overall communication efficiency when the overall network scale is large.

[0072] Optionally, the relay nodes in any structured P2P physical network will be periodically replaced with other nodes in the structured P2P physical network to synchronously update the node members corresponding to the structured P2P relay network. In the embodiments of the present specification, any structured P2P physical network will periodically or regularly replace the relay nodes based on the node maintenance protocol adopted by the structured P2P physical network. For any structured P2P physical network, the replacement of the relay nodes will not involve changes in the network structure; while for the structured P2P relay network, the replacement of the relay nodes also means the change of the corresponding node members. Therefore, the structured P2P relay network also adopts the corresponding node maintenance protocol to respond to and process the exit of the old relay nodes and the addition of the new relay nodes in real time. Through the embodiments of the present specification, the network architecture of the structured P2P relay network can be changed regularly and flexibly, so that the comprehensive forwarding performance can be flexibly adjusted according to the needs and the adaptive maintenance of the network can be realized.

[0073] Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 4 At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and may also include hardware required for other services. One or more embodiments of this specification may be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0074] like Figure 5 As shown, Figure 5 is a block diagram of a communication device based on a structured P2P relay network provided by an exemplary embodiment, and the device can be applied to Figure 4 The nodes in the structured P2P relay network are relay nodes in different structured P2P physical networks, and the device includes:

[0075] The first structured P2P physical network forwarding unit 501 is used to enable the first node in the first structured P2P physical network to send the communication message to the first relay node in the first structured P2P physical network along the shortest path in the first structured P2P physical network based on the first physical network routing table learned in the first structured P2P physical network.

[0076] The structured P2P relay network forwarding unit 502 is used to enable the first relay node to send the communication message to the second relay node in the second structured P2P physical network along the shortest path in the structured P2P relay network based on the relay network routing table learned in the structured P2P relay network.

[0077] The second structured P2P physical network forwarding unit 503 is used to enable the second relay node to send the communication message to the second node in the second structured P2P physical network along the shortest path in the second structured P2P physical network based on the second physical network routing table learned in the second structured P2P physical network.

[0078] Optionally, the index of any routing entry contained in the physical network routing table learned by any node in any structured P2P physical network in any structured P2P relay network includes: a logical distance between the any node and a node corresponding to the any routing entry, and the content of the any routing entry includes: a network address of the node corresponding to the any routing entry;

[0079] The index of any routing entry contained in the relay network routing table learned by any relay node in the structured P2P relay network includes: the logical distance between the structured P2P physical network to which any relay node belongs and the structured P2P physical network corresponding to any routing entry, and the content of any routing entry includes: the network address of the relay node in the structured P2P physical network corresponding to any routing entry.

[0080] Optionally, the first structured P2P physical network forwarding unit 501 is specifically used to:

[0081] Searching for at least one corresponding routing entry in the first physical network routing table based on the logical distance between the first node and the first relay node, sending the communication message to a node corresponding to any routing entry in the at least one routing entry, wherein the network path between the first node and the node corresponding to any routing entry is included in the shortest path between the first node and the first relay node in the first structured P2P physical network;

[0082] The second structured P2P physical network forwarding unit 503 is specifically used for:

[0083] Based on the logical distance between the second relay node and the second node, at least one corresponding routing entry is searched in the second physical network routing table, and the communication message is sent to the node corresponding to any routing entry in the at least one routing entry. The network path between the second relay node and the node corresponding to any routing entry is included in the shortest path between the second relay node and the second node in the second structured P2P physical network.

[0084] Optionally, the second structured P2P physical network forwarding unit 503 is specifically configured to:

[0085] Based on the logical distance between the first structured P2P physical network and the second structured P2P physical network, at least one corresponding routing entry is searched in the relay network routing table, and the communication message is sent to the relay node corresponding to any routing entry in the at least one routing entry, and the network path between the first relay node and the relay node corresponding to any routing entry is included in the shortest path between the first relay node and the second relay node in the second structured P2P relay network.

[0086] Optionally, the logical distance between any two nodes is determined by performing an exclusive OR operation on node identifiers corresponding to the any two nodes, the node identifier corresponding to any node is composed of a binary code with a fixed number of bits, and the node identifiers corresponding to different nodes are different, and each node in any structured P2P physical network maintains the node identifier of a relay node in the any structured P2P physical network; or,

[0087] The logical distance between any two nodes is determined by performing a similarity operation on the word vector features corresponding to the any two nodes respectively. The word vector features corresponding to any node are generated by a semantic model, and the semantic model is generated by training the network path contained in the structured P2P network. Any network path is composed of a directed node sequence, and the nodes adjacent to each other in the node sequence are physically directly connected.

[0088] Optionally, the logical distance between any two structured P2P physical networks is determined by performing an exclusive OR operation on the network identifiers corresponding to the any two structured P2P physical networks. The network identifier corresponding to any structured P2P physical network is composed of a binary code with a fixed number of bits, and the network identifiers corresponding to different structured P2P physical networks are different.

[0089] Optionally, the communication message includes a network identifier corresponding to the second structured P2P physical network as a destination network identifier, and a node identifier corresponding to the second node as a destination node identifier.

[0090] Optionally, the first structured P2P physical network forwarding unit 501 is specifically used to:

[0091] When it is determined that the destination network identifier is not the network identifier corresponding to the first structured P2P physical network, sending the communication message to the first relay node according to the shortest path in the first structured P2P physical network;

[0092] The device also includes: a destination network identifier determination unit 504, which is used to send the communication message to the second node corresponding to the destination node identifier in the first structured P2P physical network according to the shortest path in the first structured P2P physical network based on the first physical network routing table when it is determined that the destination network identifier is the network identifier corresponding to the first structured P2P physical network.

[0093] Optionally, the relay nodes in any structured P2P physical network may be periodically replaced with other nodes in the structured P2P physical network to synchronously update the node members corresponding to the structured P2P relay network.

[0094] Optionally, the number of nodes corresponding to any structured P2P physical network does not exceed a performance threshold corresponding to the structured P2P physical network, and the number of structured P2P physical networks to which relay nodes in the structured P2P relay network belong does not exceed the performance threshold.

[0095] Optionally, the first structured P2P physical network and the second structured P2P physical network belong to the same or different blockchain networks.

[0096] Optionally, any structured P2P physical network or the structured P2P relay network is constructed using a Kademlia algorithm.

[0097] The above-mentioned device embodiment corresponds to the above-mentioned method embodiment, and there is no essential difference between them. The detailed description is recorded in the above-mentioned corresponding method embodiment and will not be repeated here.

[0098] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0099] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0100] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, the present invention does not exclude that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0101] Although one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.

[0102] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0103] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0104] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0105] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0106] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0107] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0108] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0109] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0110] One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0111] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.

[0112] The above description is only an example of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included in the scope of the claims.

Claims

1. A communication method based on a structured P2P relay network, wherein the nodes in the structured P2P relay network are relay nodes in different structured P2P physical networks, the method comprising: The first node in the first structured P2P physical network sends the communication message to the first relay node in the first structured P2P physical network according to the shortest path in the first structured P2P physical network based on the first physical network routing table learned in the first structured P2P physical network; The first relay node sends the communication message to a second relay node in a second structured P2P physical network according to the shortest path in the structured P2P relay network based on the relay network routing table learned in the structured P2P relay network; The second relay node sends the communication message to the second node in the second structured P2P physical network along the shortest path in the second structured P2P physical network based on the second physical network routing table learned in the second structured P2P physical network.

2. According to the method of claim 1, the index of any routing entry contained in the physical network routing table learned by any node in any structured P2P physical network in the any structured P2P relay network includes: The logical distance between the any node and the node corresponding to the any routing entry, the content of the any routing entry including: the network address of the node corresponding to the any routing entry; The index of any routing entry contained in the relay network routing table learned by any relay node in the structured P2P relay network includes: the logical distance between the structured P2P physical network to which any relay node belongs and the structured P2P physical network corresponding to any routing entry, and the content of any routing entry includes: the network address of the relay node in the structured P2P physical network corresponding to any routing entry.

3. The method according to claim 2, wherein sending the communication message to the first relay node in the first structured P2P physical network according to the shortest path in the first structured P2P physical network comprises: Searching for at least one corresponding routing entry in the first physical network routing table based on the logical distance between the first node and the first relay node, sending the communication message to a node corresponding to any routing entry in the at least one routing entry, wherein the network path between the first node and the node corresponding to any routing entry is included in the shortest path between the first node and the first relay node in the first structured P2P physical network; The sending of the communication message to a second node in the second structured P2P physical network according to the shortest path in the second structured P2P physical network includes: Based on the logical distance between the second relay node and the second node, at least one corresponding routing entry is searched in the second physical network routing table, and the communication message is sent to the node corresponding to any routing entry in the at least one routing entry. The network path between the second relay node and the node corresponding to any routing entry is included in the shortest path between the second relay node and the second node in the second structured P2P physical network.

4. The method according to claim 2, wherein sending the communication message to a second relay node in a second structured P2P physical network according to the shortest path in the structured P2P relay network comprises: Based on the logical distance between the first structured P2P physical network and the second structured P2P physical network, at least one corresponding routing entry is searched in the relay network routing table, and the communication message is sent to the relay node corresponding to any routing entry in the at least one routing entry, and the network path between the first relay node and the relay node corresponding to any routing entry is included in the shortest path between the first relay node and the second relay node in the second structured P2P relay network.

5. According to the method of claim 2, the logical distance between any two nodes is determined by performing an exclusive OR operation on the node identifiers corresponding to the two nodes, the node identifier corresponding to any node is composed of a binary code with a fixed number of bits, and the node identifiers corresponding to different nodes are different, and each node in any structured P2P physical network maintains the node identifier of the relay node in the structured P2P physical network; or, The logical distance between any two nodes is determined by performing a similarity operation on the word vector features corresponding to the any two nodes respectively. The word vector features corresponding to any node are generated by a semantic model, and the semantic model is generated by training the network path contained in the structured P2P network. Any network path is composed of a directed node sequence, and the nodes adjacent to each other in the node sequence are physically directly connected.

6. According to the method described in claim 2, the logical distance between any two structured P2P physical networks is determined by performing an exclusive OR operation on the network identifiers corresponding to the two structured P2P physical networks respectively. The network identifier corresponding to any structured P2P physical network is composed of a binary code with a fixed number of bits, and the network identifiers corresponding to different structured P2P physical networks are different.

7. According to the method of claim 1, the communication message includes a network identifier corresponding to the second structured P2P physical network as a destination network identifier, and a node identifier corresponding to the second node as a destination node identifier.

8. The method according to claim 7, wherein sending the communication message to the first relay node in the first structured P2P physical network according to the shortest path in the first structured P2P physical network comprises: When it is determined that the destination network identifier is not the network identifier corresponding to the first structured P2P physical network, sending the communication message to the first relay node according to the shortest path in the first structured P2P physical network; The method also includes: when it is determined that the destination network identifier is a network identifier corresponding to the first structured P2P physical network, based on the first physical network routing table, sending the communication message to a second node corresponding to the destination node identifier in the first structured P2P physical network along the shortest path in the first structured P2P physical network.

9. According to the method of claim 1, the relay nodes in any structured P2P physical network are periodically replaced with other nodes in the structured P2P physical network to synchronously update the node members corresponding to the structured P2P relay network.

10. According to the method of claim 1, the number of nodes corresponding to any structured P2P physical network does not exceed a performance threshold corresponding to the structured P2P physical network, and the number of structured P2P physical networks to which relay nodes in the structured P2P relay network belong does not exceed the performance threshold.

11. According to the method of claim 1, the first structured P2P physical network and the second structured P2P physical network belong to the same or different blockchain networks.

12. The method according to claim 1, wherein any structured P2P physical network or the structured P2P relay network is constructed by using a Kademlia algorithm.

13. A communication device based on a structured P2P relay network, wherein nodes in the structured P2P relay network are relay nodes in different structured P2P physical networks, the device comprising: The first structured P2P physical network forwarding unit is configured to enable the first node in the first structured P2P physical network to send the communication message to the first relay node in the first structured P2P physical network according to the shortest path in the first structured P2P physical network based on the first physical network routing table learned in the first structured P2P physical network; A structured P2P relay network forwarding unit, configured to enable the first relay node to send the communication message to a second relay node in a second structured P2P physical network according to the shortest path in the structured P2P relay network based on a relay network routing table learned in the structured P2P relay network; The second structured P2P physical network forwarding unit is used to enable the second relay node to send the communication message to the second node in the second structured P2P physical network along the shortest path in the second structured P2P physical network based on the second physical network routing table learned in the second structured P2P physical network.

14. A network system, comprising a structured P2P relay network and at least two structured P2P physical networks, wherein: The nodes in the structured P2P relay network are relay nodes in different structured P2P physical networks, and the nodes in the structured P2P relay network are used to implement message forwarding according to the shortest path in the structured P2P relay network based on the relay network routing table learned in the structured P2P relay network; The nodes in any structured P2P network are used to implement message forwarding according to the shortest path in any structured P2P physical network based on the physical network routing table learned in the any structured P2P physical network.

15. An electronic device, comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 12 by running the executable instructions.

16. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Method for sending message, access routing node device and data cache system

    CN101741715A

  • Alliance chain communication method and system based on shortest path algorithm

    CN113923155A

  • Method and device for optimizing structured P2P network

    CN115277540A

  • Inter-web application communication method using p2p, network system for achieving the same method, cache server and its program, and web server and its program

    JP2010198116A