WO2010069198A1 - 分布式网络构造方法和系统以及任务处理方法 - Google Patents

分布式网络构造方法和系统以及任务处理方法 Download PDF

Info

Publication number
WO2010069198A1
WO2010069198A1 PCT/CN2009/074451 CN2009074451W WO2010069198A1 WO 2010069198 A1 WO2010069198 A1 WO 2010069198A1 CN 2009074451 W CN2009074451 W CN 2009074451W WO 2010069198 A1 WO2010069198 A1 WO 2010069198A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
domain
identifier
content
distributed network
Prior art date
Application number
PCT/CN2009/074451
Other languages
English (en)
French (fr)
Inventor
王铁英
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2010069198A1 publication Critical patent/WO2010069198A1/zh
Priority to US12/980,900 priority Critical patent/US8489726B2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/54Store-and-forward switching systems 
    • H04L12/56Packet switching systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5038Address allocation for local use, e.g. in LAN or USB networks, or in a controller area network [CAN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1046Joining mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1061Peer-to-peer [P2P] networks using node-based peer discovery mechanisms
    • H04L67/1063Discovery through centralising entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1061Peer-to-peer [P2P] networks using node-based peer discovery mechanisms
    • H04L67/1065Discovery involving distributed pre-established resource-based relationships among peers, e.g. based on distributed hash tables [DHT] 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/604Address structures or formats
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/695Types of network addresses using masks or ranges of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/44Distributed routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a distributed network construction method and system, and a task processing method. Background technique
  • CDN Content Delivery Network
  • UPC User Generated Content
  • ES Edge Server
  • Embodiments of the present invention provide a distributed network construction method and system, and a task processing method, which implement a fully distributed network structure with more uniform nodes and no crossover.
  • a distributed network construction method including: determining, according to an address of a requesting node of a distributed network, a domain in which the requesting node is located, and acquiring a domain identifier;
  • the requesting node Generating an intra-domain identifier of the requesting node according to the number of the intra-domain nodes that the domain has; locating the domain identifier with the intra-domain identifier to obtain a node identifier of the requesting node; and sending the node identifier to the Referring to the requesting node, the requesting node acquires node information of the neighboring node according to the obtained node identifier to join the distributed network.
  • a method for processing an intra-domain task in a distributed network constructed by the above-described distributed network construction method includes:
  • the first node receives a task processing request, where the task processing request includes: a content upload processing request, adding or deleting a content processing request; Determining, by the first node, whether the resource performance of the first node meets the requirements of the task processing; if yes, returning the node information of the first node to the second node that initiates the task processing request, where the second node Said first node initiates an operation;
  • a node identifier generating apparatus including: a domain identifier obtaining module, configured to join an address of a requesting node of a distributed network according to a request, determine a domain where the requesting node is located, and acquire a domain Identification
  • An intra-domain identifier generating module configured to generate an intra-domain identifier of the requesting node according to the number of nodes in the domain that the domain has;
  • the node identifier obtaining module is configured to cascade the domain identifier with the identifier in the domain to obtain a node identifier of the requesting node.
  • a distributed network system including:
  • a request routing server configured to join the address of the requesting node of the distributed network according to the request, determine the domain where the requesting node is located, and obtain the domain identifier; generate the domain of the requesting node according to the number of nodes in the domain that the domain has Identifying; and cascading the domain identifier with the identifier in the domain to obtain a node identifier of the requesting node;
  • An edge server configured to calculate a node identifier of the edge server according to a domain identifier of a domain in which the request routing server obtains, or obtain the edge server calculated by the request routing server from the request routing server Node identifier; for storing content, the content having a corresponding content identifier; searching for content index information corresponding to the content of one or more edge servers closest to the content identifier, and searching for the edge server
  • the edge server where the content index information is to be obtained is also used for maintaining the node list, initiating the node query of the neighboring edge server, and performing statistics and recording on the performance thereof;
  • a content indexing server configured to perform operations of adding, deleting, and distributing content uploaded to the distributed network system, registering a content identifier corresponding to the content, and receiving a query content request sent by the user or the edge server, and performing Query content processing, and return the content identifier corresponding to the content to be queried.
  • a storage medium comprising at least one code segment for processing a signal, the code segment being executed by a machine such that the machine performs the following steps:
  • the requesting node Generating an intra-domain identifier of the requesting node according to the number of the intra-domain nodes that the domain has; locating the domain identifier with the intra-domain identifier to obtain a node identifier of the requesting node; and sending the node identifier to the Referring to the requesting node, the requesting node acquires node information of the neighboring node according to the obtained node identifier to join the distributed network.
  • the distributed network construction method, apparatus, system and task processing method of the embodiment of the present invention determine the domain of the requesting node and the intra-domain identifier by first determining the domain where the requesting node is located. The cascading is performed to obtain the node identifier of the requesting node, which avoids the problem that the node distribution in the network is unbalanced by using the existing KAD algorithm to directly obtain the node identifier of the node, so that the node distribution in the distributed network is more balanced. The load on the nodes is also more balanced, and the redundant information maintained by the nodes and the number of messages exchanged between the nodes are reduced.
  • FIG. 1 is a schematic diagram of a scenario of a distributed network according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a distributed network according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a first embodiment of a method for constructing a distributed network according to the present invention
  • FIG. 4 is a schematic flowchart of a second embodiment of a method for constructing a distributed network according to the present invention
  • 5 is a simplified schematic diagram of joining a domain of a second embodiment of a distributed network construction method according to the present invention
  • FIG. 6 is a schematic flowchart of a third embodiment of a method for constructing a distributed network according to the present invention.
  • FIG. 7A is a schematic flowchart of a process for receiving an FIND_NODE(X) request by an access node with a node identifier Y according to an embodiment of the present invention
  • FIG. 7B is a schematic flowchart of a method for updating a K bucket according to an embodiment of the present invention.
  • FIG. 8 is a schematic flowchart of a fourth embodiment of a method for constructing a distributed network according to the present invention.
  • FIG. 9 is a schematic flowchart of a specific processing procedure of an RRS for an exiting node according to an embodiment of the present invention
  • FIG. 10A is a schematic flowchart of a fifth embodiment of a method for constructing a distributed network according to an embodiment of the present invention
  • FIG. 10B is a specific flowchart of a content query method according to an embodiment of the present invention
  • FIG. 10C is a schematic flowchart of a method for processing a content index information according to an embodiment of the present invention
  • FIG. 11 is a schematic flowchart of a method for processing a task in a distributed network according to an embodiment of the present invention. Schematic;
  • FIG. 13 is a schematic structural diagram of an RRS in a distributed network system according to an embodiment of the present invention
  • FIG. 14 is a schematic structural diagram of a CIS in a distributed network system according to an embodiment of the present invention
  • the existing fully distributed network mainly uses each domain as a structured network, in which the nodes adopt a distributed network structure, and then each domain is connected into a large global distributed network structure, and each domain is The distributed structure of the middle nodes is interconnected through a global distributed network. In this way, each node needs to maintain the entries of two structured networks, namely domain and global. In order not to Nodes in the same domain can communicate. Two DHT algorithms need to be constructed. Through the shared intermediate nodes, the nodes between these domain networks are cross-managed, and then the internal and external messages are exchanged.
  • NodelD is usually calculated by a hash function in order to make the nodes in the distributed network evenly distributed according to their NodelD. In this way of node distribution, if the number of nodes is large enough, the distribution of nodes tends to be balanced.
  • the length of the general NodelD is 160Bit, which is the same as the length of the content ID.
  • nodes in each domain must maintain interaction messages with intermediate nodes, which will increase the overhead of nodes.
  • the information maintained by some nodes is redundant, which also causes unnecessary overhead.
  • a node represented by a 160-bit NodelD needs to maintain a list of 160 nodes, if each node list has node information, and each node needs periodicity with the neighbor node.
  • the heartbeat message is sent to maintain the interaction of the message. Then, at each cycle, the heartbeat message between the nodes needs at least 320.
  • FIG. 1 is a schematic diagram of a scenario of a distributed network according to an embodiment of the present invention, as shown in FIG. 1
  • RTS Request Routing Server
  • ES edge server
  • FIG. 1 Each network device under.
  • Request Routing Server (RRS) which is used for domain division, for example: setting the address of the edge server (Edge Server, hereinafter referred to as ES) to be added to the distributed network, in which address segments, which domain is also used to complete the request processing of the ES and user node logins; it can also be used to locate the domain based on the identifiers of the ES and the user node.
  • the RRS also records the distribution of domains, ESs, and user nodes in the distributed network; when a new domain joins, it is necessary to set the partitioning condition of the newly added domain, and also calculate the domain identifier of the domain; When each ES or user node joins, the node identifier (NodelD ) can be calculated by the ES.
  • Content Index Server which performs centralized content index management, is responsible for fuzzy search of user keywords; meanwhile, manages content in the distributed network, for example, judging the legitimacy of content, If it is not legal, initiate a delete operation, etc.; if you need to batch inject content, you can import the content to the CIS first, and then distribute it to the ES on the demand domain.
  • ES is primarily used to store and distribute content.
  • each ES and each user node can be regarded as one node, and the nodes mentioned in the following generally refer to the ES.
  • FIG. 2 is a schematic structural diagram of a distributed network according to an embodiment of the present invention.
  • the scenario of the distributed network in FIG. 1 is structured by using the KAD algorithm shown in FIG.
  • the structure can graphically illustrate how to achieve an equalized distribution of nodes joining the distributed network.
  • the embodiment of the present invention introduces a method for constructing a structured structure of the distributed network shown in FIG. 2 and an application of node joining, node exiting, and node and content query in the distributed network.
  • each black leaf node represents an ES in the distributed network shown in FIG. 1, and other leaf nodes do not exist in the distributed network, but only for logically articulated construction.
  • Virtual node In the binary tree structure, the position of the binary tree where each leaf node is located can be represented by 0, 1.
  • the string formed by 0 and 1 is used as the prefix of NodelD of the leaf node (ES).
  • ES leaf node
  • the Node1D and the content ID of the ES are the same length. For example, the length of the content ID is 160 bits. If the prefix of the Node1D of the ES is less than 160 bits, the remaining suffixes of the NodelD can be complemented by 0.
  • the binary tree is divided into two layers to be constructed separately.
  • the upper layer is an F-tree binary tree structure, indicating the domain in which the node is located.
  • the F-bit prefix of the node indicates the domain identifier (FieldlD) of the domain in which the node is located.
  • the node's NodelD is composed of FieldlD of the domain and the intra-domain identifier (PeerlD) of the domain where the node is located.
  • the length of the NodelD and the content ID are the same, for example, 160 bits.
  • Step 301 Determining the domain of the requesting node of the distributed network according to the request, determining the domain where the requesting node is located, and obtaining the domain identifier;
  • Step 302 Generate an intra-domain identifier of the requesting node according to the number of the intra-domain nodes in the domain.
  • Step 303 Cascade the domain identifier and the intra-domain identifier to obtain the node identifier of the requesting node.
  • Step 304 Send the node identifier to the requesting node. The requesting node acquires node information of the neighboring node according to the node identifier obtained by it, to join the distributed network.
  • the process of obtaining the foregoing node identifier (Node1D) and adding the requesting node to the distributed network according to the Node1D may be implemented in the RRS in the scenario shown in FIG. 1 or by other network devices that can obtain the Node1D.
  • the domain partitioning configuration is recorded on the RRS.
  • the RRS can be determined according to the IP address of the requesting node.
  • the RRS also uniformly distributes the domain according to the Field1D of the domain; in step 302, it is determined After requesting node A is after domain 2, according to the number of nodes currently distributed in domain 2 (two in FIG.
  • PeerlD of request node A can be generated by a predetermined algorithm; for example, Field1D of domain 2 If it is 0100, the PeerlD of the requesting node A in the domain 2 is 1000; then, in step 303, the FieldID and the PeerlD are cascaded to obtain the NodelD of the requesting node A is 01001000; in step 304, according to the 0, 1 Request Node1D of node A, that is, find the location of the leaf node that A should join in the structured binary tree structure of the distributed network shown in FIG. 2, and then request node A to acquire the node of the neighboring node according to the node identifier obtained by the node A. Information can be used to access the distributed network.
  • a predetermined algorithm for example, Field1D of domain 2 If it is 0100, the PeerlD of the requesting node A in the domain 2 is 1000; then, in step 303, the FieldID and the PeerlD are cascaded to obtain the NodelD of the
  • the domain of the requesting node is determined by first determining the domain where the requesting node is located, and then the domain identifier of the requesting node and the intra-domain identifier are cascaded to obtain the node identifier of the requesting node, thereby avoiding adopting the current
  • the problem that the KAD algorithm directly HASH obtains the node identifier of the node and the node distribution in the network is unbalanced makes the node distribution in the distributed network more balanced, the load on the node is more balanced, and the redundancy of the node maintenance is reduced. Remaining information and the number of messages interacting between nodes.
  • FIG. 4 is a schematic flowchart of a second embodiment of a method for constructing a distributed network according to the present invention.
  • the RRS in the distributed network needs to divide the domain,
  • the distributed network can be extended to the domain, and the bit number of the domain identifier is preset, and the domain identifier of the domain is calculated by the domain identifier generation method in the embodiment of the present invention, thereby performing the domain Balanced distribution.
  • the step of obtaining the domain identifier includes: Step 401: The RRS receives a request for adding a domain;
  • Step 402 Set a valid length of the domain identifier M
  • M is a positive integer, and the effective length M is set to facilitate the expansion of the domain
  • Step 403 Express the value of the domain existing in the distributed network as an M-bit bit value, and generate a domain identifier of the domain according to the bit value.
  • the domain that requests to join the distributed network is allocated to one leaf node of the binary tree structure according to its domain identifier, and the uniform hook distribution of the domains under the distributed network can be implemented.
  • a requesting node requests to join the distributed network, the following steps are included:
  • Step 404 The RRS receives a request that the requesting node joins the distributed network.
  • Step 405 The RRS specifies the joined domain according to the address information of the requesting node, and requests the address information of the node, such as IP address information. If the IP address of the requesting node is not within the range of the domain defined by the structured network, the returning node returns Adding a failure message to the requesting node, ending; no, 'J, performing step 406;
  • Step 406 Set a valid length N of the identifier in the domain
  • N is a positive integer, and the setting of the effective length N is also convenient for the expansion of the nodes in the domain; Step 407, determining whether there is an existing intra-domain identifier; if yes, executing step 408; otherwise, performing step 409;
  • Step 408 assigning an idle intra-domain identifier to the requesting node, and performing step 410;
  • Step 409 Obtain a quantity value of a node in the domain from the domain, and convert the quantity value into an N-bit bit value of the identifier in the corresponding domain, and generate an intra-domain identifier of the request node according to the bit value;
  • Step 410 Cascade the domain identifier and the intra-domain identifier to obtain the node identifier of the requesting node. Send the obtained node identifier to the requesting node, and the requesting node may obtain the node information of the neighboring node according to the node identifier to join the distributed network.
  • step 402 and step 403 are used to calculate the FieldID of the domain, thereby achieving uniform distribution of the domains.
  • FIG. 5 is a schematic diagram of the addition of the domain of the second embodiment of the distributed network construction method of the present invention.
  • the example shown in Figure 5 is a simple three-layer domain structure.
  • the effective length bit M of the general domain can be taken as 10, and the domain can be expanded to 1024.
  • the domain ID in the general calculated NodelD occupies the first 32 bits of 160 bits. If the effective length bit of the set field is 10, the 22 bits of the suffix complements 0.
  • each new node joins a distributed network, it first needs a NodelD as its identity to interact in the network.
  • the RRS calculates, according to the information in the request, which domain the requesting node belongs to, and assigns a Node1D to the requesting node according to the node information in the domain,
  • the above steps 406 ⁇ 409 are specifically as follows:
  • the RRS determines whether the number of free intra-domain identifiers (FreePeerlD) in the domain is FreePeerlD-Num is 0. If it is not 0, it means that a node has been added to the domain, but currently The node has exited, and the NodelD of the exit node has not been assigned to other nodes, then the Node1D of the exit node can be directly assigned to the requesting node; if FreePeerlD_Num is 0, then the current number of nodes is obtained from the domain.
  • FreePeerlD free intra-domain identifiers
  • the calculation process of PeerlD is similar to the calculation process of FieldID, and is not specifically exemplified here.
  • the RRS may be used to calculate the Node1D of the requesting node, or may be obtained by the requesting node.
  • the number of bits of NodelD and content ID is 32, and the number of bits of PeerlD is 128. If the effective length of FieldID is set to 10, PeerlD is valid. The length bit is 10, then the remaining bit bits will be padded with zeros.
  • the distributed network construction method of this embodiment specifically introduces the calculation process of the node identifier when the node joins the distributed network, and can determine the PeerlD of the requesting node that requests to join by first determining the FieldID of the domain, and then classify the FieldID and the PeerlD.
  • the NodelD method of the requesting node is obtained, so that the nodes in the distributed network are more evenly distributed, and the load of the nodes is more balanced; and since the domain distribution and the global distribution are not different DHT algorithms, intermediate nodes are not needed. Avoid a single point effect.
  • the effective length bits of FieldID and PeerlD are also limited, so that the node corresponding to 160-bit NodelD, which is added to the network, needs to maintain a maximum of 160 nodes to fall to If the effective length bit is 20 bits, only a maximum of 20 node lists need to be maintained, so that the number of message jumps during node query can be greatly reduced, and the system overhead can be reduced.
  • FIG. 6 is a schematic flowchart diagram of a third embodiment of a method for constructing a distributed network according to the present invention.
  • the requesting node acquires node information of the neighboring node according to the node identifier obtained by the requesting node to join the distribution.
  • the requesting node needs to obtain a node list by initiating a query for its own node to other nodes, that is, a node query method is needed to establish contact with each node in the distributed network.
  • the requesting node updates all its own node lists, the requesting node not only joins a virtual location (leaf node) in the distributed network as shown in FIG. 2, but actually joins the In a distributed network.
  • the steps for requesting a node to get a list of nodes are:
  • Step 601 The requesting node sends a query request for the requesting node to the access node that is known by the requesting node.
  • the requesting node obtains the access node information from the RRS, or obtains the node information of the access node from the retained information that has been used by itself, and the access node information includes the access node.
  • NodelD, IP address, port and other information the node information of the obtained access node is written into the node list corresponding to the requesting node, and then the requesting node initiates a request for querying the access node to the access node;
  • Step 602 The requesting node receives, by the node that the node identifier returned by the access node is the node information of the neighboring node with the smallest XOR of the node identifier of the requesting node, where the node information includes the node identifier, the IP address, the port, and the like of the neighboring node.
  • the access node first queries whether there is node information of the requesting node in the node list that it has, and if not, first adds the requesting node to the corresponding node list; and then queries the node identifier and the requesting node according to the Node1D of the requesting node.
  • the node identifies the neighboring node with the smallest XOR distance, and sends the node information of the neighboring node to the requesting node;
  • Step 603 Match the node identifier of the returned neighboring node with the node identifier of the requesting node, and record the node information of the neighboring node to the corresponding node list of the requesting node according to the matched number of bits;
  • Step 604 The requesting node uses the neighboring node as the access node that sends the query request for the requesting node again, and repeats the above steps 601-603 until the access node that the requesting node queries considers itself to be the node closest to the requesting node.
  • the query ends.
  • the requesting node records the node information of all the received neighboring nodes to the request. In the node list of the node, the requesting node joins the distributed network.
  • the node list is the K bucket commonly referred to in the KAD algorithm.
  • each node retains multiple K buckets.
  • the number of K buckets is related to the effective length of NodelD, that is, if NodelD is valid. The length is 20, and the K bucket is theoretically 20.
  • the binary tree can be decomposed into a series of consecutive subtrees that do not contain themselves; the highest subtree, the whole tree does not contain itself The other half of the tree consists of the next subtree consisting of the other half that does not contain itself, and so on, until the entire tree is split.
  • the i-th bucket of the node records the node information in the sub-tree obtained by the i+1th division. Since the information of k nodes is stored in each K bucket, the information recorded in each K bucket may be the node information of all nodes under the divided subtree, or may be the node information of some nodes.
  • the method of refreshing all the node lists is specifically: first, obtaining the node information of the access node (AES), and Recording this node into the corresponding K bucket; Second, initiating a node query request for the Node1D to the access node, thereby obtaining information of a series of other nodes adjacent to itself by the access node; Repeat the above steps to refresh all of its K buckets, and ensure that the node information obtained by them is all up to date.
  • Any node can initiate a node query request, for example: a node whose node is identified as Z initiates a query request for a node whose node ID is X to the node whose node is identified as Y.
  • a node whose node ID is X to the node whose node is identified as Y.
  • FIG. 7A is a schematic diagram of a process flow of a request for receiving an FIND_NODE(X) by an access node with a node identifier Y according to an embodiment of the present invention.
  • the request of the FIND_NODE(X) may be initiated by a node with a node identifier of Z.
  • the query request with the node ID being X may also be a query request initiated by the node whose node identifier is X, as shown in FIG. 7A, and the steps are as follows:
  • Step 701 The access node with the node identifier Y receives the FIND_NODE(X) request initiated by the node with the node identifier Z;
  • Step 702 The access node updates the corresponding K bucket by using a K bucket update method to determine whether a node with a node identifier of Z exists in the corresponding K bucket;
  • Step 703 Extract the M + N bit prefix from the node identifiers X and Y respectively, and obtain the identifier X, ⁇ '; where ⁇ represents the effective length bit of the FieldID, that is, the above FL, N represents the effective length bit of the node in the domain of PeerlD , ie PL;
  • Step 706 The node identifier Y is the same as the node identifier X, and the node that returns the node identifier Y is the node that is queried by the node whose node identifier is Z, and ends;
  • Step 711 Obtain a node adjacent to the node with the node identifier X from the i-th K bucket, and the node with the node identifier X is the node identifier of the node and the node identifier X is the smallest or the smallest value.
  • Step 712 Store node information of the obtained node, and cumulatively calculate the number of nodes currently stored.
  • Step 713 Determine whether the number of accumulated nodes is sufficient to obtain the number k. If there are less than k, execute step 710; otherwise, if there are enough k, execute step 714; Step 714, further determine whether to obtain If the node information of a certain number of nodes is not obtained, step 715 is performed; otherwise, step 716 is performed;
  • Step 715 the node whose return node is identified as Y is the node closest to the node whose node identifier is X, and step 717 is performed;
  • Step 716 Return node information of the obtained node.
  • step 716 it is possible to continue to the last K bucket, and the number of acquired nodes is still no more than k, and the information of the obtained less than k nodes is returned.
  • Step 717 The node with the node identifier Z receives the node information of the neighboring node returned by the access node with the node identifier Y, and updates the node information of the corresponding node to the node with the node identifier Z according to the K bucket update method. In the K bucket.
  • FIG. 7B is a schematic flowchart of a K bucket update method according to an embodiment of the present invention.
  • Step 702 is used to update node information about a node with a node identifier Z in a K bucket corresponding to a receiving node by using the K bucket update algorithm, and step 717 uses the K bucket update.
  • the algorithm updates the node information of the neighboring node returned by the receiving node received by the node identified by the node to the K bucket corresponding to the node whose node identifier is Z.
  • the specific steps of the K bucket update method are:
  • Step 702d determining whether the node information of the node whose node is identified as Z exists in the i-th K bucket of the node identified as Y, if yes, executing step 702e; otherwise, performing step 702f;
  • Step 702e Adjust node information of the node whose node is identified as Z to the tail of the i-th K bucket; and record the node information of the node in the K bucket by placing the node information of the most recently active node at the end of the K bucket, and ending ;
  • Step 702f determining whether the number of nodes recorded in the i-th K bucket is less than k, generally specifying that the node information of the k nodes can be stored in the K bucket, and if the value is less than, the number of nodes recorded in the K bucket is not full, and the steps are performed. 702j; Otherwise, the number of nodes recorded in the K bucket is k, and step 702g is performed;
  • Step 702g Ping the node of the K bucket header, and the ping operation is to detect a node in the network to determine whether it is still online;
  • Step 702h it is determined whether the node of the K bucket header responds to the operation, if there is no response, step 702i is performed; otherwise, step 702k is performed;
  • Step 702i deleting a record of a node of the K bucket header
  • Step 702j placing the node information of the request node X to the end of the K bucket, and ending;
  • step 702k adjusting the node of the K bucket header to the tail of the K bucket;
  • Step 7021 it is determined whether all nodes in the K bucket have been traversed, if not, step 702g is performed; otherwise, step 702m is performed;
  • Step 702m ignoring the node information of the requesting node X, and ending.
  • the node whose node identifier is Z is again identified from all nodes of the current known distance node as X.
  • a node that has not sent a request for FIND_NODE(X) is selected as an access node in the near node, and a request for the FIND_NODE(X) is sent to the near node, and the request is received.
  • the requesting access node of FIND_NODE(X) repeats steps 701-717 in FIG.
  • the nodes that do not respond in time to the node whose node ID is Z will be immediately excluded, so as to ensure that the nearest node finally obtained by the requesting node X is active.
  • a method for querying a node is specifically introduced.
  • the method for querying the node obtains its node identifier at the requesting node, and is especially important when joining the distributed network.
  • the node whose node identifier is Z is the request node whose node identifier is X
  • the request node uses the node query method of steps 701 to 717 to find the node information of the node that is closer to its own node identifier X, and these nodes are
  • the node information is added to the node list corresponding to the requesting node (ie, K bucket), and thus, the requesting node added to the distributed network is associated with other nodes in the distributed network.
  • FIG. 8 is a schematic flowchart of a fourth embodiment of a method for constructing a distributed network according to the present invention.
  • a node is associated with a neighboring node. .
  • the distributed network if some other nodes do not receive the response message of a certain node that has been associated with each other, that is, if the certain node may have exited the distributed network, the distributed network
  • the specific process for managing the node that may exit and its node information is:
  • Step 801 The RRS receives, by the one or more nodes in the distributed network, a processing request for the exit node.
  • the interaction between the nodes is completely distributed, and the NodelD of each node is allocated according to an algorithm of the embodiment of the present invention; therefore, when one node exits the network, other nodes may Through the periodic heartbeat message, you can know the status of its neighbors.
  • the exit node has node information, so the heartbeat message is sent periodically to keep in touch with the exit node. When some nodes find that the heartbeat message they sent does not respond, it considers that the exit node is invalid, and reports to the RRS to request processing of the exit node.
  • Step 802 The RRS checks the list of the failed nodes that are locally saved, and determines whether the exit node is invalid.
  • the determining process includes the following two situations:
  • the exit node is created in the list of failed nodes; and it is determined whether the exit node is invalid. If yes, the node identifier of the exit node is written into the idle domain of the domain where the exit node is located. In the identification list, when a new node is added to the domain, the node identifier is assigned to the new node.
  • the node information of the exit node exists in the failed node list, and the exit node is not judged to be invalid, it is determined whether the exit node is invalid; if yes, the node identifier of the exit node is written into the idle domain identifier list of the domain where the exit node is located In the middle, when the new node is added to the domain, the node identifier is assigned to the new node.
  • the data structure of the list of failed nodes is as follows:
  • NodeID, IP Addr, IP_Port respectively represent the NodelD, IP address and IP port of the failed node;
  • Report_Num represents the total number of nodes reporting the failure of the exit node, and setting RN to a critical value of the Report_Num Point, if Report_Num is greater than or equal to RN, the RRS detects whether the exit node is really invalid; Flag indicates whether the exit node has been invalidated; Time indicates the time when the exit node record was created.
  • the NodeID, IP address, and IP port are matched, and the query is considered successful.
  • the node information of the exit node exists in the list of failed nodes.
  • FIG. 9 is a schematic flowchart of a specific processing procedure of an RRS to an exit node according to an embodiment of the present invention, as shown in FIG.
  • Step 901 The RRS receives a node sent by another node, where the node is called an exit node. Effective processing request;
  • Step 902 The RRS checks the local failed node list; the data structure of the failed node list is as shown above;
  • Step 903 it is determined whether the exit node has been recorded in the list of failed nodes, if there is no record, step 904 is performed; otherwise, step 905 is performed;
  • Step 904 creating a record of the exit node in the local failed node list, and initializing the total number of reports, recording time and other information therein, and then performing step 906;
  • Step 905 determining whether the flag is true, that is, whether the exit node that has been recorded has been invalidated, if true, that the exit node has been invalidated, and ends; otherwise, step 906 is performed;
  • Step 906 Report - Num plus 1. That is, there is another node reporting request to process the exit node;
  • Step 907 determining whether Report_Num is greater than or equal to RN, if Report_Num is less than RN, then ending; otherwise, performing step 908;
  • Step 908 the RRS initiates the detection of the information to the exit node, and determines whether the exit node is offline; if there is no drop, go to step 909; otherwise, go to step 910;
  • Step 909 Delete the record of the exit node in the failed node list, and end;
  • Step 910 Write the NodelD of the exit node to the corresponding free domain identifier list FreePeerlD_List in the domain;
  • the RRS In the process of managing the exit node by the RRS, the RRS also manages the node information recorded on the list by periodically scanning the list of failed nodes, determining whether the node information recorded on the list of failed nodes is expired, and will expire.
  • the node record is deleted. For example, a corresponding node that does not update the node information more than two scanning periods may be an expired node, and the node information of the node is deleted.
  • This embodiment mainly describes a management process for a node on a distributed network to exit, and further The step is to improve the construction method of the distributed network.
  • FIG. 10A is a schematic flowchart diagram of a fifth embodiment of a method for constructing a distributed network according to the present invention.
  • the content managed on each ES has its corresponding content identifier (content ID), and the ES performs related information and content ID of the content managed by the ES on the CIS in the network shown in FIG. Registering, and storing the content index information on one or several nodes corresponding to NodelD having the smallest distance from the content ID, such that the content index information managed by the node storing the content ID indicates that the content corresponding to the content index information is stored.
  • ES in order to find the content ID, it can be known which content index information and content corresponding to the content index information are stored on which ES.
  • the node When a node or a user node initiates a query for a certain content, the node first searches for the content on the CIS in the network shown in FIG. 1 to obtain a content ID of the corresponding content. Or the user node initiates a query according to the content ID that it knows, finds the node that manages the content ID, and obtains the content index information from the content, that is, obtains the ES that saves the corresponding content.
  • the process of defining a node or a user node as a content query request node, and querying the node corresponding to the NodelD closest to the content ID is similar to the process of node query, as shown in FIG. 10A, and includes the following steps:
  • Step 1001 The content query requesting node finds, from the node list, a node whose node identifier has the smallest content ID corresponding to the content to be queried as the first query node, and sends a query request for the content ID to the first query node;
  • Step 1002 If the node whose distance is smaller than the node identifier and the content ID of the first query node is not found in the node list of the first query node, return the node information of the first query node to the content query request node;
  • Step 1003 If a second query node whose distance is smaller than the node identifier and the content ID of the first query node is found in the node list of the first query node, return the node information of the second query node to the content query request node. ;
  • Step 1004 The content query requesting node sends a request for querying the content ID to the returned node. If the corresponding content index information is managed on the node, the content index information is returned to the content query. The node is searched for; otherwise, the node with the smallest distance between the node identifier and the content identifier is searched for to query the content index information, and the query is the same as steps 1001 to 1003.
  • each domain also has a randomly obtained FieldlD with a number of bits of M, which is denoted as F(l) ⁇ F(2) ⁇ F( 3) ⁇ ... ⁇ F(n).
  • F(l) ⁇ F(2) ⁇ F( 3) ⁇ ... ⁇ F(n).
  • the bit values vary greatly, that is, the two domains are far apart.
  • the index information of the content corresponding to the content ID of the bit value of all the M-bit prefixes in the distributed network between the field ID and the bit value of the Field1D of the domain i+1 is uploaded to the node of the NodelD in the domain i. Manage on it, which will cause the load on this node to be too large.
  • the method for querying the content ID of the embodiment of the present invention further performs matching to determine the content ID in the join domain i, that is, the prefix of the valid length bit N in the domain after the effective length bit M of the Field1D of the content ID is searched in the domain. Neighboring nodes within i, so that the content IDs added to the domain i can be evenly distributed to the respective nodes in the domain i, thereby alleviating the load on the node with the largest NodelD in the domain i.
  • FIG. 10B is a schematic flowchart of a content query method according to an embodiment of the present invention. As shown in FIG. 10B, the method includes the following steps:
  • Step 1005 The query node with NodelD Y receives the query request for the content query request node for the content ID XI;
  • Step 1006 Determine whether the content ID of the content query request node is queried on the query node, if the record exists, go to step 1007; otherwise, go to step 1008;
  • Step 1007 Return node information of the query node, and the query node whose NodelD is Y is the node closest to the content ID, and the query ends;
  • Step 1008 Extract the M-bit prefix from the identifiers XI and Y respectively, and obtain the identifiers ⁇ and ⁇ '; wherein ⁇ represents the effective length bit of the Field1D, that is, the above FL;
  • Step 1012 Determine whether the i-th K bucket exists in the query node, if not, Go to step 1013; otherwise, go to step 1022;
  • Step 1015 Extract the N-bit prefix of the M-bit from the identifiers XI and Y respectively, and obtain the identifiers ⁇ , ⁇ "; where ⁇ indicates the effective length of the PeerlD of the node in the domain, that is, PL;
  • Step 1018 determine whether the i+M buckets in the query node exist, if If not, go to step 1019; otherwise, go to step 1022;
  • Step 1021 Return the node information of the query node, and the query node whose NodelD is Y is the node closest to the content ID, and the query ends;
  • Step 1022 Return the node with the smallest distance between the NodelD and the content ID selected from the i-th K bucket, and end the query.
  • the process of querying the node for the content ID in order to register the content ID corresponding to the content saved on the ES on the node closest to the content ID is the same as the node query process described above with reference to Figs. 10A and 10B.
  • the difference is that after the content ID query process queries the closest node, the content ID is obtained from the node, and the content ID registration process registers the content ID to the node after querying the closest node.
  • the first node m finds all nodes in the second domain with the FieldID and the FieldID of the first domain t being the smallest, and in this embodiment, the domain i is found.
  • All nodes obtain the content index information of the M-bit of the content ID recorded on all the nodes in the second domain i that is greater than or equal to the content index of the FieldID of the first domain t; if there are other nodes in the first domain t, the first The node m finds the second node n with the smallest distance between the Node1D and the Node1D of the first node m, and obtains the content index of the PeerlD whose M-bit prefix of the content ID recorded on the second node n is greater than or equal to the first node m. information.
  • FIG. 10C is a schematic flowchart of a content index information migration method according to an embodiment of the present invention. As shown in FIG. 10C, the method includes the following steps:
  • the first node m determines whether it is the only node in the first domain t, and if so, step 1024 is performed; otherwise, step 1026 is performed;
  • Step 1024 The first node m sends a content index information migration request, and searches for a second domain in which the FieldID and the FieldID of the first domain t are the smallest distance;
  • Step 1025 Obtain content index information of the content ID of the first domain t from all the nodes in the second domain, and perform step 1030;
  • Step 1026 The first node m sends a content index information migration request, and finds, from the first domain t, a second node with the smallest distance between the NodelD and the NodelD of the first node m.
  • Step 1027 determining whether the NodelD of the second node is greater than the NodelD of the first node m, if yes, executing step 1028; otherwise, performing step 1029;
  • Step 1028 obtaining, from the second node, the N-bit bit of the content ID immediately after the M-bit is greater than the PeerlD of the first node and smaller than the content index information of the Peer1D of the first node, and executing step 1030;
  • Step 1029 Obtain, from the second node, the N-bit bit immediately following the M-bit of the content ID is greater than the content index information of the Peer1D of the first node.
  • Step 1030 Migrate the obtained content index information to the first node m.
  • FIG. 11 is a schematic flowchart diagram of an embodiment of a method for processing a task in a distributed network according to the present invention.
  • the user node or ES will have a request for task processing at a certain moment, for example, the user uploads the stored content; the node needs to migrate the content because the local load is too heavy; or the domain needs to add or delete some copies, etc., these requests are Some nodes need to be specified for processing, and the resources of these nodes are resources that can satisfy the processing requirements of these requests.
  • the task processing operation can be performed in the local domain more quickly and efficiently, and the specific process is as follows:
  • Step 1101 The first node receives a task processing request, where the task processing request includes: a content upload processing request, adding or deleting a content processing request;
  • Step 1102 The first node determines whether its own resource performance meets the requirements of the task processing.
  • Step 1103 If yes, return the node information of the first node to the second node that initiates the task processing request, and the second node to the first node. Initiate an operation;
  • Step 1104 If not satisfied, select a third node whose resource performance meets the requirement of the task processing from the node list of the first node, and return the node information of the third node to the second node that initiates the task processing request, where the second node The third node initiates an operation;
  • the first node preferentially selects the K bucket identifier to represent a node in the node list that is greater than or equal to M (that is, a node in the same domain).
  • Step a The user node sends a processing request for the uploaded content to its access node (ie, AES);
  • Step b AES detects whether it has sufficient resources to meet the content uploading requirements, if yes, perform step c; otherwise, perform step d; Step c: return the information of the AES to the user node, and then the user node performs an operation of uploading the content;
  • Step e The AES returns the node that satisfies the content request of the user node to the user node.
  • Step f The user node initiates an operation request to the node that can satisfy the user node to upload the content request.
  • the user node can also be an arbitrary ES.
  • the ES itself can perform the node query and the like as the AES, the AES at this time is also the ES itself.
  • the processing method is a distributed network based on the above-mentioned domain structure. Therefore, when performing task processing in the domain, an appropriate node can be selected from the nodes in the domain to process the task request.
  • the node identifier generating apparatus includes: a domain identifier acquiring module 121, an intra-domain identifier generating module 122, and a node identifier acquiring module 123.
  • the domain identifier obtaining module 121 may be configured to join the address of the requesting node of the distributed network according to the request, determine the domain where the requesting node is located, and obtain the domain identifier; the intra-domain identifier generating module 122 shall be based on the number of nodes in the domain that the domain has.
  • the intra-domain identifier of the requesting node is generated.
  • the node identifier obtaining module 123 cascades the domain identifier with the intra-domain identifier to obtain the node identifier of the requesting node.
  • the domain identifier obtaining module 121 may further include: a first setting module 1211 that sets an effective length M of the domain identifier, where M is a positive integer, and the number of existing domains in the distributed network The magnitude is represented as an M-bit bit value, and a first calculation module 1212 that generates a domain identifier for the domain based on the bit value.
  • the in-domain identifier generating module 122 may further include: a second setting module 1221 that sets the effective length N of the identifier in the domain, where N is a positive integer, determines whether there is a free intra-domain identifier determining module 1222, and assigns the idle intra-domain identifier to An evaluation module 1223 of the requesting node, and obtaining a quantity value of the intra-domain node from the domain, and converting the quantity value into a corresponding N-bit bit value, and generating a second calculation module 1224 of the intra-domain identifier of the requesting node according to the bit value.
  • a second setting module 1221 that sets the effective length N of the identifier in the domain, where N is a positive integer, determines whether there is a free intra-domain identifier determining module 1222, and assigns the idle intra-domain identifier to An evaluation module 1223 of the requesting node, and obtaining a quantity value of the intra-domain node from the domain, and converting the quantity
  • the embodiment provides a node identifier generating device for a node when constructing a distributed network, and the node identifier is generated according to the domain distribution in the network and the distribution of nodes in the domain, which can make the node distribution in the distributed network more balanced.
  • the load on the nodes is also more balanced.
  • the scenario of the distributed network system of the present invention is as shown in FIG. 1 , including: a request routing server ( RRS ), which can join the address of the requesting node of the distributed network according to the request, determine the domain where the requesting node is located, and obtain the domain identifier.
  • RRS request routing server
  • the edge server configured to calculate a node identifier of the ES according to the domain identifier of the domain in which the RRS is obtained, or obtain a node identifier of the ES calculated by the RRS from the RRS; for storing content, the content has a corresponding content identifier; Find one or more Edge Server registrations that are closest to the content ID Corresponding content index information, and the edge server where the content index information to be
  • FIG. 13 The specific structure of the RRS in the schematic diagram of the distributed network of the present invention shown in FIG. 1 is shown in FIG. 13, and the specific structure of the CIS is shown in FIG. 14.
  • the specific structure of an ES is shown in FIG.
  • the combination of Figure 15 constitutes The distributed network architecture shown in Figure 1. 13 to 15 will be specifically described below.
  • FIG. 13 is a schematic structural diagram of an RRS in a distributed network system according to an embodiment of the present invention.
  • the RRS 13 includes: a Field1D obtaining module 131, which is mainly used for ES or user node login (ie, joining the distributed In the case of the network system, according to the division of the domain identifier, it is determined that the domain belongs to, and the allocation of Field1D of a newly added domain can also be calculated; PeerlD generation module 132, which mainly calculates each node newly added to a domain.
  • the PeerlD the specific algorithm can refer to the calculation method of the intra-domain identifier in the above embodiment, and is mainly calculated according to the information of the relevant node in a domain; the NodelD acquisition module 133 is configured to cascade the FieldlD and the PeerlD to obtain the login to the network system.
  • the NodeID of the node It should be noted that the PeerlD generation module 132 and the NodelD acquisition module 133 can also be implemented by migrating to the user node.
  • the user node can calculate the NodelD of the user node as long as the user node obtains the number of nodes in the domain to which the FieldlD and the user node join.
  • the RRS 13 may further include: a domain division management list 134, which may be configured by an administrator. For example, whenever a new domain joins, the administrator needs to configure the domain in the domain division management list 134.
  • the traditional method is The domain in which the user node is located is determined according to the address segment or the location information provided by the user node.
  • the domain management module 135 manages the distribution of the domain in the system and the distribution of the nodes in the domain, and the management information includes the number of domains, the effective length of the domain identifier, and the list information of the domain. Its data structure is as follows:
  • Field_ Num indicates how many fields are currently in the system
  • FieldList records each in the system Related to the domain, Wherein, FieldlD is the calculated bit bit string, which is usually 32 bits; Peer-Num is the number of ES nodes owned in the domain; AccessES_List is randomly selected from the ES nodes added in the domain.
  • FreePeerlD Num indicates the number of nodes that need to be recorded when there is a node drop
  • FreePeerlD List is the list of PeerlD records of the dropped node, when a new node joins or a dropped node recovers You can select a NodelD directly from the PeerlD's record list as the intra-domain identification part of your own NodelD.
  • the parameters managed by the domain management module 135 are used.
  • FIG. 14 is a schematic structural diagram of a CIS in a distributed network system according to an embodiment of the present invention.
  • the CIS 14 may include: a content index management module 141, and each content uploaded to the system needs to be in the module. Registration is performed, the module records metadata information of some content; and is also used to determine whether the uploaded content has been registered in the system; the content operation module 142, when the user node detects that the content is illegal, The module initiates a request to delete the content.
  • the module can be combined with a specified content distribution server to send the content to the required domain; the keyword query module 143, To implement fuzzy query on CIS, the user can select content from the query result and obtain the ContentID of the content.
  • FIG. 15 is a schematic diagram of a specific structure of an ES in a distributed network system according to an embodiment of the present invention.
  • the ES15 includes: a content index registration module 151, configured to record and manage a minimum distance from a node identifier of the ES15.
  • the content identifier information is identified by the content identifier;
  • the node management module 152 is configured to perform maintenance on the node list;
  • the query module 153 is configured to initiate a node query to the neighboring edge server, and initiate a content identifier corresponding to the content to be queried.
  • Query performance statistics module 154, used to perform statistics and records on its performance.
  • the content index registration module 151 records the node information of the node whose content ID and the content ID of the node ID are the smallest, and the data structure is as follows, where the ContentID is the ContentID corresponding to the content stored on the other node, and is stored in the PeerList. NodelD for storage Node information of another node:
  • the node management module 152 calculates the content ID of the locally stored content, and then finds the node corresponding to the Node1D closest to the content ID to register the content ID; in the module, the node list, that is, the neighbor node, can also be implemented. Maintenance and other functions.
  • the maintenance of the neighboring node is mainly to maintain the K buckets on the node. Since the effective length of the FieldID and the effective length of the Node1D are controlled in the embodiment of the present invention, the scalability of the distributed network system is considered. , set the upper limit of the number of fields at the beginning, such as 2 n . Under normal circumstances, n needs to be set according to the division of the domain by the distributed network system.
  • n can be set very large, but in order to avoid excessive presence of nodes in the domain joining the domain K bucket (that is, there is no node information in the range recorded by some K buckets maintained by it), try to set n as appropriate, this n is called the effective length of the domain, that is, the other domains maintained by the node.
  • the maximum identifier of the node list in the node information In this way, the node list of the node identifies that the node information in the other domain is recorded in the K bucket from 0 to n-1, and the other K buckets whose identifier is greater than n records the node information of the node in the same domain as the local node.
  • the data structure of the i-th K bucket of this node can be expressed as follows:
  • the performance statistics module 154 mainly counts some current performance indicators of the node, that is, the ES15. For example: uplink free bandwidth, downlink idle bandwidth, CPU utilization, memory utilization, and remaining valid storage space. According to different performance requests, relevant statistics are sent to the node requesting the performance indicator. For example: When a node has the following request to the node, it may, but is not limited to, return the following performance statistics:
  • resources include: hard disk, The size of the downstream bandwidth, memory, etc.;
  • the resources include: the size of the hard disk, the downlink bandwidth, the memory, etc.; the content moves out of the node, and the resources include: the uplink bandwidth;
  • the distributed network system provided in this embodiment describes the connection relationship between the devices in the system and how the devices manage the information on other devices.
  • the specific operation method such as how the node is the NodelD of the ES, how to perform the node query and the content query, how to configure the node list, and the like, are all involved in the foregoing method embodiments, and are not described here.
  • the distributed network system avoids the problem that the nodes in the network are distributed unevenly by using the existing KAD algorithm to directly obtain the NodelD of the node, which makes the node distribution in the distributed network more balanced, and the load of the node is It is also more balanced; in addition, the effective length of each of FieldID and PeerlD is limited, so that the list of nodes that need to be maintained by the nodes added to the network is greatly reduced, and the number of message jumps when the node is queried is reduced, thereby reducing The overhead of the system.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Description

分布式网络构造方法和系统以及任务处理方法 本申请要求于 2008 年 12 月 19 日提交中国专利局, 申请号为 200810240455.5 , 发明名称为 "分布式网络构造方法、 装置和系统以及任务 处理方法" 的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及通信技术领域, 特别涉及一种分布式网络构造方法和系统以 及任务处理方法。 背景技术
内容分发网络( Content Delivery Network, CDN )技术已经成为目前 媒体内容分发技术的一个主要平台技术, YouTube、 YouKu、 56、 土豆网 等用户原创内容(User Generated Content , UGC ) 业务网络的普及, 吸引 了大量的用户分享内容。 这些业务目前主要是利用分域管理的分布式网络 结构来实现的, 该网络结构主要采用两种方式来实现。 一种方式是, 在每 一个域中架构一台域管理服务器, 管理域中节点的运行情况, 然后再架构 对这些域管理服务器进行管理的中心服务器, 实现分层管理。 即, 网络中 的分享内容通过中心服务器逐层的往下分发, 使得内容放置到用户接近的 域中的节点, 即边缘服务器(Edge Server, ES )上。 这样, 使得用户可以 快速的从 ES上获取需要的内容。 另外一种是, 通过对分布式网络中的各 个节点进行性能统计, 选择一些性能比较优异的节点作为超级节点, 由超 级节点对域中的节点进行管理, 而无需中心服务器再对超级节点进行管 理, 这种方式由于简化了分层管理的结构, 称为完全分布式网络结构。
在现有的完全分布式网络结构中, 由于用户对于存储内容的节点的需 求存在着地域上的差别, 即, 用户能够在自己的接入域中的节点上进行内 容的请求或者存储等操作。 在这种网络结构中, 全局的内容管理和各个域 的节点管理, 需要构建两种分布式哈希表(Distributed Hash Table, DHT ) 算法来进行操作。 在现有的分布式网络结构中, 一般采用的 DHT算法有 Chord、 CAN, Pastry、 KAD ( KAD是 kademlia的简称) 等, 其中 KAD 较其他的算法, 是通过一种独特的异或算法 (XOR )作为距离度量基础, 建立的一种全新的 DHT算法的拓朴结构, 可以大大提高路由查询速度。
发明人在实现本发明的过程中, 发现现有技术至少存在以下缺点: 采 用现有的 DHT算法计算的节点标识 (NodelD ) 进行节点分布是非常的不 均匀的, 容易造成节点上的负载的不均衡; 同时, 由于每个节点都需要维 护两张结构化网络的表项, 使得某些节点维护的信息冗余, 也会造成不必 要的开销。 发明内容
本发明实施例提供一种分布式网络构造方法和系统以及任务处理方 法, 实现一种节点分布更加均匀的、 无交叉的完全分布式网络结构。
根据本发明的一方面, 提供了一种分布式网络构造方法, 包括: 根据请求加入分布式网络的请求节点的地址, 确定所述请求节点所在 的域, 并获取域标识;
根据所述域具有的域内节点的数量, 生成所述请求节点的域内标识; 将所述域标识与所述域内标识级联, 获得所述请求节点的节点标识; 将所述节点标识发送至所述请求节点, 所述请求节点根据其获得的节点 标识获取邻近节点的节点信息, 以加入所述分布式网络。
根据本发明的另一方面,提供了一种在上述分布式网络构造方法构造的 分布式网络中进行域内任务处理方法, 其特征在于, 包括:
第一节点接收任务处理请求, 所述任务处理请求包括: 内容上传处理请 求、 增加或删除内容处理请求; 所述第一节点判断其自身的资源性能是否满足任务处理的要求; 若满足, 则将所述第一节点的节点信息返回发起所述任务处理请求的第 二节点, 所述第二节点向所述第一节点发起操作;
若不满足, 则从所述第一节点的节点列表中选择资源性能满足任务处理 的要求的第三节点, 将所述第三节点的节点信息返回发起所述任务处理请求 的第二节点, 所述第二节点向所述第三节点发起操作; 其中选择第三节点时, 先从存储有所述第一节点所在域的域内节点信息的节点列表中选择。
根据本发明的另一方面, 提供了一种节点标识生成装置, 包括: 域标识获取模块, 用于根据请求加入分布式网络的请求节点的地址, 确定所述请求节点所在的域, 并获取域标识;
域内标识生成模块, 用于根据所述域具有的域内节点的数量, 生成所述 请求节点的域内标识;
节点标识获取模块, 用于将所述域标识与所述域内标识级联, 获得所述 请求节点的节点标识。
根据本发明的另一方面, 提供了一种分布式网络系统, 包括:
请求路由服务器, 用于根据请求加入分布式网络的请求节点的地址, 确定所述请求节点所在的域, 并获取域标识; 根据所述域具有的域内节点 的数量, 生成所述请求节点的域内标识; 并将所述域标识与所述域内标识级 联, 获得所述请求节点的节点标识;
边缘服务器, 用于根据从所述请求路由服务器获得的其所在域的域标识 计算所述边缘服务器的节点标识, 或从所述请求路由服务器获得由所述请求 路由服务器计算所得的所述边缘服务器的节点标识; 用于存储内容, 所述内 容具有对应的内容标识; 用于查找与所述内容标识最近的一个或多个边缘服 务器登记所述内容对应的内容索引信息, 以及查找所述边缘服务器所要获取 的内容索引信息所在的边缘服务器; 还用于对其节点列表进行维护, 发起对 其邻近的边缘服务器的节点查询, 以及对其性能进行统计、 记录; 内容索引服务器, 用于对上传到所述分布式网络系统的内容进行添加、 删除及分发的操作, 登记所述内容对应的内容标识, 以及接收用户或所述边 缘服务器发送的查询内容请求, 进行查询内容处理, 并返回所要查询的内容 对应的内容标识。
根据本发明的另一方面, 提供了一种存储介质, 其内存储的计算机程序 包括至少一个用于处理信号的代码段, 所述代码段由机器执行使得该机器执 行如下步骤:
根据请求加入分布式网络的请求节点的地址, 确定所述请求节点所在 的域, 并获取域标识;
根据所述域具有的域内节点的数量, 生成所述请求节点的域内标识; 将所述域标识与所述域内标识级联, 获得所述请求节点的节点标识; 将所述节点标识发送至所述请求节点, 所述请求节点根据其获得的节点 标识获取邻近节点的节点信息, 以加入所述分布式网络。
由以上技术方案可知, 本发明实施例的分布式网络构造方法、 装置和系 统以及任务处理方法, 通过先对请求节点所在的域进行确定, 然后再将计 算获得的请求节点的域标识和域内标识进行级联, 得到请求节点的节点标 识, 避免了采用现有 KAD算法直接 HASH得到节点的节点标识而带来的 网络中的节点分布不均衡的问题, 使得分布式网络中的节点分布更加均 衡, 节点上的负载也更加均衡, 并且降低了节点维护的冗余信息以及节点 间交互的消息数量。 附图说明
图 1为本发明实施例的分布式网络的场景示意图;
图 2为本发明实施例的分布式网络的结构化示意图;
图 3为本发明分布式网络构造方法第一实施例的流程示意图; 图 4为本发明分布式网络构造方法第二实施例的流程示意图; 图 5为本发明分布式网络构造方法第二实施例的域的加入的简单示意 图;
图 6为本发明分布式网络构造方法第三实施例的流程示意图;
图 7A为本发明实施例节点标识为 Y的接入节点接收到 FIND— NODE(X) 的请求的处理流程示意图;
图 7B为本发明实施例 K桶更新方法的流程示意图;
图 8为本发明分布式网络构造方法第四实施例的流程示意图;
图 9为本发明实施例的 RRS对退出节点的具体处理流程示意图; 图 10A为本发明分布式网络构造方法第五实施例的流程示意图; 图 10B为本发明实施例的内容查询方法的具体流程示意图;
图 10C为本发明实施例的内容索引信息迁移方法的具体流程示意图; 图 11为本发明在分布式网络中进行任务处理方法实施例的流程示意图; 图 12为本发明节点标识生成装置实施例的结构示意图;
图 13为本发明实施例的分布式网络系统中的 RRS的具体结构示意图; 图 14为本发明实施例的分布式网络系统中的 CIS的具体结构示意图; 图 15为本发明实施例的分布式网络系统中的 ES的具体结构示意图。 具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作 出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
现有的完全分布式网络, 主要是将每个域作为一个结构化网络, 其中 的节点采用分布式网络结构, 然后再将各个域连成一个大的全局的分布式 网络结构, 将每个域中节点的分布式结构通过全局的分布式网络互联。 这 样每个节点就需要维护两张结构化网络的表项, 即域的和全局的。 为了不 同域中的节点可以进行通信, 需要构建两种 DHT算法, 通过共用的中间 节点, 对这些域网络间的节点进行交叉管理, 进而进行内外的消息交互。
在由 KAD算法构架的 KAD网络中,所有计算得到的分布式的节点都 被当作一颗二叉树的叶子, 并且每一个节点的位置都由 KAD算法得到的 NodelD的最短前缀唯一的确定。 在 KAD算法中, NodelD通常是由某个 哈希(Hash ) 函数计算得到的, 目的是为了使在分布式网络中的节点根据 其 NodelD均匀的分布。 在这种节点分布方式中, 如果节点的数量足够大, 那么节点的分布会趋向于均衡。 而且在此 KAD算法中, 一般 NodelD的 长度为 160Bit, 与内容 ID的长度相同, 当节点进行内容查询时, 节点 ID 会和内容 ID进行匹配, 以查询所需内容。
上述的分布式网络形成过程中, 无论是采用 KAD 算法还是其他的 DHT算法, 为了使得网络中的节点在理论上趋向于均匀分布, 采用了 128 位或者 160位的 Hash算法计算 NodelD, 但是, 实际上在节点的数量不是 很多的时候, 采用这些算法计算的 NodelD进行节点分布是非常的不均匀 的, 容易造成节点上的负载的不均衡。 再有, 若要实现对现有的分布式网 络的分域管理, 域的分布和全局的分布采用的是不同的 DHT算法, 那么, 某一域内的节点在与其他域中的节点进行交互的时候, 需要一些中间节点 作为跳板, 跳到其他域中进行操作, 这样可能就会产生单点效应, 而且每 个域中的节点都要维护和中间节点的交互消息, 会使节点的开销变大; 同 时, 由于每个节点都需要维护两张结构化网络的表项, 使得某些节点维护 的信息冗余, 也会造成不必要的开销。 还有, 在 KAD算法中, 通常情况 下, 160位 NodelD代表的节点都需要保留 160个节点列表, 如果每个节 点列表中都有节点信息, 并且每个节点与邻居节点之间都需要周期性的发 布心跳消息来维护消息的交互, 那么, 每个周期, 节点之间的心跳消息至 少需要 320个。
图 1为本发明实施例的分布式网络的场景示意图, 如图 1所示为该场景 下的各个网络设备。请求路由服务器( Request Routing Server,以下简称 RRS ), 用于进行域的划分, 比如: 设定要加入该分布式网络的边缘服务器 (Edge Server, 以下简称 ES )的地址在哪些地址段的, 属于哪个域; 还用于完成 ES 和用户节点登录的请求处理; 同时也可以根据 ES和用户节点的地址等标识, 为其定位域。 RRS还记录了该分布式网络中的域、 ES和用户节点的分布情况; 当一个新的域加入时, 要设定新增加的域的划分条件, 同时还要计算该域的 域标识; 同时, 每一个 ES或用户节点加入的时候, 通过 ES可以计算节点标 识( NodelD ) 。 内容索引服务器( Content Index Server, 以下简称 CIS ) , 进 行集中式的内容索引管理, 负责用户关键词的模糊搜索; 同时, 对于该分布 式网络中的内容进行管理, 如, 判断内容的合法性, 对于不合法的, 发起删 除操作等; 另外如果需要批量注入内容, 那么可以先将内容导入到该 CIS , 然后, 再分发给需求域上的 ES。 ES主要用于存储和分发内容。
在本发明实施例中,每个 ES以及各个用户节点均可以视为一个节点, 下 文中提到的节点一般是指 ES。
图 2为本发明实施例的分布式网络的结构化示意图, 如图 2所示, 将上 述图 1的分布式网络的场景采用该图 2所示的借助于 KAD算法的分布式网络 的结构化的结构, 可以形象地说明如何实现加入该分布式网络中的各个节点 的均衡分布。 本发明实施例介绍了构造图 2所示的分布式网络的结构化结构 的方法及该分布式网络中节点加入、 节点退出以及节点和内容查询的应用。
在图 2所示的二叉树结构中, 每一个黑色叶子节点表示图 1所示的分布 式网络中的一个 ES , 其他的叶子节点在该分布式网络中并不存在, 只是为了 逻辑上表述清楚构建的虚节点。 在该二叉树结构中, 每一个叶子节点所在的 二叉树的位置都可以用 0、 1表示出来, 该 0、 1构成的字符串作为叶子节点 ( ES )的 NodelD的前缀。 通常情况下, ES的 NodelD和内容 ID是长度相同 的, 如内容 ID的长度为 160位, 若 ES的 NodelD的前缀不足 160位, 那么 剩下的 NodelD的后缀都可以用 0来补足。 在本发明实施例中, 这棵二叉树被分成两层来分别构造。 上层是一个 F 层的二叉树结构, 表示节点所在的域, 节点的 F位前缀表示该节点所在域的 域标识( FieldlD )。 节点的 NodelD由所在域的 FieldlD和节点所在域的域内 标识(PeerlD )级联构成。 通常情况下, NodelD和内容 ID的长度相同, 如 取 160位, 那么在本发明实施例中, 若设定 FieldlD的位数为 FL位, PeerlD 的位数为 PL位, 则 FL+PL<=160, 并且还需要拥有足够大的 FL和 PL以满 足该分布式网络系的域和节点的可扩展性。 下面本发明实施例将详细阐述如 何确定要加入该分布式网络中的节点的 NodelD、 节点加入 /退出该分布式网 络的方法、 以及用户节点在该分布式网络中如何进行内容查找 /存储等应用。
图 3为本发明分布式网络构造方法第一实施例的流程示意图, 如图 3所 示,当一个 ES请求加入如图 2所示的结构化的分布式网络时,包括如下步骤: 步骤 301、根据请求加入分布式网络的请求节点的地址,确定该请求节 点所在的域, 并获取域标识;
步骤 302、 根据该域具有的域内节点的数量, 生成请求节点的域内标识; 步骤 303、 将域标识与域内标识级联, 获得请求节点的节点标识; 步骤 304、 将节点标识发送至请求节点, 请求节点根据其获得的节点标 识获取邻近节点的节点信息, 以加入分布式网络。
上述节点标识(NodelD ) 的获取以及根据 NodelD将请求节点加入到 分布式网络中的过程可以在如图 1所示场景下的 RRS中实现,或者由其他 可以获取 NodelD的网络设备来实现。以图 1所示场景下的 RRS为例, RRS 上记录了域的划分配置, 例如划定了具有哪些 IP地址的节点属于哪个域, 那么步骤 301中 RRS就可以根据请求节点的 IP地址来确定该请求节点所 在的域, 例如图 2中的请求节点 A将加入到域 2 , 且在之前域 2加入该分 布式网络时, RRS也是按照域的 FieldlD将域均匀分布的; 步骤 302中, 确定了请求节点 A在域 2后, 根据域 2内现分布的节点的数量(图 2中为 2个), 通过预定算法即可生成请求节点 A的 PeerlD; 例如域 2的 FieldlD 为 0100, 请求节点 A在域 2中的 PeerlD为 1000; 那么在步骤 303中, 将 FieldID和 PeerlD级联, 即可得到请求节点 A的 NodelD为 01001000; 步 骤 304中, 根据该 0、 1表示的请求节点 A的 NodelD, 即可以在图 2所示 的分布式网络的结构化的二叉树结构中找到 A应加入的叶子节点的位置, 然后请求节点 A再根据其获得的节点标识获取邻近节点的节点信息,就可以 力口入该分布式网络。
本实施例的分布式网络构造方法, 通过先对请求节点所在的域进行确 定, 然后再将计算获得的请求节点的域标识和域内标识进行级联, 得到请 求节点的节点标识, 避免了采用现有 KAD算法直接 HASH得到节点的节 点标识而带来的网络中的节点分布不均衡的问题, 使得分布式网络中的节 点分布更加均衡, 节点上的负载也更加均衡, 并且降低了节点维护的冗余 信息以及节点间交互的消息数量。
图 4为本发明分布式网络构造方法第二实施例的流程示意图, 如图 4所 示, 在请求节点请求加入分布式网络之前, 该分布式网络中的 RRS是要对 域进行划分的, 为了能够使得该分布式网络能够对其划分的域进行扩展, 会 对域标识的 Bit位数进行预先设定, 并且通过本发明实施例的域标识生成方 法计算域的域标识, 从而以对域进行均衡分布。 获取域标识的步骤包括: 步骤 401、 RRS收到一个增加域的请求;
步骤 402、 设定域标识的有效长度 M;
其中 M为正整数, 该有效长度 M的设定要便于域的扩展;
步骤 403、 将该分布式网络中已有的域的数量值表示为 M位比特值, 并根据该比特值生成域的域标识。
此时, 请求加入到该分布式网络中的域根据其域标识分配到二叉树结 构的一个叶子节点, 并且可以实现该分布式网络下的域的均勾分布。 当一 个请求节点请求加入该分布式网络时, 包括如下步骤:
步骤 404、 RRS接收到请求节点要加入该分布式网络的请求; 步骤 405、 RRS根据请求节点的地址信息为其指定加入的域, 请求节 点的地址信息如 IP地址信息; 如果该请求节点的 IP地址不在该结构化网 络划定的域的范围内, 则返回节点加入失败消息至请求节点, 结束; 否贝' J , 执行步骤 406;
步骤 406、 设定域内标识的有效长度 N;
其中 N为正整数, 该有效长度 N的设定也要便于域内的节点的扩展; 步骤 407、 判断是否存在空闲的域内标识; 若存在, 则执行步骤 408; 否则, 执行步骤 409;
步骤 408、 将空闲的域内标识赋值给请求节点, 执行步骤 410;
步骤 409、 从域中获取域内节点的数量值, 并将该数量值转换为对应域 内标识的 N位比特值, 并根据该比特值生成请求节点的域内标识;
步骤 410、 将域标识与域内标识级联, 获得请求节点的节点标识; 将获得的节点标识发送至请求节点, 请求节点就可以根据该节点标识获 取邻近节点的节点信息, 以加入分布式网络。
下面对域的加入和节点的加入的具体计算步骤进行说明。
1 )域的力口入
由于域的数量艮难在图 2所示的分布式网络的前 F层构成一个完整的二 叉树, 所以为了均衡节点负载的均匀分布, 在域的分布上也需要实现均衡。 因此采用步骤 402和步骤 403计算域的 FieldID, 从而实现域的均匀分布。
图 5 为本发明分布式网络构造方法第二实施例的域的加入的简单示意 图, 如图 5所示, 设定此域的分布为三层, 则 FieldID的有效长度位 M=3 , 该域的扩展最多可以为 8个域, 设定此时该分布式网络中已经具有 4个域, 贝' J : RRS获取当前该分布式网络中的域的个数 Field— Num, 并将 Field— Num 赋值给 N, 即 N=4; 用 M位的 Bit数表示 N, 得到一个 0、 IBit串 FID=100; 倒置 FID, 得到 FieldID=001 , 如图 5所示的节点 B; 然后 Field— Num加 1 , 以备下次域的加入时, 再计算 FieldID。 若上述步骤中得到了 N=0, 则认为新 加入的域的 FieldID=000。
图 5所示实例为一简单的三层域的结构, 为了方便域的扩展, 一般域的 有效长度位 M可以取 10, 此时域可扩展为 1024个。 那么对于 N=4时, 得到 的 FID=0000000100, 倒置后的 FieldID=0010000000, 则该域的位置在该分布 式网络的第 10层上。 一般计算得到的 NodelD中的域标识占 160位的前 32 位, 若设定域的有效长度位为 10, 那么后缀的 22位补足 0。
2 )节点的加入
每一个新的节点加入到分布式网络中时, 首先需要一个 NodelD作为自 己在网络中交互的标识。 一请求节点加入网络时, 发送一个加入分布式网络 的请求, RRS根据该请求中的信息, 计算该请求节点属于哪一个域, 并根据 该域中的节点信息, 为该请求节点分配一个 NodelD, 上述步骤 406 ~ 409具 体为:
请求节点加入到某一域内后, RRS 要判断该域内的空闲的域内标识 ( FreePeerlD ) 的个数 FreePeerlD— Num是否为 0, 如果不为 0, 则表示曾经 有节点加入到该域内, 但是当前该节点已经退出, 而退出节点的 NodelD还 没有赋值给其他节点, 那么可以直接将该退出节点的 NodelD赋值给该请求 节点使用; 如果 FreePeerlD— Num为 0 , 那么从该域中获取当前具有的节点数 量 n=Peer— Num; 计算 L等于 [log(n)]+l , 其中 "[]" 表示取整; 用 L个 Bit位 表示 n, 得 PID, 此时如果 L = 0, 那么, n就用 0表示; 倒置 PID, 得 PIID; 用 PIID集联上( PL - L )个 Bit的 0, 得 PeerlD, 其中 PL表示该分布式网络 中规定的 PeerlD的有效长度位, 通常为 128位; 但是为了节省资源, 如果网 络在将来的扩展上一个域中的节点数量不会不超过 1000个的话, 那么 PL的 位数也可以取 10。
此时, 步骤 410中, 将 FieldID和 PeerlD级联, 即得到 NodeID=FieldID || PeerlD; 然后域内的节点数量 Peer— Num加 1 , 更新此时域内的节点数量值 , 以备后续节点加入时计算 NodelD使用。 其中, 节点的加入时, PeerlD的计算过程和 FieldID的计算过程类似, 在 此不再具体举例。 从本域中获取当前具有的节点数量 n=Peer— Num的步骤可 以由 RRS来获取, RRS获取节点数量 n=Peer— Num后, 可以由 RRS来计算 请求节点的 NodelD, 也可以是请求节点获取节点数量 n=Peer— Num, 然后请 求节点也可以计算 PeerlD, 再级联从 RRS获取的 FieldID, 从而得到自己的 NodeID。
通常为了使 NodelD和内容 ID的位数相等, 如为 160位, 上述 FieldID 的位数取为 32, PeerlD的位数取为 128,此时若设定 FieldID的有效长度位为 10, PeerlD的有效长度位为 10, 那么其余的 Bit位将补足 0。
在本发明实施例中提出的上述 FieldID和 PeerlD的计算方式中均使用了 预先设定有效长度位的方法, 这样在下面将要提到的节点加入该分布式网络 时和其他节点关联、 节点退出以及内容查询与登记的应用中, 只需使用 FieldID和 PeerlD的有效长度位进行计算即可。
本实施例的分布式网络构造方法具体介绍了节点加入分布式网络时的 节点标识的计算过程, 可以通过先确定域的 FieldID, 再确定请求加入的 请求节点的 PeerlD, 然后将 FieldID和 PeerlD进行级联, 得到请求节点的 NodelD 方法, 使得分布式网络中的节点分布更加均衡, 节点的负载也更 加均衡; 并且由于域的分布和全局的分布并非采用不同的 DHT算法, 因 此也不需要中间节点, 避免了单点效应。 另外, 在 FieldID和 PeerlD的具 体计算过程中 , 还对 FieldID和 PeerlD各自的有效长度位进行了限定 , 从 而使得原来对应 160位的 NodelD,加入到网络中的节点最多需要维护 160 个节点列表下降到若有效长度位为 20个比特位时则最多仅需要维护 20个 节点列表, 从而可以大大减少节点查询时的消息跳转的次数, 减少系统的 开销。
图 6为本发明分布式网络构造方法第三实施例的流程示意图。如图 6所 示, 请求节点根据其获得的节点标识获取邻近节点的节点信息, 以加入分布 式网络的过程中, 请求节点需要通过向其他节点发起针对其自身的节点查询 以获取节点列表, 即需要通过节点查询方法与该分布式网络中的各个节点建 立联系。 该请求节点更新了其自身的所有节点列表后, 该请求节点不仅是加 入了如图 2所示的分布式网络中的一个虚拟位置(叶子节点) , 而是真正的 加入了图 1所示的分布式网络中。 请求节点获取节点列表的步骤为:
步骤 601、 请求节点向请求节点已知的接入节点发送针对请求节点的查 询请求;
请求节点在加入到该分布式网络过程中,会从 RRS中获取接入节点信息, 或从自身原来使用过的保留的信息中获取接入节点的节点信息, 接入节点信 息包括接入节点的 NodelD, IP地址、 端口等信息, 把获得的接入节点的节点 信息写入到请求节点对应的节点列表中, 然后请求节点会向接入节点发起查 询自身的请求;
步骤 602、 请求节点接收接入节点返回的节点标识与所述请求节点的节 点标识异或距离最小的邻近节点的节点信息, 节点信息中包括邻近节点的节 点标识, IP地址、 端口等信息;
接入节点首先查询自身具有的节点列表中是否具有请求节点的节点信 息, 如果没有, 则先将该请求节点加入到对应的节点列表中; 然后再根据请 求节点的 NodelD查询节点标识与请求节点的节点标识异或距离最小的邻近 节点, 并将邻近节点的节点信息发送给请求节点;
步骤 603、 将返回的邻近节点的节点标识与请求节点的节点标识进行匹 配, 根据匹配的比特位数, 记录邻近节点的节点信息到请求节点的相应的节 点列表中;
步骤 604、 请求节点将邻近节点作为其再次发送针对请求节点的查询请 求的接入节点, 不断重复上述步骤 601 ~ 603 , 直到请求节点查询的接入节点 都认为自身为最接近请求节点的节点, 并将自身的节点信息返回给请求节点 时, 查询结束。 该请求节点将所有接收到的邻近节点的节点信息记录到请求 节点的节点列表中, 该请求节点加入分布式网络。
节点列表即为 KAD算法中通常所说的 K桶,在 KAD算法构造的分布式 网络中, 每个节点都保留多个 K桶, K桶的数量和 NodelD的有效长度有关, 即若 NodelD的有效长度为 20,则 K桶理论上也为 20个。根据节点的 NodelD 组成的逻辑二叉树结构中, 对于任意一个节点, 都可以把这颗二叉树分解为 一系列连续的、 不包含自己的子树; 其中最高层的子树, 由整颗树不包含自 己的树的另一半组成, 下一层子树由剩下部分不包含自己的另一半组成, 依 此类推, 直到分割完整颗树。 那么该节点的第 i个 K桶就记录了第 i+1次划 分所得子树中的节点信息。 由于每一个 K桶中最多存放 k个节点的信息, 因 此每个 K桶中记录的可能是划分的子树下的所有节点的节点信息, 也可能是 部分节点的节点信息。
在本发明实施例中加入该分布式网络中的请求节点在获得 NodelD后, 刷新自己的所有的节点列表即 K桶的方法具体为:其一,获得接入节点( AES ) 的节点信息, 并把这个节点记录到对应的 K桶中; 其二, 向接入节点发起一 次针对自己的 NodelD 的节点查询请求, 从而通过接入节点获取一系列与自 己距离邻近的其他节点的信息; 最后, 通过前述步骤的重复, 刷新自身的所 有的 K桶, 保证自己所获得的节点信息全部都是最新的。
需要指出的是: 每一个节点加入系统的时候, 对于请求节点首次发起节 点查询 (FIND— NODE ) 时的接入节点的获取存在两种方式: 一是从 RRS上 登记的每个域中的接入节点的节点信息中查询本域的接入节点的节点信息, 但是如果所有域中加入的节点都从 RRS上登记的接入节点上进行节点查询的 操作的话, 会影响该接入节点的负载, 所以节点一旦加入系统以后, 后续可 以使用查询到同一域中的其他节点作为接入节点; 另外一种方式是, 用户节 点可以对于以前接入某一域内时使用过的节点进行保留, 以供下一次该用户 节点接入时利用。
具体地, 下面将具体介绍节点查询的一般方法, 即该分布式网络中的任 何一个节点均可以发起节点查询请求, 例如: 一节点标识为 Z的节点向节点 标识为 Y的节点发起查询节点标识为 X的节点的查询请求。 特别地, 如果是 上述提到的请求节点, 其在加入该分布式网络中时, 向其他节点如节点标识 为 Y的节点发起查询其自身的查询请求, 以更新其节点列表是尤其重要的。
图 7A为本发明实施例节点标识为 Y的接入节点接收到 FIND— NODE(X) 的请求的处理流程示意图, 该 FIND— NODE(X)的请求可以是节点标识为 Z的 节点发起的针对节点标识为 X的查询请求,也可以是节点标识为 X的节点发 起的针对其自身的查询请求, 如图 7A所示, 步骤如下:
步骤 701、 节点标识为 Y的接入节点接收到节点标识为 Z的节点发起的 FIND— NODE(X)的请求;
步骤 702、 接入节点采用 K桶更新方法更新其对应的 K桶, 以判断其对 应的 K桶中是否存在节点标识为 Z的节点;
步骤 703、 从节点标识 X、 Y中分别取出 M + N位前缀, 得到标识 X,、 Υ'; 其中 Μ表示 FieldID的有效长度位, 即上述 FL, N表示节点在域内的 PeerlD的有效长度位, 即 PL;
步骤 704、 计算 X'与 Y'的异或, 得到 A=X,㊉ Y,;
步骤 705、 判断 Α==0是否成立, 如果 Α为 0成立, 则执行步骤 706; 否 则, 执行步骤 707;
步骤 706、 节点标识 Y与节点标识 X相同, 返回节点标识为 Y的接入节 点即为节点标识为 Z的节点查询的节点, 结束;
步骤 707、 计算 = N + M -[log(2,A)] - l , 其中 "[]" 表示计算所得值取 整;
步骤 708、 判断 i>=M+N是否成立, 若不成立, 执行步骤 709; 否则, 执 行步骤 714;
步骤 709、 判断第 i个 K桶是否存在, 若不存在, 执行步骤 710; 否则, 执行步骤 711 ; 步骤 710、 i=i+l , 执行步骤 708;
步骤 711、从第 i个 K桶中获取与节点标识为 X的节点邻近的 a个节点, 与节点标识为 X的节点邻近的 a个节点即节点的节点标识与节点标识 X异或 后数值最小的几个节点;
步骤 712、 存储获取到的节点的节点信息, 并累计计算当前存储的节点 的数量;
步骤 713、 判断累计存储的节点的数量是否足够所需获取的数量 k, 若还 不足 k个, 则执行步骤 710; 否则, 说明已经足够 k个, 则执行步骤 714; 步骤 714、 进一步判断是否获取到一定数量的节点的节点信息, 若是没 有获取到任何节点, 则执行步骤 715; 否则执行步骤 716;
步骤 715、 返回节点标识为 Y的节点即为距离节点标识为 X的节点距离 最近的节点, 执行步骤 717;
步骤 716、 返回获取到的节点的节点信息;
在该步骤 716中, 可能一直到最后一个 K桶, 获取到的节点的数量累计 还是没有 k个, 此时就返回获取到的不足 k个节点的信息;
步骤 717、 节点标识为 Z的节点接收到节点标识为 Y的接入节点返回的 邻近节点的节点信息, 才艮据 K桶更新方法将相应的节点的节点信息更新到节 点标识为 Z的节点对应的 K桶中。
图 7B为本发明实施例 K桶更新方法的流程示意图, 步骤 702采用该 K 桶更新算法更新接收节点对应的 K桶中的关于节点标识为 Z的节点的节点信 息, 步骤 717采用该 K桶更新算法将节点标识为 Z的节点接收到的接收节点 返回的邻近节点的节点信息更新到节点标识为 Z的节点对应的 K桶中。 如图 7B所示, 以步骤 702为例, 该 K桶更新方法的具体步骤为:
步骤 702a、 从节点标识 Z、 Y中分别取出 M + N位前缀, 得到标识 Z,、 Υ'; 其中 Μ表示 FieldID的有效长度位, 即上述 FL, N表示节点在域内的 PeerlD的有效长度位, 即 PL; 步骤 702b、 计算 Z'与 Y'的异或, 得到 Β=Ζ '㊉ Υ';
步骤 702c、 计算 = N + M - [log(2,S)] - l , 其中 "[]" 表示计算所得值取 整;
步骤 702d、判断节点标识为 Y的接入节点中第 i个 K桶是否存在节点标 识为 Z的节点的节点信息, 若存在, 执行步骤 702e; 否则执行步骤 702f;
步骤 702e、将节点标识为 Z的节点的节点信息调整到第 i个 K桶的尾部; K桶中记录节点的节点信息的方式为将最近活动的节点的节点信息放到 K桶 的尾部, 结束;
步骤 702f、判断第 i个 K桶中记录的节点的数量是否小于 k,一般规定 K 桶中可以存放 k个节点的节点信息, 若小于, 则该 K桶中记录的节点的数量 不满, 执行步骤 702j; 否则, 则该 K桶中记录的节点的数量为 k, 执行步骤 702g;
步骤 702g、 Ping操作该 K桶头部的节点, Ping操作的作用是探测网络中 的一个节点, 用以判断其是否仍然在线;
步骤 702h、 判断该 K桶头部的节点是否响应该操作, 若没有响应, 执行 步骤 702i; 否则, 执行步骤 702k;
步骤 702i、 删除该 K桶头部的节点的记录;
步骤 702j、 把请求节点 X的节点信息放置到该 K桶的尾部, 结束; 步骤 702k、 将该 K桶头部的节点调整到该 K桶的尾部;
步骤 7021、判断是否已遍历该 K桶中的所有节点,若没有,执行步骤 702g; 否则, 执行步骤 702m;
步骤 702m、 忽略请求节点 X的节点信息, 结束。
在步骤 717将获得的若干个节点的节点信息分别更新至节点标识为 Z的 节点对应的 K桶中后, 节点标识为 Z的节点再次从自己目前所有已知的距离 节点标识为 X 的节点较近的节点中挑选出若干没有发送过 FIND— NODE(X) 的请求的节点作为接入节点, 并向其发送该 FIND— NODE(X)的请求, 收到该 FIND— NODE(X)的请求的接入节点重复上述如图 7A中的步骤 701 ~ 717 , 再 从这些接入节点上返回一些距离节点标识为 X的节点近的节点的节点信息; 不断重复上述步骤, 直至接入节点都认为自身为最接近节点标识为 X的节点 或者自身就是所要查询的节点, 并将自身的节点信息返回给节点标识为 Z的 节点。
在上述查询过程中, 没有及时响应节点标识为 Z的节点的节点将立即被 排除, 以便保证请求节点 X最终获得的最近的节点都是活动的。
本实施例提供的分布式网络构造方法中,具体介绍了节点查询的方法, 该节点查询的方法在请求节点获取了其节点标识, 要加入到该分布式网络 中时尤其重要。例如节点标识为 Z的节点为节点标识为 X的请求节点, 该 请求节点采用上述步骤 701 ~ 717 的节点查询的方法找到与其自身的节点 标识 X距离较近的节点的节点信息,并将这些节点的节点信息添加到请求 节点对应的节点列表(即 K桶) , 那么至此, 将加入到该分布式网络中的 请求节点与该分布式网络中的其他节点关联在了一起。
图 8为本发明分布式网络构造方法第四实施例的流程示意图, 如图 8所 示, 在上述实施例中, 请求节点添加了节点列表后, 即和与其邻近的节点建 立了相互的关联关系。 在该分布式网络中, 若出现其他的一些节点接收不到 已相互关联的某一节点的响应消息的情况时, 即该某一节点可能已经退出 该分布式网络的情况下, 该分布式网络管理该可能退出的节点及其节点信 息的具体流程为:
步骤 801、 RRS接收该分布式网络中的一个或多个节点发送的针对退出 节点的处理请求;
在该分布式网络中, 各个节点之间的交互是完全分布式的, 且每一个节 点的 NodelD是按照本发明实施例的算法分配的; 因此, 当有一个节点退出 该网络以后, 其他节点可以通过周期性的心跳消息, 了解到其邻近节点的状 况。 假设现该分布式网络中存在一个退出节点, 由于原来有很多其他节点对 该退出节点拥有节点信息, 因此会周期性的发送心跳消息, 以与该退出节点 保持联系。 当有一些节点发现其发送的心跳消息没有响应的时候, 则认为该 退出节点是失效的, 就会向 RRS汇报, 请求处理该退出节点;
步骤 802、 RRS查看其本地保存的失效节点列表, 并对该退出节点做出 是否失效的判定处理; 该判定处理包括如下两种情况:
若失效节点列表中不存在该退出节点的节点信息, 则在失效节点列表中 创建该退出节点; 并判断退出节点是否失效, 若是, 则将退出节点的节点标 识写入退出节点所在域的空闲域内标识列表中, 已备该域内加入新的节点时 将该节点标识赋予新的节点。
若失效节点列表中存在该退出节点的节点信息, 并且退出节点没有被判 断过是否失效, 则判断退出节点是否失效; 若是, 则将退出节点的节点标识 写入退出节点所在域的空闲域内标识列表中, 已备该域内加入新的节点时将 该节点标识赋予新的节点。
失效节点列表的数据结构如下:
Figure imgf000021_0001
Figure imgf000021_0002
其中, NodeID、 IP Addr, IP— Port分别表示失效节点的 NodelD、 IP地址 和 IP端口; Report— Num表示汇报该退出节点失效的节点的总数量, 设定 RN 为该 Report— Num的一个临界数值点, 如果 Report— Num大于或等于 RN, 则 RRS探测该退出节点是否真的失效; Flag表示该退出节点是否已经经过了失 效处理; Time表示创建该退出节点记录的时间。 RRS在失效节点列表中查询 是否存在其他节点请求处理的退出节点时候, 需要 NodeID、 IP地址、 IP端 口均匹配, 才认为是查询成功, 该失效节点列表中存在退出节点的节点信息。
图 9为本发明实施例的 RRS对退出节点的具体处理流程示意图, 如图 9 所示, 为:
步骤 901、 RRS接收其他节点发送的对某个节点, 此处称作退出节点失 效的处理请求;
步骤 902、 RRS查看本地的失效节点列表; 该失效节点列表的数据结构 如上所示;
步骤 903、 判断该退出节点是否已被记录在该失效节点列表中, 如果没 有记录, 则执行步骤 904; 否则执行步骤 905;
步骤 904、 在本地的失效节点列表中创建该退出节点的记录, 并初始化 其中的汇报总数量、 记录时间等信息, 然后执行步骤 906;
步骤 905、 判断 Flag是否为真, 即已被记录的该退出节点是否已经进行 过失效处理, 如果为真, 即该退出节点已经进行过失效处理, 结束; 否则执 行步骤 906;
步骤 906、 Report— Num加 1。 即表示又有一个节点汇报请求处理该退出 节点;
步骤 907、 判断 Report— Num是否大于或者等于 RN, 如果 Report— Num 小于 RN, 那么结束; 否则执行步骤 908;
步骤 908、 RRS向该退出节点发起信息的探测, 判断该退出节点是否掉 线; 如没有掉线, 执行步骤 909; 否则执行步骤 910;
步骤 909、 删除失效节点列表中的该退出节点的记录, 并结束; 步骤 910、把该退出节点的 NodelD写入到对应的该域中的空闲域内标识 列表 FreePeerlD— List中;
步骤 911、 设定 Flag=Ture, 结束。
在该 RRS对退出节点进行管理的流程中, RRS还要通过周期性的扫描失 效节点列表来管理该列表上记录的节点信息, 判断该失效节点列表上记录的 节点信息是否过期, 并将过期的节点记录删除。 例如可设定大于两个扫描周 期没有对节点信息进行更新的对应节点即为过期节点, 将该节点的节点信息 删除。
本实施例主要描述了对于分布式网络上的节点要退出的管理流程, 进一 步完善了该分布式网络的构造方法。
图 10A为本发明分布式网络构造方法第五实施例的流程示意图。在该分 布式网络中, 每个 ES上管理的内容都有其对应的内容标识 (内容 ID ) , ES将其管理的内容的相关信息及内容 ID在图 1所示的网络中的 CIS上进 行登记, 并将内容索引信息保存在 NodelD与内容 ID距离最小的 NodelD 对应的一个或几个节点上, 这样保存有内容 ID的节点管理的内容索引信 息指示了该内容索引信息对应的内容存储在的 ES , 以便查找到内容 ID就 可以获知内容索引信息以及内容索引信息对应的内容存储在哪个 ES上。 这样当某一节点或者用户节点发起对某一内容的查询时, 该节点首先会在 图 1所示的网络中的 CIS上进行内容的搜索,获取对应内容的一个内容 ID, 此时某一节点或者用户节点会根据其获知的内容 ID发起查询, 找到管理 该内容 ID的节点, 从中得到内容索引信息, 即获得了保存了对应内容的 ES。将某一节点或者用户节点定义为内容查询请求节点,其查询与内容 ID 距离最近的 NodelD所对应的节点的过程, 类似于节点查询的过程, 如图 10A所示, 包括如下步骤:
步骤 1001、 内容查询请求节点从其节点列表中找出节点标识与要查询的 内容对应的内容 ID距离最小的节点作为第一查询节点,并向第一查询节点发 送针对内容 ID的查询请求;
步骤 1002、 若在第一查询节点的节点列表中没有找到距离比第一查询节 点的节点标识与内容 ID距离更小的节点,则将该第一查询节点的节点信息返 回给内容查询请求节点;
步骤 1003、 若在第一查询节点的节点列表中找到距离比第一查询节点的 节点标识与内容 ID距离更小的第二查询节点,则将第二查询节点的节点信息 返回给内容查询请求节点;
步骤 1004、 内容查询请求节点向返回的节点发送查询内容 ID的请求, 若该节点上管理有对应的内容索引信息, 则返回内容索引信息到内容查询请 求节点; 否则, 在该节点上继续查找节点标识与内容标识距离最小的节点以 查询内容索引信息, 查询的步骤同步骤 1001〜步骤 1003。
具体地, 在现有的分布式网络中, 4叚设存在 n个域, 各个域也都具有随 机得到的位数为 M位的 FieldlD, 记为 F(l)<F(2)<F(3)<...<F(n)。 但是这些域 的分布并不均匀, 且 FieldlD的比特值不连续, 即 F(i+1)! = F(i)+1 , 甚至有可 能两个域, 例如域 i和域 i+1的 FieldlD的比特值相差很大, 即两个域距离很 远。 那么, 该分布式网络中所有 M位前缀的比特值在域 i和域 i+1的 FieldlD 的比特值之间的内容 ID所对应的内容的索引信息都会上传到域 i中的 NodelD 最大的节点上进行管理, 这样会造成此节点的负载过大。 本发明实施例的内 容 ID查询的方法会进一步对确定加入域 i中的内容 ID进行再次匹配, 即根 据内容 ID的 FieldlD的有效长度位 M后的域内标识有效长度位 N的前缀查 找在该域 i内的邻近节点, 从而可以实现将加入到该域 i内的内容 ID均匀地 分布到该域 i内的各个节点上, 从而减轻域 i中的 NodelD最大的节点上的负 载。
图 10B 为本发明实施例的内容查询方法的具体流程示意图, 如图 10B 所示, 包括如下步骤:
步骤 1005、 NodelD为 Y的查询节点接收到内容查询请求节点的针对内 容 ID为 XI的查询请求;
步骤 1006、判断该查询节点上是否记录有内容查询请求节点所要查询的 内容 ID, 若存在该记录, 执行步骤 1007; 否则, 执行步骤 1008;
步骤 1007、 返回该查询节点的节点信息, 该 NodelD为 Y的查询节点作 为与内容 ID最接近的节点, 结束查询;
步骤 1008、 从标识 XI、 Y中分别取出 M位前缀, 得到标识 ΧΓ、 Υ'; 其中 Μ表示 FieldlD的有效长度位, 即上述 FL;
步骤 1009、 计算 ΧΓ与 Y'的异或, 得到 Α=ΧΓ㊉ Υ';
步骤 1010、 判断 Α==0是否成立, 如果 Α为 0成立, 则执行步骤 1015; 否则, 执行步骤 1011 ;
步骤 1011、 计算 = M - [log(2,A)] - l , 其中 "[]" 表示计算所得值取整; 步骤 1012、 判断查询节点中第 i个 K桶是否存在, 如果不存在, 则执行 步骤 1013; 否则, 执行步骤 1022;
步骤 1013、 i=i+l ;
步骤 1014、 判断 i>=M是否成立, 若不成立, 执行步骤 1012; 否则, 执 行步骤 1015;
步骤 1015、 从标识 XI、 Y中分别取出 M位后的 N位前缀, 得到标识 ΧΓ,、 Υ"; 其中 Ν表示节点在域内的 PeerlD的有效长度位, 即 PL;
步骤 1016、 计算 ΧΓ,与 Y"的异或, 得到 Β=ΧΓ,㊉ Y";
步骤 1017、 计算 = \^ - [1(¾(2, )] - 1 , 其中 "[]" 表示计算所得值取整; 步骤 1018、判断查询节点中第 i+M个 Κ桶是否存在, 如果不存在, 则执 行步骤 1019; 否则, 执行步骤 1022;
步骤 1019、 i=i+l ;
步骤 1020、 判断 i>=N是否成立, 若不成立, 执行步骤 1018; 否则, 执 行步骤 1021 ;
步骤 1021、 返回该查询节点的节点信息, 该 NodelD为 Y的查询节点作 为与内容 ID最接近的节点, 结束查询;
步骤 1022、返回从第 i个 K桶中选择的 NodelD与内容 ID距离最小的节 点, 结束查询。
为了将 ES上保存的内容对应的内容 ID在最接近内容 ID的节点上进 行登记而进行的针对内容 ID的节点查询的过程同上述图 10A和图 10B所 描述的节点查询过程。 不同的是, 上述内容 ID查询过程为查询到最接近 的节点后, 从节点上获取内容 ID, 而内容 ID登记过程为查询到最接近的 节点后, 将内容 ID登记到该节点上。
另外, 如果在域 i和域 i+1之间又添加一新的域 t, 即第一域 t, 并且 该域 t中加入了一个节点 m,即第一节点 m。若第一域 t中仅有第一节点 m, 则第一节点 m查找到 FieldID与第一域 t的 FieldID距离最小的第二域中的所 有节点, 在本实施例中即找到域 i中的所有节点, 获取记录在第二域 i中的所 有节点上的内容 ID的 M位的前缀大于等于第一域 t的 FieldID的内容索引信 息;若第一域 t中还有其他节点,则第一节点 m查找到 NodelD与第一节点 m 的 NodelD距离最小的第二节点 n, 获取记录在第二节点 n上的内容 ID的 M 位后的 N位前缀大于等于第一节点 m的 PeerlD的内容索引信息。
具体地, 图 10C为本发明实施例的内容索引信息迁移方法的具体流程 示意图, 如图 10C所示, 包括如下步骤:
1023、 第一节点 m判断其是否为第一域 t中的唯一节点, 若是, 执行 步骤 1024; 否则, 执行步骤 1026;
步骤 1024、 第一节点 m发送内容索引信息迁移请求, 查找 FieldID与 第一域 t的 FieldID距离最小的第二域;
步骤 1025、从第二域中的所有节点中获取内容 ID的 M位前缀大于等 于第一域 t的 FieldID的内容索引信息, 执行步骤 1030;
步骤 1026、第一节点 m发送内容索引信息迁移请求,从第一域 t中查 找 NodelD与第一节点 m的 NodelD距离最小的第二节点;
步骤 1027、判断第二节点的 NodelD是否大于第一节点 m的 NodelD, 若大于, 执行步骤 1028; 否则, 执行步骤 1029;
步骤 1028、 从第二节点中获取内容 ID的紧跟 M位后的 N位比特大 于等于第一节点的 PeerlD且小于第一节点的 PeerlD的内容索引信息, 执 行步骤 1030;
步骤 1029、 从第二节点中获取内容 ID的紧跟 M位后的 N位比特大 于等于第一节点的 PeerlD的内容索引信息;
步骤 1030、 将获取到的内容索引信息迁移到第一节点 m上。
本实施例提供的分布式网络构造方法, 主要描述了在该分布式网络构 造中进行特定内容 ID的搜索、 登记方法, 其实质上也是针对节点的查找。 图 11为本发明在分布式网络中进行任务处理方法实施例的流程示意图。 用户节点或者 ES会在某个时刻存在任务处理的请求, 比如说,用户上传存储 内容; 节点由于本地负载太重, 需要迁移内容; 或者本域中需要增加或者删 除一些副本等等, 这些请求都需要指定一些节点来处理, 而且这些节点的资 源是能够满足这些请求的处理需求的资源。 所以, 在为节点分配任务的时候, 需要统计节点的性能, 使得在任务处理被操作前可以找到满足资源性能需求 的节点, 从而可以实现节点的负载平衡。 如图 11所示, 在本发明实施例上述 介绍的构造分布式网络的方法下, 可以更快速高效的在本域中进行任务处理 的操作, 具体的流程如下:
步骤 1101、 第一节点接收任务处理请求, 任务处理请求包括: 内容上传 处理请求、 增加或删除内容处理请求;
步骤 1102、 第一节点判断其自身的资源性能是否满足任务处理的要求; 步骤 1103、 若满足, 则将第一节点的节点信息返回发起任务处理请求的 第二节点, 第二节点向第一节点发起操作;
步骤 1104、 若不满足, 则从第一节点的节点列表中选择资源性能满足任 务处理的要求的第三节点, 将第三节点的节点信息返回发起任务处理请求的 第二节点, 第二节点向第三节点发起操作;
其中第一节点优先选择 K桶标识表示大于等于 M的节点列表中的节点 (即为同一域内的节点) 。
例如: 一用户节点要上传内容, 在发送上传内容请求前需要知道把内容 上传到哪个节点, 其处理步骤具体如下:
步骤 a、 用户节点向其接入节点 (即 AES )发送关于上传内容的处理请 求;
步骤 b、 AES检测本身是否拥有足够的资源满足内容上传的要求, 若满 足, 执行步骤 c; 否则执行步骤 d; 步骤 c、 将 AES的信息返回给用户节点, 然后用户节点进行上传内容的 操作;
步骤 d、从 AES的 K桶中选择标识大于或者等于 M的 K桶,从第 i个 K 桶开始, 依次从各个 K桶中选择 η ( η>=1 )个节点, 请求各个节点反馈资源 利用的情况; 如果第 i个 K桶中的 n个节点反馈的信息都不能满足用户节点 上传内容的要求, 那么就从第(i+l) % (M+N)个 K桶中再找出 n个节点, 依次 进行统计, 直到找到满足用户节点上传内容请求处理的节点为止; 如果不存 在, 那么就返回请求失败信息。
步骤 e、 AES把满足用户节点上传内容请求的节点返回给用户节点; 步骤 f、 用户节点向可以满足用户节点上传内容请求的节点发起操作请 求。
在这里, 用户节点也可以为一任意的 ES, 那么此时, 由于 ES本身就可 以当做 AES来进行节点查询等操作, 因此此时的 AES也为 ES本身。 务处理的方法, 由于是基于上述分域构造的分布式网络, 因此在进行本域内 的任务处理时可以 艮快的从本域内的节点中选择合适的节点以处理任务请 求。
图 12为本发明节点标识生成装置实施例的结构示意图, 如图 12所示, 该节点标识生成装置包括: 域标识获取模块 121、 域内标识生成模块 122和 节点标识获取模块 123。 其中域标识获取模块 121可以用于根据请求加入分 布式网络的请求节点的地址,确定所述请求节点所在的域,并获取域标识; 域内标识生成模块 122要根据该域具有的域内节点的数量, 生成该请求节点 的域内标识; 节点标识获取模块 123将域标识与域内标识级联, 获得请求节 点的节点标识。
其中域标识获取模块 121还可以具体包括:设定域标识的有效长度 M的 第一设置模块 1211 , 其中 M为正整数, 以及将该分布式网络中已有域的数 量值表示为 M位比特值, 并根据该比特值生成该域的域标识的第一计算模 块 1212。 域内标识生成模块 122还可以具体包括: 设定域内标识的有效长 度 N的第二设置模块 1221 , 其中 N为正整数, 判断是否存在空闲的域内标 识的判断模块 1222, 将空闲的域内标识赋值给请求节点的赋值模块 1223 , 以 及从域中获取域内节点的数量值, 并将该数量值转换为对应的 N位比特值, 并根据该比特值生成请求节点的域内标识的第二计算模块 1224。
本实施例的节点标识生成装置生成节点标识的具体过程可以参考上述分 布式网络构造方法实施例中的具体描述, 在此不再赘述。 本实施例提供了 一种构造分布式网络时的节点的节点标识生成装置, 其节点标识是按照网 络中的域的分布和域内节点的分布生成的, 可以使得分布式网络中的节点 分布更加均衡, 节点的负载也更加均衡。
本发明的分布式网络系统所在场景如图 1所示, 包括: 请求路由服务器 ( RRS ) , 可根据请求加入分布式网络的请求节点的地址, 确定所述请求 节点所在的域, 并获取域标识, 根据域具有的域内节点的数量, 生成请求节 点的域内标识, 并可将域标识与域内标识级联, 获得请求节点的节点标识; 内容索引服务器(CIS ) , 用于对上传到分布式网络系统的内容进行添加、 删 除及分发的操作, 登记内容对应的内容标识, 以及接收用户或边缘服务器发 送的查询内容请求, 进行查询内容处理, 并返回所要查询的内容对应的内容 标识; 边缘服务器(ES ) , 用于根据从 RRS 获得的其所在域的域标识计算 ES的节点标识, 或从 RRS获得由 RRS计算所得的 ES的节点标识; 用于存 储内容, 内容具有对应的内容标识; 用于查找与内容标识最近的一个或多个 边缘服务器登记内容对应的内容索引信息,以及查找 ES所要获取的内容索引 信息所在的边缘服务器; 还用于对其节点列表进行维护, 对其邻近的边缘服 务器发起节点查询, 以及对其性能进行统计、 记录。 图 1示出的本发明的分 布式网络的场景示意图中的 RRS的具体结构如图 13所示, CIS的具体结构如 图 14所示, 一个 ES的具体结构如图 15所示, 图 13〜图 15的组合即构成了 图 1所示的分布式网络架构。 下面分别对图 13〜图 15进行具体说明。
图 13为本发明实施例的分布式网络系统中的 RRS的具体结构示意图, 如图 13所示, RRS 13包括: FieldlD获取模块 131 , 主要是用于 ES或者用户 节点登录(即加入该分布式网络系统) 的时候, 根据域标识的划分, 判定属 于那一个域,还可以计算一个新加入的域的 FieldlD的分配; PeerlD生成模块 132 , 这个模块主要计算每个新加入到一个域中的节点的 PeerlD, 具体算法可 参照上述实施例中的域内标识的计算方法, 主要根据一个域内的相关节点的 信息来计算; NodelD获取模块 133 , 用于将 FieldlD与 PeerlD级联, 获得登 陆到该网络系统的节点的 NodeID。 值得注意的是, PeerlD生成模块 132和 NodelD获取模块 133也可以移植到用户节点上来实现,只要用户节点从 RRS 获取到 FieldlD 和用户节点加入的域内的节点数量即可自行计算该用户节点 的 NodelD。
该 RRS13还可以包括: 域划分管理列表 134, 可以由管理员进行配置, 例如每当一个新域加入的时候, 管理员就需要在该域划分管理列表 134中进 行域的配置, 传统的方式是根据地址段或者用户节点提供的位置信息进行判 断用户节点所在的域。 域管理模块 135 , 对系统中的域的分布情况和域中节 点的分布情况进行管理, 其管理的信息具体包括有域的数量、 域标识的有效 长度和域的列表信息等。 其数据结构如下:
Figure imgf000030_0001
其中, Field— Num表示系统中目前由多少个域; FieldBucket— Len记录当 前每个 FieldlD 的有效 Bit 位, 可设置为常数, 但一般情况下 FieldBucket _ Len = log FieldNum; FieldList记录了系统中每个域的相关情况, 其中, FieldlD为计算出来的 Bit位字符串, 通常情况下取 32位; Peer— Num 为本域中拥有的 ES节点的数量; AccessES— List为从本域中加入的 ES节点中, 随机选取几个 ES作为 AES; FreePeerlD— Num表示当有节点掉线时需要记录 的这些节点的数量; FreePeerlD— List为掉线节点的 PeerlD的记录列表, 当一 个新的节点加入或者一个掉线的节点恢复时, 可以直接从该 PeerlD的记录列 表中选择一个 NodelD作为自己的 NodelD中的域内标识部分。在节点加入到 该分布式网络系统, 需要计算节点的 NodelD 时, 会用到该域管理模块 135 中管理的参数。
图 14为本发明实施例的分布式网络系统中的 CIS的具体结构示意图,如 图 14所示, 该 CIS14可以包括: 内容索引管理模块 141 , 每一个上传到系统 中的内容都需要在该模块上进行登记,该模块记录了一些内容的元数据信息; 还用来判定上传的内容是否已经在系统中登记过; 内容操作模块 142, 当用 户节点检测到某个内容为非法的时候, 由该模块发起删除内容的请求, 同时, 当内容运营商需要注入批量的内容的时候, 可以通过该模块, 和一个指定的 内容分发服务器结合, 把内容发送到需求的域中; 关键字查询模块 143 , 以 在 CIS上实现模糊查询, 使得用户可以从查询结果中选择内容, 并获取该内 容的 ContentID。
图 15为本发明实施例的分布式网络系统中的 ES的具体结构示意图, 如 图 15所示,该 ES15包括: 内容索引登记模块 151 ,用于记录、管理与该 ES15 的节点标识距离最小的内容标识所标识的内容索引信息; 节点管理模块 152, 用于对其节点列表进行维护; 查询模块 153 , 用于对其邻近的边缘服务器发 起节点查询, 以及发起对所要查询的内容对应的内容标识的查询; 性能统计 模块 154, 用于对其性能进行统计、 记录。
其中内容索引登记模块 151上记录其拥有的内容 ID和本节点 ID距离最 小的内容标识对应的节点的节点信息, 数据结构如下, 其中 ContentID 为另 一节点上存储的内容对应的 ContentID, PeerList中存储的 NodelD为存储内 容的另一节点的节点信息:
Figure imgf000032_0001
节点管理模块 152, 计算出来本地存储的内容的内容 ID, 然后查找到与 该内容 ID最接近的 NodelD所对应的节点进行该内容 ID的登记; 在该模块 中还可以实现节点列表即对邻居节点的维护等功能。 其中对邻居节点的维护 主要是维护本节点上的各个 K桶, 由于本发明实施例中对于 FieldID的有效 长度和 NodelD 的有效长度进行了控制, 所以, 考虑到该分布式网络系统的 可扩展性, 在开始的时候设定一个域数量的上限值, 如是 2n。 在通常情况下, n需要根据该分布式网络系统对域的划分情况来设定, 为了便于以后的扩展, n可以被设定的很大,但是为了避免加入域的节点中过多地存在空的 K桶(即 其维护的某些 K桶所记录的范围内没有节点信息) , 尽量要把 n设的比较合 适, 这个 n就被称为域的有效长度, 即本节点维护的记录其他域中的节点信 息的节点列表的最大标识。 这样, 本节点的节点列表标识从 0到 n- 1的 K桶 中记录着其他域中的节点信息, 而标识大于 n的其他 K桶记录着与本节点同 一域中的节点的节点信息。 本节点第 i个 K桶的数据结构可以表示如下:
Figure imgf000032_0002
性能统计模块 154, 主要对本节点, 即 ES15的当前的一些性能指标进行 统计。 比如: 上行的空闲带宽, 下行的空闲带宽、 CPU利用率、 内存的利用 率、 剩余有效的存储空间。 根据不同的性能请求, 把相关的统计数据发给请 求性能指标的节点, 例如: 在某一节点对本节点有下述请求时, 可以但不限 于返回下述性能统计数据:
①上传内容请求——获取本域空闲资源比较多的节点, 资源包括: 硬盘、 下行带宽、 内存等的大小;
②迁移内容请求——内容迁入节点, 资源包括: 硬盘、 下行带宽、 内存 等的大小; 内容迁出节点, 资源包括: 上行带宽;
③删除内容请求——十对资源比较紧张的节点;
④下载内容请求一节点的上行带宽、 内存等资源。
本实施例提供的分布式网络系统说明了该系统中各个设备之间的连接关 系及各个设备对其他设备上的信息如何进行操作管理。 其具体的操作方法, 如节点即 ES的 NodelD如何计算获得、 如何进行节点查询和内容查询、 节点 列表如何配置管理等, 均在上述方法实施例中涉及, 在此不再赘述。
本实施例提供的分布式网络系统避免了采用现有 KAD算法直接 HASH 得到节点的 NodelD而带来的网络中的节点分布不均衡的问题, 使得分布 式网络中的节点分布更加均衡, 节点的负载也更加均衡; 另夕卜, 对 FieldID 和 PeerlD各自的有效长度进行了限定,从而使得加入到网络中的节点所需 要维护的节点列表大大减少, 节点查询时的消息跳转的次数减少, 从而降 低了系统的开销。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分 流程, 是可以通过计算机程序来指令相关的硬件来完成, 所述的程序可存 储于一计算机可获取存储介质中, 该程序在执行时, 可包括如上述各方法 的实施例的流程。 其中, 所述的存储介质可为磁碟、 光盘、 只读存储记忆 体 ( Read-Only Memory , ROM ) 或随机存^ ^己忆体 ( Random Access Memory, RAM ) 等。
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或 者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技 术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims

权 利 要 求 书
1、 一种分布式网络构造方法, 其特征在于, 包括:
根据请求加入分布式网络的请求节点的地址, 确定所述请求节点所在 的域, 并获取域标识;
根据所述域具有的域内节点的数量, 生成所述请求节点的域内标识; 将所述域标识与所述域内标识级联, 获得所述请求节点的节点标识; 将所述节点标识发送至所述请求节点, 所述请求节点根据其获得的节点 标识获取邻近节点的节点信息, 以加入所述分布式网络。
2、 根据权利要求 1所述的分布式网络构造方法, 其特征在于, 所述获 取所述域标识包括:
设定域标识的有效长度 M, M为正整数;
将所述分布式网络中已有域的数量值表示为 M位比特值, 并根据该 比特值生成所述域的域标识。
3、 根据权利要求 1所述的分布式网络构造方法, 其特征在于, 所述根 据所述域具有的域内节点的数量, 生成所述请求节点的域内标识包括:
设定域内标识的有效长度 N, N为正整数;
判断是否存在空闲的域内标识; 若存在, 则将所述空闲的域内标识赋值 给所述请求节点; 否则从所述域中获取域内节点的数量值, 并将该数量值转 换为对应 N位比特值, 并根据该比特值生成所述请求节点的域内标识。
4、 根据权利要求 1、 2或 3所述的分布式网络构造方法, 其特征在于, 所述请求节点根据其获得的节点标识获取邻近节点的节点信息, 以加入所述 分布式网络包括:
所述请求节点向其已知的接入节点发送针对所述请求节点的查询请求; 所述请求节点接收所述接入节点返回的节点标识与所述请求节点的节点 标识异或距离最小的邻近节点的节点信息, 所述节点信息中包括所述邻近节 点的节点标识; 将所述邻近节点的节点标识与所述请求节点的节点标识进行匹配, 根据 匹配的比特位数, 记录所述邻近节点的节点信息到所述请求节点的相应的节 点列表中;
将所述邻近节点作为其再次发送针对所述请求节点的查询请求的接入节 点, 以查询节点标识与所述请求节点的节点标识距离最小的邻近节点的节点 信息, 直到所述请求节点接收到的邻近节点全部为所述接入节点, 查询结束, 所述请求节点加入所述分布式网络。
5、 根据权利要求 4所述的分布式网络构造方法,其特征在于,还包括: 在所述分布式网络中的一个或多个节点接收不到一退出节点的响应消 息时, 接收所述分布式网络中的一个或多个节点发送的针对所述退出节点的 处理请求;
查看失效节点列表, 并对所述退出节点做出是否失效的判定处理。
6、 根据权利要求 5所述的分布式网络构造方法, 其特征在于, 所述查 看失效节点列表, 对所述退出节点做出是否失效的判定处理包括:
若所述失效节点列表中不存在所述退出节点的节点信息, 则在所述失效 节点列表中创建所述退出节点; 并判断所述退出节点是否失效, 若是, 则将 所述退出节点的节点标识写入所述退出节点所在域的空闲域内标识列表中; 若所述失效节点列表中存在所述退出节点的节点信息, 并且所述退出节 点没有被判断过是否失效, 则判断所述退出节点是否失效; 若是, 则将所述 退出节点的节点标识写入所述退出节点所在域的空闲域内标识列表中。
7、 根据权利要求 5或 6所述的分布式网络构造方法, 其特征在于, 还 包括周期性扫描所述失效节点列表并删除所述失效节点列表中记录的过期 节点信息的步骤。
8、 根据权利要求 4所述的分布式网络构造方法,其特征在于,还包括: 当所述分布式网络中的内容查询请求节点发起对包括内容标识的内 容索引信息的查询时, 内容查询请求节点从其节点列表中找出节点标识与要 查询的内容标识距离最小的节点作为第一查询节点, 并向所述第一查询节点 发送针对所述内容标识的查询请求;
若在所述第一查询节点的节点列表中没有找到距离比所述第一查询节点 的节点标识与所述内容标识距离更小的节点, 则将所述第一查询节点的节点 信息返回给所述内容查询请求节点;
若在所述第一查询节点的节点列表中找到距离比所述第一查询节点的节 点标识与所述内容标识距离更小的第二查询节点, 则将所述第二查询节点的 节点信息返回给所述内容查询请求节点;
所述内容查询请求节点向返回的节点发送查询所述内容标识的请求, 若 该节点上管理有所述内容索引信息, 则返回所述内容索引信息到所述内容查 询请求节点; 否则, 在该节点上继续查找节点标识与内容标识距离最小的节 点以查询所述内容索引信息。
9、 根据权利要求 8所述的分布式网络构造方法, 其特征在于, 所述在 所述第一查询节点的节点列表中找到比所述第一查询节点更加接近所述内容 标识的第二查询节点包括:
在所述第一查询节点的节点列表中找到与所述内容标识的所述 M位的前 缀距离最小的 M位比特值所标识的邻近节点列表;
在所述邻近节点列表中查找与所述内容标识的所述 M位后的所述 N位前 缀距离最小的节点列表中的邻近节点, 查找到的所述邻近节点即所述第二查 询节点。
10、 根据权利要求 8或 9所述的分布式网络构造方法, 其特征在于, 还包括:
第一节点加入到所述分布式网络的第一域后, 若所述第一域中仅有所述 第一节点, 则所述第一节点查找到域标识与所述第一域的域标识距离最小的 第二域中的所有节点, 获取记录在所述第二域中的所有节点上的内容标识的 M位的前缀大于等于所述第一域的域标识的内容索引信息; 若所述第一域中 还有其他节点, 则所述第一节点查找到节点标识与所述第一节点的节点标识 距离最小的第二节点, 获取记录在所述第二节点上的内容标识的 Μ位后的 Ν 位前缀大于等于所述第一节点的域内标识的内容索引信息。
11、 一种在权利要求 1-10任一所述的方法构造的分布式网络中进行域 内任务处理方法, 其特征在于, 包括:
第一节点接收任务处理请求, 所述任务处理请求包括: 内容上传处理请 求、 增加或删除内容处理请求;
所述第一节点判断其自身的资源性能是否满足任务处理的要求; 若满足, 则将所述第一节点的节点信息返回发起所述任务处理请求的第 二节点, 所述第二节点向所述第一节点发起操作;
若不满足, 则从所述第一节点的节点列表中选择资源性能满足任务处理 的要求的第三节点, 将所述第三节点的节点信息返回发起所述任务处理请求 的第二节点, 所述第二节点向所述第三节点发起操作; 其中选择第三节点时, 先从存储有所述第一节点所在域的域内节点信息的节点列表中选择。
12、 一种节点标识生成装置, 其特征在于, 包括:
域标识获取模块, 用于根据请求加入分布式网络的请求节点的地址, 确定所述请求节点所在的域, 并获取域标识;
域内标识生成模块, 用于根据所述域具有的域内节点的数量, 生成所述 请求节点的域内标识;
节点标识获取模块, 用于将所述域标识与所述域内标识级联, 获得所述 请求节点的节点标识。
13、 根据权利要求 12所述的节点标识生成装置, 其特征在于, 所述域 标识获取模块包括:
第一设置模块, 用于设定域标识的有效长度 Μ, Μ为正整数; 第一计算模块,用于将所述分布式网络中已有域的数量值表示为 Μ位 比特值, 并根据该比特值生成所述域的域标识。
14、 根据权利要求 12所述的节点标识生成装置, 其特征在于, 所述域 内标识生成模块包括:
第二设置模块, 用于设定域内标识的有效长度 N, N为正整数; 判断模块, 用于判断是否存在空闲的域内标识;
赋值模块, 用于将所述空闲的域内标识赋值给所述请求节点;
第二计算模块, 用于从所述域中获取域内节点的数量值, 并将该数量值 转换为对应的 N位比特值,并根据该比特值生成所述请求节点的域内标识。
15、 一种分布式网络系统, 其特征在于, 包括:
请求路由服务器, 用于根据请求加入分布式网络的请求节点的地址, 确定所述请求节点所在的域, 并获取域标识; 根据所述域具有的域内节点 的数量, 生成所述请求节点的域内标识; 并将所述域标识与所述域内标识级 联, 获得所述请求节点的节点标识;
边缘服务器, 用于根据从所述请求路由服务器获得的其所在域的域标识 计算所述边缘服务器的节点标识, 或从所述请求路由服务器获得由所述请求 路由服务器计算所得的所述边缘服务器的节点标识; 用于存储内容, 所述内 容具有对应的内容标识; 用于查找与所述内容标识最近的一个或多个边缘服 务器登记所述内容对应的内容索引信息, 以及查找所述边缘服务器所要获取 的内容索引信息所在的边缘服务器; 还用于对其节点列表进行维护, 发起对 其邻近的边缘服务器发起节点查询, 以及对其性能进行统计、 记录;
内容索引服务器, 用于对上传到所述分布式网络系统的内容进行添加、 删除及分发的操作, 登记所述内容对应的内容标识, 以及接收用户或所述边 缘服务器发送的查询内容请求, 进行查询内容处理, 并返回所要查询的内容 对应的内容标识。
16、 根据权利要求 15所述的分布式网络系统, 其特征在于, 所述请求 路由服务器包括:
域标识获取模块, 用于根据请求加入分布式网络的请求节点的地址, 指定所述请求节点所在的域, 所述域具有一域标识;
域内标识生成模块, 用于根据所述域具有的域内节点的数量, 生成所述 请求节点的域内标识;
节点标识获取模块, 用于将所述域标识与所述域内标识级联, 获得所述 请求节点的节点标识。
17、 根据权利要求 16所述的分布式网络系统, 其特征在于, 所述请求 路由服务器还包括:
域划分管理列表, 用于配置各个域的划分条件及对域的划分进行管理; 域管理模块, 用于对所述分布式网络系统中的域的数量、 域标识的有效 长度和域的列表信息进行管理。
18、 根据权利要求 15所述的分布式网络系统, 其特征在于, 所述边缘 服务器包括:
内容索引管理模块, 用于记录、 管理与其节点标识的距离最小的内容标 识所标识的内容索引信息;
节点管理模块, 用于对其节点列表进行维护;
查询模块, 用于对其邻近的边缘服务器发起节点查询, 以及发起对所要 查询的内容对应的内容标识的查询;
性能统计模块, 用于对其性能进行统计、 记录。
19、 一种存储介质, 其特征在于, 其内存储的计算机程序包括至少一个 用于处理信号的代码段, 所述代码段由机器执行使得该机器执行如下步骤: 根据请求加入分布式网络的请求节点的地址, 确定所述请求节点所在 的域, 并获取域标识;
根据所述域具有的域内节点的数量, 生成所述请求节点的域内标识; 将所述域标识与所述域内标识级联, 获得所述请求节点的节点标识; 将所述节点标识发送至所述请求节点, 所述请求节点根据其获得的节点 标识获取邻近节点的节点信息, 以加入所述分布式网络。
PCT/CN2009/074451 2008-12-19 2009-10-14 分布式网络构造方法和系统以及任务处理方法 WO2010069198A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US12/980,900 US8489726B2 (en) 2008-12-19 2010-12-29 Distributed network construction method, system and task processing method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200810240455.5A CN101753610B (zh) 2008-12-19 2008-12-19 分布式网络构造方法、装置和系统以及任务处理方法
CN200810240455.5 2008-12-19

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US12/980,900 Continuation US8489726B2 (en) 2008-12-19 2010-12-29 Distributed network construction method, system and task processing method

Publications (1)

Publication Number Publication Date
WO2010069198A1 true WO2010069198A1 (zh) 2010-06-24

Family

ID=42268296

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/074451 WO2010069198A1 (zh) 2008-12-19 2009-10-14 分布式网络构造方法和系统以及任务处理方法

Country Status (3)

Country Link
US (1) US8489726B2 (zh)
CN (1) CN101753610B (zh)
WO (1) WO2010069198A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102369749A (zh) * 2010-07-27 2012-03-07 华为技术有限公司 节点标识的生成方法、系统及设备
US8489726B2 (en) 2008-12-19 2013-07-16 Huawei Technologies Co., Ltd. Distributed network construction method, system and task processing method
CN104967873A (zh) * 2015-06-29 2015-10-07 上海帝联信息科技股份有限公司 流媒体直播调度方法、系统和调度服务器
CN110956463A (zh) * 2019-10-28 2020-04-03 北京大学 基于可扩展分布式查询系统的可信存证方法与系统

Families Citing this family (39)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102457428B (zh) * 2010-10-27 2015-10-21 中兴通讯股份有限公司 分布式哈希表网络的负载均衡实现方法及装置
CN101977162B (zh) * 2010-12-03 2012-01-18 电子科技大学 一种高速网络的负载均衡方法
CN102137145B (zh) * 2010-12-03 2015-03-18 华为技术有限公司 分布式内容管理的方法、装置及系统
CN102547471B (zh) * 2010-12-08 2013-12-11 中国科学院声学研究所 一种p2p流媒体系统中获取候选合作节点的方法及系统
US8443086B2 (en) 2011-06-22 2013-05-14 National Chiao Tung University Decentralized structured peer-to-peer network and load balancing methods thereof
CN103164262B (zh) * 2011-12-15 2016-03-30 阿里巴巴集团控股有限公司 一种任务管理方法及装置
CN102447712B (zh) * 2012-01-20 2015-07-08 华为技术有限公司 内容分发网络中节点互联的方法、系统及节点
CN102929696B (zh) * 2012-09-28 2015-09-09 北京搜狐新媒体信息技术有限公司 一种分布式系统中心节点构建、提交、监控方法及装置
CN103780490B (zh) * 2012-10-17 2018-03-30 中兴通讯股份有限公司 一种更新路由查找树的方法及装置
CN103312573B (zh) * 2013-06-14 2016-12-28 西安交通大学 一种家庭网络系统设备发现与识别方法
CN104793926B (zh) * 2014-04-17 2018-06-01 厦门极致互动网络技术股份有限公司 一种分布式系统中资源配置方法及系统
CN104038532B (zh) * 2014-05-05 2017-09-01 北京荣之联科技股份有限公司 一种分布式系统互联方法及装置
US9712455B1 (en) * 2014-11-13 2017-07-18 Cisco Technology, Inc. Determining availability of networking resources prior to migration of a server or domain
CN105554121A (zh) * 2015-12-18 2016-05-04 深圳中兴网信科技有限公司 实现分布式缓存系统负载均衡的方法及系统
CN105847159A (zh) * 2016-03-31 2016-08-10 乐视控股(北京)有限公司 Cdn网络的拓扑结构生成方法和系统
CN107896249B (zh) * 2017-11-16 2020-08-04 中国平安人寿保险股份有限公司 跨网络区域数据访问方法、装置、设备及存储介质
CN110417636B (zh) * 2018-04-28 2022-06-21 黄楚媛 一种去中心化的自组织即时通信系统及其方法
CN108880889A (zh) * 2018-06-22 2018-11-23 申报家(广州)智能科技发展有限公司 一种自动获取网络存储资源的管理方法与装置
CN108848191A (zh) * 2018-07-26 2018-11-20 深圳市元征科技股份有限公司 一种节点连接方法及相关设备
CN109246190B (zh) * 2018-08-07 2021-06-01 深圳市先河系统技术有限公司 网络寻址方法、数据编辑方法、装置及存储介质
CN110875942B (zh) * 2018-09-03 2023-03-07 北京京东尚科信息技术有限公司 一种热点节目负载均衡的方法和装置
CN109284424B (zh) * 2018-09-21 2021-10-19 长沙学院 构造滑动情况表的方法
CN109218447B (zh) * 2018-10-29 2021-09-17 中国建设银行股份有限公司 媒体文件分发方法及文件分发平台
CN109688211A (zh) * 2018-12-18 2019-04-26 杭州茂财网络技术有限公司 数据分布式处理方法
CN109669642B (zh) * 2018-12-24 2022-06-10 广东浪潮大数据研究有限公司 存储系统的节点加入方法、系统、装置及可读存储介质
CN109660624B (zh) * 2018-12-26 2022-05-17 网宿科技股份有限公司 内容分发网络资源的规划方法、服务器及存储介质
CN109831361B (zh) * 2019-02-28 2020-10-16 东软集团股份有限公司 一种分布式调试方法、系统及装置
CN110059109B (zh) * 2019-03-12 2023-11-21 湖北华中电力科技开发有限责任公司 数据查询的装置、方法及存储介质
CN110381157A (zh) * 2019-07-26 2019-10-25 正链科技(深圳)有限公司 一种基于Kademlia算法的分布式定向数据存储P2P网络
CN110708374B (zh) * 2019-09-30 2022-02-22 北京高途云集教育科技有限公司 一种边缘节点的分配方法、分配装置及可读存储介质
CN110932980B (zh) * 2019-11-27 2022-09-20 达闼机器人股份有限公司 通信方法、终端及计算机可读存储介质
CN111262916B (zh) * 2020-01-10 2022-11-08 深圳市网心科技有限公司 数据分布式存储方法、装置、存储节点及存储介质
CN111767250A (zh) * 2020-06-10 2020-10-13 钛星投资(深圳)有限公司 去中心化存储方法、下载方法及存储系统
CN111757335B (zh) * 2020-07-10 2022-06-24 展讯半导体(成都)有限公司 接入及接入控制方法、装置、系统、节点和存储介质
CN112015818B (zh) * 2020-08-31 2024-01-30 杭州欧若数网科技有限公司 分布式图数据库uuid生成方法、装置、设备及介质
US11711445B2 (en) * 2020-09-16 2023-07-25 Netflix, Inc. Configurable access-based cache policy control
CN112699094B (zh) * 2021-03-23 2021-07-13 中国信息通信研究院 文件存储方法、数据检索方法、相应装置及系统
CN113572820B (zh) * 2021-07-01 2024-02-02 西安震有信通科技有限公司 一种集群构建方法、装置、终端设备及存储介质
CN117539649A (zh) * 2024-01-10 2024-02-09 广州宇中网络科技有限公司 分布式集群的标识管理方法、设备和可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783823A (zh) * 2004-12-02 2006-06-07 索尼株式会社 网络系统、无线通信设备、无线通信方法及其计算机程序
CN1885795A (zh) * 2006-06-05 2006-12-27 中国移动通信集团公司 一种多级分布式网络系统
CN101146022A (zh) * 2006-09-11 2008-03-19 思华科技(上海)有限公司 节点重叠内容分发网络
CN101159966A (zh) * 2007-11-14 2008-04-09 北京邮电大学 在移动环境下的对等网络拓扑匹配方法
WO2008101169A2 (en) * 2007-02-15 2008-08-21 Tyco Telecommunications (Us) Inc. Distributed network management system and method

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7272645B2 (en) * 2001-05-25 2007-09-18 Sbc Technology Resources, Inc. Method of improving the reliability of peer-to-peer network downloads
US7509372B2 (en) * 2001-09-13 2009-03-24 International Business Machines Corporation Method and system for redirecting data requests in peer-to-peer data networks
US7493363B2 (en) * 2001-09-19 2009-02-17 Microsoft Corporation Peer-to-peer group management and method for maintaining peer-to-peer graphs
US7304994B2 (en) 2003-04-09 2007-12-04 Nec Laboratories America, Inc. Peer-to-peer system and method with prefix-based distributed hash table
JP4371056B2 (ja) * 2005-01-07 2009-11-25 ブラザー工業株式会社 ノード装置、ネットワーク参加処理プログラム、及びネットワーク参加処理方法等
WO2006096928A1 (en) * 2005-03-17 2006-09-21 Xynk Pty Ltd A method and system of communication with identity and directory management
WO2007030742A2 (en) * 2005-09-08 2007-03-15 Matsushita Electric Industrial Co., Ltd. Parallelizing peer-to-peer overlays using multi-destination routing
US7801128B2 (en) 2006-03-31 2010-09-21 Amazon Technologies, Inc. Managing communications between computing nodes
CN101753610B (zh) 2008-12-19 2012-11-21 华为技术有限公司 分布式网络构造方法、装置和系统以及任务处理方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783823A (zh) * 2004-12-02 2006-06-07 索尼株式会社 网络系统、无线通信设备、无线通信方法及其计算机程序
CN1885795A (zh) * 2006-06-05 2006-12-27 中国移动通信集团公司 一种多级分布式网络系统
CN101146022A (zh) * 2006-09-11 2008-03-19 思华科技(上海)有限公司 节点重叠内容分发网络
WO2008101169A2 (en) * 2007-02-15 2008-08-21 Tyco Telecommunications (Us) Inc. Distributed network management system and method
CN101159966A (zh) * 2007-11-14 2008-04-09 北京邮电大学 在移动环境下的对等网络拓扑匹配方法

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8489726B2 (en) 2008-12-19 2013-07-16 Huawei Technologies Co., Ltd. Distributed network construction method, system and task processing method
CN102369749A (zh) * 2010-07-27 2012-03-07 华为技术有限公司 节点标识的生成方法、系统及设备
CN102369749B (zh) * 2010-07-27 2014-10-08 华为技术有限公司 节点标识的生成方法、系统及设备
CN104967873A (zh) * 2015-06-29 2015-10-07 上海帝联信息科技股份有限公司 流媒体直播调度方法、系统和调度服务器
CN110956463A (zh) * 2019-10-28 2020-04-03 北京大学 基于可扩展分布式查询系统的可信存证方法与系统
CN110956463B (zh) * 2019-10-28 2022-07-12 北京大学 基于可扩展分布式查询系统的可信存证方法与系统

Also Published As

Publication number Publication date
US8489726B2 (en) 2013-07-16
CN101753610B (zh) 2012-11-21
US20110099262A1 (en) 2011-04-28
CN101753610A (zh) 2010-06-23

Similar Documents

Publication Publication Date Title
WO2010069198A1 (zh) 分布式网络构造方法和系统以及任务处理方法
US11431791B2 (en) Content delivery method, virtual server management method, cloud platform, and system
JP5551270B2 (ja) ピアツーピアネットワークを分解して、分解されたピアツーピアネットワークを使用するための方法および装置
WO2010127618A1 (zh) 一种实现流媒体内容服务的系统和方法
JP4938074B2 (ja) リソースの位置情報の要求方法、当該方法のためのユーザノードおよびサーバ
EP2227016B1 (en) A content buffering, querying method and point-to-point media transmitting system
Zhang et al. Distributed hash table: Theory, platforms and applications
WO2008034353A1 (fr) Procédé, système et dispositif permettant d&#39;établir une connexion entre homologues dans un réseau d&#39;homologues
WO2011150830A1 (zh) 获取内容的方法、节点及内容网络
JP2009089369A (ja) 階層的ピアツーピア・ネットワークの最適運用
WO2011069387A1 (zh) 一种网络节点及其数据查询方法和索引更新方法
WO2013010432A1 (zh) 一种对等网络中数据存储和查询的方法、节点及系统
WO2008128450A1 (fr) Procédé et système de publication de contenu, procédé et système de demande de contenu
WO2009006779A1 (fr) Procédé et système pour déterminer un nœud d&#39;index de domicile et un nœud de service de domicile d&#39;un utilisateur
WO2008089616A1 (fr) Serveur, système réseau p2p et procédé d&#39;acheminement et de transfert de l&#39;affectation de la clé de ressource de ce dernier.......
JP4533923B2 (ja) 階層型ピアツーピアシステムにおける負荷バランシング機能を有するスーパーピア及び該スーパーピアを動作させる方法
JP4923115B2 (ja) 自己組織型分散オーバーレイ・ネットワークにおいてオブジェクトへの参照を分散させる方法、コンピュータプログラム、及びノード、並びに自己組織型分散オーバーレイ・ネットワーク
CN108965387B (zh) 一种提高p2p数据存储抗毁性的均衡方法及系统
Singh et al. Finger forwarding scheme to reduce lookup cost in structured P2P networks
Gupta et al. Cooperative data caching in MANETs and WSNs: a survey
Imtiaz et al. Three layer hierarchical model for chord
Shil et al. Three Layer Hierarchical Model for Chord
Chung et al. Architecture and implementation of cluster-based peer-to-peer topology and its application in search.
Zhang et al. DHT Theory
Tan et al. A three-layer routing protocol of structured peer-to-peer overlay networks

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: 09832880

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: 09832880

Country of ref document: EP

Kind code of ref document: A1