CN102624936B - Method and device for distributing node identity - Google Patents

Method and device for distributing node identity Download PDF

Info

Publication number
CN102624936B
CN102624936B CN201110029944.8A CN201110029944A CN102624936B CN 102624936 B CN102624936 B CN 102624936B CN 201110029944 A CN201110029944 A CN 201110029944A CN 102624936 B CN102624936 B CN 102624936B
Authority
CN
China
Prior art keywords
node
backup
subelement
physical machine
determines
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.)
Active
Application number
CN201110029944.8A
Other languages
Chinese (zh)
Other versions
CN102624936A (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.)
China Mobile Communications Group Co Ltd
Original Assignee
China Mobile Communications Group 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 China Mobile Communications Group Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201110029944.8A priority Critical patent/CN102624936B/en
Publication of CN102624936A publication Critical patent/CN102624936A/en
Application granted granted Critical
Publication of CN102624936B publication Critical patent/CN102624936B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a method and a device for distributing a node identity (ID) to increase the accuracy of node ID assignment and assure that backup nodes of the virtual nodes of a physical machine are not on the same physical machine. The method for assigning a node identity comprises the steps of: selecting a first node ID from the assignable node identities when a first node is required to be assigned a node ID; determining a backup node which corresponds to the first node according to the selected node ID; determining the backup nodes respectively corresponding to the second nodes which are on the same physical machine as the first node; constructing collections of the backup nodes; assigning the selected node ID to the first node if at least one collection of the backup nodes which meets the predetermined requirements is judged to be exist; and if not, selecting the next node ID and returning to continue executing the above operation.

Description

