CN104717253A - P2P node connecting method and device - Google Patents

P2P node connecting method and device Download PDF

Info

Publication number
CN104717253A
CN104717253A CN201310687164.1A CN201310687164A CN104717253A CN 104717253 A CN104717253 A CN 104717253A CN 201310687164 A CN201310687164 A CN 201310687164A CN 104717253 A CN104717253 A CN 104717253A
Authority
CN
China
Prior art keywords
node
nodal information
predetermined number
connection
specified quantity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310687164.1A
Other languages
Chinese (zh)
Inventor
李卓
李茗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LeTV Information Technology Beijing Co Ltd
Original Assignee
LeTV Information Technology Beijing Co Ltd
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 LeTV Information Technology Beijing Co Ltd filed Critical LeTV Information Technology Beijing Co Ltd
Priority to CN201310687164.1A priority Critical patent/CN104717253A/en
Publication of CN104717253A publication Critical patent/CN104717253A/en
Pending legal-status Critical Current

Links

Classifications

    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a P2P node connecting method and device which can increase connecting speed. The P2P node connecting method comprises the steps that a local node obtains information of the first preset number of nodes capable of setting up P2P connection from a server; the first preset number is larger than an assigned maximum number of nodes which can set up P2P connection in the local node; when P2P node connection is set up on the basis of information of the assigned number of the nodes in the obtained information of the first preset number of the nodes, if the nodes failing to connect exist, P2P node connection is set up on the basis of information of other nodes except the information of the assigned number of the nodes in the obtained information of the first preset number of the nodes.

Description

