Embodiment
The embodiment of the present invention provides a minute territory network creating method, minute territory network, node communication method and network node.
In order to make those skilled in the art person understand better the present invention program, and above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
Network in traditional C/S structure, when solving communications prestige problem, the main method that adopts relay forwarding, thus source node and the destination node of communication is hidden in numerous network entities, realize that this mechanism needs to rely on some credible Relay Server node.And in the P2P network; each node can provide the function of relay forwarding, can provide better secret protection for the user, and the node in the P2P network not only can obtain service but also service can be provided; do not rely on the minority centralized control node, there is no the shortcoming of single point failure.The embodiment of the present invention is mainly used in the P2P network, but also can be applied to some isomery UNEs such as conventional internet network and sensor network.
Referring to Fig. 1, divide the embodiment flow chart of territory network creating method for the present invention:
Step 101: network is divided into some territories, comprises an index server node and some ordinary nodes in each territory.
Initial time, when having the node request to add the territory, index server node in the territory receives joining request of described node transmission, according to the incidence relation between the ordinary node in this node and territory, for this node distributes the prestige initial value, this prestige initial value can be used for after this node and other node communication, after the communication credit value and this prestige initial value weighted average that returns according to other node, obtains the communication credit value after this node updates.
Concrete, can geographical location information residing according to nodes network be divided into some territories, for example, take university as unit, the network of each university is divided into a territory.In fact, except take the geographical position as according to dividing, can also divide according to other attribute of the node in each territory, for example, take business alliance as example, should be cooperative relationship between the node in same territory, and this embodiment of the present invention is not limited.
Step 102: the historical communication information in the territory that communicates by the ordinary node in the index server node in territory storage territory and the ordinary node in other territory.
Concrete, index server node in each territory is by the historical communication information in territory interior nodes prestige table storage described territory, and each list item of territory interior nodes prestige table comprises: propose in described the territory in communication request source ordinary node sign, with other territory that described ordinary node is communicated by letter in the index server node identification that the purpose ordinary node identifies, the purpose ordinary node is affiliated, the sign of the communication resource and the credit value of communicating by letter;
Step 103: the local historical communication information by the described ordinary node of storage of the ordinary node in each described territory and at least one ordinary node communicate, finish current flow process.
Concrete, ordinary node in each territory is by the historical communication information in the described this locality of local node prestige table storage, and each list item of described local node prestige table comprises: with purpose ordinary node sign, the index server node identification under described purpose ordinary node, the sign of the communication resource, the communication credit value in other territory that described ordinary node is communicated by letter.
Referring to Fig. 2, the structural representation of minute territory network of setting up for the embodiment according to the method for building up of the present invention's minute territory network.Wherein, show altogether three independent domains setting up, comprise an index server node and at least one ordinary node in each independent domains.Index server node and ordinary node be that function according to each node arranges, namely in each independent domains, select stable, computing capability is strong and memory space is a large node as the index server node, and the node that all the other calculate and storage capacity is general is as ordinary node, in the territory, ordinary node can carry out information interaction with the index server node in territory, place, and can carry out information interaction between the index server node in each territory.
Wherein, the function of ordinary node is described below in conjunction with Fig. 2:
Function 211: storage was with after this ordinary node carried out communicating by letter, communication credit value (also can be described as the communication quality value) is higher than the information of other ordinary node of preset value, and the information of other ordinary node that these were communicated by letter can be preserved by the local node prestige table shown in Fig. 2.
Only preservation communication credit value is higher than the information purpose of the ordinary node of preset value, the memory space finite capacity of each ordinary node, the information of therefore not storing all ordinary nodes of communicating by letter with oneself in ordinary node, but only in a part of and own communication process of preservation communication quality exceed the information of the ordinary node of certain threshold value.because the credit value of this part ordinary node in communication process is higher, therefore at short notice, this ordinary node is probably repeatedly communicated by letter again with them, and the embodiment of the present invention is based on a minute territory management, the ordinary node of repeatedly communicating by letter for needs, if this ordinary node frequently sends the request of its credit value of inquiry to the index server node, can consume a large amount of Radio Resources and query time, therefore in the embodiment of the present invention, an anticipatory remark ground node prestige table is set in this locality, for the new communication request of this ordinary node to another ordinary node initiation, first search the information whether this another ordinary node is arranged in this local node prestige table, if have, can be directly to this another ordinary node initiating communication request, if no, then by the index server node inquire about.
As shown in table 1 below is the list item field signal of local node prestige table:
IDind-ser |
IDIP |
keyid |
TRUSTvalue |
TTL |
Stime |
Ftime |
Table 1
The IP address of supposing to preserve the ordinary node of this anticipatory remark ground node prestige table is i, and this ordinary node of back namely represents with i, and the below is the explanation of each field in his-and-hers watches 1:
ID
Ind-ser: ID
Ind-serNo. ID of the index server node in the territory, some ordinary nodes place that expression communicates with ordinary node i, No. ID of each index server node is unique;
ID
IP: the ID of the ordinary node of communicating by letter with ordinary node i, the ID of each ordinary node are also unique, and namely this ID can be the cryptographic Hash of this ordinary node IP address; Hence one can see that, and the node identifier NodeID of each ordinary node can be by above-mentioned ID
Ind-serAnd ID
IPForm, namely the first half of NodeID is ID
Ind-ser, latter half is ID
IP
key
id: for ID
IPThe sign of the corresponding communication resource of ordinary node when communicating by letter with ordinary node i, this sign can carry out obtaining after Hash calculation to resource by different hash functions, usually the communication resource is when issuing, can be distributed on the different ordinary nodes in same area not, therefore when certain communication resource of sign, the index server node identification in its territory, place and the sign of the communication resource can be made up;
TRUST
Value: the credit value of certain ordinary node that expression and ordinary node i communicate, only preserve credit value higher than the credit value of the ordinary node of preset value owing to presetting, therefore the communication quality of the corresponding ordinary node of credit value preserved of this field and ordinary node i is all higher than preset value, TRUST
ValueThe unique reference index of ordinary node i when carrying out the prestige choice.TRUST
ValueCan be continuous can be also discrete, if continuous can representing with concrete numerical value, such as representing with the numerical value between 1 to 100, if discrete can representing with grade point, such as from being divided on earth 1 to 5 grade;
TTL: the life span that represents each list item, the validity that is the credit worthiness value of each ordinary node is to decay in time, a TTL is set, when this ttl value during lower than default time threshold, but this credit worthiness value of reminding user may be expired, waits for that the user returns to the indication that whether continues to trust this ordinary node.When TTL was reduced to 0, ordinary node i deleted list item corresponding to this credit worthiness value automatically, did not communicate by letter for a long time to represent these two ordinary nodes, and this list item has not possessed reference value;
Stime: record this ordinary node i and set up with certain ordinary node the successful number of times of communicating by letter;
Ftime: record the number of times that this ordinary node i and certain ordinary node are set up communication failure.
Function 212: ordinary node i utilizes local node prestige table to aim at independently the ordinary node that preparation plays communication request and inquires about and select, if can inquire the ordinary node of preparing the initiating communication request in local node prestige table, illustrate that the ordinary node i credit value of communicating by letter with the history of this ordinary node is higher, therefore can establish a communications link with this ordinary node.
Function 213: if ordinary node i does not find the ordinary node of preparing the initiating communication request in its local node prestige table, ordinary node i to the request of this ordinary node of index server node submit Query in its territory, place, sees the credit value of whether preserving this ordinary node in the index server node.
Function 214: after ordinary node i and certain ordinary node sign off, according to communication quality, the credit value of this ordinary node is reappraised, and this credit value is reported to the index server node.
Wherein, the function of index server node is described below in conjunction with Fig. 2:
Function 221: in network, all index server nodes are numbered in order according to the not same area under it, the identifier of the ordinary node in each territory is identical with the numbering in this territory, just realized thus to ordinary node by territory classification, thereby be convenient to the index server node to the differentiated control of ordinary node in the territory.
Function 222: in index server node reception network, some node adds the territory to be called the request of ordinary node, identity to this node is verified, determine whether admit, if agree to admit according to the node identity as initial credit value of this node distribution, this node joined in the interior nodes prestige table of territory; Same, the index server node also can acceptance region in ordinary node withdraw from the request in this territory, list item corresponding to this ordinary node of deletion from the interior nodes prestige table of territory.
Function 223: the historical information record when the index server node is communicated by letter with other ordinary node with the ordinary node in upgrading this territory by the maintenance of territory interior nodes prestige table.
As shown in table 2 below is the list item field signal of territory interior nodes prestige table:
ID
req |
ID
suply |
ID
sup-ind |
key
id |
T
value |
TTL |
S
time |
F
time |
Table 2
ID
req: propose the NodeID of the ordinary node of communication request in this territory, still ordinary node i describes as example in the territory;
ID
Suply: set up the NodeID of other ordinary node of communication connection with ordinary node i, this other ordinary node can be to be positioned at the ordinary node in same territory with ordinary node i, can be also the ordinary node in other territory;
ID
Sup-ind: set up the ID of index server node in other territory, ordinary node place of communication connection with ordinary node i;
key
id: for ID
SuplyThe sign of the corresponding communication resource of ordinary node when communicating by letter with ordinary node i, this sign can carry out obtaining after Hash calculation to resource by different hash functions, usually the communication resource is when issuing, can be distributed on the different ordinary nodes in same area not, therefore when certain communication resource of sign, the index server node identification in its territory, place and the sign of the communication resource can be made up;
T
ValueOrdinary node i after establishing a communications link with other ordinary node, the credit value that this other ordinary node is provided according to the quality of result of communication;
TTL: with in above-mentioned table 1 to the explanation of TTL, do not repeat them here;
Stime: record this ordinary node i and set up with certain ordinary node the successful number of times of communicating by letter;
Ftime: record the number of times that this ordinary node i and certain ordinary node are set up communication failure.
Function 224: answer the query requests of certain ordinary node to the credit value of other ordinary node in this territory in this territory, and answer the index server node in other territory to the query requests of the credit value of ordinary node in this territory.
by the functional description of the structural representation of above-mentioned minute territory network and territory interior nodes as can be known, in this minute territory network management structure, the ordinary node that index server node in each territory is responsible in this territory provides query function, query requests between the ordinary node in two territories and Query Result forward by the index server node in these two territories, because the index server node in each territory only is responsible for ordinary node in this territory to the inquiry of the communication of the ordinary node in other territory credit value, and do not inquire about alternately by index server node separately between same area, reduced thus the query load when only a station server being arranged in the distributed network, improved the search efficiency of single-point client.
On the embodiment basis of aforementioned minute territory network creating method, the present invention also provides the node communication embodiment based on minute territory network.
Referring to Fig. 3, be the first embodiment flow chart of node communication method of the present invention;
Step 301: the communication request that endogenous index server node acceptance domain endogenous ordinary node in territory sends comprises the sign of the communication resource in this communication request.
Step 302: source index server node is searched purpose ordinary node sign and the affiliated purpose index server node identification thereof at communication resource place according to the sign of the communication resource.
Concrete, source index server node is searched territory interior nodes prestige table according to the sign of the described communication resource, obtains the purpose ordinary node sign corresponding with the sign of the communication resource, the purpose index server node identification under the purpose ordinary node and communication credit value from the interior nodes prestige table of described territory.
Step 303: the historical communication information of the purpose ordinary node that returns according to purpose index server node, obtain the global trust value of purpose ordinary node.
concrete, send query requests to purpose index server node, query requests is used for all ordinary nodes that inquiry was communicated by letter with the purpose ordinary node, index server node under all ordinary nodes and communication credit value, the Query Information inquiry field interior nodes prestige table that returns according to purpose index server node, from with all ordinary nodes that the purpose ordinary node was communicated by letter, obtain the ordinary node of communicating by letter with the source ordinary node, according to the communicate by letter credit value of source ordinary node with the purpose ordinary node, and the credit value of communicating by letter of the ordinary node of communicating by letter with described source ordinary node and described purpose ordinary node calculates the global trust value of purpose ordinary node.
Step 304: when global trust value surpasses the threshold value that sets in advance, allow the source ordinary node to set up with the purpose ordinary node and communicate by letter, finish current flow process.
Referring to Fig. 4, be the second embodiment flow chart of node communication method of the present invention, this embodiment has gone out the detailed process that communicates between source ordinary node and purpose ordinary node:
Step 401: the endogenous ordinary node in territory is searched local node prestige table according to the sign of the communication resource.
Step 402: judge whether to find the purpose ordinary node at communication resource place, if execution in step 411; Otherwise, execution in step 403.
Step 403: endogenous index server sends the communication request of the sign that comprises the communication resource to the endogenous ordinary node in territory to the territory.
Step 404: source index server node is searched territory interior nodes prestige table according to the sign of the communication resource.
Step 405: obtain the purpose ordinary node sign corresponding with the sign of the communication resource, the purpose index server node identification under the purpose ordinary node and communication credit value from the interior nodes prestige table of territory.
Step 406: send query requests to purpose index server node, be used for all ordinary nodes, the index server node under all ordinary nodes and communication credit value that inquiry was communicated by letter with the purpose ordinary node.
Step 407: the Query Information inquiry field interior nodes prestige table that returns according to purpose index server node.
Step 408: from all ordinary nodes that the purpose ordinary node was communicated by letter, obtain the ordinary node of communicating by letter with the source ordinary node.
Step 409: according to the communicate by letter credit value of source ordinary node with the purpose ordinary node, and the credit value of communicating by letter of the ordinary node of communicating by letter with described source ordinary node and purpose ordinary node calculates the global trust value of purpose ordinary node.
Step 410: when global trust value surpassed the threshold value that sets in advance, the source ordinary node was set up with the purpose ordinary node and is communicated by letter, and finishes current flow process.
Step 411: the source ordinary node directly and the purpose ordinary node establish a communications link, finish current flow process.
Embodiment to the aforementioned nodes communication means is described below by a concrete application example:
By aforementioned description as can be known, the node identifier NodeID of each ordinary node is made of two parts, first half is made of the cryptographic Hash in expression territory, ordinary node place, the information in expression territory, ordinary node place, latter half is made of the cryptographic Hash of the IP address of ordinary node, the self information of expression ordinary node.Take the P2P network as example, the P2P network is a kind of cover layer network that is structured between actual physics layer and application layer, the first half of the NodeID of the ordinary node in same territory is identical, therefore at cover layer, clockwise direction can be arranged according to the ascending order of NodeID, form a large Chord ring, this Chord ring can the implementation structure route, according to physical layer and tectal mapping relations, node in same territory is at cover layer, and is namely also mutually contiguous on the logic arrangement of whole Chord ring.
And for issue resource on ordinary node, can adopt different hash functions, resource is carried out Hash operation, obtain the interim keyword identifier keyid of resource, keyid is selected randomly any one or several ordinary node is issued, after issue, the first half of the new keyword identifier KeyID of resource is identical with the first half of the NodeID of territory, place ordinary node, and latter half is keyid.
In the embodiment of the present invention, the node between same area, can be based on described Chord ring when realizing inquiry, for whole large Chord ring, between each territory according to the clockwise direction sequential search; And in each territory, because the first half of NodeID is identical, only latter half according to the Chord rule searching, thereby can effectively improve search efficiency.Referring to Fig. 5, be Chord structure of rings schematic diagram in the embodiment of the present invention, each box indicating index server node wherein, each circle sign ordinary node, as shown in Figure 5, same area manages although whole P2P network is divided into not, but searching, all ring of the end to end composition of node in network, and the circle that distributes on the camber line between every two square frames represents to belong to the ordinary node in same territory, improved search efficiency based on this routing infrastructure.
Based on the speech channel of above-mentioned Chord structure by, the ordinary node of supposing NodeID=u is initiated searching the sign keyid=k of certain communication resource, suppose in the ordinary node of the numerous keyid=k of having resources, NodeID=v (i) (i=1,2...) ordinary node be one of them, and the ID=index_u of the index server node in ordinary node u territory of living in, the ID=index_v (i) of the index server node in ordinary node v (i) residing territory:
At first ordinary node u checks the local node prestige table (aforementioned table 1) that self stores, search according to the Chord method for routing, if there is the ordinary node v (1) of resource identification keyid=k, obtain the communication credit value that this ordinary node u communicated by letter with ordinary node v (1) from local node prestige table according to keyid, and make a decision according to this communication credit value, if the communication credit value surpasses default threshold value, illustrate that this ordinary node is reliable, ordinary node u and ordinary node v (1) establish a communications link and the transport communication resource;
If there is not the ordinary node v (1) of resource identification keyid=k in local node prestige table, ordinary node u can send query requests to index server node i ndex_u, and this moment, index server node i ndex_u can return to ordinary node u to the communication credit value (also can be described as local credit value) of ordinary node u v (1) when communicating by letter before with ordinary node v (1);
index server node i ndex_u is according to the sign NodeID of the communication resource, find the territory at communication resource place on whole Chord ring according to clockwise direction, and search the ordinary node of NodeID=v (1) according to the Chord mode in the territory at place, while index server node i ndex_u sends query requests to the index server node i ndex_v (1) in ordinary node v (1) territory, place, index server node i ndex_v (1) returns to the ID of all ordinary nodes of communicating by letter with ordinary node v (1) recently and the ID in these territories, ordinary node place to index server node i ndex_u,
suppose that certain ordinary node of communicating by letter with ordinary node v (1) is x, the ID of the index server node in its territory of living in is index_x, index server node i ndex_u can send query requests to index server node i ndex_x, index server node i ndex_x turns back to index server node i ndex_u to ordinary node x pair with the credit value of communicating by letter after ordinary node v (1) communicates, similarly, can obtain the communication credit value that nearest all ordinary nodes of communicating by letter with ordinary node v (1) return ordinary node v (1),
Index server node Index_u searches ordinary node from the interior nodes prestige table of territory, these ordinary nodes were for both communicating by letter with ordinary node u, the ordinary node of communicating by letter with ordinary node v (1) again, index server node Index_u is according to the above-mentioned ordinary node that finds and communication credit value after ordinary node v (1) communicates by letter, and ordinary node u and the communication credit value of ordinary node v (1) when communicating by letter before, calculate the global trust value of ordinary node v (1) according to overall credit worthiness algorithm;
If the overall credit worthiness of ordinary node v (1) surpasses the predefined threshold value of ordinary node u, ordinary node u meeting and ordinary node v (1) connect, and begin communication; Otherwise, ordinary node u continues to search the next one and has the own required communication resource, it is the ordinary node of NodeID=v (2), until find a global trust value surpass the ordinary node of threshold value and communicate with it, till perhaps query time returns to the inquiry failure over threshold value;
suppose that ordinary node u connects and completed and communicated by letter with ordinary node v (1), ordinary node u can be according to recommendation reputation value of mass formation of communication, and this recommendation reputation value is returned to ordinary node v (1), ordinary node v this moment (1) can be weighted processing with the current credit value of communicating by letter of self preserving with this recommendation reputation value, obtain the new communication credit value of this ordinary node v (1), and this new communication credit value is arrived ordinary node u and affiliated index server node i ndex_u thereof according to former routing forwarding, the communication credit value that ordinary node u is new according to this upgrades local node prestige table, and the index server node i ndex_u communication credit value new according to this be neofield interior nodes prestige table more.
Divide the embodiment of territory network creating method and node communication method corresponding with the present invention, the present invention also provides the embodiment of minute territory network and network node.
Referring to Fig. 6, divide the embodiment block diagram of territory network for the present invention, network is divided into some territories, and is convenient for example, only shows two territories in Fig. 6.
Wherein, comprise an index server node 610 and some ordinary nodes 620 in each territory:
Described index server node 610 is used for storing the historical communication information in the territory that ordinary node in described territory and the ordinary node in other territory communicate;
Described ordinary node 620 is used for storing the local historical communication information that described ordinary node and at least one ordinary node communicate.
Referring to Fig. 7, be the first embodiment block diagram of network node of the present invention, this network node is the source index server node in territory under the source ordinary node of request communication:
This network node comprises: receiving element 710, search unit 720, acquiring unit 730 and indicating member 740.
Receiving element 710 is used for receiving the communication request that the endogenous ordinary node in described territory sends, and comprises the sign of the communication resource in described communication request;
Search unit 720, be used for searching according to the sign of the described communication resource purpose ordinary node sign and the affiliated purpose index server node identification thereof at described communication resource place;
Acquiring unit 730 for the historical communication information of the described purpose ordinary node that returns according to described purpose index server node, obtains the global trust value of described purpose ordinary node;
Indicating member 740 is used for when described global trust value surpasses the threshold value that sets in advance, and allows described source ordinary node to set up with described purpose ordinary node and communicates by letter.
Referring to Fig. 8 A, be the second embodiment block diagram of network node of the present invention, this network node is the source index server node in territory under the source ordinary node of request communication:
This network node comprises: receiving element 810, search unit 820, acquiring unit 830, indicating member 840 and updating block 850.
Wherein, receiving element 810 is used for receiving the communication request that the endogenous ordinary node in described territory sends, and comprises the sign of the communication resource in described communication request;
Search unit 820, be used for searching according to the sign of the described communication resource purpose ordinary node sign and the affiliated purpose index server node identification thereof at described communication resource place;
Acquiring unit 830 for the historical communication information of the described purpose ordinary node that returns according to described purpose index server node, obtains the global trust value of described purpose ordinary node;
Indicating member 840 is used for when described global trust value surpasses the threshold value that sets in advance, and allows described source ordinary node to set up with described purpose ordinary node and communicates by letter;
Updating block 850, after being used for described source ordinary node and described purpose ordinary node foundation being communicated by letter, receive the communication credit value that described purpose ordinary node returns by purpose index server node, and upgrade the credit value of communicating by letter of described source ordinary node and described purpose ordinary node according to the described communication credit value that returns.
Concrete, referring to Fig. 8 B, searching unit 820 can comprise: territory interior nodes prestige table is searched unit 821, is used for searching territory interior nodes prestige table according to the sign of the described communication resource; Nodal information acquiring unit 822 is used for obtaining purpose index server node identification and communication credit value under the purpose ordinary node sign corresponding with the sign of the described communication resource, described purpose ordinary node from described territory interior nodes prestige table.
Concrete, referring to Fig. 8 C, acquiring unit 830 can comprise: query requests transmitting element 831, be used for sending query requests to described purpose index server node, described query requests is used for all ordinary nodes, the index server node under all ordinary nodes and the communication credit value that inquiry was communicated by letter with described purpose ordinary node; Territory interior nodes prestige table is searched unit 832, is used for the Query Information inquiry field interior nodes prestige table that returns according to described purpose index server node; Ordinary node acquiring unit 833 is used for all ordinary nodes from communicating by letter with described purpose ordinary node, obtains the ordinary node of communicating by letter with described source ordinary node; Global trust value computing unit 834, be used for according to the communicate by letter credit value of described source ordinary node with the purpose ordinary node, and the global trust value of the ordinary node of communicating by letter with described source ordinary node and the described purpose ordinary node of credit value calculating of communicating by letter of described purpose ordinary node.
as seen through the above description of the embodiments, in the embodiment of the present invention, network is divided into some territories, comprise an index server node and some ordinary nodes in each described territory, receive the communication request of the sign that comprises the communication resource that the endogenous ordinary node in territory sends when the endogenous index server node in territory after, search purpose ordinary node sign and the affiliated purpose index server node identification thereof at communication resource place according to the sign of the communication resource, the historical communication information of the purpose ordinary node that returns according to purpose index server node, obtain the global trust value of purpose ordinary node, when described global trust value surpasses the threshold value that sets in advance, allowing described source ordinary node to set up with described purpose ordinary node communicates by letter.Network in the embodiment of the present invention is minute network of territory management, because the index server node in each territory only is responsible for ordinary node in this territory to the inquiry of the communication of the ordinary node in other territory credit value, and do not inquire about alternately by index server node separately between same area, reduced thus the query load when only a station server being arranged in the distributed network, improved the search efficiency of single-point client, and the communications security of whole network and reliability.
Those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential general hardware platform.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product can be stored in storage medium, as ROM/RAM, magnetic disc, CD etc., comprise that some instructions are with so that a computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the present invention or embodiment.
Above-described embodiment of the present invention does not consist of the restriction to protection range of the present invention.Any modification of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.