Node identification distribution method and device
Technical field
The present invention relates to moving communicating field, particularly relate to a kind of node identification distribution method and device.
Background technology
Chord agreement is the point-to-point (P2P of a kind of structuring, Point to Point) agreement, according to this agreement, each node is corresponding mutually different node identification (ID respectively, Identity), and keyword corresponding to each node also identifies with mutually different keyword ID respectively, wherein, general employing consistency hash algorithm or other P2P algorithms calculate the characteristic information of each node respectively, thus obtain the node ID value of each node, the characteristic information of its interior joint can be the Internet protocol (IP of node, Internet Protocol) the unique characteristic information such as address.When node ID length is set to m, the span of node ID value is [0 ~ 2 m-1].According to Chord agreement, node ID value can form an ID ring, as shown in Figure 1, be the ID ring that node ID length is 3, digitized representation node ID value on ID ring, node 0 in Fig. 1, node 1 and node 3 are the node having distributed ID value, other nodes are the node of ID value to be allocated, each node on ring has a descendant node (successor node), also a predecessor node is had, for any node n added on ID ring, its descendant node refers to the node that distance node n is nearest along clockwise direction on ID ring, the predecessor node of node n then refers to the node that distance node n is nearest in the counterclockwise direction on ID ring.
Chord agreement eliminates central administration point, has advantage, be therefore applicable to the Internet (Internet) deployed environment in the shake of reply node and extensive node networking.In large scale distributed system, node may add at any time and exit ID ring, in order to ensure the continuity of business, is necessary for one or more backup node of each peer distribution.Chord agreement chooses the descendant node of node or predecessor node usually as backup node, or according to the method for Hash (HASH) space decile, determines the backup node of node.
In actual deployment process, because the performance of physical machine is very powerful, in general can at the multiple virtual machine of single physical machine deploy, i.e. dummy node, therefore, in the node ID assigning process of dummy node, due to node ID distribute inaccurate, make the backup node of each dummy node on Same Physical machine all on Same Physical machine.So when the physical machine at each dummy node place breaks down, the multiple dummy nodes be deployed in this physical machine all cannot normally work, now should start the backup node of each dummy node, if but the backup node of multiple dummy node is all on Same Physical machine, and this physical machine also there occurs fault, the backup node of so multiple dummy node also just cannot normally work, and causes the backup node of multiple dummy node to lose efficacy simultaneously, make the reliability of node and disaster tolerance lower.
Summary of the invention
The invention discloses a kind of node identification distribution method and device, in order to improve the accuracy that node ID is distributed, improve reliability and the disaster tolerance of the backup node of each dummy node.
The embodiment of the present invention provides a kind of node identification distribution method, comprising:
When needs are for first node distribution node mark ID, in assignable node ID, select first node ID;
According to the node ID selected, determine the backup node that first node is corresponding; And
Determine that each Section Point be positioned at first node on Same Physical machine distinguishes corresponding backup node;
The backup node of the backup node corresponding according to the first node determined and each Section Point difference correspondence, construct each backup node set, in each backup node set, comprise at least one backup node of at least one backup node corresponding to first node and each Section Point difference correspondence;
Judge, in each backup node set of structure, whether to there is at least one backup node set and meet pre-conditioned, not wherein saidly pre-conditionedly all to be positioned on Same Physical machine for any two backup nodes;
If the determination result is YES, then this node ID selected is distributed to described first node; Otherwise
In assignable node ID, select next node ID, and return to continue to perform and determine first node and backup node corresponding to each Section Point, construct each backup node set and judge whether that there is at least one backup node set meets pre-conditioned operation.
The embodiment of the present invention provides a kind of peer distribution device, comprising:
First selected cell, for when needs are for first node distribution node mark ID, select first node ID, and when the judged result of judging unit is no, selects next node ID in assignable node ID;
First determining unit, for the node ID selected according to the first selected cell, determines the backup node that first node is corresponding;
Second determining unit, for determining that each Section Point be positioned at first node on Same Physical machine distinguishes corresponding backup node;
Structural unit, for according to backup node corresponding to the first node determined and the corresponding respectively backup node of each Section Point, construct each backup node set, in each backup node set, comprise at least one backup node of at least one backup node corresponding to first node and each Section Point difference correspondence;
Whether judging unit, for judging, exist at least one node set and meet pre-conditioned in each backup node set of structural unit structure, not describedly pre-conditionedly all to be positioned on Same Physical machine for any two backup nodes;
Allocation units, for when the judged result of judging unit is for being, distribute to described first node by the node ID that the first selected cell is selected.
The nodes-distributing method that the embodiment of the present invention provides and device, in node identification assigning process, when needs are for first node distribution node ID, first select first node ID, according to the backup node of the node ID determination first node that this is chosen, after the backup node determining each Section Point be positioned at first node on Same Physical machine, at least one backup node is selected from the backup node of first node, and from the backup node of each Section Point, select at least one backup node to form all possible backup node set, judge whether each backup node set meets pre-conditioned all not on Same Physical machine of any two backup nodes in this backup node set respectively, if having at least a backup node set to meet, this is pre-conditioned, then the node ID of this selection is distributed to first node, if all node set all do not meet, this is pre-conditioned, then select next assignable node ID, and repeat said process, node ID in the manner described above for needing the node of distribution node ID to determine, reach the object improving the accuracy that node ID is distributed, improve reliability and the disaster tolerance of the backup node of each dummy node.
Other features and advantages of the present invention will be set forth in the following description, and, partly become apparent from specification, or understand by implementing the present invention.Object of the present invention and other advantages realize by structure specifically noted in write specification, claims and accompanying drawing and obtain.
Accompanying drawing explanation
Fig. 1 is in prior art, and node ID length is the schematic diagram of the ID ring of 3;
Fig. 2 is in the embodiment of the present invention, the implementing procedure schematic diagram of node identification distribution method;
Fig. 3 is in the embodiment of the present invention, a kind of possible structural representation of node identification distributor;
Fig. 4 is in the embodiment of the present invention, is the implementing procedure schematic diagram of dummy node V1 distribution node ID;
Fig. 5 a is in the embodiment of the present invention, for node V1 determines the schematic diagram of start node mark i-ID;
Fig. 5 b is in the embodiment of the present invention, in the assignable node ID between neighbors, for node V1 determines the schematic diagram of node ID.
Embodiment
In order in the process of distributing in node ID, reach the object improving the accuracy that node ID is distributed, to avoid the backup node of each dummy node on Same Physical machine on Same Physical machine, embodiments provide a kind of node ID distribution method and device.
Below in conjunction with Figure of description, the preferred embodiments of the present invention are described, be to be understood that, preferred embodiment described herein is only for instruction and explanation of the present invention, be not intended to limit the present invention, and when not conflicting, the embodiment in the present invention and the feature in embodiment can combine mutually.
As shown in Figure 2, be the implementing procedure schematic diagram of the node ID distribution method that the embodiment of the present invention provides, comprise the steps:
S20, when needs are for first node distribution node ID, in assignable node ID, select first node ID:
The node ID that S21, basis are selected, determines the backup node that first node is corresponding;
S22, determine to be positioned at first node each Section Point on Same Physical machine backup node corresponding respectively;
S23, according to backup node corresponding to the first node determined and the corresponding respectively backup node of each Section Point, construct each backup node set, in each backup node set, comprise at least one backup node of at least one backup node corresponding to first node and each Section Point difference correspondence;
S24, judge structure each backup node set in, whether there is at least one backup node set meets pre-conditioned, if judged result is yes, then go to step S25, if judged result is no, then go to step S26, wherein pre-conditioned is not all positioned on Same Physical machine for any two backup nodes;
S25, this node ID selected is distributed to first node;
S26, in assignable node ID, select next node ID, and return and continue to perform step step S21 ~ S24.
In concrete enforcement, in step S20, can in assignable node ID, Stochastic choice first node ID, and when the judged result of step S24 is no, Stochastic choice next node ID.
In addition, also first can determine the selecting sequence of assignable node ID, follow-uply select node ID successively according to this selecting sequence, wherein, can determine in accordance with the following steps can the selecting sequence of distribution node ID:
S200, node diagnostic information according to first node, determine the start node ID of first node;
Concrete, the node diagnostic information of first node comprises the IP address, domain name etc. of first node can the information of unique identification first node, according to the node diagnostic information of first node, HSAH function can be utilized to generate the start node ID of this first node;
S201, this start node ID is defined as first node ID selecting;
S202, according to this start node ID, determine the node ID of each neighbors of first node;
Concrete, determine that the node ID of each neighbors of first node comprises: for each node, the corresponding relation between the node ID obtaining the node ID of this node and each neighbors of this node; According to described start node ID, in the corresponding relation obtained, search the node ID of each neighbors corresponding to described start node ID.
Suppose that node ID is V-ID, utilizes the rule pre-set to determine the adjacent area of V-ID, this rule pre-set can determine algorithm for adjacent area, or specifies the degree of depth of adjacent area in advance.The node of the distribution node ID comprised in adjacent area is the neighbors of node corresponding to V-ID, the corresponding relation between the node ID of node ID and each neighbors can be expressed as V-ID-N-ID1, V-ID-N-ID2 ... V-ID-N-IDp}; Or, to be no more than the node ID of the node ID of having distributed as V-ID neighbors of the preassigned adjacent area degree of depth with the difference of V-ID, corresponding relation between the node ID of node ID and each neighbors can be expressed as V-ID-N-ID1, V-ID-N-ID2 ... V-ID-N-IDp}.Thus, according to start node ID, in the corresponding relation between node ID and the node ID of each neighbors, the node ID of each neighbors corresponding to this start node ID can be searched.
S203, obtain any two adjacent neighborss node ID between comprise, assignable node ID;
Wherein, the assignable node ID node ID that comprises the start node ID that determines and be not assigned with between the node ID of the neighbors of first node determined according to this start node ID.
S204, basis are preset and are really established rules then, determine the selecting sequence of each node ID obtained.
Concrete, be first assignable node ID with start node ID, in the neighbors of the first node determined according to this start node ID, according to the order ascending with start node ID difference, successively by comprise between two often adjacent neighbors ID, assignable node ID sorts, and determines the selecting sequence of assignable node ID thus; Preferably, in order to the uniformity that local nodes ID distributes, when determining the selecting sequence of assignable node ID, node ID corresponding to 1/2 place of two adjacent neighbors ID only can be selected to sort, the assignable node ID selected is determined selecting sequence according to the order ascending with start node ID difference.
In concrete enforcement, in the step s 21, according to the node ID selected, determine to comprise the backup node that first node is corresponding:
According to the node ID selected, in the corresponding relation between the node ID preset and backup node ID, search each backup node ID that the node ID selected is corresponding;
By each backup node corresponding for the backup node ID found, be defined as each backup node that first node is corresponding.
Concrete, according to the node ID (comprising the node ID and unappropriated node ID of having distributed) of each node, P2P algorithm is utilized to determine the backup node of each node ID, such as, node ID is that the backup node that V1-ID is corresponding can be expressed as { V1-B-ID1, V1-B-ID2 ... V1-B-IDm}.Like this, after node ID is determined, just can search the node ID of each backup node corresponding to this node ID according to the corresponding relation between this node ID and node ID of backup node, thus, also can determine each backup node of the node that this node ID is corresponding.
In concrete enforcement, in step S23, determine that each Section Point be positioned at first node on Same Physical machine distinguishes corresponding backup node, comprising:
Obtain the corresponding relation between physical machine ID and node ID;
Determine the physical machine ID of the physical machine at described first node place;
According to the physical machine ID determined, in described corresponding relation, search each node ID that the physical machine ID that determines is corresponding;
By each node corresponding for each node ID found, be defined as each Section Point be positioned at described first node on Same Physical machine;
Determine the backup node of each Section Point respectively.
Concrete, in the physical machine that physical machine ID is corresponding with this physical machine ID dummy node node ID between corresponding relation can be expressed as: { W1-V1-ID1, W1-V2-ID2, ... W1-Vn-IDn}, according to this corresponding relation, after the physical machine determining the first node place needing distribution node ID, the node ID of each Section Point coexisted with first node in a physical machine can be determined according to this corresponding relation, thus each Section Point can be determined, also the backup node of each Section Point just can be determined according to the corresponding relation between node ID and the node ID of backup node.
In concrete enforcement, node identification distribution method, also comprises:
When the physical machine at described first node place breaks down, meeting in pre-conditioned each backup node set, select a backup node set; And
Each backup node in this backup node set that startup is selected, takes over first node corresponding to described each backup node or Section Point works on.
In concrete enforcement, determine can after the selecting sequence of distribution node ID, according to first assignable node ID (the start node ID namely in the embodiment of the present invention) that this selecting sequence is determined, obtain the backup node that first node is corresponding, be assumed to be { V1-B-ID1, V1-B-ID2 ... V1-B-IDm}; With first node be positioned at each Section Point on Same Physical machine for V2-ID2, V3-ID3 ... Vn-IDn}; Equally, obtain the backup node that each Section Point is corresponding, suppose that node ID be the backup node that V2-ID2 is corresponding is { V2-B-ID1, V2-B-ID2 ... V2-B-IDm}, the like, node ID be backup node that Vn-IDn is corresponding for Vn-B-ID1, Vn-B-ID2 ... Vn-B-IDm}; After determining the backup node of first node and each Section Point, a backup node is selected from the backup node of first node, the set of a backup node composition backup node is selected in the backup node of each Section Point, such as, backup node set can be { V1-B-ID1, V2-B-ID1, ... Vn-B-ID1}, or { V1-B-ID1, V2-B-ID2, Vn-B-ID2}, the like, for each backup node set, judge whether it meets pre-conditioned: any two backup nodes in this backup node set are not all positioned on Same Physical machine; If at least there is backup node set to meet that this is pre-conditioned, then this first assignable node ID is distributed to first node; If all backup node set all do not satisfy condition, then according to the selecting sequence determined, determine that next assignable node ID is as transient node ID successively, and said process is performed to this transient node ID, until according to this transient node ID, at least one backup node set that the backup node of each Section Point that the backup node of the first node determined and first node are positioned on Same Physical machine forms meets pre-conditioned, then determine that this transient node ID is the node ID distributing to first node, and this transient node ID is distributed to first node.
Based on same technical conceive, a kind of node identification distributor is additionally provided in the embodiment of the present invention, because the principle of this device technical solution problem is similar to node identification distribution method, therefore the enforcement of this device see the enforcement of method, can repeat part and repeats no more.
As shown in Figure 3, be a kind of possible structural representation of node identification distributor that the embodiment of the present invention provides, comprise:
First selected cell 301, for when needs are for first node distribution node mark ID, select first node ID, and when the judged result of judging unit 305 is no, selects next node ID in assignable node ID;
First determining unit 302, for the node ID selected according to the first selected cell 301, determines the backup node that first node is corresponding;
Second determining unit 303, for determining that each Section Point be positioned at first node on Same Physical machine distinguishes corresponding backup node;
Structural unit 304, for according to backup node corresponding to the first node determined and the corresponding respectively backup node of each Section Point, construct each backup node set, in each backup node set, comprise at least one backup node of at least one backup node corresponding to first node and each Section Point difference correspondence;
Judging unit 305, for judging that in each backup node set of constructing at structural unit 304, whether there is at least one node set and meet pre-conditioned, this is pre-conditioned is not all positioned on Same Physical machine for any two backup nodes;
Allocation units 306, distribute to described first node for the node ID selected by the first selected cell 301.
In concrete enforcement, the first selected cell specifically comprises:
First determines subelement, for determining the selecting sequence of assignable node ID;
Chooser unit, for determining according to first the selecting sequence that subelement is determined, selects first node ID, and when the judged result of judging unit 305 is no, determines according to first the selecting sequence that subelement is determined, selects next node ID.
In concrete enforcement, first determines that subelement specifically comprises:
First determination module, for the node diagnostic information according to first node, determines the start node ID of first node;
Second determination module, the start node ID for being determined by the first determination module is defined as first node ID selected;
3rd determination module, for the start node ID determined according to the first determination module, determines the node ID of each neighbors of first node;
Obtain module, for obtain any two neighborss node ID between comprise, assignable node ID;
4th determination module, for really establishing rules then according to presetting, determines the selecting sequence obtaining each node ID that module obtains.
In concrete enforcement, the 3rd determination module specifically comprises:
Obtain submodule, for for each node, the corresponding relation between the node ID obtaining the node ID of this node and each neighbors of this node;
Search submodule, for according to described start node ID, in the corresponding relation obtaining submodule acquisition, search the node ID of each neighbors corresponding to start node ID.
In concrete enforcement, the first determining unit 302 specifically comprises:
First searches subelement, for the node ID selected according to the first selected cell 301, in the corresponding relation between the node ID preset and backup node ID, searches each backup node ID that the node ID selected is corresponding;
Second determines subelement, for searching each backup node corresponding to backup node ID that subelement finds by first, is defined as each backup node that first node is corresponding.
In concrete enforcement, the second determining unit 303 specifically comprises:
Obtain subelement, for obtaining the corresponding relation between physical machine ID and the node ID of Section Point;
3rd determines subelement, for determining the physical machine ID of the physical machine at described first node place;
Second searches subelement, for determining according to the 3rd the physical machine ID that subelement is determined, is obtaining in the corresponding relation that gets of subelement, searches the 3rd and determines each node ID that physical machine ID that subelement is determined is corresponding;
4th determines subelement, for searching each node corresponding to each node ID that subelement finds by second, is defined as each Section Point be positioned at first node on Same Physical machine;
5th determines subelement, for determining the backup node of each Section Point respectively.
In concrete enforcement, node identification distributor can also comprise:
Second selected cell 307, for when the physical machine at described first node place breaks down, meeting in pre-conditioned each backup node set, selects a backup node set;
Start unit 308, for starting each backup node in this backup node set of the second selected cell 307 selection.
The execution mode of embodiment for a better understanding of the present invention, thinks that the process of dummy node V1 distribution node ID is that example is described below.
As shown in Figure 4, be the implementing procedure schematic diagram of dummy node V1 distribution node ID, comprise the steps:
S401, generate the start node ID of V1 based on HASH algorithm;
Concrete, suppose that the start node ID generating V1 according to HASH algorithm is i-ID;
S402, according to this start node ID, determine the node ID of the neighbors of V1;
Concrete, suppose the node ID of the neighbors of V1 be V1-N-ID1, V1-N-ID2 ... V1-N-IDp};
S403, obtain any two adjacent neighborss of V1 node ID between comprise, assignable node ID;
Concrete, for comprise between V1-N-ID1 and V1-N-ID2, can distribution node ID, suppose to comprise between V1-N-ID1 and V1-V-ID2, can distribution node be { V1-N1-ID1, V1-N2-ID2, V1-N3-ID3, ... V1-Nm-IDm}, for convenience of description, supposes that the node ID in this set arranges according to ascending order; The like, to obtain between V1-N-ID2 and V1-N-ID3, between V1-N-ID3 and V1-N-ID4 ..., comprise, assignable node ID between V1-N-IDp-1 and V1-N-IDp;
S404, with start node ID for starting point, the assignable node ID of all acquisitions is arranged according to ascending order, determines the selecting sequence of assignable node ID;
S405, according to the selecting sequence determined, select first node ID;
S406, according to select node ID, determine each backup node that V1 is corresponding;
Concrete, from the corresponding relation between node ID and backup node ID, search each backup node ID that the node ID of selection is corresponding;
S407, determine to be positioned at V1 each Section Point on Same Physical machine backup node corresponding respectively;
Concrete, suppose that the dummy node coexisted in a physical machine with V1 has V2, V3, and determine the physical machine ID of the physical machine that V1 is positioned at, according to this physical machine ID, the node ID of V2 and V3 is searched from the corresponding relation between physical machine ID and the node ID of Section Point, from the corresponding relation between node ID and backup node ID, search the backup node ID of backup node ID and V3 of V2;
S408, construct all backup node set;
Concrete, backup node set should meet at least one backup node comprising at least one backup node of V1 and at least one backup node of V2 and V3 in this backup node set;
S409, judge whether whether there is at least one backup node set meets pre-conditioned, if so, then perform step S410, if not, then perform step S411;
Concrete, not pre-conditionedly all to be positioned on Same Physical machine for any two backup nodes in this backup node set; As shown in Figure 5 a, for determining that initial marking i-ID is the schematic diagram of the node ID distributing to V1, wherein, V1, V2, V3 are the dummy node being positioned at Same Physical machine, V1-N-ID1, V1-N-ID2 ... V1-N-ID5} is the neighbors of the V1 determined according to initial marking i-ID;
S410, the node ID selected is defined as the node ID distributing to V1, and performs step S412;
S411, according to the selecting sequence determined, select next assignable node ID, and return and perform step S406;
Concrete, as shown in Figure 5 b, for determining the node ID schematic diagram distributing to V1 in the assignable node ID between the neighbors of V1, wherein, V1, V2, V3 is the dummy node being positioned at Same Physical machine, V1-N-ID1, V1-N-ID2 ... V1-N-ID5} is the neighbors of the V1 determined according to initial marking i-ID;
S412, the node ID of the V1 determined is distributed to V1.
The nodes-distributing method that the embodiment of the present invention provides and device, in node identification assigning process, when needs are for first node distribution node ID, first select first node ID, according to the backup node of the node ID determination first node that this is chosen, after the backup node determining each Section Point be positioned at first node on Same Physical machine, at least one backup node is selected from the backup node of first node, and from the backup node of each Section Point, select at least one backup node to form all possible backup node set, judge whether each backup node set meets pre-conditioned all not on Same Physical machine of any two backup nodes in this backup node set respectively, if having at least a backup node set to meet, this is pre-conditioned, then the node ID of this selection is distributed to first node, if all node set all do not meet, this is pre-conditioned, then select next assignable node ID, and repeat said process, node ID in the manner described above for needing the node of distribution node ID to determine, reach the object improving the accuracy that node ID is distributed, improve reliability and the disaster tolerance of the backup node of each dummy node.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments 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 (8)