A kind of P2P joint connecting method and device
Technical field
The present invention relates to computer network field, particularly relate to a kind of P2P joint connecting method and device.
Background technology
At P2P(peer-to-peer, point-to-point) in network, each node is the brother of node of equality, successfully sets up the data can sharing various ways between node that P2P connects, as video data, voice data etc.
Owing to being subject to the restriction of bandwidth; each node can set up the limited amount of the node that P2P connects; supposing that current local node can set up at most the quantity of node that P2P connects is specified quantity; in prior art when this local node sets up P2P connection; usual meeting obtains from server the nodal information that this specified quantity can set up P2P connection, sets up P2P node connect based on this specified quantity nodal information obtained.When there is the node of connection failure, local node can obtain a nodal information can set up P2P and connect from server immediately again, sets up P2P node and connects.
But, when there is the node of multiple connection failure, local node needs repeatedly to obtain nodal information from server, and not only have impact on connection speed, between local node and server, information interaction also occupies a large amount of node local resources, server process resource and networked communication resource frequently.
Summary of the invention
The embodiment of the present invention provides a kind of P2P joint connecting method and device, in order to improve connection speed.
The embodiment of the present invention provides a kind of P2P joint connecting method, comprising:
Local node obtains from server the nodal information that the first predetermined number can set up P2P connection; Described first predetermined number is greater than the specified quantity that described local node can set up at most the node that P2P connects;
When a specified quantity nodal information in the first predetermined number nodal information based on acquisition sets up the connection of P2P node, if there is the node of connection failure, then based on other nodal information beyond a specified quantity nodal information in the first predetermined number nodal information obtained, set up P2P node and connect.
The embodiment of the present invention also provides a kind of P2P nodal connection device, comprising:
Acquiring unit, obtains from server the nodal information that the first predetermined number can set up P2P connection for local node; Described first predetermined number is greater than the specified quantity that described local node can set up at most the node that P2P connects;
Linkage unit, for when a specified quantity nodal information in the first predetermined number nodal information based on acquisition sets up the connection of P2P node, if there is the node of connection failure, then based on other nodal information beyond a specified quantity nodal information in the first predetermined number nodal information obtained, set up P2P node and connect.
Beneficial effect of the present invention comprises:
In the scheme that the embodiment of the present invention provides, local node can set up the nodal information of P2P connection from server disposable acquisition first predetermined number, this first predetermined number is greater than the specified quantity that local node can set up at most the node that P2P connects, therefore, when a specified quantity nodal information during local node is based on the first predetermined number nodal information obtained sets up the connection of P2P node, even if there is the node of connection failure, P2P node can also be set up based on other nodal information to connect, without the need to again obtaining from server the nodal information can set up P2P and connect immediately, therefore, the scheme that the embodiment of the present invention provides is compared to prior art, connection speed can be improved, and the information interaction decreased between local node and server, save node local resource, server process resource and networked communication resource.
Accompanying drawing explanation
Accompanying drawing is used to provide a further understanding of the present invention, and forms a part for specification, is used from explanation the present invention, is not construed as limiting the invention with the embodiment of the present invention one.In the accompanying drawings:
The flow chart of the P2P joint connecting method that Fig. 1 provides for the embodiment of the present invention;
The detail flowchart of the P2P joint connecting method that Fig. 2 provides for the embodiment of the present invention;
The structural representation of the P2P nodal connection device that Fig. 3 provides for the embodiment of the present invention.
Embodiment
In order to provide the implementation improving connection speed, embodiments provide a kind of P2P joint connecting method and device, in conjunction with Figure of description, the preferred embodiments of the present invention are described, be to be understood that, preferred embodiment described herein, only for instruction and explanation of the present invention, is not intended to limit the present invention.And when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.
Embodiments provide a kind of P2P joint connecting method, as shown in Figure 1, comprising:
Step 101, local node obtain from server the nodal information that the first predetermined number can set up P2P connection; This first predetermined number is greater than the specified quantity that this local node can set up at most the node that P2P connects;
Step 102, when based on obtain the first predetermined number nodal information in a specified quantity nodal information set up P2P node connection time, if there is the node of connection failure, then based on other nodal information beyond a specified quantity nodal information in the first predetermined number nodal information obtained, set up P2P node and connect.
Namely in the P2P joint connecting method that the embodiment of the present invention provides, if the quantity that local node can set up at most the node that P2P connects is specified quantity, when then local node obtains from server first time the nodal information can setting up P2P connection, obtain the nodal information more than this specified quantity, then first set up P2P node based on a specified quantity nodal information in the first predetermined number nodal information obtained and connect.
For other nodal information beyond this specified quantity nodal information in the first predetermined number nodal information obtained, local node is preserved.Set up P2P node when local node based on this specified quantity nodal information to connect, when there is the node of connection failure, local node directly obtains nodal information from other nodal information preserved, and continues to set up P2P node and connects.
Local node obtains nodal information and continues to set up P2P node when connecting from other nodal information preserved, can continue to set up the connection of P2P node by random selecting nodal information in other nodal information preserved, also can choose nodal information according to the storage order of nodal information order in other nodal information preserved and continue to set up the connection of P2P node.
Visible, the P2P joint connecting method adopting the embodiment of the present invention to provide, can improve connection speed, and decrease the information interaction between local node and server, save node local resource, server process resource and networked communication resource.
In embodiments of the present invention, when local node obtains from server first time the nodal information can setting up P2P connection, obtain the first predetermined number nodal information, the first predetermined number is greater than specified quantity.When local node is less than specified quantity based on the quantity of node that the first predetermined number nodal information obtained successfully sets up P2P connection, local node obtains from server the nodal information that the second predetermined number can set up P2P connection again, continues to set up P2P connect based on the second predetermined number nodal information obtained.
Second predetermined number can be any positive integer, and preferably, this second predetermined number is greater than this specified quantity successfully sets up the quantity of the node that P2P is connected difference with this.When local node sets up the connection of P2P node based on the nodal information again obtained, if still there is the node of connection failure, also need again to obtain nodal information from server, therefore, second predetermined number is greater than this specified quantity when successfully setting up the difference of the quantity of the node that P2P is connected with this, the information interaction times between local node and server can be reduced further, improve connection speed.
Second predetermined number specifically can set based on actual conditions, and for reducing optimum configurations number of times, the second predetermined number can equal the first predetermined number, and user once sets, and can improve the experience of user.
First predetermined number specifically can be set as that local node can set up at most the specified multiple of the specified quantity of the node that P2P connects, and specified multiple is greater than 1.In embodiments of the present invention, the first predetermined number is specifically as follows the twice that local node can set up at most the specified quantity of the node that P2P connects.
Below in conjunction with accompanying drawing, with specific embodiment, the P2P joint connecting method that the embodiment of the present invention provides is described in detail.
In the present embodiment, set up nodal information list, for preserving the unnecessary nodal information that local node obtains from server.
Figure 2 shows that the detail flowchart of the P2P joint connecting method that the embodiment of the present invention provides, specifically comprise:
Step 201, local node obtain from server the nodal information that the first predetermined number can set up P2P connection.
In the present embodiment, local node can set up at most the specified quantity of the node that P2P connects is 10; First predetermined number is set to the twice of specified quantity, and namely 20.
Step 202, order according to server return node information, order is chosen a specified quantity nodal information and is set up the connection of P2P node, is stored in nodal information list by other nodal information.
Namely front 10 nodal informations returned based on server are set up P2P node and are connected, and rear 10 nodal informations returned by server are stored in nodal information list.
Step 203, judge based on a specified quantity nodal information set up P2P node connect time, whether there is the node of connection failure.
When determining to set up the connection of P2P node based on a specified quantity nodal information, when there is not the node of connection failure, show that the quantity of the node that local node successfully connects reaches specified quantity, can not connect other node again, this flow process terminates;
When determining to set up the connection of P2P node based on a specified quantity nodal information, when there is the node of connection failure, showing that the quantity of the node that local node successfully connects does not reach specified quantity, other node can also be connected, enter step 204.
Step 204, from nodal information list obtain a nodal information, set up P2P node connect.
Whenever obtaining a nodal information and set up the connection of P2P node from list, this nodal information is deleted from list.
Whether step 205, the quantity judging successfully to set up the node that P2P connects reach specified quantity.
When the quantity determining successfully to set up the node that P2P connects reaches specified quantity, this flow process terminates;
When the quantity determining successfully to set up the node that P2P connects does not reach specified quantity, enter step 206.
Whether also nodal information is there is in step 206, decision node information list.
When determining also there is nodal information in nodal information list, return step 204;
When determining there is not nodal information in nodal information list, enter step 207.
Step 207, to obtain the second predetermined number from server and can set up the nodal information that P2P connects, and stored in nodal information list.
In the present embodiment, the second predetermined number can be set to 5, different with the first predetermined number.
Namely local node obtains 5 nodal informations stored in nodal information list from server at every turn.
In other embodiments of the invention, the second predetermined number also can be set to identical with the first predetermined number, or the first predetermined number and the second predetermined number are merged into a parameter.
Preferably, local node obtains after the second predetermined number can to set up the nodal information that P2P connects from server, the nodal information that can also comprise getting screens, specifically according to the nodal information of the nodal information of all connection failures of local node and/or all successful connections, the nodal information got can be screened.
Namely the nodal information of this connection failure and/or the nodal information of this successful connection can be deleted in the nodal information got, then by remaining nodal information stored in nodal information list.The nodal information of all connection failures and the nodal information of all successful connections, for current local node, are all invalid nodal informations, therefore, screen the nodal information got, and local node can be avoided to carry out invalid P2P node and connect.
The nodal information of the nodal information of all connection failures and/or all successful connections also can be fed back to server by local node, the nodal information that server determines to send to the set up P2P of local node to connect according to the nodal information that local node feeds back, can avoid sending invalid nodal information to local node.
Visible, the scheme adopting the embodiment of the present invention to provide, decreases the information interaction times between local node and server compared to prior art, not only saves every resource, more improve connection speed, and then can improve the experience of user.
Based on same inventive concept, according to the P2P joint connecting method that the above embodiment of the present invention provides, correspondingly, the embodiment of the present invention also provides a kind of P2P nodal connection device, as shown in Figure 3, specifically comprises:
Acquiring unit 301, obtains from server the nodal information that the first predetermined number can set up P2P connection for local node; Described first predetermined number is greater than the specified quantity that described local node can set up at most the node that P2P connects;
Linkage unit 302, for when a specified quantity nodal information in the first predetermined number nodal information based on acquisition sets up the connection of P2P node, if there is the node of connection failure, then based on other nodal information beyond a specified quantity nodal information in the first predetermined number nodal information obtained, set up P2P node and connect.
Further, acquiring unit 301, time also for being less than described specified quantity when the quantity successfully setting up the node that P2P connects based on the first predetermined number nodal information obtained, obtain from described server the nodal information that the second predetermined number can set up P2P connection;
Linkage unit 302, also connects for setting up P2P based on the second predetermined number nodal information obtained.
Preferably, this second predetermined number is greater than described specified quantity and the described difference successfully setting up the quantity of the node that P2P is connected.
Further, described second predetermined number equals described first predetermined number.
Further, described first predetermined number is specially the twice that described local node can set up at most the specified quantity of the node that P2P connects.
The function of above-mentioned each unit may correspond to the respective handling step in flow process shown in Fig. 1 or Fig. 2, does not repeat them here.
In sum, the P2P node connection scheme that the embodiment of the present invention provides, comprising: local node obtains from server the nodal information that the first predetermined number can set up P2P connection; This first predetermined number is greater than the specified quantity that this local node can set up at most the node that P2P connects; When a specified quantity nodal information in the first predetermined number nodal information based on acquisition sets up the connection of P2P node, if there is the node of connection failure, then based on other nodal information beyond a specified quantity nodal information in the first predetermined number nodal information obtained, set up P2P node and connect.The scheme adopting the embodiment of the present invention to provide, can improve the reasonability that P2P video player P2P node connects.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the flow chart of the method for the embodiment of the present invention, equipment (system) and computer program and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can being provided to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computer or other programmable data processing device produce device for realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices is provided for the step realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the embodiment of the present invention and not depart from the spirit and scope of the embodiment of the present invention.Like this, if these amendments of the embodiment of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (10)

1. a P2P joint connecting method, is characterized in that, comprising:
Local node obtains from server the nodal information that the first predetermined number can set up P2P connection; Described first predetermined number is greater than the specified quantity that described local node can set up at most the node that P2P connects;
When a specified quantity nodal information in the first predetermined number nodal information based on acquisition sets up the connection of P2P node, if there is the node of connection failure, then based on other nodal information beyond a specified quantity nodal information in the first predetermined number nodal information obtained, set up P2P node and connect.
2. the method for claim 1, is characterized in that, also comprises:
When the quantity successfully setting up the node that P2P connects based on the first predetermined number nodal information obtained is less than described specified quantity, obtain from described server the nodal information that the second predetermined number can set up P2P connection;
Set up P2P based on the second predetermined number nodal information obtained to connect.
3. method as claimed in claim 2, it is characterized in that, described second predetermined number is greater than described specified quantity and the described difference successfully setting up the quantity of the node that P2P is connected.
4. method as claimed in claim 3, it is characterized in that, described second predetermined number equals described first predetermined number.
5. the method as described in as arbitrary in claim 1-4, is characterized in that, described first predetermined number is specially the twice that described local node can set up at most the specified quantity of the node that P2P connects.
6. a P2P nodal connection device, is characterized in that, comprising:
Acquiring unit, obtains from server the nodal information that the first predetermined number can set up P2P connection for local node; Described first predetermined number is greater than the specified quantity that described local node can set up at most the node that P2P connects;
Linkage unit, for when a specified quantity nodal information in the first predetermined number nodal information based on acquisition sets up the connection of P2P node, if there is the node of connection failure, then based on other nodal information beyond a specified quantity nodal information in the first predetermined number nodal information obtained, set up P2P node and connect.
7. device as claimed in claim 6, it is characterized in that, described acquiring unit, time also for being less than described specified quantity when the quantity successfully setting up the node that P2P connects based on the first predetermined number nodal information obtained, obtain from described server the nodal information that the second predetermined number can set up P2P connection;
Described linkage unit, also connects for setting up P2P based on the second predetermined number nodal information obtained.
8. device as claimed in claim 7, it is characterized in that, described second predetermined number is greater than described specified quantity and the described difference successfully setting up the quantity of the node that P2P is connected.
9. method as claimed in claim 8, it is characterized in that, described second predetermined number equals described first predetermined number.
10. the device as described in as arbitrary in claim 6-9, is characterized in that, described first predetermined number is specially the twice that described local node can set up at most the specified quantity of the node that P2P connects.
CN201310687164.1A 2013-12-13 2013-12-13 P2P node connecting method and device Pending CN104717253A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310687164.1A CN104717253A (en) 2013-12-13 2013-12-13 P2P node connecting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310687164.1A CN104717253A (en) 2013-12-13 2013-12-13 P2P node connecting method and device

