Summary of the invention
For protection Internet user's in the BT downloading process privacy, method and node that the embodiment of the invention provides a kind of anonymity to obtain file.Said technical scheme is following:
On the one hand, the method that provides a kind of anonymity to obtain file, said method comprises:
Obtain the solicited message of client downloads file;
Generate the probability of transmitting described request information according to described request information;
Judge whether said probability satisfies preset scope,, otherwise described request information is transmitted to local neighbor node, make said client on the neighbor node of this locality, download said file if then give said client with the message transmission of said file.
Said message transmission with said file is given said client, comprising:
Judge whether this locality has said file,, otherwise return to said client-requested failure if then the information of the said file transmission path by described request message is returned to said client.
Said described request information is transmitted to local neighbor node, comprises:
Judge whether local neighbor node has said file, if then described request information is transmitted to said neighbor node.
Said with the neighbor node of described request forwards to this locality, also comprise afterwards:
Receive and store the information of the said file that said neighbor node returns, the information of said file comprises the information of the neighbor node that said neighbor node has.
The information of the said file that the said neighbor node of said storage returns comprises:
Rule according to preset is screened the neighbor node that said neighbor node has, and the said neighbor node that filters out is added to local neighbor node.
On the other hand, a kind of node is provided also, said node comprises:
Acquisition module is used to obtain the solicited message of client downloads file;
Generation module is used for generating the probability of transmitting described request information according to described request information;
Processing module; Be used to judge whether said probability satisfies preset scope; If then give said client, otherwise described request information is transmitted to local neighbor node, makes said client on the neighbor node of this locality, download said file the message transmission of said file.
Said processing module comprises:
First judging unit is used to judge whether this locality has said file, if then the information of the said file transmission path by described request message is returned to said client, otherwise returns to said client-requested failure.
Said processing module also comprises:
Second judging unit is used to judge whether local neighbor node has the neighbor node of said file, if then described request information is transmitted to said neighbor node.
Said processing module also comprises:
Memory cell is used for the described request forwards is given after the local neighbor node, receives and store the information of the said file that said neighbor node returns, and the information of said file comprises the information of the neighbor node that said neighbor node has.
Said memory cell comprises:
Add subelement, be used for the neighbor node that said neighbor node has being screened, the said neighbor node that filters out is added to local neighbor node according to preset rule.
The technical scheme that the embodiment of the invention provides is obtained the solicited message of client downloads file; Generate the probability of transmitting described request information according to described request information; Judge whether said probability satisfies preset scope,, otherwise described request information is transmitted to local neighbor node, make said client on the neighbor node of this locality, download said file if then give said client with the message transmission of said file.Transmit the solicited message of client like this with probability, make the assailant can not confirm whom the promoter who asks is, whom purpose side is again, and can only guess by probability, thereby guaranteed the two privacies of sending out of communication.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, will combine accompanying drawing that embodiment of the present invention is done to describe in detail further below.
Embodiment 1
Referring to Fig. 1, provide a kind of anonymity to obtain the method for file in the present embodiment, comprising:
101, obtain the solicited message of client downloads file;
102, generate the probability of transmitting described request information according to described request information;
103, judge whether said probability satisfies preset scope; If then give said client with the message transmission of said file; Otherwise described request information is transmitted to local neighbor node, makes said client on the neighbor node of this locality, download said file.
In the present embodiment, give said client, comprising the message transmission of said file:
Judge whether this locality has said file,, otherwise return to said client-requested failure if then the information of the said file transmission path by described request message is returned to said client.
Alternatively, in the present embodiment, described request information is transmitted to local neighbor node, comprises:
Judge whether local neighbor node has said file, if then described request information is transmitted to said neighbor node.
Alternatively, in the present embodiment, give local neighbor node, also comprise afterwards the described request forwards:
Receive and store the information of the said file that said neighbor node returns, the information of said file comprises the information of the neighbor node that said neighbor node has.
Preferably, the information of the said file that the said neighbor node of storage described in the present embodiment returns comprises:
Rule according to preset is screened the neighbor node that said neighbor node has, and the said neighbor node that filters out is added to local neighbor node.
The beneficial effect of present embodiment comprises: the solicited message of obtaining the client downloads file; Generate the probability of transmitting described request information according to described request information; Judge whether said probability satisfies preset scope,, otherwise described request information is transmitted to local neighbor node, make said client on the neighbor node of this locality, download said file if then give said client with the message transmission of said file.Transmit the solicited message of client like this with probability, make the assailant can not confirm whom the promoter who asks is, whom purpose side is again, and can only guess by probability, thereby guaranteed the two privacies of sending out of communication.
Embodiment 2
Referring to Fig. 2, present embodiment provides a kind of anonymity to obtain the method for file, comprising:
201, node receives the solicited message of the file in download of client initiation.
In the present embodiment; When client during to Tracker server requests file in download, Tracker responds, and selects part of nodes to be transferred to client; Join this node in the Swarm node listing simultaneously and present to client; Client selects arbitrary node in the node listing as request object behind Tracker server retrieves Swarm node listing, and initiates the request of file in download to this node.
202, after node is received the request of client initiation, generate the probability of transmitting described request message according to described request information.
In the present embodiment, after node is received solicited message,, can handle this solicited message, also can this solicited message be transmitted to its neighbor node and go to handle in this locality according to local processing policy.Concrete, after node receives solicited message, generate a probability of transmitting this request message at random, according to the processing mode of this request message of probable value decision.The probability of wherein transmitting request message can generate through random generator, also can generate through alternate manner, has a variety ofly in the concrete implementation prior art, and this present embodiment is not done concrete qualification.
203, judge that whether said probability satisfies preset scope, if execution in step 204 then; Otherwise execution in step 205.
In the present embodiment, judge that whether the local probability that generates satisfies preset scope, comprising: judge that whether the local probability that generates is less than preset threshold value; Wherein preset threshold value is pre-specified, can this present embodiment not done concrete qualification for 0.3,0.5 or 0.6, if preset threshold value is 0.6; If the probability that regulation generates less than 0.6, is then handled request message at local node, no longer request message is transmitted to other neighbor node; If the probability that generates greater than 0.6, then is transmitted to neighbor node with this request message and handles, the probability that generates like this locality is 0.8; Greater than 0.6, the neighbor node that then this request message is continued to be transmitted to other is handled, after neighbor node receives this request message; Carry out and the corresponding handling process of local node; Promptly generate the probability of transmitting request message, judge that this request message is to handle or be transmitted to other neighbor node to handle in this locality, repeats no more to this present embodiment.
In the present embodiment; Judge whether the local probability that generates satisfies preset scope; Comprise: judge that whether the local probability that generates is greater than preset threshold value; If greater than preset threshold value then handle this request message,, this present embodiment is not done concrete qualification if less than predetermined threshold value then this request message is transmitted to neighbor node handles at local node.
204, judge whether this locality has said file,, make said client download said file in this locality if then the information of the said file transmission path by described request message is returned to said client; Otherwise return to said client-requested failure.
In the present embodiment; Local node possibly be the node in the node listing that provides of Tracker server; Node in the node listing that wherein the Tracker server is provided is called node 1; Also possibly be the node that node 2 is forwarded to, according to local processing policy solicited message is transmitted to node 2 like node 1, node 2 is transmitted to node 3 with this solicited message again.If local node is a node 1, then judges and after request message is handled in this locality, then directly to give client file transfer.If local node is a node 3; And node 3 goes out the local solicited message of handling of needs according to the probabilistic determination that generates, and then this node judges at first whether this locality has the client-requested downloaded files, if the local file that client-requested is arranged; The then request of customer in response end; By the transmission path of solicited message the information of file is returned to client, be about to file and turn back to client to the original route of node 1, so that client is downloaded said file in this locality along node 3, node 2.
In the present embodiment, if local node is a node 3, then in the process of the fileinfo that node 3 returns; Each node of approach all can be stored the information of this document,, when receiving the fileinfo that node 3 returns, fileinfo is preserved like node 2; Stored this document information if judge this locality; Then,, then keep this document information if find that this locality does not store this document information again with this document information deletion.
In the present embodiment,, then return to the information of client-requested failure, make client can in the node listing that the Tracker server provides, seek other node file in download if there is not client to need downloaded files on the local node.
205, described request information is transmitted to local neighbor node, makes said client on the neighbor node of this locality, download said file.
In the present embodiment, if the probability that generates does not satisfy preset scope, as greater than preset threshold value, then this solicited message is transmitted to its neighbor node, this neighbor node is handled according to local processing policy this request message again.Wherein preferably, described request information is transmitted to local neighbor node, comprises: judge whether local neighbor node has the neighbor node of said file, if then described request information is transmitted to said neighbor node.In the present embodiment; Before solicited message being transmitted to neighbor node, judge whether neighbor node stores client and need ask downloaded files earlier; If its neighbor node has client to need downloaded files; Then again this solicited message is transmitted to this neighbours, can reduces the client-requested failed probability like this.
In the present embodiment, after any one node is received request, all can carry out probability and transmit, the assailant can not confirm whom the promoter who asks is, whom purpose side is again like this, and can only guess by probability, thereby has guaranteed the two privacies of sending out of communication.
206, receive and the information of the said file that the storage neighbor node returns.
In the present embodiment,,, solicited message handles but being transmitted to neighbor node if local node is not handled solicited message; Like above-mentioned node 3 decision response request messages; Then node 3 is along node 2, and the path of node 1 returns the information of file, and the information of its file is except the content that comprises the client-requested file in download; The information that also comprises the neighbor node that this neighbor node has; Node 1 is preserved this information after receiving the fileinfo that node 3 returns, and the neighbor node that this neighbor node has is added to local neighbor node.
Alternatively, in the present embodiment, node 1 can screen the neighbor node that said neighbor node has according to preset rule, and the said neighbor node that filters out is added to local neighbor node.In the concrete present embodiment, preset rule can be, judges on some neighbor node that neighbor node has whether identical fileinfo is arranged; If, then can these nodes be added to local neighbor node, or; Judge the fileinfo whether predetermined number is arranged on some neighbor node that neighbor node has, as surpassing the information of 20 files, if then can such node be added to neighbor node; And can further screen the neighbor node that adds to, with some good communication quality, abundant in content node is left neighbor node; Relative; The node knot removal that some contents are few is not done concrete qualification to this present embodiment, and total principle is to make the node that has same file fragmentation flock together with bigger probability; The node that will guarantee to have different bursts simultaneously becomes the neighbours of oneself, can guarantee with very high probability successful request.
The beneficial effect of the technical scheme that the embodiment of the invention provides is: the solicited message of obtaining the client downloads file; Generate the probability of transmitting described request information according to described request information; Judge whether said probability satisfies preset scope,, otherwise described request information is transmitted to local neighbor node, make said client on the neighbor node of this locality, download said file if then give said client with the message transmission of said file.Transmit the solicited message of client like this with probability, make the assailant can not confirm whom the promoter who asks is, whom purpose side is again, and can only guess by probability, thereby guaranteed the two privacies of sending out of communication.And solicited message is being transmitted to before the neighbor node to judge whether neighbor node has the information of demand file earlier,, can improving the client-requested probability of successful like this if having then again solicited message is transmitted to neighbor node.And after the information that receives the file that neighbor node returns, storage this document information, the neighbor node that neighbor node is had is added to local neighbor node, so further assurance client-requested probability of successful.
Embodiment 3
Referring to Fig. 3, a kind of node is provided in the present embodiment, said node comprises: acquisition module 301, generation module 302 and processing module 303.
Acquisition module 301 is used to obtain the solicited message of client downloads file;
Generation module 302 is used for generating the probability of transmitting described request information according to described request information;
Processing module 303; Be used to judge whether said probability satisfies preset scope; If then give said client, otherwise described request information is transmitted to local neighbor node, makes said client on the neighbor node of this locality, download said file the message transmission of said file.
Referring to Fig. 4, in the present embodiment, processing module 303 comprises:
The first judging unit 303a is used to judge whether this locality has said file, if then the information of the said file transmission path by described request message is returned to said client, otherwise returns to said client-requested failure.
Alternatively, processing module 303 also comprises in the present embodiment:
The second judging unit 303b is used to judge whether local neighbor node has said file, if then described request information is transmitted to said neighbor node.
Alternatively, referring to Fig. 4, in the present embodiment, processing module 303 also comprises:
Memory cell 303c is used for the described request forwards is given after the local neighbor node, receives and store the information of the said file that said neighbor node returns, and the information of said file comprises the information of the neighbor node that said neighbor node has.
Preferably in the present embodiment, memory cell 303c comprises:
Add subelement, be used for the neighbor node that said neighbor node has being screened, the said neighbor node that filters out is added to local neighbor node according to preset rule.
The beneficial effect of present embodiment comprises: the solicited message of obtaining the client downloads file; Generate the probability of transmitting described request information according to described request information; Judge whether said probability satisfies preset scope,, otherwise described request information is transmitted to local neighbor node, make said client on the neighbor node of this locality, download said file if then give said client with the message transmission of said file.Transmit the solicited message of client like this with probability, make the assailant can not confirm whom the promoter who asks is, whom purpose side is again, and can only guess by probability, thereby guaranteed the two privacies of sending out of communication.
The node that present embodiment provides specifically can belong to same design with method embodiment, and its concrete implementation procedure sees method embodiment for details, repeats no more here.
The all or part of of the technique scheme that the embodiment of the invention provides can be accomplished through the relevant hardware of program command; Said program can be stored in the storage medium that can read, and this storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
The above is merely preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.