WO2012129988A1 - 一种节点加入对等网络的方法及系统 - Google Patents

一种节点加入对等网络的方法及系统 Download PDF

Info

Publication number
WO2012129988A1
WO2012129988A1 PCT/CN2012/071072 CN2012071072W WO2012129988A1 WO 2012129988 A1 WO2012129988 A1 WO 2012129988A1 CN 2012071072 W CN2012071072 W CN 2012071072W WO 2012129988 A1 WO2012129988 A1 WO 2012129988A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
data
joining
peer
receiving
Prior art date
Application number
PCT/CN2012/071072
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
Priority claimed from CN201110078863.7A external-priority patent/CN102724226B/zh
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012129988A1 publication Critical patent/WO2012129988A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • 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

Definitions

  • the present invention relates to peer-to-peer network technologies, and more particularly to a method and system for a node to join a peer-to-peer network. Background technique
  • Peer-to-Peer (P2P) technology can interconnect nodes on the network to form a peer-to-peer network.
  • P2P peer-to-peer
  • each host node acts as a client.
  • the end acts as a server.
  • the P2P technology enables peer-to-peer connections between user nodes to share and exchange resources such as storage resources, computing resources, and network resources.
  • P2P technology has been widely used in many technical fields on the Internet because of its decentralization and easy scale.
  • the P2P Session Initiation Protocol (SIP) Working Group of the Internet Engineering Task Force (IETF) defines the first resource location and discovery (RELOAD, Resource Location And Discovery) protocol for P2P technology.
  • SIP Session Initiation Protocol
  • IETF Internet Engineering Task Force
  • a P2P network especially a structured peer-to-peer network, based on certain rules, such as a distributed hash algorithm (DHT), data resources are stored in each peer node, and the consistent hash algorithm and With the corresponding data backup mechanism, the P2P network can implement storage functions such as load balancing and data security. For example, when a new peer node joins/leaves during network adjustment, the P2P network needs to migrate data to the corresponding peer node according to the specified rules, so that the network load is rebalanced.
  • DHT distributed hash algorithm
  • the joining node in the implementation process of the peer node joining the peer-to-peer network, the joining node can perform message routing and data operation service processing and routing to the node after all data migration is completed. All peer nodes in the table send route notifications, start receiving request messages from other nodes, and start providing services.
  • All peer nodes in the table send route notifications, start receiving request messages from other nodes, and start providing services.
  • data migration may be required. It takes a long time to complete.
  • Joining a node cannot provide data services in time, so that the load of other peer nodes cannot be reduced in time. Moreover, long-term data migration may also impact network data transmission and deteriorate the network environment. In addition, in data migration, frequently changing data needs to be migrated repeatedly, and data in other peer nodes in the peer-to-peer network may be inconsistent with data that is eventually migrated to the joining node. Summary of the invention
  • the main purpose of the present invention is to provide a method and system for a node to join a peer-to-peer network, so as to solve the problem that the existing new node cannot provide services in time when the peer node joins the peer-to-peer network, resulting in deterioration of the network status and data inconsistency.
  • the present invention provides a method for a node to join a peer-to-peer network, the method comprising: adding a node to obtain routing information of a peer-to-peer network from the receiving node, constructing a local routing table, marking itself as a data migration state, and notifying the receiving node Marking the joining node as a data migration state;
  • the joining node notifies that the peer node in the local routing table itself has joined the peer-to-peer network; the receiving node migrates data to the joining node, and after the data migration is completed, marks the joining node as normal a status, and notifying the joining node that the joining node itself is in a normal state.
  • the method further includes: when the joining node is in a data migration state, the joining node Receiving a data operation request and querying the data that the local database does not have the requested operation, acquiring the data from the receiving node and processing the data.
  • the acquiring the data from the receiving node includes: The joining node sends a data acquisition request to the receiving node to request to acquire the data; the receiving node receives the data obtaining request, and returns a data obtaining response carrying the requested data to the access node;
  • the joining node receives the data acquisition response, extracts the data and saves it to a local database.
  • the method further includes:
  • the joining node When the joining node is in a data migration state, the joining node receives the data operation request, and queries the local database that the data in the data operation request does not exist, and forwards the received data operation request to the receiving node;
  • the receiving node receives the data operation request, processes the data, and migrates the processed data to the joining node.
  • the method further includes:
  • the receiving node When the joining node is in a data migration state, the receiving node receives a data operation request, and detects that the data operation request is processed by the joining node, and the requested operation data has been migrated to the joining node, And then the received data operation request is forwarded to the joining node, and the joining node performs data processing.
  • the method further includes:
  • the receiving node When the joining node is in a data migration state, the receiving node receives a data operation request, and detects that the data operation request is processed by the joining node, and the requested operation data is not migrated to the joining node, Then, the data of the requested operation is processed, and the data is migrated to the joining node, or the data of the requested operation is migrated to the joining node, and the data is processed by the joining node.
  • the receiving node migrates data to the joining node. After the data migration is completed, the method further includes: after completing the migration of a data, the receiving node marks the data in itself as Migrated.
  • the receiving node migrating data to the joining node includes: the receiving node sending, to the joining node, a storage data request carrying data to be migrated, where the joining node receives the storage data request, Extracting the data to be migrated from the stored data request to a local database, and returning a stored data response to the receiving node to complete migration of the data to be migrated.
  • the present invention also provides a system for implementing a node to join a peer-to-peer network, the system comprising: a joining node to be added to a peer-to-peer network, and a receiving node of the peer-to-peer network, where
  • the node is configured to obtain the routing information of the peer network from the receiving node, construct a local routing table, mark the data migration state, notify the receiving node to mark the joining node as a data migration state, and notify the built local route.
  • the peer node in the table itself has joined the peer-to-peer network and provides services to the peer node; after receiving the notification from the receiving node, the tag itself is in a normal state;
  • An access node configured to: after receiving the notification of the joining node, mark the joining node as a data migration state, migrate data to the joining node, and mark the joining in the self after the data migration is completed.
  • the node is in a normal state, and the joining node is notified that the joining node itself is in a normal state.
  • the joining node is further configured to: when receiving the data operation request and query the data that the local database does not have the requested operation, when the data is in the data migration state, obtain the data from the receiving node, and Processing the data, or forwarding the received data operation request to the receiving node; the receiving node is further configured to receive the data operation request forwarded by the joining node, process the data, and process the data Data migration to the joining node
  • the joining node is further configured to send a data acquisition request to the receiving node to request to acquire the data; and receive a data acquisition response returned by the receiving node, extract the data, and save the data to a local database.
  • the receiving node is further configured to receive a data acquisition request sent by the joining node, and return a data acquisition response carrying the requested data to the access node.
  • the receiving node is further configured to: when the joining node is in a data migration state, receive a data operation request and detect data that is requested by the joining node to be processed by the joining node, and the requested operation After the migration to the joining node, the received data operation request is forwarded to the joining node, and the joining node performs data processing.
  • the receiving node is further configured to: when the joining node is in a data migration state, receive a data operation request and detect data that is requested by the joining node to be processed by the joining node, and the requested operation If the node is not migrated, the data of the requested operation is processed, and the data is migrated to the joining node, or the data of the requested operation is migrated to the joining node, and the joining node is The data is processed.
  • the receiving node is further configured to mark the status of the data as migrated after completing the migration of a data.
  • the receiving node is further configured to send, to the joining node, a storage data request that carries the data to be migrated; the joining node is further configured to receive a storage data request sent by the receiving node, Extracting the data to be migrated from the stored data request is saved to the local database, and returns a stored data response to the receiving node.
  • the method and system for the node to be added to the peer-to-peer network provided by the present invention, after the node is constructed, the node is notified that the peer node in the local routing table has joined the peer-to-peer network and provides the service to the peer node. Then, the receiving node migrates data to the joining node, so that after the new node joins the peer-to-peer network, the service can be provided in time, thereby reducing the load of other peer nodes in time, and avoiding impact on network data transmission. In addition, during the data migration process, the joining node can perform business operations, thereby ensuring that the data finally migrated to the joining node is consistent with the data in the current peer-to-peer network, ensuring data consistency.
  • FIG. 1 is a flowchart of an implementation of a method for a node to join a peer-to-peer network according to the present invention
  • FIG. 2 is a schematic diagram of an implementation process of a node joining a peer-to-peer network according to Embodiment 1 of the present invention
  • FIG. 3 is a schematic diagram of a process of joining a node to perform data operations in a data migration process according to Embodiment 2 of the present invention
  • FIG. 4 is a schematic diagram of a process of joining a node to perform data operations in a data migration process according to Embodiment 3 of the present invention
  • FIG. 5 is a schematic diagram of a process of performing data operations by a receiving node in a data migration process according to Embodiment 4 of the present invention.
  • FIG. 6 is a schematic diagram of a process of performing data operations by a receiving node in a data migration process according to Embodiment 5 of the present invention.
  • FIG. 7 is a schematic diagram of a process of performing data operations by a receiving node in a data migration process according to Embodiment 6 of the present invention. detailed description
  • the basic idea of the present invention is: the joining node first completes the local routing table construction and starts the related business service, and joins the node tag itself as the data migration state, the receiving node marks the joining node in the data migration state, and joins the node to the current state.
  • the other network nodes of the network advertise the routing update notification, and announce that they can provide the service operation service. After that, the data is migrated between the joining node and the receiving node.
  • other peer nodes operate according to the current peer-to-peer routing mechanism.
  • the request message is routed to the joining node or the receiving node, and the joining node or the receiving node performs a corresponding operation according to the state of the data to be operated, in the data migration
  • the joining node and the receiving node mark the joining node as a normal state, so that the new node can provide the service as soon as possible after joining the P2P network, and does not affect the service operation and data consistency during the data migration process.
  • the method for the node of the present invention to join the peer-to-peer network may mainly include the following steps:
  • Step 101 The joining node obtains routing information of the peer network from the receiving node, constructs a local routing table, marks itself as a data migration state, and notifies the receiving node to mark the joining node as a data migration state.
  • Step 102 The joining node notifies that the peer node in the local routing table itself has joined the peer-to-peer network;
  • the joining node can begin to provide routing, and/or data operation services to the peer nodes in the local routing table.
  • Step 103 The receiving node migrates data to the joining node, and after the data migration is completed, marks the joining node as a normal state by itself, and notifies the joining node to mark the joining node itself as a normal state.
  • the receiving node migrating data to the joining node includes: the receiving node sending, to the joining node, a storage data request carrying data to be migrated, where the joining node receives the storage data request, Extracting data to be migrated from the stored data request to a local database, and returning a stored data response to the receiving node to complete migration of the data to be migrated.
  • the method further includes: when the joining node is in a data migration state, the joining node receives a data operation request, If the data of the request operation does not exist in the local database, the data is acquired from the receiving node, and the data is processed.
  • the obtaining the data from the receiving node includes: the joining node is connected Receiving, by the node, a data acquisition request, requesting to acquire the data; the receiving node receiving the data acquisition request, returning, to the access node, a data acquisition response carrying the requested data; and the joining node receiving the data acquisition In response, the data is extracted and saved to a local database.
  • the method further includes: when the joining node is in a data migration state, the joining node receives a data operation request, and Querying that the data in the data operation request does not exist in the local database, and forwarding the received data operation request to the receiving node; the receiving node receiving the data operation request, processing the data, and processing the processed data Migrate to the joining node.
  • the method further includes: when the joining node is in a data migration state, the receiving node receives a data operation request, And detecting that the data operation request is processed by the joining node, and the data of the requested operation has been migrated to the joining node, then forwarding the received data operation request to the joining node, by joining The node performs data processing.
  • the method further includes: when the joining node is in a data migration state, the receiving node receives a data operation request, and Detecting that the data operation request is processed by the joining node, and the data of the requested operation is not migrated to the joining node, processing the data of the requested operation, and migrating the data to the joining node Or, the data of the requested operation is migrated to the joining node, and the data is processed by the joining node.
  • the receiving node migrates data to the joining node. After the data migration is completed, the method further includes: after completing the migration of a data, the receiving node marks the state of the data as being migrated.
  • the present invention further provides a system for implementing a node to join a peer-to-peer network, the system mainly comprising: a joining node to be added to the peer-to-peer network, and a receiving node of the peer-to-peer network,
  • the joining node is configured to obtain the routing information of the peer network from the receiving node, construct a local routing table, mark the data migration state, notify the receiving node to mark the joining node as a data migration state, notify the constructed
  • the peer node in the local routing table itself has joined the peer-to-peer network and provides services to the peer node; after receiving the notification from the receiving node, the tag itself is in a normal state; the access node is used to receive After the notification of joining the node, marking the joining node as a data migration state, migrating data to the joining node, and marking the joining node as a normal state after the data migration is completed, notifying the The joining node marks the joining node itself to be in a normal state.
  • the receiving node is further configured to send, to the joining node, a storage data request that carries the data to be migrated; the joining node is further configured to receive a storage data request sent by the receiving node, from the storing The data request extracts the data to be migrated to the local database, and returns a stored data response to the receiving node.
  • the joining node is further configured to: when receiving the data operation request and query the local database that the requested data does not exist, when the data is in the data migration state, obtain the data from the receiving node, and obtain the data. Processing, or forwarding the received data operation request to the receiving node; the receiving node is further configured to receive the data operation request forwarded by the joining node, process the data, and migrate the processed data to The joining node.
  • the joining node is further configured to send a data acquisition request to the receiving node, requesting to acquire the data; and receiving a data obtaining response returned by the receiving node, extracting the data and saving the data to a local database;
  • the node is further configured to receive a data acquisition request sent by the joining node, and return a data acquisition response carrying the requested data to the access node.
  • the receiving node is further configured to: when the joining node is in a data migration state, receive a data operation request, and detect that the data operation request is processed by the joining node, and the requested operation data has been migrated to The joining node forwards the received data operation request to the joining node, and the joining node performs data processing.
  • the receiving node is further configured to: when the joining node is in a data migration state, receive a data operation request, and detect that the data operation request is processed by the joining node, and the requested operation data is not migrated to The joining node processes the data of the requested operation, and migrates the data to the joining node, or migrates the data of the requested operation to the joining node, and the joining node performs the data on the joining node. deal with.
  • the receiving node may be further configured to mark the status of the data as migrated after completing the migration of a data.
  • the operation processing of the data may specifically be reading, writing, updating, or the like of the data.
  • the joining node first sends a network access request to the guiding node to obtain configuration information of the peer network, and the joining node establishes a connection with the receiving node according to the configuration information of the peer network, and sends a request to join the peer network to Accommodating the node, completing the construction of the local routing table with the assistance of the receiving node, and identifying itself as the data migration state, accessing the peer-to-peer network; then, the joining node notifying the other peer nodes that the joining node can start providing the service service, Data migration between the receiving node and the joining node. After the data migration is completed, the node identifier itself is added to the normal state, and normal routing and data operations are performed.
  • the joining node sends a network access request to the guiding node of the peer network, requesting to obtain configuration information of the peer network;
  • the bootstrap node is used to guide the new node to join the peer-to-peer network, so that the newly joined node can obtain the configuration information of the peer-to-peer network.
  • the joining node receives a network access response returned by the guiding node, and extracts configuration information of the peer network from the network access response.
  • the network access response carries configuration information of the peer network, and the configuration information includes Information such as routing mechanisms, protocols, algorithms, security, and basic services supported by the network.
  • the joining node when the joining node establishes a network connection with the receiving node, it may be implemented by other nodes, for example, the joining node sends a connection request to the allocated access node, and the access node routes the connection request to the receiving node. , establish a connection between the joining node and the receiving node.
  • the receiving node is configured to provide the joining node with a service to join the peer-to-peer network.
  • the peer nodes in the peer-to-peer network may be obtained according to the routing mechanism, protocol, algorithm, security, and the like of the peer-to-peer network. The receiving node is selected.
  • the joining node sends a join peer network request to the receiving node, and the receiving node returns a join peer network response to the joining node.
  • the receiving node sends a routing update request to the joining node, and pushes routing information to the joining node.
  • the joining node receives the routing update request sent by the receiving node, obtains the routing information pushed by the receiving node from the routing update request, constructs a local routing table according to the routing information pushed by the receiving node, and returns an updated routing response to the receiving node. ;
  • the joining node tag itself is a data migration state, and sending a routing update request to the receiving node, notifying the receiving node that the joining node has completed the routing table construction, and the receiving node receives the routing update request, in the self-marking station
  • the joining node is in a data migration state, and confirms the routing update request to the joining node.
  • the receiving node can confirm to the joining node that the updated routing request has been received by sending an acknowledgement message to the receiving node.
  • the joining node sends a routing update request to all related peer nodes according to the constructed local routing table, and notifies the peer node that the joining node has completed the peer-to-peer network joining, and can provide routing and data operation services.
  • the receiving node migrates data to the joining node, and the range of the migrated data is currently
  • the P2P algorithm adopted by the network determines;
  • the receiving node sends a storage data X request to the joining node, the stored data X request carries the data X to be migrated, and the joining node receives the stored data X request, accepting The node returns a stored data X response and extracts the data X from the stored data X request for storage.
  • the foregoing storage data operation between the receiving node and the joining node may be performed in multiple times, that is, all the data to be migrated may be stored one by one, or multiple pieces of data may be migrated at one time.
  • the receiving node marks the joining node as a normal state, and sends an update routing request to the joining node, notifying the joining node that the receiving node has completed data migration.
  • the marking itself is in a normal state, and confirms the update routing notification request to the receiving node.
  • the joining node can confirm to the receiving node that the update routing request has been received by sending an acknowledgement message to the receiving node.
  • the joining node when the joining node receives the operation request of the data X, the joining node needs to perform the corresponding data operation according to its own data state. Specifically, if the joining node has an existing operating object, such as the data X, directly Performing the corresponding data operation, if there is no operation object locally on the joining node, that is, there is no data X existing in the joining node, then the receiving node needs to obtain the data X, and according to the response result of the data X returned by the receiving node, the corresponding data is executed. Data manipulation.
  • the joining node when the joining node completes the peer-to-peer network joining and is in the data migration state, the data operation process is performed, as shown in FIG. 3, and the specific process is as follows:
  • the joining node receives the data X operation request from the requesting node;
  • the joining node detects that the data X operation request is responsible for processing, and checking The local database does not have data X;
  • the joining node if the joining node queries the local database to have the data X, it can directly execute S307. In practical applications, the joining node can detect the node responsible for processing the data X operation request through the P2P algorithm of the current peer network.
  • the joining node sends a data acquisition request to the receiving node, requesting to obtain the data X;
  • the receiving node receives the data X obtaining request, and the detecting data X obtaining request is responsible for the joining node, and detecting that the joining node is in a data migration state, preferentially migrating the data X to the joining node by using a response message. That is, the data X is carried in the data X acquisition response and returned to the joining node;
  • the receiving node can detect the node responsible for processing the data X operation request through the P2P algorithm of the current peer network.
  • the joining node receives the acquired data X response, extracts the data X, obtains the data X, and performs the operation processing of the data X according to the acquired data X response, and saves the obtained data X operation result in the local database. ;
  • the operation processing of the data X may be an update
  • the data X operation result may be the updated data X.
  • the joining node returns an operation response carrying the result of the data X operation to the requesting node.
  • the joining node receives the data operation request, if the data of the request operation exists locally, the corresponding data operation processing is performed. Otherwise, the joining node forwards the data X operation request to the receiving node, and the receiving node performs the operation. The data operation processes and returns the result of the data operation, and the receiving node later migrates the data X to the joining node.
  • the joining node when the joining node completes the peer-to-peer network joining and is in the data migration state, the data processing process is performed.
  • the specific process is as follows: S401-402, identical to S301-302;
  • the joining node detects the data X operation request is handled by the local node, and queries the local database to have no data X;
  • the joining node queries the local database and finds that the local database has data X, it jumps directly to S406.
  • the receiving node receives the data X operation request, checks that the data X operation request should be processed by the joining node, and detects that the joining node is in a data migration state, and the receiving node locally processes the data X, and joins The node returns a data X operation response carrying the result of the data X operation;
  • the receiving node also saves the result of the operation of the data X to the local.
  • the joining node receives the data X operation response, and forwards the data X operation response to the requesting node;
  • the joining node sends a data X storage request to the receiving node, requests migration data X, and the receiving node returns a data X storage response carrying the data X to the joining node, and the joining node receives the data X and stores the response, and extracts the data X. And save, complete the migration of data X.
  • the admission node may migrate data X to the joining node immediately after step S405, or may proceed later in accordance with the data migration order.
  • the receiving node when the receiving node receives the data operation request, if the receiving node detects that the data item of the requested operation should be processed by the joining node, and detects that the joining node is in the data migration state, and the data of the requested operation has not yet been After the migration is completed, the receiving node may preferentially migrate the data of the requested operation to the joining node, and then forward the data operation request to the joining node, and the joining node performs a corresponding data operation to obtain a data operation result.
  • the receiving node is added to the node and the peer network is added and is in a data migration state.
  • the receiving node receives the data X operation request sent by the requesting node;
  • the receiving node detects the data X should be processed by the joining node, and the data X has not been migrated to the joining node, and is saved in the local database;
  • the receiving node marks the data to be migrated by itself, and thus, the receiving node can according to the marking status of the data from the self, for example, in this step, the receiving node Query whether data X is marked as migrated. If it is, then data X has been migrated. Otherwise, data X has not been migrated.
  • the receiving node migrates the data X to the joining node
  • the receiving node sends a data X storage request carrying the data X to the joining node
  • the joining node receives the data X storage request, extracts the data X and saves it to the local database, and returns a data X storage response to the receiving node
  • the receiving node Receiving the data X stores the response, and marking itself that the data X has migrated to the joining node, the migration of the data X is completed.
  • the receiving node After completing the migration of the data X, the receiving node forwards the received data X operation request to the joining node.
  • the joining node receives the data X operation request, queries the data X from the local database, performs corresponding operation processing on the data X, obtains the data X operation result, and returns the operation result of the data X to the receiving node.
  • the receiving node receives the data X operation response and forwards it to the requesting node, and the operation of the data X is completed.
  • the receiving node After the receiving node receives the data operation request, the data of the check request operation shall be processed by the joining node, and the joining node is currently in the data migration state, and the data of the requested operation has not been completed, the receiving node may replace Join the node, finish locally The data X operation is performed, and the processed data X is migrated to the joining node later.
  • the data processing process is performed, as shown in FIG. 6, the specific process is as follows:
  • the receiving node replaces the joining node, completes the operation processing of the data X locally, obtains the data X operation result, and saves the data X operation result to the local database;
  • the receiving node returns, to the requesting node, a data X operation response that includes the data X operation result.
  • the receiving node migrates the processed data X to the joining node. Specifically, the receiving node sends a data X storage request carrying the processed data X to the joining node, the joining node receives the data X storage request, extracts the data X and saves it to the local database, and returns the data X to the receiving node. Storing the response, the receiving node receives the data X storage response, and marks the data X has migrated to the joining node, completing the migration of the data X.
  • the receiving node may migrate the data X to the joining node immediately after step 605, or may perform the data X migration according to the data migration order in the P2P algorithm adopted by the current peer-to-peer network.
  • the receiving node After the receiving node receives the data operation request, if the receiving node detects that the requested operation data is to be processed by the joining node, the joining node is in the data migration state, and the requested operation data has been migrated to join. The node, the receiving node can directly forward the data operation request to the joining node, and the joining node performs subsequent processing.
  • the joining node when the joining node completes the peer-to-peer network joining and is in the data migration state, the data operation process is performed, as shown in FIG. 7, the specific process is as follows:
  • S701-702 identical to S501-502; S703, the receiving node detects that the data X should be processed by the joining node, and the data X has been migrated to the joining node;
  • S704 The receiving node forwards the data X operation request directly to the joining node.
  • the joining node receives the data X operation request, completes the operation processing on the data X, obtains the data X operation result, and returns a data X operation response carrying the data X operation result to the receiving node;
  • the receiving node receives the data X operation response and forwards the request to the requesting node.

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明公开了一种节点加入对等网络的方法,所述方法包括:加入节点从接纳节点获取对等网的路由信息,构建本地路由表,标记自身为数据迁移状态,并通知所述接纳节点标记所述加入节点为数据迁移状态;所述加入节点通知所述本地路由表中的对等节点自身已加入对等网;所述接纳节点向所述加入节点迁移数据,并在数据迁移完成后,在自身标记所述加入节点为正常状态,通知所述加入节点标记所述加入节点自身为正常状态。本发明还公开了一种实现节点加入对等网络的系统,使得新节点能够及时提供服务,及时降低其他对等节点的负荷,并且能够避免对网络数据传输造成冲击,还能确保了数据的一致性。

