CN102055786B - File download method and server, download client and system adopting same - Google Patents

File download method and server, download client and system adopting same Download PDF

Info

Publication number
CN102055786B
CN102055786B CN200910237450.1A CN200910237450A CN102055786B CN 102055786 B CN102055786 B CN 102055786B CN 200910237450 A CN200910237450 A CN 200910237450A CN 102055786 B CN102055786 B CN 102055786B
Authority
CN
China
Prior art keywords
downloaded
file
peer
download
filename
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN200910237450.1A
Other languages
Chinese (zh)
Other versions
CN102055786A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN200910237450.1A priority Critical patent/CN102055786B/en
Publication of CN102055786A publication Critical patent/CN102055786A/en
Application granted granted Critical
Publication of CN102055786B publication Critical patent/CN102055786B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a file download method and a server, a download client and a system which adopt the method, and belongs to the technical field of network communication. The method comprises the following steps: a P2P (peer-to-peer) server receives the file name of a file to be downloaded; the P2P server acquires download information according to the file name, sends back the download information which at least includes segment amounts of the file to be downloaded, the peer downloading the file to be downloaded and the segment number of the file to be downloaded and stored in the peer, to the download client; and the download client downloads the file to be downloaded from the download server and the peer downloading the file to be downloaded according to the segment amounts in the file to be downloaded and the segment number of the file to be downloaded and stored in the peer. The system comprises the P2P server and the download client. By adopting the method, the occupied server bandwidth and user resource are reduced and the download is accelerated.

Description

