File downloading method and device, equipment, storage medium and computer program product
Patent Information
- Application Number
- CN202510058949.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-05-06
Smart Images

Figure CN119946043A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a file downloading method, device, equipment, storage medium and computer program product. Background Art
[0002] Currently, in browsers, downloading files of the Hypertext Transfer Protocol (HTTP) type is an important function and a scenario that users use frequently. The existing file download method is usually to download separately through the browser's network process, and the download speed is limited, resulting in slow download speed and poor user experience. Summary of the invention
[0003] The main purpose of the present application is to provide a file downloading method, apparatus, device, storage medium and computer program product, aiming to solve the technical problem that the existing file downloading method is usually downloaded separately through the network process of the browser, the download speed is limited, and thus there are defects such as slow download speed and poor user experience.
[0004] To achieve the above object, the present application provides a file downloading method, the file downloading method comprising:
[0005] In response to a file download request, dividing the to-be-downloaded data corresponding to the to-be-downloaded file into a first data block and a second data block;
[0006] Downloading the first data block from the original download site corresponding to the file to be downloaded through the original acceleration node cluster;
[0007] Downloading the second data block from other data sources through a smart acceleration node cluster, wherein the other data sources are data sources other than the original download site;
[0008] The first data block and the second data block are assembled to obtain a download completion file.
[0009] Optionally, downloading the second data block from other data sources through the intelligent acceleration node cluster includes:
[0010] Selecting a download acceleration method through an intelligent acceleration node cluster, wherein the download acceleration method includes at least one of peer-to-peer network acceleration, content distribution network acceleration, and mirror acceleration;
[0011] The second data block is downloaded from the corresponding data source based on the download acceleration method.
[0012] Optionally, the download acceleration method is peer-to-peer network acceleration; and downloading the second data block from a corresponding data source based on the download acceleration method includes:
[0013] Acquire the current download data of each node in the peer-to-peer network, and match the data to be downloaded with the current download data of each node;
[0014] A peer node is selected from the peer network according to the matching result, and the first data block is downloaded through the peer node.
[0015] Optionally, the download acceleration method is content distribution network acceleration; and downloading the second data block from a corresponding data source based on the download acceleration method includes:
[0016] Request a content distribution network acceleration node;
[0017] The second data block is downloaded through the content distribution network acceleration node.
[0018] Optionally, the requesting a content distribution network acceleration node includes:
[0019] Creating an independent thread, and requesting the content distribution network service for the content distribution network node information corresponding to the file to be downloaded through the independent thread;
[0020] A content distribution network node is selected based on the content distribution network node information.
[0021] Optionally, the download acceleration method is mirror acceleration; and downloading the second data block from a corresponding data source based on the download acceleration method includes:
[0022] Searching in the backend service whether there is a target file that is the same as the file to be downloaded;
[0023] Obtain a mirror address of the target file, and download the second data block through the mirror address.
[0024] Optionally, downloading the first data block from an original download site corresponding to the file to be downloaded through the original acceleration node cluster includes:
[0025] Select multiple original acceleration nodes from the original acceleration node cluster, and build download threads corresponding to each original acceleration node;
[0026] The first data block is downloaded from the original download site corresponding to the file to be downloaded through multiple download threads based on the multiple original acceleration nodes.
[0027] Optionally, assembling the first data block and the second data block to obtain the download completion file includes:
[0028] Filling the first data block and the second data block into the file to be downloaded to obtain filled data blocks;
[0029] The filled data blocks are assembled in a preset order to obtain a download completion file.
[0030] Optionally, assembling the filled data blocks in a preset order to obtain a downloaded file includes:
[0031] Verifying the filled data block to obtain a verified data block;
[0032] The verified data blocks are assembled according to a preset order to obtain a download completion file.
[0033] Optionally, verifying the filled data block to obtain a verified data block includes:
[0034] Comparing the data characteristics of the filled data block with the data characteristics of the file to be downloaded;
[0035] The filled data block is verified according to the comparison result to obtain a data block that passes the verification.
[0036] Optionally, after assembling the first data block and the second data block to obtain the downloaded file, the method further includes:
[0037] Generate a download completion notification corresponding to the downloaded file, and display the download completion notification;
[0038] Obtain a temporary file corresponding to the downloaded file, and clean up the temporary file.
[0039] In addition, to achieve the above purpose, the present application also proposes a file downloading device, the file downloading device comprising:
[0040] A data partitioning module, configured to, in response to a file download request, partition the data to be downloaded corresponding to the file to be downloaded into a first data block and a second data block;
[0041] A first downloading module, configured to download the first data block from an original downloading site corresponding to the file to be downloaded through an original acceleration node cluster;
[0042] A second downloading module, configured to download the second data block from other data sources through a smart acceleration node cluster, wherein the other data sources are data sources other than the original download site;
[0043] The data assembly module is used to assemble the first data block and the second data block to obtain a download completion file.
[0044] Optionally, the second download module is also used to select a download acceleration method through an intelligent acceleration node cluster, wherein the download acceleration method includes at least one of peer-to-peer network acceleration, content distribution network acceleration and mirror acceleration; and download the second data block from the corresponding data source based on the download acceleration method.
[0045] Optionally, the download acceleration method is peer-to-peer network acceleration; the second download module is also used to obtain the current download data of each node in the peer-to-peer network, and match the data to be downloaded with the current download data of each node; select a peer node from the peer network according to the matching result, and download the first data block through the peer node.
[0046] Optionally, the download acceleration method is content distribution network acceleration; the second download module is further used to request a content distribution network acceleration node; and download the second data block through the content distribution network acceleration node.
[0047] Optionally, the second download module is further used to create an independent thread, and request content distribution network node information corresponding to the file to be downloaded from the content distribution network service through the independent thread; and select a content distribution network node based on the content distribution network node information.
[0048] Optionally, the download acceleration method is mirror acceleration; the second download module is also used to search in the backend service whether there is a target file that is the same as the file to be downloaded; obtain the mirror address of the target file, and download the second data block through the mirror address.
[0049] In addition, to achieve the above objectives, the present application also proposes a file downloading device, which includes a memory, a processor, and a file downloading program stored in the memory and executable on the processor, wherein the file downloading program is configured to implement the file downloading method described above.
[0050] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, on which a file download program is stored, and when the file download program is executed by a processor, the file download method as described above is implemented.
[0051] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a file downloading program, and when the file downloading program is executed by a processor, it implements the file downloading method described above.
[0052] One or more technical solutions proposed in this application have at least the following technical effects:
[0053] In the present application, it is disclosed that in response to a file download request, the data to be downloaded corresponding to the file to be downloaded is divided into a first data block and a second data block, the first data block is downloaded from the original download site corresponding to the file to be downloaded through the original acceleration node cluster, and the second data block is downloaded from other data sources through the intelligent acceleration node cluster, wherein the other data source is a data source other than the original download site, and the first data block and the second data block are assembled to obtain a downloaded file; since in the present application a part of the data blocks are downloaded from the original download site through the original acceleration node cluster, and another part of the data blocks are downloaded from other data sources through the intelligent acceleration node cluster, the file download speed can be increased, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0056] Figure 1 This is a flow chart of the first embodiment of the method for downloading application documents;
[0057] Figure 2 This is a flow chart of the second embodiment of the method for downloading application documents;
[0058] Figure 3 This is an interactive schematic diagram of an embodiment of a method for downloading application documents;
[0059] Figure 4 This is a flowchart of the third embodiment of the method for downloading application documents;
[0060] Figure 5 This is a schematic diagram of the module structure of the file downloading device according to the embodiment of the present application;
[0061] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the file downloading method in the embodiment of the present application.
[0062] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0063] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0064] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0065] Currently, in browsers, downloading files of the Hypertext Transfer Protocol (HTTP) type is an important function and a scenario that users use frequently. The existing file download method is usually to download separately through the browser's network process, and the download speed is limited. However, with the development of the Internet, the quality of video and film information has also been greatly improved, and the size of the file has also become very large. Therefore, the existing file download method has the defects of slow download speed and poor user experience.
[0066] Therefore, in order to overcome the above-mentioned defects, the present application provides a solution, which includes: in response to a file download request, dividing the data to be downloaded corresponding to the file to be downloaded into a first data block and a second data block, downloading the first data block from the original download site corresponding to the file to be downloaded through the original acceleration node cluster, downloading the second data block from other data sources through the intelligent acceleration node cluster, wherein the other data source is a data source other than the original download site, assembling the first data block and the second data block to obtain a downloaded file; since in the present application a part of the data blocks are downloaded from the original download site through the original acceleration node cluster, and another part of the data blocks are downloaded from other data sources through the intelligent acceleration node cluster, the file download speed can be increased, thereby improving the user experience.
[0067] It should be noted that the execution subject of this embodiment can be a file downloading device with data processing, network communication and program running functions, such as a computer, or other electronic devices that can achieve the same or similar functions, and this embodiment does not impose any restrictions on this.
[0068] Based on this, the present application embodiment provides a file download method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the method for downloading documents of this application.
[0069] In a first embodiment, the file downloading method includes:
[0070] Step S10: In response to the file download request, divide the to-be-downloaded data corresponding to the to-be-downloaded file into a first data block and a second data block.
[0071] It should be understood that in order to make full use of resources from different sources to improve the download speed, in this embodiment, in response to a file download request, the data to be downloaded corresponding to the file to be downloaded is divided into a first data block and a second data block. Among them, the file download request may refer to an instruction initiated by a user through a client or a browser to obtain a specific file from a server or a network. The file to be downloaded may refer to a target file that the user wants to download, which may be any type of file such as a movie, music, or a document. The data to be downloaded may refer to all data contents contained in the file to be downloaded, and these data may be divided into multiple data blocks during the download process for easy transmission and processing. The first data block may refer to the first part of the data to be downloaded after being divided, and the first data block may include multiple data blocks. The second data block may refer to the second part of the data to be downloaded after being divided, and together with the first data block, it constitutes a complete file to be downloaded, and the second data block may also include multiple data blocks.
[0072] In a specific implementation, when a user initiates a file download request (such as an HTTP request), the data to be downloaded can be divided into multiple data blocks (such as dividing a file into multiple data blocks according to a 1M size) according to factors such as the file size, network conditions, and download strategy, and then the multiple data blocks can be divided into a first data block and a second data block according to a preset strategy. The preset strategy can be pre-set, and this embodiment does not limit this.
[0073] Step S20: downloading the first data block from the original download site corresponding to the file to be downloaded through the original acceleration node cluster.
[0074] It is understandable that in order to ensure the reliability of the source of the data block and to improve the download efficiency by utilizing the performance advantage of the acceleration node. In this embodiment, the first data block is downloaded from the original download site corresponding to the file to be downloaded by the original acceleration node cluster. The original acceleration node cluster may refer to a group of servers or nodes specifically used to obtain data from the original download site. The original download site may be the original server or site that provides the file to be downloaded.
[0075] In a specific implementation, an HTTP request is sent to an original download site through a server or a node of the original acceleration node cluster to download the first data block from the original download site.
[0076] Step S30: downloading the second data block from other data sources through the intelligent acceleration node cluster, wherein the other data sources are data sources other than the original download site.
[0077] It should be understood that in order to utilize diverse data sources and increase the download speed. In this embodiment, the second data block is also downloaded from other data sources through an intelligent acceleration node cluster. Among them, the intelligent acceleration node cluster can refer to a group of servers or nodes that can intelligently select the optimal download path according to network conditions and data sources. Other data sources can be any source that can provide file data to be downloaded other than the original download site, such as a peer-to-peer (P2P) network, a content delivery network (CDN) node, a local memory, etc., which is not limited in this embodiment.
[0078] In a specific implementation, the intelligent selection capability of the intelligent acceleration node cluster is utilized to request and download the second data block from other data sources other than the original download site (such as other users in the P2P network, CDN nodes, etc.).
[0079] Step S40: Assemble the first data block and the second data block to obtain a download completion file.
[0080] It is understandable that in order to ensure the integrity and correctness of the file, in this embodiment, the first data block and the second data block are assembled to obtain a download completion file, wherein the download completion file may refer to a complete file formed after all the data blocks to be downloaded are successfully downloaded and correctly assembled.
[0081] In a specific implementation, after the first data block and the second data block are downloaded, the first data block and the second data block can be reassembled according to the original order of the file to form a complete download completed file.
[0082] In this embodiment, a portion of data blocks are downloaded from the original download site through the original acceleration node cluster, and another portion of data blocks are downloaded from other data sources through the intelligent acceleration node cluster, thereby increasing the file download speed and further improving the user experience.
[0083] Furthermore, in order to ensure that the data blocks are correctly placed in the file, the step S40 includes: filling the first data block and the second data block into the file to be downloaded to obtain filled data blocks; assembling the filled data blocks in a preset order to obtain a downloaded file. The preset order may refer to a specific order in which the data blocks are assembled into a complete file during the file assembly process, which may be consistent with the storage order of the file on the disk.
[0084] In a specific implementation, during the download process, data blocks may be continuously received. Once a data block is downloaded, the data block is filled into the corresponding position of the file to be downloaded. After all data blocks are downloaded and filled into the file, the data blocks may be assembled into a complete file in a preset order.
[0085] Furthermore, in order to timely discover and correct errors in data blocks and avoid using erroneous data for file assembly, the filled data blocks are assembled in a preset order to obtain the downloaded file, including: verifying the filled data blocks to obtain data blocks that pass the verification; assembling the data blocks that pass the verification in a preset order to obtain the downloaded file. The data blocks that pass the verification may refer to data blocks that have been verified and confirmed to be correct.
[0086] In a specific implementation, after the data filling is completed, each data block can be verified. The verification method can include hash verification, cyclic redundancy check (CRC) verification, etc. to ensure the integrity and correctness of the data. The data blocks that have been verified and confirmed to be correct are used for subsequent file assembly. After all data blocks are downloaded and verified, the data blocks are assembled into a complete file in a preset order.
[0087] It can be understood that verifying the filled data block to obtain the verified data block can be by comparing the data characteristics of the filled data block with the data characteristics of the file to be downloaded; verifying the filled data block according to the comparison result to obtain the verified data block.
[0088] Furthermore, in order to facilitate users to understand the download progress and results and avoid unnecessary waste of resources, after step S40, it also includes: generating a download completion notification corresponding to the download completion file and displaying the download completion notification; obtaining a temporary file corresponding to the download completion file and cleaning up the temporary file.
[0089] In a specific implementation, after the file assembly is completed, the client or browser can generate a download completion notification and display the notification to the user through the user interface. The notification can include information such as the file name, size, and download completion time. During the download process, some files are created to store part of the downloaded data or temporary data. These temporary files are usually no longer needed after the download is completed, so they can be cleaned up to avoid unnecessary waste of resources.
[0090] Reference Figure 2 , Figure 2 This is a flow chart of the second embodiment of the method for downloading application files. Figure 1The first embodiment shown proposes a second embodiment of the method for downloading files of the present application.
[0091] In the second embodiment, the step S30 includes:
[0092] Step S301: selecting a download acceleration method through an intelligent acceleration node cluster, wherein the download acceleration method includes at least one of peer-to-peer network acceleration, content distribution network acceleration, and mirror acceleration.
[0093] It should be understood that in order to achieve dynamic optimization and improve download speed, in this embodiment, the intelligent acceleration node cluster can intelligently select the download acceleration method, and request and download the second data block from the corresponding data source according to the download acceleration method selected by the intelligent acceleration node cluster.
[0094] It should be noted that peer-to-peer acceleration (P2P acceleration) may refer to a technology that uses the downloaded data of other users in the network to accelerate the download process. Content distribution network acceleration (CDN acceleration) may refer to a technology that accelerates content distribution and downloading through CDN nodes distributed in various places. Mirror acceleration may refer to a technology that uses a mirror server that stores the same file to accelerate downloading.
[0095] In the specific implementation, the intelligent acceleration node cluster intelligently selects the optimal download acceleration method based on factors such as current network conditions, availability of data sources, and load conditions.
[0096] Step S302: downloading the second data block from the corresponding data source based on the download acceleration method.
[0097] It is understandable that in order to fully utilize the advantages of various acceleration methods and improve the download speed, in this embodiment, the second data block is downloaded from the corresponding data source based on the download acceleration method. In a specific implementation, for example, according to the download acceleration method selected by the intelligent acceleration node cluster, the second data block is requested and downloaded from the corresponding data source.
[0098] This embodiment uses an intelligent acceleration node cluster to intelligently select a download acceleration method, and requests and downloads the second data block from a corresponding data source according to the download acceleration method selected by the intelligent acceleration node cluster, thereby achieving dynamic optimization and improving the download speed.
[0099] Furthermore, in order to utilize the resources of other users in the network to accelerate downloading and reduce the dependence on the original server and bandwidth consumption, the download acceleration method is peer-to-peer network acceleration; the step S302 includes: obtaining the current download data of each node in the peer-to-peer network, and matching the data to be downloaded with the current download data of each node; selecting a peer node from the peer-to-peer network according to the matching result, and downloading the first data block through the peer node. The peer node may refer to a node that provides data to other users in peer-to-peer network acceleration.
[0100] In a specific implementation, if a certain peer node has downloaded a portion of the data of the second data block, the smart acceleration node cluster can guide other users to download this portion of data from the peer node.
[0101] Furthermore, in order to utilize the distributed characteristics of the CDN network to improve the download speed, the download acceleration method is content distribution network acceleration; the step S302 includes: requesting a content distribution network acceleration node; downloading the second data block through the content distribution network acceleration node. The content distribution network acceleration node may refer to a specific server node in the CDN network, which is responsible for storing and distributing content.
[0102] Furthermore, in order to maintain the smoothness of the CDN download process, the request for the content distribution network acceleration node includes: creating an independent thread, and requesting the content distribution network node information corresponding to the file to be downloaded from the content distribution network service through the independent thread; and selecting a content distribution network node based on the content distribution network node information.
[0103] It should be understood that in order to maintain the smoothness of the CDN download process, in this embodiment, an independent thread can be created and CDN download can be performed through the independent thread. The independent thread can refer to a thread in a computer program that can independently execute tasks, which does not share the execution path with the main thread or other threads, but can share the resources of the process.
[0104] It is understandable that after the independent thread is created, the independent thread is responsible for selecting a CDN node from the CDN network and downloading the second data block through the CDN node. The process of selecting a CDN node can be based on a variety of factors, such as the availability of the node, the download speed, the geographical location, and the distance from the user, etc., which are not limited in this embodiment. Among them, the content distribution network service can be a system that provides a content distribution network (CDN) acceleration service, which realizes rapid distribution and transmission of data by deploying multiple nodes. Content distribution network node information can refer to detailed information about each node in the content distribution network, including the address, status, load, etc. of the node.
[0105] Furthermore, in order to utilize the fast data access provided by the mirror server to increase the download speed, the download acceleration method is mirror acceleration; the step S302 includes: searching in the backend service whether there is a target file identical to the file to be downloaded; obtaining the mirror address of the target file, and downloading the second data block through the mirror address. Among them, mirror acceleration can refer to accelerating the download using a mirror server with the same content as the original server, and the mirror server can be located in different geographical locations to provide faster data access speed. The target file can refer to a file with the same content as the file to be downloaded, and can be located on a mirror server or other storage location. The mirror address can point to the URL or network location of the target file, which is used to download data from the mirror server.
[0106] In a specific implementation, it is searched in the backend service whether there is a target file identical to the file to be downloaded, the mirror address of the target file is obtained, and the second data block is downloaded from the mirror server through the mirror address.
[0107] It should be understood that in order to further improve the download speed, in this embodiment, the download acceleration method may include peer-to-peer network acceleration, content distribution network acceleration and mirror acceleration, and the step S302 includes: accelerating the download of the first part of the data blocks in the second data block through the peer-to-peer network, accelerating the download of the second part of the data blocks in the second data block through the content distribution network, and accelerating the download of the third part of the data blocks in the second data block through the mirror. The specific download process of each acceleration method is as described above and will not be repeated here.
[0108] For ease of understanding, refer to Figure 3 This invention is provided for illustration, but is not intended to limit the present application. Figure 3 This is an interactive diagram of an embodiment of the method for downloading application documents. Figure 3 In the method for downloading a file, the steps include:
[0109] 1. Start file downloading: The user initiates a file download request (such as an HTTP request) through a browser to determine the file to be downloaded.
[0110] 2. Divide the file into 1M blocks: Divide the file into 1M blocks and determine the number of blocks. For example, divide the data to be downloaded into 9 blocks, divide blocks 1, 2 and 3 into the first block, and divide blocks 4, 5, 6, 7, 8 and 9 into the second block.
[0111] 3. Request data blocks from different block sources:
[0112] (1) The source of the first data block: the original site.
[0113] Specific steps: Start 10 threads and download different block data from the original site at the same time.
[0114] (2) The source of the first part of the data block in the second data block: P2P / P2SP acceleration.
[0115] Specific steps: Use the client that is currently downloading the file as the seed end and pull the downloaded block data of the seed.
[0116] (3) Source of the second part of the data block in the second data block: CDN acceleration.
[0117] Specific steps: start a separate thread, request the server's CDN acceleration node through the Transmission Control Protocol (TCP) protocol, and pull the CDN block data.
[0118] (4) The source of the third data block in the second data block: mirror acceleration.
[0119] Specific steps: Query the mirror address of the same file in the backend service. Obtain the file data corresponding to the mirror address through HTTP request.
[0120] 4. Download block data: Obtain block data from different block sources in turn to ensure that all blocks of the file are downloaded.
[0121] 5. Merge block data: merge all downloaded block data into a complete file in sequence.
[0122] 6. Complete the download: After the download is complete, perform necessary verification and processing to ensure the integrity and correctness of the file.
[0123] Through the above method, multiple resources can be effectively utilized, including original sites, P2P acceleration, CDN services and backend service storage, to improve the efficiency and speed of file downloading.
[0124] Reference Figure 4 , Figure 4 This is a flow chart of the third embodiment of the method for downloading files of the present application. Based on the above embodiments, the third embodiment of the method for downloading files of the present application is proposed.
[0125] In the second embodiment, the step S20 includes:
[0126] Step S201: select multiple original acceleration nodes from the original acceleration node cluster, and construct a download thread corresponding to each original acceleration node.
[0127] It should be understood that in order to further improve the download speed, in this embodiment, the first data block can be downloaded by requesting data in blocks and multiple threads. The original acceleration node can refer to a specific server or node in the original acceleration node cluster. The download thread can refer to an independent execution path or process for executing a download task in computer programming.
[0128] Step S202: downloading the first data block from the original download site corresponding to the file to be downloaded through multiple download threads based on the multiple original acceleration nodes.
[0129] In a specific implementation, in order to increase the download speed, multiple original acceleration nodes may be selected from the original acceleration node cluster, and a download thread may be created for each original acceleration node. The first data block may be downloaded in parallel from the multiple original acceleration nodes through the created download threads.
[0130] This embodiment downloads the first data block by using a block-by-block multi-threaded data request method, thereby further improving the download speed.
[0131] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the method for downloading the documents of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0132] This application also provides a file download device, please refer to Figure 5 , the file downloading device comprises:
[0133] A data partitioning module 10, configured to partition the data to be downloaded corresponding to the file to be downloaded into a first data block and a second data block in response to a file download request;
[0134] A first downloading module 20, configured to download the first data block from an original downloading site corresponding to the file to be downloaded through an original acceleration node cluster;
[0135] A second downloading module 30, configured to download the second data block from other data sources through a smart acceleration node cluster, wherein the other data sources are data sources other than the original download site;
[0136] The data assembling module 40 is used to assemble the first data block and the second data block to obtain a download completion file.
[0137] The file download device provided by the present application adopts the file download method in the above embodiment, which can solve the technical problem that the existing file download method is usually to download separately through the network process of the browser, and the download speed is limited, thus there are defects such as slow download speed and poor user experience. Compared with the prior art, the beneficial effects of the file download device provided by the present application are the same as the beneficial effects of the file download method provided by the above embodiment, and other technical features in the file download device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0138] The present application provides a file downloading device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the file downloading method in the above-mentioned embodiment 1.
[0139] Reference below Figure 6 , which shows a schematic diagram of the structure of a file download device suitable for implementing the embodiment of the present application. The file download device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The file downloading device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0140] like Figure 6As shown, the file download device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a ROM (Read Only Memory) 1002 or a program loaded from a storage device 1003 to a RAM (Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the file download device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, an LCD (Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the file download device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a file download device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0141] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0142] The file download device provided by the present application adopts the file download method in the above embodiment, which can solve the technical problem that the existing file download method is usually to download separately through the network process of the browser, and the download speed is limited, thus there are defects such as slow download speed and poor user experience. Compared with the prior art, the beneficial effects of the file download device provided by the present application are the same as the beneficial effects of the file download method provided by the above embodiment, and other technical features in the file download device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0143] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0144] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0145] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the file downloading method in the above-mentioned embodiment.
[0146] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory) or flash memory, optical fiber, CD-ROM (CD-Read Only Memory, portable compact disk read-only memory), optical storage device, magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0147] The computer-readable storage medium may be included in the file downloading device; or may exist independently without being assembled into the file downloading device.
[0148] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the file downloading device, the file downloading device executes the file downloading method.
[0149] The computer program code for performing the operation of the present application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a LAN (Local Area Network) or a WAN (Wide Area Network), or it can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).
[0150] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0151] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0152] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned file download method, and can solve the technical problem that the existing file download method is usually downloaded separately through the network process of the browser, and the download speed is limited, so there are defects such as slow download speed and poor user experience. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the file download method provided by the above-mentioned embodiment, and will not be repeated here.
[0153] The present application also provides a computer program product, including a computer program, which implements the above-mentioned file downloading method when executed by a processor.
[0154] The computer program product provided by the present application can solve the technical problem that the existing file downloading method is usually to download separately through the network process of the browser, and the download speed is limited, resulting in the defects of slow download speed and poor user experience. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the file downloading method provided by the above embodiment, and will not be repeated here.
[0155] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
[0156] The present application discloses A1, a file downloading method, the file downloading method comprising:
[0157] In response to a file download request, dividing the to-be-downloaded data corresponding to the to-be-downloaded file into a first data block and a second data block;
[0158] Downloading the first data block from the original download site corresponding to the file to be downloaded through the original acceleration node cluster;
[0159] Downloading the second data block from other data sources through a smart acceleration node cluster, wherein the other data sources are data sources other than the original download site;
[0160] The first data block and the second data block are assembled to obtain a download completion file.
[0161] A2. The file downloading method as described in A1, wherein the downloading of the second data block from other data sources by using the intelligent acceleration node cluster comprises:
[0162] Selecting a download acceleration method through an intelligent acceleration node cluster, wherein the download acceleration method includes at least one of peer-to-peer network acceleration, content distribution network acceleration, and mirror acceleration;
[0163] The second data block is downloaded from the corresponding data source based on the download acceleration method.
[0164] A3. The file downloading method as described in A2, wherein the download acceleration method is peer-to-peer network acceleration; and downloading the second data block from the corresponding data source based on the download acceleration method comprises:
[0165] Acquire the current download data of each node in the peer-to-peer network, and match the data to be downloaded with the current download data of each node;
[0166] A peer node is selected from the peer network according to the matching result, and the first data block is downloaded through the peer node.
[0167] A4. The file downloading method as described in A2, wherein the download acceleration method is content distribution network acceleration; and downloading the second data block from the corresponding data source based on the download acceleration method comprises:
[0168] Request a content distribution network acceleration node;
[0169] The second data block is downloaded through the content distribution network acceleration node.
[0170] A5. The file downloading method as described in A4, wherein the requesting a content distribution network acceleration node comprises:
[0171] Creating an independent thread, and requesting the content distribution network service for the content distribution network node information corresponding to the file to be downloaded through the independent thread;
[0172] A content distribution network node is selected based on the content distribution network node information.
[0173] A6. The file downloading method as described in A2, wherein the download acceleration mode is mirror acceleration; and downloading the second data block from the corresponding data source based on the download acceleration mode comprises:
[0174] Searching in the backend service whether there is a target file that is the same as the file to be downloaded;
[0175] Obtain a mirror address of the target file, and download the second data block through the mirror address.
[0176] A7. The file downloading method as described in any one of A1 to A6, wherein downloading the first data block from the original download site corresponding to the file to be downloaded by using the original acceleration node cluster comprises:
[0177] Select multiple original acceleration nodes from the original acceleration node cluster, and build download threads corresponding to each original acceleration node;
[0178] The first data block is downloaded from the original download site corresponding to the file to be downloaded through multiple download threads based on the multiple original acceleration nodes.
[0179] A8. The file downloading method as described in any one of A1 to A6, wherein the assembling of the first data block and the second data block to obtain the downloaded file comprises:
[0180] Filling the first data block and the second data block into the file to be downloaded to obtain filled data blocks;
[0181] The filled data blocks are assembled in a preset order to obtain a download completion file.
[0182] A9. The file downloading method as described in A8, wherein the filled data blocks are assembled in a preset order to obtain a downloaded file, comprising:
[0183] Verifying the filled data block to obtain a verified data block;
[0184] The verified data blocks are assembled according to a preset order to obtain a download completion file.
[0185] A10. The file downloading method as described in A9, wherein the checking of the filled data blocks to obtain the data blocks that pass the check comprises:
[0186] Comparing the data characteristics of the filled data block with the data characteristics of the file to be downloaded;
[0187] The filled data block is verified according to the comparison result to obtain a data block that passes the verification.
[0188] A11. The file downloading method as described in any one of A1 to A6, wherein after assembling the first data block and the second data block to obtain the downloaded file, the method further comprises:
[0189] Generate a download completion notification corresponding to the downloaded file, and display the download completion notification;
[0190] Obtain a temporary file corresponding to the downloaded file, and clean up the temporary file.
[0191] The present application also discloses B12, a file downloading device, the file downloading device comprising:
[0192] A data partitioning module, configured to, in response to a file download request, partition the data to be downloaded corresponding to the file to be downloaded into a first data block and a second data block;
[0193] A first downloading module, configured to download the first data block from an original downloading site corresponding to the file to be downloaded through an original acceleration node cluster;
[0194] A second downloading module, configured to download the second data block from other data sources through a smart acceleration node cluster, wherein the other data sources are data sources other than the original download site;
[0195] The data assembly module is used to assemble the first data block and the second data block to obtain a download completion file.
[0196] B13. In the file downloading device as described in B12, the second download module is further used to select a download acceleration method through an intelligent acceleration node cluster, wherein the download acceleration method includes at least one of peer-to-peer network acceleration, content distribution network acceleration and mirror acceleration; and download the second data block from the corresponding data source based on the download acceleration method.
[0197] B14. A file download device as described in B13, wherein the download acceleration method is peer-to-peer network acceleration; the second download module is also used to obtain the current download data of each node in the peer-to-peer network, and match the data to be downloaded with the current download data of each node; select a peer node from the peer network according to the matching result, and download the first data block through the peer node.
[0198] B15. In the file downloading device as described in B13, the download acceleration method is content distribution network acceleration; the second download module is also used to request a content distribution network acceleration node; and download the second data block through the content distribution network acceleration node.
[0199] B16. In the file downloading device as described in B15, the second downloading module is further used to create an independent thread, and request the content distribution network service for content distribution network node information corresponding to the file to be downloaded through the independent thread; and select a content distribution network node based on the content distribution network node information.
[0200] B17. In the file downloading device as described in B13, the download acceleration method is mirror acceleration; the second download module is also used to search in the backend service whether there is a target file that is the same as the file to be downloaded; obtain the mirror address of the target file, and download the second data block through the mirror address.
[0201] The present application also discloses C18, a file downloading device, which includes: a memory, a processor, and a file downloading program stored in the memory and executable on the processor, wherein the file downloading program implements the file downloading method described above when executed by the processor.
[0202] The present application also discloses D19, a storage medium, on which a file download program is stored, and when the file download program is executed by a processor, the file download method as described above is implemented.
[0203] The present application also discloses E20, a computer program product, which includes a file downloading program, and when the file downloading program is executed by a processor, the file downloading method as described above is implemented.
Claims
1. A file downloading method, characterized in that: The file downloading method comprises: In response to a file download request, dividing the to-be-downloaded data corresponding to the to-be-downloaded file into a first data block and a second data block; Downloading the first data block from the original download site corresponding to the file to be downloaded through the original acceleration node cluster; Downloading the second data block from other data sources through a smart acceleration node cluster, wherein the other data sources are data sources other than the original download site; The first data block and the second data block are assembled to obtain a download completion file.
2. The file downloading method according to claim 1, characterized in that: The downloading of the second data block from other data sources by using the intelligent acceleration node cluster includes: Selecting a download acceleration method through an intelligent acceleration node cluster, wherein the download acceleration method includes at least one of peer-to-peer network acceleration, content distribution network acceleration, and mirror acceleration; The second data block is downloaded from the corresponding data source based on the download acceleration method.
3. The file downloading method according to claim 2, characterized in that: The download acceleration method is peer-to-peer network acceleration; and downloading the second data block from a corresponding data source based on the download acceleration method includes: Acquire the current download data of each node in the peer-to-peer network, and match the data to be downloaded with the current download data of each node; A peer node is selected from the peer network according to the matching result, and the first data block is downloaded through the peer node.
4. The file downloading method according to claim 2, characterized in that: The download acceleration method is content distribution network acceleration; and downloading the second data block from the corresponding data source based on the download acceleration method includes: Request a content distribution network acceleration node; The second data block is downloaded through the content distribution network acceleration node.
5. The file downloading method according to claim 4, characterized in that: The request content distribution network acceleration node includes: Creating an independent thread, and requesting the content distribution network service for the content distribution network node information corresponding to the file to be downloaded through the independent thread; A content distribution network node is selected based on the content distribution network node information.
6. The file downloading method according to claim 2, characterized in that: The download acceleration method is mirror acceleration; and downloading the second data block from the corresponding data source based on the download acceleration method includes: Searching in the backend service whether there is a target file that is the same as the file to be downloaded; Obtain a mirror address of the target file, and download the second data block through the mirror address.
7. A file downloading device, characterized in that: The file downloading device comprises: A data partitioning module, configured to, in response to a file download request, partition the data to be downloaded corresponding to the file to be downloaded into a first data block and a second data block; A first downloading module, configured to download the first data block from an original downloading site corresponding to the file to be downloaded through an original acceleration node cluster; A second downloading module, configured to download the second data block from other data sources through a smart acceleration node cluster, wherein the other data sources are data sources other than the original download site; The data assembly module is used to assemble the first data block and the second data block to obtain a download completion file.
8. A file downloading device, characterized in that: The file downloading device comprises: a memory, a processor, and a file downloading program stored in the memory and executable on the processor, wherein the file downloading program implements the file downloading method according to any one of claims 1 to 6 when executed by the processor.
9. A storage medium, characterized in that: The storage medium stores a file downloading program, and when the file downloading program is executed by the processor, the file downloading method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product comprises a file downloading program, and when the file downloading program is executed by a processor, the file downloading method according to any one of claims 1 to 6 is implemented.