CN110022336A - Improve method, storage medium, equipment and the system of Internet resources speed of download - Google Patents

Improve method, storage medium, equipment and the system of Internet resources speed of download Download PDF

Info

Publication number
CN110022336A
CN110022336A CN201810019790.6A CN201810019790A CN110022336A CN 110022336 A CN110022336 A CN 110022336A CN 201810019790 A CN201810019790 A CN 201810019790A CN 110022336 A CN110022336 A CN 110022336A
Authority
CN
China
Prior art keywords
file
files
blocks
downloaded
download
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
Application number
CN201810019790.6A
Other languages
Chinese (zh)
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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201810019790.6A priority Critical patent/CN110022336A/en
Publication of CN110022336A publication Critical patent/CN110022336A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols

Abstract

The invention discloses a kind of method, storage medium, equipment and systems for improving Internet resources speed of download, it is related to mobile terminal download technology field, the present invention is by creating multiple background threads, the segmentation downloading same file from network server parallel, multiple background thread downloadings are waited to complete, the content that per thread is downloaded is merged again, creates and is written to local file.It opens multiple background threads simultaneously while downloading this document, not only increase download performance, also improve the Parallel download amount of synchronization file, to improve the speed of download of file.

Description

Improve method, storage medium, equipment and the system of Internet resources speed of download
Technical field
The present invention relates to mobile terminal download technology fields, and in particular to a kind of side for improving Internet resources speed of download Method, storage medium, equipment and system.
Background technique
Internet resources refer to the information resources using computer by communication equipment propagation and network software management, such as network On video, music, file etc. be all Internet resources.
Common Internet resources downloading mode is to be downloaded using a background thread, disadvantage are as follows: uses a backstage line Journey downloading, it is excessively slow to will cause big file downloading speed;For example downloading file is 1GB, current speed of download is 1 second 1MB, that is in total Downloading in 1024 seconds is needed to complete.
Summary of the invention
In view of the deficiencies in the prior art, the purpose of the present invention is to provide a kind of raising Internet resources speeds of download Method, storage medium, equipment and system, improve the speed of download of file.
To achieve the above objectives, the technical solution adopted by the present invention is that: a method of improve Internet resources speed of download:
Client receives the download address of Internet resources, obtains the title and size of file to be downloaded;
Client calculates the quantity N for preparing that file to be downloaded is split into blocks of files according to the size of file to be downloaded, and File to be downloaded is split into N number of blocks of files to web server requests;
File to be downloaded is split into N number of blocks of files by server;
Client obtains the file block message of each blocks of files to network server;Create N number of background process, each backstage Process is corresponding with a blocks of files of file to be downloaded, and the file block message of each blocks of files is transmitted to corresponding backstage respectively In process, blocks of files is downloaded in background process;
Client creates one and the equal-sized local file of file to be downloaded, and the blocks of files downloaded is written to this In ground file.
Based on the above technical solution, the quantity computation method of blocks of files are as follows:
Optimal threads load amount is set as PMB, the size of file to be downloaded is QMB, and maximum thread amount is NmaxIt is a, meter Calculate number of threads Na=Q/P;
If Na≦Nmax, the value of the quantity N of blocks of files is Na
If Na > Nmax, the value of the quantity N of blocks of files is Nmax
Based on the above technical solution, GetBlockFileInfo function is called to obtain file block message, blocks of files Information includes the sequence and size of blocks of files.
Based on the above technical solution, the N number of background process of CreateProcess function creation, each backstage are called Process is corresponding with a blocks of files of file to be downloaded, and each file block message is transmitted to respectively in corresponding background process;
StartProcessDownFile is called to open the network connection downloading of each background process
Based on the above technical solution, the local of one file to be downloaded size of CreateFile function creation is called File, calling WriteFile function being sequentially written in local file according to each blocks of files by the blocks of files downloaded.
The invention also discloses a kind of storage medium, computer program, the computer journey are stored on the storage medium The method for improving Internet resources speed of download is realized when sequence is executed by processor.
The invention also discloses a kind of electronic equipment, including memory and processor, store on memory in processor The computer program of upper operation, processor realize the method for improving Internet resources speed of download when executing computer program.
The invention also discloses a kind of systems for improving Internet resources speed of download, including client and server, in which:
The client includes that download information obtains module, and blocks of files splits module, data obtaining module, and mould is downloaded on backstage Block and downloading file combination module;
Download information obtain module be used for receive Internet resources downloading request, obtain file to be downloaded download address, Title and size;
Blocks of files, which splits module and is used to be calculated according to the size of file to be downloaded, to be prepared file to be downloaded splitting into file The quantity N of block, and file to be downloaded is split into N number of blocks of files to web server requests;
Blocks of files data obtaining module is used to obtain the file block message of each blocks of files to network server;
Backstage download module is for creating N number of background process, a blocks of files of each background process and file to be downloaded It is corresponding, the file block message of each blocks of files is transmitted to respectively in corresponding background process, downloads blocks of files in background process;
File combination module is downloaded for creating one and the equal-sized local file of file to be downloaded, by what is downloaded Blocks of files is written in local file;
The server is used to file to be downloaded splitting into N number of blocks of files.
Based on the above technical solution, the quantity computation method of blocks of files are as follows:
Optimal threads load amount is set as PMB, the size of file to be downloaded is QMB, and maximum thread amount is NmaxIt is a, meter Calculate number of threads Na=Q/P;
If Na≦Nmax, the value of the quantity N of blocks of files is Na
If Na > Nmax, the value of the quantity N of blocks of files is Nmax
Based on the above technical solution, the backstage download module is for calling CreateProcess function creation N A background process, each background process is corresponding with a blocks of files of file to be downloaded, and each file block message is transmitted respectively Into corresponding background process;
StartProcessDownFile is called to open the network connection downloading of each background process.
Compared with the prior art, the advantages of the present invention are as follows:
The present invention creates multiple background threads, and the segmentation downloading same file from network server, waits multiple parallel Background thread downloading is completed, then the content that per thread is downloaded is merged, and is created and is written to local file.It opens simultaneously Open multiple background threads while downloading this document, not only increase download performance, also improve synchronization file it is parallel under Carrying capacity, to improve the speed of download of file.
Detailed description of the invention
Fig. 1 is the flow diagram that the method for Internet resources speed of download is improved in the embodiment of the present invention;
Fig. 2 is the structural schematic diagram that the system of Internet resources speed of download is improved in the embodiment of the present invention.
Specific embodiment
Invention is further described in detail with reference to the accompanying drawings and embodiments.
Shown in Figure 1, the embodiment of the present invention provides a kind of method for improving Internet resources speed of download:
S1, client receive the download address of Internet resources, and the get function of QNetworkAccessManager is called to obtain Take the title and size of file to be downloaded;
S2, client calculate the quantity N for preparing that file to be downloaded is split into blocks of files according to the size of file to be downloaded, And file to be downloaded is split into N number of blocks of files to web server requests;
File to be downloaded is split into N number of blocks of files by S3, server;
S4, client call GetBlockFileInfo function obtain the blocks of files letter of each blocks of files to network server Breath;Call the N number of background process of CreateProcess function creation, a blocks of files of each background process and file to be downloaded It is corresponding, the file block message of each blocks of files is transmitted to respectively in corresponding background process, is called StartProcessDownFile function opens the network connection downloading of each background process, downloads blocks of files in background process;
S5, client call CreateFile function creation one and the equal-sized local file of file to be downloaded are adjusted The blocks of files downloaded is written in local file with WriteFile function.
When all background process downloadings are completed, CloseFile is finally called to close the file handle of creation, completes entire text The downloading of part.
The present invention creates multiple background threads, and the segmentation downloading same file from network server, waits multiple parallel Background thread downloading is completed, then the content that per thread is downloaded is merged, and is created and is written to local file.It opens simultaneously Open multiple background threads while downloading this document, not only increase download performance, also improve synchronization file it is parallel under Carrying capacity, to improve the speed of download of file.For example download file size is 1GB, current speed of download is 1 second 1MB, is used The present invention creates 5 threads on backstage and downloads simultaneously, and speed of download is equivalent to 1 second 5MB, needs 204 seconds in total, speed improves 5 times.
The quantity computation method of blocks of files are as follows:
Optimal threads load amount is set as PMB, the size of file to be downloaded is QMB, and maximum thread amount is NmaxIt is a, meter Calculate number of threads Na=Q/P;
If Na≦Nmax, the value of the quantity N of blocks of files is Na
If Na > Nmax, the value of the quantity N of blocks of files is Nmax
Such as:
1) maximum thread amount is set as 6, and optimal threads load amount is 200MB;
2) assume download file size 1GB, according to optimal threads load amount, distributing number of threads is 5, threads load amount For 200MB;
3) assume download file size 2GB, according to optimal threads load amount, show that needing number of threads is 10, then surpasses Maximum thread amount is gone out;It then adjusts practical number of threads and is taken as 6, the actual negative carrying capacity of per thread is 335MB.
The embodiment of the invention also discloses a kind of storage medium, computer program is stored on the storage medium: computer The method for improving Internet resources speed of download is realized when program is executed by processor.
The embodiment of the invention also discloses a kind of electronic equipment, including memory and processor, stored on memory The computer program run on processor: processor realizes the side for improving Internet resources speed of download when executing computer program Method.
Shown in Figure 2, the embodiment of the invention also discloses a kind of systems for improving Internet resources speed of download, including visitor Family end and server, in which:
The client includes that download information obtains module, and blocks of files splits module, data obtaining module, and mould is downloaded on backstage Block and downloading file combination module;
Download information obtain module be used for receive Internet resources downloading request, obtain file to be downloaded download address, Title and size;
Blocks of files, which splits module and is used to be calculated according to the size of file to be downloaded, to be prepared file to be downloaded splitting into file The quantity N of block, and file to be downloaded is split into N number of blocks of files to web server requests;
Blocks of files data obtaining module is used to obtain the file block message of each blocks of files to network server;
Backstage download module is for creating N number of background process, a blocks of files of each background process and file to be downloaded It is corresponding, the file block message of each blocks of files is transmitted to respectively in corresponding background process, downloads blocks of files in background process;
File combination module is downloaded for creating one and the equal-sized local file of file to be downloaded, by what is downloaded Blocks of files is written in local file;
The server is used to file to be downloaded splitting into N number of blocks of files.
The quantity computation method of blocks of files are as follows:
Optimal threads load amount is set as PMB, the size of file to be downloaded is QMB, and maximum thread amount is NmaxIt is a, meter Calculate number of threads Na=Q/P;
If Na≦Nmax, the value of the quantity N of blocks of files is Na
If Na > Nmax, the value of the quantity N of blocks of files is Nmax
Download information obtains module and is used to call the get function of QNetworkAccessManager to obtain file to be downloaded Download address, title and size;
Blocks of files data obtaining module is for calling GetBlockFileInfo function to obtain each blocks of files blocks of files letter Breath, blocks of files information includes the sequence and size of blocks of files.
Backstage download module for calling the N number of background process of CreateProcess function creation, each background process with to A blocks of files for downloading file is corresponding, and each file block message is transmitted to respectively in corresponding background process;It calls StartProcessDownFile opens the network connection downloading of each background process.
Downloading file combination module for call CreateFile function creation one it is equal-sized with file to be downloaded Local file calls WriteFile function that the blocks of files downloaded is sequentially written in local file according to each blocks of files In.
The present invention is not limited to the above-described embodiments, for those skilled in the art, is not departing from Under the premise of the principle of the invention, several improvements and modifications can also be made, these improvements and modifications are also considered as protection of the invention Within the scope of.The content being not described in detail in this specification belongs to the prior art well known to professional and technical personnel in the field.

Claims (10)

1. a kind of method for improving Internet resources speed of download, it is characterised in that:
Client receives the download address of Internet resources, obtains the title and size of file to be downloaded;
Client calculates the quantity N for preparing that file to be downloaded is split into blocks of files according to the size of file to be downloaded, and to net File to be downloaded is split into N number of blocks of files by the request of network server;
File to be downloaded is split into N number of blocks of files by server;
Client obtains the file block message of each blocks of files to network server;Create N number of background process, each background process It is corresponding with a blocks of files of file to be downloaded, the file block message of each blocks of files is transmitted to corresponding background process respectively In, blocks of files is downloaded in background process;
Client creates one and the equal-sized local file of file to be downloaded, and the blocks of files downloaded is written to local text In part.
2. a kind of method for improving Internet resources speed of download as described in claim 1, which is characterized in that the quantity of blocks of files Calculation method are as follows:
Optimal threads load amount is set as P MB, the size of file to be downloaded is Q MB, and maximum thread amount is NmaxIt is a, it calculates Number of threads Na=Q/P;
If Na≦Nmax, the value of the quantity N of blocks of files is Na
If Na > Nmax, the value of the quantity N of blocks of files is Nmax
3. a kind of method for improving Internet resources speed of download as described in claim 1, it is characterised in that:
GetBlockFileInfo function is called to obtain file block message, blocks of files information includes the sequence and size of blocks of files.
4. a kind of method for improving Internet resources speed of download as described in claim 1, it is characterised in that:
Call the N number of background process of CreateProcess function creation, a blocks of files of each background process and file to be downloaded It is corresponding, each file block message is transmitted to respectively in corresponding background process;
StartProcessDownFile is called to open the network connection downloading of each background process.
5. a kind of method for improving Internet resources speed of download as described in claim 1, it is characterised in that:
Call one file to be downloaded size of CreateFile function creation local file, call WriteFile function will under The blocks of files carried is sequentially written in local file according to each blocks of files.
6. a kind of storage medium, computer program is stored on the storage medium, it is characterised in that: the computer program is located Reason device realizes method described in any one of claim 1 to 5 when executing.
7. a kind of electronic equipment, including memory and processor, the computer journey run on a processor is stored on memory Sequence, it is characterised in that: processor realizes method described in any one of claim 1 to 5 when executing computer program.
8. a kind of system for improving Internet resources speed of download, which is characterized in that including client and server, in which:
The client include download information obtain module, blocks of files split module, data obtaining module, backstage download module and Download file combination module;
Download information obtains the downloading request that module is used to receive Internet resources, obtains download address, the title of file to be downloaded And size;
Blocks of files, which splits module and is used to be calculated according to the size of file to be downloaded, to be prepared file to be downloaded splitting into blocks of files Quantity N, and file to be downloaded is split into N number of blocks of files to web server requests;
Blocks of files data obtaining module is used to obtain the file block message of each blocks of files to network server;
For backstage download module for creating N number of background process, each background process is corresponding with a blocks of files of file to be downloaded, The file block message of each blocks of files is transmitted to respectively in corresponding background process, downloads blocks of files in background process;
File combination module is downloaded for creating one and the equal-sized local file of file to be downloaded, the file that will have been downloaded Block is written in local file;
The server is used to file to be downloaded splitting into N number of blocks of files.
9. a kind of system for improving Internet resources speed of download as claimed in claim 8, it is characterised in that:
The quantity computation method of blocks of files are as follows:
Optimal threads load amount is set as P MB, the size of file to be downloaded is Q MB, and maximum thread amount is NmaxIt is a, it calculates Number of threads Na=Q/P;
If Na≦Nmax, the value of the quantity N of blocks of files is Na
If Na > Nmax, the value of the quantity N of blocks of files is Nmax
10. a kind of system for improving Internet resources speed of download as claimed in claim 8, it is characterised in that:
The backstage download module for calling the N number of background process of CreateProcess function creation, each background process with to A blocks of files for downloading file is corresponding, and each file block message is transmitted to respectively in corresponding background process;
StartProcessDownFile is called to open the network connection downloading of each background process.
CN201810019790.6A 2018-01-09 2018-01-09 Improve method, storage medium, equipment and the system of Internet resources speed of download Pending CN110022336A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810019790.6A CN110022336A (en) 2018-01-09 2018-01-09 Improve method, storage medium, equipment and the system of Internet resources speed of download

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810019790.6A CN110022336A (en) 2018-01-09 2018-01-09 Improve method, storage medium, equipment and the system of Internet resources speed of download

Publications (1)

Publication Number Publication Date
CN110022336A true CN110022336A (en) 2019-07-16

Family

ID=67187761

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810019790.6A Pending CN110022336A (en) 2018-01-09 2018-01-09 Improve method, storage medium, equipment and the system of Internet resources speed of download

Country Status (1)

Country Link
CN (1) CN110022336A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110784528A (en) * 2019-10-22 2020-02-11 北京天融信网络安全技术有限公司 File downloading method and device and storage medium
CN112199052A (en) * 2020-11-04 2021-01-08 江苏特思达电子科技股份有限公司 File downloading method and device and computer equipment
CN112311897A (en) * 2020-11-17 2021-02-02 腾讯科技(深圳)有限公司 Resource file downloading method, device, equipment and medium
CN112463866A (en) * 2020-11-25 2021-03-09 上海中通吉网络技术有限公司 Express delivery industry data exporting method, system, computer and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103716719A (en) * 2013-12-02 2014-04-09 乐视网信息技术(北京)股份有限公司 Multimedia file downloading method and user terminal
CN103929427A (en) * 2014-04-23 2014-07-16 无锡天脉聚源传媒科技有限公司 Dynamic multi-thread downloading device and method
CN104184789A (en) * 2014-02-24 2014-12-03 无锡天脉聚源传媒科技有限公司 File downloading method and device
CN104506950A (en) * 2014-12-29 2015-04-08 珠海全志科技股份有限公司 Multithread download method and download device in network streaming media play, and download equipment
CN105893409A (en) * 2015-11-17 2016-08-24 乐视网信息技术(北京)股份有限公司 File downloading method and apparatus
CN106227566A (en) * 2016-07-27 2016-12-14 北京奇虎科技有限公司 Application program download control method, device and terminal unit in application shop

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103716719A (en) * 2013-12-02 2014-04-09 乐视网信息技术(北京)股份有限公司 Multimedia file downloading method and user terminal
CN104184789A (en) * 2014-02-24 2014-12-03 无锡天脉聚源传媒科技有限公司 File downloading method and device
CN103929427A (en) * 2014-04-23 2014-07-16 无锡天脉聚源传媒科技有限公司 Dynamic multi-thread downloading device and method
CN104506950A (en) * 2014-12-29 2015-04-08 珠海全志科技股份有限公司 Multithread download method and download device in network streaming media play, and download equipment
CN105893409A (en) * 2015-11-17 2016-08-24 乐视网信息技术(北京)股份有限公司 File downloading method and apparatus
CN106227566A (en) * 2016-07-27 2016-12-14 北京奇虎科技有限公司 Application program download control method, device and terminal unit in application shop

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110784528A (en) * 2019-10-22 2020-02-11 北京天融信网络安全技术有限公司 File downloading method and device and storage medium
CN112199052A (en) * 2020-11-04 2021-01-08 江苏特思达电子科技股份有限公司 File downloading method and device and computer equipment
CN112311897A (en) * 2020-11-17 2021-02-02 腾讯科技(深圳)有限公司 Resource file downloading method, device, equipment and medium
CN112463866A (en) * 2020-11-25 2021-03-09 上海中通吉网络技术有限公司 Express delivery industry data exporting method, system, computer and storage medium

Similar Documents

Publication Publication Date Title
CN110022336A (en) Improve method, storage medium, equipment and the system of Internet resources speed of download
CN104424229B (en) A kind of calculation method and system that various dimensions are split
CN106506587A (en) A kind of Docker image download methods based on distributed storage
US8577892B2 (en) Utilizing affinity groups to allocate data items and computing resources
CN104881466B (en) The processing of data fragmentation and the delet method of garbage files and device
CN110457281A (en) Data processing method, device, equipment and medium
CN102546836A (en) Method, terminal, server and system for uploading files
CN104778270A (en) Storage method for multiple files
US11076020B2 (en) Dynamically transitioning the file system role of compute nodes for provisioning a storlet
CN107493329A (en) A kind of remote document access method of distributed memory file system
CN106484821A (en) Hybrid cloud storage method under cloud computing architecture
CN104778229A (en) Telecommunication service small file storage system and method based on Hadoop
CN101673271A (en) Distributed file system and file sharding method thereof
CN109558378A (en) File management method, device, equipment and storage medium
CN107491549A (en) A kind of data processing method and system
CN104426838A (en) Internet cache scheduling method and system
CN102882960B (en) A kind of sending method of resource file and device
CN114138776A (en) Method, system, apparatus and medium for graph structure and graph attribute separation design
CN103888513B (en) Server end multifile method for down loading and system
CN108319653A (en) Web page resources document handling method and device
CN105988941A (en) Cached data processing method and device
CN102104581A (en) Network karaoke on-demand system and method thereof
CN103677930A (en) GIS data loading method and device based on mosaic wall system
CN105404672A (en) Webpage data storage and operation system and method
CN111427920B (en) Data acquisition method, device, system, computer equipment and storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190716