A kind of method of file download, server, downloading end and system
Technical field
The present invention relates to network communication technology field, particularly a kind of method of file download, server, downloading end and system.
Background technology
At present, one of file download main application having become the Internet, along with all kinds of file to be downloaded as Games Software, other application software take up space increasing, file download has become and has taken one of maximum application of server bandwidth.Software enterprise and hardware cost and the bandwidth cost of organizing the download of file of having nothing for it but to pay costliness.
Traditional file downloading mode mainly logs in Webpage corresponding in download server by URL, and file to be downloaded is directly downloaded in the chained address of the file to be downloaded provided from Webpage from download server.But this kind of mode speed of download be slow, take higher server bandwidth.
In order to solve Problems existing in traditional file downloading mode, people bring into use P2P (Peer-to-Peer, peer-to-peer network) mode download file, mainly contain the method for following two kinds of P2P mode download files at present:
The first, use multi-source download tool from download server, download file to be downloaded, such as, by URL (Uniform Resource Locator, URL(uniform resource locator)) log in Webpage corresponding in download server, file to be downloaded is downloaded in the chained address of the file to be downloaded using the multi-source such as a sudden peal of thunder or whirlwind download tool to provide from this Webpage.
The second, use Bt (Bit torrent, file distributing agreement) or Emule (electric donkey) shared file system download file to be downloaded from all clients participated in.
Realizing in process of the present invention, inventor finds that existing P2P downloading mode at least exists following problem:
In above-mentioned first method: multi-source download tool takies higher server bandwidth, and multi-source download tool capacity is comparatively large, will first install multi-source download tool before downloading, occupy user resources.
In above-mentioned second method: cannot speed of download be ensured, and also Bt or Emule shared file system to be first installed before downloading, occupy user resources.
Summary of the invention
In order to when download file, reduce taking and improving speed of download server bandwidth and user resources, embodiments provide a kind of method of file download, server, downloading end and system.Described technical scheme is as follows:
A method for file download, described method comprises:
P2P server receives the filename of file to be downloaded;
The corresponding relation of described P2P server according to described filename, filename and fragment sum and the corresponding relation of Peer and fileinfo, obtain Download Info, and returning described Download Info to downloading end, described Download Info comprises the sheet number that the described file to be downloaded that stores in fragment sum that described file to be downloaded at least comprises, the Peer downloading described file to be downloaded and described Peer comprises;
The sheet number that the described file to be downloaded stored in the fragment sum that described downloading end comprises according to described file to be downloaded and described Peer comprises, downloads described file to be downloaded from download server and described download the Peer of described file to be downloaded simultaneously.
A kind of server, described server comprises:
Receiver module, for receiving the filename of file to be downloaded;
Acquisition module, for according to the corresponding relation of described filename, filename and fragment sum and the corresponding relation of Peer and fileinfo, obtain Download Info, described Download Info at least comprises the sheet number that the described file to be downloaded that stores in fragment sum that described file to be downloaded comprises, the Peer downloading described file to be downloaded and described Peer comprises;
Sending module, for sending described Download Info to downloading end.
A kind of downloading end, described downloading end comprises:
Receiver module, for receiving Download Info, described Download Info at least comprises the sheet number that the described file to be downloaded that stores in fragment sum that file to be downloaded comprises, the Peer downloading described file to be downloaded and described Peer comprises;
Download module, for the sheet number that the described file to be downloaded that stores in the fragment sum that comprises according to described file to be downloaded and described Peer comprises, download described file to be downloaded from download server and described download the Peer of described file to be downloaded simultaneously.
A system for file download, described system comprises downloading end and P2P server;
Described P2P server, for receiving the filename of file to be downloaded; According to the corresponding relation of described filename, filename and fragment sum and the corresponding relation of Peer and fileinfo, obtain Download Info, and returning described Download Info to downloading end, described Download Info at least comprises the sheet number that the described file to be downloaded that stores in fragment sum that described file to be downloaded comprises, the Peer downloading described file to be downloaded and described Peer comprises;
Described downloading end, for the sheet number that the described file to be downloaded that stores in the fragment sum that comprises according to described file to be downloaded and described Peer comprises, download described file to be downloaded from download server and described download the Peer of described file to be downloaded simultaneously.
The filename of file to be downloaded is received by P2P server, according to filename, obtain Download Info, and return this Download Info to downloading end, downloading end downloads file to be downloaded from downloading the Peer of file to be downloaded of comprising of download server and Download Info.Wherein, due to the direct download file of downloading end, thus minimizing takies user resources; Due to simultaneously download file from download server and Peer, so reduce the bandwidth resources that take download server and improve speed of download.
Accompanying drawing explanation
Fig. 1 is the method flow diagram of a kind of file download that the embodiment of the present invention 1 provides;
Fig. 2 is a kind of P2P network architecture schematic diagram that the embodiment of the present invention 1 provides;
Fig. 3 is the method detail flowchart of a kind of file download that the embodiment of the present invention 1 provides;
Fig. 4 is the schematic diagram of a kind of server that the embodiment of the present invention 2 provides;
Fig. 5 is the schematic diagram of a kind of downloading end that the embodiment of the present invention 3 provides;
Fig. 6 is the system block diagram of a kind of file download that the embodiment of the present invention 4 provides.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Embodiment 1
As shown in Figure 1, embodiments provide a kind of method of file download, comprising:
Step 101:P2P server receives the filename of file to be downloaded;
Step 102:P2P server is according to the filename received, obtain Download Info, and return this Download Info to downloading end, wherein, this Download Info at least comprises the sheet number that the file to be downloaded that stores in fragment sum that file to be downloaded comprises, the Peer downloading file to be downloaded and this Peer comprises;
Step 103: the sheet number that the file to be downloaded stored in the fragment sum that downloading end comprises according to file to be downloaded and this Peer comprises, from download server and downloading file to be downloaded Peer download file to be downloaded.
Wherein, downloading end for certain Peer in P2P network or can operate in downloading in certain Peer, and each downloading end has a corresponding Peer, so downloading end download file is exactly in fact, Peer corresponding to downloading end is at download file.
In embodiments of the present invention, P2P server receives the filename of file to be downloaded, according to filename, obtains Download Info, and returning this Download Info to downloading end, downloading end downloads file to be downloaded from downloading the Peer of file to be downloaded of comprising of download server and Download Info.Wherein, due to the direct download file of downloading end, thus minimizing takies user resources; Due to simultaneously download file from download server and Peer, so reduce the bandwidth resources that take download server and improve speed of download.
In order to be described in detail to said method, refer to Fig. 2, be a kind of P2P network architecture schematic diagram that the embodiment of the present invention provides, comprising download server, P2P server and Peer (being respectively PeerA, PeerB and PeerC).Wherein, download server is used for storage file; P2P server is used for storage file name and the corresponding relation of fragment sum and the corresponding relation of Peer and fileinfo, and file is made up of fragment, and each fragment has the sheet number of self.
Based on the P2P network architecture that above-mentioned Fig. 2 provides, see Fig. 3, the detailed process of the method that the embodiment of the present invention provides, specifically comprises:
Step 201: downloading end obtains the filename of file to be downloaded from the download address of file to be downloaded, and the filename of acquisition is sent to P2P server;
Wherein, include the filename of file to be downloaded in the download address of file to be downloaded, particularly, downloading end is file reading name from the download address of file to be downloaded, and this filename is sent to P2P server.
Wherein, downloading end can obtain the download address of file to be downloaded from download server.Such as, take PeerA as downloading end for example is described, downloading end obtains the download address IP3 of file to be downloaded from download server, wherein, IP3 is " www. file 3.com ", and in IP3, include filename and the file 3 of file to be downloaded, file reading 3 from IP3, and file 3 is sent to P2P server.
Step 202:P2P server receives the filename of file to be downloaded, searches the fragment sum that file to be downloaded comprises, and returns to downloading end;
Particularly, P2P server receives the filename of file to be downloaded, according to this filename, from self filename of storage and the corresponding relation of fragment sum, find out the fragment sum that file to be downloaded comprises, and the fragment sum comprised by file to be downloaded returns to downloading end.
Wherein, every bar record in the corresponding relation of filename and fragment sum is for representing the sum of all fragments that certain file and this file comprise, the corresponding relation of filename as shown in table 1 and fragment sum, the implication of the second line display of table 1 is that file 1 and this file 1 comprise all fragment sums 3, and namely file 1 comprises three fragments.The corresponding relation of filename and fragment sum is that operator sets up in advance, comprises the filename of each file in download server and the corresponding relation of it fragment sum comprised.
Table 1
Filename Fragment sum
File 1 3
File 2 4
File 3 5
…… ……
Such as, P2P server receives filename and the file 3 of file to be downloaded, adds up to 5 according to file 3 from filename as shown in table 1 with the fragment finding out file to be downloaded corresponding the corresponding relation of fragment sum.
Wherein, in the step 201 of the present embodiment, downloading end first can not read the filename of the file to be downloaded in download address, but directly the download address of file to be downloaded is sent to P2P server; Correspondingly, P2P server receives the download address of file to be downloaded in step 202., and from download address, read the filename of file to be downloaded, then searches according to the filename read the fragment sum that file to be downloaded comprises.
Step 203:P2P server, according to the filename of file to be downloaded, finds out in network all Peer downloading file to be downloaded;
Particularly, P2P server, according to the filename of file to be downloaded, finds out all Peer nodes downloading file to be downloaded from the corresponding relation of the Peer self stored and fileinfo.
Wherein, fileinfo at least comprise just download file filename and downloaded the sheet number of the fragment that this file comprises, download state can also be comprised and namely downloading or downloading end, the bandwidth etc. of Peer.The corresponding relation of Peer and fileinfo can be stored by forms such as tables, such as, store the corresponding relation of Peer and fileinfo with table 2.In Peer shown in table 2 and the corresponding relation of fileinfo, the filename of the file just downloaded at each Peer of download file, each Peer in storage networking and downloaded the sheet number of the fragment that each file comprises.Such as, the second line item shown in table 2 is PeerA, file 1 and sheet numbers 1,2,3 for representing PeerA just at download file 1, and the sheet number that downloaded file 1 comprises is 1,2,3 three fragment.Peer in network is when downloading certain file, all the sheet of the fragment downloaded number is reported P2P server with the filename of this file, this Peer, filename and sheet number are stored in the corresponding relation of Peer and fileinfo as a record by P2P server.Wherein, when representing that unique Peer, a P2P server receives sheet that certain Peer reports number and filename with IP address in the present embodiment, directly can view the IP address of this Peer, represent this Peer with this IP address.
Table 2
Such as, P2P server, finds out just at PeerB and PeerC of download file 3 for index with file 3 from table 2.
Step 204:P2P server selects a Peer from all Peer searched, from the corresponding relation of the Peer self stored and fileinfo, read this Peer further and stored the sheet number that file to be downloaded comprises, and the sheet number that the file to be downloaded stored in this Peer and this Peer comprises is returned to downloading end;
Wherein, P2P server selects the method for Peer to have multiple, and such as, Stochastic choice Peer from all Peer, for another example, selects to download the maximum Peer of segments from all Peer.
Such as, P2P server is from PeerB and PeerC found out, Stochastic choice PeerC, or select to have downloaded the many PeerC of segments, from the corresponding relation of Peer as shown in table 2 and fileinfo, read in PeerC the sheet number having stored all fragments that file to be downloaded comprises further and be respectively 1,2,3,4, PeerC and sheet numbers 1,2,3,4 is returned to downloading end.
Step 205: occur after step 202 and with step 203 and/or 204 simultaneously or occur afterwards, downloading end receives the fragment sum of file to be downloaded, according to fragment sum, determines the sheet number of all fragments that file to be downloaded comprises;
Such as, the fragment that downloading end returns according to reception P2P server adds up to 5, determines that file to be downloaded comprises sheet number and is respectively 1,2,3,4,5 five fragment.
Step 206: select a sheet number all numbers that downloading end comprises from file to be downloaded, using this sheet number as first to be downloaded number, the download address lower slide glass number from download server according to file to be downloaded is the fragment of first to be downloaded number;
Wherein, the method for first to be downloaded number is selected to comprise multiple, such as, downloading end Stochastic choice sheet number, and using this sheet number as first to be downloaded number, for another example, select a sheet number in order, and using this sheet number as first to be downloaded number.Such as, downloading end is from 1,2,3,4,5 five sheet number, and Stochastic choice sheet numbers 3, using sheet numbers 3 as first to be downloaded number, is the fragment of 3 according to IP3 lower slide glass number from download server.
In addition, downloading end starts from download server sheet number when being the fragment of first to be downloaded number, by the filename of file to be downloaded, first to be downloaded number report P2P server.P2P server is according to the filename of Peer corresponding to downloading end and file to be downloaded, search the corresponding relation of Peer and the fileinfo self stored, if do not find out the corresponding relation of the filename comprising Peer corresponding to downloading end and file to be downloaded, then by Peer corresponding for this downloading end, the filename of file to be downloaded and first to be downloaded number are stored in the corresponding relation of Peer and the fileinfo self stored as a new corresponding relation, if find out the corresponding relation of the filename comprising Peer corresponding to downloading end and file to be downloaded, then first to be downloaded number is stored in this corresponding relation.File 3 and sheet numbers 3 is reported P2P server by such as downloading end, P2P server is according to PeerA corresponding to downloading end and file 3, the corresponding relation comprising PeerA and file 3 is not found out from the corresponding relation of Peer as shown in table 2 and fileinfo, then PeerA, file 3 and sheet numbers 3 is stored in the corresponding relation of Peer as shown in table 2 and fileinfo, shown in the table 3 that the result obtained is following as a new corresponding relation.
Table 3
In addition, downloading end can also report other information to P2P server, such as, report the bandwidth of the Peer of self correspondence or download state namely to download to P2P server, correspondingly, P2P server also records other information reported.Wherein, the filename that in network, each Peer will report to P2P server the file downloaded when download file, the sheet number of fragment downloaded, each Peer can also report other information.
Wherein, step 205-206 occurs after step 202, can occur with step 203-204 simultaneously or occur after step 204.In addition, in the present embodiment step 202, after P2P whois lookup goes out the fragment sum that file to be downloaded comprises, first can not return fragment sum to downloading end, until return to downloading end in step 204 together with fragment sum, Peer and sheet number.
Step 207: downloading end receives the sheet number that the file to be downloaded that stores in the Peer and this Peer that P2P server returns comprises, a sheet number also do not downloaded is selected in sheet that the file to be downloaded stored from this Peer comprises number, and using this sheet number as second to be downloaded number;
Such as, 1,2,3,4 four sheet number that in PeerC and PeerC that downloading end reception P2P server returns, storage file 3 comprises, and from 1,2,3,4 four sheet number received, select a sheet also do not downloaded numbers 2, and using this sheet number as second to be downloaded number.
Step 208: downloading end lower slide glass number from the Peer returned is the fragment of second to be downloaded number;
Wherein, file to be downloaded and second to be downloaded number, when slide glass number lower in the Peer returned is the fragment of second to be downloaded number, are reported P2P server by downloading end.Correspondingly, P2P server is according to the filename of Peer corresponding to downloading end and file to be downloaded, search the corresponding relation of Peer and fileinfo, if do not find out the corresponding relation of the filename comprising Peer corresponding to downloading end and file to be downloaded, then by Peer corresponding for this downloading end, the filename of file to be downloaded and first to be downloaded number are stored in the corresponding relation of Peer and fileinfo as a new corresponding relation, if find out the corresponding relation of the filename comprising Peer corresponding to downloading end and file to be downloaded, then first to be downloaded number is stored in this corresponding relation.
Such as, downloading end is the fragment of 2 to slide glass under PeerC number, and file 3 and sheet numbers 2 is reported P2P server.Correspondingly, P2P server is according to PeerA corresponding to downloading end and file 3, from the corresponding relation of Peer as shown in table 3 and fileinfo, find out the corresponding relation comprising PeerA and file 3, then sheet numbers 3 is stored in this corresponding relation, shown in the table 4 that the result obtained is following.
Table 4
Step 209: after downloaded the current fragment downloaded from download server, all numbers that downloading end comprises from file to be downloaded, select a sheet number also do not downloaded, using this sheet number as first to be downloaded number, and lower slide glass number is the fragment of first to be downloaded number from download server; After downloaded the current fragment downloaded from the Peer returned, a sheet number also do not downloaded is selected in sheet that the file to be downloaded that downloading end stores from the Peer returned comprises number, using this sheet number as second to be downloaded number, and from the Peer that this returns, lower slide glass number is the fragment of second to be downloaded number, until download complete file to be downloaded.
Such as, when to have downloaded from download server slice number be the fragment of 3 after, downloading end selects a sheet also do not downloaded number 1 from 1,2,3,4,5 five sheet number, using sheet number 1 as first to be downloaded number, from download server, lower slide glass number is the fragment of 1, when to have downloaded from PeerC slice number be the fragment of 2 after, downloading end is from the sheet that returns numbers 1,2,3,4, select a sheet also do not downloaded numbers 4, using sheet numbers 4 as second to be downloaded number, from PeerC, lower slide glass number is the fragment of 4, so, until downloaded complete file 3.
Wherein, when downloading end downloads complete file to be downloaded, namely the filename of file to be downloaded and download state are downloaded end and reports P2P server, correspondingly, P2P server is according to this download state, just know that downloading end has downloaded complete file to be downloaded, and according to the filename of Peer corresponding to downloading end and file to be downloaded, from Peer and the corresponding relation finding out the filename comprising Peer corresponding to downloading end and file to be downloaded the corresponding relation of fileinfo, and delete this corresponding relation from the corresponding relation of Peer and fileinfo.
In addition, if downloading end is at every turn when reporting the filename of file to be downloaded and downloading the sheet of fragment to P2P server, download state is also reported namely to download, namely P2P server is by Peer corresponding for downloading end, the filename of file to be downloaded and the fragment sheet downloaded number and download state are stored in the corresponding relation of Peer and fileinfo as a record, then when P2P server to receive under the treating that report of downloading end file and at the end of downloading, from Peer and the corresponding relation finding out the filename comprising Peer corresponding to downloading end and file to be downloaded the corresponding relation of fileinfo, then the download state in this corresponding relation is updated to download to terminate.Wherein, in the present embodiment, downloading end also supports breakpoint transmission.
Wherein, in the present embodiment, downloading end also can be downloader.Wherein, user logs in Webpage corresponding in download server by URL in advance, wherein, the chained address of the downloader that this Webpage provides file to be downloaded corresponding, according to the chained address that this Webpage provides, the download address of the downloader that direct download file to be downloaded is corresponding and file to be downloaded is to certain Peer in P2P network, and then in this Peer, directly run this downloader, this downloader just carries out download file to be downloaded by above-mentioned steps 201-209.
Correspondingly, for each file is provided with a corresponding downloader in download server, download server provides the chained address of downloader to user by Webpage, instead of directly provide the chained address of file to be downloaded.Wherein, downloader capacity is very little, generally only has the size of 1 to 2MB, so can download from download server fast, can also reduce taking the bandwidth resources of user resources and download server; And before utilizing downloader download file, do not need to install in Peer, but directly run downloader when download file, so, reduce further and take user resources, facilitate user.
In embodiments of the present invention, P2P server receives the filename from the file to be downloaded of downloading end, according to filename, obtain the fragment sum that file to be downloaded comprises, downloading in a Peer of file to be downloaded and this Peer the sheet number storing file to be downloaded and comprise, and the above-mentioned information obtained returns downloading end, the sheet number that downloading end comprises according to the file to be downloaded stored in the fragment sum returned and this Peer, downloads file to be downloaded from download server and this Peer.Wherein, due to the direct download file of downloading end, thus minimizing takies user resources; Due to simultaneously download file from download server and Peer, so reduce the bandwidth resources that take download server and improve speed of download.
Embodiment 2
As shown in Figure 4, embodiments provide a kind of server, comprising:
Receiver module 301, for receiving the filename of file to be downloaded;
Acquisition module 302, for according to the filename received, obtains Download Info, and this Download Info at least comprises the sheet number that the file to be downloaded that stores in fragment sum that file to be downloaded comprises, the Peer downloading file to be downloaded and this Peer comprises;
Sending module 303, for sending this Download Info to downloading end.
Wherein, acquisition module 302 specifically comprises:
Search unit, for according to the filename received, search the fragment sum that file to be downloaded comprises and all Peer downloading file to be downloaded;
Selected cell, for selecting a Peer downloading file to be downloaded from all Peer searched, obtains in this Peer the sheet number storing file to be downloaded and comprise;
Further, search unit specifically to comprise:
First searches subelement, and for according to the filename received, from the corresponding relation of filename and fragment sum, it is total to search corresponding fragment;
Second searches subelement, for according to the filename received, from the corresponding relation of Peer and fileinfo, searches all Peer of correspondence;
Further, this server also comprises:
First memory module, during for reporting the sheet of the filename of file to be downloaded and the fragment downloaded when downloading end, judge Peer and in the corresponding relation of fileinfo, whether there is the corresponding relation of filename comprising Peer corresponding to this downloading end and report, if not, Peer corresponding to this downloading end, the filename reported and the sheet number reported is stored; If so, the sheet reported number is stored in this corresponding relation;
Further, this server also comprises:
First removing module, during for reporting filename and the ending message of file to be downloaded when downloading end, according to the ending message reported, will comprise Peer corresponding to this downloading end and the corresponding relation of filename that reports is deleted.
In embodiments of the present invention, after server receives the filename of file to be downloaded, the sheet number that the file to be downloaded stored in the fragment sum that acquisition file to be downloaded comprises, the Peer downloading file to be downloaded and this Peer comprises, and the above-mentioned information obtained is sent to downloading end, so, make the information that downloading end sends according to server, from download server and Peer, download file to be downloaded, reduce the bandwidth resources taking download server, improve speed of download.
Embodiment 3
As shown in Figure 5, embodiments provide a kind of downloading end, comprising:
Receiver module 401, for receiving Download Info, this Download Info at least comprises the sheet number that the file to be downloaded that stores in fragment sum that file to be downloaded comprises, the Peer downloading file to be downloaded and this Peer comprises;
Download module 402, for the sheet number that the file to be downloaded that stores in the fragment sum that comprises according to file to be downloaded and this Peer comprises, from download server and downloading file to be downloaded Peer download file to be downloaded.
Wherein, download module 402 specifically comprises:
Determining unit, for according to the fragment sum in Download Info, all numbers that determine that file to be downloaded comprises;
First download unit, in comprise from file to be downloaded all numbers, selects a sheet number also do not downloaded, and using this sheet number as first to be downloaded number, downloads the fragment of first to be downloaded number from download server;
Second download unit, in sheet that the file to be downloaded for storing from this Peer comprises number, selects a sheet number also do not downloaded, and using this sheet number as second to be downloaded number, downloads the fragment of second to be downloaded number from this Peer;
Further, this downloading end also comprises:
First reporting module, for when downloading file to be downloaded, to the sheet number of fragment that P2P server reports the filename of file to be downloaded and downloading;
Further, this downloading end also comprises:
Second reporting module, for when having downloaded file to be downloaded, has reported filename and the ending message of file to be downloaded to P2P server;
Wherein, downloading end can be downloader.
In embodiments of the present invention, downloading end receives Download Info, according to Download Info, from download server and downloading treat lower file Peer download file to be downloaded simultaneously, thus improve speed of download and minimizing takies the bandwidth resources of download server.In addition, downloading end can be downloader, downloader capacity is very little, generally only have the size of 1 to 2MB, before utilizing downloader download file to be downloaded, do not need to install, but directly run downloader when downloading file to be downloaded, just can download file to be downloaded, so, reduce and take user resources.
Embodiment 4
As shown in Figure 6, embodiments provide a kind of system of file download, this system comprises P2P server 501 and downloading end 502;
P2P server 501, for receiving the filename of file to be downloaded; According to the filename of file to be downloaded, obtain Download Info, and return this Download Info to downloading end, wherein, this Download Info at least comprises the sheet number that the file to be downloaded that stores in fragment sum that file to be downloaded comprises, the Peer downloading file to be downloaded and this Peer comprises;
Downloading end 502, the sheet number that the file to be downloaded for storing in the fragment sum that comprises according to file to be downloaded and the Peer that returns comprises, downloads file to be downloaded from download server and the Peer that returns.
Wherein, P2P server 501 specifically comprises:
Receiver module, for receiving the filename of file to be downloaded;
Search module, for the filename according to file to be downloaded, search the fragment sum that file to be downloaded comprises and all Peer downloading file to be downloaded;
Selecting module, for selecting a Peer downloading file to be downloaded from all Peer searched, obtaining in this Peer the sheet number storing file to be downloaded and comprise;
Return module, the sheet number that the file to be downloaded stored in total for the fragment comprised by file to be downloaded, to download file to be downloaded Peer and this Peer comprises returns to downloading end 302;
Search module specifically to comprise
First searches unit, for the filename according to file to be downloaded, from the corresponding relation of filename and fragment sum, searches corresponding fragment sum;
Second searches unit, for the filename according to file to be downloaded, from the corresponding relation of Peer and fileinfo, searches corresponding all Peer;
Downloading end 502 specifically comprises:
Determination module, for the fragment sum comprised according to file to be downloaded, all numbers that determine that file to be downloaded comprises;
First download module, in comprise from file to be downloaded all numbers, selects a sheet number also do not downloaded, and using this sheet number as first to be downloaded number, downloads the fragment of first to be downloaded number from download server;
Second download module, in sheet that the file to be downloaded for storing from the Peer returned comprises number, selects a sheet number also do not downloaded, and using this sheet number as second to be downloaded number, downloads the fragment of second to be downloaded number from this Peer;
Downloading end 502 also comprises:
3rd reporting module, for when downloading end 502 downloads file to be downloaded, to the sheet number of fragment that P2P server 501 reports the filename of file to be downloaded and downloading;
Correspondingly, P2P server 501 also comprises:
Second memory module, for judging Peer and the corresponding relation that whether there is the filename comprising Peer corresponding to downloading end and file to be downloaded in the corresponding relation of fileinfo, if not, downloading end corresponding Peer, the filename reported and the sheet number reported is stored; If so, the sheet reported number is stored in this corresponding relation;
Downloading end 502 also comprises:
4th reporting module, for when downloading end 501 has downloaded file to be downloaded, has reported filename and the ending message of file to be downloaded to P2P server 501;
Correspondingly, P2P server 501 also comprises:
Second removing module, for according to ending message, deletes the corresponding relation comprising Peer corresponding to downloading end and filename.
Wherein, downloading end 502 supports breakpoint transmission in the present embodiment.
In embodiments of the present invention, P2P server receives the filename of file to be downloaded, according to filename, obtains Download Info, and returning this Download Info to downloading end, downloading end downloads file to be downloaded from downloading the Peer of file to be downloaded of comprising of download server and Download Info.Wherein, due to the direct download file of downloading end, thus minimizing takies user resources; Due to simultaneously download file from download server and Peer, so reduce the bandwidth resources that take download server and improve speed of download.
All or part of content in the technical scheme that above embodiment provides can be realized by software programming, and its software program is stored in the storage medium that can read, storage medium such as: the hard disk in computer, CD or floppy disk.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (19)

