CN111182053A - Method and device for downloading file, computer storage medium and terminal - Google Patents

Method and device for downloading file, computer storage medium and terminal Download PDF

Info

Publication number
CN111182053A
CN111182053A CN201911377614.0A CN201911377614A CN111182053A CN 111182053 A CN111182053 A CN 111182053A CN 201911377614 A CN201911377614 A CN 201911377614A CN 111182053 A CN111182053 A CN 111182053A
Authority
CN
China
Prior art keywords
file
downloading
request
server
stream
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
CN201911377614.0A
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.)
Beijing Mininglamp Software System Co ltd
Original Assignee
Beijing Mininglamp Software System 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 Beijing Mininglamp Software System Co ltd filed Critical Beijing Mininglamp Software System Co ltd
Priority to CN201911377614.0A priority Critical patent/CN111182053A/en
Publication of CN111182053A publication Critical patent/CN111182053A/en
Pending legal-status Critical Current

Links

Images

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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • 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]

Abstract

A method, a device, a computer storage medium and a terminal for downloading files comprise: a client sends a file downloading request to a server; after receiving a file stream corresponding to a file downloading request from a server, generating a Uniform Resource Locator (URL) address of the file stream according to a storage position of the file stream; and obtaining the file corresponding to the file downloading request according to the generated URL address. The embodiment of the invention downloads the file in a file stream mode, avoids the occupation of server resources during file downloading, and improves the application efficiency of server storage resources.

Description

