WO2024021412A1 - 结构化p2p网络优化 - Google Patents

结构化p2p网络优化 Download PDF

Info

Publication number
WO2024021412A1
WO2024021412A1 PCT/CN2022/135297 CN2022135297W WO2024021412A1 WO 2024021412 A1 WO2024021412 A1 WO 2024021412A1 CN 2022135297 W CN2022135297 W CN 2022135297W WO 2024021412 A1 WO2024021412 A1 WO 2024021412A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
network
structured
shortest path
nodes
Prior art date
Application number
PCT/CN2022/135297
Other languages
English (en)
French (fr)
Inventor
焦梦洪
Original Assignee
蚂蚁区块链科技(上海)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 蚂蚁区块链科技(上海)有限公司 filed Critical 蚂蚁区块链科技(上海)有限公司
Publication of WO2024021412A1 publication Critical patent/WO2024021412A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks

Definitions

  • the embodiments of this specification belong to the field of network security technology, and particularly relate to a method and device for optimizing a structured P2P network.
  • a structured P2P network is usually not a fully connected network.
  • the traditional solution is to perform performance maintenance or security-dimensional capability optimization on all nodes in a structured P2P network. Although it can ensure good optimization effects, the cost is too high and there is a lack of application in large-scale structured P2P networks. Feasibility; and if the capacity optimization is only performed on a randomly selected part of the nodes in the structured P2P network, although the cost can be reduced, the optimization effect on the overall network capacity of the structured P2P network cannot be guaranteed.
  • the purpose of the present invention is to provide a method and device for optimizing a structured P2P network.
  • a method for optimizing a structured P2P network including: obtaining a routing table maintained by each node in the structured P2P network; determining based on the obtained routing table The shortest path set of the structured P2P network, the shortest path set includes the shortest path between any two nodes in the structured P2P network, and any shortest path is composed of a directed node sequence; determine the shortest path The longest common subsequence corresponding to the shortest path included in the path set, and determining the node constituting the longest common subsequence as the communication pillar node of the structured P2P network; performing at least one dimension on at least one communication pillar node A capability enhancement strategy for improving the capability of the at least one communication backbone node in the at least one dimension.
  • a device for optimizing a structured P2P network including: a routing table acquisition unit for acquiring routing tables maintained by each node in the structured P2P network. ; The shortest path set determination unit is used to determine the shortest path set of the structured P2P network based on the obtained routing table. The shortest path set includes the shortest path between any two nodes in the structured P2P network.
  • a shortest path is composed of a directed node sequence; the communication pillar node determination unit is used to determine the longest common subsequence corresponding to the shortest path included in the shortest path set, and determine the nodes that constitute the longest common subsequence A communication pillar node of the structured P2P network; a capability enhancement strategy execution unit configured to execute at least one dimension of capability enhancement strategy for at least one communication pillar node to improve the performance of the at least one communication pillar node at the at least Ability in one dimension.
  • an electronic device including: a processor; a memory for storing executable instructions by the processor; wherein the processor executes the executable instructions by To implement the method described in the first aspect.
  • a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
  • the shortest path set including the shortest path between each node can be determined, and the corresponding longest common subsequence and the structure can be further obtained
  • the communication backbone node in the P2P network Obviously, the communication pillar nodes discovered in the above way will relatively frequently participate in the forwarding process of various data in the structured P2P network, that is, the communication pillar nodes are important nodes that play a key role in the normal operation of the structured P2P network.
  • the capability enhancement strategy can be prioritized for these communication pillar nodes to relatively accurately optimize the overall network capabilities of the structured P2P network, thus consuming relatively little resource cost to obtain the targeted capabilities for the structured P2P network.
  • the overall network capabilities are optimized as much as possible.
  • Figure 1 is a schematic diagram of the logical distance between nodes in a structured P2P network provided by an exemplary embodiment.
  • Figure 2 is a flow chart of a method for optimizing a structured P2P network provided by an exemplary embodiment.
  • Figure 3 is a schematic diagram of a method for determining the longest common subsequence provided by an exemplary embodiment.
  • Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • Figure 5 is a block diagram of an apparatus for optimizing a structured P2P network provided by an exemplary embodiment.
  • P2P Peer to Peer
  • the structured P2P network described in this specification is a peer-to-peer network with a certain structure.
  • Each node in the network has a logically determined position in the network. Through the preset algorithm The position of any node determined in the network is fixed.
  • a structured P2P network contains multiple network nodes (hereinafter referred to as nodes). Taking the 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 name of the node. key or the digest of its public key (such as hash), etc. This specification does not limit this.
  • a hash function can be used to calculate the fixed-length hash value corresponding to each node identifier, thereby mapping each node identifier to each hash value, which is used to record a list of hash values (such as hash values). column value as index) is called a hash table.
  • the logical distance between each node can be further determined based on the above hash value, and a tree-shaped distance table corresponding to each node can be drawn based on the logical distance.
  • the hash value corresponding to each node obtained above can also be used as the node identifier of each node at the same time.
  • the hash table can be the hash value corresponding to the node ID of each neighbor node (when the node ID includes a hash value, that is, The node identifier itself) records the node information of other nodes as an index. It is assumed that the node identification of each node in the structured P2P network can be converted into a three-digit binary code.
  • the binary codes corresponding to the node identifications of nodes A to G are 111, 110, 101, 100, 010, 001 and 000 respectively. On this basis, for node B whose binary code is 110, its corresponding tree distance table can be seen in Figure 1.
  • the logical distance between any two nodes can be calculated by calculating the binary codes corresponding to the two nodes. Specifically, the XOR operation is performed on the two binary codes, and the high-order " The number of digits in the binary number after removing 0" is used as the logical distance between the two nodes.
  • the logical distance between node B and other nodes can be calculated in the following way: "001” obtained by performing an XOR operation on "111" corresponding to node A and "110" corresponding to node B, and "001" After removing the highest "0", the binary number "1" is obtained.
  • the number of digits in this number is 1, so the logical distance between node A and node B is 1; add “111” corresponding to node C or “111” corresponding to node D. 100" and “101” corresponding to node B perform XOR operations respectively to obtain “010” and “011” respectively. After removing the "0” in the high bits, the binary numbers "10” and “11” are obtained. The bits of these two binary numbers The numbers are all 2, so the logical distance between nodes C ⁇ D and node B is all 2; similarly, the logical distance between nodes E ⁇ G and node B can be calculated to be 3.
  • the above different concepts can be represented by the concept of K-bucket.
  • node B can locally maintain a node list (ie, the aforementioned hash table).
  • This node list can be used to record node information of other nodes (such as node A and nodes C ⁇ G) in the structured P2P network.
  • node B can record the node information of each node according to the logical distance in the node list.
  • Each node information therefore has the corresponding logical distance as an index, so the corresponding node information can be quickly found based on the logical distance.
  • 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 be passed Logical distance quickly indexes to the corresponding K-bucket and finds the node information recorded in it.
  • node information of up to K nodes can be recorded in any K-bucket.
  • the specific value of K can be preset according to the actual situation, and this specification does not limit this.
  • 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 relationship between itself and the node through the aforementioned method.
  • the logical distance between nodes 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 if the K-bucket corresponding to the logical distance has -The node information will be saved in this K-bucket only if the node information has not been saved in the bucket and the saved node information has not reached K.
  • 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 if the connection between the two is normal; if the connection is abnormal, This information is usually not saved.
  • each node corresponding to each node information recorded in the node list of node B can be any node in the structured P2P network.
  • each node recorded in Node B's node list can also be a neighbor node of Node B.
  • the neighbor nodes of Node B are It is a node that can establish a connection, has established a connection, or has a physical direct connection relationship.
  • Node B can communicate with its neighbor nodes.
  • 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 needs to forward a message, it can use the corresponding The destination node determines that the node is the next hop node to establish a connection relationship with itself.
  • each node in the structured P2P network can maintain its own corresponding node list.
  • the number of K-buckets recorded in the node list of any node can be determined based on the number of digits of the hash value after node identification conversion.
  • the node identifier of each node in the structured P2P network is 32 bit, and the logical distance between any node in node B and other nodes ranges from [1,32].
  • the maximum number of records in the node list of any node can be There are 32 K-buckets, and any K-bucket can record the node information of K nodes.
  • 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.), This specification does not limit the node's identity information (such as public key).
  • 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 recording according to the node information for message forwarding.
  • nodes in a structured P2P network can follow the shortest path algorithm for message forwarding.
  • the forwarding path between node A and node B may be A-C-D-E-B, or A-C-D-G-F-B, etc. .
  • the path with the smallest number of nodes is the shortest path between them.
  • the shortest path between any two nodes is the forwarding path with the smallest number of nodes between them, and any shortest path may have at least one intermediate node, or may not contain intermediate nodes.
  • Nodes in the structured P2P network can follow the shortest path algorithm for message forwarding. Specifically, when any node receives a message whose destination node is not its own, it will first calculate the logic between the destination node and any node. distance, and find several (K) routing entries (node information) corresponding to the logical distance in the node list maintained by itself. If these several routing entries have routing entries corresponding to the destination node, then directly follow the route If there is no routing entry corresponding to the destination node among these routing entries, a routing entry will be randomly selected from these routing entries for forwarding. In the above routing strategy, each node forwarding will reduce the logical distance to the destination node by at least 1, so the overall forwarding efficiency can be ensured, and the generated forwarding path belongs to the above-mentioned shortest path.
  • Figure 2 is a flow chart of a method for optimizing a structured P2P network provided by an exemplary embodiment. As shown in Figure 2, the method may include the following steps 202-208.
  • Step 202 Obtain the routing table maintained by each node in the structured P2P network.
  • the executor of the method for optimizing a structured P2P network in this specification can be any node in the structured P2P network, or it can also be a management device used by the manager of the network, etc. This specification does not limit this.
  • the executing party can initiate a node discovery request following the FindNode protocol (such as a FindNode message) to other nodes in the structured P2P network to obtain the other party's response to the request. node information.
  • node A when node A joins the structured P2P network through node B, node A only knows that node B exists in the network at this time, so node A can initiate a request to node B. Node discovery request. In response to the request, Node B may return the routing table maintained by itself (ie, the aforementioned node list) to Node A. As can be seen from the above description, the node list maintained by node B records the node information of other nodes according to the logical distance (between node B and other nodes), such as nodes C ⁇ D, etc., so node A can use these newly discovered nodes Information determines the presence of other nodes in the structured P2P network.
  • node A can initiate the same node discovery request to node C and node D respectively based on the above node information to obtain the routing tables maintained by node C and node D respectively, thereby further obtaining more node information in the structured P2P network.
  • the node discovery request can be initiated again to other nodes represented by the newly obtained node information. This cycle is iterated several times until the routing tables returned by each node have been obtained by itself, then it can stop initiating the node discovery request, that is, the process of obtaining the routing tables maintained by each node in the structured P2P network has been completed. Finish.
  • obtaining the routing table maintained by each node in the structured P2P network includes: sending a network access request to the structured P2P network; and after receiving the structured P2P network's response to the network access request. If the returned network access response indicates that the network access is successful, a node discovery request is initiated to each node; and a routing table returned by each node in response to the node discovery request is obtained.
  • the method for optimizing the structured P2P network is executed by a management device outside the structured P2P network. Therefore, the management device needs to first access the structured P2P network before it can further communicate with the structured P2P network. Each node communicates to obtain the routing table. Therefore, the management device can first send a network access request to a seed node in the structured P2P network (a network entry node that discloses its own node information to the outside), and if it passes the network access review of the seed node, it will receive the seed node The returned network access request indicates that the management device has successfully joined the network.
  • a seed node in the structured P2P network a network entry node that discloses its own node information to the outside
  • the management device can further initiate requests to each node in the structured P2P network based on these node information.
  • the structured P2P network described in this specification can be implemented based on Kademlia, Chord, Pastry, Tapestry and other algorithms, and this specification does not limit this.
  • the structured P2P network may be a blockchain network, in which case each node in the structured P2P network is a blockchain node in the blockchain network. At this time, any node can be implemented as a P2P module in the corresponding blockchain node.
  • Step 204 Determine the shortest path set of the structured P2P network according to the obtained routing table.
  • the shortest path set includes the shortest path between any two nodes in the structured P2P network. Any shortest path consists of a directed consists of a sequence of nodes.
  • the routing table maintained by each node can be obtained, that is, the node information and connection relationship of each node in the network can be obtained.
  • the network architecture of the structured P2P network can be determined based on the node information and connection relationships of the above-mentioned nodes, that is, the connection relationships between each node and other nodes in the network can be determined. It can be understood that the above process of determining the network architecture is a process of simulating, inferring or visualizing the network architecture of the structured P2P network through the routing tables of all nodes.
  • the execution party can traverse the shortest path between each node and other nodes.
  • the shortest path algorithm can be used to calculate the shortest path between any two nodes (by obtaining the routing table of each node, simulating the process of forwarding messages between any two nodes to derive the shortest path between any two nodes). Similar to the shortest path between nodes B to G; the shortest path between each node in the structured P2P network and other nodes can be traversed in sequence, thereby obtaining the shortest path between any two nodes in the structured P2P network.
  • the shortest path, the set of all shortest paths is the shortest path set.
  • the index of any routing entry contained in the routing table of any node includes: the logical distance between the any node and the node corresponding to the any routing entry.
  • the routing table maintained by any node obtained by the executor has certain structural characteristics, which is reflected in the fact that each routing entry in the routing table contains an index on the logical distance.
  • the logical distance is the logical distance between any node and the node corresponding to any routing entry. Therefore, when searching for routing entries in the routing table, you can first index to the corresponding several (for example, K) routing entries (for example, the corresponding K-buckets) through logical distance, and then perform the search in these several routing entries. For further inquiries.
  • the logical distance between any two nodes is determined by performing an XOR operation on the node identifiers corresponding to the any two nodes.
  • the node identifier corresponding to any node is composed of a fixed-digit binary code.
  • the node identifiers corresponding to different nodes are different.
  • the node ID corresponding to the node can be determined when the node joins the network, and the node ID of the node will not change after that.
  • the node ID of each node is set. is a binary code with a fixed number of digits.
  • the XOR value of the node identifiers corresponding to any two nodes can be calculated, and the number of digits of the binary number after eliminating the high-order 0 from the XOR value is used as the The logical distance between any two nodes.
  • This method is also a general networking method based on the Kademlia algorithm and will not be described again here.
  • 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, and the word vector features corresponding to any node are generated through a semantic model.
  • the semantic model is generated by training the network paths included in the structured P2P network. 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.
  • each node in the structured P2P network will be 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 the word2vec model).
  • the network paths included in the structured P2P network are trained as sentences in the training set.
  • the network path here refers to the physical A sequence of nodes directly connected to the node sequence.
  • the nodes on the node sequence are represented by text codes.
  • the training set can include: ABGDC, GCDBDE, DCBCGE..., where the letter text is used to represent nodes, and adjacent nodes indicate that the two nodes are physically directly connected.
  • the network paths in the above training set are randomly generated after obtaining the physical network architecture of the entire structured P2P network. These network paths can be looped or even repeated, and the length of each network path is not limited.
  • the word vector features corresponding to each node i.e., each text code, such as A, B, C, etc.
  • the word vector features corresponding to each node are obtained after multiple iterations.
  • a collection of connection relationships, so the word vector features corresponding to each node finally obtained will also contain information about their respective feature positions in the structured P2P network, and nodes with similar word vector features correspond to feature positions in the structured P2P network.
  • the logical distance between different nodes can be judged by judging the similarity of the word vector features corresponding to different nodes. The closer the logical distance is, the closer the feature positions of the nodes in the structured P2P network are. The two are generally in It's also physically closer. Since there may be new nodes added to the structured P2P network, the network architecture of the structured P2P network may change, which will also affect the network connection relationship between each node and ultimately affect the word vector characteristics corresponding to each node. Therefore, the word vector characteristics of any node involved in this embodiment will be dynamically changing, which also means that the routing table maintained by any node will also be updated based on the changing logical distance from other nodes.
  • determine the shortest path between the first node and the second node in the following manner: determine the first node as the current node, and perform the following steps in a loop: calculate the latest logic between the current node and the second node distance, search for at least one corresponding routing entry in the routing table maintained by the current node based on the latest logical distance; when the at least one routing entry includes a routing entry corresponding to the second node, end the loop and generate a third The shortest path between a node and a second node; when the at least one routing entry does not include a routing entry corresponding to the second node, add the current node to the shortest path between the first node and the second node, And the node corresponding to any routing entry in the at least one routing entry is re-determined as the current node, and the cycle continues.
  • the above is the process of determining the shortest path between the first node and the second node by obtaining each routing table maintained by each node. In essence, it simulates the process of the first node sending a message to the second node.
  • the forwarding of the message The path is the shortest path between the required first node and the second node.
  • each node forwarding will reduce the logical distance between the current node and the destination node, thus ensuring high overall forwarding efficiency.
  • the generated forwarding path belongs to the shortest path mentioned above.
  • the nodes in the node sequence included in the shortest path are added one after another. First, the node sequence starts with the first node, and then some intermediate nodes are added one after another. Finally, when the loop ends, the second node is added to the end of the node sequence, thus generating The shortest path between the first node and the second node.
  • Step 206 Determine the longest common subsequence corresponding to the shortest path included in the shortest path set, and determine the node constituting the longest common subsequence as the communication pillar node of the structured P2P network.
  • determining the longest common subsequence corresponding to the shortest path included in the shortest path set includes: using a multiple longest common subsequence MLCS algorithm to process all the shortest paths included in the shortest path set to determine the The longest common subsequence.
  • the executing party can further determine the longest common subsequence.
  • the MLCS Moving Longest Common Subsequence
  • the nodes in the longest common subsequence can be regarded as communication pillar nodes of the structured P2P network.
  • the MLCS algorithm please refer to the records in related technologies, and will not be described again.
  • the shortest path set only includes shortest paths 1, 2, and 3.
  • the shortest path 1 between node A and node B is "A-C-D-E-B”
  • the shortest path 2 between node A and node D is "A-G-C-E-B-D”
  • the shortest path 3 between node C and node B is "C-E-F-B”
  • the longest common subsequence can be determined as "C-E-B" through the MLCS algorithm.
  • node B, node C and node E that constitute "C-E-B” are the communication pillar nodes of the structured P2P network.
  • the shortest paths in the shortest path set can be used for unified calculation, that is, the longest common subsequence between all shortest paths is calculated.
  • the calculated communication pillar node is It is the global pillar node of the structured P2P network.
  • the shortest paths in the shortest path set can also be divided into multiple subsets, and all the shortest paths in each subset are used to calculate the longest common subsequence corresponding to each subset - the longest corresponding to any subset.
  • the nodes included in the common subsequence are the local pillar nodes corresponding to the subset, and these local pillar nodes are regarded as communication pillar nodes.
  • any global pillar node may affect most or even all nodes in the network, while the local pillar nodes corresponding to any subset may affect the corresponding nodes of that subset. All or part of the nodes.
  • global pillar nodes have a relatively greater influence on the structured P2P network than local pillar nodes. Therefore, the longest common subsequence can be determined using the above different calculation methods according to the actual situation. In addition, the longest common subsequence calculated in the above method may only include one node, and this specification does not limit this.
  • any finally determined communication pillar node is in at least one shortest path. It can be seen that the communication pillar node is discovered based on the shortest path between nodes in the structured P2P network, that is, the process of determining the communication pillar node in this specification relies on the determination of the shortest path. It is precisely because each node in the structured P2P network has a relatively fixed logical position that the routing policy of each node is also relatively fixed, and therefore a relatively fixed forwarding path can be formed, that is, the shortest path described in this application.
  • Step 208 Execute a capability enhancement strategy of at least one dimension for at least one communication pillar node, so as to improve the capability of the at least one communication pillar node in the at least one dimension.
  • the capability enhancement strategy in at least one dimension includes a performance enhancement strategy in a performance dimension and/or a security enhancement strategy in a security dimension.
  • the execution level after the executing party determines the communication pillar node in the structured P2P network, it can directly send a capability enhancement notification to at least one communication pillar node, so that the communication pillar node that receives the notification can perform the corresponding capability enhancement on its own.
  • the execution party can also directly send a capability enhancement notification for the at least one communication pillar node to the resource party, so that the resource party directly executes the corresponding capability enhancement strategy for the at least one communication pillar node based on the notification, Since this method does not directly inform at least one communication pillar node that needs enhanced capabilities, it can make at least one communication pillar node that needs enhanced capabilities unaware (not knowing that it is determined to be a communication pillar node, nor that it will be executed). Capability enhancement strategy) to achieve the effect of capability enhancement.
  • the performance enhancement strategy includes: configuring high-performance hardware resources, configuring hardware resource clusters, expanding network bandwidth, and/or optimizing network parameters;
  • the security enhancement strategy includes: configuring enhanced network security policies and/or configuration Trusted execution environment.
  • the specific form of the above-mentioned high-performance hardware resources or hardware resource clusters can be cloud resources, the above-mentioned expanded network bandwidth can be specifically expanded the number of I/O interfaces of the network, the above-mentioned optimized network parameters can be specifically expanded the capacity of the routing table, each The cache capacity of network resources, etc.
  • the above network security policies can include firewall policies, ACL (Access Control Lists, Access Control Lists) policies, etc.
  • the message transmission efficiency of the structured P2P network can be optimized overall at a smaller cost; when at least one communication pillar node is implemented with a security enhancement strategy , then the security of message transmission in the structured P2P network can be optimized overall at a smaller cost.
  • the shortest path set including the shortest path between each node can be determined, and the corresponding longest common subsequence and the structure can be further obtained
  • the communication backbone node in the P2P network Obviously, the communication pillar nodes discovered in the above way will relatively frequently participate in the forwarding process of various data in the structured P2P network, that is, the communication pillar nodes are important nodes that play a key role in the normal operation of the structured P2P network.
  • the capability enhancement strategy can be prioritized for these communication pillar nodes to relatively accurately optimize the overall network capabilities of the structured P2P network, thus consuming relatively little resource cost to obtain the targeted capabilities for the structured P2P network.
  • the overall network capabilities are optimized as much as possible.
  • it also includes: determining a security node that satisfies security rules in the structured P2P network, and sending the identity information of the communication pillar node to the security node, so that the security node responds to the requester
  • the node discovery request used to request to obtain the original routing table maintained by the security node executes at least one of the following response strategies: will include node information (i.e., routing entries) in the original routing table other than the node information of the communication pillar node.
  • a new routing table, or a new routing table containing non-complete node information randomly selected from the original routing table is returned to the requesting party; and/or, if the node discovers a preset before the request is received, If the number of historical node discovery requests initiated by the requester received within the time period exceeds the preset number, the node discovery request from the requester will not be responded to or forwarded.
  • the communication pillar nodes are important nodes that play a key role in the normal operation of the structured P2P network. Therefore, if the attacker targets the above-mentioned communication pillar nodes, it may cause the network operation to be adversely affected or even paralyze the network. . It can be seen from the method of determining the communication pillar nodes in the structured P2P network that the key to preventing this type of network attack is to prevent the attacker from obtaining the complete routing table of all nodes in the network.
  • the execution party can inform the security nodes that have been confirmed to be safe (non-attackers) in the structured P2P network with the identity information of the above-mentioned communication pillar nodes for use by them.
  • the executing party can first determine the security nodes in the structured P2P network that meet security rules.
  • the security rules can be formulated based on historical communication records, user identities corresponding to the nodes, security protection levels of the node equipment, and other factors.
  • a safe node that meets the security rules can be considered a node that has been confirmed to be safe in the structured P2P network. Such nodes will most likely not launch attacks on the structured P2P network, so the execution party can trust the safe node.
  • the identity information of the communication pillar node determined in the aforementioned manner is sent to the security node.
  • the security node when the security node receives a node discovery request initiated by the requesting party (the request is used to request to obtain the complete routing table maintained by the security node), the security node may implement a variety of response strategies to avoid providing the requesting party with The complete routing table prevents the requesting party from launching a network attack after identifying the communication pillar node, and prevents network attacks to a certain extent.
  • the above response strategy includes: creating a new routing table that contains node information other than the node information of the communication pillar node in the original routing table, or a new routing table that contains non-full node information randomly selected from the original routing table.
  • the routing table is returned to the requester.
  • the requester since the requester cannot obtain the original routing table containing complete node information from the secure node, it cannot determine the real communication pillar node through the above-mentioned method of inferring the network architecture. The impact will also be diminished.
  • this response strategy can prevent the requesting party from inferring the communication pillar nodes in the structured P2P network by hiding the node information of some nodes from the requesting party, thereby effectively preventing the attacker from knowing and attacking the communication pillar nodes. Attacks are launched on structured P2P networks. Under the strategy of returning a new routing table containing non-complete node information randomly selected from the original routing table, since the routing entries randomly selected by the security node are not exactly the same, if the requester sends node discovery requests to the security node multiple times, It may also be possible to restore the complete original routing table based on the incomplete new routing table returned each time. In this regard, the security node can also maintain the mapping relationship between the requester and the new routing table returned for the first time.
  • the security node can ensure that each node discovery request is based on the above mapping relationship.
  • the same new routing table is returned to the requester every time, thus ensuring that the requester cannot obtain the complete original routing table through multiple requests.
  • the above response strategy also includes: if the number of historical node discovery requests initiated by the requesting party exceeds the preset number within a preset time period before the reception time of the node discovery request, then not respond or forward the request. Party's node discovery request.
  • the security node may limit the frequency of node discovery requests received (including whether the destination node is the security node and the destination node is not the security node but is only forwarded via the security node). For example, after a security node receives a node discovery request at any time, it can determine that the initiator (i.e., the requester) corresponding to the node discovery request has received a historical node initiated by the same requester within a preset time period before the reception time of the request.
  • the initiator i.e., the requester
  • the number of discovery requests can be achieved, for example, by counting all node discovery requests it has received.
  • the historical node discovery request is all node discovery requests initiated by the same requester that the security node received before receiving the node discovery request. Based on this, if the above number exceeds the preset number, it can be determined that the requester initiates node discovery requests too frequently, so the requester may be an attacker.
  • the safe node can avoid responding to the node discovery requests (at the node If the destination node of the discovery request is the safe node) or avoid forwarding the node discovery request (if the destination node of the node discovery request is not the safe node), such as directly discarding the request.
  • the node discovery request can be responded to by returning a request failure response or a new routing table containing randomly generated node information to the requesting party, thereby rejecting or Mislead the requesting party who is recognized as the attacker, further achieving the effect of countering network attacks.
  • Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410.
  • the processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it.
  • the execution party of the following processing flow is not limited to each A logic unit can also be a hardware or logic device.
  • Figure 5 is a block diagram of a device for optimizing a structured P2P network provided in this specification according to an exemplary embodiment.
  • This device can be applied to the equipment shown in Figure 4 to implement the instructions of this specification.
  • the device includes: a routing table acquisition unit 501, used to acquire routing tables maintained by each node in the structured P2P network; a shortest path set determination unit 502, used to determine the routing table of the structured P2P network based on the acquired routing table.
  • a shortest path set includes the shortest path between any two nodes in the structured P2P network, and any shortest path is composed of a directed node sequence;
  • the communication pillar node determination unit 503 is used to determine the The longest common subsequence corresponding to the shortest path included in the shortest path set, and determine the node that constitutes the longest common subsequence as the communication pillar node of the structured P2P network;
  • the capability enhancement policy execution unit 504 is used to A capability enhancement strategy of at least one dimension is executed for at least one communication pillar node, so as to improve the capability of the at least one communication pillar node in the at least one dimension.
  • the routing table acquisition unit 501 is specifically configured to: send a network access request to the structured P2P network; upon receiving a network access response returned by the structured P2P network in response to the network access request indicating successful network access. Next, initiate a node discovery request to each node respectively; obtain the routing table returned by each node in response to the node discovery request.
  • the index of any routing entry contained in the routing table of any node includes: the logical distance between the any node and the node corresponding to the any routing entry.
  • the logical distance between any two nodes is determined by performing an XOR operation on the node identifiers corresponding to any two nodes.
  • the node identifier corresponding to any node is composed of a fixed-digit binary code. Different The node identifiers corresponding to the nodes are different; 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, and the word vector features corresponding to any node are determined by semantics Model generation, the semantic model is generated by training the network paths included in the structured P2P network. Any network path is composed of a directed node sequence, and nodes adjacent to each other on the node sequence are physically directly connected.
  • the shortest path set determination unit 502 determines the shortest path between the first node and the second node in the following manner: determines the first node as the current node, and loops through the following steps: calculates the current node and The latest logical distance between the second nodes, searching for at least one corresponding routing entry in the routing table maintained by the current node based on the latest logical distance; including the routing entry corresponding to the second node in the at least one routing entry When , end the loop and generate the shortest path between the first node and the second node; when the at least one routing entry does not include the routing entry corresponding to the second node, add the current node to the first node and the second node.
  • the shortest path between the two nodes is determined, and the node corresponding to any routing entry in the at least one routing entry is redetermined as the current node, and the cycle continues.
  • the communication pillar node determination unit 503 is specifically configured to use a multiple longest common subsequence MLCS algorithm to process all the shortest paths included in the shortest path set to determine the longest common subsequence.
  • the capability enhancement strategy in at least one dimension includes a performance enhancement strategy in a performance dimension and/or a security enhancement strategy in a security dimension.
  • the performance enhancement strategy includes: configuring high-performance hardware resources, configuring hardware resource clusters, expanding network bandwidth, and/or optimizing network parameters;
  • the security enhancement strategy includes: configuring enhanced network security policies and/or configuration Trusted execution environment.
  • the structured P2P network is a blockchain network.
  • the structured P2P network is constructed using the Kademlia algorithm.
  • a secure node determination unit 505 configured to determine secure nodes that meet security rules in the structured P2P network, and send the identity information of the communication pillar node to the secure node, so that The secure node executes at least one of the following response strategies in response to the node discovery request used by the requesting party to request to obtain the original routing table maintained by the secure node: including node information other than the communication pillar node in the original routing table.
  • a new routing table with node information, or a new routing table containing randomly selected non-complete node information in the original routing table is returned to the requester; and/or, if the node discovery request is received before the time If the number of historical node discovery requests initiated by the requesting party exceeds the preset number within the preset time period, the node discovery request from the requesting party will not be responded to or forwarded.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor. , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers and embedded microcontrollers.
  • controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, For Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller in addition to implementing the controller in the form of pure computer-readable program code, the controller can be completely programmed with logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded logic by logically programming the method steps. Microcontroller, etc. to achieve the same function. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the means for implementing various functions can be considered as structures within hardware components as well as software modules implementing the methods.
  • 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.
  • 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, or a personal digital assistant. , media player, navigation device, email device, game console, tablet, wearable device, or a combination of any of these devices.
  • the functions are divided into various modules and described separately.
  • the functions of each module can be implemented in the same or multiple software and/or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. .
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash random access memory
  • Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information.
  • Information may be computer-readable instructions, data structures, modules of programs, 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), and read-only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • read-only memory read-only memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • compact disc read-only memory CD-ROM
  • DVD digital versatile disc
  • Magnetic tape cartridges magnetic tape disk storage, graphene storage or other magnetic storage devices or any other non-transmission medium can be used to store information that can be accessed by a computing device.
  • computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, one or more embodiments of the present description may employ a computer program implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. Product form.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • program modules may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network.
  • program modules may be located in both local and remote computer storage media including storage devices.

