WO2020006866A1 - 文件下载方法、装置、计算机设备和存储介质 - Google Patents

文件下载方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2020006866A1
WO2020006866A1 PCT/CN2018/105494 CN2018105494W WO2020006866A1 WO 2020006866 A1 WO2020006866 A1 WO 2020006866A1 CN 2018105494 W CN2018105494 W CN 2018105494W WO 2020006866 A1 WO2020006866 A1 WO 2020006866A1
Authority
WO
WIPO (PCT)
Prior art keywords
files
file
downloaded
block
download
Prior art date
Application number
PCT/CN2018/105494
Other languages
English (en)
French (fr)
Inventor
毛习均
曹敏
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020006866A1 publication Critical patent/WO2020006866A1/zh

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/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Definitions

  • the present application relates to a file downloading method, device, computer equipment, and storage medium.
  • the business files selected by the user are generally downloaded to the local one by one through the server.
  • the inventors realized that the amount of data in the file to be downloaded is too large, which may cause memory overflow in severe cases.
  • the existing server resources are limited. If a large amount of data is downloaded at once, the server resources will be preempted, thereby reducing the server's resource utilization.
  • a file downloading method, apparatus, computer device, and storage medium are provided.
  • a file download method includes:
  • the plurality of segmented files are downloaded separately to obtain a plurality of downloaded segmented files.
  • a file downloading device includes:
  • File acquisition module used to acquire files to be downloaded and corresponding key information
  • Information matching module which is used to match key information with the full text of the file to be downloaded to obtain the matching result
  • a file segmentation module configured to separate a plurality of segmented files from the files to be downloaded according to a matching result
  • a level acquisition module configured to acquire a download level of the plurality of divided files
  • the file downloading module is configured to download the plurality of divided file files according to the download level to obtain a plurality of downloaded divided file files.
  • a computer device includes a memory and one or more processors.
  • the memory stores computer-readable instructions.
  • the one or more processors are executed. The following steps:
  • the plurality of segmented files are downloaded separately to obtain a plurality of downloaded segmented files.
  • One or more non-volatile storage media storing computer-readable instructions.
  • the computer-readable instructions When executed by one or more processors, the one or more processors execute the following steps:
  • the plurality of segmented files are downloaded separately to obtain a plurality of downloaded segmented files.
  • FIG. 1 is an application scenario diagram of a file download method according to one or more embodiments.
  • FIG. 2 is a schematic flowchart of a file download method according to one or more embodiments.
  • FIG. 3 is a schematic flowchart of a file downloading method in another embodiment.
  • FIG. 4 is a schematic flowchart of a file downloading method in another embodiment.
  • FIG. 5 is a schematic flowchart of a file downloading method in still another embodiment.
  • FIG. 6 is a schematic flowchart of a file downloading method in still another embodiment.
  • FIG. 7 is a schematic flowchart of a file downloading method in still another embodiment.
  • FIG. 8 is a block diagram of a file download apparatus according to one or more embodiments.
  • FIG. 9 is a block diagram of a computer device according to one or more embodiments.
  • the file downloading method provided in this application can be applied to the application environment shown in FIG. 1.
  • the terminal 110 and the server 120 communicate through a network.
  • the terminal 110 detects a trigger operation of the user to select a file to be downloaded, generates a corresponding download request, and sends the download request to the server 120.
  • the server 120 obtains the file to be downloaded and corresponding key information according to the download request; matches the key information with the full text of the file to be downloaded to obtain a matching result, and separates a plurality of divided files from the file to be downloaded according to the matching result.
  • the server 120 analyzes a plurality of segmented files to obtain a corresponding download level, and according to the download level, separately downloads the plurality of separated segmented files to obtain a plurality of downloaded segmented files and divides the plurality of downloaded segments into The block file is returned to the terminal 110.
  • the terminal 110 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices; the server 120 may be implemented by an independent server or a server cluster composed of multiple servers.
  • a file download method is provided.
  • the method is applied to the server in FIG. 1 as an example, and includes the following steps:
  • Step S201 Acquire a file to be downloaded and corresponding key information.
  • the file to be downloaded refers to a file that is triggered to be downloaded on an operation interface (such as a file download interface) of a terminal (such as a notebook computer); specifically, a large file that takes up a large amount of memory, such as business data such as report data and log data.
  • Key information refers to the core information of the file, such as keywords, key fields, and so on.
  • the terminal detects the user's selection operation and input operation on the operation interface, analyzes the selection operation and input operation, generates a corresponding download request, and sends the download request to the server; the download request includes the file to be downloaded and the key information entered by the user .
  • the server receives the download request sent by the terminal, and obtains the file to be downloaded and corresponding key information according to the download request.
  • Step S202 Match key information with the full text of the file to be downloaded to obtain a matching result.
  • the full text of the file to be downloaded contains a variety of information, such as template information, report information, and digital information, but the information that the user cares about is only part of it.
  • step S203 a plurality of segment files are separated from the file to be downloaded according to the matching result.
  • a block file refers to a combination of data information associated with key information in a file to be downloaded. It is an independent file, and can be opened, viewed, and edited separately. In addition, separating multiple chunked files from the file to be downloaded does not mechanically divide the file to be downloaded into multiple chunked files, but rather uses the combination of data information associated with key information in the file to be downloaded as a division. Block files and separate them from the files to be downloaded; moreover, the memory occupied by the combination of multiple divided files is far less than the memory occupied by the files to be downloaded.
  • the data information that meets the requirements is filtered; the data information that meets the requirements is combined multiple times to obtain multiple block files, which greatly reduces
  • the data amount of the file to be downloaded is prevented, and server memory overflow and resource preemption are avoided, thereby improving resource utilization of the server.
  • the download speed is constant, reducing the data amount of the file to be downloaded is beneficial to improving the download efficiency of the file.
  • Step S204 Obtain the download levels of the multiple segment files.
  • the download level indicates the importance of the divided file. The higher the importance of the divided file, the higher the corresponding download level. According to the information of the divided file, such as the amount of data, the importance of the content, etc., comprehensively evaluate the importance of the divided file, and determine the download level of the divided file according to the correspondence between the importance and the download level. Download multiple chunked files.
  • step S205 a plurality of segmented files are downloaded separately according to the download level to obtain a plurality of downloaded segmented files.
  • the downloaded chunked file is also a separate file with the same attributes as the file to be downloaded, such as being able to open, view, edit, merge, etc. separately.
  • the download level corresponding to the segmented file multiple segmented files are downloaded, which reduces the amount of data to be downloaded, avoids server memory overflow, and allows file downloads to be performed in an orderly manner, ensuring stable server operation and further Improved server resource utilization.
  • the key information corresponding to the file to be downloaded is matched with the full text of the file to be downloaded to obtain the corresponding matching result, and then multiple divided files are separated from the file to be downloaded according to the matching result, and finally According to the download level of each segment file, multiple segment files are downloaded separately to obtain multiple downloaded segment files.
  • the matching result of the key information and the full text of the file to be downloaded separate multiple file segments from the file to be downloaded, and only obtain the data information associated with the key information, which greatly reduces the data amount of the file to be downloaded, avoiding server memory overflow and Resource preemption improves server resource utilization.
  • the download speed is constant, reducing the data amount of the file to be downloaded is beneficial to improving the download efficiency of the file.
  • the file to be downloaded contains a variety of information, but the information that the user cares about is only a part of it, in order to obtain the information that the user cares about, the key information can be matched with the full text of the file to be downloaded to filter out the information that the user cares about.
  • the above step S202 matches the key information with the full text of the file to be downloaded to obtain a matching result, including: matching the key information with the data information of each position of the full text of the file to be downloaded to obtain a corresponding matching result.
  • the matching result refers to the correlation between the key information and the data information in the file to be downloaded.
  • the above step S203, separating a plurality of segmented files from the file to be downloaded according to the matching result includes: selecting, from the data information of each position of the full text of the file to be downloaded, multiple positions that match the requirements Data information, and mark data information at multiple locations; combine the marked data information within a preset range to obtain multiple data information combinations, as multiple divided files separated from the file to be downloaded .
  • the data information of multiple positions with matching values within a certain range is filtered and marked; starting from the data information of the first position in the file to be downloaded , Sequentially combining the marked data information within a preset range to obtain multiple data information combinations, that is, multiple divided files.
  • the data information that meets the requirements is filtered; the data information that meets the requirements is combined multiple times to obtain multiple block files, greatly
  • the amount of data to be downloaded is reduced, server memory overflow and resource preemption are avoided, thereby improving server resource utilization.
  • reducing the data amount of the file to be downloaded is beneficial to improving the download efficiency of the file.
  • step S203 separating a plurality of segmented files from the file to be downloaded according to the matching result includes: selecting, from the data information of each position in the context of the file to be downloaded, multiple positions that match the requirements Data information and mark data information at multiple locations; combine the marked data information to obtain a combined file; divide the combined file according to a preset length to obtain multiple block files.
  • a combined file is made up of multiple chunked files.
  • FIG. 3 another file downloading method is provided, including the following steps:
  • Step S301 Acquire a file to be downloaded and corresponding key information.
  • step S302 the key information is matched with the data information of each position of the full text of the file to be downloaded to obtain a matching result.
  • Step S303 From the data information of each position of the full text of the file to be downloaded, filter out the data information of multiple locations that match the requirements, and mark the data information of the multiple locations; The data information is combined to obtain multiple data information combinations, which are used as a plurality of divided files separated from the file to be downloaded.
  • Step S304 Obtain the download levels of the multiple segment files.
  • step S305 a plurality of segmented files are downloaded separately according to the download level to obtain a plurality of downloaded segmented files.
  • a plurality of divided files are separated from the file to be downloaded, and only the data information associated with the key information is obtained, which greatly reduces the data amount of the file to be downloaded, avoids server memory overflow, and thereby improves server resources. Utilization.
  • the block file is downloaded according to the download level, so that the file download can be performed in an orderly manner, avoiding the messy process of file download, ensuring the stable operation of the server, and further improving the resource utilization of the server.
  • a file chunking model can be constructed to obtain multiple chunked files based on the files to be downloaded and corresponding key information.
  • the method includes: inputting the file to be downloaded and corresponding key information into a pre-trained file block model, and the file block model is used for According to the file to be downloaded and the corresponding key information, query the correspondence between the key information and the file to determine the information of the data to be downloaded in the file to be downloaded; according to the data to be downloaded, separate a plurality of divided files from the file to be downloaded.
  • the file block model is trained based on historical data information. For example, after historical data analysis, the template of the business file is fixed, the position of the information that the user cares about is basically fixed in the business file, and the key information can also be counted. Then, there are multiple correspondences between key information and business files. After repeated training, the file partitioning model can separate multiple block files from the files to be downloaded according to the files to be downloaded and the key information. According to the file segmentation model, multiple segmented files can be quickly separated from the file to be downloaded, which reduces the data amount of the file to be downloaded and further improves the resource utilization of the server.
  • the obtained multiple divided files can be compressed.
  • the method includes: compressing the plurality of segmented files to obtain a plurality of compressed segmented files. Compressing the separated multiple divided files further reduces the data amount of the file to be downloaded, avoids server memory overflow and resource preemption, thereby improving the server's resource utilization.
  • FIG. 4 another file downloading method is provided, including the following steps:
  • Step S401 Acquire a file to be downloaded and corresponding key information.
  • step S402 a file to be downloaded and corresponding key information are input into a pre-trained file block model.
  • the file block model is used to query the correspondence between the key information and the file according to the file to be downloaded and the corresponding key information to determine the file to be downloaded.
  • Step S403 compressing a plurality of segmented files to obtain a plurality of compressed segmented files.
  • Step S404 Obtain the download levels of multiple chunked files.
  • step S405 according to the download level, a plurality of segmented files are downloaded separately to obtain a plurality of downloaded segmented files.
  • obtaining the download level of the multiple segment files includes: obtaining the information content of the multiple segment files; and querying the correspondence between the information content and the download level according to the information content of the multiple segment files. Relationship to get the download level of multiple chunked files.
  • the information content includes the amount of data and the importance of the content.
  • the importance of the divided file is comprehensively evaluated, and then the download level of the divided file is determined, so that according to the download level, the importance of the divided file can be quickly identified.
  • it is beneficial for subsequent downloading of multiple divided files according to the download level ensuring that the file download can be performed in an orderly manner, thereby ensuring the stable operation of the server and further improving the resource utilization of the server.
  • step S205 downloading a plurality of segmented files to obtain a plurality of downloaded segmented files includes: arranging the plurality of segmented files according to the download level, and Download multiple divided file in sequence to get multiple downloaded divided files; each downloaded divided file is an independent divided file.
  • Each downloaded block file is also a separate file, with the same attributes as the file to be downloaded, such as being able to be opened, viewed, edited, merged, etc. separately.
  • the download level corresponding to the chunked file multiple chunked files are downloaded separately, so that the file download can be carried out in an orderly manner, which ensures the stable operation of the server, while reducing the amount of data to be downloaded, and avoiding server memory overflow and Resource preemption further improves server resource utilization.
  • downloading a plurality of segmented files according to the download level to obtain a plurality of downloaded segmented files includes: placing the plurality of segmented files in descending order of download level Download and get multiple downloaded chunked files.
  • multiple chunk files can also be downloaded in order of download level from low to high to obtain multiple downloaded chunk files; of course, multiple chunk files can also be downloaded in other orders.
  • the method includes: detecting a user's selection to trigger an operation. Select the trigger operation to suspend the download of the current block file and start the download of the block file corresponding to the select trigger operation; select the trigger operation to trigger the download of the block file. Selecting the block file that the user cares about for downloading not only meets the user's needs, but also avoids server memory overflow and resource preemption, which further improves the server's resource utilization.
  • the above step S205 after downloading a plurality of divided file files according to the download level to obtain a plurality of downloaded divided file files, includes: if the downloaded divided file files are larger than a preset number, According to the download level, a plurality of downloaded block files are combined together to obtain a file corresponding to the file to be downloaded.
  • the file index information of each segment file can also be established in the file; the corresponding segment file can be quickly located according to the file index information. Combining multiple downloaded chunked files together makes it easier for users to view and avoid the disadvantages of too many chunked files and inconvenient viewing.
  • FIG. 5 another method for downloading a block file is provided, including the following steps:
  • Step S501 Acquire a file to be downloaded and corresponding key information.
  • Step S502 Match key information with the full text of the file to be downloaded to obtain a matching result.
  • step S503 a plurality of segment files are separated from the file to be downloaded according to the matching result.
  • step S504 the download levels of the multiple chunked files are obtained.
  • step S505 a plurality of segmented files are downloaded separately according to the download level to obtain a plurality of downloaded segmented files.
  • step S506 if the downloaded block files are larger than the preset number, a plurality of downloaded block files are combined together according to the download level to obtain files corresponding to the files to be downloaded.
  • the method further includes: establishing a verification matching file corresponding to each segment file.
  • the check matching file is a file used to check whether the data of the block file is complete.
  • the above step S205, downloading a plurality of segmented files according to the download level includes detecting that the segmented file corresponding to the current download level is downloaded, and matching the files according to the verification corresponding to the segmented file. , Verify the block file; if the check is incorrect, download the block file again; if the check is correct, continue downloading.
  • the block files are arranged according to the download level. If the block files corresponding to the current download level are downloaded, the other block files continue to be downloaded. For example, after the block file corresponding to the first download level is downloaded, the block file of the second download level is started for downloading.
  • FIG. 6 another file downloading method is provided, including the following steps:
  • Step S601 Acquire a file to be downloaded and corresponding key information.
  • Step S602 Match key information with the full text of the file to be downloaded to obtain a matching result.
  • step S603 a plurality of segment files are separated from the file to be downloaded according to the matching result.
  • step S604 the download levels of the multiple segment files are obtained; and a verification matching file corresponding to each segment file is established.
  • Step S605 It is detected that the download of the segment file corresponding to the current download level is completed, and the segment file is verified according to the verification matching file corresponding to the segment file; if the verification is incorrect, the segment file is downloaded again; If the verification is correct, the download continues.
  • step S606 a plurality of downloaded block files are obtained.
  • the data amount of some block files may be too large.
  • the load on the server will be too large, thereby reducing the resource utilization of the server. , You can divide the file into blocks.
  • the method further includes: comparing the data amounts corresponding to the plurality of segment files with the preset data amounts, respectively. , Filtering out a plurality of block files from a plurality of block files, and dividing the block files larger than a preset data amount to obtain a plurality of block sub-files.
  • the data amount of the block sub-file is less than the preset data amount.
  • the segmented files larger than the preset data volume are divided again, which avoids that the segmented file is too large and affects the resource utilization of the server, ensuring that the server can Stable operation further improves the resource utilization of the server.
  • the method includes: obtaining a download level of the plurality of block sub-files.
  • the method for obtaining the download level of a chunked sub-file is the same as the method for obtaining the download level of a chunked file.
  • a plurality of segmented files are downloaded separately according to the download level to obtain a plurality of downloaded segmented files, including: according to the download level, the plurality of segmented files and the segmented sub-files are obtained.
  • the files are downloaded separately to obtain multiple downloaded chunked files and downloaded chunked sub-files.
  • the downloaded sub-file is also a separate file with the same attributes as the file to be downloaded, such as being able to open, view, edit, merge, etc. separately
  • FIG. 7 another file downloading method is provided, including the following steps:
  • Step S701 Acquire a file to be downloaded and corresponding key information.
  • Step S702 Match key information with the full text of the file to be downloaded to obtain a matching result.
  • step S703 a plurality of segment files are separated from the file to be downloaded according to the matching result.
  • Step S704 comparing the data amounts corresponding to the plurality of block files with the preset data amounts, and selecting a block file larger than the preset data amount from the plurality of block files; and dividing the block larger than the preset data amount.
  • the file is divided into multiple sub-files.
  • Step S705 Obtain the download levels of the multiple divided files and the divided sub-files.
  • step S706 according to the download level, a plurality of segmented files and segmented sub-files are downloaded separately to obtain a plurality of downloaded segmented files and downloaded segmented sub-files.
  • the method includes: outputting and displaying the label information of each segmented file according to a preset period.
  • the tag information includes the send level, download notification status, download progress, and content summary. According to the preset period, the label information of each segment file is displayed, which is convenient for monitoring the information of each segment file.
  • steps in the flowchart of FIG. 2-7 are sequentially displayed according to the directions of the arrows, these steps are not necessarily performed sequentially in the order indicated by the arrows. Unless explicitly stated in this document, the execution of these steps is not strictly limited, and these steps can be performed in other orders. Moreover, at least a part of the steps in FIG. 2-7 may include multiple sub-steps or stages. These sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. These sub-steps or stages The execution order of is not necessarily performed sequentially, but may be performed in turn or alternately with at least a part of another step or a sub-step or stage of another step.
  • a file downloading device including: a file obtaining module 810, an information matching module 820, a file block module 830, a level obtaining module 840, and a file download module 850. :
  • the file obtaining module 810 is configured to obtain a file to be downloaded and corresponding key information.
  • the information matching module 820 is configured to match key information with the full text of the file to be downloaded to obtain a matching result.
  • the file segmentation module 830 is configured to separate a plurality of segmented files from a file to be downloaded according to a matching result.
  • a level obtaining module 840 is configured to obtain a download level of the plurality of divided files.
  • the file downloading module 850 is configured to download a plurality of divided file files according to a download level to obtain a plurality of downloaded divided file files.
  • the file segmentation module is further configured to filter the data information of multiple locations where the matching result meets the requirements from the data information of each location of the full text of the file to be downloaded, and mark the data information of multiple locations. ; Combining the marked data information within a preset range to obtain multiple data information combinations, as a plurality of divided files separated from the file to be downloaded.
  • the level acquisition module is further configured to acquire the information content of multiple segment files; according to the information content of the multiple segment files, query the correspondence between the information content and the download level to obtain the information of multiple segment files. Download level.
  • the file downloading module is further configured to arrange a plurality of divided files according to a download level to obtain the aligned multiple divided files; sequentially download the aligned multiple divided files to obtain multiple Downloaded chunked files.
  • the file downloading device further includes a file combination module, which is used to combine a plurality of downloaded block files according to the download level if the downloaded block files are larger than a preset number, to obtain the files to be downloaded.
  • the file corresponding to the file is used to combine a plurality of downloaded block files according to the download level if the downloaded block files are larger than a preset number, to obtain the files to be downloaded.
  • the file downloading device further includes a file compression module, which is used for the file partitioning module to separate multiple partition files from the files to be downloaded according to the matching result, and then compress the multiple partition files to obtain multiple files. Compressed chunked files.
  • the file downloading device further includes a matching file establishment module, which is used for the file division module to establish a verification corresponding to each of the divided files after the plurality of divided files are separated from the file to be downloaded according to the matching result. Match files.
  • the file downloading device further includes a sub-file division module, which is used for the file division module to separate the plurality of chunk files from the files to be downloaded according to the matching result, and then divide the data corresponding to the plurality of chunk files. Compare with the preset data amount respectively, and select a block file larger than the preset data amount from the multiple block files; divide the data amount of the block file larger than the preset data amount to obtain a plurality of sub-blocks File; the amount of data of the block sub-file is less than the preset data amount.
  • a sub-file division module which is used for the file division module to separate the plurality of chunk files from the files to be downloaded according to the matching result, and then divide the data corresponding to the plurality of chunk files. Compare with the preset data amount respectively, and select a block file larger than the preset data amount from the multiple block files; divide the data amount of the block file larger than the preset data amount to obtain a plurality of sub-blocks File; the amount of data of the block sub-file is less than the
  • the file downloading module is further configured to detect that the block file corresponding to the current download level has been downloaded, and verify the block file according to the check matching file corresponding to the block file; if the check is incorrect , Then download the chunked file again; if the verification is correct, the download continues.
  • the file downloading device matches the key information corresponding to the file to be downloaded with the full text of the file to be downloaded to obtain a matching result, and then separates multiple block files from the file to be downloaded according to the matching result.
  • the download level of the segmented file Multiple segmented files are downloaded to obtain multiple downloaded segmented files.
  • the matching result of the key information and the full text of the file to be downloaded separate multiple file segments from the file to be downloaded, and only obtain the data information associated with the key information, which greatly reduces the data amount of the file to be downloaded, avoiding server memory overflow and Resource preemption improves server resource utilization.
  • the download speed is constant, reducing the data amount of the file to be downloaded is beneficial to improving the download efficiency of the file.
  • Each module in the above file downloading device may be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the hardware in or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 9.
  • the computer device includes a processor, a memory, a network interface, and a database connected through a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer-readable instructions, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer-readable instructions in a non-volatile storage medium.
  • the computer equipment database is used to store chunked files.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer-readable instructions are executed by a processor to implement a file download method.
  • FIG. 9 is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer equipment to which the scheme of the present application is applied.
  • the specific computer equipment may be Include more or fewer parts than shown in the figure, or combine certain parts, or have a different arrangement of parts.
  • a computer device includes a memory and one or more processors.
  • the memory stores computer-readable instructions.
  • the steps of the file downloading method provided in any embodiment of the present application are implemented.
  • One or more non-volatile storage media storing computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors implement a file provided in any one of the embodiments of the present application Steps to download method.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种文件下载方法,包括:获取待下载文件及对应的关键信息;将关键信息与待下载文件的全文进行匹配,得到匹配结果;根据匹配结果从所述待下载文件中分离出多个分块文件;获取所述多个分块文件的下载级别;根据下载级别,对所述多个分块文件分别进行下载,得到多个已下载分块文件。

Description

文件下载方法、装置、计算机设备和存储介质
本申请要求于2018年7月3日提交中国专利局,申请号为2018107156004,申请名称为“文件下载方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及一种文件下载方法、装置、计算机设备和存储介质。
背景技术
随着计算机技术的迅速发展,各种数据量呈现爆炸式增长,比如短信平台各种业务文件数据,一般占用的内存比较大。
目前,为了方便查看各种业务文件数据,比如报表数据或日志数据,一般通过服务器,将用户选择的业务文件,以整份文件的形式,一一下载到本地。但是,发明人意识到,待下载文件的数据量过大,严重时会造成内存溢出。而且,现有的服务器资源有限,若一下子下载大量数据会导致服务器的资源被抢占,从而降低了服务器的资源利用率。
发明内容
根据本申请公开的各种实施例,提供一种文件下载方法、装置、计算机设备和存储介质。
一种文件下载方法包括:
获取待下载文件及对应的关键信息;
将关键信息与待下载文件的全文进行匹配,得到匹配结果;
根据匹配结果从所述待下载文件中分离出多个分块文件;
获取所述多个分块文件的下载级别;及
根据下载级别,对所述多个分块文件分别进行下载,得到多个已下载分块文件。
一种文件下载装置包括:
文件获取模块,用于获取待下载文件及对应的关键信息;
信息匹配模块,用于将关键信息与待下载文件的全文进行匹配,得到匹配结果;
文件分块模块,用于根据匹配结果从所述待下载文件中分离出多个分块文件;
级别获取模块,用于获取所述多个分块文件的下载级别;及
文件下载模块,用于根据下载级别,对所述多个分块文件分别进行下载,得到多个已下载分块文件。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步 骤:
获取待下载文件及对应的关键信息;
将关键信息与待下载文件的全文进行匹配,得到匹配结果;
根据匹配结果从所述待下载文件中分离出多个分块文件;
获取所述多个分块文件的下载级别;及
根据下载级别,对所述多个分块文件分别进行下载,得到多个已下载分块文件。
一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
获取待下载文件及对应的关键信息;
将关键信息与待下载文件的全文进行匹配,得到匹配结果;
根据匹配结果从所述待下载文件中分离出多个分块文件;
获取所述多个分块文件的下载级别;及
根据下载级别,对所述多个分块文件分别进行下载,得到多个已下载分块文件。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其他特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为根据一个或多个实施例中文件下载方法的应用场景图。
图2为根据一个或多个实施例中文件下载方法的流程示意图。
图3为另一个实施例中文件下载方法的流程示意图。
图4为又一个实施例中文件下载方法的流程示意图。
图5为再一个实施例中文件下载方法的流程示意图。
图6为再一个实施例中文件下载方法的流程示意图。
图7为再一个实施例中文件下载方法的流程示意图。
图8为根据一个或多个实施例中文件下载装置的框图。
图9为根据一个或多个实施例中计算机设备的框图。
具体实施方式
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供的文件下载方法,可以应用于如图1所示的应用环境中。终端110与服务 器120通过网络进行通信。终端110检测到用户选择待下载文件的触发操作,生成对应的下载请求,并将下载请求发送至服务器120。服务器120根据下载请求,获取待下载文件及对应的关键信息;并将关键信息与待下载文件的全文进行匹配,以得到匹配结果,根据匹配结果从待下载文件中分离出多个分块文件。服务器120对多个分块文件进行分析,得到对应的下载级别,根据下载级别,对分离出的多个分块文件分别进行下载,得到多个已下载分块文件,并将多个已下载分块文件返回至终端110。其中,终端110可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备;服务器120可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在其中一个实施例中,如图2所示,提供了一种文件下载方法,以该方法应用于图1中的服务器为例进行说明,包括以下步骤:
步骤S201,获取待下载文件及对应的关键信息。
待下载文件是指终端(比如笔记本电脑)操作界面(比如文件下载界面)上,被触发下载的文件;具体指大文件,占用内存较大,例如报表数据和日志数据等业务型文件。关键信息指文件的核心信息,比如关键词、关键字段等。
终端检测到用户在操作界面上的选中操作和输入操作,解析选中操作和输入操作,生成对应的下载请求,并将下载请求发送至服务器;下载请求包括用户选中的待下载文件以及输入的关键信息。服务器接收终端发送的下载请求,根据下载请求,获取待下载文件及对应的关键信息。
步骤S202,将关键信息与待下载文件的全文进行匹配,得到匹配结果。
待下载文件的全文包含多种信息,比如模板信息、报表信息、数字信息等,但用户关心的信息只是其中的一部分,为了快速获取用户关心的信息,可以将关键信息与待下载文件的全文进行匹配,得到相应的匹配结果,方便后续根据关键信息与待下载文件全文的匹配结果,从待下载文件中分离出多个分块文件。
步骤S203,根据匹配结果从待下载文件中分离出多个分块文件。
分块文件指待下载文件中,与关键信息关联的数据信息的组合,是一种独立的文件,比如可以单独打开、查看、编辑等。另外,从待下载文件中分离出多个分块文件,并不是机械地将待下载文件分成多个分块文件,而是将待下载文件中,与关键信息关联的数据信息的组合,作为分块文件,并从待下载文件中独立分离出来;而且,多个分块文件的组合所占用的内存,远小于待下载文件所占用的内存。
根据关键信息与待下载文件全文的各种匹配结果,从待下载文件中,筛选出匹配结果符合要求的数据信息;将符合要求的数据信息进行多次组合,得到多个分块文件,大大减少了待下载文件的数据量,避免服务器内存溢出和资源抢占,从而提高了服务器的资源利用率。同时,在下载速度一定的情况下,减少待下载文件的数据量,有利于提高文件的下载效率。
步骤S204,获取多个分块文件的下载级别。
下载级别表示分块文件的重要程度,分块文件的重要程度越高,对应的下载级别越高。根据分块文件的信息,比如数据量大小、内容重要程度等,综合评估分块文件的重要程度,根据重要程度与下载级别的对应关系,确定分块文件的下载级别,方便后续按照下载级别,对多个分块文件进行下载。
步骤S205,根据下载级别,对多个分块文件分别进行下载,得到多个已下载分块文件。
已下载分块文件也是一种独立的文件,具备与待下载文件相同的属性,比如可以单独打开、查看、编辑、合并等。按照分块文件对应的下载级别,对多个分块文件进行下载,减少了待下载文件的数据量,避免服务器内存溢出,同时让文件下载能够有序地进行,保证了服务器的稳定运行,进一步提高了服务器的资源利用率。
上述文件下载方法中,将待下载文件对应的关键信息,与待下载文件的全文进行匹配,得到相应的匹配结果,然后根据匹配结果从所述待下载文件中分离出多个分块文件,最后按照各个分块文件的下载级别,对多个分块文件分别进行下载,得到多个已下载分块文件。根据关键信息与待下载文件全文的匹配结果,从待下载文件中分离出多个分块文件,只获取与关键信息关联的数据信息,大大减少了待下载文件的数据量,避免服务器内存溢出和资源抢占,从而提高了服务器的资源利用率。在下载速度一定的情况下,减少待下载文件的数据量,有利于提高文件的下载效率。同时,根据分块文件对应的下载级别,对多个分块文件分别进行下载,让文件下载能够有序地进行,避免文件下载的过程杂乱无章,保证了服务器的稳定运行,进一步提高了服务器的资源利用率。
考虑到待下载文件包含多种信息,但用户关心的信息只是其中的一部分,为了获取用户关心的信息,可以将关键信息与待下载文件的全文进行匹配,以筛选出用户关心的信息。
在其中一个实施例中,上述步骤S202,将关键信息与待下载文件的全文进行匹配,得到匹配结果,包括:将关键信息与待下载文件全文各个位置的数据信息进行匹配,得到相应的匹配结果。匹配结果是指关键信息与待下载文件中的数据信息的关联情况。
将关键信息与待下载文件全文各个位置的数据信息进行匹配,全面遍历待下载文件全文,可以准确获取用户关心的信息,避免遗漏信息,有利于后续从待下载文件中分离出多个分块文件。
在其中一个实施例中,上述步骤S203,根据匹配结果从待下载文件中分离出多个分块文件包括:从待下载文件全文各个位置的数据信息中,筛选出匹配结果符合要求的多个位置的数据信息,并对多个位置的数据信息进行标记;将被标记的在预设范围内的数据信息进行组合,得到多个数据信息组合,作为待下载文件中分离出的多个分块文件。
比如,从待下载文件全文各个位置的数据信息中,筛选出匹配值在某个范围内的多个位置的数据信息,并将其进行标记;从待下载文件中第一个位置的数据信息开始,依次将被标记的在预设范围内的数据信息进行组合,得到多个数据信息组合,即多个分块文件。
根据关键信息与待下载文件全文的各种匹配结果,从待下载文件中,筛选出匹配结果 符合要求的数据信息;并将符合要求的数据信息进行多次组合,得到多个分块文件,大大减少了待下载文件的数据量,避免服务器内存溢出和资源抢占,从而提高了服务器的资源利用率。同时,在下载速度一定的情况下,减少待下载文件的数据量,有利于提高文件的下载效率。
在另一个实施例中,上述步骤S203,根据匹配结果从待下载文件中分离出多个分块文件包括:从待下载文件上下文各个位置的数据信息中,筛选出匹配结果符合要求的多个位置的数据信息,并对多个位置的数据信息进行标记;将被标记的数据信息进行组合,得到组合文件;将组合文件按照预设长度进行划分,得到多个分块文件。组合文件由多个分块文件组合而成。
将符合要求的多个位置的数据信息进行组合,得到对应的组合文件,再将组合文件划分成多个分块文件,可以保证每个分块文件大小相同,同时减少了待下载文件的数据量,避免服务器内存溢出,进一步提高了服务器的资源利用率。
在其中一个实施例中,如图3所示,提供了另一种文件下载方法,包括以下步骤:
步骤S301,获取待下载文件及对应的关键信息。
步骤S302,将关键信息与待下载文件全文各个位置的数据信息进行匹配,得到匹配结果。
步骤S303,从待下载文件全文各个位置的数据信息中,筛选出匹配结果符合要求的多个位置的数据信息,并对多个位置的数据信息进行标记;将被标记的在预设范围内的数据信息进行组合,得到多个数据信息组合,作为待下载文件中分离出的多个分块文件。
步骤S304,获取多个分块文件的下载级别。
步骤S305,根据下载级别,对多个分块文件分别进行下载,得到多个已下载分块文件。
上述文件下载方法中,从待下载文件中分离出多个分块文件,只获取与关键信息关联的数据信息,大大减少了待下载文件的数据量,避免服务器内存溢出,从而提高了服务器的资源利用率。同时,按照下载级别对分块文件进行下载,让文件下载能够有序地进行,避免文件下载的过程杂乱无章,保证了服务器的稳定运行,进一步提高了服务器的资源利用率。
为了快速从待下载文件中分离出多个分块文件,可以构建一种文件分块模型,用于根据待下载文件及对应的关键信息,得到多个分块文件。在其中一个实施例中,上述步骤S201,在获取待下载文件及对应的关键信息之后,包括:将待下载的文件及对应的关键信息输入预先训练的文件分块模型,文件分块模型用于根据待下载文件及对应的关键信息,查询关键信息与文件的对应关系,确定待下载文件中待下载数据信息;根据待下载数据信息,从待下载文件中分离出多个分块文件。
文件分块模型是基于历史数据信息训练得到的;比如,经过历史数据分析,业务文件的模板是固定的,用户关心的信息在业务文件中的位置基本也是固定的,关键信息也是可 以统计的,那么,关键信息与业务文件之间就有多种对应关系,经过多次反复训练,直到文件分块模型能够根据待下载文件及关键信息,从待下载文件中分离出多个分块文件为止。根据文件分块模型,可以快速从待下载文件中分离出多个分块文件,减少了待下载文件的数据量,进一步提高了服务器的资源利用率。
为了进一步减少待下载文件的数据量,可以将得到的多个分块文件进行压缩。在其中一个实施例中,上述步骤S203,在根据匹配结果从待下载文件中分离出多个分块文件之后,包括:将多个分块文件进行压缩,得到多个压缩后的分块文件。将分离后的多个分块文件进行压缩,进一步减少了待下载文件的数据量,避免服务器内存溢出和资源抢占,从而提高了服务器的资源利用率。
在其中一个实施例中,如图4所示,提供了又一种文件下载方法,包括以下步骤:
步骤S401,获取待下载文件及对应的关键信息。
步骤S402,将待下载文件及对应的关键信息输入预先训练的文件分块模型,文件分块模型用于根据待下载文件及对应的关键信息,查询关键信息与文件的对应关系,确定待下载文件中待下载数据信息;根据待下载数据信息,从待下载文件中分离出多个分块文件。
步骤S403,将多个分块文件进行压缩,得到多个压缩后的分块文件。
步骤S404,获取多个分块文件的下载级别。
步骤S405,根据下载级别,对多个分块文件分别进行下载,得到多个已下载分块文件。
上述文件下载方法中,根据文件分块模型,从待下载文件中分离出多个分块文件,只获取与关键信息关联的数据信息,同时将各个分块文件进行压缩,大大减少了待下载文件的数据量,避免服务器内存溢出,进一步提高了服务器的资源利用率。
考虑到不同分块文件的重要程度不一样,为了方便表示分块文件的重要程度,需要将分块文件分级别(比如下载级别)进行标识。在其中一个实施例中,上述步骤S204,获取多个分块文件的下载级别包括:获取多个分块文件的信息内容;根据多个分块文件的信息内容,查询信息内容与下载级别的对应关系,获取多个分块文件的下载级别。其中,信息内容包括数据量大小、内容重要程度等。
根据分块文件的信息内容,综合评估分块文件的重要程度,进而确定分块文件的下载级别,从而根据下载级别,即可快速识别分块文件的重要程度。同时有利于后续按照下载级别,对多个分块文件进行下载,保证文件下载能够有序地进行,从而保证了服务器的稳定运行,进一步提高了服务器的资源利用率。
为了保证分块文件下载能够有序地进行,避免文件下载的过程杂乱无章,可以根据下载级别,对多个分块文件分别进行下载。在其中一个实施例中,上述步骤S205,根据下载级别,对多个分块文件分别进行下载,得到多个已下载分块文件包括:将多个分块文件按照下载级别进行排列,得到排列后的多个分块文件;依次对排列后的多个分块文件进行下载,得到多个已下载分块文件;各个已下载分块文件为相互独立的分块文件。每个已下 载分块文件也是一个独立的文件,具备与待下载文件相同的属性,比如可以单独打开、查看、编辑、合并等。
根据分块文件对应的下载级别,对多个分块文件分别进行下载,让文件下载能够有序地进行,保证了服务器的稳定运行,同时减少了待下载文件的数据量,避免服务器内存溢出和资源抢占,进一步提高了服务器的资源利用率。
在另一个实施例中,上述步骤S205,根据下载级别,对多个分块文件分别进行下载,得到多个已下载分块文件包括:将多个分块文件按照下载级别从高到低的顺序进行下载,得到多个已下载分块文件。
将各个分块文件,按照下载级别从高到低的顺序进行下载,让文件下载能够有序地进行,保证了服务器的稳定运行,同时减少了待下载文件的数据量,避免服务器内存溢出和资源抢占,进一步提高了服务器的资源利用率。
需要说明的是,还可以将多个分块文件按照下载级别从低到高的顺序进行下载,得到多个已下载分块文件;当然还可以将多个分块文件按照其他顺序进行下载。
在其中一个实施例中,上述步骤S205,在根据下载级别,对多个分块文件分别进行下载,得到多个已下载分块文件之后,包括:检测用户的选择触发操作,若检测到用户的选择触发操作,暂停当前分块文件的下载,启动与选择触发操作对应的分块文件的下载;选择触发操作用于触发启动分块文件的下载。选择用户关心的分块文件进行下载,既满足了用户需求,又避免了服务器内存溢出和资源抢占,进一步提高了服务器的资源利用率。
考虑到已下载分块文件有多个,若要同时查看各个分块文件,需要将各个分块文件均打开,过程比较繁琐,而且查看不方便,因此,可以将多个已下载分块文件进行组合。
在其中一个实施例中,上述步骤S205,在根据下载级别,对多个分块文件分别进行下载,得到多个已下载分块文件之后,包括:若已下载分块文件大于预设个数,根据下载级别,将多个已下载分块文件组合在一起,得到与待下载文件对应的文件。此外,还可以在文件中建立各个分块文件的文件索引信息;根据文件索引信息可以快速定位到对应的分块文件。将多个已下载分块文件组合在一起,可以方便用户查看,避免分块文件过多而查看不方便的缺陷。
在其中一个实施例中,如图5所示,提供了再一种分块文件下载方法,包括以下步骤:
步骤S501,获取待下载文件及对应的关键信息。
步骤S502,将关键信息与待下载文件的全文进行匹配,得到匹配结果。
步骤S503,根据匹配结果从待下载文件中分离出多个分块文件。
步骤S504,获取多个分块文件的下载级别。
步骤S505,根据下载级别,对多个分块文件分别进行下载,得到多个已下载分块文件。
步骤S506,若已下载分块文件大于预设个数,根据下载级别,将多个已下载分块文件组合在一起,得到与待下载文件对应的文件。
上述文件下载方法中,根据关键信息与待下载文件全文的匹配结果,从待下载文件中分离出多个分块文件,大大减少了待下载文件的数据量,避免服务器内存溢出,进一步提高了服务器的资源利用率;同时,将多个已下载分块文件组合在一起,方便用户查看,避免了分块文件过多而查看不方便的缺陷。
考虑到已下载分块文件,在下载的过程中可能存在数据丢失的情况,为了保证分块文件的完整性,防止数据丢失,可以在分块文件下载之前,建立与分块文件对应的校验匹配文件。
在其中一个实施例中,上述步骤S203,在根据匹配结果从待下载文件中分离出多个分块文件之后,还包括:建立与各个分块文件对应的校验匹配文件。其中,校验匹配文件是一种用于检验分块文件的数据是否完整的文件。
在其中一个实施例中,上述步骤S205,按照下载级别,对多个分块文件分别进行下载包括:检测到当前下载级别对应的分块文件下载完毕,根据与分块文件对应的校验匹配文件,对分块文件进行校验;若校验错误,则重新下载分块文件;若校验正确,则继续进行下载。分块文件按照下载级别进行排列,若当前下载级别对应的分块文件下载完毕,则继续对其他分块文件进行下载。比如,第一下载级别对应的分块文件下载完毕,则启动第二下载级别的分块文件进行下载。
建立各个分块文件对应的检验匹配文件,并通过检验匹配文件,对下载后的分块文件进行校验,可以保证分块文件中数据的完整性,避免分块文件的数据丢失而引起不必要的后果。
在其中一个实施例中,如图6所示,提供了再一种文件下载方法,包括以下步骤:
步骤S601,获取待下载文件及对应的关键信息。
步骤S602,将关键信息与待下载文件的全文进行匹配,得到匹配结果。
步骤S603,根据匹配结果从待下载文件中分离出多个分块文件。
步骤S604,获取多个分块文件的下载级别;建立与各个分块文件对应的校验匹配文件。
步骤S605,检测到当前下载级别对应的分块文件下载完毕,根据与分块文件对应的校验匹配文件,对分块文件进行校验;若校验错误,则重新下载分块文件;若校验正确,则继续进行下载。
步骤S606,得到多个已下载分块文件。
上述文件下载方法中,根据关键信息与待下载文件全文的匹配结果,从待下载文件中分离出多个分块文件,大大减少了待下载文件的数据量,避免服务器内存溢出,进一步提高了服务器的资源利用率;同时,建立各个分块文件对应的检验匹配文件,并通过检验匹配文件,对下载后的分块文件进行校验,可以保证分块文件中数据的完整性,避免分块文件的数据丢失而引起不必要的后果。
考虑到分离后的分块文件的数据量大小不一,有些分块文件的数据量可能过大,在下 载的过程中,会造成服务器的负载太大,从而降低了服务器的资源利用率,因此,可以将分块文件再进行划分。
在其中一个实施例中,上述步骤S203,在根据匹配结果从待下载文件中分离出多个分块文件之后,还包括:将多个分块文件对应的数据量分别与预设数据量进行比较,从多个分块文件中筛选出大于预设数据量的分块文件;将大于预设数据量的分块文件进行划分,得到多个分块子文件。分块子文件的数据量小于预设数据量。
通过将各分块文件的数据量与预设数据量进行比较,将大于预设数据量的分块文件再进行划分,避免了分块文件过大而影响服务器的资源利用率,保证了服务器能够稳定运行,进一步提高了服务器的资源利用率。
此外,同一个分块文件对应的分块子文件的重要程度可能不一样,需要获取多个分块子文件的下载级别,以方便后续文件下载的过程能够有序地进行。在其中一个实施例中,在将大于预设数据量的分块文件进行划分,得到多个分块子文件之后,包括:获取多个分块子文件的下载级别。获取分块子文件的下载级别与获取分块文件的下载级别的方法一致。
在其中一个实施例中,上述步骤S205,根据下载级别,对多个分块文件分别进行下载,得到多个已下载分块文件,包括:按照下载级别,对多个分块文件和分块子文件分别进行下载,得到多个已下载分块文件和已下载分块子文件。已下载分块子文件也是一个独立的文件,具备与待下载文件相同的属性,比如可以单独打开、查看、编辑、合并等
获取多个分块子文件的下载级别,将多个分块文件和分块子文件,按照下载级别分别进行下载,保证了文件下载的过程能够有序地进行,同时减少了待下载文件的数据量,避免服务器内存溢出和资源抢占,保证了服务器能够稳定运行,进一步提高了服务器的资源利用率。
在其中一个实施例中,如图7所示,提供了再一种文件下载方法,包括以下步骤:
步骤S701,获取待下载文件及对应的关键信息。
步骤S702,将关键信息与待下载文件的全文进行匹配,得到匹配结果。
步骤S703,根据匹配结果从待下载文件中分离出多个分块文件。
步骤S704,将多个分块文件对应的数据量分别与预设数据量进行比较,从多个分块文件中筛选出大于预设数据量的分块文件;将大于预设数据量的分块文件进行划分,得到多个分块子文件。
步骤S705,获取多个分块文件和分块子文件的下载级别。
步骤S706,根据下载级别,对多个分块文件和分块子文件分别进行下载,得到多个已下载分块文件和已下载分块子文件。
上述文件下载方法中,根据关键信息与待下载文件全文的匹配结果,从待下载文件中分离出多个分块文件,大大减少了待下载文件的数据量,避免服务器内存溢出,进一步提高了服务器的资源利用率;同时,在分块文件的数据量大于预设数据量的情况下,将分块 文件再进行划分,避免了分块文件过大而影响服务器的资源利用率;并将多个分块文件和分块子文件,按照下载级别分别进行下载,保证了文件下载的过程能够有序地进行,确保了服务器能够稳定运行,进一步提高了服务器的资源利用率。
在其中一个实施例中,上述步骤S205,在根据下载级别,对多个分块文件分别进行下载之后,包括:根据预设周期,输出显示各个分块文件的标签信息。标签信息包括发送级别、下载通知状态、下载进度和内容概要。根据预设周期,输出显示各个分块文件的标签信息,方便对各个分块文件的信息进行监控。
应该理解的是,虽然图2-7的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-7中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在其中一个实施例中,如图8所示,提供了一种文件下载装置,包括:文件获取模块810、信息匹配模块820、文件分块模块830、级别获取模块840和文件下载模块850,其中:
文件获取模块810,用于获取待下载文件及对应的关键信息。
信息匹配模块820,用于将关键信息与待下载文件的全文进行匹配,得到匹配结果。
文件分块模块830,用于根据匹配结果从待下载文件中分离出多个分块文件。
级别获取模块840,用于获取所述多个分块文件的下载级别。
文件下载模块850,用于根据下载级别,对多个分块文件分别进行下载,得到多个已下载分块文件。
在其中一个实施例中,文件分块模块还用于从待下载文件全文各个位置的数据信息中,筛选出匹配结果符合要求的多个位置的数据信息,并对多个位置的数据信息进行标记;将被标记的在预设范围内的数据信息进行组合,得到多个数据信息组合,作为待下载文件中分离出的多个分块文件。
在其中一个实施例中,级别获取模块还用于获取多个分块文件的信息内容;根据多个分块文件的信息内容,查询信息内容与下载级别的对应关系,获取多个分块文件的下载级别。
在其中一个实施例中,文件下载模块还用于将多个分块文件按照下载级别进行排列,得到排列后的多个分块文件;依次对排列后的多个分块文件进行下载,得到多个已下载分块文件。
在其中一个实施例中,文件下载装置还包括文件组合模块,用于若已下载分块文件大于预设个数,按照下载级别,将多个已下载分块文件组合在一起,得到与待下载文件对应 的文件。
在其中一个实施例中,文件下载装置还包括文件压缩模块,用于文件分块模块根据匹配结果从待下载文件中分离出多个分块文件之后,将多个分块文件进行压缩,得到多个压缩后的分块文件。
在其中一个实施例中,文件下载装置还包括匹配文件建立模块,用于文件分块模块根据匹配结果从待下载文件中分离出多个分块文件之后,建立与各个分块文件对应的校验匹配文件。
在其中一个实施例中,文件下载装置还包括子文件划分模块,用于文件分块模块根据匹配结果从待下载文件中分离出多个分块文件之后,将多个分块文件对应的数据量分别与预设数据量进行比较,从多个分块文件中筛选出大于预设数据量的分块文件;将大于预设数据量的分块文件的数据量进行划分,得到多个分块子文件;分块子文件的数据量小于预设数据量。
在其中一个实施例中,文件下载模块还用于检测到当前下载级别对应的分块文件下载完毕,根据与分块文件对应的校验匹配文件,对分块文件进行校验;若校验错误,则重新下载分块文件;若校验正确,则继续进行下载。
上述各个实施例,文件下载装置将待下载文件对应的关键信息,与待下载文件的全文进行匹配,得到匹配结果,然后根据匹配结果从待下载文件中分离出多个分块文件,最后按照各个分块文件的下载级别,对多个分块文件进行下载,得到多个已下载分块文件。根据关键信息与待下载文件全文的匹配结果,从待下载文件中分离出多个分块文件,只获取与关键信息关联的数据信息,大大减少了待下载文件的数据量,避免服务器内存溢出和资源抢占,从而提高了服务器的资源利用率。在下载速度一定的情况下,减少待下载文件的数据量,有利于提高文件的下载效率。同时,根据分块文件对应的下载级别,对多个分块文件分别进行下载,让文件下载能够有序地进行,避免文件下载的过程杂乱无章,保证了服务器能够稳定运行,进一步提高了服务器的资源利用率。
关于文件下载装置的具体限定可以参见上文中对于文件下载方法的限定,在此不再赘述。上述文件下载装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在其中一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图9所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储分块文件。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种文件下载方 法。
本领域技术人员可以理解,图9中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
一种计算机设备,包括存储器和一个或多个处理器,存储器中存储有计算机可读指令,计算机可读指令被处理器执行时实现本申请任意一个实施例中提供的文件下载方法的步骤。
一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的文件下载方法的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种文件下载方法,包括:
    获取待下载文件及对应的关键信息;
    将关键信息与待下载文件的全文进行匹配,得到匹配结果;
    根据匹配结果从所述待下载文件中分离出多个分块文件;
    获取所述多个分块文件的下载级别;及
    根据下载级别,对所述多个分块文件分别进行下载,得到多个已下载分块文件。
  2. 根据权利要求1所述的方法,其特征在于,所述根据匹配结果从所述待下载文件中分离出多个分块文件,包括:
    从所述待下载文件全文各个位置的数据信息中,筛选出匹配结果符合要求的多个位置的数据信息,并对所述多个位置的数据信息进行标记;及
    将被标记的在预设范围内的数据信息进行组合,得到多个数据信息组合,作为所述待下载文件中分离出的多个分块文件。
  3. 根据权利要求1所述的方法,其特征在于,所述获取所述多个分块文件的下载级别,包括:
    提取所述多个分块文件的信息内容;及
    根据所述多个分块文件的信息内容,查询信息内容与下载级别的对应关系,获取所述多个分块文件的下载级别。
  4. 根据权利要求3所述的方法,其特征在于,所述根据下载级别,对所述多个分块文件分别进行下载,得到多个已下载分块文件,包括:
    将所述多个分块文件按照下载级别进行排列,得到排列后的多个分块文件;及
    依次对排列后的多个分块文件进行下载,得到多个已下载分块文件。
  5. 根据权利要求1至4任意一项所述的方法,其特征在于,还包括:
    若已下载分块文件大于预设个数,根据所述下载级别,将所述多个已下载分块文件组合在一起,得到与所述待下载文件对应的文件。
  6. 根据权利要求5所述的方法,其特征在于,在根据匹配结果从所述待下载文件中分离出多个分块文件之后,所述方法还包括:
    将所述多个分块文件进行压缩,得到多个压缩后的分块文件;
    建立与各个分块文件对应的校验匹配文件;
    将所述多个分块文件对应的数据量分别与预设数据量进行比较,从多个分块文件中筛选出大于预设数据量的分块文件;及
    将大于预设数据量的分块文件进行划分,得到多个分块子文件;所述分块子文件的数据量小于预设数据量。
  7. 根据权利要求6所述的方法,其特征在于,所述根据下载级别,对所述多个分块文件分别进行下载,包括:
    当检测到当前下载级别对应的分块文件下载完毕,根据与所述分块文件对应的校验匹配文件,对所述分块文件进行校验;
    若校验错误,则重新下载所述分块文件;及
    若校验正确,则继续进行下载。
  8. 一种文件下载装置,包括:
    文件获取模块,用于获取待下载文件及对应的关键信息;
    信息匹配模块,用于将关键信息与待下载文件的全文进行匹配,得到匹配结果;
    文件分块模块,用于根据匹配结果从所述待下载文件中分离出多个分块文件;
    级别获取模块,用于获取所述多个分块文件的下载级别;及
    文件下载模块,用于根据下载级别,对所述多个分块文件分别进行下载,得到多个已下载分块文件。
  9. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理执行以下步骤:
    获取待下载文件及对应的关键信息;
    将关键信息与待下载文件的全文进行匹配,得到匹配结果;
    根据匹配结果从所述待下载文件中分离出多个分块文件;
    获取所述多个分块文件的下载级别;及
    根据下载级别,对所述多个分块文件分别进行下载,得到多个已下载分块文件。
  10. 根据权利要求9所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    从所述待下载文件全文各个位置的数据信息中,筛选出匹配结果符合要求的多个位置的数据信息,并对所述多个位置的数据信息进行标记;及
    将被标记的在预设范围内的数据信息进行组合,得到多个数据信息组合,作为所述待下载文件中分离出的多个分块文件。
  11. 根据权利要求9所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    提取所述多个分块文件的信息内容;及
    根据所述多个分块文件的信息内容,查询信息内容与下载级别的对应关系,获取所述多个分块文件的下载级别。
  12. 根据权利要求11所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    将所述多个分块文件按照下载级别进行排列,得到排列后的多个分块文件;及
    依次对排列后的多个分块文件进行下载,得到多个已下载分块文件。
  13. 根据权利要求9至12任意一项所述的计算机设备,其特征在于,所述处理器执 行所述计算机可读指令时还执行以下步骤:
    若已下载分块文件大于预设个数,根据所述下载级别,将所述多个已下载分块文件组合在一起,得到与所述待下载文件对应的文件。
  14. 根据权利要求13所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    将所述多个分块文件进行压缩,得到多个压缩后的分块文件;
    建立与各个分块文件对应的校验匹配文件;
    将所述多个分块文件对应的数据量分别与预设数据量进行比较,从多个分块文件中筛选出大于预设数据量的分块文件;及
    将大于预设数据量的分块文件进行划分,得到多个分块子文件;所述分块子文件的数据量小于预设数据量。
  15. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    获取待下载文件及对应的关键信息;
    将关键信息与待下载文件的全文进行匹配,得到匹配结果;
    根据匹配结果从所述待下载文件中分离出多个分块文件;
    获取所述多个分块文件的下载级别;及
    根据下载级别,对所述多个分块文件分别进行下载,得到多个已下载分块文件。
  16. 根据权利要求15所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    从所述待下载文件全文各个位置的数据信息中,筛选出匹配结果符合要求的多个位置的数据信息,并对所述多个位置的数据信息进行标记;及
    将被标记的在预设范围内的数据信息进行组合,得到多个数据信息组合,作为所述待下载文件中分离出的多个分块文件。
  17. 根据权利要求15所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    提取所述多个分块文件的信息内容;及
    根据所述多个分块文件的信息内容,查询信息内容与下载级别的对应关系,获取所述多个分块文件的下载级别。
  18. 根据权利要求17所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    将所述多个分块文件按照下载级别进行排列,得到排列后的多个分块文件;及
    依次对排列后的多个分块文件进行下载,得到多个已下载分块文件。
  19. 根据权利要求15至18任意一项所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    若已下载分块文件大于预设个数,根据所述下载级别,将所述多个已下载分块文件组合在一起,得到与所述待下载文件对应的文件。
  20. 根据权利要求19所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    将所述多个分块文件进行压缩,得到多个压缩后的分块文件;
    建立与各个分块文件对应的校验匹配文件;
    将所述多个分块文件对应的数据量分别与预设数据量进行比较,从多个分块文件中筛选出大于预设数据量的分块文件;及
    将大于预设数据量的分块文件进行划分,得到多个分块子文件;所述分块子文件的数据量小于预设数据量。
PCT/CN2018/105494 2018-07-03 2018-09-13 文件下载方法、装置、计算机设备和存储介质 WO2020006866A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810715600.4 2018-07-03
CN201810715600.4A CN109040191B (zh) 2018-07-03 2018-07-03 文件下载方法、装置、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2020006866A1 true WO2020006866A1 (zh) 2020-01-09

Family

ID=65521419

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/105494 WO2020006866A1 (zh) 2018-07-03 2018-09-13 文件下载方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN109040191B (zh)
WO (1) WO2020006866A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110401723A (zh) * 2019-08-16 2019-11-01 北京浪潮数据技术有限公司 Ova文件上传服务器的方法、系统、设备及存储介质
CN111193785B (zh) * 2019-12-20 2023-05-02 北京淇瑀信息科技有限公司 一种文件切割传输方法、装置和电子设备
CN111324458A (zh) * 2020-02-18 2020-06-23 山东汇贸电子口岸有限公司 一种基于Java的大文件下载加速方法
CN112580092B (zh) * 2020-12-07 2023-03-24 北京明朝万达科技股份有限公司 一种敏感文件识别方法及装置
CN116048710B (zh) * 2023-04-03 2023-09-29 荣耀终端有限公司 应用标识的显示方法、电子设备及可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101827128A (zh) * 2010-04-06 2010-09-08 山东高效能服务器和存储研究院 一种文件网络传输中分块下载和匹配的方法
WO2016155599A1 (zh) * 2015-03-31 2016-10-06 中兴通讯股份有限公司 流媒体服务与文件下载融合的方法、装置及cdn服务器
CN106850842A (zh) * 2012-06-28 2017-06-13 北京奇虎科技有限公司 一种文件的下载、上传方法及装置
CN108111555A (zh) * 2016-11-25 2018-06-01 阿里巴巴集团控股有限公司 用于控制安装包下载过程的方法及系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102196008A (zh) * 2010-03-08 2011-09-21 株式会社日立制作所 点对点下载方法、视频设备和内容发送方法
CN106257879B (zh) * 2015-06-16 2020-02-14 阿里巴巴集团控股有限公司 一种下载应用的方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101827128A (zh) * 2010-04-06 2010-09-08 山东高效能服务器和存储研究院 一种文件网络传输中分块下载和匹配的方法
CN106850842A (zh) * 2012-06-28 2017-06-13 北京奇虎科技有限公司 一种文件的下载、上传方法及装置
WO2016155599A1 (zh) * 2015-03-31 2016-10-06 中兴通讯股份有限公司 流媒体服务与文件下载融合的方法、装置及cdn服务器
CN108111555A (zh) * 2016-11-25 2018-06-01 阿里巴巴集团控股有限公司 用于控制安装包下载过程的方法及系统