Method and device for downloading file, computer storage medium and terminal
Technical Field
The present disclosure relates to, but not limited to, internet technologies, and in particular, to a method, an apparatus, a computer storage medium, and a terminal for downloading a file.
Background
With the improvement of the scientific and technical level and the arrival of the big data age, the world wide WEB (WEB) technology makes great progress. The server stores the file, and the browser downloads the file stored in the server from the server. In the file downloading mode, when a server is required to calculate and generate a file to be downloaded, the server needs to extract the file to be downloaded and store the file in an address of the server, and the file is issued to the user through the address; the downloading of the file is performed by generating the file to be downloaded, which may occupy a large amount of storage resources of the server and affect the resource application efficiency of the server.
Disclosure of Invention
The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
Embodiments of the present invention provide a method and an apparatus for downloading a file, a computer storage medium, and a terminal, which can avoid occupation of server resources during file downloading and improve application efficiency of server storage resources.
The embodiment of the invention provides a method for downloading a file, which comprises the following steps:
a client sends a file downloading request to a server;
after receiving a file stream corresponding to a file downloading request from a server, generating a Uniform Resource Locator (URL) address of the file stream according to a storage position of the file stream;
and obtaining the file corresponding to the file downloading request according to the generated URL address.
In one exemplary embodiment, the file download request includes: hypertext transfer protocol HTTP request.
In an exemplary embodiment, the obtaining a file corresponding to the file download request according to the generated URL address includes:
setting an a label of HTML according to the URL address of the generated file stream;
and downloading the file corresponding to the file downloading request according to the HTML set by the a label.
On the other hand, the embodiment of the present invention further provides a computer storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method for downloading a file.
In another aspect, an embodiment of the present invention further provides a terminal, including: a memory and a processor, the memory having a computer program stored therein; wherein the content of the first and second substances,
the processor is configured to execute the computer program in the memory;
the computer program, when executed by the processor, implements a method of downloading files as described above.
In another aspect, an embodiment of the present invention further provides a method for downloading a file, including:
the server receives a file downloading request from the client;
and issuing a file stream corresponding to the file downloading request to the client.
In a further aspect, an embodiment of the present invention further provides a computer storage medium, where a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the method for downloading a file is implemented.
In another aspect, an embodiment of the present invention further provides a terminal, including: a memory and a processor, the memory having a computer program stored therein; wherein the content of the first and second substances,
the processor is configured to execute the computer program in the memory;
the computer program, when executed by the processor, implements a method of downloading files as described above.
In another aspect, an embodiment of the present invention further provides a device for downloading a file, including: the device comprises a request unit, a generation unit and an acquisition unit; wherein the content of the first and second substances,
the request unit is to: sending a file downloading request to a server;
the generation unit is used for: after receiving a file stream corresponding to a file downloading request from a server, generating a Uniform Resource Locator (URL) address of the file stream according to a storage position of the file stream;
the acquisition unit is used for: and obtaining the file corresponding to the file downloading request according to the generated URL address.
In one exemplary embodiment, the file download request includes: hypertext transfer protocol HTTP request.
In an exemplary embodiment, the obtaining unit is specifically configured to:
setting an a label of HTML according to the URL address of the generated file stream;
and downloading the file corresponding to the file downloading request according to the HTML set by the a label.
In another aspect, an embodiment of the present invention further provides a device for downloading a file, including: a receiving unit and a response unit; wherein the content of the first and second substances,
the receiving unit is used for: receiving a file downloading request from a client;
the response unit is used for: and issuing a file stream corresponding to the file downloading request to the client.
Compared with the related art, the technical scheme of the application comprises the following steps: a client sends a file downloading request to a server; after receiving a file stream corresponding to a file downloading request from a server, generating a Uniform Resource Locator (URL) address of the file stream according to a storage position of the file stream; and obtaining the file corresponding to the file downloading request according to the generated URL address. The embodiment of the invention downloads the file in a file stream mode, avoids the occupation of server resources during file downloading, and improves the application efficiency of server storage resources.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
FIG. 1 is a flowchart of a method for downloading a file according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for downloading a file according to another embodiment of the present invention;
FIG. 3 is a block diagram of an apparatus for downloading files according to an embodiment of the present invention;
fig. 4 is a block diagram of another apparatus for downloading a file according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
Fig. 1 is a flowchart of a method for downloading a file according to an embodiment of the present invention, as shown in fig. 1, including:
step 101, a client sends a file downloading request to a server;
in one exemplary embodiment, the file download request includes: a hypertext transfer protocol (HTTP) request.
It should be noted that the embodiment of the present invention may include file download requests of other kinds of protocols.
102, receiving a file stream corresponding to a file downloading request from a server, and generating a Uniform Resource Locator (URL) address of the file stream according to a storage position of the file stream;
it should be noted that, the URL address is generated according to the storage address of the file stream, and the related art may be referred to.
And 103, acquiring a file corresponding to the file downloading request according to the generated URL address.
In an exemplary embodiment, the obtaining a file corresponding to the file download request according to the generated URL address includes:
setting an a label of HTML according to the URL address of the generated file stream;
and downloading the file corresponding to the file downloading request according to the HTML set by the a label.
It should be noted that the a-tag is a language tag of HTML, which defines a hyperlink for linking from one page to another page; the a-tag contains a hypertext reference (href) attribute specifying the URL of the hyperlink target.
Compared with the related art, the technical scheme of the application comprises the following steps: a client sends a file downloading request to a server; after receiving a file stream corresponding to a file downloading request from a server, generating a Uniform Resource Locator (URL) address of the file stream according to a storage position of the file stream; and obtaining the file corresponding to the file downloading request according to the generated URL address. The embodiment of the invention downloads the file in a file stream mode, avoids the occupation of server resources during file downloading, and improves the application efficiency of server storage resources.
The embodiment of the invention also provides a computer storage medium, wherein a computer program is stored in the computer storage medium, and when being executed by a processor, the computer program realizes the file downloading method.
An embodiment of the present invention further provides a terminal, including: a memory and a processor, the memory having a computer program stored therein; wherein the content of the first and second substances,
the processor is configured to execute the computer program in the memory;
the computer program, when executed by the processor, implements a method of downloading files as described above.
Fig. 2 is a flowchart of a method for downloading a file according to another embodiment of the present invention, as shown in fig. 2, including:
step 201, a server receives a file downloading request from a client;
step 202, issuing a file stream corresponding to the file downloading request to the client.
In one exemplary embodiment, the file download request includes: a hypertext transfer protocol (HTTP) request.
Compared with the related art, the technical scheme of the application comprises the following steps: the server receives a file downloading request from the client; and issuing a file stream corresponding to the file downloading request to the client. According to the embodiment of the invention, the server directly feeds back the file of the file downloading request to the client in a file stream mode, so that occupation of server resources when the server locally stores the file is avoided, and the application efficiency of the server storage resources is improved.
The embodiment of the invention also provides a computer storage medium, wherein a computer program is stored in the computer storage medium, and when being executed by a processor, the computer program realizes the file downloading method.
An embodiment of the present invention further provides a terminal, including: a memory and a processor, the memory having a computer program stored therein; wherein the content of the first and second substances,
the processor is configured to execute the computer program in the memory;
the computer program, when executed by the processor, implements a method of downloading files as described above.
Fig. 3 is a block diagram of a device for downloading a file according to an embodiment of the present invention, as shown in fig. 3, including: the device comprises a request unit, a generation unit and an acquisition unit; wherein the content of the first and second substances,
the request unit is to: sending a file downloading request to a server;
the generation unit is used for: after receiving a file stream corresponding to a file downloading request from a server, generating a Uniform Resource Locator (URL) address of the file stream according to a storage position of the file stream;
the acquisition unit is used for: and obtaining the file corresponding to the file downloading request according to the generated URL address.
In one exemplary embodiment, the file download request includes: hypertext transfer protocol HTTP request.
In an exemplary embodiment, the obtaining unit is specifically configured to:
setting an a label of HTML according to the URL address of the generated file stream;
and downloading the file corresponding to the file downloading request according to the HTML set by the a label.
It should be noted that the a-tag is a language tag of HTML, which defines a hyperlink for linking from one page to another page; the a-tag contains a hypertext reference (href) attribute specifying the URL of the hyperlink target.
In an exemplary embodiment, an apparatus of an embodiment of the present invention may be a client.
Compared with the related art, the technical scheme of the application comprises the following steps: a client sends a file downloading request to a server; after receiving a file stream corresponding to a file downloading request from a server, generating a Uniform Resource Locator (URL) address of the file stream according to a storage position of the file stream; and obtaining the file corresponding to the file downloading request according to the generated URL address. The embodiment of the invention downloads the file in a file stream mode, avoids the occupation of server resources during file downloading, and improves the application efficiency of server storage resources.
Fig. 4 is a block diagram of another apparatus for downloading a file according to an embodiment of the present invention, as shown in fig. 4, including: a receiving unit and a response unit; wherein the content of the first and second substances,
the receiving unit is used for: receiving a file downloading request from a client;
the response unit is used for: and issuing a file stream corresponding to the file downloading request to the client.
In an exemplary embodiment, an apparatus of an embodiment of the present invention may be a server.
Compared with the related art, the technical scheme of the application comprises the following steps: the server receives a file downloading request from the client; and issuing a file stream corresponding to the file downloading request to the client. According to the embodiment of the invention, the server directly feeds back the file of the file downloading request to the client in a file stream mode, so that occupation of server resources when the server locally stores the file is avoided, and the application efficiency of the server storage resources is improved.
"one of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art. ".

