CN102333116A - P2P (peer-to-peer) network building method and data positioning method - Google Patents

P2P (peer-to-peer) network building method and data positioning method Download PDF

Info

Publication number
CN102333116A
CN102333116A CN201110280071A CN201110280071A CN102333116A CN 102333116 A CN102333116 A CN 102333116A CN 201110280071 A CN201110280071 A CN 201110280071A CN 201110280071 A CN201110280071 A CN 201110280071A CN 102333116 A CN102333116 A CN 102333116A
Authority
CN
China
Prior art keywords
node
ring
subring
descendant
level
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.)
Granted
Application number
CN201110280071A
Other languages
Chinese (zh)
Other versions
CN102333116B (en
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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN 201110280071 priority Critical patent/CN102333116B/en
Publication of CN102333116A publication Critical patent/CN102333116A/en
Application granted granted Critical
Publication of CN102333116B publication Critical patent/CN102333116B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an annular P2P (peer-to-peer) network building method. In each ring, multiple paths are connected with a direct precursor and a direct successor of a node if the node has a subring, thus point connectivity and side connectivity are improved, and the problem of dividing an overlay network is greatly alleviated; besides, ID of the node contains a proportion code, an address code and a random code, so that nodes with the same region in the address code are located in the same ring. Consistency of the overlay network and a practical physical network is improved, communication delay is reduced, the whole network is not required to be traversed, data positioning is sped up, and response time to user requirement is reduced. Besides, the proportion code is contained, thus the proportion code of the node comprising more subrings is shorter, more data can be stored, and the problem of load unbalance caused by route locality can be greatly alleviated.

Description

P2P network establishing method and data positioning method
Technical field
The present invention relates to the P2P network, be specifically related to a kind of P2P network establishing method and data positioning method.
Background technology
Growing along with P2P technology, the P2P Study on Theory also becomes better and approaching perfection day by day.In recent years, being accompanied by the rise of cloud storage, will be an important field of research with the P2P technical application in the cloud storage.Yet structured P 2 P network solve nerve of a covering cut apart with problem such as locality on still also have many deficiencies.
Node in the structured P 2 P network maybe be under the situation of not making advise of same sudden failure, if the node that lost efficacy just is a cutpoint, be easy to then make that the P2P nerve of a covering is cut apart.The method that present solution nerve of a covering is cut apart has many limitation, does not have very efficient ways.Can effectively alleviate nerve of a covering segmentation problem in the P2P network, this very major part depend on key factors such as point-connectivity and edge connectivity.
In addition; Nerve of a covering and physics net are inconsistent often in the structured P 2 P network, and the node of vicinity very possible wide apart in the actual physical network causes communication delay in nerve of a covering; Do not have route locality characteristic, can not satisfy the demand of active user quick response.The route locality is meant that node contiguous in nerve of a covering also is contiguous in the actual physical network.Though some P2P structure has certain locality at present, often can not be divided into many levels, and the load between each node also has loss of equilibrium.
Ring-shaped P 2P network (Chord) is a kind of typical structured P 2 P network model, also still has above problem.In ring-shaped P 2P network; All nodes all are to be in the same ring; Each node has been stored forerunner's node and a plurality ofly (has been generally logN; N is the total quantity of all nodes in the ring-shaped P 2P network) descendant node, and comprised a routing table (Finger table), the number of nodes of wherein storing in the routing table also is logN.Also do not have a kind of P2P system at present, can greatly alleviate the nerve of a covering subregion, and when having locality, can keep load balancing.
Summary of the invention
The object of the present invention is to provide a kind of P2P network establishing method, the network of its structure is alleviated the nerve of a covering subregion greatly, when having locality, can keep load balancing
Another object of the present invention is to provide a kind of data positioning method, can effectively alleviate the network division problem, when keeping load balancing; And has a route locality characteristic; Reduced communication delay, accelerated the data location, improved user's request responding speed.
The construction method of P2P network of the present invention may further comprise the steps:
New node n finds the existing node N in the ring-shaped P 2P network, obtains the address information among the ID of new node n;
The quantity num of same domain in the address information of calculating new node n and existing node N;
Judge num whether greater than the hierachy number of this ring of N node place, if not, then node N is that the environment-development of num goes out new node and joins request to level;
In level is the ring of num, search a descendant node Nx, its response new node n joins request;
Calculate the quantity num2 of descendant node Nx and new node n same domain, num3 is set again equals the level that num2 deducts this ring of descendant node Nx place;
Judge whether num3 is 0,, judge that then descendant node Nx has or not subring if be not 0;
If there is not subring, then new node n will join in the subring of descendant node Nx as first node of descendant node Nx subring, and the hierachy number that the Nx subring is set is that num adds 1.
The construction method of P2P network of the present invention also comprises: if num3 is 0, then new node n adds in this ring of descendant node Nx place.
The construction method of P2P network of the present invention; Also comprise: if descendant node Nx has subring; The level that num is descendant node Nx subring then is set, and each node in subring sends new node and join request, repeating above-mentioned again is the step of searching a descendant node Nx in the ring of num at level.
The construction method of P2P network of the present invention also comprises: equal the hierachy number that num deducts this ring of N node place if num, then is provided with num3 greater than the hierachy number of this ring of N node place, then repeat the above-mentioned num3 of judgement and whether be 0 step.
The construction method of P2P network of the present invention contains address-IP mapping table among the existing node N.
The step that the construction method of P2P network of the present invention, said new node n add in this ring of descendant node Nx place comprises: its follow-up node listing of the direct precursor node updates of descendant node Nx, and be increased to node n in its routing table; Descendant node Nx upgrades its direct precursor tabulation, and is increased to node n in its routing table, and node n is provided with its direct precursor tabulation, immediate successor tabulation and routing table, and the level that this ring of node n place is set equals the level that descendant node Nx belongs to this ring.
The construction method of P2P network of the present invention; The step that said new node n will join as first node of descendant node Nx subring in the subring of descendant node Nx comprises: descendant node Nx upgrades the direct precursor tabulation in its subring; And be increased to node n in its subring routing table; Node n is provided with the tabulation of its direct precursor and immediate successor tabulation and routing table, and the level that this ring of node n place is set equals the level that descendant node Nx belongs to this ring and adds one.
The method of data of the present invention location comprises step:
The node M that need search data calculate to search the ID of data;
Ratio sign indicating number with in data ID and the node M self ID compares, and the quantity in same ratio territory is made as num4;
Judge that num4 is whether greater than the hierachy number of this ring of node N place, if the hierachy number that num4 equals this ring of node M place then is set;
, level searches the responsive node Nz of response in being the ring of num4 to the search request of data ID;
Judge that responsive node Nz has or not subring, if having, then responsive node Nz transmission search request continues to search in the subring at Nz place;
In the subring of responsive node Nz, search another responsive node Ny of response to the search request of data ID, responsive node Nz is set to responsive node Ny, and repeats the step that above-mentioned judgement responsive node Nz has or not subring.
The method of data of the present invention location; Also comprise: if num4 is not more than the hierachy number of this ring of node N place; Then to send search request be the ring of num4 to level to node M, and repeat above-mentionedly in level is the ring of num4, to search the step of response to the responsive node Nz of the search request of data ID.
The method of data of the present invention location, also comprise: responsive node Nz does not have subring, confirms that then required data of searching just are stored among the responsive node Nz, searches to finish.
Compared with prior art, the present invention has the following advantages:
1, in each ring, as long as some nodes have subring, then must there be mulitpath to connect the direct precursor and the immediate successor of this node, increased point-connectivity and edge connectivity, alleviated the segmentation problem of nerve of a covering greatly.
2, comprise ratio sign indicating number, address code and random code among the ID of node, made the node that in address code, has same domain in same ring.Improved the consistency of nerve of a covering and actual physics network, reduced communication delay, and need not travel through whole network, accelerated the data location, reduced user's request responding time.Owing to also comprised the ratio sign indicating number, make that its ratio sign indicating number of node that comprises more subrings is shorter in addition, can store more data, overcome the problem of laod unbalance.
Description of drawings
Accompanying drawing is used to provide further understanding of the present invention, and constitutes the part of specification, is used to explain the present invention with embodiments of the invention, does not constitute restriction of the present invention.In the accompanying drawings:
Fig. 1 is the composition structural model of multi-layer annular P2P network.
Fig. 2 is the ratio coding and the address information coding sketch map of node.
Fig. 3 is the sketch map of direct precursor tabulation in each node, immediate successor tabulation and successor list.
Fig. 4 is that this ring of present node is gone up the immediate successor tabulation of direct precursor and the direct precursor tabulation sketch map of immediate successor.
Fig. 5 is that present node is tabulated and immediate successor tabulation sketch map in this ring and the direct precursor in the subring.
Fig. 6 is that the immediate successor tabulation of direct precursor and immediate successor in the present node subring is tabulated with direct precursor.
Fig. 7 is the flow chart of P2P network establishing method of the present invention.
Fig. 8 is the flow chart of data positioning method of the present invention.
Embodiment
With reference to Fig. 1, multi-layer annular P2P network of the present invention is made up of a plurality of rings that belong to different levels, and each ring all is to be made up of the big or small clockwise direction of a plurality of nodes by its node ID.
Node is to be used for the storaging user data index, and each node all has a unique ID, and ID is made up of ratio sign indicating number, address code and random code three parts.
Random code is the HASH value that node association attributes (like IP address, port) is calculated, and its length is generally 160, also can be other length.
Level is meant from ring L 0To L iThe quantity of ring of process.Said L 0Ring is not have identical address field in each node address sign indicating number in the finger ring, and its level is 0.L iHave the individual identical address field of i in this ring of ring expression in each territory, address of node at least, i is less than or equal in the ring maximum quantity in identical address territory in each node address sign indicating number, and i is called L iThe level of ring perhaps is called L iThe level of the node on the ring.The level of node is the same with the level of this ring of node place, and for the interface point on the ring, the level of interface point is the level of its this ring of place.
Interface point be finger ring with ring between the node that is connected, also promptly connect the node of two rings, it is two rings of 1 that an interface point hierarchical link differs.The level of interface point is the level of this ring of interface point, and is littler by 1 than the level of interface point subring.
As shown in Figure 1, ring L 0Represent in this ring that the quantity of common prefix is 0 in the address code, ring L1 representes that the common prefix quantity of each address of node sign indicating number in this ring is 1 ..., and the like.Each node in each ring according to address code information from the size order arranged clockwise of A-Z ring.Handing-over node between ring and the ring is interface point.Each node is represented with the territory corresponding to level in the address code in the ring, like ring L 0In each node represent that with first territory of address code ring each node among the L1 representes with second territory of address field ..., and the like.In addition, the level of the ring of L0 ring is 0, and the level of node also is 0 on the L0 ring.The level of L1 ring is 1, and the level of node also is 1 in the ring.CN is an interface point, and it has connected L0 ring and L1 ring.
Subring is meant in two rings that are connected with interface point that ring that level is bigger, interface point claim that this ring is subring.
This ring is the level of node in the finger ring ring identical with the level of ring, and the node in the ring claims that this ring is this ring.
Father's ring is for the node in the subring, and in two rings that are connected with tie point, the node that is on that bigger ring of level claims that less ring of level is father's ring.
In Fig. 1, node CN claims that the L0 ring is this ring, claims that the L1 ring is the subring of CN, and the node CN.BJ in the L1 ring claims that the L0 ring is his father's ring.
Fig. 2 is the sketch map of ratio sign indicating number and address code in the node ID.Address code is to be used to represent each address of node information, is represented by A-Z, and is made up of a plurality of territories, and geographical location information of each domain representation separates with ". " between territory and the territory, finishes with "/" expression.In ground floor L0, do not have common prefix in each address of node sign indicating number, and each node is according to the big or small arranged clockwise of letter.A common prefix is arranged is CN to address code in each node of L10 in the second layer; It is US that L11 has a common prefix; L20 has 2 common prefix in the 3rd layer; Be respectively HB, CN, thus in each node ID among the 3rd layer of L20 the expression mode of address code be CN.HB._/, among the L21 in each node ID address code be expressed as US.UT._/.
The ratio territory is through carrying out the Shannon coding to each node ratio and complementary operation is calculated.The node ratio is meant that all number of nodes of all subrings of some nodes account for the upward ratio of all number of nodes of all subrings of all nodes of this this ring of node.Because node dynamically adds and leaves,, be mainly used in load balancing so this value is not a definite value.Calculated this ring and gone up after the ratio of each node, with coded systems such as Shannon codings these ratios have been encoded again.Last connect the coding that the coding that calculates the front has just constituted each node on this ring with the ratio sign indicating number of this ring and the handing-over node of father's ring again.Its expression mode is similar with address code, and the coding that is calculated on each ring is separated with ". ", is divided into a plurality of territories; And with "/" expression end, as shown in Figure 2, be to encode with the mode of radix-minus-one complement again with the Shannon coding earlier to the coding between each node; The ratio sign indicating number of node CN and node US is 11 and 10; Because the number of nodes that contains in their subrings is identical, so the figure place of ratio sign indicating number is also identical, and node AA and ZZ be encoded to 0010 and 0001; The ratio sign indicating number of node HB is " 11.1/ ", and the ratio sign indicating number of node WH is " 11.1.1/ ".For the data ID of any ratio sign indicating number that do not match, then be put into the ratio sign indicating number greater than data ID and in the node near data ID, as, for data 0011 ..., then it will to be stored in the ratio sign indicating number be in 10 the node.In addition, after system initialization is accomplished because node adds and the probability that withdraws from is impartial, thus can be similar to think that the ratio sign indicating number of node is stable in certain error range.
As shown in Figure 3, each node all has direct precursor tabulation Direct PredList, immediate successor tabulation Direct SuccList, routing table Routing Table.
The direct precursor tabulation is meant the data structure that has comprised a plurality of direct precursor nodes, like chained list, Vector etc.The direct precursor node is meant a certain specific nodes Ni's in the relative ring; Contiguous with node Ni on the ring, but and the node of Ni front promptly this node address sign indicating number less than node Ni address code or identical its random code of this node address sign indicating number with node Ni address code less than node Ni random code.When having only a node on the ring, the direct precursor node is exactly node Ni itself.
In system provided by the present invention, the tabulation of the direct precursor of node Ni comprises three direct precursor nodes at most, is respectively N iNode N on this ring I-1, and at N I-1In the subring with N I-1Two adjacent sub-loop nodes.If N I-1Do not have subring, the direct precursor tabulation just only comprises N so iNode N on this ring I-1Certainly the tabulation of the direct precursor of node Ni can comprise the direct precursor node more than three, but in order to be unlikely to have too big maintenance costs, has only comprised three direct precursor nodes in system provided by the present invention.In addition, if N iBe interface point, i.e. N iSubring is arranged, so N iAlso have the direct precursor tabulation that is used for subring, be called the tabulation of subring direct precursor, formation rule is the same.
Each has directly comprised the direct precursor of this ring and the direct precursor of subring in the tabulation, and direct precursor is meant that its ID approaches present node ID most, but in the anticlockwise node of front nodal point ID.Each immediate successor tabulation has comprised the immediate successor of this ring and the immediate successor of subring, and immediate successor is meant that its ID approaches present node ID most, but in the clockwise node of present node ID.Because the quantity of node is fewer in each ring, the routing table that is used for this ring and subring comprises the information of all nodes of respective rings.
In addition, (except that the L0 ring), all comprising two special nodes in each ring, is respectively to be in the node of handing-over node in the subring both sides.They have all comprised direct precursor node and the immediate successor node of interface point on this ring.
If present node is N Cur, the direct precursor node is N Cur-1, the immediate successor node is N Cur+1, the direct precursor of Ncur in subring is SN Cur-1, immediate successor is SN Cur+1N CurDirect precursor node N Cur-1Node in the immediate successor tabulation on this ring is respectively N Cur, SN Cur+1, SN Cur-1N CurImmediate successor node N Cur+1Node in the direct precursor tabulation on this ring also is respectively N Cur, SN Cur+1, SN Cur-1N CurBe used for node on the routing table of this ring and be N0 ..., Nn.
The immediate successor tabulation is meant the data structure that has comprised a plurality of immediate successor nodes, like chained list, Vector etc.The immediate successor node is meant a certain specific nodes N in the relative ring i, the ring on node N iContiguous, and at N iThe node of back promptly this node address sign indicating number greater than node N iBut address code or this node address sign indicating number and the identical random code of node Ni address code are greater than node Ni random code.When having only a node on the ring, the immediate successor node is exactly node N iItself.
In system provided by the present invention, node N iImmediate successor tabulation comprise three immediate successor nodes at most, be respectively N iNode N on this ring I+1, and at N I+1In the subring with N I+1Two adjacent sub-loop nodes.If N I+1Do not have subring, the immediate successor tabulation just only comprises the node N of Ni on this ring so I+1Certainly the tabulation of the immediate successor of node Ni can comprise the immediate successor node more than three, but in order to be unlikely to have too big maintenance costs, has only comprised three immediate successor nodes in system provided by the present invention.In addition, if N iBe interface point, i.e. N iSubring is arranged, so N iAlso have the immediate successor tabulation that is used for subring, be called the tabulation of subring immediate successor, formation rule is the same.
In addition, in order to alleviate the problem of nerve of a covering subregion, interface point N jTwo neighbor node SN in subring J-1And SN J+1, they must store interface point N iTwo neighbor nodes on its this ring, promptly Ni is at the direct precursor node N of this ring I-1With immediate successor node N I+1, these two nodes are with being stored in SN respectively J-1(SN J+1In too) the direct precursor tabulation and immediate successor tabulation.Node N I-1Immediate successor tabulation in stored node N i, SN I-1And SN I+1, node N I+1The direct precursor node in also stored node N i, SN I-1And SN I+1So from node N I-1To node N I+1The path by original N I-1-N i-N I+1This paths increases to three, and wherein two paths that increase are respectively N more I-1-SN I-1-N I+1And N I-1-SN I+1-N I+1, therefore have only the N of working as i, SN I-1And SN I+1When three nodes lost efficacy simultaneously, just can produce network partition.Increase the limit, limit and measure the probability that not only can reduce interface point subring and Qi Ben ring subregion greatly, and can play the effect of shunting, the load that alleviates interface point request.
Routing table is meant the data structure that has comprised other node ID, IP address and transmitted routing iinformations such as port.Because whole system has been divided into a lot of rings; Number of nodes is fewer in each ring; So each node in the ring has all comprised the upward routing iinformation of other all nodes of this ring; Therefore in ring, some nodes will only need once jumping the node that can achieve the goal when the another one node sends request.If a certain node N in the ring iBe interface point, subring is promptly arranged, then node Ni also has a routing table that comprises subring node routing iinformation, is called the subring routing table.
In addition, the routing iinformation in the routing table sorts according to alphabetic order according to address code in the node ID.When searching a certain node N iThe memory location time, promptly confirm direct precursor node and the immediate successor node of Ni, specifically search rule is following:
Predicate node N jAddress code whether at the N of routing table iAnd N kBetween the node, the total quantity of the node of wherein storing in the routing table is m, i=0 ..., m-1, k=(j+1) %m.If N i<N k&&N i<N j<N k, perhaps N i>N k&& (N j>N iPerhaps N j<N k), N so jJust be stored in N iWith N kBetween, N jThe direct precursor node be N i, the immediate successor node is N kWherein node size relatively all is meant the size according to the order comparison node address code of node The English alphabet.In addition, if each address of node sign indicating number equates that all will compare their random code so, comparison rule is the same in the ring, the only comparison of node size is meant the size of random code in the comparison node.Find the immediate successor node N of Nj kAfter, N kWill responsive node N jRequest.
With reference to Fig. 4, the direct precursor node of present node CN on this ring is AR, the immediate successor N of AR Cur, SN Cur+1, SN Cur-1Be respectively CN, CNBJ, CNTJ; The immediate successor node of CN on this ring is EG, the direct precursor N of EG Cur, SN Cur+1, SN Cur-1Be respectively CN, CNBJ, CNTJ; Node in the routing table on this ring of CN is GR, KR ...
This direct precursor tabulation on this ring of Ncur is N Cur-1, SN Cur-2, SN Cur, N CurDirect precursor tabulation in subring is SN Cur-1And SN Cur-1Be close to SN in the subring Cur-1Two nodes; N CurThis immediate successor tabulation on this ring is N Cur+1, SN Cur+2, SN Cur, N CurImmediate successor tabulation in subring is SN Cur+1And SN Cur+1Be close to SN in the subring Cur+1Two nodes.
With reference to Fig. 5; Node in the direct precursor tabulation of present node CN on this ring is AR; And two the node AR_ (AR is not if there is subring, and then AR_ is empty) that are close to AR in the AR subring, the node in the direct precursor tabulation of CN in subring is CNTJ; And two the node CNTJ_ (CNTJ is not if there is subring, and then CNTJ_ is empty) that are close to CNTJ in the CNTJ subring; Node in the immediate successor tabulation of CN on this ring is EG, and two the node EG (EG is not if there is subring, and then EG_ is empty) that are close to EG in the EG subring; Node in the immediate successor tabulation of CN in subring is CNBJ, and two the node CNBJ_ (CNBJ is not if there is subring, and then CNBJ_ is empty) that are close to CNBJ in the CNBJ subring.
Present node N CurDirect precursor node SN in the subring Cur-1, the immediate successor node is SN Cur+1SN Cur-1Immediate successor on this ring is SN Cur, because SN CurBe N CurSo, SN Cur-1Immediate successor tabulation in have only a descendant node SN CurSN Cur-1Immediate successor node in subring is with shown in Fig. 4 embodiment, so in this omission.SN in addition Cur-1In the direct precursor tabulation, also need preserve a node N in father's ring Cur+1SN Cur+1Direct precursor on this ring is SN Cur, because SN CurBe N CurSo, SN Cur+1Direct precursor tabulation in have only forerunner's node SN CurSN Cur+1Direct precursor node in subring is with shown in Fig. 4 embodiment, so in this omission.SN in addition Cur+1In the immediate successor tabulation, also need preserve a node N in father's ring Cur-1
With reference to Fig. 6, present node CN, direct precursor is CNTJ in its subring, immediate successor is CNBJ.Be CN with regard to a descendant node in the immediate successor tabulation of CNTJ on this ring, preserved the descendant node EG of present node in addition; In the direct precursor tabulation of CNBJ on this ring is CN with regard to forerunner's node also, has preserved forerunner's node AR of present node in addition.
As shown in Figure 7, the construction method of loop network of the present invention may further comprise the steps:
(1) new node n finds in the ring-shaped P 2P network (Chord) existing node N, and N contains the address ip mapping table, obtains the address information among the ID of this new node n.
(2) the quantity num of same domain in the address information of calculating n and N.
(3) judge that num is whether greater than the hierachy number of this ring of N node place, if then forward step (4) to, otherwise forward step (5) to.
(4) num3 is set and equals the hierachy number that num deducts this ring of N node place.
(5) N will be that the environment-development of num goes out new node and joins request to level.
(6) in level is the ring of num, search a successor node Nx, its response new node n joins request.
(7) the quantity num2 in the common territory of calculating successor node Nx and n is provided with num3 again and equals the level that num2 deducts this ring of Nx place.
(8) judge whether num3 is 0, if num3 equals 0, then forwards step (9) to, otherwise forward step (10) to.
(9) new node n adds in this ring of successor node Nx place, and successor node Nx upgrades its direct precursor tabulation, and is increased to node n in its routing table.This exterior node n will be provided with the tabulation of its direct precursor and immediate successor tabulation and routing table, and the level that this ring of node n place is set equals the level that descendant node Nx belongs to this ring.So far the completion that joins request of new node.
(10) judge that successor node Nx has or not subring, if do not have, then forwards step 11 to, otherwise forwards step (12) to.
(11) new node n will join in the subring of successor node Nx as first node of successor node Nx subring.Nx upgrades the direct precursor tabulation in its subring, and is increased to node n in its subring routing table.This exterior node n will be provided with the tabulation of its direct precursor and immediate successor tabulation and routing table, and the level that descendant node Nx belongs to this ring that time equals layer by layer that this ring of node n place is set adds one.So far the completion that joins request of new node.
(12) level that num is descendant node Nx subring place is set.And the request of each node transmission new node adding in subring, forward step (6) again to.
As shown in Figure 8, the method for data location comprises step:
(1) node M that need search data calculate to search the ID of data.
(2) compare with the ratio sign indicating number in data ID and this node self ID, the quantity in same ratio territory is made as num4.
(3) judge that num4 is whether greater than the hierachy number of this ring of M node place, if then forward step (4) to, otherwise forward step (5) to.
(4) hierachy number that num4 equals this ring of M node place is set.
(5) node M transmission search request is the ring of num4 to level.
(6), level searches the responsive node Nz of response in being the ring of num4 to the search request of data ID
(7) judge that Nz has or not subring, if having, then forward step 8 to, otherwise forward step (10) to.
(8) responsive node Nz transmission search request continues to search in the subring at Nz place.
(9) in the subring of Nz, search another responsive node Ny of response to the search request of data ID.Nz is set to Ny.Forward step (7) again to.
(10) confirm that required data of searching just are stored among the responsive node Nz, search to finish.The above only is an embodiment of the present invention; Should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; Can also make some improvement and retouching, these improvement and retouching also should be regarded as protection scope of the present invention.

Claims (10)

1. the construction method of a P2P network is characterized in that, may further comprise the steps:
New node n finds the existing node N in the ring-shaped P 2P network, obtains the address information among the ID of new node n;
The quantity num of same domain in the address information of calculating new node n and existing node N;
Judge num whether greater than the hierachy number of this ring of N node place, if not, then node N is that the environment-development of num goes out new node and joins request to level;
In level is the ring of num, search a descendant node Nx, its response new node n joins request;
Calculate the quantity num2 of descendant node Nx and new node n same domain, num3 is set again equals the level that num2 deducts this ring of descendant node Nx place;
Judge whether num3 is 0,, judge that then descendant node Nx has or not subring if be not 0;
If there is not subring, then new node n will join in the subring of descendant node Nx as first node of descendant node Nx subring, and the hierachy number that the Nx subring is set is that num adds 1.
2. the construction method of P2P network according to claim 1 is characterized in that, also comprises: if num3 is 0, then new node n adds in this ring of descendant node Nx place.
3. the construction method of P2P network according to claim 1; It is characterized in that; Also comprise: if descendant node Nx has subring; The level that num is descendant node Nx subring then is set, and each node in subring sends new node and join request, repeating above-mentioned again is the step of searching a descendant node Nx in the ring of num at level.
4. the construction method of P2P network according to claim 1; It is characterized in that; Also comprise: equal the hierachy number that num deducts this ring of N node place if num, then is provided with num3 greater than the hierachy number of this ring of N node place, then repeat the above-mentioned num3 of judgement and whether be 0 step.
5. the construction method of P2P network according to claim 1 is characterized in that, contains address-IP mapping table among the existing node N.
6. the construction method of P2P network according to claim 1; It is characterized in that; The step that said new node n adds in this ring of descendant node Nx place comprises: its follow-up node listing of the direct precursor node updates of descendant node Nx, and be increased to node n in its routing table; Descendant node Nx upgrades its direct precursor tabulation, and is increased to node n in its routing table; Node n is provided with the tabulation of its direct precursor, immediate successor tabulation and routing table, and the level that this ring of node n place is set equals the level of this ring of descendant node Nx place.
7. the construction method of P2P network according to claim 1; It is characterized in that; The step that said new node n will join as first node of descendant node Nx subring in the subring of descendant node Nx comprises: descendant node Nx upgrades the direct precursor tabulation in its subring; And be increased to node n in its subring routing table; Node n is provided with the tabulation of its direct precursor and immediate successor tabulation and routing table, and the level that this ring of node n place is set equals the level that descendant node Nx belongs to this ring and adds one.
8. the method for a data location is characterized in that, comprises step:
The node M that need search data calculate to search the ID of data;
Ratio sign indicating number with in data ID and the node M self ID compares, and the quantity in same ratio territory is made as num4;
Judge that num4 is whether greater than the hierachy number of this ring of node M place, if the hierachy number that num4 equals this ring of node M place then is set;
, level searches the responsive node Nz of response in being the ring of num4 to the search request of data ID;
Judge that responsive node Nz has or not subring, if having, then responsive node Nz transmission search request continues to search in the subring at Nz place;
In the subring of responsive node Nz, search another responsive node Ny of response to the search request of data ID, responsive node Nz is set to responsive node Ny, and repeats the step that above-mentioned judgement responsive node Nz has or not subring.
9. the method for data according to claim 8 location; It is characterized in that; Also comprise: if num4 is not more than the hierachy number of this ring of node M place; Then to send search request be the ring of num4 to level to node M, and repeat above-mentionedly in level is the ring of num4, to search the step of response to the responsive node Nz of the search request of data ID.
10. the method for data according to claim 8 location is characterized in that also comprise: responsive node Nz does not have subring, confirms that then required data of searching just are stored among the responsive node Nz, searches to finish.
CN 201110280071 2011-09-20 2011-09-20 P2P (peer-to-peer) network building method and data positioning method Expired - Fee Related CN102333116B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110280071 CN102333116B (en) 2011-09-20 2011-09-20 P2P (peer-to-peer) network building method and data positioning method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110280071 CN102333116B (en) 2011-09-20 2011-09-20 P2P (peer-to-peer) network building method and data positioning method

Publications (2)

Publication Number Publication Date
CN102333116A true CN102333116A (en) 2012-01-25
CN102333116B CN102333116B (en) 2013-07-24

Family

ID=45484717

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110280071 Expired - Fee Related CN102333116B (en) 2011-09-20 2011-09-20 P2P (peer-to-peer) network building method and data positioning method

Country Status (1)

Country Link
CN (1) CN102333116B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103166819A (en) * 2013-03-07 2013-06-19 南京邮电大学 Network structure based on business priorities and push method of network structure
CN104112049A (en) * 2014-07-18 2014-10-22 西安交通大学 P2P (peer-to-peer) architecture based cross-data-center MapReduce task scheduling system and P2P architecture based cross-data-center MapReduce task scheduling method
CN104780588A (en) * 2014-01-10 2015-07-15 中国电信股份有限公司 Method of controlling adding of sensing node and sink node
CN105007190A (en) * 2015-07-30 2015-10-28 杭州施强网络科技有限公司 P2P networking quality optimization method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1988518A (en) * 2006-12-13 2007-06-27 北京交通大学 Counterpart network searching method
US7545735B1 (en) * 2003-03-11 2009-06-09 Atrica Israel Ltd. Scalable protection mechanism for hierarchical multicast service in ring based networks
CN101605094A (en) * 2009-04-29 2009-12-16 哈尔滨工程大学 Ring model and routing algorithm thereof based on point to point network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7545735B1 (en) * 2003-03-11 2009-06-09 Atrica Israel Ltd. Scalable protection mechanism for hierarchical multicast service in ring based networks
CN1988518A (en) * 2006-12-13 2007-06-27 北京交通大学 Counterpart network searching method
CN101605094A (en) * 2009-04-29 2009-12-16 哈尔滨工程大学 Ring model and routing algorithm thereof based on point to point network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张家明: "P2P模式下网络路由算法的研究", 《硕士学位论文》, 15 May 2011 (2011-05-15), pages 29 - 42 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103166819A (en) * 2013-03-07 2013-06-19 南京邮电大学 Network structure based on business priorities and push method of network structure
CN103166819B (en) * 2013-03-07 2016-04-20 南京邮电大学 A kind of network configuration based on service priority and method for pushing thereof
CN104780588A (en) * 2014-01-10 2015-07-15 中国电信股份有限公司 Method of controlling adding of sensing node and sink node
CN104112049A (en) * 2014-07-18 2014-10-22 西安交通大学 P2P (peer-to-peer) architecture based cross-data-center MapReduce task scheduling system and P2P architecture based cross-data-center MapReduce task scheduling method
CN104112049B (en) * 2014-07-18 2015-11-11 西安交通大学 Based on the MapReduce task of P2P framework across data center scheduling system and method
CN105007190A (en) * 2015-07-30 2015-10-28 杭州施强网络科技有限公司 P2P networking quality optimization method
CN105007190B (en) * 2015-07-30 2018-10-26 杭州施强教育科技有限公司 A kind of P2P networkings quality optimization method

Also Published As

Publication number Publication date
CN102333116B (en) 2013-07-24

Similar Documents

Publication Publication Date Title
CN102333116B (en) P2P (peer-to-peer) network building method and data positioning method
CN103051543B (en) A kind of process of route prefix, search, increase and delet method
CN102663058A (en) URL duplication removing method in distributed network crawler system
CN102780628B (en) On-chip interconnection network routing method oriented to multi-core microprocessor
CN104734962B (en) A kind of resource search method of non-structural P 2 P network
CN112380209B (en) Block chain multi-channel state data-oriented structure tree aggregation method
CN104346444B (en) A kind of the best site selection method based on the anti-spatial key inquiry of road network
CN102201986A (en) Zonal routing method for non-relational database Cassandra
CN103838831A (en) On-line social network mass data storage method based on community division
CN103346967A (en) Data center network topology structure and routing method thereof
CN102325093A (en) Routing system constructing method in structuralized P2P (peer-to-peer) network
CN102378407B (en) Object name resolution system and method in internet of things
CN105471893A (en) Distributed equivalent data stream connection method
Loutskii et al. Using excess code to design fault-tolerant topologies
CN104301212A (en) Functional chain combination method
CN101465753A (en) Method, device and system for managing P2P system set
CN107257356B (en) Social user data optimal placement method based on hypergraph segmentation
CN102130810A (en) Method for realizing interconnection structure in same layer domain of tree topology
CN103337856B (en) Switch grouping method of network reconstruction of power distribution network
CN105072660A (en) Routing method of wireless sensor and actuator network for fire protection
CN102075582A (en) Storage method for data storage model of credible cloud storage system
CN103729461A (en) Releasing and subscribing method based on history recorded data mining
CN101360055B (en) P2P network information resource location method having constant hop routing characteristic
CN103428087B (en) The longest path preset protection P using depth of round first traversal encloses generation method
Toda et al. Autonomous and distributed construction of locality aware skip graph

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130724

Termination date: 20180920