Publications (1)

Publication Number Publication Date
CN104717253A true CN104717253A (en) 2015-06-17

Family

ID=53416212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310687164.1A Pending CN104717253A (en) 2013-12-13 2013-12-13 P2P node connecting method and device

Country Status (1)

Country Link
CN (1) CN104717253A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109040787A (en) * 2018-09-05 2018-12-18 湖南华诺科技有限公司 A kind of method of distributed autonomous set-top box content distribution network
CN117135767A (en) * 2023-10-24 2023-11-28 荣耀终端有限公司 Method for connecting devices and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101150465A (en) * 2006-09-22 2008-03-26 腾讯科技(深圳)有限公司 A method for obtaining seed information and supernode and common nodes in P2P network
CN101741750A (en) * 2010-01-15 2010-06-16 中国科学院计算技术研究所 Resource downloading method in P2P (peer-to peer) and system thereof
US7761569B2 (en) * 2004-01-23 2010-07-20 Tiversa, Inc. Method for monitoring and providing information over a peer to peer network
CN103312752A (en) * 2012-03-13 2013-09-18 中国联合网络通信集团有限公司 P2P (Peer to Peer) network information distribution method, downloading node, index server and P2P network information distribution system
CN103428070A (en) * 2012-05-17 2013-12-04 阿里巴巴集团控股有限公司 Instant group messaging method, session management server and client side

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7761569B2 (en) * 2004-01-23 2010-07-20 Tiversa, Inc. Method for monitoring and providing information over a peer to peer network
CN101150465A (en) * 2006-09-22 2008-03-26 腾讯科技(深圳)有限公司 A method for obtaining seed information and supernode and common nodes in P2P network
CN101741750A (en) * 2010-01-15 2010-06-16 中国科学院计算技术研究所 Resource downloading method in P2P (peer-to peer) and system thereof
CN103312752A (en) * 2012-03-13 2013-09-18 中国联合网络通信集团有限公司 P2P (Peer to Peer) network information distribution method, downloading node, index server and P2P network information distribution system
CN103428070A (en) * 2012-05-17 2013-12-04 阿里巴巴集团控股有限公司 Instant group messaging method, session management server and client side

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109040787A (en) * 2018-09-05 2018-12-18 湖南华诺科技有限公司 A kind of method of distributed autonomous set-top box content distribution network
CN117135767A (en) * 2023-10-24 2023-11-28 荣耀终端有限公司 Method for connecting devices and electronic device
CN117135767B (en) * 2023-10-24 2024-04-12 荣耀终端有限公司 Method for connecting devices and electronic device