Landscapes

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

Abstract

本说明书提供一种优化结构化P2P网络的方法及装置。其中,所述方法包括:获取所述结构化P2P网络中各个节点分别维护的路由表;根据获取的路由表确定所述结构化P2P网络的最短路径集,所述最短路径集包含所述结构化P2P网络中任意两个节点之间的最短路径,任一最短路径由有向的节点序列构成;确定所述最短路径集中包含的最短路径对应的最长公共子序列,并将构成所述最长公共子序列的节点确定为所述结构化P2P网络的通信支柱节点;针对至少一个通信支柱节点执行至少一个维度的能力增强策略,以用于提高所述至少一个通信支柱节点在所述至少一个维度上的能力。

Description

结构化P2P网络优化 技术领域
本说明书实施例属于网络安全技术领域,尤其涉及一种优化结构化P2P网络的方法及装置。
背景技术
结构化P2P网络通常不是全连接网络,其包括的不同节点的交互数据往往需要途径多个中间节点,因此如何在结构化P2P网络上实现高效或安全的数据传输,从而对结构化P2P网络整体的网络能力进行优化是目前亟待解决的问题。
传统的解决方案是对结构化P2P网络中的所有节点进行性能维护或安全维度的能力优化,其虽然可以保证较好的优化效果但成本太高,缺乏在大规模的结构化P2P网络中应用的可行性;而如果仅对结构化P2P网络中随机选取的部分节点执行能力优化,虽然可以降低成本,但无法保证针对结构化P2P网络整体的网络能力的优化效果。
发明内容
本发明的目的在于提供一种优化结构化P2P网络的方法及装置。
根据本说明书一个或多个实施例的第一方面,提出了一种优化结构化P2P网络的方法,包括:获取所述结构化P2P网络中各个节点分别维护的路由表;根据获取的路由表确定所述结构化P2P网络的最短路径集,所述最短路径集包含所述结构化P2P网络中任意两个节点之间的最短路径,任一最短路径由有向的节点序列构成;确定所述最短路径集中包含的最短路径对应的最长公共子序列,并将构成所述最长公共子序列的节点确定为所述结构化P2P网络的通信支柱节点;针对至少一个通信支柱节点执行至少一个维度的能力增强策略,以用于提高所述至少一个通信支柱节点在所述至少一个维度上的能力。
根据本说明书一个或多个实施例的第二方面,提出了一种优化结构化P2P网络的装置,包括:路由表获取单元,用于获取所述结构化P2P网络中各个节点分别维护的路由表;最短路径集确定单元,用于根据获取的路由表确定所述结构化P2P网络的最短路径集,所述最短路径集包含所述结构化P2P网络中任意两个节点之间的最短路径,任一最短路径由有向的节点序列构成;通信支柱节点确定单元,用于确定所述最短路径集中包 含的最短路径对应的最长公共子序列,并将构成所述最长公共子序列的节点确定为所述结构化P2P网络的通信支柱节点;能力增强策略执行单元,用于针对至少一个通信支柱节点执行至少一个维度的能力增强策略,以用于提高所述至少一个通信支柱节点在所述至少一个维度上的能力。
根据本说明书一个或多个实施例的第三方面,提出了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器通过运行所述可执行指令以实现如第一方面所述的方法。
根据本说明书一个或多个实施例的第四方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面所述方法的步骤。
基于本说明书的前述实施例,通过获取结构化P2P网络中各个节点分别维护路由表,从而可以确定包含各个节点之间最短路径的最短路径集,并进一步得到对应的最长公共子序列以及该结构化P2P网络中的通信支柱节点。显然,上述方式发现的通信支柱节点将相对频繁地参与该结构化P2P网络中的各个数据的转发过程,即通信支柱节点是在该结构化P2P网络正常运行过程中起到关键作用的重要节点。因此,在成本有限的情况下,可以优先针对这些通信支柱节点执行能力增强策略,从而相对精准地优化结构化P2P网络整体的网络能力,从而消耗相对较少的资源成本以获取针对结构化P2P网络整体的网络能力尽可能大的的优化效果。
附图说明
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是一示例性实施例提供的一种结构化P2P网络中节点之间逻辑距离的示意图。
图2是一示例性实施例提供的一种优化结构化P2P网络的方法的流程图。
图3是一示例性实施例提供的一种最长公共子序列的确定方法的示意图。
图4是一示例性实施例提供的一种设备的结构示意图。
图5是一示例性实施例提供的一种优化结构化P2P网络的装置的框图。
具体实施方式
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。
P2P(Peer to Peer)网络,即点对点网络;本说明书所述的结构化P2P网络,即具有一定结构的点对点网络,该网络中的各个节点在网络中具有逻辑上的确定位置,通过预设算法确定出的任一节点在网络中的位置是固定的。
结构化P2P网络中包含多个网络节点(下称节点),以基于Kademlia算法建立的结构化P2P网络为例,各个节点分别具有相应的节点标识,任一节点的节点标识可以是该节点的公钥或者其公钥的摘要(如哈希)等,本说明书并不对此进行限定。对于网络中的各个节点,可以通过散列函数分别计算各个节点标识对应的固定长度的散列值,从而将各个节点标识映射为各个散列值,用于记录散列值的列表(如以散列值作为索引)称为散列表。基于上述散列值可以进一步确定出各个节点之间的逻辑距离,基于该逻辑距离即可绘制各个节点分别对应的树状距离表。当然,上述得到的各个节点对应的散列值也可以同时作为各个节点的节点标识。
对于任一节点而言,其可以维护有用于记录其邻居节点的节点信息的散列表,该散列表可以以各个邻居节点的节点标识所对应的散列值(在节点标识包括散列值时即节点标识本身)为索引记录其他节点的节点信息。假设将结构化P2P网络中各个节点的节点标识可以转换为三位的二进制码,其中节点A~G的节点标识对应的二进制码分别为111、110、101、100、010、001和000。在此基础上,对于其中二进制码为110的节点B而言,其对应的树状距离表可以参见图1。
如图1所示,任意两个节点之间逻辑距离可以通过计算这两个节点对应的二进制码计算得到,具体是通过对两个二进制码进行异或运算,并将得到的值中高位的“0”去掉后的二进制数的位数作为者两个节点之间的逻辑距离。例如,节点B与其他节点之间的逻辑距离可以通过以下方式进行计算:将节点A对应的“111”与节点B对应的“110”执行异或运算得到的“001”,将“001”中最高的“0”去掉后得到二进制数“1”,该数的位数为1,故节点A与节点B之间的逻辑距离为1;将节点C对应的“111”或节 点D对应的“100”分别和节点B对应的“101”执行异或运算分别得到的“010”与“011”高位的“0”去掉后得到二进制数“10”和“11”,这两个二进制数的位数均为2,故节点C~D与节点B之间的逻辑距离均为2;同理可以计算得到节点E~G与节点B之间的逻辑距离均为3。其中,在所述结构化P2P网络基于分布式哈希表DHT(distributed hash table)所构建,而该DHT通过Kademlia算法实现的情况下,可以以K-桶(K-bucket)的概念表示上述不同逻辑距离的节点,如对于节点B,bucket=1(即逻辑距离为1,下同)的子树是右边的节点A所在的子树、bucket=2的子树是节点C~D所在的子树、bucket=3的子树是节点E~G所在的子树。
基于上述逻辑距离,节点B可以在本地维护节点列表(即前述散列表),该节点列表可以用于记录结构化P2P网络中其他节点(如节点A和节点C~G)的节点信息。例如,节点B可以在节点列表中按照逻辑距离记录各个节点的节点信息,每个节点信息因此具有对应的逻辑距离作为索引,因此可以基于逻辑距离来快速查找到对应的节点信息。如节点B可以在K-bucket 1中记录节点A的节点信息、在K-bucket 2中记录节点C~D的节点信息、在K-bucket 3中记录节点E~G的节点信息,因此可以通过逻辑距离快速索引到对应K-bucket并找到记录在其中的节点信息。其中,任一K-bucket中最多可以记录K个节点的节点信息,K的具体取值可以根据实际情况预先设置,本说明书并不对此进行限定。
需要说明的是,任一节点在通过节点发现机制获取到任一其他节点的节点信息之后,通常并不会将其全部保存在本地维护的节点列表中,而是会通过前述方式计算自身与该节点之间的逻辑距离,若该逻辑距离对应的K-bucket中已经保存有该节点的节点信息或者保存的节点信息数量已经达到K,则会丢弃该节点信息;只有在该逻辑距离对应的K-bucket中尚未保存该节点信息且已保存的节点信息尚未达到K的情况下,才会将该节点信息保存在这一K-bucket中。另外,所述任一节点还可以根据该节点信息进一步判断自身与所述任一其他节点之间的网络连接状态,并在二者连接正常的情况下再保存该节点信息;若连接不正常则通常不保存该信息。
由前述过程可见,任意两节点之间的逻辑距离仅由二者的节点标识所决定,而与二者在结构化P2P网络中的实际网络连接关系(物理上的直连关系)无关,当然,也可以按照物理上的直连关系去分别设置各个节点的节点标识(散列值),从而使得上述的逻辑距离也可以一定程度地表征结构化P2P网络中相应节点在世界网络连接中关系。因此,节点B的节点列表中记录的各节点信息对应的各个节点,可以为结构化P2P网络中的任 一节点。当然,鉴于被记录的节点可能会被节点B用于消息传输,所以为保证消息的可靠传输,节点B的节点列表中记录的各个节点也可以是节点B的邻居节点,节点B的邻居节点是其能够建立连接、已经建立连接或存在物理上的直连关系的节点,换言之,节点B可以与其邻居节点进行通信。例如在节点列表中仅记录有邻居节点的情况下,节点B可以直接将该节点列表视为自身维护的网络路由表,并按照该节点列表来实现消息路由,在需要转发消息时通过消息对应的目的节点以确定该节点为与自身建立有连接关系的下一跳节点。
可以理解的是,上述过程仅以节点A~G为例,实际上,结构化P2P网络中的各个节点均可以分别维护自身对应的节点列表。而且,任一节点的节点列表中记录的K-bucket的个数可以根据节点标识转换后的散列值的位数确定。如结构化P2P网络中各个节点的节点标识为32bit,则节点B中任一节点与其他节点的逻辑距离的取值范围为[1,32],此时任一节点的节点列表中可以最多记录32个K-bucket,其中任一K-bucket中可以记录K个节点的节点信息。
其中,任一节点中记录的任一其他节点的节点信息可以包括所述任一其他节点的节点标识、节点标识对应的散列值、该节点的网络地址(如IP地址、端口号等)、该节点的身份信息(如公钥)等,本说明书并不对此进行限定。实际上,结构化P2P网络中的各个节点可以根据分别维护的所述节点列表确定转发路径,即将所述节点列表作为路由表,而节点列表中的节点信息则作为路由条目,用于根据其中记录的节点信息进行消息转发。
通常情况下,结构化P2P网络中的节点可以遵循最短路径算法进行消息转发。从结构化P2P网络中的任一节点到达另一节点可能存在多条转发路径,任一转发路径可能需要经过中间节点,如节点A与节点B之间的转发路径可能为A-C-D-E-B,或者为A-C-D-G-F-B等。在上述多条转发路径中,经过节点数量最少的路径即为二者之间的最短路径。显然,任意两节点之间的最短路径为二者之间间隔节点的数量最少的转发路径,而任一最短路径可能至少一个中间节点,或不含中间节点。结构化P2P网络中的节点可以遵循最短路径算法进行消息转发,具体是指,任一节点在接收到目的节点并非自身的消息时,会首先计算该目的节点与所述任一节点之间的逻辑距离,并在自身维护的节点列表中查找到该逻辑距离对应的若干个(K个)路由条目(节点信息),如果这若干个路由条目有该目的节点对应的路由条目,则直接按照该路由条目进行转发,如果这若干个路由条目中没有该目的节点对应的路由条目,则会从这若干个路由条目中随机选取一 个路由条目进行转发。在上述选路策略中,每次节点转发都将至少将与目的节点的逻辑距离减少1,因此可以确保整体的转发效率较高,同时生成的转发路径即属于上述的最短路径。
至此,对结构化P2P网络的网络特性介绍完毕,下面对本申请涉及的优化结构化P2P网络的方法进行说明。
请参见图2,图2是一示例性实施例提供的一种优化结构化P2P网络的方法的流程图。如图2所示,所述方法可以包括下述步骤202-208。
步骤202:获取所述结构化P2P网络中各个节点分别维护的路由表。
本说明书优化结构化P2P网络的方法的执行方可以是所述结构化P2P网络中的任一节点,或者也可以是该网络的管理方所使用的管理设备等,本说明书并不对此进行限定。在所述结构化P2P网络基于Kademlia算法实现的情况下,该执行方可以向结构化P2P网络中的其他节点发起遵循FindNode协议的节点发现请求(如FindNode消息),以获取对方响应于该请求返回的节点信息。
承接于图1,若所述执行方为节点A,则在节点A通过节点B加入结构化P2P网络完成时,节点A此时仅知晓该网络中存在节点B,所以节点A可以向节点B发起节点发现请求。节点B响应于该请求,可以将自身所维护的路由表(即前述的节点列表)返回至节点A。由前述说明可知,节点B维护的节点列表中按照(节点B与其他节点之间的)逻辑距离记录有其他节点的节点信息,如节点C~D等,所以节点A可以根据这些新发现的节点信息确定结构化P2P网络中存在的其他节点。
进而,节点A可以根据上述节点信息分别向节点C和节点D发起同样的节点发现请求,以分别获取节点C和节点D维护的路由表,从而进一步获得结构化P2P网络中更多的节点信息。此时可以再次向新获取到的节点信息所表示的其他节点发起所述节点发现请求。如此循环迭代进行多次,直至各个节点返回的路由表均已被自身所获取,则可以停止发起所述节点发现请求,即获取所述结构化P2P网络中各个节点分别维护的路由表的过程已完成。
可选的,所述获取所述结构化P2P网络中各个节点分别维护的路由表,包括:向所述结构化P2P网络发送入网请求;在接收到所述结构化P2P网络响应于所述入网请求返回的入网响应表明入网成功的情况下,向所述各个节点分别发起节点发现请求;获取所述各个节点响应于所述节点发现请求各自分别返回的路由表。
在本说明书实施例中,优化结构化P2P网络的方法的执行方为结构化P2P网络外部的管理设备,因此,该管理设备需要首先接入该结构化P2P网络才能进一步与结构化P2P网络中的各个节点进行通信以获取路由表。于是,管理设备可以首先向所述结构化P2P网络中的种子节点(对外部公开自身节点信息的入网口节点)发送入网请求,并在通过种子节点的入网审核的情况下,将接收到种子节点返回的用于表明该管理设备入网成功的入网请求,此时相当于该管理设备成功地加入了结构化P2P网络,并能够基于结构化P2P网络的相关协议执行相关的节点/路由发现机制。例如,入网响应中包含有结构化P2P网络中所有节点的节点信息(但不包含各个节点所维护的路由表),因此管理设备可以进一步基于这些节点信息向结构化P2P网络中的各个节点分别发起节点发现请求以获取各自维护的路由表;或者,管理设备也可以像前述方式那样通过路由表不断发现新节点、不断向新发现的节点发送节点发现请求以获取新的路由表的循环迭代的方式以获取各个节点各自维护的路由表。
本说明书所述的结构化P2P网络可以基于Kademlia、Chord、Pastry、Tapestry等算法实现,本说明书并不对此进行限定。
另外,所述结构化P2P网络可以为区块链网络,此时结构化P2P网络中的各个节点即为区块链网络中的区块链节点。此时,任一节点可以被实现为相应区块链节点中的P2P模块。
步骤204:根据获取的路由表确定所述结构化P2P网络的最短路径集,所述最短路径集包含所述结构化P2P网络中任意两个节点之间的最短路径,任一最短路径由有向的节点序列构成。
由前述描述可知,通过向各个节点分别发起节点发现请求可以获取到各个节点分别维护的路由表,即获取到该网络中各个节点的节点信息以及连接关系。此时,即可根据上述各个节点的节点信息以及连接关系确定结构化P2P网络的网络架构,即确定出该网络中各个节点与其他节点之间的连接关系。可以理解的是,上述确定网络架构的过程,即是通过全部节点的路由表进行模拟、推测或可视化构建该结构化P2P网络的网络架构的过程。
在确定出所述结构化P2P网络的网络架构的情况下,执行方即可遍历各个节点与其他节点之间的最短路径。如对于节点A,可以通过前述最短路径算法(通过获取到的各个节点的路由表,在任意两个节点之间模拟转发消息的过程从而推导出任意两个节点之间的最短路径)依次计算其与节点B~G之间的最短路径;类似的,可以依次遍历结构 化P2P网络中的各个节点与其他节点之间的最短路径,从而得到所述结构化P2P网络中任意两个节点之间的最短路径,全部最短路径构成的集合即为所述最短路径集。
如前所述,所述任一节点的路由表包含的任一路由条目的索引包括:所述任一节点与所述任一路由条目对应的节点之间的逻辑距离。对于执行方获取到的任一节点维护的路由表,其都具备一定的结构化特征,这体现在该路由表中的每一个路由条目都包含一个关于逻辑距离的索引,任一路由条目对于的逻辑距离即所述任一节点与所述任一路由条目对应的节点之间的逻辑距离。由此,在查找路由表中的路由条目时,可以通过逻辑距离首先索引到对应的若干个(例如K个)路由条目(例如对应的K-bucket),然后再在这若干个路由条目中进行进一步的查询。
在一实施例中,任意两个节点之间的逻辑距离由所述任意两个节点分别对应的节点标识执行异或运算以确定,任一节点对应的节点标识由固定位数的二进制码所构成,不同节点对应的节点标识不同。如前所述,在结构化P2P网络中,可以在节点加入网络中时就确定该节点对应的节点标识,过后该节点的节点标识就不会再变动,例如将每个节点的节点标识都设置为固定位数的二进制码,由此一来,就可以通过计算任意两个节点分别对应的节点标识的异或值,并将该异或值消去高位0后的二进制数的位数作为所述任意两个节点之间的逻辑距离。该方式也是基于Kademlia算法的一般组网方式,这里不再赘述。
在另一实施例中,所述任意两个节点之间的逻辑距离由所述任意两个节点分别对应的词向量特征执行相似度运算以确定,任一节点对应的词向量特征通过语义模型生成,所述语义模型通过所述结构化P2P网络中包含的网络路径训练生成,任一网络路径由有向的节点序列构成,该节点序列上彼此相邻的节点在物理上直连。在本说明书实施例中,会给结构化P2P网络中各个节点各自分配一个动态变化的词向量特征以作为计算任意两个节点之间逻辑距离的基础。该词向量特征是通过语义模型(如word2vec模型)训练得到的,在语义模型的训练过程中,将结构化P2P网络中包含的网络路径作为训练集中的语句进行训练,这里的网络路径是指物理上直连的节点序列,节点序列上的节点以文本代码表征。例如,训练集可以包括:ABGDC、GCDBDE、DCBCGE……,这其中的字母文本用于代表节点,相邻的节点表明这两个节点在物理上是直连的。上述训练集中的网络路径是在获得整个结构化P2P网络的物理网络架构后从中随机生成的,这些网络路径可以呈环甚至重复,每个网络路径的长度不限。通过将结构化P2P网络中的网络路径作为“语句”送入语义模型进行训练,在多次迭代后从而获得各个节点(即各个文 本代码,如A、B、C等)对应的词向量特征。这些语义模型生成词向量特征之间在语义空间具备某种联系,而这种联系可以通过相似性运算予以提取,由于训练语义模型时所采用的“语句”实质上是表达结构化P2P网络的物理连接关系的集合,因此最终获取的各个节点对应的词向量特征也将包含各自在结构化P2P网络中的特征位置的信息,而词向量特征相似的节点所对应在结构化P2P网络中的特征位置(包含实际的物理位置、与其他的节点之间的拓普连接关系等)也相近,即各个节点的词向量特征所处语义空间一定程度上内化了结构化P2P网络的物理连接关系,从而可以通过判断不同节点对应的词向量特征的相似度来判断不同节点之间的逻辑距离,而逻辑距离越相近的节点之间在结构化P2P网络中所处的特征位置也接近,二者一般在物理上也更为接近。由于结构化P2P网络可能会有新加入的节点,因此结构化P2P网络的网络架构将可能发生变化,这也就会影响各个节点之间的网络连接关系进而最终影响各个节点对应的词向量特征,因此本实施例所涉及的任一节点的词向量特征将处在动态变化之中,这也意味着任一节点维护的路由表也会根据不断变化的与其他节点之间的逻辑距离而进行更新。
可选的,通过以下方式确定第一节点与第二节点之间的最短路径:将第一节点确定为当前节点,并循环执行以下步骤:计算所述当前节点与第二节点之间的最新逻辑距离,基于所述最新逻辑距离在所述当前节点维护的路由表中查找对应的至少一个路由条目;在所述至少一个路由条目中包括第二节点对应的路由条目时,结束循环,并生成第一节点与第二节点之间的最短路径;在所述至少一个路由条目中不包括第二节点对应的路由条目时,将所述当前节点加入第一节点与第二节点之间的最短路径,并将所述至少一个路由条目中任一路由条目对应的节点重新确定为所述当前节点,继续循环。
以上为通过获取到各个节点分别维护的各个路由表来确定第一节点与第二节点之间最短路径的过程,其实质上就是模拟第一节点向第二节点发送消息的过程,该消息的转发路径即所需要的确定的第一节点与第二节点之间最短路径。在该方式下,每次节点转发都将减少当前节点与目的节点之间的逻辑距离,因此可以确保整体的转发效率较高,同时生成的转发路径即属于上述的最短路径。最短路径中包含的节点序列中的节点是逐次添加的,首先节点序列开头是第一节点,然后逐次加入一些中间节点,最后在结束循环时,将第二节点加入至节点序列的尾部,从而生成第一节点与第二节点之间的最短路径。
步骤206:确定所述最短路径集中包含的最短路径对应的最长公共子序列,并将构成所述最长公共子序列的节点确定为所述结构化P2P网络的通信支柱节点。
可选的,所述确定所述最短路径集中包含的最短路径对应的最长公共子序列,包括:采用多重最长公共子序列MLCS算法处理所述最短路径集中包含的所有最短路径以确定所述最长公共子序列。
基于上述方式确定出的最短路径集,执行方可以进一步确定最长公共子序列。在一实施例中,可以采用MLCS(Most Longest Common Subsequence,多重最长公共子序列)算法处理所述最短路径集,以确定其中的最长公共子序列。此时,所述最长公共子序列中的节点即可视为所述结构化P2P网络的通信支柱节点。其中,所述MLCS算法的具体实现过程可以参见相关技术中的记载,不再赘述。
如图3所示,假设最短路径集中仅包括最短路径1、2和3,其中,节点A至节点B之间的最短路径1为“A-C-D-E-B”、节点A至节点D之间的最短路径2为“A-G-C-E-B-D”、节点C至节点B之间的最短路径3为“C-E-F-B”,则通过MLCS算法可以确定出最长公共子序列为“C-E-B”。可见,构成“C-E-B”的节点B、节点C和节点E即为结构化P2P网络的通信支柱节点。
当然,在确定最长公共子序列时,可以使用所述最短路径集中的全部最短路径进行统一计算,即计算全部最短路径之间的最长公共子序列——此时计算出的通信支柱节点即为结构化P2P网络的全局支柱节点。或者,也可以将所述最短路径集中的最短路径划分为多个子集,并分别使用各个子集中的全部最短路径计算各个子集对应的最长公共子序列——任一子集对应的最长公共子序列中包含的节点即为该子集所对应的局部支柱节点,并讲这些局部支柱节点作为通信支柱节点。可以理解的是,在结构化P2P网络的运行过程中,任一全局支柱节点可能影响到该网络中的多数甚至全部节点,而任一子集对应的局部支柱节点则可能影响到该子集对应的全部或部分节点,显然,全局支柱节点比局部支柱节点对结构化P2P网络的影响力相对而言更大,因此可以根据实际情况采用上述不同的计算方式确定最长公共子序列。另外,上述方式计算出的最长公共子序列也可能仅包含一个节点,本说明书并不对此进行限定。
可以理解的是,因为上述最长公共子序列根据最短路径集中的最短路径确定得到,所以最终确定出的任一通信支柱节点即处于至少一个最短路径中。可见,所述通信支柱节点是基于结构化P2P网络中各个节点之间的最短路径发现的,即本说明书确定通信支柱节点的过程依赖于最短路径的确定。正是因为结构化P2P网络中各节点具有相对固定的逻辑位置,才使得各节点的路由策略也相对固定,因此能够形成相对固定的转发路径,也即本申请所述的最短路径。而只有在路径确定性较强的结构化P2P网络中,才能通过 相对确定的最短路径集来确定出具有较大影响力的通信支柱节点(在相对松散的P2P网络中,各个节点之间的转发路径相对随机,因此通过此法确定的通信支柱节点可能不一定承担了较多的消息转发任务,不具备网络影响力),即从理论上可以确保此法确定的通信支柱节点是对于结构化P2P网络的正常运行起到关键作用的重要节点。
步骤208:针对至少一个通信支柱节点执行至少一个维度的能力增强策略,以用于提高所述至少一个通信支柱节点在所述至少一个维度上的能力。
在本说明书实施例中,所述至少一个维度的能力增强策略包括性能维度的性能增强策略和/或安全维度的安全增强策略。具体在执行层面,执行方在确定出结构化P2P网络中的通讯支柱节点后,可以直接向至少一个通信支柱节点发送能力增强通知,以使接收到该通知的通信支柱节点自行执行对应的能力增强策略;或者,执行方也可以直接向资源方发送针对所述至少一个通信支柱节点的能力增强通知,以使该资源方基于该通知直接对所述至少一个通信支柱节点执行对应的能力增强策略,本方式由于并没有直接告知需要增强能力的至少一个通信支柱节点,因此可以使需要增强能力的至少一个通信支柱节点在无感知(不知道自身被确定为通信支柱节点、也不知道自身会被执行能力增强策略)的情况下实现能力增强的效果。
可选的,所述性能增强策略包括:配置高性能的硬件资源、配置硬件资源集群、扩展网络带宽和/或优化网络参数;所述安全增强策略包括:配置增强的网络安全策略和/或配置可信执行环境。上述的高性能的硬件资源或硬件资源集群其具体形式可以是云资源,上述扩展网络带宽具体可以是扩展网络的I/O接口的数量,上述优化网络参数具体可以是扩展路由表的容量、各类网络资源的缓存容量等,上述网络安全策略可以包括防火墙策略、ACL(Access Control Lists,访问控制列表)策略等。容易理解的是,当至少一个通信支柱节点被执行了性能增强策略,则可以在较小成本下整体性地优化结构化P2P网络的消息传输效率;当至少一个通信支柱节点被执行了安全增强策略,则可以在较小成本下整体性地优化结构化P2P网络的消息传输的安全性。
基于本说明书的前述实施例,通过获取结构化P2P网络中各个节点分别维护路由表,从而可以确定包含各个节点之间最短路径的最短路径集,并进一步得到对应的最长公共子序列以及该结构化P2P网络中的通信支柱节点。显然,上述方式发现的通信支柱节点将相对频繁地参与该结构化P2P网络中的各个数据的转发过程,即通信支柱节点是在该结构化P2P网络正常运行过程中起到关键作用的重要节点。因此,在成本有限的情况下,可以优先针对这些通信支柱节点执行能力增强策略,从而相对精准地优化结构化P2P网 络整体的网络能力,从而消耗相对较少的资源成本以获取针对结构化P2P网络整体的网络能力尽可能大的的优化效果。
可选的,还包括:确定所述结构化P2P网络中满足安全性规则的安全节点,并将所述通信支柱节点的身份信息发送至所述安全节点,以使所述安全节点响应于请求方用于请求获取所述安全节点维护的原路由表的节点发现请求执行以下至少一个响应策略:将包含所述原路由表中除所述通信支柱节点的节点信息以外的节点信息(即路由条目)的新路由表,或者包含所述原路由表中随机选取的非全量的节点信息的新路由表返回至所述请求方;和/或,若在所述节点发现请求的接收时刻之前的预设时长内接收到所述请求方发起的历史节点发现请求的数量超出预设数量,则不响应或转发所述请求方的所述节点发现请求。
可以理解的是,通信支柱节点是对于结构化P2P网络的正常运行起到关键作用的重要节点,因此若攻击方针对性的攻击上述通信支柱节点,则可能导致网络运行受到不利影响,甚至网络瘫痪。由确定结构化P2P网络中通信支柱节点的方法可知,要防范这类网络攻击,关键是防止攻击方获取到网络中全部节点的完整路由表。因此为了防范攻击方可能发起的上述攻击,所述执行方可以将上述通信支柱节点的身份信息告知结构化P2P网络中已经确认安全(非攻击方)的安全节点,以由其使用。
例如,执行方可以先确定所述结构化P2P网络中满足安全性规则的安全节点,所述安全规则可以根据历史通信记录、节点对应的用户身份、节点设备的安全防护等级等多种因素制定。满足安全性规则的安全节点,即可认为是结构化P2P网络中已经确认安全的节点,这类节点大概率不会对结构化P2P网络发起攻击,因此所述执行方可以相信所述安全节点,将通过前述方式确定出的通信支柱节点的身份信息发送至所述安全节点。相应的,所述安全节点在接收到请求方发起的节点发现请求(该请求用于请求获取所述安全节点维护的完整路由表)的情况下,可以执行多种响应策略以避免向请求方提供完整的路由表,从而防止请求方确定出通信支柱节点后对其发起网络攻击,一定程度上实现对网络攻击的防范。
上述的响应策略包括:将包含所述原路由表中除所述通信支柱节点的节点信息以外的节点信息的新路由表,或者包含所述原路由表中随机选取的非全量的节点信息的新路由表返回至所述请求方。在本响应策略下,由于请求方无法从安全节点处获取到包含完整节点信息的原路由表,因此其无法通过前述推测网络架构的方式确定出真正的通信支柱节点,其所发起的攻击的不良影响也将被削弱。可见,该响应策略可以通过向请求方 隐藏部分节点的节点信息的方式,防止请求方推测出结构化P2P网络中的通信支柱节点,从而能够有效防范攻击方通过获知和攻击通信支柱节点的方式对结构化P2P网络发起攻击。在返回包含所述原路由表中随机选取的非全量的节点信息的新路由表的策略下,由于安全节点随机选取的路由条目不完全相同,若请求方多次向安全节点发送节点发现请求,则也可能能够根据各次返回的不完整的新路由表来恢复出完整的原路由表。对此,安全节点也可以维护请求方与第一次返回的新路由表之间的映射关系,这样,即便请求方多次向安全节点发送节点发现请求,安全节点也能够基于上述映射关系确保每次都向请求方返回相同的新路由表,从而确保请求方无法通过多次请求来获取完整的原路由表。
上述的响应策略还包括:若在所述节点发现请求的接收时刻之前的预设时长内接收到所述请求方发起的历史节点发现请求的数量超出预设数量,则不响应或转发所述请求方的所述节点发现请求。
若请求方为攻击方,则其可能会在短时间内向结构化P2P网路中的各个节点发起过量的所述节点发现请求,以便尽快获取到各个节点的路由表。对此,安全节点可以通过接收到的(包括目的节点为该安全节点、以及目的节点并非该安全节点而只是经由该安全节点进行转发的)节点发现请求的频率对其进行限制。例如,安全节点在任意一次接收到节点发现请求之后,可以确定该节点发现请求对应的发起方(即请求方)在该请求的接收时刻之前的预设时长内接收到同一请求方发起的历史节点发现请求的数量,如可以通过对自身接收到所有节点发现请求进行统计实现。其中,所述历史节点发现请求就是安全节点在接收所述节点发现请求之前接收到的由该同一请求方发起的所有节点发现请求。基于此,若上述数量超出预设数量,即可判定请求方发起节点发现请求过于频繁,因此请求方存在为攻击方的可能,此时安全节点可以避免响应所述节点发现请求(在所述节点发现请求的目的节点为该安全节点的情况下)或避免转发所述节点发现请求(在所述节点发现请求的目的节点不为该安全节点的情况下),如直接将该请求丢弃。或者,也可以在一段时间之后再响应或转发该请求,以减缓对应请求方获取各个节点路由表的速度——即便该请求方是攻击方,也能够尽量延长其网络攻击的准备阶段所消耗的时间。或者,在所述节点发现请求的目的节点为该安全节点的情况下,可以响应该节点发现请求,向所述请求方返回请求失败应答或包含随机生成的节点信息的新路由表,从而拒绝或误导被认作攻击方的请求方,进一步起到反网络攻击的效果。
图4是一示例性实施例提供的一种设备的示意结构图。请参考图4,在硬件层面,该设备包括处理器402、内部总线404、网络接口406、内存408以及非易失性存储器 410,当然还可能包括其他业务所需要的硬件。本说明书一个或多个实施例可以基于软件方式来实现,比如由处理器402从非易失性存储器410中读取对应的计算机程序到内存408中然后运行。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行方并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
如图5所示,图5是本说明书根据一示例性实施例提供的一种优化结构化P2P网络的装置的框图,该装置可以应用于如图4所示的设备中,以实现本说明书的技术方案。该装置包括:路由表获取单元501,用于获取所述结构化P2P网络中各个节点分别维护的路由表;最短路径集确定单元502,用于根据获取的路由表确定所述结构化P2P网络的最短路径集,所述最短路径集包含所述结构化P2P网络中任意两个节点之间的最短路径,任一最短路径由有向的节点序列构成;通信支柱节点确定单元503,用于确定所述最短路径集中包含的最短路径对应的最长公共子序列,并将构成所述最长公共子序列的节点确定为所述结构化P2P网络的通信支柱节点;能力增强策略执行单元504,用于针对至少一个通信支柱节点执行至少一个维度的能力增强策略,以用于提高所述至少一个通信支柱节点在所述至少一个维度上的能力。
可选的,所述路由表获取单元501具体用于:向所述结构化P2P网络发送入网请求;在接收到所述结构化P2P网络响应于所述入网请求返回的入网响应表明入网成功的情况下,向所述各个节点分别发起节点发现请求;获取所述各个节点响应于所述节点发现请求各自分别返回的路由表。
可选的,任一节点的路由表包含的任一路由条目的索引包括:所述任一节点与所述任一路由条目对应的节点之间的逻辑距离。
可选的,任意两个节点之间的逻辑距离由所述任意两个节点分别对应的节点标识执行异或运算以确定,任一节点对应的节点标识由固定位数的二进制码所构成,不同节点对应的节点标识不同;或者,所述任意两个节点之间的逻辑距离由所述任意两个节点分别对应的词向量特征执行相似度运算以确定,任一节点对应的词向量特征通过语义模型生成,所述语义模型通过所述结构化P2P网络中包含的网络路径训练生成,任一网络路径由有向的节点序列构成,该节点序列上彼此相邻的节点在物理上直连。
可选的,所述最短路径集确定单元502通过以下方式确定第一节点与第二节点之间的最短路径:将第一节点确定为当前节点,并循环执行以下步骤:计算所述当前节点与第二节点之间的最新逻辑距离,基于所述最新逻辑距离在所述当前节点维护的路由表中 查找对应的至少一个路由条目;在所述至少一个路由条目中包括第二节点对应的路由条目时,结束循环,并生成第一节点与第二节点之间的最短路径;在所述至少一个路由条目中不包括第二节点对应的路由条目时,将所述当前节点加入第一节点与第二节点之间的最短路径,并将所述至少一个路由条目中任一路由条目对应的节点重新确定为所述当前节点,继续循环。
可选的,所述通信支柱节点确定单元503具体用于:采用多重最长公共子序列MLCS算法处理所述最短路径集中包含的所有最短路径以确定所述最长公共子序列。
可选的,所述至少一个维度的能力增强策略包括性能维度的性能增强策略和/或安全维度的安全增强策略。
可选的,所述性能增强策略包括:配置高性能的硬件资源、配置硬件资源集群、扩展网络带宽和/或优化网络参数;所述安全增强策略包括:配置增强的网络安全策略和/或配置可信执行环境。
可选的,所述结构化P2P网络为区块链网络。
可选的,所述结构化P2P网络通过Kademlia算法构建。
可选的,还包括:安全节点确定单元505,用于确定所述结构化P2P网络中满足安全性规则的安全节点,并将所述通信支柱节点的身份信息发送至所述安全节点,以使所述安全节点响应于请求方用于请求获取所述安全节点维护的原路由表的节点发现请求执行以下至少一个响应策略:将包含所述原路由表中除所述通信支柱节点的节点信息以外的节点信息的新路由表,或者包含所述原路由表中随机选取的非全量的节点信息的新路由表返回至所述请求方;和/或,若在所述节点发现请求的接收时刻之前的预设时长内接收到所述请求方发起的历史节点发现请求的数量超出预设数量,则不响应或转发所述请求方的所述节点发现请求。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件 编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如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)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为服务器系统。当然,本发明不排除随着未来计算机技术的发展,实现上述实施例功能的计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
虽然本说明书一个或多个实施例提供了如实施例或流程图所述的方法操作步骤,但 基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。例如若使用到第一,第二等词语用来表示名称,而并不表示任何特定的顺序。
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
本发明是参照根据本发明实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或 其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储、石墨烯存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
本领域技术人员应明白,本说明书一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本本说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统 实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
以上所述仅为本说明书一个或多个实施例的实施例而已,并不用于限制本本说明书一个或多个实施例。对于本领域技术人员来说,本说明书一个或多个实施例可以有各种更改和变化。凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在权利要求范围之内。

Claims (14)

  1. 一种优化结构化P2P网络的方法,包括:
    获取所述结构化P2P网络中各个节点分别维护的路由表;
    根据获取的路由表确定所述结构化P2P网络的最短路径集,所述最短路径集包含所述结构化P2P网络中任意两个节点之间的最短路径,任一最短路径由有向的节点序列构成;
    确定所述最短路径集中包含的最短路径对应的最长公共子序列,并将构成所述最长公共子序列的节点确定为所述结构化P2P网络的通信支柱节点;
    针对至少一个通信支柱节点执行至少一个维度的能力增强策略,以用于提高所述至少一个通信支柱节点在所述至少一个维度上的能力。
  2. 根据权利要求1所述的方法,所述获取所述结构化P2P网络中各个节点分别维护的路由表,包括:
    向所述结构化P2P网络发送入网请求;
    在接收到所述结构化P2P网络响应于所述入网请求返回的入网响应表明入网成功的情况下,向所述各个节点分别发起节点发现请求;
    获取所述各个节点响应于所述节点发现请求各自分别返回的路由表。
  3. 根据权利要求1所述的方法,任一节点的路由表包含的任一路由条目的索引包括:所述任一节点与所述任一路由条目对应的节点之间的逻辑距离。
  4. 根据权利要求3所述的方法,任意两个节点之间的逻辑距离由所述任意两个节点分别对应的节点标识执行异或运算以确定,任一节点对应的节点标识由固定位数的二进制码所构成,不同节点对应的节点标识不同;或者,
    所述任意两个节点之间的逻辑距离由所述任意两个节点分别对应的词向量特征执行相似度运算以确定,任一节点对应的词向量特征通过语义模型生成,所述语义模型通过所述结构化P2P网络中包含的网络路径训练生成,任一网络路径由有向的节点序列构成,该节点序列上彼此相邻的节点在物理上直连。
  5. 根据权利要求3所述的方法,通过以下方式确定第一节点与第二节点之间的最短路径:
    将第一节点确定为当前节点,并循环执行以下步骤:
    计算所述当前节点与第二节点之间的最新逻辑距离,基于所述最新逻辑距离在所述当前节点维护的路由表中查找对应的至少一个路由条目;
    在所述至少一个路由条目中包括第二节点对应的路由条目时,结束循环,并生成第 一节点与第二节点之间的最短路径;
    在所述至少一个路由条目中不包括第二节点对应的路由条目时,将所述当前节点加入第一节点与第二节点之间的最短路径,并将所述至少一个路由条目中任一路由条目对应的节点重新确定为所述当前节点,继续循环。
  6. 根据权利要求1所述的方法,所述确定所述最短路径集中包含的最短路径对应的最长公共子序列,包括:
    采用多重最长公共子序列MLCS算法处理所述最短路径集中包含的所有最短路径以确定所述最长公共子序列。
  7. 根据权利要求1所述的方法,所述至少一个维度的能力增强策略包括性能维度的性能增强策略和/或安全维度的安全增强策略。
  8. 根据权利要求7所述的方法,所述性能增强策略包括:配置高性能的硬件资源、配置硬件资源集群、扩展网络带宽和/或优化网络参数;
    所述安全增强策略包括:配置增强的网络安全策略和/或配置可信执行环境。
  9. 根据权利要求1所述的方法,所述结构化P2P网络为区块链网络。
  10. 根据权利要求1所述的方法,所述结构化P2P网络通过Kademlia算法构建。
  11. 根据权利要求1所述的方法,还包括:
    确定所述结构化P2P网络中满足安全性规则的安全节点,并将所述通信支柱节点的身份信息发送至所述安全节点,以使所述安全节点响应于请求方用于请求获取所述安全节点维护的原路由表的节点发现请求执行以下至少一个响应策略:
    将包含所述原路由表中除所述通信支柱节点的节点信息以外的节点信息的新路由表,或者包含所述原路由表中随机选取的非全量的节点信息的新路由表返回至所述请求方;和/或,
    若在所述节点发现请求的接收时刻之前的预设时长内接收到所述请求方发起的历史节点发现请求的数量超出预设数量,则不响应或转发所述请求方的所述节点发现请求。
  12. 一种优化结构化P2P网络的装置,包括:
    路由表获取单元,用于获取所述结构化P2P网络中各个节点分别维护的路由表;
    最短路径集确定单元,用于根据获取的路由表确定所述结构化P2P网络的最短路径集,所述最短路径集包含所述结构化P2P网络中任意两个节点之间的最短路径,任一最短路径由有向的节点序列构成;
    通信支柱节点确定单元,用于确定所述最短路径集中包含的最短路径对应的最长公共子序列,并将构成所述最长公共子序列的节点确定为所述结构化P2P网络的通信支柱 节点;
    能力增强策略执行单元,用于针对至少一个通信支柱节点执行至少一个维度的能力增强策略,以用于提高所述至少一个通信支柱节点在所述至少一个维度上的能力。
  13. 一种电子设备,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-11中任一项所述的方法。
  14. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求1-11中任一项所述方法的步骤。
