CN109361739A - A kind of method for down loading, device, client, system and storage medium - Google Patents
A kind of method for down loading, device, client, system and storage medium Download PDFInfo
- Publication number
- CN109361739A CN109361739A CN201811120843.XA CN201811120843A CN109361739A CN 109361739 A CN109361739 A CN 109361739A CN 201811120843 A CN201811120843 A CN 201811120843A CN 109361739 A CN109361739 A CN 109361739A
- Authority
- CN
- China
- Prior art keywords
- section
- file
- http
- client
- data slice
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
Abstract
The invention discloses a kind of method for down loading, device, client, system and computer readable storage mediums, its method includes: the attribute information of the file in file download instructions based on the received, it obtains the HTTP download path of the file and the information of the Terminal Server Client of downloading can be provided, and generate the section to be downloaded of the file in unfinished section;When detecting the section to be downloaded of file described in the unfinished section, the HTTP fragment section and P2P fragment section of preset quantity are obtained from the section to be downloaded of the file;According to HTTP fragment section and the HTTP download path, from the HTTP data slice of HTTP server parallel downloading preset quantity;According to P2P fragment section and the information of the Terminal Server Client, P2P data slice is downloaded from the Terminal Server Client;Section is completed in HTTP data slice and the write-in of P2P data slice, to obtain the file from the section that is completed, the present invention can improve speed of download in the case where network is poor.
Description
Technical field
The present invention relates to technical field of the computer network more particularly to a kind of method for down loading, device, client, system and
Computer readable storage medium.
Background technique
File download technology is widely used in various file transmitting scenes.Wherein, most common document down loading method is
HTTP method for down loading, hypertext transfer protocol (Hyper Text Transportation Protocol, HTTP) is that one kind is
The agreement that content in the Web server for being located at each place in the whole world is sent to an unspecified number of user and is worked out, mentions
The standard (TCP) of client and server end request and response is supplied.Client is terminal user, and server end is website.It is logical
It crosses using Web browser, web crawlers or other tools, client initiates one to the (default of designated port on server
Port is HTTP request 80), the client that then server downloads the content transmission being stored on server to request
(Client)。
In the implementation of the present invention, inventor has found: in complicated network environment transmission, when user network situation
When poor, it is slack-off to may result in speed of download;Or when downloading from a server file there are multiple client, due to clothes
The bandwidth that business device can be provided is limited, and the client of file download is each carried out from server, will occupy server one
Divide bandwidth, causes server to be unable to satisfy the client of excess quantity while downloading the demand of file, so that client-side
The speed of download in face is slack-off or even can not download, the experience of the user seriously affected.
Summary of the invention
In view of the above-mentioned problems, the purpose of the present invention is to provide a kind of method for down loading, device, client, system and calculating
Machine readable storage medium storing program for executing, significantly improves speed of download, improves the user experience.
In a first aspect, the embodiment of the invention provides a kind of method for down loading, comprising the following steps:
Receive file download instructions;Wherein, the file download instructions include the attribute information of file to be downloaded;
According to the attribute information of the file, obtains the HTTP download path of the file and the long-range of downloading can be provided
The information of client, and the section to be downloaded of the file is generated in unfinished section;
When detecting the section to be downloaded of file described in the unfinished section, from the section to be downloaded of the file
The HTTP fragment section of the middle preset quantity for obtaining the file, and the text is obtained from the section to be downloaded of the file
The P2P fragment section of part;
It is corresponding default from HTTP server parallel downloading according to HTTP fragment section and the HTTP download path
The HTTP data slice of quantity;
According to P2P fragment section and the information of the Terminal Server Client, P2P number is downloaded from the Terminal Server Client
According to piece;
Section is completed in the HTTP data slice and P2P data slice write-in, to obtain from the section that is completed
Remove the file for carrying and completing.
In the first implementation of first aspect, the information according to the file obtains the file
HTTP download path and can provide downloading Terminal Server Client information, and do not complete section generate the file under
Section is carried, specifically:
According to the attribute information of the file, the HTTP download path of the file is obtained;
According to the attribute information of the file, obtained from P2P server can provide remote client's end interface of downloading with
And the Terminal Server Client can sharing data piece information;
According to the attribute information of the file, the section to be downloaded of the file is generated in unfinished section.
It is described when detection in second of implementation of first aspect according to the first implementation of first aspect
When to the section to be downloaded of file described in the unfinished section, the file is obtained from the section to be downloaded of the file
Preset quantity HTTP fragment section, and obtain from the section to be downloaded of the file P2P fragment area of the file
Between, specifically:
When detecting the section to be downloaded of file described in the unfinished section, according to current HTTP speed of download,
The HTTP fragment section of preset quantity is obtained from the pre-selected locations in the section to be downloaded of the file;
When detecting the section to be downloaded of file described in the unfinished section, according to the Terminal Server Client can
The speed of download of sharing data piece information and presently described Terminal Server Client is obtained from the section to be downloaded of the file
P2P data slice section.
It is described according to institute in the third implementation of first aspect according to second of implementation of first aspect
The information for stating P2P fragment section and the Terminal Server Client downloads P2P data slice from the Terminal Server Client, specifically:
According to remote client's end interface, the first P2P upload message is sent to the Terminal Server Client;Wherein, described
First P2P upload message includes P2P fragment section;
Receive the first P2P download message that the Terminal Server Client is returned according to the first P2P upload message;Wherein,
The first P2P download message includes P2P fragment section and the corresponding P2P data slice in P2P fragment section.
According to the third implementation of first aspect, in the 4th kind of implementation of first aspect, it is described will be described
Section is completed in HTTP data slice and P2P data slice write-in, to obtain the institute that downloading is completed from the section that is completed
File is stated, specifically:
Section is completed in the HTTP data slice of downloading completion and P2P data slice write-in;
Described total section shared by HTTP data slice described in section and the P2P data slice is completed it is equal to when detects
The file is at the initial section to be downloaded in the unfinished section, from the HTTP that section is completed and extracts the file
Data slice and P2P data slice, to obtain the file.
According to the 4th of first aspect the kind of implementation, in the 5th kind of implementation of first aspect, further includes:
According to all data slices that file described in section is completed, P2P data slice is sent to the P2P server
Share message;Wherein, the P2P data slice sharing message includes client-side interface and can sharing data piece information;
It receives the Terminal Server Client and the 2nd P2P upload message that message returns is shared according to the P2P data slice;Its
In, the Terminal Server Client obtains the P2P data slice from the P2P server and shares message;The 2nd P2P upload message
P2P fragment section including the Terminal Server Client;
According to all data slices of the file being completed in section and the P2P fragment of the Terminal Server Client
Section sends the 2nd P2P download message to the Terminal Server Client;Wherein, the 2nd P2P download message includes described long-range
The P2P fragment section of client and it is corresponding from it is described be completed section obtain P2P data slice.
Second aspect, the embodiment of the invention provides a kind of download apparatus, comprising:
Download instruction receiving module, for receiving file download instructions;Wherein, the file download instructions include to be downloaded
File attribute information;
Download information obtains module, for the attribute information according to the file, obtains the HTTP downloading road of the file
The information of diameter and the Terminal Server Client that downloading can be provided, and the section to be downloaded of the file is generated in unfinished section;
Fragment section obtains module, for when detecting the section to be downloaded of file described in the unfinished section,
Obtain the HTTP fragment section of the preset quantity of the file from the section to be downloaded of the file, and from the file
The P2P fragment section of the file is obtained in section to be downloaded;
HTTP data slice download module, for according to HTTP fragment section and the HTTP download path, from
HTTP server parallel downloading corresponds to the HTTP data slice of preset quantity;
P2P data slice download module, for the information according to P2P fragment section and the Terminal Server Client, from
The Terminal Server Client downloads P2P data slice;
File acquisition module, for by the HTTP data slice and the P2P data slice write-in section is completed, with from
The section that is completed obtains the file that downloading is completed.
The third aspect the embodiment of the invention provides a kind of downloading client, including processor, memory and is stored in
In the memory and it is configured as the computer program executed by the processor, the processor executes the computer journey
The method for down loading as described in any one of first aspect is realized when sequence.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storage
Medium includes the computer program of storage, wherein controls the computer-readable storage medium in computer program operation
Equipment executes the method for down loading as described in any one of first aspect where matter.
5th aspect, the embodiment of the invention provides a kind of download systems, including the downloading client as described in the third aspect
End, at least one Terminal Server Client and HTTP server;
The downloading client, for receiving file download instructions;Wherein, the file download instructions include to be downloaded
The attribute information of file;According to the attribute information of the file, obtains the HTTP download path of the file and can provide down
The information of the Terminal Server Client of load, and the section to be downloaded of the file is generated in unfinished section;
The downloading client is also used to when detecting the section to be downloaded of file described in the unfinished section,
Obtain the HTTP fragment section of the preset quantity of the file from the section to be downloaded of the file, and from the file
The P2P fragment section of the file is obtained in section to be downloaded;
The downloading client is also used to according to HTTP fragment section and the HTTP download path, from HTTP
Server parallel downloading corresponds to the HTTP data slice of preset quantity;
The HTTP server, for providing Downloadable HTTP data slice;
The downloading client is also used to the information according to P2P fragment section and the Terminal Server Client, from institute
State Terminal Server Client downloading P2P data slice;
The Terminal Server Client, for providing Downloadable P2P data slice;
The downloading client is also used to the HTTP data slice and the P2P data slice write-in section is completed,
To obtain the file that downloading is completed from the section that is completed.
Above embodiments have the following beneficial effects:
By being believed according to the attribute of file to be downloaded in the file download instructions when receiving file download instructions
Breath obtains the HTTP download path of the file and can provide the information of the Terminal Server Client of downloading, and from the file
Parallel downloading HTTP data slice in HTTP download path, and P2P number is downloaded from the Terminal Server Client that can provide downloading
According to piece, so that the downloading of the file is completed, by way of multi-thread concurrent downloading and P2P downloading, in user network shape
In the case that condition is poor or HTTP server upstream bandwidth occupancy is excessively high, file downloading speed is significantly improved, network is avoided to ask
Topic or bandwidth problem bring download slow problem, also save total download time, improve the downloading experience of user, and
And from the P2P downloading mode of Terminal Server Client downloading P2P data slice, while decreasing HTTP server upstream bandwidth
Pressure.
Detailed description of the invention
In order to illustrate more clearly of technical solution of the present invention, attached drawing needed in embodiment will be made below
Simply introduce, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, general for this field
For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the flow diagram for the method for down loading that first embodiment of the invention provides.
Fig. 2 is the structural schematic diagram for the download apparatus that second embodiment of the invention provides.
Fig. 3 is the structural schematic diagram for the downloading client that third embodiment of the invention provides.
Fig. 4 is the structural schematic diagram for the download system that fifth embodiment of the invention provides.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Referring to Fig. 1, first embodiment of the invention provides a kind of method for down loading, can be executed by downloading client,
And the following steps are included:
S11 receives file download instructions;Wherein, the file download instructions include the attribute information of file to be downloaded.
In embodiments of the present invention, the downloading client can be the meter such as computer, mobile phone, tablet computer, laptop
Equipment is calculated, the method for down loading can be used as a function or be integrated in the downloading client by carrier of APP.
In embodiments of the present invention, it when user wants to download a certain file, can be clicked by hardware such as mouse, touch tablets
It downloads key or downloads key by the screen taps with touch sensitive surface, the downloading client detects downloading key quilt
When triggering, corresponding file download instructions are received.
S12 obtains the HTTP download path of the file and can provide downloading according to the attribute information of the file
The information of Terminal Server Client, and the section to be downloaded of the file is generated in unfinished section.
In embodiments of the present invention, the downloading client obtains the file according to the attribute information of the file
HTTP download path;Simultaneously according to the attribute information of the file, the remote client of downloading can be provided from the acquisition of P2P server
End interface and the Terminal Server Client can sharing data piece information, the downloading client and the P2P server are established
TCP connection is connected with UDP, wherein by the TCP connection, to carry out resource query, example according to the attribute information of the file
Sha1 the and md5 value of file is inquired as the ID of resource file as will be described, so that obtaining from the P2P server can
With provide that the Terminal Server Client of resource downloading is capable of providing can sharing data piece information, and by the UDP connection from described
IP the and UDP interface of the Terminal Server Client is obtained in P2P server, and the downloading client is according to the category of the file
Property information, generate the section to be downloaded of the file not completing section.
S13, when detecting the section to be downloaded of file described in the unfinished section, from the to be downloaded of the file
The HTTP fragment section of the preset quantity of the file is obtained in section, and obtains institute from the section to be downloaded of the file
State the P2P fragment section of file.
In embodiments of the present invention, when it is described downloading client detect file described in the unfinished section under
When carrying section, according to current HTTP speed of download, preset quantity is obtained from the pre-selected locations in the section to be downloaded of the file
HTTP fragment section, specifically, there is also do not divide detecting file described in the unfinished section for the downloading client
When the section to be downloaded matched, is gone not completing paper interval according to the preparatory position of file, practical distribution position is found, if pre- bit selecting
The position for being assigned and then having found nearest neighbor is set, the HTTP fragment of distribution is then calculated according to current HTTP speed of download
The length in section, so that the HTTP fragment section of the preset quantity of distribution is obtained, for example, HTTP data slice is 4M, root when defaulting
According to the speed of download of HTTP divided by parallel downloading HTTP fragment section number (such as default is 4 pieces while downloading) mapping 2M to 8M
Length of the section as downloading segment, it should be noted that the present invention does not do the specific setting of the preset quantity any
Limitation, can be specifically arranged according to actual conditions, in addition, after being assigned with corresponding HTTP fragment section, the file
Allocated HTTP fragment section is accordingly subtracted in the section to be downloaded in the unfinished section.
In embodiments of the present invention, when detecting the section to be downloaded of file described in the unfinished section, according to
The Terminal Server Client can sharing data piece information and presently described Terminal Server Client speed of download, from the file
P2P data slice section, specifically, downloading client institute in detecting the unfinished section are obtained in section to be downloaded
File is stated there is also when unappropriated section to be downloaded, according to the Terminal Server Client can sharing data piece information in the text
Corresponding position to be allocated is determined in the unappropriated section to be downloaded of part, then according to the speed of download of the Terminal Server Client
The length in the section of distribution is calculated, to obtain the P2P data slice of distribution, such as P2P data slice default size is 64K, directly
Pick up length of the P2P speed of download mapping section 48K to 512K as downloading segment between each Terminal Server Client.
S14, it is corresponding from HTTP server parallel downloading according to HTTP fragment section and the HTTP download path
The HTTP data slice of preset quantity.
In embodiments of the present invention, the download terminal leads to according to the HTTP fragment section of the preset quantity of acquisition
The HTTP download path is crossed, the HTTP data slice of preset quantity is corresponded to from HTTP server parallel downloading, specifically, under described
The HTTP fragment section for carrying the preset quantity that client will acquire is put into request queue, then is gone by the thread inside thread pool
HTTP request is taken, the request number handled according to the size of queue and per thread takes preset quantity task, and (such as 1 arrive
4) it is added in the execution queue of this thread and concurrently executes, it realizes HTTP request function how concurrent in multithreading, supports
Get, post upload the HTTP requests such as downloading, and the HTTP data slice that the HTTP server returns is received after request is completed,
Section is completed in HTTP data slice write-in by the downloading client, if in the HTTP for receiving the HTTP server return
HTTP error code is received while data slice, is carried out HTTP if HTTP error code is (300-400) and is retried, if 3 times retry
After continue error then abandon the HTTP data slice and by HTTP fragment section be written do not complete section.
S15 is downloaded according to P2P fragment section and the information of the Terminal Server Client from the Terminal Server Client
P2P data slice.
In embodiments of the present invention, the downloading client is according to remote client's end interface, to the remote client
End sends the first P2P upload message, and the first P2P upload message includes P2P fragment section, then receives described long-range
The first P2P download message that client is returned according to the first P2P upload message, the first P2P download message includes institute
State P2P fragment section and the corresponding P2P data slice in P2P fragment section, wherein the downloading client and the long-range visitor
UTP connection is established by the Terminal Server Client IP and interface in family end, after receiving the P2P data slice, the downloading
Client verifies the P2P data slice, if unsuccessfully returning to Terminal Server Client error code, if verifying the P2P number successfully
According to piece be written described in section is completed, implemented using this mode of client active transmission acceleration request, reduce client to every
A Terminal Server Client safeguards the complex logic that can download resource section, also greatly reduces the logic and difficulty of implementation, imitates
Fruit also has a good guarantee.
Section is completed, area is completed from described in the HTTP data slice and P2P data slice write-in by S16
Between obtain downloading complete the file.
In embodiments of the present invention, the HTTP data slice and the P2P that the downloading client completes downloading
Data slice write-in section is completed, when the downloading client detect described in be completed HTTP data slice described in section and
Total section shared by the P2P data slice is equal to the file at the initial section to be downloaded in the unfinished section, from described
HTTP data slice and P2P data slice that the file is extracted in section is completed, to obtain the file, file download complete into
Row entire file sha1 and md5 verification ensures the correctness of file.
In conclusion first embodiment of the invention provides a kind of method for down loading, by receiving file download instructions
When, according to the attribute information of file to be downloaded in the file download instructions, obtain the file HTTP download path and
The information of the Terminal Server Client of downloading, and the parallel downloading HTTP data from the HTTP download path of the file can be provided
Piece, and P2P data slice is downloaded from the Terminal Server Client that can provide downloading, to complete the downloading of the file, lead to
The mode of multithreading parallel downloading and P2P downloading is crossed, it is poor or HTTP server upstream bandwidth accounts in user network situation
In the case where excessively high, file downloading speed is significantly improved, avoids network problem or bandwidth problem bring from downloading slow
Problem also saves total download time, improves the downloading experience of user, and download P2P data from the Terminal Server Client
The P2P downloading mode of piece, while decreasing the pressure of HTTP server upstream bandwidth.
In order to facilitate the understanding of the present invention, some currently preferred embodiments of the present invention will be done and will further be retouched below
It states.
Preferably, the method for down loading further include:
According to all data slices that file described in section is completed, P2P data slice is sent to the P2P server
Share message;Wherein, the P2P data slice sharing message includes client-side interface and can sharing data piece information.
It receives the Terminal Server Client and the 2nd P2P upload message that message returns is shared according to the P2P data slice;Its
In, the Terminal Server Client obtains the P2P data slice from the P2P server and shares message;The 2nd P2P upload message
P2P fragment section including the Terminal Server Client.
According to all data slices of the file being completed in section and the P2P fragment of the Terminal Server Client
Section sends the 2nd P2P download message to the Terminal Server Client;Wherein, the 2nd P2P download message includes described long-range
The P2P fragment section of client and it is corresponding from it is described be completed section obtain P2P data slice.
In embodiments of the present invention, data slice resource present in section is completed in the downloading client according to
(including the HTTP data slice downloaded from HTTP approach and the P2P data slice downloaded from P2P approach), to the P2P server
It sends P2P data slice and shares message, the P2P server stores the IP of the data slice resource information and the downloading client
And interface message, then other Terminal Server Clients are inquired in the downloading client on P2P server in the presence of described
After the resource data that Terminal Server Client needs, the IP and interface of the downloading client are obtained from the P2P server
Then information sends the 2nd P2P upload message to the downloading client, the downloading client is according on the 2nd P2P
It passes message and sends the 2nd P2P download message to the Terminal Server Client, the 2nd P2P download message carries the long-range visitor
The P2P data slice that family end needs realizes that the downloading client passes through sharing process of the P2P approach to other Terminal Server Clients.
Referring to Fig. 2, second embodiment of the invention provides a kind of download apparatus, comprising:
Download instruction receiving module 11, for receiving file download instructions;Wherein, the file download instructions include under
The attribute information of the file of load.
Download information obtains module 12, for the attribute information according to the file, obtains the HTTP downloading of the file
The information in path and the Terminal Server Client that downloading can be provided, and the section to be downloaded of the file is generated in unfinished section.
Fragment section obtains module 13, for when the section to be downloaded for detecting file described in the unfinished section
When, obtain the HTTP fragment section of the preset quantity of the file from the section to be downloaded of the file, and from the text
The P2P fragment section of the file is obtained in the section to be downloaded of part.
HTTP data slice download module 14, for according to HTTP fragment section and the HTTP download path, from
HTTP server parallel downloading corresponds to the HTTP data slice of preset quantity.
P2P data slice download module 15, for the information according to P2P fragment section and the Terminal Server Client,
P2P data slice is downloaded from the Terminal Server Client.
File acquisition module 16, for section to be completed in the HTTP data slice and P2P data slice write-in, with
The file that downloading is completed is obtained from the section that is completed.
In the first implementation of second embodiment, the download information obtains module 12 and specifically includes:
HTTP download path acquiring unit, for the attribute information according to the file, under the HTTP for obtaining the file
Carry path.
Terminal Server Client information acquisition unit, for the attribute information according to the file, obtaining from P2P server can be with
There is provided downloading remote client's end interface and the Terminal Server Client can sharing data piece information.
Initial section generation unit generates the file in unfinished section for the attribute information according to the file
Section to be downloaded.
The first implementation according to the second embodiment, in second of implementation of second embodiment, described point
Piece section obtains module 13 and specifically includes:
HTTP fragment section acquiring unit, for when the section to be downloaded for detecting file described in the unfinished section
When, according to current HTTP speed of download, HTTP points of preset quantity are obtained from the pre-selected locations in the section to be downloaded of the file
Piece section.
P2P data slice section acquiring unit, for when the area to be downloaded for detecting file described in the unfinished section
Between when, according to the Terminal Server Client can sharing data piece information and presently described Terminal Server Client speed of download, from
P2P data slice section is obtained in the section to be downloaded of the file.
Second of implementation according to the second embodiment, in the third implementation of second embodiment, the P2P
Data slice download module 15 specifically:
First P2P upload message transmission unit, for being sent out to the Terminal Server Client according to remote client's end interface
Send the first P2P upload message;Wherein, the first P2P upload message includes P2P fragment section.
First P2P download message receiving unit, for receiving the Terminal Server Client according to the first P2P upload message
The first P2P download message returned;Wherein, the first P2P download message includes P2P fragment section and the P2P points
The corresponding P2P data slice in piece section.
The third implementation according to the second embodiment, in the 4th kind of implementation of second embodiment, the text
Part obtains module 16 and specifically includes:
Data slice writing unit, for the HTTP data slice completed and P2P data slice write-in will to have been downloaded
Complete section.
File obtaining unit, for described HTTP data slice described in section and the P2P number being completed when detecting
It is equal to the file at the initial section to be downloaded in the unfinished section according to total section shared by piece, section is completed from described
The HTTP data slice and P2P data slice of the file are extracted, to obtain the file.
4th kind of implementation according to the second embodiment, in the 5th kind of implementation of second embodiment, further includes:
Share message sending unit, for all data slices of file described in section to be completed according to, to described
P2P server sends P2P data slice and shares message;Wherein, the P2P data slice sharing message includes client-side interface and can
Sharing data piece information.
2nd P2P upload message receiving unit disappears for receiving the Terminal Server Client according to P2P data slice sharing
Cease the 2nd P2P upload message returned;Wherein, the Terminal Server Client obtains the P2P data slice point from the P2P server
Enjoy message;The 2nd P2P upload message includes the P2P fragment section of the Terminal Server Client.
2nd P2P download message transmission unit, all data of the file for being completed according in section
The P2P fragment section of piece and the Terminal Server Client sends the 2nd P2P download message to the Terminal Server Client;Wherein, institute
It states P2P fragment section that the 2nd P2P download message includes the Terminal Server Client and corresponding is obtained from the section that is completed
The P2P data slice taken.
It should be noted that the apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with
It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual
It needs that some or all of the modules therein is selected to achieve the purpose of the solution of this embodiment.In addition, device provided by the invention
In embodiment attached drawing, the connection relationship between module indicate between them have communication connection, specifically can be implemented as one or
A plurality of communication bus or signal wire.Those of ordinary skill in the art are without creative efforts, it can understand
And implement.
It is the schematic diagram for the downloading client that third embodiment of the invention provides referring to Fig. 3.As shown in figure 3, the lower carrying
Family end includes: at least one processor 11, such as CPU, at least one network interface 14 or other users interface 13, memory
15, at least one communication bus 12, communication bus 12 is for realizing the connection communication between these components.Wherein, user interface
13 may include optionally USB interface and other standards interface, wireline interface.Network interface 14 optionally may include Wi-
Fi interface and other wireless interfaces.Memory 15 may include high speed RAM memory, it is also possible to further include non-labile deposit
Reservoir (non-volatilememory), for example, at least a magnetic disk storage.Memory 15 optionally may include at least one
A storage device for being located remotely from aforementioned processor 11.
In some embodiments, memory 15 stores following element, executable modules or data structures, or
Their subset or their superset:
Operating system 151 includes various system programs, for realizing various basic businesses and hardware based of processing
Business;
Program 152.
Specifically, processor 11 is for calling the program 152 stored in memory 15, under executing described in above-described embodiment
Support method, such as step S11 shown in FIG. 1.Alternatively, the processor realizes above-mentioned each device when executing the computer program
The function of each module/unit in embodiment, such as download instruction receiving module.
Illustratively, the computer program can be divided into one or more module/units, one or more
A module/unit is stored in the memory, and is executed by the processor, to complete the present invention.It is one or more
A module/unit can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing institute
State implementation procedure of the computer program in the downloading client.
The downloading client can be desktop PC, notebook, palm PC and mobile phone etc. and calculate equipment.It is described
Downloading client may include, but be not limited only to, processor 11, memory 15.It will be understood by those skilled in the art that the signal
Figure is only the example for downloading client, does not constitute the restriction to downloading client, may include more more or less than illustrating
Component, perhaps combine certain components or different components.
Alleged processor 11 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
It is the control centre of the downloading client Deng, the processor 11, entirely downloads client using various interfaces and connection
The various pieces at end.
The memory 15 can be used for storing the computer program and/or module, the processor 11 by operation or
Computer program and/or the module stored in the memory is executed, and calls the data being stored in memory, is realized
The various functions of the downloading client.The memory 15 can mainly include storing program area and storage data area, wherein deposit
Storing up program area can application program needed for storage program area, at least one function etc.;Storage data area can be stored according to mobile phone
Use created data etc..In addition, memory may include high-speed random access memory, it can also include non-volatile
Memory, such as hard disk, memory, plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital
(Secure Digital, SD) card, flash card (Flash Card), at least one disk memory, flush memory device or other
Volatile solid-state part.
Fourth embodiment of the invention provides a kind of computer readable storage medium, the integrated mould of the downloading client
If block/unit is realized in the form of SFU software functional unit and when sold or used as an independent product, can store one
In a computer-readable storage medium.Based on this understanding, the present invention realizes the whole in above-described embodiment method or portion
Split flow can also instruct relevant hardware to complete by computer program, and the computer program can be stored in one
In computer readable storage medium, the computer program is when being executed by processor, it can be achieved that above-mentioned each embodiment of the method
Step.Wherein, the computer program includes computer program code, and the computer program code can be source code shape
Formula, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium may include: that can take
Any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, CD, computer with the computer program code are deposited
Reservoir, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access
Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the computer-readable medium
The content for including can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, such as in certain departments
Method administrative area does not include electric carrier signal and telecommunication signal according to legislation and patent practice, computer-readable medium.
Referring to Fig. 4, fifth embodiment of the invention provides a kind of download system, under as described in 3rd embodiment
Carry client 41, at least one Terminal Server Client 42 and HTTP server 43;
The downloading client 41, for receiving file download instructions;Wherein, the file download instructions include to be downloaded
File attribute information;According to the attribute information of the file, obtains the HTTP download path of the file and can provide
The information of the Terminal Server Client of downloading, and the section to be downloaded of the file is generated in unfinished section;
The downloading client 41 is also used to when the section to be downloaded for detecting file described in the unfinished section
When, obtain the HTTP fragment section of the preset quantity of the file from the section to be downloaded of the file, and from the text
The P2P fragment section of the file is obtained in the section to be downloaded of part;
The downloading client 41, is also used to according to HTTP fragment section and the HTTP download path, from
43 parallel downloading of HTTP server corresponds to the HTTP data slice of preset quantity;
The HTTP server 43, for providing Downloadable HTTP data slice;
The downloading client 41, is also used to the information according to P2P fragment section and the Terminal Server Client 42,
P2P data slice is downloaded from the Terminal Server Client;
The Terminal Server Client 42, for providing Downloadable P2P data slice;
The downloading client 41 is also used to the HTTP data slice and the P2P data slice write-in area is completed
Between, to obtain the file that downloading is completed from the section that is completed.
Preferably, the download system further includes P2P server.
The downloading client 41, is specifically also used to the attribute information according to the file, obtains the HTTP of the file
Download path;According to the attribute information of the file, obtained from P2P server can provide remote client's end interface of downloading with
And the Terminal Server Client can sharing data piece information;According to the attribute information of the file, institute is generated in unfinished section
State the section to be downloaded of file.
The P2P server can provide the remote client's end interface and the Terminal Server Client of downloading for providing
Can sharing data piece information.
Preferably,
The downloading client 41, is also used to be completed all data slices of file described in section according to, to institute
It states P2P server and sends P2P data slice sharing message;Wherein, the P2P data slice share message include client-side interface and
It can sharing data piece information.
The P2P server, is also used to store the client-side interface and can sharing data piece information.
The Terminal Server Client 42, be also used to obtain to the P2P server can provide the client-side interface of downloading with
And the client can sharing data piece information.
The P2P server, be also used to provide to the Terminal Server Client 42 can provide the client-side interface of downloading with
And the client can sharing data piece information.
The Terminal Server Client 42 is also used to the client-side interface that can provide downloading and the client according to acquisition
End can sharing data piece information, to the downloading client 41 transmission the 2nd P2P upload message;Wherein, on the 2nd P2P
Pass the P2P fragment section that message includes the Terminal Server Client.
The downloading client 41 is also used to receive the 2nd P2P upload message, and is uploaded according to the 2nd P2P
Message sends the 2nd P2P download message to the Terminal Server Client 42;Wherein, the 2nd P2P download message includes described remote
The P2P fragment section of journey client 42 and it is corresponding from it is described be completed section obtain P2P data slice.
The above is a preferred embodiment of the present invention, it is noted that for those skilled in the art
For, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also considered as
Protection scope of the present invention.
Claims (10)
1. a kind of method for down loading, which comprises the following steps:
Receive file download instructions;Wherein, the file download instructions include the attribute information of file to be downloaded;
According to the attribute information of the file, obtains the HTTP download path of the file and the remote client of downloading can be provided
The information at end, and the section to be downloaded of the file is generated in unfinished section;
When detecting the section to be downloaded of file described in the unfinished section, obtained from the section to be downloaded of the file
The HTTP fragment section of the preset quantity of the file is taken, and obtains the file from the section to be downloaded of the file
P2P fragment section;
According to HTTP fragment section and the HTTP download path, preset quantity is corresponded to from HTTP server parallel downloading
HTTP data slice;
According to P2P fragment section and the information of the Terminal Server Client, P2P data are downloaded from the Terminal Server Client
Piece;
Section is completed in the HTTP data slice and P2P data slice write-in, to be completed under the acquisition of section from described
Carry the file completed.
2. method for down loading according to claim 1, which is characterized in that the information according to the file, described in acquisition
The information of the HTTP download path of file and the Terminal Server Client that downloading can be provided, and the file is generated in unfinished section
Section to be downloaded, specifically:
According to the attribute information of the file, the HTTP download path of the file is obtained;
According to the attribute information of the file, remote client's end interface and the institute of downloading can be provided from the acquisition of P2P server
That states Terminal Server Client can sharing data piece information;
According to the attribute information of the file, the section to be downloaded of the file is generated in unfinished section.
3. method for down loading according to claim 2, which is characterized in that described to detect described in the unfinished section
When the section to be downloaded of file, the HTTP fragment area of the preset quantity of the file is obtained from the section to be downloaded of the file
Between, and the P2P fragment section of the file is obtained from the section to be downloaded of the file, specifically:
When detecting the section to be downloaded of file described in the unfinished section, according to current HTTP speed of download, from institute
The pre-selected locations for stating the section to be downloaded of file obtain the HTTP fragment section of preset quantity;
When detecting the section to be downloaded of file described in the unfinished section, according to sharing for the Terminal Server Client
The speed of download of data slice information and presently described Terminal Server Client obtains P2P number from the section to be downloaded of the file
According to piece section.
4. method for down loading according to claim 3, which is characterized in that described according to P2P fragment section and described
The information of Terminal Server Client downloads P2P data slice from the Terminal Server Client, specifically:
According to remote client's end interface, the first P2P upload message is sent to the Terminal Server Client;Wherein, described first
P2P upload message includes P2P fragment section;
Receive the first P2P download message that the Terminal Server Client is returned according to the first P2P upload message;Wherein, described
First P2P download message includes P2P fragment section and the corresponding P2P data slice in P2P fragment section.
5. method for down loading according to claim 4, which is characterized in that described by the HTTP data slice and the P2P
Section is completed in data slice write-in, to obtain the file that downloading is completed from the section that is completed, specifically:
Section is completed in the HTTP data slice of downloading completion and P2P data slice write-in;
When detecting described be completed described in total section shared by HTTP data slice described in section and the P2P data slice is equal to
File is at the initial section to be downloaded in the unfinished section, from the HTTP data that section is completed and extracts the file
Piece and P2P data slice, to obtain the file.
6. method for down loading according to claim 5, which is characterized in that further include:
According to all data slices that file described in section is completed, P2P data slice is sent to the P2P server and is shared
Message;Wherein, the P2P data slice sharing message includes client-side interface and can sharing data piece information;
It receives the Terminal Server Client and the 2nd P2P upload message that message returns is shared according to the P2P data slice;Wherein, institute
It states Terminal Server Client and obtains the P2P data slice sharing message from the P2P server;The 2nd P2P upload message includes
The P2P fragment section of the Terminal Server Client;
According to all data slices of the file being completed in section and the P2P fragment area of the Terminal Server Client
Between, the 2nd P2P download message is sent to the Terminal Server Client;Wherein, the 2nd P2P download message includes the long-range visitor
The P2P fragment section at family end and it is corresponding from it is described be completed section obtain P2P data slice.
7. a kind of download apparatus characterized by comprising
Download instruction receiving module, for receiving file download instructions;Wherein, the file download instructions include text to be downloaded
The attribute information of part;
Download information obtains module, for the attribute information according to the file, obtain the file HTTP download path and
The information of the Terminal Server Client of downloading can be provided, and generate the section to be downloaded of the file in unfinished section;
Fragment section obtains module, for when detecting the section to be downloaded of file described in the unfinished section, from institute
The HTTP fragment section for the preset quantity that the file is obtained in the section to be downloaded of file is stated, and from the file under
Carry the P2P fragment section that the file is obtained in section;
HTTP data slice download module, for being taken from HTTP according to HTTP fragment section and the HTTP download path
Business device parallel downloading corresponds to the HTTP data slice of preset quantity;
P2P data slice download module, for the information according to P2P fragment section and the Terminal Server Client, from described
Terminal Server Client downloads P2P data slice;
File acquisition module, for section to be completed in the HTTP data slice and P2P data slice write-in, with from described
Section is completed and obtains the file that downloading is completed.
8. a kind of downloading client, including processor, memory and storage in the memory and are configured as by described
The computer program that processor executes, the processor are realized when executing the computer program as any in claim 1 to 6
Method for down loading described in one.
9. a kind of computer readable storage medium, which is characterized in that the computer readable storage medium includes the calculating of storage
Machine program, wherein equipment where controlling the computer readable storage medium in computer program operation is executed as weighed
Benefit require any one of 1 to 6 described in method for down loading.
10. a kind of download system, which is characterized in that including downloading client, at least one long-range visitor as claimed in claim 8
Family end and HTTP server;
The downloading client, for receiving file download instructions;Wherein, the file download instructions include file to be downloaded
Attribute information;According to the attribute information of the file, obtains the HTTP download path of the file and downloading can be provided
The information of Terminal Server Client, and the section to be downloaded of the file is generated in unfinished section;
The downloading client is also used to when detecting the section to be downloaded of file described in the unfinished section, from institute
The HTTP fragment section for the preset quantity that the file is obtained in the section to be downloaded of file is stated, and from the file under
Carry the P2P fragment section that the file is obtained in section;
The downloading client is also used to according to HTTP fragment section and the HTTP download path, from HTTP service
Device parallel downloading corresponds to the HTTP data slice of preset quantity;
The HTTP server, for providing Downloadable HTTP data slice;
The downloading client is also used to the information according to P2P fragment section and the Terminal Server Client, from described remote
Journey client downloads P2P data slice;
The Terminal Server Client, for providing Downloadable P2P data slice;
The downloading client, be also used to by the HTTP data slice and the P2P data slice write-in section is completed, with from
The section that is completed obtains the file that downloading is completed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811120843.XA CN109361739A (en) | 2018-09-25 | 2018-09-25 | A kind of method for down loading, device, client, system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811120843.XA CN109361739A (en) | 2018-09-25 | 2018-09-25 | A kind of method for down loading, device, client, system and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109361739A true CN109361739A (en) | 2019-02-19 |
Family
ID=65347753
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811120843.XA Pending CN109361739A (en) | 2018-09-25 | 2018-09-25 | A kind of method for down loading, device, client, system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109361739A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109922142A (en) * | 2019-02-21 | 2019-06-21 | 阿里巴巴集团控股有限公司 | A kind of document down loading method, apparatus and system |
CN110401702A (en) * | 2019-07-09 | 2019-11-01 | 北京达佳互联信息技术有限公司 | A kind of offline packet method for down loading, device, electronic equipment and storage medium |
CN114422507A (en) * | 2022-01-27 | 2022-04-29 | 北京金山云网络技术有限公司 | File downloading method and device and electronic equipment |
-
2018
- 2018-09-25 CN CN201811120843.XA patent/CN109361739A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109922142A (en) * | 2019-02-21 | 2019-06-21 | 阿里巴巴集团控股有限公司 | A kind of document down loading method, apparatus and system |
CN110401702A (en) * | 2019-07-09 | 2019-11-01 | 北京达佳互联信息技术有限公司 | A kind of offline packet method for down loading, device, electronic equipment and storage medium |
CN110401702B (en) * | 2019-07-09 | 2022-03-25 | 北京达佳互联信息技术有限公司 | Offline package downloading method and device, electronic equipment and storage medium |
CN114422507A (en) * | 2022-01-27 | 2022-04-29 | 北京金山云网络技术有限公司 | File downloading method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108776934B (en) | Distributed data calculation method and device, computer equipment and readable storage medium | |
CN109155748A (en) | The natural language interaction formula messaging system server of internet cloud trustship cooperates | |
US10310850B2 (en) | Methods and systems for determining relevant changes in an API | |
CN110443695A (en) | Data processing method and its device, electronic equipment and medium | |
US11175796B2 (en) | Menu management method, server, and system | |
CN106664321A (en) | Placement policy-based allocation of computing resources | |
CN103607424B (en) | Server connection method and server system | |
CN109361739A (en) | A kind of method for down loading, device, client, system and storage medium | |
US10467055B2 (en) | Computer resource provisioning failure mitigation | |
US11012371B2 (en) | Queued workload service in a multi tenant environment | |
US9787521B1 (en) | Concurrent loading of session-based information | |
CN110096388A (en) | A kind of method, apparatus and computer storage medium of data backup | |
CN108418874A (en) | Guiding method, device, computer equipment and storage medium are returned across wide area network data | |
CN107396199A (en) | Barrage method for exhibiting data and device, computer-readable recording medium | |
US11157579B2 (en) | Optimizing listing efficiency and efficacy for a delivery coordination system | |
CN107222774A (en) | Information displaying method and device, computer-readable recording medium | |
US11126483B1 (en) | Direct message retrieval in distributed messaging systems | |
CN110019873A (en) | Human face data processing method, device and equipment | |
CN106357561A (en) | Access port queuing and resource management | |
CN110149374A (en) | A kind of document transmission method, terminal device and computer readable storage medium | |
CN107480117A (en) | Automate the restoration methods and device of page table list data | |
US8745245B1 (en) | System and method for offline detection | |
CN107332703B (en) | Method and device for checking multi-application logs | |
US10341420B1 (en) | Approaches for preparing and delivering bulk data to clients | |
CN110086881A (en) | Method for processing business, device and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190219 |
|
RJ01 | Rejection of invention patent application after publication |