1. a method for file download, is characterized in that, described method comprises:
P2P server receives the filename of file to be downloaded;
The corresponding relation of described P2P server according to described filename, filename and fragment sum and the corresponding relation of Peer and fileinfo, obtain Download Info, and returning described Download Info to downloading end, described Download Info at least comprises the sheet number that the described file to be downloaded that stores in fragment sum that described file to be downloaded comprises, the Peer downloading described file to be downloaded and described Peer comprises;
The sheet number that the described file to be downloaded stored in the fragment sum that described downloading end comprises according to described file to be downloaded and described Peer comprises, downloads described file to be downloaded from download server and described download the Peer of described file to be downloaded simultaneously.
2. the method for claim 1, is characterized in that, described P2P server, according to described filename, obtains Download Info, specifically comprises:
According to described filename, search the fragment sum that described file to be downloaded comprises and all Peer downloading described file to be downloaded;
Download the Peer of described file to be downloaded select one from the described all Peer searched described in, obtain in described Peer the sheet number storing described file to be downloaded and comprise.
3. method as claimed in claim 2, is characterized in that, described according to described filename, searches the fragment sum that described file to be downloaded comprises and all Peer downloading described file to be downloaded, specifically comprises:
According to described filename, from the corresponding relation of filename and fragment sum, search corresponding fragment sum;
According to described filename, from the corresponding relation of Peer and fileinfo, search corresponding all Peer.
4. the method for claim 1, it is characterized in that, the sheet number that the described file to be downloaded stored in the fragment sum that described downloading end comprises according to described file to be downloaded and described Peer comprises, download described file to be downloaded from download server and described download the Peer of described file to be downloaded, specifically comprise:
According to described fragment sum, all numbers that determine that described file to be downloaded comprises;
All numbers that comprise from described file to be downloaded, select a sheet number also do not downloaded, using described number as first to be downloaded number, from described download server, download the fragment of described first to be downloaded number;
In sheet that the described file to be downloaded stored from described Peer comprises number, select a sheet number also do not downloaded, using described number as second to be downloaded number, from described Peer, download the fragment of described second to be downloaded number.
5. the method as described in claim as arbitrary in claim 1-4, is characterized in that, when described downloading end downloads described file to be downloaded, described method also comprises:
The sheet number of fragment that described downloading end reports the filename of described file to be downloaded to described P2P server and downloading;
Correspondingly,
Described P2P server judges Peer and whether there is the corresponding relation comprising Peer corresponding to described downloading end and described filename in the corresponding relation of fileinfo, if not, store Peer corresponding to described downloading end, described in the filename that reports and the described sheet number reported; If so, the described sheet reported number is stored in described corresponding relation.
6. the method as described in claim as arbitrary in claim 1-4, is characterized in that, when described downloading end has downloaded described file to be downloaded, described method also comprises:
Described downloading end reports filename and the ending message of described file to be downloaded to described P2P server;
Correspondingly,
The corresponding relation comprising Peer corresponding to described downloading end and described filename, according to described ending message, is deleted by described P2P server.
7. the method as described in claim as arbitrary in claim 1-4, is characterized in that, described downloading end is downloader.
8. method as claimed in claim 7, is characterized in that, before P2P server receives the filename of file to be downloaded, also comprises and performs described downloader.
9. method as claimed in claim 8, is characterized in that, before the described downloader of execution, first from downloader described in described download server to the Peer that need download file to be downloaded.
10. a server, is characterized in that, described server comprises:
Receiver module, for receiving the filename of file to be downloaded;
Acquisition module, for according to the corresponding relation of described filename, filename and fragment sum and the corresponding relation of Peer and fileinfo, obtain Download Info, described Download Info at least comprises the sheet number that the described file to be downloaded that stores in fragment sum that described file to be downloaded comprises, the Peer downloading described file to be downloaded and described Peer comprises;
Sending module, for sending described Download Info to downloading end.
11. servers as claimed in claim 10, it is characterized in that, described acquisition module specifically comprises:
Search unit, for according to described filename, search the fragment sum that described file to be downloaded comprises and all Peer downloading described file to be downloaded;
Selected cell, for downloading the Peer of described file to be downloaded from the described all Peer searched described in selection one, is obtaining in described Peer the sheet number storing described file to be downloaded and comprise.
12. servers as claimed in claim 11, is characterized in that, described in search unit and specifically comprise:
First searches subelement, for according to described filename, from the corresponding relation of described filename and fragment sum, searches corresponding fragment sum;
Second searches subelement, for according to described filename, from the corresponding relation of described Peer and fileinfo, searches corresponding all Peer.
Server as described in 13. claims as arbitrary in claim 10-12, it is characterized in that, described server also comprises:
First memory module, during for reporting the sheet of the filename of described file to be downloaded and the fragment downloaded when downloading end, judge described Peer and in the corresponding relation of fileinfo, whether there is the corresponding relation comprising Peer corresponding to described downloading end and described filename, if not, store Peer corresponding to described downloading end, described in the filename that reports and the described sheet number reported; If so, the described sheet reported number is stored in described corresponding relation.
Server as described in 14. claims as arbitrary in claim 10-12, it is characterized in that, described server also comprises:
First removing module, during for reporting filename and the ending message of described file to be downloaded when downloading end, according to described ending message, the corresponding relation that will comprise Peer corresponding to described downloading end and described filename is deleted.
15. 1 kinds of downloading ends, is characterized in that, described downloading end comprises:
Receiver module, for receiving Download Info, described Download Info at least comprises the sheet number that the described file to be downloaded that stores in fragment sum that file to be downloaded comprises, the Peer downloading described file to be downloaded and described Peer comprises;
Download module, for the sheet number that the described file to be downloaded that stores in the fragment sum that comprises according to described file to be downloaded and described Peer comprises, download described file to be downloaded from download server and described download the Peer of described file to be downloaded simultaneously.
16. downloading ends as claimed in claim 15, it is characterized in that, described download module specifically comprises:
Determining unit, for according to described fragment sum, all numbers that determine that described file to be downloaded comprises;
First download unit, in comprise from described file to be downloaded all numbers, selects a sheet number also do not downloaded, using described number as first to be downloaded number, downloads the fragment of described first to be downloaded number from described download server;
Second download unit, in sheet that the described file to be downloaded for storing from described Peer comprises number, selecting a sheet number also do not downloaded, using described number as second to be downloaded number, downloading the fragment of described second to be downloaded number from described Peer.
17. downloading ends as described in claim 15 or 16, it is characterized in that, described downloading end also comprises:
First reporting module, for when downloading described file to be downloaded, to the sheet number of fragment that P2P server reports the filename of described file to be downloaded and downloading.
18. downloading ends as described in claim 15 or 16, it is characterized in that, described downloading end also comprises:
Second reporting module, for when having downloaded described file to be downloaded, has reported filename and the ending message of described file to be downloaded to P2P server.
The system of 19. 1 kinds of file download, is characterized in that, described system comprises downloading end and P2P server;
Described P2P server, for receiving the filename of file to be downloaded; According to the corresponding relation of described filename, filename and fragment sum and the corresponding relation of Peer and fileinfo, obtain Download Info, and returning described Download Info to described downloading end, described Download Info at least comprises the sheet number that the described file to be downloaded that stores in fragment sum that described file to be downloaded comprises, the Peer downloading described file to be downloaded and described Peer comprises;
Described downloading end, for the sheet number that the described file to be downloaded that stores in the fragment sum that comprises according to described file to be downloaded and described Peer comprises, download described file to be downloaded from download server and described download the Peer of described file to be downloaded simultaneously.
CN200910237450.1A 2009-11-06 2009-11-06 File download method and server, download client and system adopting same Active CN102055786B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910237450.1A CN102055786B (en) 2009-11-06 2009-11-06 File download method and server, download client and system adopting same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910237450.1A CN102055786B (en) 2009-11-06 2009-11-06 File download method and server, download client and system adopting same