Description

一种节点加入对等网络的方法及系统 技术领域
本发明涉及对等网络技术, 尤其涉及一种节点加入对等网络的方法及 系统。 背景技术
点对点 (P2P, Peer-to-Peer )技术, 又称对等互联网络技术, 该技术能 够将网络上各节点平等的互联起来组成对等网络, 在对等网络中, 每个主 机节点即充当客户端又充当服务器。 P2P技术使得用户节点之间可以建立对 等连接, 进行存储资源、 计算资源、 网络资源等资源的共享和交换。 目前, 由于 P2P技术具有去中心化、 易规模化的优点, 在互联网上的许多技术领 域中得到了广泛应用。 因特网工程工作组 ( IETF , Internet Engineering Task Force ) 的 P2P会话初始协议 ( SIP, Session Initiation Protocol )工作组定义 了首个针对 P2P技术的资源定位与发现( RELOAD, Resource Location And Discovery )协议。
在 P2P 网络, 尤其是结构化对等网络中, 基于一定的规则如分布式哈 希算法(DHT ), 将数据资源均勾的存储在各个对等节点中, 通过这种一致 性哈希算法及相应的数据备份机制, P2P网络可以实现负载均衡、数据安全 等存储功能。 例如, 在网络调整时, 新的对等节点加入 /离开时, P2P 网络 需要根据指定的规则将数据迁移到相应的对等节点, 使网络负载重新达到 均衡。 现有技术, 如基于 Chord算法的 RELOAD协议中, 对等节点加入对 等网络的实现过程中, 加入节点在完成所有的数据迁移后, 才可以进行消 息路由及数据操作业务处理, 并向其路由表中的所有对等节点发送路由通 知, 开始接收来自其它节点的请求消息, 开始提供服务。 在某些应用中, 如 P2P网络作为专用存储网络时, 新节点加入需要迁移大量的数据, 且所 迁移的数据中可能存在部分频繁变动的数据, 这样, 在加入节点加入对等 网络的过程中, 数据迁移可能会需要较长的时间才能完成, 加入节点不能 及时提供数据服务, 从而不能及时降低其他对等节点的负荷; 并且, 长时 间的数据迁移, 还有可能会对网络数据传输造成沖击, 使网络环境恶化; 此外, 在数据迁移中, 频繁变动的数据需要重复迁移, 还可能会出现对等 网络中其他对等节点中的数据与最终迁移到加入节点中的数据不一致。 发明内容
有鉴于此, 本发明的主要目的在于提供一种节点加入对等网络的方法 及系统, 以解决现有新节点加入对等网络时不能及时提供服务、 导致网络 状况恶化、 以及数据不一致等问题。
为达到上述目的, 本发明的技术方案是这样实现的:
本发明提供了一种节点加入对等网络的方法, 所述方法包括: 加入节点从接纳节点获取对等网的路由信息, 构建本地路由表, 标记 自身为数据迁移状态, 并通知所述接纳节点标记所述加入节点为数据迁移 状态;
所述加入节点通知所述本地路由表中的对等节点自身已加入对等网; 所述接纳节点向所述加入节点迁移数据, 并在数据迁移完成后, 在自 身标记所述加入节点为正常状态, 并通知所述加入节点标记所述加入节点 自身为正常状态。
在上述方案中, 在所述加入节点通知所述本地路由表中的对等节点自 身已加入对等网之后, 所述方法还包括: 在所述加入节点为数据迁移状态 时, 所述加入节点接收数据操作请求, 并查询到本地数据库不存在所请求 操作的数据, 则从所述接纳节点获取所述数据, 并对所述数据进行处理。
在上述方案中, 所述从所述接纳节点获取所述数据, 包括: 所述加入节点向接纳节点发送数据获取请求, 请求获取所述数据; 所述接纳节点接收所述数据获取请求, 向所述接入节点返回携带有所 请求数据的数据获取响应;
所述加入节点接收所述数据获取响应, 提取所述数据并保存到本地数 据库。
在上述方案中, 在所述加入节点通知所述本地路由表中的对等节点自 身已加入对等网之后, 所述方法还包括:
在所述加入节点为数据迁移状态时, 所述加入节点接收数据操作请求, 并查询到本地数据库不存在所述数据操作请求中的数据, 则将所接收到的 数据操作请求转发给接纳节点;
所述接纳节点接收所述数据操作请求, 对数据进行处理, 并将处理后 的数据迁移到所述加入节点。
在上述方案中, 在所述加入节点通知所述本地路由表中的对等节点自 身已加入对等网之后, 所述方法还包括:
在所述加入节点为数据迁移状态时, 所述接纳节点接收数据操作请求, 并检测到所述数据操作请求由所述加入节点负责处理、 且所请求操作的数 据已迁移到所述加入节点, 则将所接收到的数据操作请求转发给所述加入 节点, 由所述加入节点进行数据处理。
在上述方案中, 在所述加入节点通知所述本地路由表中的对等节点自 身已加入对等网之后, 所述方法还包括:
在所述加入节点为数据迁移状态时, 所述接纳节点接收数据操作请求, 并检测到所述数据操作请求由所述加入节点负责处理、 且所请求操作的数 据未迁移到所述加入节点, 则对所请求操作的数据进行处理, 并将所述数 据迁移到所述加入节点, 或者, 将所请求操作的数据迁移到加入节点, 由 所述加入节点对所述数据进行处理。 在上述方案中, 所述接纳节点向所述加入节点迁移数据, 在数据迁移 完成后, 所述方法还包括: 在完成一个数据的迁移后, 所述接纳节点在自 身标记所述数据的状态为已迁移。
在上述方案中, 所述接纳节点向所述加入节点迁移数据, 包括: 所述接纳节点向所述加入节点发送携带有需迁移数据的存储数据请 求, 所述加入节点接收所述存储数据请求, 从所述存储数据请求中提取所 述需迁移的数据保存到本地数据库, 并向所述接纳节点返回存储数据响应, 完成所述需迁移数据的迁移。
本发明还提供了一种实现节点加入对等网络的系统, 所述系统包括: 待加入对等网络的加入节点、 和所述对等网络的接纳节点, 其中,
加入节点, 用于从所述接纳节点获取对等网的路由信息, 构建本地路 由表, 标记自身为数据迁移状态, 通知所述接纳节点标记所述加入节点为 数据迁移状态, 通知所构建本地路由表中的对等节点自身已加入对等网, 并向所述对等节点提供服务; 在接收到所述接纳节点的通知后, 标记自身 为正常状态;
接入节点, 用于在接收到所述加入节点的通知后, 在自身标记所述加 入节点为数据迁移状态, 向所述加入节点迁移数据, 并在数据迁移完成后, 在自身标记所述加入节点为正常状态, 通知所述加入节点标记所述加入节 点自身为正常状态。
在上述方案中, 所述加入节点, 还用于在自身为数据迁移状态时, 接 收数据操作请求并查询到本地数据库不存在所请求操作的数据, 则从所述 接纳节点获取所述数据, 并对所述数据进行处理, 或者, 将所接收到的数 据操作请求转发给接纳节点; 所述接纳节点, 还用于接收所述加入节点转 发的数据操作请求, 对数据进行处理, 并将处理后的数据迁移到所述加入 节点 在上述方案中, 所述加入节点, 还用于向所述接纳节点发送数据获取 请求, 请求获取所述数据; 并接收所述接纳节点返回的数据获取响应, 提 取所述数据并保存到本地数据库; 所述接纳节点, 还用于接收所述加入节 点发送的数据获取请求, 并向所述接入节点返回携带有所请求数据的数据 获取响应。
在上述方案中, 所述接纳节点, 还用于在所述加入节点为数据迁移状 态时, 接收数据操作请求并检测到所述数据操作请求由所述加入节点负责 处理、 且所请求操作的数据已迁移到所述加入节点, 则将所接收到的数据 操作请求转发给所述加入节点, 由所述加入节点进行数据处理。
在上述方案中, 所述接纳节点, 还用于在所述加入节点为数据迁移状 态时, 接收数据操作请求并检测到所述数据操作请求由所述加入节点负责 处理、 且所请求操作的数据未迁移到所述加入节点, 则对所请求操作的数 据进行处理,, 并将所述数据迁移到所述加入节点, 或者, 将所请求操作的 数据迁移到加入节点, 由所述加入节点对所述数据进行处理。
在上述方案中, 所述接纳节点, 还用于在完成一个数据的迁移后, 在 自身标记所述数据的状态为已迁移。
在上述方案中, 所述接纳节点, 还用于向所述加入节点发送携带有需 迁移数据的存储数据请求; 所述加入节点, 还用于接收所述接纳节点发送 的存储数据请求, 从所述存储数据请求中提取需迁移的数据保存到本地数 据库, 并向所述接纳节点返回存储数据响应。
本发明所提供的节点加入对等网络的方法及系统, 加入节点在构建本 地路由表后, 通知本地路由表中的对等节点自身已加入对等网, 并向所述 对等节点提供服务, 之后, 所述接纳节点向所述加入节点迁移数据, 使得 新节点加入对等网络后, 能够及时提供服务, 从而及时降低其他对等节点 的负荷, 并且能够避免对网络数据传输造成沖击。 此外, 在数据迁移过程中, 加入节点能够进行业务操作, 从而保证最 终迁移到加入节点中的数据与当前对等网络中的数据一致, 确保了数据的 一致性。 附图说明
图 1为本发明中节点加入对等网络方法的实现流程图;
图 2为本发明实施例一中节点加入对等网过程的实现示意图; 图 3 为本发明实施例二中数据迁移过程中加入节点执行数据操作的过 程示意图;
图 4为本发明实施例三中数据迁移过程中加入节点执行数据操作的过 程示意图;
图 5 为本发明实施例四中数据迁移过程中接纳节点执行数据操作的过 程示意图;
图 6为本发明实施例五中数据迁移过程中接纳节点执行数据操作的过 程示意图;
图 7为本发明实施例六中数据迁移过程中接纳节点执行数据操作的过 程示意图。 具体实施方式
本发明的基本思想是: 加入节点首先完成本地路由表构建并启动相关 业务服务, 并且加入节点标记自身为数据迁移状态、 接纳节点在自身标记 所述加入节点处于数据迁移状态, 同时加入节点向当前网络的其他网络节 点发布路由更新通知, 宣告自身能够提供业务操作服务; 之后, 加入节点 与接纳节点之间进行数据迁移, 在数据迁移过程中, 其他对等节点根据当 前对等网路由机制将操作请求消息路由到所述加入节点或接纳节点, 所述 加入节点或接纳节点根据需操作数据的状态执行相应的操作, 在数据迁移 完成后, 所述加入节点及接纳节点均标记所述加入节点为正常状态, 如此, 新节点加入 P2P网络后能够尽快的提供服务, 并且在数据迁移过程中不影 响业务操作和数据的一致性。
本发明的节点加入对等网络的方法, 参照图 1 所示, 主要可以包括以 下步驟:
步驟 101 : 加入节点从接纳节点获取对等网的路由信息,构建本地路由 表, 标记自身为数据迁移状态, 并通知所述接纳节点标记所述加入节点为 数据迁移状态;
步驟 102:所述加入节点通知所述本地路由表中的对等节点自身已加入 对等网;
这里, 在通知各对等节点自身已加入对等网之后, 所述加入节点便可 以开始向本地路由表中的对等节点提供路由、 和 /或数据操作服务。
步驟 103: 所述接纳节点向所述加入节点迁移数据, 并在数据迁移完成 后, 在自身标记所述加入节点为正常状态, 并通知所述加入节点标记所述 加入节点自身为正常状态。
具体地, 所述接纳节点向所述加入节点迁移数据, 包括: 所述接纳节 点向所述加入节点发送携带有需迁移数据的存储数据请求, 所述加入节点 接收到所述存储数据请求后, 从所述存储数据请求中提取需迁移的数据保 存到本地数据库, 并向所述接纳节点返回存储数据响应, 完成所述需迁移 数据的迁移。
在所述加入节点通知所述本地路由表中的对等节点自身已加入对等网 之后, 所述方法还包括: 在所述加入节点为数据迁移状态时, 所述加入节 点接收数据操作请求, 查询本地数据库不存在请求操作的数据, 则从所述 接纳节点获取所述数据, 并对所述数据进行处理。
其中, 所述从所述接纳节点获取所述数据, 包括: 所述加入节点向接 纳节点发送数据获取请求, 请求获取所述数据; 所述接纳节点接收所述数 据获取请求, 向所述接入节点返回携带有所请求数据的数据获取响应; 所 述加入节点接收所述数据获取响应, 提取所述数据并保存到本地数据库。
在所述加入节点通知上述本地路由表中的对等节点自身已加入对等网 之后, 所述方法还包括: 在所述加入节点为数据迁移状态时, 所述加入节 点接收数据操作请求, 并查询本地数据库不存在所述数据操作请求中的数 据, 则将所接收到的数据操作请求转发给接纳节点; 所述接纳节点接收所 述数据操作请求, 对数据进行处理, 并将处理后的数据迁移到所述加入节 点。
在所述加入节点通知所述本地路由表中的对等节点自身已加入对等网 之后, 所述方法还包括: 在所述加入节点为数据迁移状态时, 所述接纳节 点接收数据操作请求, 并检测到所述数据操作请求由所述加入节点负责处 理、 且所请求操作的数据已迁移到所述加入节点, 则将所接收到的数据操 作请求转发给所述加入节点, 由所述加入节点进行数据处理。
在所述加入节点通知上述本地路由表中的对等节点自身已加入对等网 之后, 所述方法还包括: 在所述加入节点为数据迁移状态时, 所述接纳节 点接收数据操作请求, 并检测到所述数据操作请求由所述加入节点负责处 理、 且所请求操作的数据未迁移到所述加入节点, 则对所请求操作的数据 进行处理, 并将所述数据迁移到所述加入节点, 或者, 将所请求操作的数 据迁移到加入节点, 由所述加入节点对所述数据进行处理。
其中, 所述接纳节点向所述加入节点迁移数据, 在数据迁移完成后, 所述方法还包括: 在完成一个数据的迁移后, 所述接纳节点在自身标记所 述数据的状态为已迁移。
相应的, 本发明还提供了一种实现节点加入对等网络的系统, 所述系 统主要包括: 待加入对等网络的加入节点、 和所述对等网络的接纳节点, 其中, 加入节点, 用于从所述接纳节点获取对等网的路由信息, 构建本地 路由表, 标记自身为数据迁移状态, 通知所述接纳节点标记所述加入节点 为数据迁移状态, 通知所构建本地路由表中的对等节点自身已加入对等网, 并向所述对等节点提供服务; 在接收到所述接纳节点的通知后, 标记自身 为正常状态; 接入节点, 用于在接收到所述加入节点的通知后, 在自身标 记所述加入节点为数据迁移状态, 向所述加入节点迁移数据, 并在数据迁 移完成后, 在自身标记所述加入节点为正常状态, 通知所述加入节点标记 所述加入节点自身为正常状态。
具体地, 所述接纳节点, 还用于向所述加入节点发送携带有需迁移数 据的存储数据请求; 所述加入节点, 还用于接收所述接纳节点发送的存储 数据请求, 从所述存储数据请求中提取需迁移的数据保存到本地数据库, 并向所述接纳节点返回存储数据响应。
其中, 所述加入节点, 还用于在自身为数据迁移状态时, 接收数据操 作请求并查询本地数据库不存在所请求操作的数据, 则从所述接纳节点获 取所述数据, 并对所述数据进行处理, 或者, 将所接收到的数据操作请求 转发给接纳节点; 所述接纳节点, 还用于接收所述加入节点转发的数据操 作请求, 对数据进行处理, 并将处理后的数据迁移到所述加入节点。
这里, 所述加入节点还用于向所述接纳节点发送数据获取请求, 请求 获取所述数据; 并接收所述接纳节点返回的数据获取响应, 提取所述数据 并保存到本地数据库; 所述接纳节点, 还用于接收所述加入节点发送的数 据获取请求, 并向所述接入节点返回携带有所请求数据的数据获取响应。
其中, 所述接纳节点, 还用于在所述加入节点为数据迁移状态时, 接 收数据操作请求并检测到所述数据操作请求由所述加入节点负责处理、 且 所请求操作的数据已迁移到所述加入节点, 则将所接收到的数据操作请求 转发给所述加入节点, 由所述加入节点进行数据处理。 其中, 所述接纳节点, 还用于在所述加入节点为数据迁移状态时, 接 收数据操作请求并检测到所述数据操作请求由所述加入节点负责处理、 且 所请求操作的数据未迁移到所述加入节点, 则对所请求操作的数据进行处 理, 并将所述数据迁移到所述加入节点, 或者, 将所请求操作的数据迁移 到加入节点, 由所述加入节点对所述数据进行处理。
其中, 所述接纳节点, 还可以用于在完成一个数据的迁移后, 在自身 标记所述数据的状态为已迁移。
本发明中, 数据的操作处理具体可以是数据的读取、 写入、 更新等。 下面结合附图及具体实施例对本发明进行详细说明。
实施例一
本实施例中, 加入节点首先向引导节点发送网络接入请求, 获取对等 网络的配置信息, 加入节点根据对等网络的配置信息与接纳节点之间建立 连接, 并发送加入对等网请求到接纳节点, 在接纳节点的协助下完成本地 路由表的构建, 并标识自身为数据迁移状态, 接入对等网; 之后, 加入节 点通知其他对等节点所述加入节点能够开始提供业务服务, 同时接纳节点 与加入节点之间进行数据迁移, 在数据迁移完成后, 加入节点标识自身为 正常状态, 并执行正常的路由与数据操作。
如图 2所示, 本实施例中新节点加入对等网络的流程, 具体步驟如下:
5201 , 加入节点向对等网的引导节点发送网络接入请求, 请求获取对 等网的配置信息;
这里, 引导节点用于引导新节点加入对等网络, 使得新加入的节点能 够获取到对等网的配置信息。
5202 , 加入节点接收引导节点返回的网络接入响应, 从所述网络接入 响应中提取到对等网的配置信息;
这里, 网络接入响应中会携带对等网的配置信息, 该配置信息包括对 等网的路由机制、 协议、 算法、 安全、 以及所支持的基本业务等信息。
S203 , 加入节点与接纳节点之间建立连接;
这里, 加入节点与接纳节点建立网络连接时, 可以经过其他节点来实 现, 例如, 加入节点发送连接请求到分配的接入节点上, 再由该接入节点 将所述连接请求路由到接纳节点上, 建立加入节点与接纳节点之间的连接。
这里, 接纳节点用于向所述加入节点提供加入对等网的服务, 实际应 用中, 可以根据对等网的路由机制、 协议、 算法、 安全等信息, 来从对等 网中各对等节点中选出接纳节点。
S204-205 ,加入节点向接纳节点发送加入对等网请求,接纳节点向加入 节点返回加入对等网响应;
5206, 接纳节点向加入节点发送路由更新请求, 向加入节点推送路由 信息;
5207, 加入节点接收接纳节点发送的路由更新请求, 从所述路由更新 请求中获取到接纳节点推送的路由信息, 根据接纳节点推送的路由信息, 构建本地路由表, 并向接纳节点返回更新路由响应;
5208 , 加入节点标记自身为数据迁移状态, 并向接纳节点发送路由更 新请求, 通知所述接纳节点所述加入节点已完成路由表构建, 所述接纳节 点接收所述路由更新请求, 在自身标记所述加入节点为数据迁移状态, 并 向所述加入节点确认所述路由更新请求。
这里, 接纳节点可以通过向接纳节点发送确认消息, 来向加入节点确 认已接收到所述更新路由请求。
5209, 根据所构建的本地路由表, 加入节点向相关的所有对等节点发 送路由更新请求, 通知所述对等节点所述加入节点已完成对等网加入, 能 够提供路由及数据操作服务;
S210-211 ,接纳节点向加入节点迁移数据,所迁移数据的范围由当前对 等网所采用的 P2P算法决定;
具体地, 对于要迁移的数据 X来说, 接纳节点向加入节点发送存储数 据 X请求, 该存储数据 X请求中携带所述要迁移的数据 X, 加入节点接收 所述存储数据 X请求, 向接纳节点返回存储数据 X响应, 并从所述存储数 据 X请求中提取出数据 X进行存储。
这里, 接纳节点与加入节点之间上述存储数据操作可以分多次进行, 即可以逐条存储所有需要迁移的数据, 也可以一次迁移多条数据。
S212 , 在所有待迁移的数据均已迁移完成后, 接纳节点在自身标记所 述加入节点为正常状态, 并向加入节点发送更新路由请求, 通知所述加入 节点所述接纳节点已完成数据迁移, 加入节点接收到所述更新路由请求后, 标记自身为正常状态, 并向所述接纳节点确认所述更新路由通知请求。
这里, 加入节点可以通过向接纳节点发送确认消息, 来向接纳节点确 认已接收到所述更新路由请求。
实施例二
在数据迁移过程中, 在加入节点接收到数据 X的操作请求时, 加入节 点需要根据自身的数据状态执行相应的数据操作, 具体地, 如果加入节点 本地已存在操作对象, 如数据 X, 则直接执行相应的数据操作, 如果加入 节点本地不存在操作对象, 即加入节点本地不存在数据 X, 则需要向接纳 节点请求获取数据 X, 并根据接纳节点所返回数据 X的响应结果, 来执行 相应的数据操作。
本实施例中, 在加入节点完成对等网加入并处于数据迁移状态时, 进 行数据操作处理的过程, 如图 3所示, 具体流程如下:
5301 , 加入节点完成对等网加入, 且处于数据迁移状态;
5302 , 加入节点接收到来自请求节点的数据 X操作请求;
S303 , 加入节点检测到所述数据 X操作请求由自身负责进行处理, 查 询本地数据库不存在数据 X;
这里,如果加入节点查询本地数据库存在数据 X, 可以直接执行 S307。 实际应用中, 加入节点可以通过当前对等网的 P2P算法检测负责处理 数据 X操作请求的节点。
S304, 加入节点向接纳节点发送数据 X获取请求, 请求获取数据 X;
5305 , 接纳节点接收所述数据 X获取请求, 检测数据 X获取请求应由 加入节点负责, 并检测到所述加入节点处于数据迁移状态, 则优先将所述 数据 X通过响应消息迁移到加入节点, 即将数据 X携带在数据 X获取响应 中返回给加入节点;
实际应用中, 接纳节点可以通过当前对等网的 P2P算法检测负责处理 数据 X操作请求的节点。
5306, 加入节点接收所述获取数据 X响应, 提取数据 X, 获取到数据 X, 并根据所述获取数据 X响应, 执行数据 X的操作处理, 并将得到的数 据 X操作结果保存在本地数据库中;
例如, 所述数据 X的操作处理可以是更新, 所述数据 X操作结果可以 是更新后的数据 X。
5307, 加入节点向请求节点返回携带有数据 X操作结果的操作响应消 it 实施例三
在数据迁移过程中, 加入节点接收到数据操作请求后, 如果加入节点 本地存在请求操作的数据, 则执行相应的数据操作处理, 否则, 加入节点 向接纳节点转发数据 X操作请求, 由接纳节点执行数据操作处理并返回数 据操作结果, 并且, 稍后接纳节点将数据 X迁移到加入节点。
本实施例中, 在加入节点完成对等网加入并处于数据迁移状态时, 进 行数据操作处理的过程, 如图 4所示, 具体流程如下: S401-402 , 与 S301-302完全相同;
S403, 加入节点检测到所述数据 X操作请求由本节点负责进行处理, 并查询到本地数据库不存在数据 X;
这里, 如果加入节点查询本地数据库, 发现本地数据库存在数据 X, 则直接跳到 S406。
5404 , 加入节点将所述数据 X操作请求转发给接纳节点;
5405 , 接纳节点接收到所述数据 X操作请求, 检查该数据 X操作请求 应由加入节点进行处理, 并检测到加入节点处于数据迁移状态, 则接纳节 点在本地对数据 X进行处理, 并向加入节点返回携带有数据 X操作结果的 数据 X操作响应;
这里, 接纳节点还将数据 X的操作结果保存到本地。
5406 , 加入节点接收所述数据 X操作响应, 并将该数据 X操作响应转 发给请求节点;
S407-408 , 加入节点向接纳节点发送数据 X存储请求, 请求迁移数据 X, 接纳节点向加入节点返回携带有数据 X的数据 X存储响应, 加入节点 接收到该数据 X存储响应后, 提取数据 X并保存, 完成数据 X的迁移。
这里, 接纳节点向加入节点迁移数据 X可以在步驟 S405后立即进行, 也可以按照来的数据迁移顺序稍后进行。
实施例四
在数据迁移过程中, 接纳节点收到数据操作请求时, 如果接纳节点检 测到所请求操作的数据项应由加入节点进行处理, 并检测到加入节点处于 数据迁移状态、 且所请求操作的数据尚未完成迁移, 则接纳节点可以优先 将所请求操作的数据迁移到加入节点, 再将所述数据操作请求转发到加入 节点, 由加入节点执行相应的数据操作, 得到数据操作结果。
本实施例中, 在加入节点完成对等网加入并处于数据迁移状态时, 进 行数据操作处理的过程, 如图 5所示, 具体流程如下:
5501 ,接纳节点标记加入节点已完成对等网加入且处于数据迁移状态;
5502 , 接纳节点接收请求节点发送的数据 X操作请求;
5503 , 接纳节点检测到数据 X应由加入节点进行处理, 而数据 X尚未 迁移到加入节点, 保存在本地数据库;
这里, 在数据迁移过程中, 在一个数据迁移到加入节点后, 接纳节点 会在自身标记该数据已迁移, 如此, 接纳节点可以根据从自身查询数据的 标记状态, 例如, 本步驟中, 接纳节点查询数据 X是否标记为已迁移, 如 果是, 则数据 X已迁移, 否则, 数据 X尚未迁移。
S504-505 , 接纳节点将数据 X迁移到加入节点;
具体地, 接纳节点向加入节点发送携带有数据 X的数据 X存储请求, 加入节点接收所述数据 X存储请求, 提取数据 X并保存到本地数据库, 并 向接纳节点返回数据 X存储响应, 接纳节点接收所述数据 X存储响应, 并 在自身标记所述数据 X已迁移到加入节点, 数据 X的迁移完成。
S506 , 接纳节点在完成数据 X的迁移后, 将所接收到的数据 X操作请 求转发给加入节点;
S507, 加入节点接收所述数据 X操作请求, 从本地数据库查询到数据 X, 并对数据 X执行相应的操作处理, 得到数据 X操作结果, 并向接纳节 点返回携带有所述数据 X操作结果的数据 X操作响应;
S508 , 接纳节点接收所述数据 X操作响应并转发给请求节点, 数据 X 的操作完成。
实施例五
在数据迁移过程中, 接纳节点接收数据操作请求后, 检查请求操作的 数据应由加入节点负责进行处理, 而加入节点目前处于数据迁移状态, 且 请求操作的数据尚未完成迁移, 则接纳节点可以代替加入节点, 在本地完 成数据 X操作, 并在稍后将经过操作处理后的数据 X迁移到加入节点。 本实施例中, 在加入节点完成对等网加入并处于数据迁移状态时, 进 行数据操作处理的过程, 如图 6所示, 具体流程如下:
S601-603 , 与 S501-503完全相同;
S604, 接纳节点代替加入节点, 在本地完成数据 X的操作处理, 得到 数据 X操作结果, 并将所述数据 X操作结果保存到本地数据库;
S605 , 接纳节点向请求节点返回包含有所述数据 X操作结果的数据 X 操作响应;
S606-607 , 接纳节点将经过操作处理后的数据 X迁移到加入节点。 具体地, 接纳节点向加入节点发送携带有经过操作处理后数据 X的数 据 X存储请求, 加入节点接收所述数据 X存储请求, 提取所述数据 X保存 到本地数据库, 并向接纳节点返回数据 X存储响应, 接纳节点接收所述数 据 X存储响应, 并在自身标记所述数据 X已迁移到加入节点, 完成数据 X 的迁移。
这里,接纳节点向加入节点迁移数据 X还可以在步驟 605后立即进行, 也可以按照当前对等网络所采用 P2P算法中的数据迁移顺序, 进行数据 X 的迁移。
实施例六
在数据迁移过程中, 接纳节点接收到数据操作请求后, 如果接纳节点 检测到所请求操作的数据应由加入节点负责进行处理, 而加入节点处于数 据迁移状态, 且请求操作的数据已迁移到加入节点, 则接纳节点可以直接 将数据操作请求转发给加入节点, 由加入节点进行后续处理。
本实施例中, 在加入节点完成对等网加入并处于数据迁移状态时, 进 行数据操作处理的过程, 如图 7所示, 具体流程如下:
S701-702 , 与 S501-502完全相同; S703, 接纳节点检测到数据 X应由加入节点负责进行处理, 且数据 X 已迁移到加入节点;
5704, 接纳节点将所述数据 X操作请求直接转发给加入节点;
5705 ,加入节点接收所述数据 X操作请求,完成对数据 X的操作处理, 得到数据 X操作结果, 并向接纳节点返回携带有所述数据 X操作结果的数 据 X操作响应;
5706, 接纳节点接收所述数据 X操作响应并转发给请求节点。
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。