PCT/CN2022/135297 2022-07-29 2022-11-30 结构化p2p网络优化 WO2024021412A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210908253.3 2022-07-29
CN202210908253.3A CN115277540B (zh) 2022-07-29 2022-07-29 一种优化结构化p2p网络的方法、装置、电子设备及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2024021412A1 true WO2024021412A1 (zh) 2024-02-01

Family

ID=83772017

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/135297 WO2024021412A1 (zh) 2022-07-29 2022-11-30 结构化p2p网络优化

Country Status (2)

Country Link
CN (1) CN115277540B (zh)
WO (1) WO2024021412A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277540B (zh) * 2022-07-29 2024-03-26 蚂蚁区块链科技(上海)有限公司 一种优化结构化p2p网络的方法、装置、电子设备及计算机可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7420923B2 (en) * 2001-03-13 2008-09-02 Telefonaktiebolaget Lm Ericsson (Publ) Optimizing software distribution in large communication networks
CN107306224A (zh) * 2016-04-19 2017-10-31 华为技术有限公司 一种路由路径更新方法及网络管理装置
CN107592269A (zh) * 2016-07-06 2018-01-16 华为技术有限公司 传输路径的负载信息的方法和网络节点
CN108494596A (zh) * 2018-03-23 2018-09-04 西安电子科技大学 多个vnf间依赖的协同式构建与映射sfc方法
CN115277540A (zh) * 2022-07-29 2022-11-01 蚂蚁区块链科技(上海)有限公司 一种优化结构化p2p网络的方法及装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729362A (zh) * 2008-10-22 2010-06-09 华为技术有限公司 实现结构化p2p网络拓扑优化的方法、设备及系统
CN104243320A (zh) * 2014-09-10 2014-12-24 珠海市君天电子科技有限公司 一种优化网络访问路径的方法及装置
CN106506188B (zh) * 2015-09-08 2019-11-08 阿里巴巴集团控股有限公司 一种确定关键节点的方法和设备
US10666547B2 (en) * 2018-10-25 2020-05-26 Ca, Inc. Efficient machine learning for network optimization
CN110336741B (zh) * 2019-08-20 2021-05-18 深圳市中仁信息科技有限公司 一种适于P2P即时通信的Kad算法的优化方法
CN110796543B (zh) * 2019-09-26 2024-02-27 北京淇瑀信息科技有限公司 基于关系网络的定制信息获取方法、装置及电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7420923B2 (en) * 2001-03-13 2008-09-02 Telefonaktiebolaget Lm Ericsson (Publ) Optimizing software distribution in large communication networks
CN107306224A (zh) * 2016-04-19 2017-10-31 华为技术有限公司 一种路由路径更新方法及网络管理装置
CN107592269A (zh) * 2016-07-06 2018-01-16 华为技术有限公司 传输路径的负载信息的方法和网络节点
CN108494596A (zh) * 2018-03-23 2018-09-04 西安电子科技大学 多个vnf间依赖的协同式构建与映射sfc方法
CN115277540A (zh) * 2022-07-29 2022-11-01 蚂蚁区块链科技(上海)有限公司 一种优化结构化p2p网络的方法及装置