1. a node identification distribution method, is characterized in that, comprising:
When needs are for first node distribution node mark ID, determine the selecting sequence of assignable node ID, according to the selecting sequence determined, select first node ID, wherein, determine the selecting sequence of assignable node ID, specifically comprise: according to the node diagnostic information of described first node, determine the start node ID of first node; Described start node ID is defined as first node ID selected; According to described start node ID, determine the node ID of each neighbors of described first node; Comprise, assignable node ID between the node ID obtaining any two adjacent neighborss; Really establishing rules then according to presetting, determining the selecting sequence of each node ID obtained;
According to the node ID selected, in the corresponding relation between the node ID preset and backup node ID, search each backup node ID that the node ID selected is corresponding; By each backup node corresponding for the backup node ID found, be defined as each backup node that first node is corresponding; And
Obtain the corresponding relation between physical machine ID and node ID, determine the physical machine ID of the physical machine at described first node place, according to the physical machine ID determined, in the corresponding relation between physical machine ID and node ID, search each node ID that the physical machine ID that determines is corresponding; By each node corresponding for each node ID found, be defined as each Section Point be positioned at described first node on Same Physical machine; Determine the backup node of each Section Point respectively;
The backup node of the backup node corresponding according to the first node determined and each Section Point difference correspondence, construct each backup node set, in each backup node set, comprise at least one backup node of at least one backup node corresponding to first node and each Section Point difference correspondence;
Judge, in each backup node set of structure, whether to there is at least one backup node set and meet pre-conditioned, not wherein saidly pre-conditionedly all to be positioned on Same Physical machine for any two backup nodes;
If the determination result is YES, then this node ID selected is distributed to described first node; Otherwise
In assignable node ID, select next node ID, and return to continue to perform and determine first node and backup node corresponding to each Section Point, construct each backup node set and judge whether that there is at least one backup node set meets pre-conditioned operation.
2. the method for claim 1, is characterized in that, selects next node ID, specifically comprise in assignable node ID:
According to the described selecting sequence determined, select next node ID.
3. the method for claim 1, is characterized in that, determines the node ID of each neighbors of described first node, specifically comprises:
For each node, the corresponding relation between the node ID obtaining the node ID of this node and each neighbors of this node;
According to described start node ID, in the corresponding relation obtained, search the node ID of each neighbors corresponding to described start node ID.
4. the method as described in claim as arbitrary in claims 1 to 3, is characterized in that, also comprise:
When the physical machine at described first node place breaks down, meeting in described pre-conditioned each backup node set, select a backup node set; And
Start each backup node in this backup node set selected.
5. a node identification distributor, is characterized in that, comprising:
First selected cell, comprise first and determine subelement and chooser unit, wherein, described first determines subelement, for when needs are for first node distribution node mark ID, determine the selecting sequence of assignable node ID, described chooser unit, for determining according to first the selecting sequence that subelement is determined, select first node ID, first determines that subelement specifically comprises: the first determination module, for the node diagnostic information according to described first node, determines the start node ID of first node; Second determination module, for being defined as first node ID selected by described start node ID; 3rd determination module, for according to described start node ID, determines the node ID of each neighbors of described first node; Obtain module, for obtain any two neighborss node ID between comprise, assignable node ID; 4th determination module, for really establishing rules then according to presetting, determines the selecting sequence obtaining each node ID that module obtains; And when the judged result of judging unit is no, select next node ID;
First determining unit, comprise first to search subelement and second and determine subelement, wherein: first searches subelement, for the node ID selected according to described first selected cell, in corresponding relation between the node ID preset and backup node ID, search each backup node ID that the node ID selected is corresponding; Second determines subelement, for searching each backup node corresponding to backup node ID that subelement finds by first, is defined as each backup node that first node is corresponding;
Second determining unit, comprises acquisition subelement, the 3rd and determines that subelement, second is searched subelement, the 4th and determined that subelement determined by subelement and the 5th, wherein: obtain subelement, for obtaining the corresponding relation between physical machine ID and node ID; 3rd determines subelement, for determining the physical machine ID of the physical machine at described first node place; Second searches subelement, for determining according to the 3rd the physical machine ID that subelement is determined, in described corresponding relation, searching the 3rd and determining each node ID that physical machine ID that subelement is determined is corresponding; 4th determines subelement, for searching each node corresponding to each node ID that subelement finds by second, is defined as each Section Point be positioned at described first node on Same Physical machine; 5th determines subelement, for determining the backup node of each Section Point respectively;
Structural unit, for according to backup node corresponding to the first node determined and the corresponding respectively backup node of each Section Point, construct each backup node set, in each backup node set, comprise at least one backup node of at least one backup node corresponding to first node and each Section Point difference correspondence;
Whether judging unit, for judging, exist at least one node set and meet pre-conditioned in each backup node set of structural unit structure, not describedly pre-conditionedly all to be positioned on Same Physical machine for any two backup nodes;
Allocation units, for when the judged result of judging unit is for being, distribute to described first node by the node ID that the first selected cell is selected.
6. device as claimed in claim 5, is characterized in that,
Described chooser unit, also for when the judged result of judging unit is no, determines according to first the selecting sequence that subelement is determined, selects next node ID.
7. device as claimed in claim 5, it is characterized in that, the 3rd determination module specifically comprises:
Obtain submodule, for for each node, the corresponding relation between the node ID obtaining the node ID of this node and each neighbors of this node;
Search submodule, for according to described start node ID, in the corresponding relation that described acquisition submodule obtains, search the node ID of each neighbors corresponding to described start node ID.
8. the device as described in claim as arbitrary in claim 5 to 7, is characterized in that, also comprise:
Second selected cell, for when the physical machine at described first node place breaks down, meeting in described pre-conditioned each backup node set, selects a backup node set;
Start unit, for starting each backup node in this backup node set of the second selected cell selection.
CN201110029944.8A 2011-01-27 2011-01-27 Method and device for distributing node identity Active CN102624936B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110029944.8A CN102624936B (en) 2011-01-27 2011-01-27 Method and device for distributing node identity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110029944.8A CN102624936B (en) 2011-01-27 2011-01-27 Method and device for distributing node identity