Claims

权利要求书
1、 一种节点加入对等网络的方法, 其特征在于, 所述方法包括: 加入节点从接纳节点获取对等网的路由信息, 构建本地路由表, 标记 自身为数据迁移状态, 并通知所述接纳节点标记所述加入节点为数据迁移 状态;
所述加入节点通知所述本地路由表中的对等节点自身已加入对等网; 所述接纳节点向所述加入节点迁移数据, 并在数据迁移完成后, 在自 身标记所述加入节点为正常状态, 并通知所述加入节点标记所述加入节点 自身为正常状态。
2、 根据权利要求 1所述节点加入对等网络的方法, 其特征在于, 在所 述加入节点通知所述本地路由表中的对等节点自身已加入对等网之后, 所 述方法还包括:
在所述加入节点为数据迁移状态时, 所述加入节点接收数据操作请求, 查询到本地数据库不存在请求操作的数据, 则从所述接纳节点获取所述数 据, 并对所述数据进行处理。
3、 根据权利要求 2所述节点加入对等网络的方法, 其特征在于, 所述 从所述接纳节点获取所述数据, 包括:
所述加入节点向接纳节点发送数据获取请求, 请求获取所述数据; 所述接纳节点接收所述数据获取请求, 向所述接入节点返回携带有所 请求数据的数据获取响应;
所述加入节点接收所述数据获取响应, 提取所述数据并保存到本地数 据库。
4、 根据权利要求 1所述节点加入对等网络的方法, 其特征在于, 在所 述加入节点通知所述本地路由表中的对等节点自身已加入对等网之后, 所 述方法还包括: 在所述加入节点为数据迁移状态时, 所述加入节点接收数据操作请求, 并查询到本地数据库不存在所述数据操作请求中的数据, 则将所接收到的 数据操作请求转发给接纳节点;
所述接纳节点接收所述数据操作请求, 对数据进行处理, 并将处理后 的数据迁移到所述加入节点。
5、 根据权利要求 1所述节点加入对等网络的方法, 其特征在于, 在所 述加入节点通知所述本地路由表中的对等节点自身已加入对等网之后 , 所 述方法还包括:
在所述加入节点为数据迁移状态时, 所述接纳节点接收数据操作请求, 并检测到所述数据操作请求由所述加入节点负责处理、 且所请求操作的数 据已迁移到所述加入节点, 则将所接收到的数据操作请求转发给所述加入 节点, 由所述加入节点进行数据处理。
6、 根据权利要求 1所述节点加入对等网络的方法, 其特征在于, 在所 述加入节点通知所述本地路由表中的对等节点自身已加入对等网之后, 所 述方法还包括:
在所述加入节点为数据迁移状态时, 所述接纳节点接收数据操作请求, 并检测到所述数据操作请求由所述加入节点负责处理、 且所请求操作的数 据未迁移到所述加入节点, 则对所请求操作的数据进行处理, 并将所述数 据迁移到所述加入节点, 或者, 将所请求操作的数据迁移到加入节点, 由 所述加入节点对所述数据进行处理。
7、 根据权利要求 1所述节点加入对等网络的方法, 其特征在于, 所述 接纳节点向所述加入节点迁移数据, 在数据迁移完成后, 所述方法包括: 在完成一个数据的迁移后, 所述接纳节点在自身标记所述数据的状态 为已迁移。
8、 根据权利要求 1至 7任一项所述节点加入对等网络的方法, 其特征 在于, 所述接纳节点向所述加入节点迁移数据, 包括:
所述接纳节点向所述加入节点发送携带有需迁移数据的存储数据请 求, 所述加入节点接收所述存储数据请求, 从所述存储数据请求中提取需 迁移的数据保存到本地数据库, 并向所述接纳节点返回存储数据响应。
9、 一种实现节点加入对等网络的系统, 其特征在于, 所述系统包括: 待加入对等网络的加入节点、 和所述对等网络的接纳节点, 其中,
加入节点, 用于从所述接纳节点获取对等网的路由信息, 构建本地路 由表, 标记自身为数据迁移状态, 通知所述接纳节点标记所述加入节点为 数据迁移状态, 通知所述本地路由表中的对等节点自身已加入对等网, 并 向所述对等节点提供服务; 在接收到所述接纳节点的通知后, 标记自身为 正常状态;
接入节点, 用于在接收到所述加入节点的通知后, 在自身标记所述加 入节点为数据迁移状态, 向所述加入节点迁移数据, 并在数据迁移完成后, 在自身标记所述加入节点为正常状态, 通知所述加入节点标记所述加入节 点自身为正常状态。
10、 根据权利要求 9所述实现节点加入对等网络的系统, 其特征在于, 所述加入节点, 还用于在自身为数据迁移状态时, 接收数据操作请求 并查询到本地数据库不存在所请求操作的数据, 则从所述接纳节点获取所 述数据, 并对所述数据进行处理, 或者, 将所接收到的数据操作请求转发 给接纳节点;
所述接纳节点, 还用于接收所述加入节点转发的数据操作请求, 对数 据进行处理, 并将处理后的数据迁移到所述加入节点。
11、根据权利要求 10所述实现节点加入对等网络的系统,其特征在于, 所述加入节点, 还用于向所述接纳节点发送数据获取请求, 请求获取 所述数据; 并接收所述接纳节点返回的数据获取响应, 提取所述数据并保 存到本地数据库;
所述接纳节点, 还用于接收所述加入节点发送的数据获取请求, 并向 所述接入节点返回携带有所请求数据的数据获取响应。
12、 根据权利要求 9所述实现节点加入对等网络的系统, 其特征在于, 所述接纳节点, 还用于在所述加入节点为数据迁移状态时, 接收数据 操作请求并检测到所述数据操作请求由所述加入节点负责处理、 且所请求 操作的数据已迁移到所述加入节点, 则将所接收到的数据操作请求转发给 所述加入节点, 由所述加入节点进行数据处理。
13、 根据权利要求 9所述实现节点加入对等网络的系统, 其特征在于, 所述接纳节点, 还用于在所述加入节点为数据迁移状态时, 接收数据 操作请求并检测到所述数据操作请求由所述加入节点负责处理、 且所请求 操作的数据未迁移到所述加入节点, 则对所请求操作的数据进行处理, 并 将所述数据迁移到所述加入节点, 或者, 将所请求操作的数据迁移到加入 节点, 由所述加入节点对所述数据进行处理。
14、 根据权利要求 9所述实现节点加入对等网络的系统, 其特征在于, 所述接纳节点, 还用于在完成一个数据的迁移后, 在自身标记所述数 据的状态为已迁移。
15、 根据权利要求 9至 14任一项所述实现节点加入对等网络的系统, 其特征在于, 所述接纳节点, 还用于向所述加入节点发送携带有需迁移数 据的存储数据请求; 所述加入节点, 还用于接收所述接纳节点发送的存储 数据请求, 从所述存储数据请求中提取需迁移的数据保存到本地数据库, 并向所述接纳节点返回存储数据响应。
PCT/CN2012/071072 2011-03-30 2012-02-13 一种节点加入对等网络的方法及系统 WO2012129988A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110078863.7A CN102724226B (zh) 2011-03-30 一种节点加入对等网络的方法及系统
CN201110078863.7 2011-03-30