Also Published As

Publication number Publication date
CN115277540A (zh) 2022-11-01
CN115277540B (zh) 2024-03-26

Similar Documents

Publication Publication Date Title
EP3975506A1 (en) Methods and apparatuses for transmitting messages
US11233849B2 (en) Message transmission methods and apparatuses
CN108337170B (zh) 分布式资源查找方法和系统
CN111338806B (zh) 一种业务控制方法及装置
WO2024021412A1 (zh) 结构化p2p网络优化
US20200374231A1 (en) Managing network traffic flows
WO2023093041A1 (zh) 区块链状态数据处理方法
EP3975005B1 (en) Message transmission methods and apparatuses
WO2008089616A1 (fr) Serveur, système réseau p2p et procédé d'acheminement et de transfert de l'affectation de la clé de ressource de ce dernier.......
US7475128B2 (en) Information processing device, information processing method, and computer program
CN113300851B (zh) 基于dht的区块链消息广播方法、电子设备及存储介质
WO2021103207A1 (zh) 基于在网计算的分布式信息检索方法、系统与装置
Hassanzadeh-Nazarabadi et al. DHT-based edge and fog computing systems: infrastructures and applications
CN116232971A (zh) 一种基于结构化p2p中继网络的通讯方法和网络系统
CN113067772B (zh) 区块链网络间的交易转发方法
US10911207B1 (en) Reusable acknowledgments
EP3979564A1 (en) Device virtualization method, apparatus, system, device, and storage medium
EP3779691B1 (en) Data processing method and apparatus
CN115277717B (zh) 发现通信支柱节点和防范网络攻击的方法、装置、电子设备及计算机可读存储介质
CN115567541B (zh) 区块链网络、节点集合的维护方法及装置
CN115567542B (zh) 节点集合的维护方法及装置
CN112954074B (zh) 一种区块链网络连接方法及装置
CN116389163B (zh) 区块链交易始发节点ip追踪方法、风险监测方法及装置
CN115550251B (zh) 区块链网络、节点集合的维护方法及装置
KR20230094346A (ko) 오픈 데이터 생태계의 표준 참조 모델을 고려한 지능형 데이터 허브 분산 탐색 기술

Legal Events

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

Ref document number: 22952846

Country of ref document: EP

Kind code of ref document: A1