Also Published As

Publication number Publication date
CN109040191A (zh) 2018-12-18
CN109040191B (zh) 2021-11-09

Similar Documents

Publication Publication Date Title
WO2020006866A1 (zh) 文件下载方法、装置、计算机设备和存储介质
WO2020186786A1 (zh) 文件处理方法、装置、计算机设备和存储介质
CN106657213B (zh) 文件传输方法和装置
US9619487B2 (en) Method and system for the normalization, filtering and securing of associated metadata information on file objects deposited into an object store
US11296940B2 (en) Centralized configuration data in a distributed file system
CN110347651B (zh) 基于云存储的数据同步方法、装置、设备及存储介质
CN109711145A (zh) 数据校验方法及装置、存储介质、计算机设备
CN109739828B (zh) 一种数据处理方法、设备及计算机可读存储介质
US10417192B2 (en) File classification in a distributed file system
CN107590144A (zh) 一种文件存储方法和终端
CN110018982A (zh) 查找文件的方法、装置、设备及计算机可读存储介质
CN114647689A (zh) 一种图数据库数据导入的方法、系统、装置和介质
WO2021120628A1 (zh) 基于区块链的敏感词检测方法、装置、计算机设备和计算机可读存储介质
CN107885859B (zh) 一种文件个数配额的方法、装置和计算机可读存储介质
US9917697B2 (en) Performing incremental upgrade on APK base file corresponding to APK eigenvalue value
CN112506869A (zh) 文件处理方法、装置及系统
US20210319058A1 (en) Location-based alarm notification application
CN106326310B (zh) 一种手机客户端软件的资源加密更新方法
CN115129789A (zh) 一种分布式对象存储系统的桶索引存储方法、装置及介质
CN114968937A (zh) 一种数据存取方法、装置、设备和计算机可读存储介质
CN109857888B (zh) 图像文件处理方法、装置、计算机设备和存储介质
US20140208057A1 (en) Storage card partition system and method
CN111935539A (zh) 一种视频检测的方法、系统、电子装置和存储介质
WO2017016248A1 (zh) 一种数据输出方法及装置
CN110147384B (zh) 数据查找模型建立方法、装置、计算机设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18925178

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18925178

Country of ref document: EP

Kind code of ref document: A1