Publications (2)

Publication Number Publication Date
CN102055786A CN102055786A (en) 2011-05-11
CN102055786B true CN102055786B (en) 2014-12-24

Family

ID=43959711

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910237450.1A Active CN102055786B (en) 2009-11-06 2009-11-06 File download method and server, download client and system adopting same

Country Status (1)

Country Link
CN (1) CN102055786B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102456076A (en) * 2011-11-23 2012-05-16 北京安天电子设备有限公司 Massive fragment data aggregation system and method
CN103369002B (en) 2012-03-30 2018-03-27 腾讯科技(深圳)有限公司 A kind of method and system of resource downloading
CN103532999B (en) * 2012-07-05 2019-03-12 腾讯科技(深圳)有限公司 Data transmission method, mobile device and background service system
CN104079615B (en) * 2013-03-29 2018-11-09 联想(北京)有限公司 Document down loading method and information processing unit
CN109600453B (en) * 2019-02-18 2021-10-08 广州卓远虚拟现实科技有限公司 Distributed virtual reality content distribution method and system
CN112104990A (en) * 2019-05-30 2020-12-18 北京小米移动软件有限公司 Resource downloading method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1852099A (en) * 2005-07-11 2006-10-25 华为技术有限公司 Method and system for terminal download of sharing data
CN1925403A (en) * 2005-09-02 2007-03-07 腾讯科技(深圳)有限公司 Network communication system and method realizing file downloading
CN101068155A (en) * 2006-09-20 2007-11-07 腾讯科技(深圳)有限公司 Coordinate connection stream media direct broadcasting system and collection server thereof
CN101136911A (en) * 2006-08-31 2008-03-05 腾讯科技(深圳)有限公司 Method to download files using P2P technique and P2P download system
CN101188622A (en) * 2007-12-29 2008-05-28 腾讯科技(深圳)有限公司 A method and device for downloading file by using P2P living broadcast channel

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1852099A (en) * 2005-07-11 2006-10-25 华为技术有限公司 Method and system for terminal download of sharing data
CN1925403A (en) * 2005-09-02 2007-03-07 腾讯科技(深圳)有限公司 Network communication system and method realizing file downloading
CN101136911A (en) * 2006-08-31 2008-03-05 腾讯科技(深圳)有限公司 Method to download files using P2P technique and P2P download system
CN101068155A (en) * 2006-09-20 2007-11-07 腾讯科技(深圳)有限公司 Coordinate connection stream media direct broadcasting system and collection server thereof
CN101188622A (en) * 2007-12-29 2008-05-28 腾讯科技(深圳)有限公司 A method and device for downloading file by using P2P living broadcast channel

