CN101917488B - BT download method, device and system - Google Patents

BT download method, device and system Download PDF

Info

Publication number
CN101917488B
CN101917488B CN 201010264494 CN201010264494A CN101917488B CN 101917488 B CN101917488 B CN 101917488B CN 201010264494 CN201010264494 CN 201010264494 CN 201010264494 A CN201010264494 A CN 201010264494A CN 101917488 B CN101917488 B CN 101917488B
Authority
CN
China
Prior art keywords
downloaded
resources
information
burst
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN 201010264494
Other languages
Chinese (zh)
Other versions
CN101917488A (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.)
Huawei Digital Technologies Chengdu Co Ltd
Original Assignee
Huawei Symantec Technologies 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 Huawei Symantec Technologies Co Ltd filed Critical Huawei Symantec Technologies Co Ltd
Priority to CN 201010264494 priority Critical patent/CN101917488B/en
Publication of CN101917488A publication Critical patent/CN101917488A/en
Application granted granted Critical
Publication of CN101917488B publication Critical patent/CN101917488B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention discloses a BT download method, which comprises the following steps: obtaining a first request data packet which is sent to an index server in a network; sending a second request data packet to the index server according to resource information to be downloaded which is obtained by analyzing the first request data packet, wherein the second request data packet is used for requesting for owning client-end list information of resources to be downloaded from the index server; receiving the client-end list information returned by the index server; interacting with at least one client end in the client-end list and obtaining fragment information of the resources to be downloaded, which comprises fragment size information; and downloading the resources to be downloaded from at least one client end according to the fragment information of the resources to be downloaded. By adopting the download method, BT resources can be downloaded when seed documents cannot be found, thus improving the reliability of BT resource downloading.

Description