Publications (2)

Publication Number Publication Date
CN102624936A CN102624936A (en) 2012-08-01
CN102624936B true CN102624936B (en) 2015-04-22

Family

ID=46564618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110029944.8A Active CN102624936B (en) 2011-01-27 2011-01-27 Method and device for distributing node identity

Country Status (1)

Country Link
CN (1) CN102624936B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103036949B (en) * 2012-11-27 2015-06-17 华中科技大学 Optimization method and system of Cassandra system in virtual environment
CN106850282A (en) * 2017-01-19 2017-06-13 郑州云海信息技术有限公司 Host Administration method and system in a kind of cluster file system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1256567A (en) * 1998-11-26 2000-06-14 三星电子株式会社 Home network system and method of distributing node-identifying code
CN101771715A (en) * 2008-12-26 2010-07-07 华为技术有限公司 Method, device and system for establishing distribution type network

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070233832A1 (en) * 2006-03-30 2007-10-04 Matsushita Electric Industrial Co., Ltd. Method of distributed hash table node ID collision detection
WO2009010093A1 (en) * 2007-07-17 2009-01-22 Telefonaktiebolaget Lm Ericsson (Publ) Operation of p2p telecommunications networks

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1256567A (en) * 1998-11-26 2000-06-14 三星电子株式会社 Home network system and method of distributing node-identifying code
CN101771715A (en) * 2008-12-26 2010-07-07 华为技术有限公司 Method, device and system for establishing distribution type network