Also Published As

Publication number Publication date
CN102055786A (en) 2011-05-11

Similar Documents

Publication Publication Date Title
CN102055786B (en) File download method and server, download client and system adopting same
CN107943951B (en) Method and system for retrieving block chain service information
CN101409706B (en) Method, system and relevant equipment for distributing data of edge network
US9985927B2 (en) Managing content delivery network service providers by a content broker
US7343422B2 (en) System and method for using uniform resource locators to map application layer content names to network layer anycast addresses
US20150237113A1 (en) Method and system for file transmission
CN102651861B (en) Download method for mobile terminal, mobile terminal and proxy download server
CN103685590B (en) Obtain the method and system of IP address
CN103023902B (en) Data transmission method and system
US8041893B1 (en) System and method for managing large filesystem-based caches
CN103701957A (en) Domain name server (DNS) recursive method and system thereof
CN104426718B (en) Data decryptor server, cache server and redirection method for down loading
US20140359066A1 (en) System, method and device for offline downloading resource and computer storage medium
CN101046806B (en) Search engine system and method
CN103077208B (en) URL(uniform resource locator) matched processing method and device
CN104717314A (en) IP management method and system, client-side and server
CN103812881B (en) Offline download control method and device
US8984100B2 (en) Data downloading method, terminal, server, and system
CA2310603A1 (en) An internet caching system and a method and an arrangement in such a system
Cherkasova et al. Dynamics and evolution of web sites: Analysis, metrics and design issues
CN103428231B (en) Offline download method and system
Jernberg et al. Doh: A content delivery peer-to-peer network
Asthana et al. On the feasibility of unstructured peer-to-peer information retrieval
CN102098339A (en) Audio file transmission method and system
Kamiyama et al. Measurement Analysis of Co-occurrence Degree of Web Objects

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant