WO2011150741A1 - Point to point (p2p) overlay network, data resources operation method and new node join method thereof - Google Patents
Point to point (p2p) overlay network, data resources operation method and new node join method thereof Download PDFInfo
- Publication number
- WO2011150741A1 WO2011150741A1 PCT/CN2011/074167 CN2011074167W WO2011150741A1 WO 2011150741 A1 WO2011150741 A1 WO 2011150741A1 CN 2011074167 W CN2011074167 W CN 2011074167W WO 2011150741 A1 WO2011150741 A1 WO 2011150741A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- node
- domain
- resource
- overlay network
- new
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1059—Inter-group management mechanisms, e.g. splitting, merging or interconnection of groups
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1044—Group management mechanisms
- H04L67/1046—Joining mechanisms
Definitions
- the present invention relates to the field of communications, and in particular to a P2P overlay network, a data resource operation method thereof, and a new node force input method.
- BACKGROUND A Distributed Hash Table (DHT) network is an implementation technology of a Point To Point (P2P) network. It uses distributed hash table technology to implement resource storage and lookup.
- DHT Distributed Hash Table
- P2P Point To Point
- It uses distributed hash table technology to implement resource storage and lookup.
- the entire P2P network is divided into multiple domains, each identified by a unique domain ID. Nodes in the same domain have the same domain ID, and all nodes are identified by a unique node ID.
- the resource identifier also carries the domain ID to indicate which domain the corresponding resource belongs to, and each resource has a resource ID to uniquely identify.
- both the node identifier and the resource identifier have a domain.
- the information, and the domain IDs used in the node identifier and the resource identifier are the same length, and the information represented is the same.
- each i or resource element i is i or ID, for example, port 3, the identifier of resource X is i or ID (0101) + resource ID (13XX); and the front part of each i or node identifier is also i or ID, for example, the target i of node M is only i or ( 0101 ) + node ID ( 22XX )##
- the node when the node searches for resources, it first compares the search resource identifiers. Whether the domain ID and the domain ID in the local node ID are equal. If they are equal, the resource being queried is considered to be the domain, and then the resource is searched in the local domain.
- the resource is considered to be a resource of another domain, and the query message is routed. Go to the domain indicated by the domain ID, and then perform intra-domain lookup to finally find the requested resource.
- the following describes the resource search in the prior art with reference to Figure 2.
- Figure 2 it is assumed that there are three domain IDs. 0101, 0201, and 0301.
- the domain ID included in the resource ID is determined to be in the local domain (the domain ID in the resource identifier is equal to the domain ID of the local node), and the query request is routed to the domain to store the resource.
- Node M as shown in Figure 2.
- the L node finds that the queried resource is in domain 0301. It is learned through the routing table that it can be linked to the 0301 domain through the P point (the domain ID in the resource identifier). And the 0301 domain ID is equal), the L node routes the query request to the P node, and the P node determines that the queried resource is in the local domain, and routes the query request to the node N where the resource is saved, and the path is as shown in FIG. 2 .
- the existing multi-domain architecture cannot be flexibly configured, and reasonable domain planning cannot be performed according to the size of the domain.
- a primary object of the present invention is to provide a P2P overlay network, a data resource operation method thereof, and a new node join method, to at least solve the above problems.
- a P2P overlay network including: a plurality of node domains, wherein each node domain is connected to each other, and nodes in each node domain are configured to store data resources of a P2P overlay network, wherein the data resources It is divided into multiple resource domains, and the data resources stored by each node of one node domain belong to the same resource domain.
- Each of the plurality of resource domains has the same geographical location information.
- the node domain ID of each node domain contains the resource domain ID of the resource domain to which the data resource stored by the node domain belongs.
- the plurality of nodes of the P2P overlay network are further configured to store a first correspondence between a domain name of each resource domain in the plurality of resource domains and a resource domain ID.
- the plurality of nodes of the P2P overlay network are further configured to store a second correspondence between the node domain ID of each node domain in the plurality of node domains and the routing information of the node domain.
- the node ID of each node contains the node domain ID of the node domain to which the node belongs.
- the resource identifier of each data resource contains the resource domain ID of the resource domain to which the data resource belongs.
- a data resource operation method for a P2P overlay network including: an access node of a P2P overlay network receives an operation request sent by a requester, where the operation request is used to request a P2P overlay network The stored data resource performs a predetermined operation; the access node acquires a node domain that stores the data resource; the access node sends the operation request to a node in the node domain that stores the data resource; the node performs the predetermined operation on the data resource .
- the node domain that the access node acquires the data resource includes: the resource identifier of the data resource that the access node acquires, where the resource identifier includes: a resource domain ID of the resource domain to which the data resource belongs and a resource ID of the data resource in the resource domain;
- the node matches the resource identifier with the node domain ID of each node domain of the P2P overlay network to obtain the node domain corresponding to the longest matching node domain ID, wherein the node domain ID of each node domain includes: the node domain storage The resource domain ID of the resource domain to which the data resource belongs.
- the operation request carries the resource identifier of the data resource, and the access node obtains the resource identifier of the data resource, where the access node obtains the resource identifier from the operation request.
- the operation request carries the name of the data resource and the domain name of the resource domain to which the data resource belongs, and the resource identifier of the access node to obtain the data resource includes: the access node according to the domain name and the resource domain of each resource domain stored in the P2P overlay network.
- the access node acquires the resource ID in the domain of the data resource according to the name of the data resource; the access node according to the obtained resource domain ID and the domain
- the resource ID which is the resource identifier of the data resource. If the acquired node domain is the node domain to which the access node belongs, the node that sends the operation request to the node that stores the data resource in the node domain includes: the access node acquires the node that stores the resource data according to a predetermined algorithm; the access node An operation request is sent to the node.
- the node that sends the operation request to the node that stores the data resource in the node domain includes: the node domain ID of each node domain stored by the access node according to the P2P overlay network and the node
- the second correspondence of the routing information of the node domain acquires routing information corresponding to the longest matching node domain ID; the access node sends the operation request to the connecting node of the node domain corresponding to the node domain ID according to the routing information; According to a predetermined algorithm, a node storing the resource data is obtained, and an operation request is sent to the node.
- a new node joining method for a P2P overlay network including: a new node sends a request for a request to join a P2P overlay network to an access node of a P2P overlay network, where The join request message carries the node identifier of the new node; the access node determines the node domain to which the new node belongs according to the node identifier, and sends the join request message to the responsible node of the new node in the node domain, where the responsible node a node whose identifier is the closest to the node identifier of the new node; the responsible node receives the join request message, and returns a response message, and the response message is returned to the new node according to the routing path of the join request message, where the response message carries There is identification information of the responsible node.
- the node identifier of the new node includes: a node domain ID of the node domain to which the new node belongs and a node ID of the new node in the node domain, and the access node determines, according to the node identifier, the node domain to which the new node belongs: the access node will The node identifier of the new node is matched with the node domain ID of each node domain of the P2P overlay network, and the node domain corresponding to the longest matching node domain ID is determined to be the node domain to which the new node belongs. If the node domain to which the new node belongs is the node domain to which the access node belongs, the access node will join the request message.
- the responsible node of the new node in the node domain includes: the access node acquires the responsible node of the new node according to a predetermined algorithm; The node forwards the join request message to the responsible node. If the node domain to which the new node belongs is not the node domain to which the access node belongs, the access node will join the request message.
- the responsible node of the new node in the node domain includes: the node domain ID of each node domain stored by the access node according to the P2P overlay network.
- the access node Corresponding to the second correspondence between the routing information of the node domain, obtaining routing information corresponding to the longest matching node domain ID; the access node sending the joining request message to the connecting node of the node domain corresponding to the node domain ID according to the routing information
- the connecting node acquires the responsible node of the new node according to a predetermined algorithm, and sends a join request message to the responsible node.
- the method further includes: the new node acquiring the node identifier, where the node identifier is allocated by the configuration server of the P2P overlay network or the new node is based on the attribute information thereof. Generated.
- the method further includes: the new node acquiring the identification information of the responsible node carried in the response message, and performing message interaction with the responsible node according to the identification information.
- the method further includes: the new node sending an out-of-domain broadcast message to the connection node of the other node domain other than the node domain to which it belongs, notifying the other node domain that a new node joins.
- the resource domain and the node domain are separated. When the resource data of a certain resource domain is relatively large, the resource data of the resource domain can be distributed to run in multiple node domains, thereby reducing system maintenance.
- FIG. 3 is a P2P overlay network according to an embodiment of the present invention.
- FIG. 4 is a flowchart of a data resource operation method of a P2P overlay network according to an embodiment of the present invention.
- FIG. 5 is a schematic diagram of operations on data resources in a P2P overlay network according to an embodiment of the present invention;
- FIG. 7 is a flowchart of a new node joining method of a P2P overlay network according to an embodiment of the present invention;
- FIG. 4 is a flowchart of a data resource operation method of a P2P overlay network according to an embodiment of the present invention.
- FIG. 5 is a schematic diagram of operations on data resources in a P2P overlay network according to an embodiment of the present invention.
- FIG. 9 is a diagram of a preferred embodiment of a new node joining method for a P2P overlay network according to an embodiment of the present invention.
- BEST MODE FOR CARRYING OUT THE INVENTION the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
- a P2P overlay network is first provided, in which a resource domain and a node domain are separated.
- FIG. 3 is a schematic structural diagram of a P2P overlay network according to an embodiment of the present invention. As shown in FIG.
- data resources in an entire P2P network are divided into multiple resources.
- the domain (a box in Figure 3 represents a resource domain), and the nodes in the entire P2P overlay network are divided into multiple node domains (one circle in Figure 3 represents a node domain), and the data resources of each resource domain It can be responsible for one node domain or multiple node domains. That is, the data resources of one resource domain can be stored in each node of a node domain, or can be stored in each node of multiple node domains. The amount of data resources included in the resource domain is determined. When a resource resource of a resource domain is large, the data resource of the resource domain may be stored in multiple node domains.
- the data resources stored by each node of a node domain belong to the same resource domain.
- the division of resource domains can be performed according to geographical location, for example, Shanghai domain, Nanjing domain, Beijing domain, and the like.
- the geographical location information on which the division is based may be the resource or the administrative area where the user is located, or may be divided into regions according to the operator.
- a resource management domain can deploy only one node domain. For example, a Nanjing resource domain can be deployed in a node domain, and a Shanghai resource domain is also a node domain. However, if there are many resources (users) in the resource domain, the node size of the deployed node domain will be large.
- each resource domain has a domain name, and has a unique identifier (referred to as a resource domain ID) corresponding thereto.
- resource domain ID a unique identifier
- the division of the node domain may be performed according to the geographical location, or may be divided according to other methods such as an IP address, and each node domain has a node domain ID.
- the node domain ID of the node domain The resource domain ID of the resource domain to which the data resource stored in the node domain belongs may be included, that is, the length of the resource domain ID is less than or equal to the length of the node domain ID.
- the resource domain ID may be used as a prefix of the node domain ID, or The resource domain ID can also be used as a predetermined bit of the node domain ID, for example, the last four digits, and the like.
- the node identifier of each node in the node domain may be represented by the node domain ID.
- the node identifier may include the node domain ID to which the node belongs and the node ID of the node in the node domain.
- node identification node domain ID + node ID
- the resource ID and the node ID may be obtained by using a predetermined intra-domain DHT algorithm, so that the resource ID of the data resource is related to the node ID of the node storing the data resource.
- Figure 3 contains five node domains.
- the node domain ID of each node domain contains the ID of the resource to which the stored data resource belongs.
- the five node domains in Figure 3 can be 0301, 0201, 01011, respectively. 01012, 01013.
- the node domain and the node domain of the P2P overlay network may use a full connection mode, and the node domain ID of each node domain and the routing information of the node domain may be stored in each node of the P2P overlay network.
- the correspondence relationship is such that a connection can be established between the respective node domains.
- the correspondence relationship can be stored by using a mapping table as shown in Table 2. Table 2. Inter-domain routing table
- the resource domain and the node domain in which the resource domain is located may have the same ID of the resource domain and the ID of the node domain, but the ID of the resource domain is included in the node.
- the node domain where the resource domain is located can be obtained by the longest match. For example, if one resource domain is deployed to multiple node domains, the domain ID of the resource domain can be the longest match in the domain ID of the node domain. .
- the resource domain and the node domain are separated, so that the data resources of one resource domain can be stored by one or more node domains.
- the domain name is dom-b.com.cn. All data resources in the domain are responsible for the nodes in the three node domains (domain IDs 01011, 01012, and 01013).
- the resource domain and the node domain can be separated. If the resource data of a resource management domain is relatively large, the number of nodes is also very large, and the system can be deployed to run in multiple node domains. The maintenance overhead will not be too great. In this way, the overlay network can be flexibly configured according to the actual situation. Thereby improving the performance of the entire overlay network.
- the data resource operation method of the above P2P overlay network provided by the embodiment of the present invention is described below.
- Step S402 a connection of a P2P overlay network
- the ingress node receives an operation request sent by the requesting party, where the operation request is used to request to perform a predetermined operation on a certain data resource stored in the P2P overlay network; specifically, the predetermined operation may be querying, storing, or modifying a certain data resource.
- Step S404 The access node acquires a node domain that stores the data resource.
- Step S406 The access node sends the operation request to a node that stores the data resource in the node domain.
- the data resource operation method of the P2P overlay network in the foregoing embodiment of the present invention may perform a predetermined operation on a data resource stored in a P2P overlay network in which the node domain and the resource domain are separated. Details of the processing of the above steps are further described below.
- Step S402 In the specific implementation process, when the user needs to perform some operation on a certain data resource in the P2P overlay network, the client sends a request to the access node connected to the client in the P2P overlay network through the client. Request, request to perform an operation on a data resource.
- the user needs to query the data resource abc whose domain name is dom-c.com.cn, that is, query abc@dom-c.com.cn, and the user sends a query request through its client.
- the name of the data resource to be operated and the domain name of the resource domain in which the client is located may be converted into the resource identifier of the data resource, for example, abc@dom- C.com.cn is converted into the resource identifier 02012213 of the data resource, and the resource identifier of the data resource is carried in the operation request and sent to the access node of the P2P overlay network; or, the client may only use the data resource
- the name and the domain name of the resource domain in which it resides are carried in the operation request and sent to the access node, and the access node converts the name of the resource and the domain name of the resource domain into the resource identifier of the data resource.
- Step S404 In the specific implementation process, if the resource identifier of the data resource includes the resource domain ID of the resource domain to which the data resource belongs and the resource ID of the data resource in the resource domain, and the node domain ID of the node domain includes the node
- the resource domain ID of the resource domain to which the data resource stored in the domain belongs can obtain the node domain in which the data resource is stored by the longest matching method. That is, the access node performs the longest match between the resource identifier and the node domain ID of each node domain of the P2P overlay network, and obtains the node domain corresponding to the longest matching node domain ID, where the node domain is the node that stores the data resource. area.
- the resource domain ID may be used as a prefix of the node domain ID, or may be located at a predetermined location of the node domain ID (for example, the last few digits); and the resource identifier includes: a resource domain ID and a resource ID, where the resource domain The ID may be used as a prefix of the resource identifier, or may be located at a predetermined location of the resource identifier (the predetermined location may be pre-agreed), and the resource ID is calculated by using an intra-domain algorithm.
- the longest matching node domain ID may be directly obtained by using the longest matching method of the prefix; or Obtaining, according to a predetermined agreement, a resource domain ID included in the node domain ID from a predetermined location of the node domain ID, and obtaining a resource domain ID of the resource domain to which the data resource belongs from the predetermined location of the resource identifier, and setting the two resource domain IDs Matching is performed. If the matching is successful, the remaining bits in the resource identifier are matched with the remaining bits of the node domain ID, so that the longest matching node domain ID can be obtained.
- the node domain of each resource domain may be stored in the P2P overlay network, or the node domain of each data resource may be stored. For example, it may be recorded in which node the data resource whose resource identifier is in a certain range is stored. Etc., based on the information, the access node can determine the node domain in which the data resource is stored.
- Step S406 In the specific implementation process, if the node domain determined in the foregoing step S404 is the node domain (ie, the local domain) where the access node is located, the access node may obtain the storage according to the preset intra-domain algorithm.
- the access node if the node domain determined in the foregoing step S404 is not the node domain where the access node is located, the access node is pre-stored according to the P2P network.
- Corresponding relationship between the node domain ID and the routing information of the node domain may obtain the routing information of the node domain determined in step S404, and according to the routing information, the access node forwards the operation request to the The connection node of the node domain.
- the connection node After receiving the operation request, the connection node determines that the data resource is stored in the local domain, and obtains a node that stores the data resource in the local domain according to a predetermined intra-domain algorithm, and forwards the operation request to the node.
- Step S408 After receiving the operation request, the node storing the data resource performs a predetermined operation on the data resource according to the instruction of the operation request, that is, queries, stores, or modifies the data resource, if it is a query operation, The node returns corresponding data to the requester according to the path of the operation request, and if it is a storage or modification operation request, the node returns a corresponding response message to the request according to the path of the operation request.
- the P2P overlay network shown in FIG. 5 is taken as an example to describe a preferred implementation manner of the data resource operation method of the P2P overlay network in the embodiment of the present invention. In Figure 5, the ID is described in hexadecimal.
- the resource i or ID of the resource domain dom-b.com.cn is 0101, which corresponds to three nodes i or ID is 01011.
- the node i of 01012 and 01013 or; and the resource domain ID of the resource domain dom-a.com.cn is 0301, which corresponds to a node i with a node domain ID of 0301; and the resource of resource i or dom-c com.cn
- the i or ID is 0201, which corresponds to a node domain with a node domain ID of 0201.
- the user queries/stores/modifies a resource domain name to the P2P overlay network through client A (Client A) as the resource data of the dom-c.com.cn domain, for example, abc@dom-c. Com. cn.
- the data resource is stored or stored in an E-node in a node domain with a node domain ID of 0201.
- FIG. 6 is a flowchart of a specific implementation. As shown in FIG. 6, the method mainly includes the following steps: Step-Chen 601, Client A will The resource abc@dom-c. com.
- cn is converted into a resource identifier of 02012213;
- Client A can query the domain name mapping table (as shown in Table 1), and obtain the resource domain ID of the resource domain whose domain name is Dom-c.com.cn is 0201. By using the intra-domain algorithm, "abc" can be calculated. The corresponding resource ID is 2213, so that the resource identifier ID of the data resource is 0201-2213.
- Step 602 Client A sends a query/storage/modification resource request message to the connection node B, where the resource identifier carried in the request is 0201-2213;
- Step 603 the node B (node domain ID is 01011) is based on the resource identifier 0201- 2213 In the inter-domain routing table (shown in Table 2), the longest matching node domain ID, find the longest matching node domain ID is 0201, determine that the node domain ID is not the local domain ID, therefore, responsible for the data resource 0201
- the node of -2213 is not in the domain; step 604, the node B obtains the routing information corresponding to the node domain ID0201 according to the table 2, and obtains the connection node of the node domain 0201 as A, and then forwards the request message received in the above step 602 to the connection.
- Step 606 Node A According to the algorithm used in the domain (such as Chord, Pastry, etc.), the final message is routed to the node E storing the data resource;
- Steps 608 ⁇ 610 Node E Send ring
- the message is returned to Client A. If the data resource is queried, the response message carries the data that is queried.
- FIG. 7 is a flowchart of a method for joining a new node of a P2P overlay network according to an embodiment of the present invention. As shown in FIG. 7, the method mainly includes the following steps (step S702 - step S706): Step S702, the new node superimposes the network to the P2P.
- the access node sends a join request message requesting to join the P2P overlay network, where the join request message carries the node identifier of the new node; Step S704, the access node determines the node domain to which the new node belongs, and sends the join request message to the responsible node of the new node in the node domain, where the responsible node is the node identifier of the node identifier and the new node.
- the neighboring node receives the above-mentioned join request message, and returns a response message, and the response message is returned to the new node according to the routing path of the join request message, wherein the response message carries the identification information of the responsible node.
- a new node may be added in a P2P overlay network in which the node domain and the resource domain are separated. Details of each of the above processes are further described below.
- Step 4 S S702 before the new node sends a join request message to an access node of the P2P overlay network, the new node first acquires the node identifier.
- the method for the new node to obtain the node identifier includes, but is not limited to, the following two methods: Method 1, the new node sends a request to the configuration server, and the configuration server allocates the node identifier of the new node, as shown in FIG.
- the new node As shown in the second method, the new node generates its node identifier according to its own IP address and other information. If the node identifier of the new node is obtained by using the foregoing method 1, the configuration server allocates the node identifier to the new node at the same time, and allocates the access node to the new node at the same time; if the node identifier of the new node is obtained by using the foregoing method 2, the P2P The access nodes of the overlay network can be manually configured. After obtaining the configured access node, the new node sends a join request message to the access node, requesting to join the P2P overlay network, where the request message carries the node identifier of the new node.
- the access node may perform the longest match by the node identifier of the new node and the node domain ID of each node domain in the P2P overlay network.
- the node domain to which the node whose node identifier is within a certain range may be pre-stored when the network is set up, thereby acquiring the node domain to which the new node belongs.
- the node identifier of the new node in the above step S702 includes: the node domain ID of the node domain to which the new node belongs and the new node
- the node domain to which the new node belongs may be the local domain of the foregoing access node, or may not be the local domain of the access node.
- the access node sends the join request message to the new domain in the node domain.
- the responsible node of the node has two ways of processing: Mode 1, the new node and the access node are in the same node domain. After determining that the new node is in the local domain, the access node calculates the responsible node of the new node according to the intra-domain algorithm. Specifically, the responsible node has a node identifier greater than the node identifier of the new node, and the node identifier and the new node identifier The node of the node identifies the closest node, and then forwards the above join request message to the responsible node; mode 2, the new node and the access node are not in the same node domain.
- the access node obtains the routing information of the node domain where the new node is located according to the foregoing Table 2, and forwards the joining request message to the connecting node of the node domain according to the routing information.
- the connecting node determines that the new node is determined in the local domain (specifically, may be determined by using the longest matching method described above, or may be determined according to pre-stored information), and the intra-domain algorithm is used to calculate the responsible node of the new node, and The above join request message is sent to the responsible node.
- Step 4 The S706-receiving node returns a response message to the new node according to the routing path of the join request message after receiving the join request message, where the response message carries the identifier information of the responsible node.
- the new node learns the identification information of the responsible node from the response message, and performs interaction with the responsible node according to the identification information to obtain a routing table of the P2P overlay network, and the new node is responsible for Data resources, etc., are added to the P2P overlay network. Moreover, after receiving the response message, the new node sends an out-of-domain broadcast message to other out-of-domain access points to notify other domains, new nodes join, and receive response messages sent by other out-of-domain nodes.
- the P2P overlay network shown in Figure 8 is taken as an example to describe the preferred implementation of the new node joining the P2P overlay network.
- Figure 9 shows the process power of the new node joining the P2P overlay network, as shown in Figure 9.
- the new node joins the P2P overlay network mainly includes the following steps: Step 901: The new node obtains its node identifier. In the specific implementation process, the new node obtains the node identifier in two ways: Method 1, the new node sends a request to the configuration server, Configure the server to assign node IDs and overlay network access nodes, as shown in Figure 8. Method 2: The new node generates a node identifier according to its own IP address and other information, and the overlay network access node is manually configured. For example, the node identifier of the new node N is 01012340.
- Step 902 the new node sends a request message to the access node of the P2P overlay network, where the join request message carries the node identifier of the new node; the access node is the new node connected to the P2P.
- An access point of the overlay network is generally obtained by the configuration server or manually.
- Step 903: The access node B (NodeID 01011345) queries the i or the inter-exchange table (Table 2), and matches the node identifier of the new node with the node domain ID of each node domain for the longest match, and finds the NodelD with the new node N. ( 01012340 ) The longest matching node i or ID is 01012.
- the access node B can obtain the connected node of the node domain as the node G, and the access node B routes the join request message to the inter-domain inter-node connection node G.
- the connection node G queries the inter-domain routing table (Table 2), and matches the node identifier of the new node with the node domain ID of each node domain for the longest match, and finds the new node N.
- NodeID (01012340) matches the node i or ID to 01012, which is the domain where the node is located, and then finds the responsible node according to the algorithm in the domain (such as Pastry, Chord, One-Hop, etc.) (the NodelD ratio of the node responsible for the node)
- the new node is large, NodelD and Node1D of the new node and the nearest node), after receiving the message, the node returns a response message; Steps 905 ⁇ 908, the response message is returned to the new node according to the requested routing path; 909, the new node obtains the information of the responsible node by using the response message, and interacts with the responsible node through other messages to obtain the routing table, the responsible resource data, and the like; Step 910, the new node sends an out-of-domain broadcast message to the other out-of-domain access point.
- Step 911 other extra-domain nodes receive the above The broadcast message sends a response message to the new node.
- the operator can separate the resource domain from the node domain when planning the overlay network, if a resource
- the resource data of the management domain is relatively large, the number of nodes will be very large, and it can be deployed to run in multiple node domains, and the maintenance cost of the system will not be too large.
- the overlay network can be flexibly configured according to the actual situation. Thereby improving the performance of the entire overlay network.
- the computing device may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
- the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module.
- the invention is not limited to any specific combination of hardware and software.
- the above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the scope of the present invention are intended to be included within the scope of the present invention.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
P2P叠加网各及 P2P overlay network
其数据资源操作方法和新节点加入方法 技术领域 本发明涉及通信领域, 具体而言, 涉及一种 P2P叠加网络及其数据资源操 作方法和新节点力口入方法。 背景技术 分布式哈希表 ( Distributed Hash Table, 简称为 DHT )网络是点对点( Point To Point, 简称为 P2P )网络的一种实现技术。 它釆用分布式的散列表技术来实 现资源的存储与查找。 在多域的 DHT叠加网中, 整个 P2P网络被分成多个域, 每个域都由唯一的域 ID来标识。 在同一个域当中的节点都有相同的域 ID, 所 有的节点都由唯一的节点 ID标识。 并且, 在多域 P2P网络中, 资源标识也携 带域 ID, 以表示对应的资源属于哪个域, 每个资源都有一个资源 ID来唯一标 识。 具体地, 在多域的 DHT叠加网中, 资源和节点标识分别是: 节点标识 = 域 ID+节点 ID 资源标识 = 域03+资源 ID 才艮据上述描述可知, 节点标识和资源标识都带有域信息, 并且, 节点标识 和资源标识中所釆用的域 ID长度相同, 代表的信息也相同。 图 1 中叠加网中 有三域 , 域名为 dom-a.com.cn、 dom-b.com.cn和 dom-c.com.cn, 这三个域的域 ID分另' J为 0301、 0101、 0201。 每个 i或的资源标 i只前部分为 i或 ID, 例 ¾口, 资源 X的标识为 i或 ID(0101) +资源 ID(13XX); 而每个 i或的节点标识前部分也为 i或 ID, 例如, 节点 M的标 i只为 i或 ( 0101 ) +节点 ID ( 22XX )„ 在现有的多域的 DHT 叠加网中, 节点在资源查找时, 先比较查找资源标 识中的域 ID和本节点标识中的域 ID是否相等, 如果相等则认为所查询的资源 为本域的, 然后在本域中查找资源; 如果不相等, 则认为是其他域的资源, 将 查询消息路由到该域 ID所指的域中, 再进行域内查找, 最终查找到所求资源。 下面具体结合图 2对现有技术的资源查找进行说明。 在图 2中假设有三个 域 ID分另' J为 0101 , 0201和 0301。 当 ClientA在域 0101的 K节点处查询 资源 ID=0101-22XX的资源时, 居资源 ID中包含的域 ID确定是在本域 (资源 标识中的域 ID和本节点的域 ID相等), 将查询请求路由到本域中存储该资源 的节点 M, 具体如图 2 所示。 假如 ClientB在域 0201 中 L节点处查询资源 ID=0301-22XX的资源时, L节点发现查询的资源在域 0301中, 通过路由表获 知可通过 P点链接到 0301域 (资源标识中的域 ID和 0301域 ID相等), L节 点将查询请求路由到 P节点, P节点确定查询的资源在本域, 将查询请求路由 到保存此资源的节点 N处, 路径如图 2所示。 现有的多域架构的不能灵活地配置, 不能根据域的规模进行合理的域规 划。 例如, 如果某运营商域中用户数据资源非常大, 其域中的节点数量非常多, 按照目前的架构配置, 只能规划成一个叠加网域, 从而导致系统的维护开销非 常大。 例如, 图 1中的域名为 dom-b.com.cn的域, 用户数据非常多, 需要几十 万个节点, 如果这些节点都划在一个 DHT域中, 则将导致系统的维护开销非 常大。 发明内容 本发明的主要目的在于提供一种 P2P叠加网络及其数据资源操作方法和新 节点加入方法, 以至少解决上述问题。 根据本发明的一个方面, 提供了一种 P2P叠加网络, 包括: 多个节点域, 其中各个节点域相互连接, 各个节点域中的节点设置为存储 P2P叠加网络的数 据资源, 其中, 该数据资源被划分为多个资源域, 一个节点域的各个节点存储 的数据资源属于同一个资源域。 该多个资源域中的各个资源域具有相同的地域位置信息。 每个节点域的节点域 ID 包含该节点域所存储的数据资源所归属的资源域 的资源域 ID。 TECHNICAL FIELD The present invention relates to the field of communications, and in particular to a P2P overlay network, a data resource operation method thereof, and a new node force input method. BACKGROUND A Distributed Hash Table (DHT) network is an implementation technology of a Point To Point (P2P) network. It uses distributed hash table technology to implement resource storage and lookup. In a multi-domain DHT overlay network, the entire P2P network is divided into multiple domains, each identified by a unique domain ID. Nodes in the same domain have the same domain ID, and all nodes are identified by a unique node ID. Moreover, in the multi-domain P2P network, the resource identifier also carries the domain ID to indicate which domain the corresponding resource belongs to, and each resource has a resource ID to uniquely identify. Specifically, in the multi-domain DHT overlay network, the resource and the node identifier are: Node ID = Domain ID + Node ID Resource ID = Domain 03 + Resource ID. According to the above description, both the node identifier and the resource identifier have a domain. The information, and the domain IDs used in the node identifier and the resource identifier are the same length, and the information represented is the same. In Figure 1, there are three domains in the overlay network, the domain names are dom-a.com.cn, dom-b.com.cn, and dom-c.com.cn. The domain IDs of these three domains are separated by another 'J is 0301, 0101. , 0201. The first part of each i or resource element i is i or ID, for example, port 3, the identifier of resource X is i or ID (0101) + resource ID (13XX); and the front part of each i or node identifier is also i or ID, for example, the target i of node M is only i or ( 0101 ) + node ID ( 22XX ) „ In the existing multi-domain DHT overlay network, when the node searches for resources, it first compares the search resource identifiers. Whether the domain ID and the domain ID in the local node ID are equal. If they are equal, the resource being queried is considered to be the domain, and then the resource is searched in the local domain. If they are not equal, the resource is considered to be a resource of another domain, and the query message is routed. Go to the domain indicated by the domain ID, and then perform intra-domain lookup to finally find the requested resource. The following describes the resource search in the prior art with reference to Figure 2. In Figure 2, it is assumed that there are three domain IDs. 0101, 0201, and 0301. When ClientA queries at the K node of domain 0101 When the resource ID=0101-22XX is used, the domain ID included in the resource ID is determined to be in the local domain (the domain ID in the resource identifier is equal to the domain ID of the local node), and the query request is routed to the domain to store the resource. Node M, as shown in Figure 2. If ClientB queries the resource with resource ID=0301-22XX at the L node in domain 0201, the L node finds that the queried resource is in domain 0301. It is learned through the routing table that it can be linked to the 0301 domain through the P point (the domain ID in the resource identifier). And the 0301 domain ID is equal), the L node routes the query request to the P node, and the P node determines that the queried resource is in the local domain, and routes the query request to the node N where the resource is saved, and the path is as shown in FIG. 2 . The existing multi-domain architecture cannot be flexibly configured, and reasonable domain planning cannot be performed according to the size of the domain. For example, if the user data resource in an operator domain is very large, the number of nodes in the domain is very large. According to the current architecture configuration, only one overlay domain can be planned, which results in a very large maintenance cost. For example, the domain name in Figure 1 is the domain of dom-b.com.cn. There are many user data and hundreds of thousands of nodes. If these nodes are all in one DHT domain, the maintenance cost of the system will be very large. . SUMMARY OF THE INVENTION A primary object of the present invention is to provide a P2P overlay network, a data resource operation method thereof, and a new node join method, to at least solve the above problems. According to an aspect of the present invention, a P2P overlay network is provided, including: a plurality of node domains, wherein each node domain is connected to each other, and nodes in each node domain are configured to store data resources of a P2P overlay network, wherein the data resources It is divided into multiple resource domains, and the data resources stored by each node of one node domain belong to the same resource domain. Each of the plurality of resource domains has the same geographical location information. The node domain ID of each node domain contains the resource domain ID of the resource domain to which the data resource stored by the node domain belongs.
P2P叠加网络的多个节点还设置为存储多个资源域中各个资源域的域名与 资源域 ID的第一对应关系。 The plurality of nodes of the P2P overlay network are further configured to store a first correspondence between a domain name of each resource domain in the plurality of resource domains and a resource domain ID.
P2P叠加网络的多个节点还设置为存储多个节点域中各个节点域的节点域 ID与该节点域的路由信息的第二对应关系。 每个节点的节点标识包含该节点所属节点域的节点域 ID。 每个数据资源的资源标识包含该数据资源所属的资源域的资源域 ID。 根据本发明的另一方面, 提供了一种 P2P叠加网络的数据资源操作方法, 包括: P2P叠加网络的接入节点接收请求方发送的操作请求, 其中, 该操作请 求用于请求对 P2P叠加网络中存储的数据资源执行预定操作; 接入节点获取存 储该数据资源的节点域; 接入节点将上述操作请求发送给该节点域内存储该数 据资源的节点; 该节点对该数据资源执行上述预定操作。 该接入节点获取存储数据资源的节点域包括: 接入节点获取数据资源的资 源标识, 其中, 资源标识包括: 数据资源所属的资源域的资源域 ID 和资源域 内数据资源的资源 ID; 接入节点将资源标识与 P2P 叠加网络的各个节点域的 节点域 ID进行最长匹配, 获取最长匹配的节点域 ID所对应的节点域, 其中, 各个节点域的节点域 ID 包括: 该节点域存储的数据资源所属的资源域的资源 域 ID。 上述操作请求中携带有数据资源的资源标识, 则接入节点获取数据资源的 资源标识包括: 接入节点从操作请求中获取资源标识。 上述操作请求中携带有数据资源的名称及数据资源所属的资源域的域名, 则接入节点获取数据资源的资源标识包括: 接入节点根据 P2P叠加网络中存储 的各个资源域的域名与资源域 ID 的第一对应关系, 获取与操作请求中携带的 域名对应的资源域 ID; 接入节点根据数据资源的名称, 获取数据资源的域内的 资源 ID; 接入节点根据获取的资源域 ID和域内的资源 ID, 得到数据资源的资 源标识。 如果获取的节点域为接入节点所属的节点域, 则接入节点将操作请求发送 给节点域内存储数据资源的节点包括: 接入节点根据预定算法, 获取存储资源 数据的节点; 接入节点将操作请求发送给节点。 如果获取的节点不属于接入节点所属的节点域, 则接入节点将操作请求发 送给节点域内存储数据资源的节点包括: 接入节点根据 P2P叠加网络存储的各 个节点域的节点域 ID 与该节点域的路由信息的第二对应关系, 获取与最长匹 配的节点域 ID对应的路由信息; 接入节点根据路由信息, 将操作请求发送给 节点域 ID对应的节点域的连接节点; 连接节点根据预定算法, 获取存储资源 数据的节点, 并将操作请求发送给节点。 根据本发明的又一个方面, 提供了一种 P2P叠加网络的新节点加入方法, 包括:新节点向 P2P叠加网络的接入节点发送请求加入 P2P叠力口网络的力口入请 求消息, 其中, 该加入请求消息中携带有该新节点的节点标识; 接入节点根据 该节点标识确定新节点归属的节点域, 并将上述加入请求消息发送给该节点域 内新节点的负责节点, 其中, 负责节点为其节点标识与新节点的节点标识最接 近的节点; 负责节点接收该加入请求消息, 返回响应消息, 该响应消息根据上 述加入请求消息的路由路径返回到新节点, 其中, 该响应消息中携带有负责节 点的标识信息。 上述新节点的节点标识包括: 该新节点所属节点域的节点域 ID和该新节 点在该节点域内的节点 ID,则接入节点根据节点标识确定新节点归属的节点域 包括:接入节点将新节点的节点标识与 P2P叠加网络的各个节点域的节点域 ID 进行最长匹配, 确定最长匹配的节点域 ID所对应的节点域为新节点归属的节 点域。 如果新节点归属的节点域为接入节点所属的节点域, 则接入节点将加入请 求消息发送节点域内新节点的负责节点包括: 接入节点根据预定算法, 获取新 节点的负责节点; 接入节点将加入请求消息转发给负责节点。 如果新节点归属的节点域不是接入节点所属的节点域, 则接入节点将加入 请求消息发送节点域内新节点的负责节点包括: 接入节点根据 P2P叠加网络存 储的各个节点域的节点域 ID 与该节点域的路由信息的第二对应关系, 获取与 最长匹配的节点域 ID对应的路由信息; 接入节点根据路由信息, 将加入请求 消息发送给节点域 ID对应的节点域的连接节点; 连接节点根据预定算法, 获 取新节点的负责节点, 并将加入请求消息发送给负责节点。 在上述新节点向接入节点发送加入请求消息之前, 该方法还包括: 新节点 获取其节点标识, 其中, 该节点标识为 P2P叠加网络的配置月艮务器分配的或新 节点根据其属性信息生成的。 在响应消息返回到新节点之后, 该方法还包括: 新节点获取响应消息中携 带的负责节点的标识信息, 并才艮据标识信息与负责节点进行消息交互。 在新节点接收响应消息之后, 该方法还包括: 新节点向其所属节点域之外 的其它节点域的连接节点发送域外广播消息, 通知其它节点域有新节点加入。 通过本发明, 在 P2P叠加网络中, 将资源域和节点域分开, 当某个资源域 的资源数据比较多时, 可以将该资源域的资源数据布局到多个节点域中运行, 减少了系统维护的开销, 解决了现有技术中当用户资源数据过多时而导致域中 的节点规模过大、 系统维护开销过高的问题, 进而可以根据实际情况, 灵活地 配置 P2P叠加网络。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部 分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不 当限定。 在附图中: 图 1为现有技术中的多域系统结构示意图; 图 2为在现有的多域系统中进行资源查询示意图; 图 3为才艮据本发明实施例的 P2P叠加网络的一种结构示意图; 图 4为根据本发明实施例的 P2P叠加网络的数据资源操作方法的流程图; 图 5为本发明实施例中对 P2P叠加网络中的数据资源进行操作的示意图; 图 6为根据本发明实施例的 P2P叠加网络的数据资源操作方法的优选实施 方式的流程图; 图 7为才艮据本发明实施例的 P2P叠加网络的新节点加入方法的流程图; 图 8为本发明实施例中在 P2P叠加网络中加入新节点的示意图; 图 9为才艮据本发明实施例的 P2P叠加网络的新节点加入方法的优选实施方 式的¾¾程图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不 冲突的情况下, 本申请中的实施例及实施例中的特征可以相互组合。 才艮据本发明实施例, 首先提供一种 P2P叠加网络, 在该 P2P叠加网络中资 源域和节点域相分离。 图 3为才艮据本发明实施例的 P2P叠加网络的一种结构示意图,如图 3所示, 在本发明实施例的 P2P叠加网络中,整个 P2P网络中的数据资源被划分为多个 资源域 (在图 3 中一个方框表示一个资源域), 而整个 P2P叠加网络中的节点 划分成多个节点域 (在图 3 中一个圓圏表示一个节点域), 每个资源域的数据 资源可以由一个节点域负责, 也可以由多个节点域负责, 即一个资源域的数据 资源可以存储在一个节点域的各个节点中, 也可以存储在多个节点域的各个节 点中, 具体可以根据该资源域包含的数据资源量进行确定, 当某个资源域的数 据资源较多时, 可以将该资源域的数据资源存储在多个节点域中。 即在本发明 实施例中, 一个节点域的各个节点所存储数据资源属于同一个资源域。 在具体应用中, 资源域的划分可以按照地域位置来进行, 例如, 上海域, 南京域, 北京域等。 划分所依据的地域位置信息可以是资源或用户所在的行政 区域, 也可以按照运营商进行区域划分等。 一个资源管理域可以只部署一个节 点域, 比如南京资源域可以部署在一个节点域,上海资源域也是一个节点域等。 但是如果资源域中的资源(用户)非常多, 部署的节点域的节点规模就会很大, 为了使得域的负载均衡, 维护开销小, 路由性能高, 可以把一个资源域部署多 个节点域中。 整个 P2P网络中的资源域划分以及资源域的数目可以根据实际情况来定。 在具体应用中, 每个资源域都具有一个域名, 同时有唯一的标识 (简称为 资源域 ID ) 与之对应, 例如, 图 3中有三个资源域(用方框表示), 域名分别 为 dom-b.com.cn, dom-c.com.cn, dom-a.com.cn对应的域 ID为 0101 , 0201 , 0301 , 可以在 P2P叠加网络中存储资源域的域名与资源域 ID的对应关系, 具 体地, 可以通过如表 1所示的域映射表来记录资源域名与资源域 ID对应关系。 表 1. 域名映射表 The plurality of nodes of the P2P overlay network are further configured to store a second correspondence between the node domain ID of each node domain in the plurality of node domains and the routing information of the node domain. The node ID of each node contains the node domain ID of the node domain to which the node belongs. The resource identifier of each data resource contains the resource domain ID of the resource domain to which the data resource belongs. According to another aspect of the present invention, a data resource operation method for a P2P overlay network is provided, including: an access node of a P2P overlay network receives an operation request sent by a requester, where the operation request is used to request a P2P overlay network The stored data resource performs a predetermined operation; the access node acquires a node domain that stores the data resource; the access node sends the operation request to a node in the node domain that stores the data resource; the node performs the predetermined operation on the data resource . The node domain that the access node acquires the data resource includes: the resource identifier of the data resource that the access node acquires, where the resource identifier includes: a resource domain ID of the resource domain to which the data resource belongs and a resource ID of the data resource in the resource domain; The node matches the resource identifier with the node domain ID of each node domain of the P2P overlay network to obtain the node domain corresponding to the longest matching node domain ID, wherein the node domain ID of each node domain includes: the node domain storage The resource domain ID of the resource domain to which the data resource belongs. The operation request carries the resource identifier of the data resource, and the access node obtains the resource identifier of the data resource, where the access node obtains the resource identifier from the operation request. The operation request carries the name of the data resource and the domain name of the resource domain to which the data resource belongs, and the resource identifier of the access node to obtain the data resource includes: the access node according to the domain name and the resource domain of each resource domain stored in the P2P overlay network. The first correspondence of the ID, the resource domain ID corresponding to the domain name carried in the operation request; the access node acquires the resource ID in the domain of the data resource according to the name of the data resource; the access node according to the obtained resource domain ID and the domain The resource ID, which is the resource identifier of the data resource. If the acquired node domain is the node domain to which the access node belongs, the node that sends the operation request to the node that stores the data resource in the node domain includes: the access node acquires the node that stores the resource data according to a predetermined algorithm; the access node An operation request is sent to the node. If the acquired node does not belong to the node domain to which the access node belongs, the node that sends the operation request to the node that stores the data resource in the node domain includes: the node domain ID of each node domain stored by the access node according to the P2P overlay network and the node The second correspondence of the routing information of the node domain acquires routing information corresponding to the longest matching node domain ID; the access node sends the operation request to the connecting node of the node domain corresponding to the node domain ID according to the routing information; According to a predetermined algorithm, a node storing the resource data is obtained, and an operation request is sent to the node. According to still another aspect of the present invention, a new node joining method for a P2P overlay network is provided, including: a new node sends a request for a request to join a P2P overlay network to an access node of a P2P overlay network, where The join request message carries the node identifier of the new node; the access node determines the node domain to which the new node belongs according to the node identifier, and sends the join request message to the responsible node of the new node in the node domain, where the responsible node a node whose identifier is the closest to the node identifier of the new node; the responsible node receives the join request message, and returns a response message, and the response message is returned to the new node according to the routing path of the join request message, where the response message carries There is identification information of the responsible node. The node identifier of the new node includes: a node domain ID of the node domain to which the new node belongs and a node ID of the new node in the node domain, and the access node determines, according to the node identifier, the node domain to which the new node belongs: the access node will The node identifier of the new node is matched with the node domain ID of each node domain of the P2P overlay network, and the node domain corresponding to the longest matching node domain ID is determined to be the node domain to which the new node belongs. If the node domain to which the new node belongs is the node domain to which the access node belongs, the access node will join the request message. The responsible node of the new node in the node domain includes: the access node acquires the responsible node of the new node according to a predetermined algorithm; The node forwards the join request message to the responsible node. If the node domain to which the new node belongs is not the node domain to which the access node belongs, the access node will join the request message. The responsible node of the new node in the node domain includes: the node domain ID of each node domain stored by the access node according to the P2P overlay network. Corresponding to the second correspondence between the routing information of the node domain, obtaining routing information corresponding to the longest matching node domain ID; the access node sending the joining request message to the connecting node of the node domain corresponding to the node domain ID according to the routing information The connecting node acquires the responsible node of the new node according to a predetermined algorithm, and sends a join request message to the responsible node. Before the new node sends the join request message to the access node, the method further includes: the new node acquiring the node identifier, where the node identifier is allocated by the configuration server of the P2P overlay network or the new node is based on the attribute information thereof. Generated. After the response message is returned to the new node, the method further includes: the new node acquiring the identification information of the responsible node carried in the response message, and performing message interaction with the responsible node according to the identification information. After the new node receives the response message, the method further includes: the new node sending an out-of-domain broadcast message to the connection node of the other node domain other than the node domain to which it belongs, notifying the other node domain that a new node joins. According to the present invention, in the P2P overlay network, the resource domain and the node domain are separated. When the resource data of a certain resource domain is relatively large, the resource data of the resource domain can be distributed to run in multiple node domains, thereby reducing system maintenance. The overhead of the prior art solves the problem that the node size in the domain is too large and the system maintenance overhead is too high when the user resource data is too large, and the P2P overlay network can be flexibly configured according to actual conditions. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are set to illustrate,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 1 is a schematic diagram of a multi-domain system in the prior art; FIG. 2 is a schematic diagram of resource query in an existing multi-domain system; FIG. 3 is a P2P overlay network according to an embodiment of the present invention. FIG. 4 is a flowchart of a data resource operation method of a P2P overlay network according to an embodiment of the present invention; FIG. 5 is a schematic diagram of operations on data resources in a P2P overlay network according to an embodiment of the present invention; A flowchart of a preferred embodiment of a data resource operation method of a P2P overlay network according to an embodiment of the present invention; FIG. 7 is a flowchart of a new node joining method of a P2P overlay network according to an embodiment of the present invention; A schematic diagram of adding a new node to a P2P overlay network in an embodiment; FIG. 9 is a diagram of a preferred embodiment of a new node joining method for a P2P overlay network according to an embodiment of the present invention. BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict. According to an embodiment of the present invention, a P2P overlay network is first provided, in which a resource domain and a node domain are separated. FIG. 3 is a schematic structural diagram of a P2P overlay network according to an embodiment of the present invention. As shown in FIG. 3, in a P2P overlay network according to an embodiment of the present invention, data resources in an entire P2P network are divided into multiple resources. The domain (a box in Figure 3 represents a resource domain), and the nodes in the entire P2P overlay network are divided into multiple node domains (one circle in Figure 3 represents a node domain), and the data resources of each resource domain It can be responsible for one node domain or multiple node domains. That is, the data resources of one resource domain can be stored in each node of a node domain, or can be stored in each node of multiple node domains. The amount of data resources included in the resource domain is determined. When a resource resource of a resource domain is large, the data resource of the resource domain may be stored in multiple node domains. That is, in the embodiment of the present invention, the data resources stored by each node of a node domain belong to the same resource domain. In a specific application, the division of resource domains can be performed according to geographical location, for example, Shanghai domain, Nanjing domain, Beijing domain, and the like. The geographical location information on which the division is based may be the resource or the administrative area where the user is located, or may be divided into regions according to the operator. A resource management domain can deploy only one node domain. For example, a Nanjing resource domain can be deployed in a node domain, and a Shanghai resource domain is also a node domain. However, if there are many resources (users) in the resource domain, the node size of the deployed node domain will be large. To make the load balancing of the domain, the maintenance overhead is small, and the routing performance is high, you can deploy multiple resource domains to multiple node domains. in. The resource domain partitioning and the number of resource domains in the entire P2P network can be determined according to actual conditions. In a specific application, each resource domain has a domain name, and has a unique identifier (referred to as a resource domain ID) corresponding thereto. For example, there are three resource domains (represented by boxes) in FIG. 3, and the domain names are respectively dom -b.com.cn, dom-c.com.cn, dom-a.com.cn corresponding domain ID is 0101, 0201, 0301, which can store the domain name of the resource domain and the resource domain ID in the P2P overlay network. Relationship, specifically, the correspondence between the resource domain name and the resource domain ID can be recorded by the domain mapping table as shown in Table 1. Table 1. Domain Name Mapping Table
而资源域中的各个数据资源的资源标识可以包括: 该数据资源所属的资源 域的资源域 ID和该数据资源在该资源域内的资源 ID, 即: 资源标识 =资源域 ID +资源 ID 同样, 节点域的划分可以按照地域位置来进行, 或者, 也可以按照其他方 式比如 IP地址等进行划分, 每个节点域都有一个节点域 ID, 在具体实施过程 中, 节点域的节点域 ID 可以包含该节点域所存储的数据资源所属的资源域的 资源域 ID, 即资源域 ID的长度小于或等于节点域 ID的长度, 优选地, 资源 域 ID可以作为节点域 ID的前缀, 或者, 资源域 ID也可以作为节点域 ID的预 定位, 例如, 最后四位等。 在确定节点域的节点域 ID后, 可以通过节点域 ID来表示节点域内各个节 点的节点标识, 具体地, 节点标识可以包括该节点所属的节点域 ID 和该节点 在该节点域内的节点 ID, 即: 节点标识 =节点域 ID +节点 ID 在具体应用中, 上述资源 ID和节点 ID可以釆用预定的域内 DHT算法得 到, 从而使得数据资源的资源 ID与存储该数据资源的节点的节点 ID相关联。 例如, 图 3 中包含五个节点域, 每个节点域的节点域 ID 包含其存储的数 据资源所属的资源的 ID, 例如, 图 3中的五个节点域可以分别为 0301 , 0201 , 01011 , 01012, 01013。 i或内可以釆用不同的 DHT算法来计算各个节点在节点 域内的节点 ID、 各个数据资源在资源域内的资源 ID以及存储数据资源的节点 等, 例如, One-hop、 Pastry、 Chord和 Kad等算法。 在具体应用中, 上述 P2P叠加网络的节点域与节点域之间可以釆用全连接 方式, 具体可以在 P2P叠加网络的各个节点中存储各个节点域的节点域 ID与 该节点域的路由信息的对应关系, 以使得各个节点域之间可以建立连接, 在具 体应用中, 该对应关系可以釆用如表 2所示的映射表存储。 表 2. 域间路由表 The resource identifier of each data resource in the resource domain may include: a resource domain ID of the resource domain to which the data resource belongs and a resource ID of the data resource in the resource domain, that is, the resource identifier=resource domain ID+resource ID Similarly, the division of the node domain may be performed according to the geographical location, or may be divided according to other methods such as an IP address, and each node domain has a node domain ID. In the specific implementation process, the node domain ID of the node domain The resource domain ID of the resource domain to which the data resource stored in the node domain belongs may be included, that is, the length of the resource domain ID is less than or equal to the length of the node domain ID. Preferably, the resource domain ID may be used as a prefix of the node domain ID, or The resource domain ID can also be used as a predetermined bit of the node domain ID, for example, the last four digits, and the like. After determining the node domain ID of the node domain, the node identifier of each node in the node domain may be represented by the node domain ID. Specifically, the node identifier may include the node domain ID to which the node belongs and the node ID of the node in the node domain. That is: node identification = node domain ID + node ID In a specific application, the resource ID and the node ID may be obtained by using a predetermined intra-domain DHT algorithm, so that the resource ID of the data resource is related to the node ID of the node storing the data resource. Union. For example, Figure 3 contains five node domains. The node domain ID of each node domain contains the ID of the resource to which the stored data resource belongs. For example, the five node domains in Figure 3 can be 0301, 0201, 01011, respectively. 01012, 01013. i or may use different DHT algorithms to calculate the node ID of each node in the node domain, the resource ID of each data resource in the resource domain, and the node storing the data resource, for example, One-hop, Pastry, Chord, Kad, etc. algorithm. In a specific application, the node domain and the node domain of the P2P overlay network may use a full connection mode, and the node domain ID of each node domain and the routing information of the node domain may be stored in each node of the P2P overlay network. The correspondence relationship is such that a connection can be established between the respective node domains. In a specific application, the correspondence relationship can be stored by using a mapping table as shown in Table 2. Table 2. Inter-domain routing table
通过上述的描述可知, 在上述 P2P叠加网络中, 资源域和该资源域所在的 节点域中, 资源域的 ID和节点域的 ID可能相等, 但资源域的 ID包含在节点 域的 ID 内, 可以通过最长匹配得到资源域所在的节点域, 例如, 一个资源域 部署到多个节点域, 则该资源域的域 ID—定可在节点域的域 ID中最长匹配。 通过本发明实施例的上述 P2P叠加网络, 资源域和节点域相分离, 从而使 得一个资源域的数据资源可以通过一个或多个节点域来负责存储。 如图 3中域 名为 dom-b.com.cn 的资源域, 域内的所有数据资源由三个节点域 (域 ID 为 01011 , 01012和 01013 ) 中节点负责。 进而使得运营商在规划叠加网时, 可以 把资源域和节点域分开, 如果某个资源管理域的资源数据比较多时, 节点的数 量也会非常多, 可以布局到多个节点域中运行, 系统的维护开销就不会太大。 这样可以根据实际情况, 灵活地配置叠加网。 从而提高整个叠加网络的性能提 高。 下面描述基于本发明实施例提供的上述 P2P 叠加网络的数据资源操作方 法。 图 4为根据本发明实施例的 P2P叠加网络的数据资源操作方法的流程图, 如图 4所示, 该方法主要包括以下步骤 (步骤 S402 -步骤 S408 ): 步骤 S402, P2P叠加网络的一个接入节点接收请求方发送的操作请求, 其 中,该操作请求用于请求对 P2P叠加网络中存储的某个数据资源执行预定操作; 具体地, 该预定操作可以为查询、 存储或修改某个数据资源。 步骤 S404 , 接入节点获取存储上述数据资源的节点域; 步骤 S406,接入节点将上述操作请求发送给上述节点域内存储该数据资源 的节点; 步骤 S408, 上述节点对该数据资源执行预定操作。 通过本发明实施例的上述 P2P叠加网络的数据资源操作方法, 可以对节点 域与资源域分离的 P2P叠加网络中存储的数据资源执行预定的操作。 下面进一步描述上述各步 4聚的处理细节。 (一) 步骤 S402 在具体实施过程中, 当用户需要对 P2P叠加网络中的某个数据资源执行某 种操作时, 通过其客户端向 P2P叠加网络中与该客户端连接的接入节点发送请 求, 请求对某个数据资源执行某项操作。 用户需要查询域名为 dom-c.com.cn域 的数据资源 abc, 即查询 abc@dom-c.com.cn, 则用户通过其客户端发送查询请 求。 在具体应用中, 客户端在向 P2P叠加网络发送的操作请求时, 可以将待操 作数据资源的名称和其所在的资源域的域名转换为该数据资源的资源标识, 例 如, 将 abc@dom-c.com.cn转化为该数据资源的资源标识 02012213 , 并将该数 据资源的资源标识携带在操作请求中发送给 P2P叠加网络的接入节点; 或者, 客户端也可以只将该数据资源的名称和其所在的资源域的域名携带 在操作请求中发送给上述接入节点, 由接入节点将该资源的名称和资源域的域 名转化为该数据资源的资源标识。 According to the above description, in the P2P overlay network, the resource domain and the node domain in which the resource domain is located may have the same ID of the resource domain and the ID of the node domain, but the ID of the resource domain is included in the node. Within the ID of the domain, the node domain where the resource domain is located can be obtained by the longest match. For example, if one resource domain is deployed to multiple node domains, the domain ID of the resource domain can be the longest match in the domain ID of the node domain. . With the above P2P overlay network in the embodiment of the present invention, the resource domain and the node domain are separated, so that the data resources of one resource domain can be stored by one or more node domains. As shown in Figure 3, the domain name is dom-b.com.cn. All data resources in the domain are responsible for the nodes in the three node domains (domain IDs 01011, 01012, and 01013). In addition, when the operator plans the overlay network, the resource domain and the node domain can be separated. If the resource data of a resource management domain is relatively large, the number of nodes is also very large, and the system can be deployed to run in multiple node domains. The maintenance overhead will not be too great. In this way, the overlay network can be flexibly configured according to the actual situation. Thereby improving the performance of the entire overlay network. The data resource operation method of the above P2P overlay network provided by the embodiment of the present invention is described below. 4 is a flowchart of a method for operating a data resource of a P2P overlay network according to an embodiment of the present invention. As shown in FIG. 4, the method mainly includes the following steps (step S402 - step S408): Step S402, a connection of a P2P overlay network The ingress node receives an operation request sent by the requesting party, where the operation request is used to request to perform a predetermined operation on a certain data resource stored in the P2P overlay network; specifically, the predetermined operation may be querying, storing, or modifying a certain data resource. . Step S404: The access node acquires a node domain that stores the data resource. Step S406: The access node sends the operation request to a node that stores the data resource in the node domain. Step S408: The node performs a predetermined operation on the data resource. The data resource operation method of the P2P overlay network in the foregoing embodiment of the present invention may perform a predetermined operation on a data resource stored in a P2P overlay network in which the node domain and the resource domain are separated. Details of the processing of the above steps are further described below. (1) Step S402 In the specific implementation process, when the user needs to perform some operation on a certain data resource in the P2P overlay network, the client sends a request to the access node connected to the client in the P2P overlay network through the client. Request, request to perform an operation on a data resource. The user needs to query the data resource abc whose domain name is dom-c.com.cn, that is, query abc@dom-c.com.cn, and the user sends a query request through its client. In a specific application, when the client sends an operation request to the P2P overlay network, the name of the data resource to be operated and the domain name of the resource domain in which the client is located may be converted into the resource identifier of the data resource, for example, abc@dom- C.com.cn is converted into the resource identifier 02012213 of the data resource, and the resource identifier of the data resource is carried in the operation request and sent to the access node of the P2P overlay network; or, the client may only use the data resource The name and the domain name of the resource domain in which it resides are carried in the operation request and sent to the access node, and the access node converts the name of the resource and the domain name of the resource domain into the resource identifier of the data resource.
(二) 步骤 S404 在具体实施过程中, 如果数据资源的资源标识包括该数据资源所属的资源 域的资源域 ID和该资源域内该数据资源的资源 ID, 且节点域的节点域 ID 包 括该节点域所存储的数据资源所属的资源域的资源域 ID,则可以通过最长匹配 的方式获取存储上述数据资源的节点域。 即接入节点将上述资源标识与 P2P叠 加网络的各个节点域的节点域 ID进行最长匹配, 获取最长匹配的节点域 ID所 对应的节点域, 该节点域即为存储上述数据资源的节点域。 釆用这种方式, 资 源域 ID可以作为节点域 ID的前缀, 也可以位于节点域 ID的预定位置(例如, 最后几位); 而资源标识包括: 资源域 ID和资源 ID, 其中, 资源域 ID可以作 为资源标识的前缀, 也可以位于资源标识的预定位置 (该预定位置可以预先约 定), 并且, 资源 ID为釆用域内算法计算得到的。 在具体应用中, 如果资源域 ID为节点域 ID的前缀, 且资源标识 =资源域 ID +资源 ID, 则可以直接釆用 前缀最长匹配的方式获取最长匹配的节点域 ID; 或者, 可以按照预先约定, 从 节点域 ID的预定位置获取该节点域 ID 包含的资源域 ID, 并从资源标识的预 定位置中获取该数据资源所属的资源域的资源域 ID, 将这两个资源域 ID进行 匹配, 如果匹配成功, 则将资源标识中的其余位与节点域 ID 的其余位进行匹 配, 从而可以获取最长匹配的节点域 ID。 或者,在组网过程中,也可以在 P2P叠加网络中存储各个资源域的节点域, 或者存储各个数据资源的节点域, 例如, 可以记录资源标识在某个范围内的数 据资源存储在哪个节点等, 接入节点根据这些信息, 可以确定存储上述数据资 源的节点域。 (三) 步骤 S406 在具体实施过程中, 如果上述步骤 S404 中所确定的节点域为接入节点所 在的节点域 (即本域), 则接入节点根据预设的域内算法, 可以获取到存储上 述数据资源的节点, 并将上述接收到的上述操作请求转发给该节点; 如果上述步骤 S404 中所确定的节点域不是该接入节点所在的节点域, 则 接入节点根据 P2P网络中预先存储的节点域 ID与该节点域的路由信息的对应 关系 (如上表 2所示) 可以获取步骤 S404中所确定的节点域的路由信息, 根 据该路由信息, 接入节点将上述操作请求转发给该节点域的连接节点。 该连接 节点接收到该操作请求后, 确定该数据资源存储在本域, 则按照预定的域内算 法, 获取本域内存储该数据资源的节点, 并将上述操作请求转发给该节点。 (2) Step S404: In the specific implementation process, if the resource identifier of the data resource includes the resource domain ID of the resource domain to which the data resource belongs and the resource ID of the data resource in the resource domain, and the node domain ID of the node domain includes the node The resource domain ID of the resource domain to which the data resource stored in the domain belongs can obtain the node domain in which the data resource is stored by the longest matching method. That is, the access node performs the longest match between the resource identifier and the node domain ID of each node domain of the P2P overlay network, and obtains the node domain corresponding to the longest matching node domain ID, where the node domain is the node that stores the data resource. area. In this way, the resource domain ID may be used as a prefix of the node domain ID, or may be located at a predetermined location of the node domain ID (for example, the last few digits); and the resource identifier includes: a resource domain ID and a resource ID, where the resource domain The ID may be used as a prefix of the resource identifier, or may be located at a predetermined location of the resource identifier (the predetermined location may be pre-agreed), and the resource ID is calculated by using an intra-domain algorithm. In a specific application, if the resource domain ID is a prefix of the node domain ID, and the resource identifier=the resource domain ID+the resource ID, the longest matching node domain ID may be directly obtained by using the longest matching method of the prefix; or Obtaining, according to a predetermined agreement, a resource domain ID included in the node domain ID from a predetermined location of the node domain ID, and obtaining a resource domain ID of the resource domain to which the data resource belongs from the predetermined location of the resource identifier, and setting the two resource domain IDs Matching is performed. If the matching is successful, the remaining bits in the resource identifier are matched with the remaining bits of the node domain ID, so that the longest matching node domain ID can be obtained. Alternatively, in the networking process, the node domain of each resource domain may be stored in the P2P overlay network, or the node domain of each data resource may be stored. For example, it may be recorded in which node the data resource whose resource identifier is in a certain range is stored. Etc., based on the information, the access node can determine the node domain in which the data resource is stored. (3) Step S406 In the specific implementation process, if the node domain determined in the foregoing step S404 is the node domain (ie, the local domain) where the access node is located, the access node may obtain the storage according to the preset intra-domain algorithm. a node of the foregoing data resource, and forwarding the foregoing operation request received to the node; if the node domain determined in the foregoing step S404 is not the node domain where the access node is located, the access node is pre-stored according to the P2P network. Corresponding relationship between the node domain ID and the routing information of the node domain (as shown in Table 2 above) may obtain the routing information of the node domain determined in step S404, and according to the routing information, the access node forwards the operation request to the The connection node of the node domain. After receiving the operation request, the connection node determines that the data resource is stored in the local domain, and obtains a node that stores the data resource in the local domain according to a predetermined intra-domain algorithm, and forwards the operation request to the node.
(四 ) 步骤 S408 存储上述数据资源的节点在接收到上述操作请求后, 根据该操作请求的指 示, 对该数据资源执行预定操作, 即查询、 存储或修改该数据资源, 如果是查 询操作, 则该节点根据上述操作请求的路径, 向请求方返回相应的数据, 如果 是存储或修改操作请求, 则该节点根据上述操作请求的路径, 向请求返回相应 的响应消息。 下面以图 5所示 P2P叠加网络为例,对本发明实施例的上述 P2P叠加网络 的数据资源操作方法的优选实现方式进行说明。 在图 5 中, 标识 ID 以 4 进制为例进行描述, 如图 5 所示, 资源域 dom-b.com.cn的资源 i或 ID为 0101 , 其对应三个节点 i或 ID为 01011、 01012和 01013的节点 i或; 而资源域 dom-a. com. cn的资源域 ID为 0301 , 其对应一个节 点域 ID为 0301的节点 i或; 而资源 i或 dom-c com.cn的资源 i或 ID为 0201 , 其对 应一个节点域 ID为 0201的节点域。 在图 5中, 用户通过客户端 A ( Client A ) 向 P2P叠加网络查询 /存储 /修改 某个资源域名为 dom-c. com. cn域的资源数据, 例 ^口, abc@dom-c. com. cn。 该该 数据资源存储或应该存储在节点域 ID为 0201的节点域中的 E节点, 图 6为具 体实施的流程图, 如图 6所示, 主要包括以下步骤: 步-骤 601 , Client A将资源 abc@dom-c. com. cn转化为资源标识为 02012213; 在具体应用中, Client A可以查询域名映射表(如表 1所示;), 获取域名为 Dom-c.com. cn的资源域的资源域 ID为 0201 , 通过域内算法, 可以计算出 "abc" 对应的资源 ID为 2213 , 从而得到该数据资源的资源标识 ID为 0201-2213。 步骤 602, Client A向连接节点 B发送查询 /存储 /修改资源请求消息, 该请 求中携带的资源标识为 0201-2213; 步骤 603 , 节点 B (节点域 ID为 01011 )才艮据资源标识 0201-2213在域间 路由表(表 2所示)中前缀最长匹配的节点域 ID, 找到最长匹配到的节点域 ID 是 0201 , 确定该节点域 ID不是本域 ID, 因此, 负责数据资源 0201-2213的节 点不在本域; 步骤 604 , 节点 B根据表 2 , 获取与节点域 ID0201对应的路由信息, 获取 节点域 0201 的连接节点为 A, 则将上述步骤 602 中接收到请求消息转发到连 接节点 A; 步骤 605 , 节点 A通过查询域外路由表(表 2 )找出与资源标识 02012213 前缀最长匹配的节点 i或 ID, 确定目标 (key=02012213)在本 i或; 步骤 606, 节点 A按照域内釆用的算法 (如 Chord, Pastry等) 最终消息路 由到存储该数据资源的节点 E; 步骤 607, 节点 E根据 key=02012213读取 /存储 /修改资源数据; 步骤 608 ~ 610, 节点 E发送响应消息, 该响应消息返回到 Client A, 如果 是查询数据资源, 则该响应消息中携带有是查询的数据; 在具体应用中, Client A 可以直接用资源 abc@dom-c.com.cn向节点 B发 请求消息, 由节点 B查询域名映射表, 再计算出资源 ID, 然后组成资源标识。 下面描述基于本发明实施例提供的上述 P2P叠加网络的新节点加入方法。 图 7为才艮据本发明实施例的 P2P叠加网络的新节点加入方法的流程图, 如 图 7所示, 主要包括以下步骤 (步骤 S702 -步骤 S706 ): 步骤 S702, 新节点向 P2P叠加网络的接入节点发送请求加入 P2P叠加网 络的加入请求消息, 其中, 该加入请求消息中携带有新节点的节点标识; 步骤 S704,接入节点 居上述节点标识确定新节点归属的节点域, 并将上 述加入请求消息发送给该节点域内新节点的负责节点, 其中, 负责节点为其节 点标识与新节点的节点标识最接近的节点; 步骤 S706, 负责节点接收到上述加入请求消息, 返回响应消息, 该响应消 息根据上述加入请求消息的路由路径返回到新节点, 其中, 上述响应消息中携 带有负责节点的标识信息。 才艮据本发明实施例的上述 P2P叠加网络的新节点加入方法, 可以在节点域 和资源域分离的 P2P叠加网络中加入新节点。 下面进一步描述上述各处理的细节。 (一) 步 4聚 S702 在具体应用中, 新节点在向 P2P叠加网络的某个接入节点发送加入请求消 息之前, 新节点首先获取节点标识。 在具体实施过程中, 新节点获取节点标识 的方法包括但不限于以下两种: 方法一, 新节点向配置月艮务器发请求, 由配置 服务器分配该新节点的节点标识, 具体如图 8所示; 方法二, 新节点根据自己 的 IP地址等信息, 生成其节点标识。 如果釆用上述方法一获取新节点的节点标识, 则配置服务器在为新节点分 配节点标识时, 同时为该新节点分配接入节点; 如果釆用上述方法二获取新节 点的节点标识, 则 P2P叠加网络的接入节点可以通过手工配置。 新节点在获取配置的接入节点后, 向该接入节点发送加入请求消息, 请求 加入到 P2P叠加网络中, 该请求消息中携带新节点的节点标识。 (4) Step S408: After receiving the operation request, the node storing the data resource performs a predetermined operation on the data resource according to the instruction of the operation request, that is, queries, stores, or modifies the data resource, if it is a query operation, The node returns corresponding data to the requester according to the path of the operation request, and if it is a storage or modification operation request, the node returns a corresponding response message to the request according to the path of the operation request. The P2P overlay network shown in FIG. 5 is taken as an example to describe a preferred implementation manner of the data resource operation method of the P2P overlay network in the embodiment of the present invention. In Figure 5, the ID is described in hexadecimal. As shown in Figure 5, the resource i or ID of the resource domain dom-b.com.cn is 0101, which corresponds to three nodes i or ID is 01011. The node i of 01012 and 01013 or; and the resource domain ID of the resource domain dom-a.com.cn is 0301, which corresponds to a node i with a node domain ID of 0301; and the resource of resource i or dom-c com.cn The i or ID is 0201, which corresponds to a node domain with a node domain ID of 0201. In Figure 5, the user queries/stores/modifies a resource domain name to the P2P overlay network through client A (Client A) as the resource data of the dom-c.com.cn domain, for example, abc@dom-c. Com. cn. The data resource is stored or stored in an E-node in a node domain with a node domain ID of 0201. FIG. 6 is a flowchart of a specific implementation. As shown in FIG. 6, the method mainly includes the following steps: Step-Chen 601, Client A will The resource abc@dom-c. com. cn is converted into a resource identifier of 02012213; In a specific application, Client A can query the domain name mapping table (as shown in Table 1), and obtain the resource domain ID of the resource domain whose domain name is Dom-c.com.cn is 0201. By using the intra-domain algorithm, "abc" can be calculated. The corresponding resource ID is 2213, so that the resource identifier ID of the data resource is 0201-2213. Step 602, Client A sends a query/storage/modification resource request message to the connection node B, where the resource identifier carried in the request is 0201-2213; Step 603, the node B (node domain ID is 01011) is based on the resource identifier 0201- 2213 In the inter-domain routing table (shown in Table 2), the longest matching node domain ID, find the longest matching node domain ID is 0201, determine that the node domain ID is not the local domain ID, therefore, responsible for the data resource 0201 The node of -2213 is not in the domain; step 604, the node B obtains the routing information corresponding to the node domain ID0201 according to the table 2, and obtains the connection node of the node domain 0201 as A, and then forwards the request message received in the above step 602 to the connection. Node A; Step 605, Node A finds the node i or ID that matches the resource identifier 02012213 prefix the longest by querying the out-of-domain routing table (Table 2), and determines the target (key=02012213) in this i or; Step 606, Node A According to the algorithm used in the domain (such as Chord, Pastry, etc.), the final message is routed to the node E storing the data resource; Step 607, the node E reads/stores/modifies the resource data according to key=02012213; Steps 608 ~ 610, Node E Send ring The message is returned to Client A. If the data resource is queried, the response message carries the data that is queried. In a specific application, Client A can directly use the resource abc@dom-c.com.cn to the node. B sends a request message, the node B queries the domain name mapping table, calculates the resource ID, and then composes the resource identifier. A new node joining method for the above P2P overlay network provided based on the embodiment of the present invention is described below. FIG. 7 is a flowchart of a method for joining a new node of a P2P overlay network according to an embodiment of the present invention. As shown in FIG. 7, the method mainly includes the following steps (step S702 - step S706): Step S702, the new node superimposes the network to the P2P. The access node sends a join request message requesting to join the P2P overlay network, where the join request message carries the node identifier of the new node; Step S704, the access node determines the node domain to which the new node belongs, and sends the join request message to the responsible node of the new node in the node domain, where the responsible node is the node identifier of the node identifier and the new node. The neighboring node receives the above-mentioned join request message, and returns a response message, and the response message is returned to the new node according to the routing path of the join request message, wherein the response message carries the identification information of the responsible node. According to the new node joining method of the above P2P overlay network according to the embodiment of the present invention, a new node may be added in a P2P overlay network in which the node domain and the resource domain are separated. Details of each of the above processes are further described below. (1) Step 4 S S702 In a specific application, before the new node sends a join request message to an access node of the P2P overlay network, the new node first acquires the node identifier. In the specific implementation process, the method for the new node to obtain the node identifier includes, but is not limited to, the following two methods: Method 1, the new node sends a request to the configuration server, and the configuration server allocates the node identifier of the new node, as shown in FIG. 8 As shown in the second method, the new node generates its node identifier according to its own IP address and other information. If the node identifier of the new node is obtained by using the foregoing method 1, the configuration server allocates the node identifier to the new node at the same time, and allocates the access node to the new node at the same time; if the node identifier of the new node is obtained by using the foregoing method 2, the P2P The access nodes of the overlay network can be manually configured. After obtaining the configured access node, the new node sends a join request message to the access node, requesting to join the P2P overlay network, where the request message carries the node identifier of the new node.
(二) 步骤 S704 在具体应用中, 与上述 P2P叠加网络的数据资源操作方法相似, 接入节点 可以通过将新节点的节点标识与 P2P叠加网络中的各个节点域的节点域 ID进 行最长匹配来确定新节点归属的节点域, 也可以在组网时预先存储节点标识在 某个范围内的节点所归属的节点域, 从而获取该新节点所归属的节点域。 如果釆用最长匹配的方式确定新节点所归属的节点域, 则上述步骤 S702 中的该新节点的节点标识包括: 该新节点所属节点域的节点域 ID和该新节点 在该节点域内的节点 ID (该节点 ID可以釆用域内算法确定), 即节点标识 =节 点 i或 ID +节点 ID。 并且, 新节点所归属的节点域可能为上述接入节点的本域, 也可能不是上 述接入节点的本域, 针对这两种情况, 接入节点将上述加入请求消息发送给节 点域内该新节点的负责节点有两种处理方式: 方式一、 新节点与接入节点在同一节点域。 则接入节点在确定新节点在本 域后, 根据域内算法, 计算出该新节点的负责节点, 具体地, 该负责节点为其 节点标识大于该新节点的节点标识, 且其节点标识与新节点的节点标识最接近 的节点, 然后将上述加入请求消息转发给该负责节点; 方式二、 新节点与接入节点不在同一节点域。 则接入节点根据上述表 2, 获取新节点所在节点域的路由信息, 并根据该路由信息将上述加入请求消息转 发给该节点域的连接节点。 该连接节点确定该新节点在本域(具体可以釆用上 述最长匹配的方法确定, 也可以才艮据预先存储的信息确定), 釆用域内算法, 计算出该新节点的负责节点, 并将上述加入请求消息发送给该负责节点。 (三) 步 4聚 S706 负责节点在接收到上述加入请求消息后, 根据该加入请求消息的路由路 径, 向新节点返回响应消息, 该响应消息中携带负责节点的标识信息。 新节点在接收到上述响应消息后, 从该响应消息中获知负责节点的标识信 息, 根据该标识信息与负责节点进行其它消息的交互, 从而获取 P2P叠加网络 的路由表, 以及该新节点负责的数据资源等, 从而加入到 P2P叠加网络中。 并且, 新节点在接收到上述响应消息后, 将向其它域外接入点发域外广播 消息, 以通知其它域, 有新节点加入, 并接收其它域外节点发送的响应消息。 下面以图 8所示的 P2P叠加网络为例,对新节点加入到 P2P叠加网络的优 选实施方式进行说明, 图 9为新节点加入到 P2P叠加网络的流程力产, 如图 9 所示, 一个新节点加入到 P2P叠加网络主要包括以下步骤: 步骤 901 , 新节点获取其节点标识; 在具体实施过程中, 新节点获取节点标识有两种方法: 方法一, 新节点向 配置服务器发请求, 由配置服务器分配节点标识和叠加网接入节点, 如图 8所 示; 方法二, 新节点根据自己的 IP地址等信息, 自己生成节点标识, 叠加网接 入节点手工配置。 如新节点 N的节点标识为 01012340; 步骤 902, 新节点向 P2P叠加网的接入节点发节点加入请求消息, 该加入 请求消息中携带有新节点的节点标识; 接入节点是新节点连接 P2P叠加网的一个接入点, 由步骤 901可知它一般 是由配置服务器获得, 也可以是手工配置获得。 步骤 903 , 接入节点 B ( NodeID=01011345 ) 查询 i或间路由表 (表 2 ), 将 新节点的节点标识与各个节点域的节点域 ID进行前缀最长匹配, 发现与新节 点 N的 NodelD ( 01012340 ) 最长匹配的节点 i或 ID为 01012, 通过表 2, 接入 节点 B可以获取该节点域的连接节点为节点 G,接入节点 B将加入请求消息路 由到节点域间连接节点 G; 步骤 904,连接节点 G接收到上述加入请求消息后查询域间路由表(表 2 ), 将新节点的节点标识与各个节点域的节点域 ID进行前缀最长匹配, 发现和新 节点 N的 NodeID(01012340)最长匹配到节点 i或 ID为 01012, 即是本节点所在 的域, 再根据域内的算法 (如 Pastry, Chord, One-Hop等) 找到负责节点 (负责 节点即节点的 NodelD比新节点大, NodelD与新节点的 NodelD且最近的一个 节点) ,负责节点接收到消息后, 返回响应消息; 步骤 905 ~ 908, 响应消息根据请求的路由路径返回到新节点; 步骤 909, 新节点通过响应消息, 获取其负责节点的信息, 并通过其它消 息与负责节点交互, 获取路由表, 负责的资源数据等; 步骤 910, 新节点向其它域外接入点发域外广播消息, 通知其它域, 有新 节点加入; 在实际应用中, 如果域内算法为 One-Hop算法, 则需要本步骤的处理, 如 果为其它算法, 则不需要此步骤; 步骤 911 , 其它域外节点接收到上述广播消息向新节点发送响应消息。 从以上的描述中, 可以看出, 通过本发明实施例, 将资源域和节点域相分 离, 从而使得一个资源域的数据资源可以通过一个或多个节点域来负责存储。 进而使得运营商在规划叠加网时, 可以 4巴资源域和节点域分开, 如果某个资源 管理域的资源数据比较多时, 节点的数量也会非常多, 可以布局到多个节点域 中运行, 系统的维护开销就不会太大。 这样可以才艮据实际情况, 灵活地配置叠 加网。 从而提高整个叠加网络的性能提高。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以 用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多 个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码 来实现, 从而, 可以将它们存储在存储装置中由计算装置来执行, 并且在某些 情况下, 可以以不同于此处的顺序执行所示出或描述的步骤, 或者将它们分别 制作成各个集成电路模块, 或者将它们中的多个模块或步骤制作成单个集成电 路模块来实现。 这样, 本发明不限制于任何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领 域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的 ^"神和原则 之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之 内。 (2) Step S704 In a specific application, similar to the data resource operation method of the P2P overlay network, the access node may perform the longest match by the node identifier of the new node and the node domain ID of each node domain in the P2P overlay network. To determine the node domain to which the new node belongs, the node domain to which the node whose node identifier is within a certain range may be pre-stored when the network is set up, thereby acquiring the node domain to which the new node belongs. If the node domain to which the new node belongs is determined by the longest matching manner, the node identifier of the new node in the above step S702 includes: the node domain ID of the node domain to which the new node belongs and the new node The node ID in the node domain (the node ID can be determined by the intra-domain algorithm), that is, node ID = node i or ID + node ID. And the node domain to which the new node belongs may be the local domain of the foregoing access node, or may not be the local domain of the access node. For the two cases, the access node sends the join request message to the new domain in the node domain. The responsible node of the node has two ways of processing: Mode 1, the new node and the access node are in the same node domain. After determining that the new node is in the local domain, the access node calculates the responsible node of the new node according to the intra-domain algorithm. Specifically, the responsible node has a node identifier greater than the node identifier of the new node, and the node identifier and the new node identifier The node of the node identifies the closest node, and then forwards the above join request message to the responsible node; mode 2, the new node and the access node are not in the same node domain. The access node obtains the routing information of the node domain where the new node is located according to the foregoing Table 2, and forwards the joining request message to the connecting node of the node domain according to the routing information. The connecting node determines that the new node is determined in the local domain (specifically, may be determined by using the longest matching method described above, or may be determined according to pre-stored information), and the intra-domain algorithm is used to calculate the responsible node of the new node, and The above join request message is sent to the responsible node. (3) Step 4: The S706-receiving node returns a response message to the new node according to the routing path of the join request message after receiving the join request message, where the response message carries the identifier information of the responsible node. After receiving the response message, the new node learns the identification information of the responsible node from the response message, and performs interaction with the responsible node according to the identification information to obtain a routing table of the P2P overlay network, and the new node is responsible for Data resources, etc., are added to the P2P overlay network. Moreover, after receiving the response message, the new node sends an out-of-domain broadcast message to other out-of-domain access points to notify other domains, new nodes join, and receive response messages sent by other out-of-domain nodes. The P2P overlay network shown in Figure 8 is taken as an example to describe the preferred implementation of the new node joining the P2P overlay network. Figure 9 shows the process power of the new node joining the P2P overlay network, as shown in Figure 9. The new node joins the P2P overlay network mainly includes the following steps: Step 901: The new node obtains its node identifier. In the specific implementation process, the new node obtains the node identifier in two ways: Method 1, the new node sends a request to the configuration server, Configure the server to assign node IDs and overlay network access nodes, as shown in Figure 8. Method 2: The new node generates a node identifier according to its own IP address and other information, and the overlay network access node is manually configured. For example, the node identifier of the new node N is 01012340. Step 902, the new node sends a request message to the access node of the P2P overlay network, where the join request message carries the node identifier of the new node; the access node is the new node connected to the P2P. An access point of the overlay network, as shown in step 901, is generally obtained by the configuration server or manually. Step 903: The access node B (NodeID=01011345) queries the i or the inter-exchange table (Table 2), and matches the node identifier of the new node with the node domain ID of each node domain for the longest match, and finds the NodelD with the new node N. ( 01012340 ) The longest matching node i or ID is 01012. Through Table 2, the access node B can obtain the connected node of the node domain as the node G, and the access node B routes the join request message to the inter-domain inter-node connection node G. Step 904, after receiving the above-mentioned join request message, the connection node G queries the inter-domain routing table (Table 2), and matches the node identifier of the new node with the node domain ID of each node domain for the longest match, and finds the new node N. NodeID (01012340) matches the node i or ID to 01012, which is the domain where the node is located, and then finds the responsible node according to the algorithm in the domain (such as Pastry, Chord, One-Hop, etc.) (the NodelD ratio of the node responsible for the node) The new node is large, NodelD and Node1D of the new node and the nearest node), after receiving the message, the node returns a response message; Steps 905 ~ 908, the response message is returned to the new node according to the requested routing path; 909, the new node obtains the information of the responsible node by using the response message, and interacts with the responsible node through other messages to obtain the routing table, the responsible resource data, and the like; Step 910, the new node sends an out-of-domain broadcast message to the other out-of-domain access point. In the other application, if there is a new node to join, in the actual application, if the intra-domain algorithm is the One-Hop algorithm, the processing of this step is required. If it is another algorithm, this step is not needed; Step 911, other extra-domain nodes receive the above The broadcast message sends a response message to the new node. From the above description, it can be seen that, by using the embodiment of the present invention, the resource domain and the node domain are separated, so that the data resources of one resource domain can be stored by one or more node domains. In turn, the operator can separate the resource domain from the node domain when planning the overlay network, if a resource When the resource data of the management domain is relatively large, the number of nodes will be very large, and it can be deployed to run in multiple node domains, and the maintenance cost of the system will not be too large. In this way, the overlay network can be flexibly configured according to the actual situation. Thereby improving the performance of the entire overlay network. Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software. The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the scope of the present invention are intended to be included within the scope of the present invention.
Claims
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201010193254.1 | 2010-06-01 | ||
| CN2010101932541A CN102271144A (en) | 2010-06-01 | 2010-06-01 | P2P (point to point) overlay network, data resource operating method and new node adding method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2011150741A1 true WO2011150741A1 (en) | 2011-12-08 |
Family
ID=45053307
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2011/074167 Ceased WO2011150741A1 (en) | 2010-06-01 | 2011-05-17 | Point to point (p2p) overlay network, data resources operation method and new node join method thereof |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN102271144A (en) |
| WO (1) | WO2011150741A1 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107306296A (en) * | 2016-04-17 | 2017-10-31 | 王正伟 | Domain name substitutes application method |
| WO2021056738A1 (en) * | 2019-09-23 | 2021-04-01 | 平安科技(深圳)有限公司 | Distributed system nat traversal method, apparatus, and device, and storage medium |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111262916B (en) * | 2020-01-10 | 2022-11-08 | 深圳市网心科技有限公司 | Data distributed storage method and device, storage node and storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101651710A (en) * | 2009-09-21 | 2010-02-17 | 北京工业大学 | Disaster-tolerant backup method based on P2P |
| CN101674233A (en) * | 2008-09-12 | 2010-03-17 | 中国科学院声学研究所 | Peterson graph-based storage network structure and data read-write method thereof |
| CN101710902A (en) * | 2009-12-10 | 2010-05-19 | 北京邮电大学 | Unstructured P2P network and data query method and index update method thereof |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN100383764C (en) * | 1998-01-30 | 2008-04-23 | 纽约市哥伦比亚大学托管会 | Client-server interaction method and system in interactive communication |
| US8874691B2 (en) * | 2005-06-22 | 2014-10-28 | Core Wireless Licensing S.A.R.L. | System and method for establishing peer to peer connections between PCS and smart phones using networks with obstacles |
| CN101471838B (en) * | 2007-12-27 | 2012-06-27 | 华为技术有限公司 | Method, system and equipment for switching source |
| CN101374159B (en) * | 2008-10-08 | 2012-05-23 | 中国科学院计算技术研究所 | P2P network trusted control method and system |
| CN101483670B (en) * | 2009-02-25 | 2012-02-22 | 南京邮电大学 | Data Consistency Maintenance Method for Regional Peer Computing Based on Distributed Hash Table |
-
2010
- 2010-06-01 CN CN2010101932541A patent/CN102271144A/en active Pending
-
2011
- 2011-05-17 WO PCT/CN2011/074167 patent/WO2011150741A1/en not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101674233A (en) * | 2008-09-12 | 2010-03-17 | 中国科学院声学研究所 | Peterson graph-based storage network structure and data read-write method thereof |
| CN101651710A (en) * | 2009-09-21 | 2010-02-17 | 北京工业大学 | Disaster-tolerant backup method based on P2P |
| CN101710902A (en) * | 2009-12-10 | 2010-05-19 | 北京邮电大学 | Unstructured P2P network and data query method and index update method thereof |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107306296A (en) * | 2016-04-17 | 2017-10-31 | 王正伟 | Domain name substitutes application method |
| WO2021056738A1 (en) * | 2019-09-23 | 2021-04-01 | 平安科技(深圳)有限公司 | Distributed system nat traversal method, apparatus, and device, and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN102271144A (en) | 2011-12-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8732298B2 (en) | Method and apparatus for maintaining routing information | |
| EP2356792B1 (en) | Network nodes and methods for data authorization in distributed storage networks | |
| CN101860474B (en) | Peer-to-peer network and resource information processing method based on same | |
| US8233489B2 (en) | System, method, and router for routing data packets in an overlay network | |
| TW200803303A (en) | Inter-proximity communication within a rendezvous federation | |
| CN104170333A (en) | Method and system for fast and large-scale longest prefix matching | |
| CN103618801B (en) | Method, equipment and the system of a kind of P2P resource-sharing | |
| WO2009089772A1 (en) | A method for searching a network device and a network device | |
| CN104380289B (en) | Service-aware distributed hash table is route | |
| WO2013078776A1 (en) | Establishing a label distribution protocol ldp remote neighbor relationship | |
| CN108989220A (en) | Route Method And Route System | |
| CN103139076B (en) | Distributed hashtable intercommunication network system, domain intermediate node and implementation method | |
| WO2011150741A1 (en) | Point to point (p2p) overlay network, data resources operation method and new node join method thereof | |
| US20200186463A1 (en) | Method and system for name-based in-networking processing | |
| CN104539538A (en) | IP address matching method and data package forwarding method of router | |
| US20150098468A1 (en) | Method of controlling routing of identifier/locator mapping service | |
| US10735316B2 (en) | Receiver directed anonymization of identifier flows in identity enabled networks | |
| CN102611718B (en) | One nodes domains supports the resource lookup method and system of multiple resource domains | |
| CN103841027B (en) | The map information of Hash mapping plane is registered and lookup method, equipment and system | |
| Azgin et al. | Hash-based overlay routing architecture for information centric networks | |
| CN101753430B (en) | Distributed VPN route processing device and method based on route specifier | |
| CN101399739B (en) | Method, system and device for coverage network interconnection implementation | |
| WO2012003623A1 (en) | Resource information processing method based on peer-to-peer network, peer-to-peer network and node | |
| CN121151214A (en) | Gateway upgrading method, system, device, computer equipment and storage medium | |
| CN120186127A (en) | DNS resolution method, device and computer storage medium for decentralized network system |
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: 11789120 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 11789120 Country of ref document: EP Kind code of ref document: A1 |