Document down loading method and system based on P2P
Technical field
The invention belongs to technical field of the computer network, relate to a kind of document down loading method, relate in particular to a kind of document down loading method based on P2P; Simultaneously, the invention still further relates to a kind of file download system based on P2P.
Background technology
What the network video system in past adopted is the structure of C/S or B/S, promptly exists a server (Server) as intermediate node, handles each user's (Client or Browser) request and sends video data to the user.The defective of this structure is the requirement of intermediate node too high, because server does not often reach desired data capacity of whole system and transmission bandwidth, causes the bottleneck on the hardware, so these systems often do not reach the requirement of real-time play.Up to the maturation of P2P (Peer-to-Peer, point-to-point) technology, just make network video system really move towards to use based on the appearance of the video system of P2P network; Network video system based on P2P continues to bring out now; Comprise PPStream, PPLive etc. have set up many customer groups.
Network video system based on P2P has following advantage: decentralized: resource in the network and service are dispersed on all nodes, and the realization of transmission of Information and service is all directly carried out between node.Extensibility: in the P2P network, along with user's adding, the increase in demand of not only serving, the resource of entire system and service ability are also synchronously expanding, and can more easily satisfy user's needs all the time.Robustness: carry out because service is dispersed between each node, part node or network are destroyed the influence of other part very little.High performance-price ratio: adopt the P2P framework can effectively utilize a large amount of common node of scattering in the Internet, reach the purpose of high-performance calculation and mass memory.More than these characteristics exactly can remedy the weak point of C/S network video system in the past, make the practicability of video network become possibility.
P2P is a kind of distributed network; The participant of network shares a part of hardware resource (disposal ability, storage capacity, network concatenation ability, printer etc.) that they are had; These shared resources need provide service and content by network, can directly be visited and need not the process intermediate entities by other peer node.Participant in this network is resource (service and content) supplier, is again that resource (service and content) obtains taker.In the P2P system, be divided into many piecemeals to file usually during transfer files, the user sets up one as a node and other node and is connected, and selects own required piecemeal from other node, and node is many more like this, and the piecemeal that can download simultaneously is many more, and efficient is high more; But owing to have only a connection between node, can only download a piecemeal simultaneously, the transmission downloading efficiency descended at node from other node.
Comprise the Tracker server in the P2P system,, offer corresponding node in order to collect other node identifications of downloading identical file.Existing a lot of Tracker server all is to return a pile node at random when receiving the client query node, carries out node by client again and connects screening.
This search algorithm has following shortcoming:
The first, client will be inquired about repeatedly, just can be connected to enough nodes.Slow down the speed that client gets into network, increase Tracker server computation burden
The second, because return node at random, therefore the outlet upstream and downstream bandwidth of uncontrollable each Virtual network operator increases operator's cost, to whole network build-up of pressure.
Summary of the invention
Technical problem to be solved by this invention is: a kind of document down loading method based on P2P is provided, can reduces Tracker server computation burden, and reduce the Virtual network operator cost, accelerate data sharing and propagation velocity.
In addition, the present invention further provides a kind of file download system based on P2P, can reduce Tracker server computation burden, and reduces the Virtual network operator cost, accelerates data sharing and propagation velocity.
For solving the problems of the technologies described above, the present invention adopts following technical scheme:
A kind of document down loading method based on P2P, said method for down loading comprises the steps:
Step S1, Tracker server load the IP storehouse of the client of downloading identical file, serve as to divide according to management node with Virtual network operator type, geographical position;
Step S2, when the Tracker server is received the client node query requests, inquire about the Virtual network operator type and the geographical position of this client ip;
Step S3, Tracker server mate said client and other nodes; The node that matching principle has identical network operator type for preferential coupling and said client, if the interstitial content that matches is during less than set point, coupling and the identical node in said client geographical position again.
As a kind of preferred version of the present invention, among the said step S3, the method for mating the node identical with said client geographical position is:
Preferential coupling and said client are in the node in same city;
If the interstitial content that matches is during less than set point, coupling and said client are in the node in same province again;
If the interstitial content that matches is during less than set point, coupling and said client are in the node of the same area again.
A kind of file download system based on P2P, said VOD system comprises:
Some nodes;
The Tracker server in order to collect other node identifications of downloading identical file, offers corresponding node; Said Tracker server comprises:
-IP database management module in order to load the IP storehouse of the client of downloading identical file, serves as to divide according to management node with Virtual network operator type, geographical position;
-client ip enquiry module in order to when the Tracker server is received the client node query requests, is inquired about the Virtual network operator type and the geographical position of this client ip;
-node matching module is in order to mate said client and other nodes; The node that matching principle has identical network operator type for preferential coupling and said client, if the interstitial content that matches is during less than set point, coupling and the identical node in said client geographical position again.
As a kind of preferred version of the present invention, the method for the node that said node matching module coupling is identical with said client geographical position is:
Preferential coupling and said client are in the node in same city;
If the interstitial content that matches is during less than set point, coupling and said client are in the node in same province again;
If the interstitial content that matches is during less than set point, coupling and said client are in the node of the same area again.
As a kind of preferred version of the present invention, said VOD system also comprises the order program data source server, in order to the order program data source to be provided.
Beneficial effect of the present invention is: document down loading method and system that the present invention proposes based on P2P, when the Tracker server is received the client node query requests, said client and other nodes are mated; Preferential coupling and the node that said client has identical network operator type are mated and the identical node in said client geographical position again.
The online number of a file is many more, the area dividing that then can more become more meticulous more.When online number reached certain value, optimal effect was exactly that the node of consolidated network operator only connects the node with the city.The present invention can reduce Tracker server computation burden, and reduces the Virtual network operator cost, accelerates sharing and propagation velocity of data.
Description of drawings
Fig. 1 is the composition sketch map of demand stream media system of the present invention.
Fig. 2 is the flow chart of stream media ordering method of the present invention.
Embodiment
Specify the preferred embodiments of the present invention below in conjunction with accompanying drawing.
Embodiment one
See also Fig. 1, the present invention has disclosed a kind of file download system based on P2P, and said VOD system comprises: some nodes (being client) 10, Tracker server 20, order program data source server 30.Order program data source server 30 is in order to provide the order program data source file.
Tracker server 20 offers corresponding node 10 in order to collect other node identifications of downloading identical file.
Said Tracker server comprises: IP database management module 21, client ip enquiry module 22, node matching module 23.
-IP database management module 21 serves as to divide according to management node in order to load the IP storehouse of the client of downloading identical file with Virtual network operator type, geographical position.
-client ip enquiry module 22 is inquired about the Virtual network operator type and the geographical position of this client ip in order to when the Tracker server is received the client node query requests.
-node matching module 23 is in order to mate said client and other nodes; The node that matching principle has identical network operator type for preferential coupling and said client, if the interstitial content that matches is during less than set point, coupling and the identical node in said client geographical position again.
The method of the node that said node matching module coupling 23 is identical with said client geographical position is: preferential coupling and said client are in the node in same city; If the interstitial content that matches is during less than set point, coupling and said client are in the node in same province again; If the interstitial content that matches is during less than set point, coupling and said client are in the node in the same area (like East China, south China, North China or the like) again.
The online number of a file is many more, the area dividing that then can more become more meticulous more.When online number reached certain value, optimal effect was exactly that the node of consolidated network operator only connects the node with the city.
More than introduced the composition of the file download system that the present invention is based on P2P, the present invention also discloses a kind of method for down loading of above-mentioned download system when disclosing above-mentioned download system.See also Fig. 2, said document down loading method based on P2P comprises the steps:
[step S1] Tracker server loads the IP storehouse of the client of downloading identical file, serves as to divide according to management node with Virtual network operator type, geographical position;
When [step S2] receives the client node query requests at the Tracker server, inquire about the Virtual network operator type and the geographical position of this client ip;
[step S3] Tracker server matees said client and other nodes; The node that matching principle has identical network operator type for preferential coupling and said client, if the interstitial content that matches is during less than set point, coupling and the identical node in said client geographical position again.
The method of the node that wherein, coupling is identical with said client geographical position is: preferential coupling and said client are in the node in same city; If the interstitial content that matches is during less than set point, coupling and said client are in the node in same province again; If the interstitial content that matches is during less than set point, coupling and said client are in the node of the same area again.
In sum, document down loading method and system based on P2P that the present invention proposes when the Tracker server is received the client node query requests, mate said client and other nodes; Preferential coupling and the node that said client has identical network operator type are mated and the identical node in said client geographical position again.
The present invention can reduce Tracker server computation burden, and reduces the Virtual network operator cost, accelerates sharing and propagation velocity of data.
Here description of the invention and application is illustrative, is not to want with scope restriction of the present invention in the above-described embodiments.Here the distortion of the embodiment that is disclosed and change are possible, and the replacement of embodiment is known with the various parts of equivalence for those those of ordinary skill in the art.Those skilled in the art are noted that under the situation that does not break away from spirit of the present invention or substantive characteristics, and the present invention can be with other form, structure, layout, ratio, and realize with other assembly, material and parts.Under the situation that does not break away from the scope of the invention and spirit, can carry out other distortion and change here to the embodiment that is disclosed.