Claims (10)

1. A method of downloading a file, comprising:
a client sends a file downloading request to a server;
after receiving a file stream corresponding to a file downloading request from a server, generating a Uniform Resource Locator (URL) address of the file stream according to a storage position of the file stream;
and obtaining the file corresponding to the file downloading request according to the generated URL address.
2. The method of claim 1, wherein the file download request comprises: hypertext transfer protocol HTTP request.
3. The method according to claim 1 or 2, wherein the obtaining the file corresponding to the file download request according to the generated URL address comprises:
setting an a label of HTML according to the URL address of the generated file stream;
and downloading the file corresponding to the file downloading request according to the HTML set by the a label.
4. A method of downloading a file, comprising:
the server receives a file downloading request from the client;
and issuing a file stream corresponding to the file downloading request to the client.
5. A computer storage medium having stored thereon a computer program which, when executed by a processor, implements a method of downloading a file as claimed in any one of claims 1 to 3 or 4.
6. A terminal, comprising: a memory and a processor, the memory having a computer program stored therein; wherein the content of the first and second substances,
the processor is configured to execute the computer program in the memory;
the computer program, when executed by the processor, implements a method of downloading a file as recited in any of claims 1-3 or 4.
7. An apparatus for downloading a file, comprising: the device comprises a request unit, a generation unit and an acquisition unit; wherein the content of the first and second substances,
the request unit is to: sending a file downloading request to a server;
the generation unit is used for: after receiving a file stream corresponding to a file downloading request from a server, generating a Uniform Resource Locator (URL) address of the file stream according to a storage position of the file stream;
the acquisition unit is used for: and obtaining the file corresponding to the file downloading request according to the generated URL address.
8. The apparatus of claim 7, wherein the file download request comprises: hypertext transfer protocol HTTP request.
9. The apparatus according to claim 7 or 8, wherein the obtaining unit is specifically configured to:
setting an a label of HTML according to the URL address of the generated file stream;
and downloading the file corresponding to the file downloading request according to the HTML set by the a label.
10. An apparatus for downloading a file, comprising: a receiving unit and a response unit; wherein the content of the first and second substances,
the receiving unit is used for: receiving a file downloading request from a client;
the response unit is used for: and issuing a file stream corresponding to the file downloading request to the client.
CN201911377614.0A 2019-12-27 2019-12-27 Method and device for downloading file, computer storage medium and terminal Pending CN111182053A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911377614.0A CN111182053A (en) 2019-12-27 2019-12-27 Method and device for downloading file, computer storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911377614.0A CN111182053A (en) 2019-12-27 2019-12-27 Method and device for downloading file, computer storage medium and terminal

Publications (1)

Publication Number Publication Date
CN111182053A true CN111182053A (en) 2020-05-19

Family

ID=70623704

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911377614.0A Pending CN111182053A (en) 2019-12-27 2019-12-27 Method and device for downloading file, computer storage medium and terminal

Country Status (1)