Publications (1)

Publication Number Publication Date
WO2012129988A1 true WO2012129988A1 (zh) 2012-10-04

Family

ID=46929409

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/071072 WO2012129988A1 (zh) 2011-03-30 2012-02-13 一种节点加入对等网络的方法及系统

Country Status (1)

Country Link
WO (1) WO2012129988A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1815981A (zh) * 2006-03-10 2006-08-09 清华大学 对等网络中全局节点维护方法
CN101159966A (zh) * 2007-11-14 2008-04-09 北京邮电大学 在移动环境下的对等网络拓扑匹配方法
CN101179466A (zh) * 2007-10-15 2008-05-14 北京交通大学 一种基于集中服务的分布式对等网络的实现方法及系统
CN101227292A (zh) * 2007-01-18 2008-07-23 华为技术有限公司 服务器、对等网络系统、路由与转移资源键值的方法
CN101299893A (zh) * 2008-06-03 2008-11-05 中兴通讯股份有限公司 一种自动交换光网络中基于状态转换的迁移方法
US20080301233A1 (en) * 2006-02-17 2008-12-04 Nhn Corporation P2p file transmission system and method
CN101340457A (zh) * 2008-08-29 2009-01-07 北京邮电大学 一种不依赖于中心服务器的对等网络启动方法和系统

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080301233A1 (en) * 2006-02-17 2008-12-04 Nhn Corporation P2p file transmission system and method
CN1815981A (zh) * 2006-03-10 2006-08-09 清华大学 对等网络中全局节点维护方法
CN101227292A (zh) * 2007-01-18 2008-07-23 华为技术有限公司 服务器、对等网络系统、路由与转移资源键值的方法
CN101179466A (zh) * 2007-10-15 2008-05-14 北京交通大学 一种基于集中服务的分布式对等网络的实现方法及系统
CN101159966A (zh) * 2007-11-14 2008-04-09 北京邮电大学 在移动环境下的对等网络拓扑匹配方法
CN101299893A (zh) * 2008-06-03 2008-11-05 中兴通讯股份有限公司 一种自动交换光网络中基于状态转换的迁移方法
CN101340457A (zh) * 2008-08-29 2009-01-07 北京邮电大学 一种不依赖于中心服务器的对等网络启动方法和系统