Similar Documents

Publication Publication Date Title
US11240745B2 (en) Network slice instance processing method and apparatus, and system
CN102377686B (en) Message subscription system, method and device
KR102376713B1 (en) Composite partition functions
US10313452B2 (en) Migrating a chat message service provided by a chat server to a new chat server
CN106445473B (en) container deployment method and device
CN104219316A (en) Method and device for processing call request in distributed system
CN108696911B (en) Method and device for selecting data transmission mode of Internet of things
CN109617807A (en) Route information update method, device, gateway and storage medium
CN103312752B (en) Point to point network information dispensing method, download node, index server and system
CN108632063B (en) Method, device and system for managing network slice instances
JP2016527741A (en) Automatic data ring discovery and configuration
WO2021184177A1 (en) Master node selection method and apparatus, electronic device, and storage medium
CN113835825A (en) Dynamic adjustment method and device of virtual service host, server and storage medium
CN114124948A (en) High-availability method, device, equipment and readable medium for cloud component
CN105430028A (en) Service calling method, service providing method, and node
CN104506330A (en) Message synchronizing method and system
CN102611734A (en) Mirroring instance starting method and device based on cloud computing
CN104717253A (en) P2P node connecting method and device
CN113055457B (en) Access control and data forwarding method and device, electronic equipment and storage medium
CN111147585B (en) Equipment upgrading method, device, storage medium and system
CN109391545B (en) System and method for discovering inter-domain link
CN102833158B (en) Network data sending method and device and network data system
CN104104701A (en) Online service configuration updating method and system
US20180069768A1 (en) Method and apparatus for establishing interface between vnfms, and system
CN109542981B (en) Data synchronization system and method, electronic device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150617