Country Link
CN (1) CN111182053A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112597406A (en) * 2020-12-24 2021-04-02 厦门亿联网络技术股份有限公司 File transmission method and device, terminal equipment and storage medium
CN116107978A (en) * 2023-04-12 2023-05-12 北京尽微致广信息技术有限公司 File export method and device, storage medium and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729602A (en) * 2009-12-11 2010-06-09 北京工业大学 Method for acquiring P2P (peer-to-peer) video system program information
US20110219098A1 (en) * 2010-03-05 2011-09-08 Samsung Electronics Co., Ltd. Method and apparatus for generating and reproducing adaptive stream based on file format, and recording medium thereof
CN102843614A (en) * 2012-07-27 2012-12-26 优视科技有限公司 Streaming media display method and equipment and system
CN107528917A (en) * 2017-09-13 2017-12-29 马上消费金融股份有限公司 A kind of file memory method and device
CN107528865A (en) * 2016-06-21 2017-12-29 平安科技(深圳)有限公司 The method for down loading and system of file
CN107800734A (en) * 2016-08-31 2018-03-13 北京优朋普乐科技有限公司 A kind of burst method for down loading, apparatus and system
CN108337528A (en) * 2018-01-17 2018-07-27 浙江大华技术股份有限公司 A kind of method and apparatus of preview video
CN108390935A (en) * 2018-02-28 2018-08-10 北京酷我科技有限公司 A kind of audio broadcast strategy based on file stream
CN109347828A (en) * 2018-10-22 2019-02-15 北京达佳互联信息技术有限公司 File Upload and Download method, apparatus, electronic equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729602A (en) * 2009-12-11 2010-06-09 北京工业大学 Method for acquiring P2P (peer-to-peer) video system program information
US20110219098A1 (en) * 2010-03-05 2011-09-08 Samsung Electronics Co., Ltd. Method and apparatus for generating and reproducing adaptive stream based on file format, and recording medium thereof
CN102843614A (en) * 2012-07-27 2012-12-26 优视科技有限公司 Streaming media display method and equipment and system
CN107528865A (en) * 2016-06-21 2017-12-29 平安科技(深圳)有限公司 The method for down loading and system of file
CN107800734A (en) * 2016-08-31 2018-03-13 北京优朋普乐科技有限公司 A kind of burst method for down loading, apparatus and system
CN107528917A (en) * 2017-09-13 2017-12-29 马上消费金融股份有限公司 A kind of file memory method and device
CN108337528A (en) * 2018-01-17 2018-07-27 浙江大华技术股份有限公司 A kind of method and apparatus of preview video
CN108390935A (en) * 2018-02-28 2018-08-10 北京酷我科技有限公司 A kind of audio broadcast strategy based on file stream
CN109347828A (en) * 2018-10-22 2019-02-15 北京达佳互联信息技术有限公司 File Upload and Download method, apparatus, electronic equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
宋毓震: "《网页设计与制作教程》", 31 August 2012 *
熊伟: "《多媒体技术应用基础》", 30 June 2000 *
短腿长颈鹿小姐: "以流的方式,文件下载的基本步骤及代码(读取文件,response设置头和con", 《CSDN博客HTTPS://BLOG.CSDN.NET/QQ_40673345/ARTICLE/DETAILS/102681267》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112597406A (en) * 2020-12-24 2021-04-02 厦门亿联网络技术股份有限公司 File transmission method and device, terminal equipment and storage medium
CN116107978A (en) * 2023-04-12 2023-05-12 北京尽微致广信息技术有限公司 File export method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN107465722B (en) Web access realization method and device
US20170272499A1 (en) Method and device for loading webpage
CN109257451B (en) Corresponding relation analysis method and equipment
CN111385316B (en) Resource refreshing method, access method and device
CN110247985B (en) Resource downloading method and device, electronic equipment and medium
CN104714965A (en) Static resource weight removing method, and static resource management method and device
US20150058452A1 (en) Video loading method, device and system of mobile terminal
CN111182053A (en) Method and device for downloading file, computer storage medium and terminal
CN109634753B (en) Data processing method, device, terminal and storage medium for switching browser kernels
CN109104368B (en) Connection request method, device, server and computer readable storage medium
US8195762B2 (en) Locating a portion of data on a computer network
CN111294372B (en) Method, device and system for realizing cache in proxy server
US20070055663A1 (en) Programmatic response for detected variants of HTTP requests
CN110874445A (en) Webpage loading method, client and business service center
KR101650829B1 (en) Method, apparatus, and system for acquiring object
CN107103001B (en) Method, device and system for acquiring target front-end resource file based on browser
CN115695416A (en) File downloading method, device, medium and equipment based on cloud storage service
EP3220607B1 (en) Service data processing methods and devices
CN105446754A (en) Method and equipment for loading target application
US11379653B2 (en) Rendering method for on-demand loading of PDF file on network
CN105592143B (en) A kind of file loading method and device
CN113626741A (en) Method and equipment for loading webpage of mobile client
CN104462595B (en) Search engine system and the method that multimedia element is embedded in search result items
CN112491939B (en) Multimedia resource scheduling method and system
US9516111B2 (en) Communication apparatus, communication method, and computer program product

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: 20200519