CN102333116B - 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
CN102333116B
CN102333116B CN 201110280071 CN201110280071A CN102333116B CN 102333116 B CN102333116 B CN 102333116B CN 201110280071 CN201110280071 CN 201110280071 CN 201110280071 A CN201110280071 A CN 201110280071A CN 102333116 B CN102333116 B CN 102333116B
Authority
CN
China
Prior art keywords
node
ring
subring
place
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.)
Expired - Fee Related
Application number
CN 201110280071
Other languages
Chinese (zh)
Other versions
CN102333116A (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

Landscapes

  • Mobile Radio Communication Systems (AREA)
  • Small-Scale Networks (AREA)

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 the P2P technology, the P2P Study on Theory also becomes better and approaching perfection day by day.In recent years, be accompanied by the rise of cloud storage, being applied to the P2P technology in the cloud storage will be an important field of research.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 may 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 feature, 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), wherein the number of nodes of 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 feature, 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;
Search a descendant node Nx in level is the ring of num, 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: if num then is provided with num3 and equals the hierachy number that num deducts this ring of N node place 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, described 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 node n is increased in its routing table; Descendant node Nx upgrades the tabulation of its direct precursor, and node n is increased in its routing table, and node n is provided with its direct precursor tabulation, immediate successor is tabulated 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.
The construction method of P2P network of the present invention, the step that described 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 node n is increased in its subring routing table, node n is provided with the tabulation of its direct precursor and immediate successor is tabulated and routing table, and the level that the level that this ring of node n place is set equals this ring of descendant node Nx place adds one.
The method of data of the present invention location comprises step:
The node M that need search data calculates the ID that will search data;
Compare with the ratio sign indicating number in data ID and the node M self ID, 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;
In being the ring of num4, level searches the responsive node Nz of response 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;
Search another responsive node Ny of response to the search request of data ID in the subring of responsive node Nz, 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 to search the step of response to the responsive node Nz of the search request of data ID in level is the ring of num4.
The method of data of the present invention location, also comprise: responsive node Nz does not have subring, determines 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,, then must there be mulitpath to connect the direct precursor and the immediate successor of this node, have increased point-connectivity and edge connectivity, alleviate the segmentation problem of nerve of a covering greatly as long as some nodes have subring.
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 do not needed to 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 from explanation the present invention with embodiments of the invention one, 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 schematic diagram of node.
Fig. 3 is the schematic diagram 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 schematic diagram of immediate successor.
Fig. 5 is direct precursor tabulation and the immediate successor tabulation schematic diagram of present node in this ring and subring.
Fig. 6 is that the immediate successor tabulation and the direct precursor of direct precursor and immediate successor in the present node subring tabulated.
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 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 (as 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.Described 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 ring level or be 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 represents 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, as ring L 0In each node represent that with first territory of address code ring each node among the L1 represents 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 this ring to be 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 to be father's ring.
In Fig. 1, node CN claims the L0 ring to be this ring, claims the L1 ring to be the subring of CN, and the node CN.BJ in the L1 ring claims the L0 ring to be his father's ring.
Fig. 2 is the schematic diagram 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, so 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 by 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 to address code, the coding that is calculated on each ring is separated with ". ", be divided into a plurality of territories, and with "/" expression end, as shown in Figure 2, to the coding between each node is to encode with the mode of radix-minus-one complement with the Shannon coding earlier again, 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/ ", 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 finished 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, as chained list, Vector etc.The direct precursor node is meant a certain specific node 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-link points.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, as chained list, Vector etc.The immediate successor node is meant a certain specific node 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-link points.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 will be 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 determine direct precursor node and the immediate successor node of Ni, concrete search rule is as follows:
Predicate node N jAddress code whether at the N of routing table iAnd N kBetween the node, wherein the total quantity of the node of 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 in the AR subring two node AR_ of next-door neighbour AR (AR is not if there is a subring, then AR_ is empty), 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 to 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 to 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) search a successor node Nx in level is the ring of num, 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 node n is increased in its routing table.This exterior node n will be provided with the tabulation of its direct precursor and immediate successor is tabulated 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.So far joining request of new node finished.
(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 node n is increased 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 inferior layer by layer level that equals this ring of descendant node Nx place that this ring of node n place is set adds one.So far joining request of new node finished.
(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 calculates the ID that will search 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) in being the ring of num4, level searches the responsive node Nz of response 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) determine that required data of searching just are stored among the responsive node Nz, search to finish.The above only is the specific 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 improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (2)