Also Published As

Publication number Publication date
CN102624936A (en) 2012-08-01

Similar Documents

Publication Publication Date Title
Al-Tam et al. On load balancing via switch migration in software-defined networking
CN109067930B (en) Domain name access method, domain name resolution method, server, terminal and storage medium
US20090070773A1 (en) Method for efficient thread usage for hierarchically structured tasks
US9866362B2 (en) Method and system for searching network in long term evolution slave mode
CN109451540B (en) Resource allocation method and equipment for network slices
JP2006174417A5 (en)
CN103973837A (en) Method and device for determining physical location information
JP2002305524A (en) Methods and devices for relevancy testing of identifier
CN102624936B (en) Method and device for distributing node identity
KR20090005555A (en) Method for avoiding and overcoming indirect collision in beacon-mode wireless sensor network
CN102082832B (en) Data storage method and device in distributed file system
CN103384251A (en) Multi-class safety service combinable safety network construction method and device
CN104202834A (en) Control method, controller and electronic equipment
CN112685175A (en) Method and device for constructing service topological graph and computer readable storage medium
CN103942196A (en) Method, device and system for data inquiry
CN110858810B (en) Network link state monitoring method, device, system and medium
CN104283966A (en) Data distribution algorithm and device of cloud storage system
US20140225896A1 (en) Resource oriented dependency graph for network configuration
CN106254515A (en) A kind of load-balancing method storing system and equipment
CN113037561A (en) Networking equipment mode switching method and device based on distributed networking system
CN111274315A (en) Synchronous data channel construction method and device, computer equipment and storage medium
CN114422526B (en) Block synchronization method and device, electronic equipment and storage medium
CN108268523A (en) Database aggregation processing method and device
CN114338714A (en) Block synchronization method and device, electronic equipment and storage medium
CN114338724A (en) Block synchronization method and device, electronic equipment 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
C14 Grant of patent or utility model
GR01 Patent grant