A kind of BT method for down loading, Apparatus and system
Technical field
The present invention relates to communication technical field, relate in particular to a kind of BT method for down loading, Apparatus and system.
Background technology
P-2-P technology (peer-to-peer is called for short P2P) claims reciprocity internet technique again, is a kind of network information exchanged form with respect to client/server (C/S) pattern.In the P2P network, each node both can be used as client and had obtained service from other nodes, and also can serve as server provides service to other nodes.Since the P2P network can greatly alleviate the pressure of server end in traditional C/S network architecture excessive, be prone to problem such as single failpoint, can take full advantage of the affluent resources of terminal again, so the P2P technology is widely used in each application of computer network, as aspects such as distributed science calculating, file-sharing, live streaming media and program request, voice communication and game on line support platforms.
BT is the abbreviation of bit-torrent BitTorrent, is that a kind of P2P of dependence mode is shared file and the agreement of transmitting between a large amount of Internet users, because its realization is simple, easy to use, is widely used between Chinese user.Node among the BT is when sharing a file, at first be kept at a stream (Torrent) type file (being the .torrent file) with file fragmentation and with file and burst information, this Torrent file is commonly called seed file, and the node that has seed file is called kind of a child node visually.Seed file is text in essence, comprises Tracker information and fileinfo two parts.If need the address of the index server (being the Tracker server) used during Tracker information spinner BT downloads and at the setting of Tracker server, fileinfo is to generate according to the calculating to file destination, and result of calculation is encoded according to the B coding rule in the BitTorrent agreement.Its cardinal principle is need downloaded files is virtual to be divided into equal-sized burst providing, the burst size is necessary for the integer power of 2k (owing to be virtual burst, do not produce each slicing files on the hard disk), and the index information of each burst and Hash identifying code write in the seed file.When the user when downloading this document, can the part burst of file be downloaded according to the information of seed file, between other download the node of this document, share the burst of oneself having downloaded then, exchange each other's needs, thereby realize the quick distribution of file.Because each node at the burst of uploading this document for other users, so on the whole, can not reduce speed of download along with the increase of number of users yet when downloading file, the people of Xia Zaiing is more many on the contrary, and speed is more fast.
The inventor is in realizing process of the present invention, find that client must be searched for the seed file that obtains resources to be downloaded earlier in the existing BT downloading process in network, could download the BT resource from other peer node according to seed file then, yet, owing to reasons such as the frequent changes in the website that has the BT seed file, cause part BT seed file to be difficult to obtain, thereby thereby exist a large amount of because finding seed file can't download the situation of BT resource.
Summary of the invention
The object of the invention is to provide a kind of BT method for down loading, Apparatus and system, can not find realization BT resource downloading under the situation of seed file.
According to the one side of the embodiment of the invention, a kind of BT method for down loading is provided, comprising:
Obtain first request data package that the peer node Peer in the network sends to index server;
Send second request data package according to the resources to be downloaded information of resolving described first request data package acquisition to described index server, described second request data package is used for having to the index server request client side list information of described resources to be downloaded;
Receive the client side list information that described index server returns;
The burst information of described resources to be downloaded is determined in the information analysis that obtains by described resources to be downloaded information and at least one client from described client side list, and described burst information comprises the burst size information;
According to described burst information from the described resources to be downloaded of described at least one client downloads.
According to the embodiment of the invention on the other hand, provide a kind of BT download apparatus, comprising:
The packet acquiring unit is used for obtaining the peer node Peer of network to first request data package of index server transmission;
Request unit, be used for according to sending second request data package according to the described resources to be downloaded information of resolving described first request data package acquisition to described index server, described second request data package is used for having to the index server request client side list information of described resources to be downloaded;
Receiving element is used for receiving the client side list information that described index server returns;
Processing unit is used for determining the burst information of described resources to be downloaded by described resources to be downloaded information and from the information analysis that at least one client of described client side list obtains that the burst information of described resources to be downloaded comprises the burst size information;
Download unit is used for burst information according to described resources to be downloaded from the described resources to be downloaded of described at least one client downloads.
One side again according to the embodiment of the invention provides a kind of BT download system, comprises index server and at least two above-mentioned BT download apparatus.
The method for down loading that the embodiment of the invention provides, Apparatus and system can be by other clients or server in the extracting network to first request data package of index server transmission, and parsing obtains the address of index server, the size information of resources to be downloaded signs and the described resources to be downloaded resource information that waits for downloads, send second request data package according to the resources to be downloaded information structuring that obtains and to index server, thereby obtain the client side list information that has resources to be downloaded that index server returns, and by with client side list at least one client obtain the burst information of resources to be downloaded alternately, thereby according to the burst information of resources to be downloaded at least one client downloads fragment data, make do not obtain seed file please condition under also can carry out BT and download, promote the reliability of BT resource downloading, better realized sharing of BT resource.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the invention, the accompanying drawing of required use is done to introduce simply in will describing embodiment below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
The schematic flow sheet of a kind of BT method for down loading that Fig. 1 provides for the embodiment of the invention;
The schematic flow sheet of the another kind of BT method for down loading that Fig. 2 provides for the embodiment of the invention;
The structural representation of a kind of client that Fig. 3 provides for the embodiment of the invention;
The structural representation of the another kind of client that Fig. 4 provides for the embodiment of the invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Need to prove, the BT method for down loading that the embodiment of the invention provides is that a kind of being different from must obtain the new downloading mode that seed file just can carry out the BT resource downloading in the conventional download method, and the BT method for down loading that the embodiment of the invention provides also can carry out the download of BT resource under the situation that can't obtain seed file.To the scheme of the embodiment of the invention be described in detail below.
The schematic flow sheet of a kind of BT method for down loading that Fig. 1 provides for the embodiment of the invention, as shown in the figure, this method comprises:
Step 100 is obtained first request data package that sends to index server in the network;
Concrete, can grasp first request data package that the peer node Peer in the network sends to index server (being the Tracker server), this first request data package is the request data package that other clients or server request index server return the client side list information that has identical resources to be downloaded in the network, concrete, this first request data package can be the request data package of Get type, the address that can comprise the Tracker server in this packet, the size information of resources to be downloaded sign and resources to be downloaded, wherein the resources to be downloaded sign is used for the unique identification resources to be downloaded.
Wherein, the Tracker server is necessary role during BT downloads.BT client client is downloading beginning and is downloading in the process of carrying out, otherwise communicating with the Tracker server of stopping, reporting the information of oneself, and obtains the information of other download client client.This communication is undertaken by http protocol, and its process is such:
Client sends out the GET request of a HTTP to the Tracker server, and its information is placed in the parameter of GET, the roughly meaning of this GET request can be: I am xxx (a unique id), and I want to download the yyy file, my ip is aaa, and the port of my usefulness is bbb....
The Tracker server is safeguarded all download persons' information, after it receives a request, at first the other side's information is noted (if place on record, whether need upgrade) if so just checking, the information that then a part (being not all, according to parameter download person's the request that arranges) is participated in the download person of the same file of download (a Tracker server may be safeguarded the download of a plurality of files simultaneously) returns to the other side.Client just can obtain other download person's information after the response of receiving the Tracker server, it just can connect with other download person according to these information so, downloads file fragment there from them.
Step 105, send second request data package according to the resources to be downloaded information of resolving described first request data package acquisition to described index server, described second request data package is used for having to the index server request client side list information of described resources to be downloaded;
Concrete, can be by resolving size information that first request data package that packet capturing obtains obtains Tracker address, resources to be downloaded sign and the resources to be downloaded resource information that waits for downloads, according to resources to be downloaded information structuring second request data package that obtains, to return the client side list information that has described resources to be downloaded to the index server request, concrete, this second request data package also can be the request data package of Get type.
Step 110 receives the client side list information that described index server returns;
Concrete, after index server receives second request data package, can return the client side list information that has these resources to be downloaded according to the resources to be downloaded information in second request data package.Need to prove, can comprise the client-side information that has these resources to be downloaded in the client side list information that index server returns, the information that also can comprise the server that has these resources to be downloaded, wherein, the client and server that has resources to be downloaded all is the peer node Peer that has these resources to be downloaded.For convenience, the embodiment of the invention is that example describes with the client.
Step 115, at least one client from described client side list obtains the burst information of described resources to be downloaded, and described burst information comprises the burst size information;
Concrete, after receiving the client side list information that described index server returns, can by with this client side list at least one client carry out BT and shake hands alternately, receive the burst information of the resources to be downloaded that at least one client returns after BT shakes hands, and determine the burst size of resources to be downloaded according to the burst information of the resources to be downloaded that receive.
Step 120, according to described burst information from described at least one client downloads resources to be downloaded.
Concrete, can send download request to described at least one client according to the burst size of the resources to be downloaded of determining, from described at least one client downloads resources to be downloaded.
By the embodiment of the invention one described BT method for down loading, can be by other clients or server in the extracting network to first request data package of index server transmission, and resolve the address that first request data package obtains index server, the size information of resources to be downloaded signs and the described resources to be downloaded resource information that waits for downloads, structure also sends second request data package to index server, thereby obtain the client side list information that has resources to be downloaded that index server returns, and by with client side list at least one client obtain the burst information of resources to be downloaded alternately, thereby according to the burst information of resources to be downloaded at least one client downloads fragment data, make do not obtain seed file please condition under also can carry out BT and download, promote the reliability of BT resource downloading, better realized sharing of BT resource.
The schematic flow sheet of the another kind of BT method for down loading that Fig. 2 provides for the embodiment of the invention, it is that example is described that the embodiment of the invention two is downloaded the F file with customer end A, if customer end A does not find the seed file of F file in network, then customer end A can be downloaded the F file by the described method of present embodiment.As shown in the figure, this method comprises:
Step 200, customer end A grasp first request data package from network;
Concrete, when customer end A will be downloaded resources to be downloaded F, if it does not obtain the seed file of F file in network, can obtain other clients (for example customer end B) of downloaded resources F in the network to first request data package of Tracker server transmission by packet capturing, in the present embodiment, this first request data package can be the request data package of Get type, the purpose of this first request data package is to obtain the information of other peer that has resources to be downloaded to the Tracker server, in order to download the BT resource with other peer communication.
For example, the resource that customer end B will be downloaded is that the resource that will download with customer end A is identical, all be to download file F, and B has obtained the seed of F file in network, after B obtains seed file, can send the Get request data package to the Tracker server according to the relevant information in the seed file that obtains, to have the information of other peer of F file from the acquisition of Tracker server, in order to download the F file with other peer communication, when customer end A does not obtain the seed file of F file, can in network, the mode by packet capturing obtain the Get request data package that customer end B sends to the Tracker server, present embodiment is that Get announce request data package is that example describes with the Get request data package, need to prove, Get announce request is the HTTP Get request of standard, wherein, parameter info_hash in the Get announce request data package is used for the unique identification file to be downloaded, therefore, during the customer end A packet capturing, can determine the Getannounce request data package that it will obtain according to the parameter value info_hash in the Get announce request data package.
Step 205, customer end A are resolved first request data package;
Concrete, can resolve the Get announce request data package that customer end B sends to the Tracker server, obtain Tracker server address, the sign of resources to be downloaded and the size information of resources to be downloaded.Wherein, the form of Get announce request can for:
GET?announce?info_hash=xxx&download=m&left=n&...
Wherein, can from the packet header of this Get announce request data package, extract address information and the port numbers of Tracker, directly obtain the sign info_hash of resources to be downloaded according to Get announce parameter, and by the download in the Get announce parameter and left addition being obtained the size of resources to be downloaded.
Step 210, customer end A sends second request data package to the Tracker server;
Concrete, client is according to resolving information (comprising: the sign info_hash of the address information of Tracker server and port numbers, resources to be downloaded, the size of resources to be downloaded) structure second request data package that first request data package obtains in the step 205, and send second request data package of structure to the Tracker server, to obtain to have the peer list information of resources to be downloaded F to the request of Tracker server.Wherein, in the present embodiment, second request data package also is Get announce request data package.
Step 215, customer end A receives the client side list peer list information that the Tracker server returns;
Concrete, after the Tracker server receives second request data package of customer end A transmission, can return to customer end A and participate in downloading for example other download persons' of F information peer list of same file.The IP address and the port numbers that include each peer in the peer list information of wherein returning.
Need to prove, can comprise the client-side information that has these resources to be downloaded in the client side list information that index server returns, the information that also can comprise the server that has these resources to be downloaded, wherein, the client and server that has resources to be downloaded all is the peer node Peer that has these resources to be downloaded.For convenience, the embodiment of the invention is that example describes with the client.
Step 220, customer end A sends BT handshake request message according to peer list information at least one peer;
Concrete, IP address and the port numbers of the peer of the same file of download that customer end A can be returned according to the Tracker server send handshake request message at least one peer (for example client C) wherein, to connect with it.Usually, customer end A can send BT handshake request message to all peer.
Step 225, customer end A receive BT that at least one peer the returns response message of shaking hands, and establish a communications link with at least one peer;
Step 230, customer end A receive at least one peer in the bit field bitfield message of the resources to be downloaded of the back transmission that establishes a communications link;
According to the BT protocol requirement, after download client and other peer connect by shaking hands, can send bitfield message to the other side immediately, the burst situation of the resources to be downloaded that circular has separately, if peer does not have the burst of resources to be downloaded, then this peer can not send bitfield message.Wherein, include three parts in the bitfield message: message-length Message Length, type of message Message Type, data payload Payload, wherein, message-length Message Length is the length of type of message Message Type and the length sum of data payload Payload; The value of Message Type is 5 in the bitfield message, and its length is 1 byte; Data payload Payload part is actual to be a bitmap, if this Peer has certain burst of resources to be downloaded, so Dui Ying position puts 1, otherwise puts 0.
Step 235, the burst size that customer end A is determined resources to be downloaded according to size and the bitfield message analysis of resources to be downloaded;
According to the BT protocol requirement, receive the bitfield message of the resources to be downloaded that peer (for example client C) sends after BT shakes hands when customer end A after, can obtain the length of the data Payload that this peer (for example client C) returns according to the length (1 byte) that the Message Length that carries in this bitfield message deducts type of message Message Type.Be length=Message Length-1 of Payload.Because the burst of each (bit) sign among the Payload, and 1 byte equals 8 (bit), therefore, the burst number that can determine the resources to be downloaded that this peer has by the length of Payload at head and the tail in the interval of 7 bit.For example: it is 9 that certain resources to be downloaded is divided into, need 2 bytes to represent (second byte only used one), and another BT resource is divided into 16, also only need 2 bytes to represent, then if resolving the length of the Payload of bitfield message acquisition is 2, can judge the burst number of these resources to be downloaded between the 9-16 sheet.
Owing in step 205, obtain the size of resources to be downloaded by parsing first request data package, in this step, can extrapolate total burst number of these resources to be downloaded according to the length of the Payload in the bitfield message that obtains, and, because each burst size of BT resource is generally 2 n power, for example: 32K, 64k, 128K, 256k, 512K, 1M, 2M, 4M, 8M, therefore, in this step can be further obtain the burst size of resources to be downloaded according to the burst number of the size of resources to be downloaded and resources to be downloaded, concrete, can be with the resources to be downloaded size respectively divided by two end values of burst number interval, obtain an interval of burst size, the value of getting 2 Nth power in the interval of burst size then is the burst size of these resources to be downloaded.For example: if customer end A is 330K by the size that grasps first request data package acquisition resources to be downloaded F, the length that obtains Payload by the bitfield message of resolving peer (for example client C) transmission is 2 bytes, and the burst number that can extrapolate these resources to be downloaded F is between the 9-16 sheet, then the burst of these resources to be downloaded F size is at [330K/16,330K/9] value of Nth power of 2 in (being 20.6K-36.67K) interval, then can get 32K in the 20.6K-36.67K interval and be the burst size of these resources to be downloaded.
Step 240, customer end A sends download request according to the burst size of analyzing the resources to be downloaded that obtain at least one peer;
Concrete, obtained the size of resources to be downloaded bursts when customer end A after, can be with described at least one peer mutual and send download request, in the practical application, when customer end A will be downloaded the resources to be downloaded burst from client C, customer end A at first must with it with client C between be connected and be set to interested, be exactly to send out an interested message to go in fact, and client C will check whether it should send data to customer end A, if the customer end A of client C is unchoke, so just can send unchoke message to customer end A, receive the unchoke message of client C transmission when customer end A after, can download concrete fragment data with request to the message of a Request type of client C transmission, comprise the index Piece Index of resources to be downloaded burst in the message of this Request type, the offset address Block Offset of data to be downloaded and data length Block Length to be downloaded.Those skilled in the art can know that customer end A can be downloaded the data in the burst in batches, once only downloads the partial data piece of certain burst, also can once download all data of this burst.In the practical application, usually client is to the peer request resource time, generally can once whole burst once not downloaded, but being divided into several data block Block, downloads a burst, a general Block is 16K, after the burst size of knowing resources to be downloaded, client can be divided into a plurality of data blocks according to the burst size.Wherein, Block Offset is the offset address of data block in the burst of resources to be downloaded.For example if the burst size of certain resources to be downloaded is 32K, be that a data block is divided the burst of described resources to be downloaded with 16K, then the offset address Block Offset of first data block is 0, Block Length is 16k, the offset address Block Offset of second data block is 16*1024, and Block Length also is 16K.
Step 245, customer end A receive the fragment data that at least one peer returns according to described download request.
Concrete, after at least one peer (for example client C) receives the Request message of customer end A, can return a Piece message to customer end A, this Piece message includes the burst index Piece Index of the resources to be downloaded of customer end A request, offset address Block Offset and the data Block Data to be downloaded of data to be downloaded, wherein, the offset address Block Offset of described data to be downloaded refers to data block to be downloaded offset address in this burst.Thereby make customer end A finish download to these resources to be downloaded.
The BT method for down loading that provides by the embodiment of the invention, customer end A is under the situation of the seed file that does not obtain resources to be downloaded, can be by in network, grasping the Get announce request data package that other clients of downloading same asset send to the Tracker server, and send the 2nd Get announce request according to the information structuring that resolve to obtain and to the Tracker server, to obtain the peer list information that has resources to be downloaded that the Tracker server returns, by mutual with at least one peer, obtain the burst size of resources to be downloaded, download resources to be downloaded according to the burst size of this acquisition at least one peer again.Thereby realized that client also can carry out BT and download under the situation of the seed file that does not obtain resources to be downloaded, promoted the reliability of BT resource downloading, better realized sharing of resource.
The structural representation of a kind of BT download apparatus that Fig. 3 provides for the embodiment of the invention, as shown in Figure 3, described BT download apparatus comprises:
Packet acquiring unit 300 is used for obtaining first request data package that network sends to index server;
Concrete, packet acquiring unit 300 can grasp first request data package that other clients in the network send to index server (being the Tracker server), this first request data package is the request data package that other client-requested index servers return the client side list information that has identical resources to be downloaded in the network, concrete, this first request data package can be the request data package of Get type, can comprise the Tracker address in this packet, the size information of resources to be downloaded sign and resources to be downloaded, wherein the resources to be downloaded sign is used for the unique identification resources to be downloaded.
Request unit 305, be used for according to sending second request data package according to the described resources to be downloaded information of resolving described first request data package acquisition to described index server, described second request data package is used for having to the index server request client side list information of described resources to be downloaded;
Concrete, resource information that request unit 305 can obtain the Tracker server address by first request data package that resolution data bag acquiring unit 300 obtains, resources to be downloaded identify and the size information of resources to be downloaded waits for downloads, according to resources to be downloaded information structuring second request data package that obtains, to return the client side list information that has described resources to be downloaded to the index server request, concrete, this second request data package also can be the request data package of Get type.
Receiving element 310 is used for receiving the client side list information that described index server returns;
Concrete, after index server receives second request data package, can return the client side list information that has these resources to be downloaded according to the resources to be downloaded information in second request data package.Receiving element 310 namely is used for receiving the client side list information that described index server returns.
Processing unit 315, for the burst information that obtains described resources to be downloaded from least one client of described client side list, the burst information of described resources to be downloaded comprises the burst size information;
Concrete, after receiving element 310 receives the client side list information that described index server returns, processing unit 315 can by with this client side list at least one client carry out BT and shake hands alternately, receive the burst information of the resources to be downloaded that at least one client returns after BT shakes hands, and determine the burst size of these resources to be downloaded according to the burst information of the resources to be downloaded that obtain.
Download unit 320 is used for burst information according to described resources to be downloaded from the described resources to be downloaded of described at least one client downloads.
Concrete, the burst size of the resources to be downloaded that download unit 320 can be determined according to processing unit 315 sends download request to described at least one client, from described at least one client downloads resources to be downloaded.
The BT download apparatus that the embodiment of the invention provides can be by grasping the request data package that other clients send to index server in the network, and parsing obtains the address of index server, the size information of resources to be downloaded signs and the described resources to be downloaded resource information that waits for downloads, and construct second request data package, thereby obtain the client side list information that has resources to be downloaded that index server returns, and by with client side list at least one client obtain the burst information of resources to be downloaded alternately, thereby according to the burst information of resources to be downloaded at least one client downloads fragment data, make do not obtain seed file please condition under also can carry out BT and download, promote the reliability of BT resource downloading, better realized sharing of BT resource.
The structural representation of the another kind of BT download apparatus that Fig. 4 provides for the embodiment of the invention, as shown in Figure 4, this download apparatus comprises:
Packet acquiring unit 300 is used for obtaining first request data package that network sends to index server;
Concrete, when the download device will be downloaded resources to be downloaded F, if it does not obtain the seed file of F file in network, can obtain other clients (for example customer end B) of downloaded resources F in the network to first request data package of index server (being the Tracker server) transmission by packet capturing, in the present embodiment, this first request data package can be the request data package of Get type, the purpose of this first request data package is to obtain the information of other peer that has resources to be downloaded to the Tracker server, in order to download the BT resource with other peer communication.
Request unit 305, be used for according to sending second request data package according to the described resources to be downloaded information of resolving described first request data package acquisition to described index server, described second request data package is used for having to the index server request client side list information of described resources to be downloaded;
Concrete, described request unit 305 can comprise:
Resolve subelement 3051, be used for resolving first request data package acquisition resources to be downloaded information that described packet acquiring unit 300 obtains;
Wherein, described resources to be downloaded information comprises the size information of address, resources to be downloaded sign and the described resources to be downloaded of index server.
Request subelement 3052, be used for resolving the resources to be downloaded information that obtains according to described parsing subelement 3051 and send second request data package to described index server, described second request data package is used for having to the index server request client side list information of described resources to be downloaded.
Receiving element 310 is used for receiving the client side list information that described index server returns;
Concrete, after the Tracker server receives second request data package of request subelement 3052 transmissions, can return to client and participate in downloading for example other download persons' of F information peer list of same file.The IP address and the port numbers that include each peer in the peer list information of wherein returning, receiving element 310 is used for receiving the peer list information that Tracker returns.
Processing unit 315, for the burst information that obtains described resources to be downloaded from least one client of described client side list, the burst information of described resources to be downloaded comprises the burst size information;
Download unit 320 is used for burst information according to described resources to be downloaded from the described resources to be downloaded of described at least one client downloads.
Concrete, download unit 320 can be analyzed the burst size information of determining resources to be downloaded according to analysis and processing unit 315 and send download request at least one peer in the described client side list, and receives the fragment data that described at least one peer returns after receiving download request.Wherein, this download request is specifically as follows the request message of Request type, comprises offset address Block Offset and the data length Block Length to be downloaded of the index Piece Index of resources to be downloaded burst, data to be downloaded in the message of Request type.The fragment data that described at least one peer returns after receiving download request can be included in the Piece message, wherein, described Piece message includes the burst index Piece Index of the resources to be downloaded of customer end A request, offset address Block Offset and the data Block Data to be downloaded of data to be downloaded.
Those skilled in the art can know that download unit 320 can be downloaded the data in the burst in batches, once only downloads the partial data of certain burst, also can once download all data of this burst.In the practical application, usually client is to the peer request resource time, generally can once whole burst once not downloaded, but being divided into several data block Block, downloads a burst, a general Block is 16K, after the burst size of knowing resources to be downloaded, client can be divided into a plurality of data blocks according to the burst size.Wherein, Block Offset is the offset address of data block in the burst of resources to be downloaded.For example if the burst size of certain resources to be downloaded is 32K, be that a data block is divided the burst of described resources to be downloaded with 16K, then the offset address Block Offset of first data block is 0, Block Length is 16k, the offset address Block Offset of second data block is 16*1024, and Block Length also is 16K.
Further, in the BT download apparatus that another embodiment of the present invention provides, comprise packet acquiring unit 300, request unit 305, receiving element 310, processing unit 315 and download unit 320, wherein, described packet acquiring unit 300, request unit 305, receiving element 310 and download unit 320 can be referring to the descriptions of previous embodiment, as shown in Figure 4, described processing unit 315 can comprise:
Connect and set up subelement 3151, be used for establishing a communications link with at least one client of described client side list;
Concrete, can send BT handshake request message at least one peer according to peer list information, and receive BT that at least one peer the returns response message of shaking hands, establish a communications link with at least one peer.Usually, customer end A can send BT handshake request message to all peer.
Receive subelement 3152, be used for receiving at least one peer in the bit field bitfield message of the resources to be downloaded of the back transmission that establishes a communications link;
Concrete, according to the BT protocol requirement, after download client and other peer connect by shaking hands, can send bitfield message to the other side immediately, the burst situation of the resources to be downloaded that circular has separately, if peer does not have the burst of resources to be downloaded, then this peer can not send bitfield message.Wherein, include three parts in the bitfield message: message-length Message Length, type of message Message Type, data payload Payload, wherein, message-length Message Length is the length of type of message Message Type and the length sum of data payload Payload; The value of Message Type is 5 in the bitfield message, and its length is 1 byte; Data payload Payload part is actual to be a bitmap, if this Peer has certain burst of resources to be downloaded, so Dui Ying position puts 1, otherwise puts 0.
Analyzing and processing subelement 3153 is used for the burst size of determining resources to be downloaded according to size and the bit field bitfield message analysis of resources to be downloaded.
Concrete, after reception subelement 3152 received the bit field bitfield message that at least one peer sends among the peer list, analyzing and processing subelement 3153 can obtain the burst information such as burst size of described resources to be downloaded according to the size information analysis that bitfield message and the parsing subelement 3051 of acquisition are resolved the resources to be downloaded of acquisition.
Concrete, because according to the BT protocol requirement, the length (1 byte) that deducts type of message Message Type according to the Message Length that carries in this bitfield message obtains the length of the data Payload that this peer (for example client C) returns, the i.e. length of Payload=Message Length-1.Because burst of each (bit) sign among the Payload, and 1 byte equals 8 (bit), therefore, analyzing and processing subelement 3153 can be determined the length of the Payload that carries in this bitfield message according to the bitfield message that obtains, and further determines the burst number interval of the resources to be downloaded that this peer has according to the length of the Payload that determines.For example: it is 9 that certain resources to be downloaded is divided into, need 2 bytes to represent (second byte only used one), and another BT resource is divided into 16, also only need 2 bytes to represent, then if resolving the length of the Payload of bitfield message acquisition is 2, can judge the burst number of these resources to be downloaded between the 9-16 sheet.
Further, when analyzing and processing subelement 3153 can be resolved the burst size that the burst number interval of the size information of the resources to be downloaded that obtain and the resources to be downloaded that aforementioned analysis obtains is determined described resources to be downloaded according to resolving subelement 3051, concrete, because each burst size of BT resource is generally 2 n power, for example: 32K, 64k, 128K, 256k, 512K, 1M, 2M, 4M, 8M, therefore, analyzing and processing subelement 3153 can be with the resources to be downloaded size respectively divided by two end values of burst number interval, obtain an interval of burst size, the value of getting 2 Nth power in the interval of burst size then is the burst size of these resources to be downloaded.For example: if the size of first request data package acquisition resources to be downloaded F that the described packet acquiring unit 300 of parsing subelement 3051 parsings grasps is 330K, analyzing and processing subelement 3153 is 2 bytes by the length that the bitfield message of resolving peer (for example client C) transmission obtains Payload, the burst number that then can extrapolate these resources to be downloaded F is between the 9-16 sheet, and this burst size is at [330K/16,330K/9] value of Nth power of 2 in (being 20.6K-36.67K) interval, then can get 32K in the 20.6K-36.67K interval and be the size of these resources to be downloaded.
The BT download apparatus that the embodiment of the invention provides is under the situation of the seed file that does not obtain resources to be downloaded, can be by in network, grasping first request data package that other clients of downloading same asset send to index server, and according to resolving resources to be downloaded information structuring second request data package that obtains, and send second request data package to index server, to obtain the peer list information that has resources to be downloaded that index server returns, by with peer list information at least one peer mutual, obtain the burst size of resources to be downloaded, download resources to be downloaded according to the burst size of this acquisition at least one peer again.Download thereby realized under the situation of the seed file that does not obtain resources to be downloaded, also can carrying out BT, promoted the reliability of BT resource downloading, better realized sharing of resource.
Need to prove that the BT download apparatus in above-described embodiment can refer to client, also can refer to server, also can just be applied to a module in client or the server, get final product so long as can realize the device of downloading the BT resource.
In actual applications, BT method for down loading and BT download apparatus that above-described embodiment provides can be applied in the download system, further, the embodiment of the invention also provides a kind of BT download system, can comprise that index server (Tracker server) and at least two are as BT download apparatus as described in the aforementioned embodiment.
In addition, in actual applications, BT method for down loading and BT download apparatus that above-described embodiment provides can be applied in the caching system, concrete, can be with caching system not only on the backbone network of operating side, by grasping the packet on the network, and captured packets analyzed, find out popular BT resource, the BT resource of downloading this focus by the described method for down loading of the embodiment of the invention or download apparatus from the outer net row cache of going forward side by side is downloaded for Intranet user and to be used.When Intranet user is downloaded the focus BT resource of buffer memory, caching system can be redirected on the Tracker server of caching system by the download request that is redirected Intranet user, is returned client or the server list of described focus BT resource to Intranet user by the Tracker server of caching system.Thereby make caching system can field find hot point resource in the network, and in the time can't from outer net, obtaining the seed file of hot point resource, also can download and the buffer memory hot point resource by above-mentioned method for down loading, and provide download service for Intranet user.Thereby alleviated flow between net, saved outlet bandwidth, improved user's speed of download and downloading experience.
Need to prove, for aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the specification all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that describes in detail among certain embodiment, can be referring to the associated description of other embodiment.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in above-described embodiment method, be to instruct relevant hardware to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
The above only is several embodiments of the present invention; be understandable that; for those of ordinary skills; can be equal to replacement or change according to technical scheme and the inventive concept thereof of the embodiment of the invention, and all these changes or replacement all should belong to the protection range of the appended claim of the present invention.

Claims (3)

1. a bit-torrent BT method for down loading is characterized in that, comprising:
Obtain first request data package that the peer node Peer in the network sends to index server;
According to resolving the resources to be downloaded information that described first request data package obtains, send second request data package to described index server, described second request data package is used for having to the index server request client side list information of described resources to be downloaded, and described resources to be downloaded information comprises the size information of address, resources to be downloaded sign and the described resources to be downloaded of index server;
Receive the client side list information that described index server returns;
The burst information of described resources to be downloaded is determined in the information analysis that obtains by described resources to be downloaded information and at least one client from described client side list, and described burst information comprises the burst size information;
According to described burst information from the described resources to be downloaded of described at least one client downloads;
Wherein, the described information analysis that obtains by described resources to be downloaded information and at least one client from described client side list determines that the burst information of described resources to be downloaded comprises:
Establish a communications link with described at least one client;
Receive the bit field bitfield message that at least one client sends in the back that establishes a communications link;
According to the burst quantity information of the acquisition of the data payload Payload length in described bitfield message resources to be downloaded, described burst quantity information is burst quantity interval;
According to size and the interval big minizone of burst that obtains described resources to be downloaded of the burst quantity of described resources to be downloaded of described resources to be downloaded, the value that in the big minizone of described burst is 2 Nth power is defined as described resources to be downloaded burst size.
2. a BT download apparatus is characterized in that, comprising:
The packet acquiring unit is used for obtaining the peer node Peer of network to first request data package of index server transmission;
Request unit, be used for according to the resources to be downloaded information according to described first request data package acquisition of parsing, send second request data package to described index server, described second request data package is used for having to the index server request client side list information of described resources to be downloaded, wherein, described resources to be downloaded information comprises the size information of address, resources to be downloaded sign and the described resources to be downloaded of index server;
Receiving element is used for receiving the client side list information that described index server returns;
Processing unit is used for determining the burst information of described resources to be downloaded by described resources to be downloaded information and from the information analysis that at least one client of described client side list obtains that described burst information comprises the burst size information;
Download unit is used for according to described burst information from the described resources to be downloaded of described at least one client downloads;
Wherein, described processing unit comprises:
Connect and set up subelement, be used for establishing a communications link with at least one client of described client side list;
Receive subelement, be used for receiving at least one client in the bit field bitfield message of the resources to be downloaded of the back transmission that establishes a communications link;
The analyzing and processing subelement, be used for obtaining according to the data payload Payload length of described bitfield message the burst quantity information of described resources to be downloaded, described burst quantity information is burst quantity interval, and according to size and the interval big minizone of burst that obtains described resources to be downloaded of the burst quantity of described resources to be downloaded of described resources to be downloaded, the value that in the big minizone of described burst is 2 Nth power is defined as described resources to be downloaded burst size.
3. a BT download system is characterized in that, comprises index server and at least two download apparatus as claimed in claim 2.
CN 201010264494 2010-08-20 2010-08-20 BT download method, device and system Expired - Fee Related CN101917488B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010264494 CN101917488B (en) 2010-08-20 2010-08-20 BT download method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010264494 CN101917488B (en) 2010-08-20 2010-08-20 BT download method, device and system

Publications (2)

Publication Number Publication Date
CN101917488A CN101917488A (en) 2010-12-15
CN101917488B true CN101917488B (en) 2013-09-11

Family

ID=43324870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010264494 Expired - Fee Related CN101917488B (en) 2010-08-20 2010-08-20 BT download method, device and system

Country Status (1)

Country Link
CN (1) CN101917488B (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102130963B (en) * 2011-04-08 2014-02-05 北京奇艺世纪科技有限公司 Method, device and system for storing file in client network
CN102130964B (en) * 2011-04-11 2013-04-24 华为数字技术(成都)有限公司 Method for acquiring bit torrent (BT) seed file and relevant devices
CN103220308B (en) * 2012-01-19 2018-07-03 腾讯科技(深圳)有限公司 A kind of document down loading method, apparatus and system
CN102664813B (en) * 2012-05-17 2014-12-03 重庆邮电大学 System and method for localizing peer-to-peer (P2P) flow
CN104811750A (en) * 2014-01-23 2015-07-29 北京风行在线技术有限公司 Method and device used for playing video in P2P peers and system
US9635077B2 (en) * 2014-03-14 2017-04-25 Adobe Systems Incorporated Low latency live video streaming
CN105208067A (en) * 2014-06-26 2015-12-30 格瑞菲技术有限公司 Asynchronous multi-source transmission
CN104168539A (en) * 2014-08-06 2014-11-26 无锡高联信息技术有限公司 Information interaction and push method based on LTE system
CN104572839A (en) * 2014-12-11 2015-04-29 百度在线网络技术(北京)有限公司 Retrieval method and retrieval system for resource file
CN106161549B (en) * 2015-04-15 2020-02-11 阿里巴巴集团控股有限公司 Data transmission method, system, control server and client
CN105656986A (en) * 2015-11-26 2016-06-08 乐视云计算有限公司 Live video play method, device and system
US10608933B2 (en) * 2016-03-31 2020-03-31 Toshiba Mitsubishi-Electric Industrial Systems Corporation Data reproduction device for plant-monitoring control system
CN107770209B (en) * 2016-08-16 2021-04-16 中兴通讯股份有限公司 Resource sharing method and device
CN112491972A (en) 2018-06-11 2021-03-12 华为技术有限公司 Resource obtaining, distributing and downloading method, device, equipment and storage medium
CN108964845B (en) 2018-07-03 2021-04-16 网宿科技股份有限公司 Method and device for acquiring BT (bit rate protocol) resource information
CN108881034B (en) * 2018-07-03 2021-07-09 网宿科技股份有限公司 Request response method, device and system applied to BT system
CN110430274A (en) * 2019-08-09 2019-11-08 西藏宁算科技集团有限公司 A kind of document down loading method and system based on cloud storage
CN114513499A (en) * 2022-01-25 2022-05-17 统信软件技术有限公司 File downloading method, downloading device and computing equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1791213A (en) * 2005-12-27 2006-06-21 北京邮电大学 Mobile video order service system with optimized performance and realizing method
EP2088719A1 (en) * 2007-05-21 2009-08-12 Huawei Technologies Co., Ltd. Method, device and system for distributing file data
EP2112788A1 (en) * 2007-03-28 2009-10-28 Huawei Technologies Co., Ltd. A method, system and nodes for p2p content sharing
CN101577695A (en) * 2008-05-09 2009-11-11 上海未来宽带技术及应用工程研究中心有限公司 Method for downloading data based on P2P technology

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1791213A (en) * 2005-12-27 2006-06-21 北京邮电大学 Mobile video order service system with optimized performance and realizing method
EP2112788A1 (en) * 2007-03-28 2009-10-28 Huawei Technologies Co., Ltd. A method, system and nodes for p2p content sharing
EP2088719A1 (en) * 2007-05-21 2009-08-12 Huawei Technologies Co., Ltd. Method, device and system for distributing file data
CN101577695A (en) * 2008-05-09 2009-11-11 上海未来宽带技术及应用工程研究中心有限公司 Method for downloading data based on P2P technology

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
BitTorrent原理与算法研究及其性能优化;王展明;《中国优秀硕士学位论文全文数据库·信息科技辑》;20071215(第6期);第5-18页,特别是第2.1.3, 2.1.4节、图2.2 *
王展明.BitTorrent原理与算法研究及其性能优化.《中国优秀硕士学位论文全文数据库·信息科技辑》.2007,(第6期),第5-18页,特别是第2.1.3,2.1.4节、图2.2.

Also Published As

Publication number Publication date
CN101917488A (en) 2010-12-15

Similar Documents

Publication Publication Date Title
CN101917488B (en) BT download method, device and system
US7702917B2 (en) Data transfer using hyper-text transfer protocol (HTTP) query strings
CN107094176B (en) Method and system for caching data traffic on a computer network
CN108259542B (en) Resource transmission method and device
CN110392071B (en) Uploading and downloading methods of streaming media resources, distribution system and streaming media server
EP3439239B1 (en) Data transmission method and system based on peer-to-peer network
EP2773080A1 (en) Sharing control system and method for network resources download information
CN106549878B (en) Service distribution method and device
US20130219441A1 (en) Method, server and terminal for audio and video on demand
CN103731472B (en) Method and system, the client of file are downloaded using P2P technologies
CN110430274A (en) A kind of document down loading method and system based on cloud storage
CN102693297B (en) Data processing method, node and ETL (extract transform and load) system
CN101997822A (en) Streaming media content delivery method, system and equipment
CN102739717A (en) Downloading method, downloading proxy server and network system
CN102075561A (en) Method, device and system for downloading network resources
JP2016525256A (en) Method and apparatus for providing redundant data access
CN110392020B (en) Streaming media resource transmission method and system
CN113422728A (en) Method and device for selecting content distribution network link
KR100929031B1 (en) Block selection method in file parallel download, file parallel download method using the same, and recording medium recording a program for implementing the same
US20130238767A1 (en) Method and system for downloading real-time streaming media in peer-to-peer network
CN103873443A (en) Information processing method, local proxy server and network proxy server
CN105847396A (en) Data transmission method and device
CN103685469B (en) Document down loading method and system and client based on P2P
CN106060155B (en) The method and device of P2P resource-sharing
CN103731511B (en) Data acquiring method and data acquiring device in P2P (Peer-to-Peer) system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent for invention or patent application
CB02 Change of applicant information

Address after: B Park No. 88 high science and Technology University of Electronic Science and technology of Sichuan province 611731 Chengdu high tech Zone West Park area Qingshui River Tianchen Road No. 1 building

Applicant after: Huawei Symantec Technologies Co., Ltd.

Address before: B Park No. 88 high science and Technology University of Electronic Science and technology of Sichuan province 611731 Chengdu high tech Zone West Park area Qingshui River Tianchen Road No. 1 building

Applicant before: Chengdu Huawei Symantec Technologies Co., Ltd.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: CHENGDU HUAWEI SYMANTEC TECHNOLOGIES CO., LTD. TO: HUAWEI DIGITAL TECHNOLOGY (CHENGDU) CO., LTD.

C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130911

Termination date: 20190820

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