1. the construction method of a P2P network is characterized in that, may further comprise the steps:
(1) new node n finds in the ring-shaped P 2P network existing node N, and N contains the address ip mapping table, obtains the address information among the ID of this new node n, and ID is made up of ratio sign indicating number, address code and random code three parts; Address code is defined as: address code is to be used to represent each address of node information, 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; The ratio sign indicating number is defined as: on having calculated this ring after the ratio of each node, with the Shannon coded system these ratios are encoded again, last connect the ratio sign indicating number 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 to address code, the coding that is calculated on each ring is separated with ". ", be divided into a plurality of territories, and finish with "/" expression;
(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) search a successor node Nx in level is the ring of num, 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 detailed process is: successor node Nx upgrades its direct precursor tabulation, and node n is increased in its routing table; This exterior node n will be provided with the tabulation of its direct precursor and immediate successor is tabulated 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, and so far joining request of new node finished;
(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, and detailed process is: Nx upgrades the direct precursor tabulation in its subring, and node n is increased in its subring routing table; This exterior node n will be provided with the tabulation of its direct precursor and immediate successor is tabulated and routing table, and the level that the level that this ring of node n place is set equals this ring of descendant node Nx place adds one, and so far joining request of new node finished;
(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.
2. the method for data location is used for making up according to the described method of claim 1 the data location of the P2P network that obtains, and it is characterized in that the method comprising the steps of:
(I) node M that need search data calculates the ID that will search data;
(II) 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;
(III) judge that num4 is whether greater than the hierachy number of this ring of M node place, if then forward step (IV) to, otherwise forward step (V) to;
(IV) hierachy number that num4 equals this ring of M node place is set;
(V) node M transmission search request is the ring of num4 to level;
(VI) in being the ring of num4, level searches the responsive node Nz of response to the search request of data ID;
(VII) judge that Nz has or not subring, if having, then forward step (VIII) to, otherwise forward step (X) to;
(VIII) responsive node Nz transmission search request continues to search in the subring at Nz place;
(IX) search another responsive node Ny of response to the search request of data ID in the subring of Nz, Nz is set to Ny, forwards step (VII) again to;
(X) determine that required data of searching just are stored among the responsive node Nz, search 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 CN102333116A (en) 2012-01-25
CN102333116B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103166819B (en) * 2013-03-07 2016-04-20 南京邮电大学 A kind of network configuration based on service priority and method for pushing thereof
CN104780588B (en) * 2014-01-10 2018-09-21 中国电信股份有限公司 Method and aggregation node for controlling sensing node addition
CN104112049B (en) * 2014-07-18 2015-11-11 西安交通大学 Based on the MapReduce task of P2P framework across data center scheduling system and method
CN105007190B (en) * 2015-07-30 2018-10-26 杭州施强教育科技有限公司 A kind of P2P networkings 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 (2)

* Cited by examiner, † Cited by third party
Title
P2P模式下网络路由算法的研究;张家明;《硕士学位论文》;20110515;29-42 *
张家明.P2P模式下网络路由算法的研究.《硕士学位论文》.2011,29-42.

Also Published As

Publication number Publication date
CN102333116A (en) 2012-01-25

Similar Documents

Publication Publication Date Title
CN102333116B (en) P2P (peer-to-peer) network building method and data positioning method
CN102663058A (en) URL duplication removing method in distributed network crawler system
CN112380209B (en) Block chain multi-channel state data-oriented structure tree aggregation method
CN102780628A (en) On-chip interconnection network routing method oriented to multi-core microprocessor
CN103346967A (en) Data center network topology structure and routing method thereof
CN102201986A (en) Zonal routing method for non-relational database Cassandra
CN102325093B (en) Routing system constructing method in structuralized P2P (peer-to-peer) network
CN104734962A (en) Resource searching method for unstructured P2P network
CN104780101A (en) FIB (Forward Information Base) table structure in named data networking forwarding plane and retrieval method thereof
CN102378407B (en) Object name resolution system and method in internet of things
CN101963510A (en) Rapid path planning method and enhancement method for random route map
CN105471893A (en) Distributed equivalent data stream connection method
CN104301212A (en) Functional chain combination method
CN102130810A (en) Method for realizing interconnection structure in same layer domain of tree topology
CN105072660A (en) Routing method of wireless sensor and actuator network for fire protection
CN103337856A (en) Switch grouping method of network reconstruction of power distribution network
CN102075582A (en) Storage method for data storage model of credible cloud storage system
CN101360055B (en) P2P network information resource location method having constant hop routing characteristic
Xu et al. Integration of cloud computing and p2p: A future storage infrastructure
CN103729461A (en) Releasing and subscribing method based on history recorded data mining
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
CN106302178A (en) A kind of method for searching route and device
Baldoni et al. A self-organizing crash-resilient topology management system for content-based publish/subscribe
Zhang et al. Enabling routing control in a DHT

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

Granted publication date: 20130724

Termination date: 20180920

CF01 Termination of patent right due to non-payment of annual fee