Also Published As

Publication number Publication date
CN102724226A (zh) 2012-10-10

Similar Documents

Publication Publication Date Title
WO2021249490A1 (zh) 区块链网络中的通信方法、业务数据传输方法
CN100531098C (zh) 一种对等网络系统及重叠网间节点的互通方法
JP5741150B2 (ja) 中継装置、中継プログラム、及び中継方法
JP5684110B2 (ja) ルーティングテーブルを維持する方法およびオーバレイネットワーク内で使用するためのノード
TWI584194B (zh) 在一服務導向架構(soa)網路中尋求服務之技術
KR102158654B1 (ko) 자원 구독 방법, 자원 구독 장치, 및 자원 구독 시스템
TW200803303A (en) Inter-proximity communication within a rendezvous federation
TW200818811A (en) Inter-proximity communication within a rendezvous federation
EP2234332A1 (en) Method, device and system for diagnosing whether nodes are abnormal or not in p2p network
TWI599201B (zh) 網路系統及建立資料連線的方法
CN111352716B (zh) 一种基于大数据的任务请求方法、装置、系统及存储介质
WO2018040220A1 (zh) 一种数据传输方法、集中控制器、转发面设备和通信装置
JP2013542681A (ja) コンテンツ中心のネットワーク環境でグループ変更に関する情報を用いるコンテンツ共有方法及び装置
KR20140007363A (ko) 기업 네트워크 외부로부터의 사이트-인식 분산형 파일 시스템 액세스
JP4954328B2 (ja) 通信ネットワークにおけるデータ管理のための方法およびシステム
US10536368B2 (en) Network-aware routing in information centric networking
WO2008089616A1 (fr) Serveur, système réseau p2p et procédé d'acheminement et de transfert de l'affectation de la clé de ressource de ce dernier.......
JP4335907B2 (ja) ピアツーピアルックアップシステムに対するモビリティチャーン処理のための方法および装置
CN103166860A (zh) 一种p2p叠加网络数据迁移的方法和装置
JP2019533254A (ja) 情報取得
US10404659B2 (en) Optimization of resource URLs in machine-to-machine networks
US20110016226A1 (en) Methods and Apparatus for Updating Index Information While Adding and Updating Documents in a Distributed Network
CN103139076A (zh) 分布式哈希表互通网络系统、域间节点及实现方法
CN103001987B (zh) 一种数据处理方法和数据处理节点
WO2012129988A1 (zh) 一种节点加入对等网络的方法及系统

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

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

Country of ref document: EP

Kind code of ref document: A1