File downloading method, device, server and medium

文档序号:1156524 发布日期:2020-09-15 浏览:6次 中文

阅读说明:本技术 一种文件下载方法、装置、服务器及介质 (File downloading method, device, server and medium ) 是由 陈悌宇 范钟艺 蒋玉树 于 2020-06-03 设计创作,主要内容包括:本发明实施例公开了一种文件下载方法、装置、服务器及介质。该方法包括:接收客户端发送的文件下载请求,并获取所述文件下载请求对应的文件配置信息和文件模板路径;根据所述文件下载请求中的请求信息确定下载数据;根据所述文件模板路径调用文件模板,基于所述文件配置信息将所述下载数据添加至所述文件模板中,生成下载文件,其中,所述文件配置信息中包括文件模板中待添加的内容;将所述下载文件传输至所述客户端,本发明实施例的技术方案,解决了文件下载时,下载效率低的问题,实现了提高文件下载效率及降低文件下载系统开发成本的效果。(The embodiment of the invention discloses a file downloading method, a file downloading device, a server and a medium. The method comprises the following steps: receiving a file downloading request sent by a client, and acquiring file configuration information and a file template path corresponding to the file downloading request; determining download data according to request information in the file download request; calling a file template according to the file template path, adding the download data into the file template based on the file configuration information, and generating a download file, wherein the file configuration information comprises contents to be added in the file template; the technical scheme of the embodiment of the invention solves the problem of low downloading efficiency when the file is downloaded, and achieves the effects of improving the file downloading efficiency and reducing the development cost of a file downloading system.)

1. A file downloading method is applied to a server and comprises the following steps:

receiving a file downloading request sent by a client, and acquiring file configuration information and a file template path corresponding to the file downloading request;

determining download data according to request information in the file download request;

calling a file template according to the file template path, adding the download data into the file template based on the file configuration information, and generating a download file, wherein the file configuration information comprises contents to be added in the file template;

and transmitting the download file to the client.

2. The method according to claim 1, wherein the obtaining of the file configuration information and the file template path corresponding to the file download request comprises:

and determining a file template path and file configuration information according to the file type in the file downloading request.

3. The method of claim 2, further comprising:

and calling a corresponding file generator according to the file type in the file downloading request, wherein the file generator is used for adding the downloading data into the file template based on the file configuration information to generate a downloading file.

4. The method according to claim 1, further comprising, after receiving the file download request sent by the client:

verifying the file downloading request;

when the download data volume of the file download request passing the verification is within the preset data volume threshold range, determining that the download mode is synchronous download;

and when the download data volume of the file download request passing the verification exceeds the search preset data volume threshold range, determining that the download mode is asynchronous download.

5. The method according to claim 4, wherein when the downloading mode is asynchronous downloading, before determining to download data according to the request information in the file downloading request, the method further comprises:

generating a file downloading message according to the file downloading request, and sending the file downloading message to a file downloading message queue;

and monitoring information of the download message queue, and when the file download message is monitored, executing the operation of determining download data according to the request information in the file download request.

6. The method according to claim 1 or 5, wherein the transmitting the download file to the client comprises:

and transmitting the generated download file to a preset storage directory of the client, and sending file download prompt information to the client, wherein the file download prompt information comprises a storage path corresponding to the preset storage directory.

7. The method according to claim 4, wherein when the downloading mode is asynchronous downloading, the method further comprises:

and generating asynchronous downloading prompt information and sending the asynchronous downloading prompt information to the client.

8. A file downloading apparatus, comprising:

the file downloading request receiving module is used for receiving a file downloading request sent by a client and acquiring file configuration information and a file template path corresponding to the file downloading request;

the download data determining module is used for determining download data according to the request information in the file download request;

and the download file generation module is used for calling a file template according to the file template path, adding the download data into the file template based on the file configuration information and generating a download file, wherein the file configuration information comprises the content to be added in the file template.

And the download file transmission module is used for transmitting the download file to the client.

9. A server, characterized in that the server comprises:

one or more processors;

storage means for storing one or more programs;

when executed by the one or more processors, cause the one or more processors to implement the file download method as claimed in any one of claims 1-7.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the file downloading method according to any one of claims 1 to 7.

Technical Field

The embodiment of the invention relates to the technical field of network file management, in particular to a file downloading method, a file downloading device, a file downloading server and a file downloading medium.

Background

With the rapid development of computer and network technology, various network services are widely used, thereby generating a large amount of service files

In the processing process of various service scenes, the generation and downloading of files of various service types such as estimated value tables, electronic reconciliation results, position taking details and other different formats such as txt, xls, pdf, dbf and the like are involved, and the generated files are different in size, so that the downloading efficiency is low in the generation process of the downloaded files when the files are downloaded at present.

Disclosure of Invention

The embodiment of the invention provides a file downloading method, a file downloading device, a server and a medium, and aims to achieve the effect of improving the file downloading efficiency.

In a first aspect, an embodiment of the present invention provides a file downloading method, where the method includes:

receiving a file downloading request sent by a client, and acquiring file configuration information and a file template path corresponding to the file downloading request;

determining download data according to request information in the file download request;

calling a file template according to the file template path, adding the download data into the file template based on the file configuration information, and generating a download file, wherein the file configuration information comprises contents to be added in the file template;

and transmitting the download file to the client.

In a second aspect, an embodiment of the present invention further provides a file downloading apparatus, where the apparatus includes:

the file downloading request receiving module is used for receiving a file downloading request sent by a client and acquiring file configuration information and a file template path corresponding to the file downloading request;

the download data determining module is used for determining download data according to the request information in the file download request;

and the download file generation module is used for calling a file template according to the file template path, adding the download data into the file template based on the file configuration information and generating a download file, wherein the file configuration information comprises the content to be added in the file template.

And the download file transmission module is used for transmitting the download file to the client.

In a third aspect, an embodiment of the present invention further provides a server, where the server includes:

one or more processors;

storage means for storing one or more programs;

when executed by the one or more processors, cause the one or more processors to implement a file download method as provided by any of the embodiments of the invention.

In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the program, when executed by a processor, implements the file downloading method provided in any embodiment of the present invention.

The embodiment of the invention receives a file downloading request sent by a client and acquires file configuration information and a file template path corresponding to the file downloading request; and matching corresponding file configuration information and file template paths aiming at different downloading requests, so that the file configuration information and the file template paths are more targeted. Determining download data according to request information in the file download request; calling a file template according to the file template path, adding the download data into the file template based on the file configuration information, and generating a download file, wherein the file configuration information comprises contents to be added in the file template; the download file is transmitted to the client, so that the problem of low download efficiency during file downloading is solved, and the effects of improving the file download efficiency and reducing the development cost of a file download system are achieved.

Drawings

Fig. 1 is a flowchart of a file downloading method according to a first embodiment of the present invention;

FIG. 2 is a flow chart of download file generation;

FIG. 3 is a flowchart of a file downloading method according to a second embodiment of the present invention;

FIG. 4 is a flow chart of an asynchronous download mode;

FIG. 5 is a schematic diagram of a synchronous download mode;

FIG. 6 is a schematic diagram of an asynchronous download mode;

fig. 7 is a structural diagram of a file downloading device in a third embodiment of the present invention;

fig. 8 is a schematic structural diagram of a server in the fourth embodiment of the present invention.

Detailed Description

The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:会议纪要的生成方法及装置、电子设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!