A file downloading method and system in an Internet system

By adopting a shared download strategy in the Internet system, the source file is fragmented and pushed to the message queue, and the client merges the download fragments, which solves the problems of large file download bandwidth usage and low efficiency in the existing technology, and achieves efficient file download. and cluster scalability.

CN114500499BActive Publication Date: 2024-09-17SINA TECH (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111637543.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2024-09-17
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

File download solutions in existing Internet systems occupy a lot of bandwidth resources and have low download efficiency. Especially when the cluster expands and the number of files increases, the bandwidth pressure on the source server is high, leading to bottleneck problems.

Method used

A shared download strategy is adopted to fragment the source file and push it to the message queue. The client decides whether to download and merge the fragments based on the file attributes to achieve file sharing, reduce source bandwidth consumption and improve download efficiency.

Benefits of technology

It effectively solves the bandwidth pressure problems caused by source server bandwidth limitations and cluster expansion, improves download efficiency, simplifies download policy configuration, and improves the scalability and reliability of the download system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114500499B
    Figure CN114500499B
Patent Text Reader

Abstract

This invention provides a file download method and system within an internet system, comprising: pushing the file attributes of the latest version of a source file to a message queue in the form of messages; a client subscribing to messages in the message queue and retrieving file attribute messages from the message queue; wherein the categories of the file attributes include: source file attributes and file sharing fragment attributes, wherein file sharing fragments refer to dividing the source file into fragments and sharing these fragments for download by other clients; the client determining whether to download the corresponding source file based on the retrieved file attributes, and when it is determined to download the file attributes, this can effectively reduce source bandwidth consumption and improve cluster download efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet, and in particular to a method and system for downloading files in an Internet system. Background Art

[0002] At present, a large number of large files need to be downloaded between applications in the Internet system: algorithm models, feature vectors, text indexes, etc. With the development of business, clusters are getting larger and larger, and the amount of data is getting larger and larger. The bandwidth and download time occupied by the data to be downloaded are getting larger and larger. At the same time, applications require more efficient downloading of these files. The existing file download solutions are all for fixed files from source to client, which occupies a lot of bandwidth resources and has low download efficiency. Summary of the invention

[0003] The embodiment of the present invention provides a file downloading method and system in an Internet system. The shared download strategy can effectively reduce source bandwidth consumption, improve cluster download efficiency, effectively solve the bottleneck caused by source server bandwidth limitation, and effectively solve the problem of high source server bandwidth pressure caused by cluster expansion and more downloaded files.

[0004] To achieve the above object, on the one hand, an embodiment of the present invention provides a method for downloading files in an Internet system, comprising:

[0005] Push the file attributes of the latest version of the source file to the message queue in the form of a message;

[0006] The client subscribes to the message in the message queue and obtains the file attribute message from the message queue; wherein the file attribute categories include: source file attribute and file sharing fragment attribute, wherein the file sharing fragment refers to fragmenting the source file and sharing the fragment to be downloaded by other clients;

[0007] The client determines whether to download the corresponding source file according to the acquired file attributes, and when it is determined to download the source file corresponding to the file attributes, downloads the source file; the downloading of the source file specifically includes:

[0008] When the acquired file attribute is a file sharing slice attribute, the client downloads all file sharing slices of the source file corresponding to the file sharing slice from the port of the device that pushes the file sharing slice attribute message according to the file sharing slice attribute; merges all the file sharing slices to form a source file, and uses the formed source file for the application program of the network resource managed by the client; wherein, there are multiple clients in the same Internet system, each client is in charge of a preset number of network resources allocated to it, and downloads the latest version of the source file for the network resource it is in charge of; the device includes: a file source end and other clients, and the file source end refers to the client that initially provides the source file;

[0009] When the acquired file attribute is a source file attribute, and the source file attribute does not set the source file to have a sharing attribute, the client downloads the source file from the file source, and uses the source file for the application program of the network resource managed by the client;

[0010] When the acquired file attribute is a source file attribute, and the source file is set to have a shared attribute in the source file attribute, the file sharing segment attribute message of the source file is searched for in the message queue, and the client downloads all the file sharing segments of the source file from the port of the device that pushes the file sharing segment attribute message; all the file sharing segments are merged to form a source file, and the formed source file is used for the application program of the network resources managed by the client.

[0011] On the other hand, an embodiment of the present invention provides a file downloading system in an Internet system.

[0012] In the same Internet system, multiple clients are provided, each client is responsible for a preset number of network resources allocated to it, and downloads the latest version of the source file for the network resources it is responsible for; the file download system includes a file attribute push unit arranged at the file source end, a file attribute acquisition unit and a download unit arranged at the client end, and the file source end refers to the client end that initially provides the source file, wherein:

[0013] A file attribute push unit, used to push the file attributes of the latest version of the source file to the message queue in the form of a message;

[0014] A file attribute acquisition unit, used for subscribing to messages in a message queue and acquiring file attribute messages from the message queue; wherein the categories of the file attributes include: source file attributes and file sharing fragment attributes, wherein the file sharing fragment refers to fragmenting a source file and sharing the fragments to be downloaded by other clients;

[0015] A download unit is used to determine whether to download a corresponding source file according to the acquired file attributes, and after determining to download a source file corresponding to the file attribute, download the source file; the download unit specifically includes:

[0016] The first download unit is used for, when the acquired file attribute is a file sharing segment attribute, downloading all file sharing segments of the source file corresponding to the file sharing segment from the port of the device that pushes the file sharing segment attribute message according to the file sharing segment attribute; merging all the file sharing segments to form a source file, and using the formed source file for the application program of the network resource managed by the client; the device includes: a file source end and other clients;

[0017] A second downloading unit is used to download the source file from the file source end when the acquired file attribute is a source file attribute and the source file attribute does not set the source file to have a sharing attribute, and use the source file for the application program of the network resource managed by the client end;

[0018] The third download unit is used to search for the file sharing segment attributes of the source file from the message queue when the acquired file attribute is the source file attribute and the source file is set to have sharing attributes in the source file attributes; download all the file sharing segments of the source file from the port of the device that pushes the file sharing segment attribute message according to the found file sharing segment attributes of the source file; merge all the file sharing segments to form a source file, and use the formed source file for the application program of the network resources managed by the client.

[0019] The above technical solution has the following beneficial effects: the shared download strategy can effectively reduce source bandwidth consumption, improve cluster download efficiency, effectively solve the bottleneck caused by source server bandwidth limitation, and effectively solve the problem of high source server bandwidth pressure caused by cluster expansion and more downloaded files. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention 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, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 is a flow chart of a method for downloading files in an Internet system according to an embodiment of the present invention;

[0022] Figure 2 is a structural diagram of a file downloading system in an Internet system according to an embodiment of the present invention;

[0023] Figure 3 is a flow chart of a file downloading method in another Internet system according to an embodiment of the present invention;

[0024] Figure 4 It is a step-by-step flow chart of a method for downloading files in an Internet system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] like Figure 1 As shown, in combination with an embodiment of the present invention, a method for downloading files in an Internet system is provided, comprising:

[0027] S101: Pushing the file attributes of the latest version of the source file to a message queue in the form of a message;

[0028] S102: The client subscribes to messages in a message queue, and obtains file attribute messages from the message queue; wherein the file attribute categories include: source file attributes, and file sharing fragment attributes, wherein the file sharing fragment refers to fragmenting the source file and sharing the fragments to be downloaded by other clients;

[0029] S103: The client determines whether to download the corresponding source file according to the acquired file attributes. When it is determined to download the source file corresponding to the file attributes, the source file is downloaded. The downloading of the source file specifically includes:

[0030] S1031: When the acquired file attribute is a file sharing slice attribute, the client downloads all file sharing slices of the source file corresponding to the file sharing slice from the port of the device that pushes the file sharing slice attribute message according to the file sharing slice attribute; merges all the file sharing slices to form a source file, and uses the formed source file for the application program of the network resource managed by the client; wherein, there are multiple clients in the same Internet system, each client is in charge of a preset number of network resources allocated to it, and downloads the latest version of the source file for the network resource it is in charge of; the device includes: a file source end and other clients, and the file source end refers to the client that initially provides the source file;

[0031] S1032: When the acquired file attribute is a source file attribute, and the source file attribute does not set the source file to have a sharing attribute, the client downloads the source file from the file source, and uses the source file for the application program of the network resource managed by the client;

[0032] S1033: When the acquired file attribute is a source file attribute, and the source file is set to have a sharing attribute in the source file attribute, the file sharing segment attribute message of the source file is searched in the message queue, and the client downloads all the file sharing segments of the source file from the port of the device that pushes the file sharing segment attribute message; all the file sharing segments are merged to form a source file, and the formed source file is used for the application program of the network resources managed by the client.

[0033] Preferably, it also includes:

[0034] S104: configuring and writing policies on the policy setting page of the policy center, wherein the policies include: the source file identifier to be downloaded by the client, the execution cycle for the client to download the source file, the download method provided for the client, and whether to set the sharing attribute of the source file, wherein the download method provided for the client includes at least one of the following: http protocol, rsync protocol, and P2P protocol.

[0035] Preferably, in step 101, pushing the file attributes of the latest version of the source file to the message queue in the form of a message specifically includes:

[0036] S1011: The file source obtains the policy of the policy center. When the latest version of the source file to be downloaded by the client is available in the policy, the latest version of the source file to be downloaded by the client is generated into a file attribute; the generated file attribute is pushed to the message queue in the form of a message; wherein,

[0037] If the source file meets the sharing requirement, the source file attribute is set when configuring the policy, and the source file is set to have a sharing attribute, the file source end generates a source file attribute with a sharing attribute for the source file; and the file source end slices the source file into multiple file sharing slices, and generates a corresponding file sharing slice attribute for each file sharing slice;

[0038] If the source file does not meet the sharing requirement, the source file attributes are directly generated when configuring the policy, and the source file attributes do not set the source file to have sharing attributes. The file source generates source file attributes without setting sharing attributes for the source file.

[0039] The file downloading method in the Internet system further includes:

[0040] S105: When the acquired file attribute is a source file attribute and the source file is set to have a sharing attribute in the source file attribute, the file sharing segment attribute message of the source file is searched from the message queue. After the client downloads all the file sharing segments of the source file from the port of the device that pushes the file sharing segment attribute message, the client forms respective file sharing segment attributes for all the downloaded file sharing segments, and pushes the generated file sharing segment attributes to the message queue in the form of a message.

[0041] Preferably, in step 103, the downloading process of the source file specifically includes:

[0042] S1034: When the acquired file attribute is a source file attribute, and the source file attribute is set to have a sharing attribute, but the file sharing segment attribute message of the source file is not found in the message queue, the client downloads the source file from the file source according to the source file attribute, and uses the source file for the application program of the network resource managed by the client;

[0043] S1035: After the client downloads the source file from the file source according to the source file attributes, the file source segments the source file downloaded by the client into multiple file sharing segments, and the file source generates respective file sharing segment attributes for all the file sharing segments, and pushes the generated file sharing segment attributes to the message queue in the form of messages.

[0044] Preferably, the downloading process of the source file specifically includes:

[0045] S106: After determining to download the source file corresponding to the file attribute, the client integrates the source file identifier corresponding to the file attribute and the selected download method to form a download command, and writes the download command into a message queue; any device where the source file is located or any device where the file sharing segment is located obtains the client's download command from the message queue, and provides the client with the download of the source file or the file sharing segment according to the source file identifier included in the download command and the selected download method; wherein, when the source file has a shared attribute, any device where the file sharing segment is located preferentially obtains the client's download command from the message queue.

[0046] Preferably, it also includes:

[0047] S107: after the client completes downloading the source file, the download information of the source file is written into the message queue; or after the client completes downloading the file sharing segment, the download information of the file sharing segment is written into the message queue;

[0048] S108: The client obtains the download information of the source file or the download information of the file sharing segment from the message queue for display.

[0049] like Figure 2 As shown, in combination with an embodiment of the present invention, a file download system in an Internet system is provided, wherein a plurality of clients are provided in the same Internet system, each client is responsible for a preset number of network resources allocated to it, and downloads the latest version of the source file for the network resources it is responsible for; the file download system comprises a file attribute push unit arranged at a file source end, a file attribute acquisition unit and a download unit arranged at a client end, the file source end refers to a client end that initially provides a source file, wherein:

[0050] The file attribute push unit 21 is used to push the file attributes of the latest version of the source file to the message queue in the form of a message;

[0051] The file attribute acquisition unit 22 is used to subscribe to the messages in the message queue and acquire the file attribute messages from the message queue; wherein the file attribute categories include: source file attribute and file sharing fragment attribute, wherein the file sharing fragment refers to fragmenting the source file and sharing the fragment to be downloaded by other clients;

[0052] The download unit 23 is used to determine whether to download the corresponding source file according to the acquired file attributes, and after determining to download the source file corresponding to the file attribute, download the source file; the download unit specifically includes:

[0053] The first downloading unit 231 is used for, when the acquired file attribute is a file sharing segment attribute, downloading all file sharing segments of the source file corresponding to the file sharing segment from the port of the device that pushes the file sharing segment attribute message according to the file sharing segment attribute; merging all the file sharing segments to form a source file, and using the formed source file for the application program of the network resource managed by the client; the device includes: a file source terminal and other clients;

[0054] The second downloading unit 232 is used to download the source file from the file source when the acquired file attribute is a source file attribute and the source file attribute does not set the source file to have a sharing attribute, and use the source file for the application program of the network resource managed by the client;

[0055] The third download unit 233 is used for searching the file sharing slice attribute of the source file from the message queue when the acquired file attribute is the source file attribute and the source file is set to have a sharing attribute in the source file attribute; downloading all the file sharing slices of the source file from the port of the device that pushes the file sharing slice attribute message according to the found file sharing slice attribute of the source file; merging all the file sharing slices into a source file, and using the formed source file for the application of the network resources managed by the client.

[0056] Preferably, the file downloading system further includes:

[0057] The policy configuration unit 24 is used to configure and write policies on the policy setting page of the policy center, wherein the policies include: the source file identifier to be downloaded by the client, the execution period for the client to download the source file, the download method provided for the client, and whether to set the sharing attribute of the source file, wherein the download method provided for the client includes at least one of the following: http protocol, rsync protocol, and P2P protocol.

[0058] Preferably, the file attribute pushing unit 21 includes:

[0059] The first file attribute push unit 211 is used to obtain the policy of the policy center. When the policy center has the latest version of the source file to be downloaded by the client, the latest version of the source file to be downloaded by the client is generated into a file attribute; the generated file attribute is pushed to the message queue in the form of a message; wherein,

[0060] If the source file meets the sharing requirement, the source file attribute is set when configuring the policy, and the source file attribute is set to have a sharing attribute, then a source file attribute with a sharing attribute is generated for the source file; and the source file is sliced ​​to form a plurality of file sharing slices, and a corresponding file sharing slice attribute is generated for each file sharing slice;

[0061] If the source file does not meet the sharing requirement, the source file attributes are directly generated when configuring the policy, and the source file attributes do not set the source file to have sharing attributes, then source file attributes without sharing attributes are generated for the source file;

[0062] The download fee is 23 yuan, and also includes:

[0063] The second file attribute pushing unit 234 is used to generate respective file sharing segment attributes for all downloaded file sharing segments after the third downloading unit is executed, and push the generated file sharing segment attributes to the message queue in the form of a message.

[0064] Preferably, the file attribute pushing unit includes a third file attribute pushing unit 212, wherein:

[0065] The third downloading unit 233 is further configured to download the source file from the file source end according to the source file attribute when the acquired file attribute is a source file attribute and the source file attribute is set to have a sharing attribute, but the file sharing segment attribute of the source file is not found in the message queue, and use the source file for the application program of the network resource managed by the client;

[0066] The third file attribute pushing unit 212 is used to segment the source file downloaded by the client into multiple file sharing segments after the client downloads the source file from the source end of the file according to the source file attributes, and generate respective file sharing segment attributes for all the file sharing segments; and push the file sharing segment attributes generated by the segmentation unit to the message queue in the form of messages.

[0067] Preferably, the download unit 23 includes a download command generating unit 234, wherein:

[0068] The download command generating unit 234 is used for integrating the source file identifier of the file attribute and the selected download mode to form a download command after determining to download the source file corresponding to the file attribute, and writing the download command into the message queue;

[0069] Any device where the source file is located or any device where the file sharing segment is located is provided with a download command processing unit 235, which is used to obtain the client's download command from the message queue, and provide the client with the download of the source file or the file sharing segment according to the source file identifier contained in the download command and the selected download method; wherein, when the source file has a shared attribute, any device where the file sharing segment is located gives priority to obtaining the client's download command from the message queue.

[0070] Preferably, the client is also provided with a download information feedback unit and a display unit, wherein:

[0071] The download information feedback unit 26 is used to write the download information of the source file into the message queue after the download of the source file is completed; or, after the download of the file sharing segment is completed, write the download information of the file sharing segment into the message queue;

[0072] The display unit 27 is used to obtain the download information of the source file or the download information of the file sharing segment from the message queue for display.

[0073] The beneficial effects achieved by the present invention are as follows:

[0074] This system has greatly improved the scalability of the download system through modular design and flexible configuration, and simplified the configuration of download strategies, which can adapt to the environment of multiple file downloads and changing file download tasks. In addition, multiple protocols are allowed to be downloaded in the download strategy configuration, which effectively improves the download reliability.

[0075] First: The shared download strategy can effectively reduce source bandwidth consumption, improve cluster download efficiency, effectively solve the bottleneck caused by source server bandwidth limitations, and effectively solve the problem of high source server bandwidth pressure caused by cluster expansion and more downloaded files.

[0076] Second: There are configurable policies, download files, and download status observation policy configurations. This can solve the problems of inconvenient changes in downloaded files, single download method, and unobservable download status.

[0077] Third: There is a message queue that can handle the communication of the entire cluster (all servers), solve the information sharing problem between download servers, and enable more efficient download and synchronization of information.

[0078] Fourth: There are various download protocols, which effectively prevents the failure of a single protocol from affecting file downloads. It is more reliable.

[0079] The above technical solution of the embodiment of the present invention is described in detail below in conjunction with specific application examples. For technical details not introduced during the implementation process, please refer to the relevant description in the previous text.

[0080] The technical terms and abbreviations involved in the present invention are defined as follows:

[0081] Policy configuration: The policy configuration in this article refers to the download policy of the download system: including the file source update cycle, the client download cycle (how long to check whether downloading is needed), the client download protocol selection, whether the client uses shared download, etc.

[0082] File source: The file source in this article refers to the server that produces files, provides source file updates and provides download methods using multiple protocols for clients to download files.

[0083] Client: The client in this article refers to the server that needs to download files. The client provides file download methods of multiple protocols and also provides file sharing download functions.

[0084] File sharing sharding: In this article, file sharing sharding refers to dividing a large file into smaller files, which are then downloaded and shared through the client sharing protocol.

[0085] The present invention is a method and system for centrally configuring multiple download modes to download index files, belonging to the technical field of centralized configuration, distributed download, and verification file download systems. The technical problems to be solved by the present invention are:

[0086] First point: Introduce message queues into the download architecture, write file download instructions, file download strategies (strategy configuration), file attributes, file sharing shard attributes, and file download status information back to the message queue, and the client performs unified scheduling communication through subscription.

[0087] Second point: The download system client supports http protocol, rsync protocol, and P2P protocol, integrates various download commands in the client, and selects the download method in the message queue.

[0088] Third point: The download system provides a unified message queue, and the synchronization information will be written back to the message queue to facilitate the display and observation of the download status. That is, the message queue carries the communication function of the entire system, and provides file source information writing: original file information (file size, file md5, file download method, number of file fragments, file fragment d5,) client download information (client file download status, client shared fragment information (client ip, client shared fragment number, client analysis fragment md5)), completing the communication function between the source and the client.

[0089] Fourth point: The download system provides file fragment sharing download between clients, and can share source file fragments between download nodes, effectively reducing the bandwidth pressure on the download source during the download process, which is conducive to improving download efficiency.

[0090] The technical solution of the present invention is described in detail as follows:

[0091] First, the overall technical flow chart is as follows Figure 3 As shown, this technical solution includes: policy configuration, file source, message queue, client, a total of 4 module units, which are executed in the order of numbers 1-12 in the figure.

[0092] Second, explanation of the functions of each module unit:

[0093] Policy configuration: The central configuration node provides download resource policy configuration functions, and provides functions for adding, modifying, deleting, and viewing download resource policies. There is only one operation entry.

[0094] File source: Provides file download capabilities for multiple download protocols, updates files according to configuration policies, and then pushes file attributes to the message queue.

[0095] Message queue: provides communication functions during the download process, including: file download strategy, file attributes, shard sharing attributes, file download status and other information.

[0096] Client: Responsible for the file download function, downloads files according to the update policy and download protocol of the policy center (configuration center), divides files into slices in the shared download mode, writes the file slice attributes into the message queue, and provides file slice shared download services.

[0097] Third, the step-by-step flowchart is as follows Figure 4 , explained as follows:

[0098] like Figure 4As shown in step 201, a policy is configured and written on the policy setting page of the policy center, wherein the policy includes: an identifier of a source file to be downloaded by the client, an execution cycle for the client to download the source file, a download method provided for the client, and whether to set a sharing attribute of the source file, wherein the download method provided for the client includes at least one of the following: http protocol, rsync protocol, and P2P protocol.

[0099] Specifically, the policy configuration module provides a page for updating policies and writes policy updates to the policy center. It is used to add, delete, modify, and query download policies. The policies that can be set include: the client's execution cycle, scheduling source (referring to the source file) and download method (referring to the download protocol), and provides functions such as policy query and executed policy query. A complete policy description is as follows: [

[0101] Id: The unique ID of the policy

[0102] Name: The artificial name of the strategy

[0103] Period: Strategy execution period

[0104] Method: Strategy checking method

[0105] Source: The source address of the policy

[0106] Backup: The backup resource address of the strategy

[0107] Status: Policy execution status

[0108] Enable: Whether it is executable

[0109] Protocol: Download protocol / download method

[0110] Createtime: Policy creation time

[0111] Updatatime: Policy modification time

[0112] Exectime: Strategy execution time ]

[0114] like Figure 4 As shown in step 202, the server obtains the policy configuration of the policy center, and performs source file update operations according to the client's download cycle for source file resources (client's download cycle for source files) and download protocol recorded by the policy center (configuration center).

[0115] like Figure 4As shown in step 203, the server writes the updated properties of the source file into the message queue for the client to download and verify (using an algorithm to see whether the md5 of the source file is the same as the file sharing segment). The file properties of the latest version of the source file are pushed to the message queue in the form of a message; wherein the categories of the file properties include: source file properties, file sharing segment properties, and the file sharing segment refers to segmenting the source file and sharing the segment for download by other clients. That is: the file source obtains the policy of the policy center, and when it has the latest version of the source file to be downloaded by the client, it generates file properties for the latest version of the source file to be downloaded by the client; the generated file properties are pushed to the message queue in the form of a message; wherein,

[0116] If the source file meets the sharing requirements, the source file attributes are set when configuring the policy, and the source file is set to have sharing attributes, the file source generates source file attributes with sharing attributes for the source file; and the file source segments the source file to form multiple file sharing segments, and generates corresponding file sharing segment attributes for each file sharing segment.

[0117] If the source file does not meet the sharing requirements, the source file attributes are directly generated when the policy is configured, and the source file attributes do not set the source file to have sharing attributes. The file source generates source file attributes without setting sharing attributes for the source file.

[0118] A complete message about the file's updated properties is described below: [

[0120] FileName: source file name

[0121] FileMd5sum: source file md5 information

[0122] FileCreatetime: file creation (update) time

[0123] FileSize: File size

[0124] Source: Shared source address ]

[0126] Among them, the attributes of the source file and the attributes of the shared file fragments are placed in different groups in the same queue; for example, one group specifically corresponds to the file size, and another group specifically corresponds to the file md5, etc.;

[0127] like Figure 4 As shown in step 204, the client subscribes to the message update in the message queue, obtains the strategy (policy configuration) of the downloaded file and the information of the downloaded file (obtains the file attribute message from the message queue).

[0128] The client determines whether to download the corresponding source file according to the acquired file attributes, and when it is determined to download the source file corresponding to the file attributes, downloads the source file; the downloading of the source file specifically includes:

[0129] When the acquired file attribute is a file sharing slice attribute, the client downloads all file sharing slices of the source file corresponding to the file sharing slice from the port of the device that pushes the file sharing slice attribute message according to the file sharing slice attribute; merges all the file sharing slices to form a source file, and uses the formed source file for the application program of the network resource in charge of the client; wherein, a plurality of clients are arranged in the same Internet system, each client is in charge of a preset number of network resources allocated to it, and downloads the latest version of the source file for the network resource in charge; the device comprises: a file source end and other clients, and the file source end refers to the client that initially provides the source file.

[0130] When the acquired file attribute is a source file attribute, and the source file attribute is not set to have a sharing attribute, the client downloads the source file from the file source, and uses the source file for an application program of the network resource managed by the client.

[0131] When the acquired file attribute is a source file attribute, and the source file is set to have a shared attribute in the source file attribute, the file sharing segment attribute message of the source file is searched for in the message queue, and the client downloads all the file sharing segments of the source file from the port of the device that pushes the file sharing segment attribute message; all the file sharing segments are merged to form a source file, and the formed source file is used for the application program of the network resources managed by the client.

[0132] When the acquired file attribute is a source file attribute, and the source file is set to have a sharing attribute in the source file attribute, the file sharing segment attribute message of the source file is searched from the message queue. After the client downloads all the file sharing segments of the source file from the port of the device that pushes the file sharing segment attribute message, the client forms respective file sharing segment attributes for all the downloaded file sharing segments, and pushes the generated file sharing segment attributes to the message queue in the form of a message.

[0133] When the acquired file attribute is a source file attribute, and the source file attribute is set to have a sharing attribute, but the file sharing segment attribute message of the source file is not found in the message queue, the client downloads the source file from the file source according to the source file attribute, and uses the source file for the application program of the network resource managed by the client;

[0134] After the client downloads the source file from the file source according to the source file attributes, the file source segments the source file downloaded by the client into multiple file sharing segments, and the file source generates respective file sharing segment attributes for all the file sharing segments, and pushes the generated file sharing segment attributes to the message queue in the form of messages.

[0135] like Figure 4 As shown in step 205, the client determines whether it needs to download the file according to the update message in the message queue; whether there is a shared file slice that can be downloaded. After determining to download the source file corresponding to the file attribute, the client integrates the source file identifier of the file attribute and the selected download method to form a download command, and writes the download command into the message queue; any device where the source file is located or any device where the file sharing slice is located obtains the client's download command from the message queue, and provides the client with the source file or the file sharing slice download according to the source file identifier contained in the download command and the selected download method; wherein, when the source file has a shared attribute, any device where the file sharing slice is located has priority to obtain the client's download command from the message queue.

[0136] Specifically: when deciding to download a source file, the client puts the download instruction into the message queue to obtain the download client. If the shared fragment cannot be obtained, it will go back to the source to download. That is, for any client, the strategy for obtaining shared fragments is the same, and the shared fragments are downloaded first. If not, it will go back to the source. The download command does not specify whether to download the shared fragment of the file or the unfragmented source file.

[0137] like Figure 4 As shown in step 206, the client downloads the file, and the client downloads the source file from the source.

[0138] like Figure 4 As shown in step 207, the client performs file sharing and processes the downloaded source file into slices. This facilitates sharing of slices to accelerate downloading. The client used is shared; there is a shared port on the client, and the client sharing process is to write the current slice information into the message queue. Other clients can download the slices from this client if they need to download. Each client that has downloaded the source file must share it to avoid bottlenecks and single points caused by only the first client using it sharing. Among them, the slice processing of the downloaded source file is completed uniformly on the source. If the file download is set to sharing mode, the source will slice the file, and then write the number of slices and the attributes of each file into the message queue for the client to download. After the client downloads, the downloaded file slices are shared. Of course, if there is no slice shared by the client, it will go to the source for download. After all slices are downloaded, each client assembles the file.

[0139] like Figure 4 As shown in step 208, the client writes the segment information back to the message queue to facilitate other clients to share and download. A complete message description is as follows: [

[0141] FileName: file name

[0142] FileMd5sum: source file md5 information

[0143] FileCreatetime: File creation time

[0144] FileSize: File size ]

[0146] like Figure 4 As shown in step 209, other clients obtain the shared download messages in the message queue.

[0147] like Figure 4 As shown in step 210, other clients perform shared downloading of file segments.

[0148] After the client completes downloading the source file, the download information of the source file is written into the message queue; or, after the client completes downloading the file sharing segment, the download information of the file sharing segment is written into the message queue. Figure 4 As shown in step 211, the shared segment download is completed, and the file download status is updated to the message queue. A complete message description is as follows: [

[0150] FileName: file name

[0151] FileMd5sum: file md5 information

[0152] FileCreatetime: File creation time

[0153] FileSize: File size

[0154] Source: client address ]

[0156] like Figure 4 As shown in step 212, the download status is displayed, and the file download status of all clients is read from the message queue to display the download status.

[0157] The beneficial effects achieved by the present invention are as follows:

[0158] This system has greatly improved the scalability of the download system through modular design and flexible configuration, and simplified the configuration of download strategies, which can adapt to the environment of multiple file downloads and changing file download tasks. In addition, multiple protocols are allowed to be downloaded in the download strategy configuration, which effectively improves the download reliability.

[0159] First: The system has a shared download strategy that can effectively reduce source bandwidth consumption, improve cluster download efficiency, effectively solve the bottleneck caused by source server bandwidth limitations, and effectively solve the problem of high source server bandwidth pressure caused by cluster expansion and more downloaded files.

[0160] Second: The system has configurable strategies, download files, and strategy configurations for observing download status. It can solve the problems of inconvenient changes in downloaded files, single download method, and unobservable download status.

[0161] Third: The system has a message queue that can handle the communication of the entire cluster (all servers), solve the information sharing problem between download servers, and enable more efficient download and synchronization of information.

[0162] Fourth: There are various download protocols, which effectively prevents the failure of a single protocol from affecting file downloads. It is more reliable.

[0163] It also avoids the technical defects of the prior art of "using the existing http protocol download solution to download from a unified http server":

[0164] First point: The current download solution has no distributed downloading, which occupies a lot of download source bandwidth, and bandwidth bottlenecks at the download source lead to low download efficiency.

[0165] Second point: The current download solution has no central communication means, which is not conducive to download cluster information synchronization. It is particularly troublesome to change the scenario when downloading multiple files or the downloaded files change frequently.

[0166] Third point: The current download solution has a single download protocol. If the source http service providing the download is abnormal, the download will fail.

[0167] Fourth point: With the current downloading solution, it is not easy to observe whether the download is successful, and it is impossible to judge the progress of the download.

[0168] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.

[0169] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.

[0170] The disclosed embodiments are described above to enable any person skilled in the art to implement or use the present invention. Various modifications of these embodiments are obvious to those skilled in the art, and the general principles defined herein may also be applied to other embodiments without departing from the spirit and scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments given herein, but is consistent with the broadest scope of the principles and novel features disclosed in this application.

[0171] The above description includes examples of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", just as "including," is explained as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".

[0172] Those skilled in the art may also understand that the various illustrative logical blocks, units, and steps listed in the embodiments of the present invention may be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly demonstrate the interchangeability of hardware and software, the various illustrative components, units, and steps described above have generally described their functions. Whether such functions are implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art may use various methods to implement the described functions for each specific application, but such implementation should not be understood as exceeding the scope of protection of the embodiments of the present invention.

[0173] The various illustrative logic blocks or units described in the embodiments of the present invention can be implemented or operated by a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of the above. The general-purpose processor can be a microprocessor, and optionally, the general-purpose processor can also be any conventional processor, controller, microcontroller or state machine. The processor can also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.

[0174] The steps of the method or algorithm described in the embodiments of the present invention can be directly embedded in the software module executed by the hardware, the processor, or the combination of the two. The software module can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM or other storage media of any form in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be arranged in an ASIC, and the ASIC can be arranged in a user terminal. Optionally, the processor and the storage medium can also be arranged in different components in the user terminal.

[0175] In one or more exemplary designs, the above functions described in the embodiments of the present invention can be implemented in hardware, software, firmware or any combination of the three. If implemented in software, these functions can be stored on a computer-readable medium, or transmitted in the form of one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media that facilitate the transfer of computer programs from one place to another. The storage medium can be any available medium that can be accessed by any general or special computer. For example, such computer-readable media can include but are not limited to RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that can be used to carry or store program codes in the form of instructions or data structures and other forms that can be read by general or special computers, or general or special processors. In addition, any connection can be appropriately defined as a computer-readable medium, for example, if the software is transmitted from a website site, server or other remote resource through a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wirelessly, such as infrared, wireless and microwave, it is also included in the defined computer-readable medium. The disk and disc include compact disk, laser disk, optical disk, DVD, floppy disk and blue-ray disk. Disks usually copy data magnetically, while discs usually copy data optically with lasers. The above combination can also be included in computer readable media.

[0176] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for downloading files in an Internet system, characterized in that: include: Push the file attributes of the latest version of the source file to the message queue in the form of a message; The client subscribes to the message in the message queue and obtains the file attribute message from the message queue; wherein the categories of the file attribute include: source file attribute, file sharing segment attribute; The client determines whether to download the corresponding source file according to the acquired file attributes, and when it is determined to download the source file corresponding to the file attributes, downloads the source file; the downloading of the source file specifically includes: When the acquired file attribute is a file sharing slice attribute, the client downloads all file sharing slices of the source file corresponding to the file sharing slice from the port of the device that pushes the file sharing slice attribute message according to the file sharing slice attribute; merges all the file sharing slices to form a source file, and uses the formed source file for the application program of the network resource in charge of the client; wherein, there are multiple clients in the same Internet system, each client is in charge of a preset number of network resources allocated to it, and downloads the latest version of the source file for the network resource in charge; the device is a file source terminal or other client; When the acquired file attribute is a source file attribute, and the source file attribute does not set the source file to have a sharing attribute, the client downloads the source file from the file source, and uses the source file for the application program of the network resource managed by the client; When the acquired file attribute is a source file attribute, and the source file attribute is set to have a sharing attribute, the file sharing segment attribute message of the source file is searched from the message queue, and the client downloads all the file sharing segments of the source file from the port of the device that pushes the file sharing segment attribute message. The client generates respective file sharing segment attributes for all the downloaded file sharing segments, and pushes the generated file sharing segment attributes to the message queue in the form of a message; all the file sharing segments are merged to form a source file, and the generated source file is used for the application program of the network resource managed by the client; The downloading process of the source file specifically includes: When the acquired file attribute is a source file attribute, and the source file attribute is set to have a sharing attribute, but the file sharing segment attribute message of the source file is not found in the message queue, the client downloads the source file from the file source according to the source file attribute, and uses the source file for the application program of the network resource managed by the client; After the client downloads the source file from the file source according to the source file attributes, the file source segments the source file downloaded by the client into multiple file sharing segments. The file source generates respective file sharing segment attributes for all file sharing segments, and pushes the generated file sharing segment attributes to the message queue in the form of messages.

2. The file downloading method in the Internet system according to claim 1, characterized in that: Also includes: Configure and write policies on the policy setting page of the policy center, wherein the policies include: the source file identifier to be downloaded by the client, the execution cycle for the client to download the source file, the download method provided for the client, and whether to set the sharing attribute of the source file, wherein the download method provided for the client includes at least one of the following: http protocol, rsync protocol, and P2P protocol.

3. The file downloading method in the Internet system according to claim 2, characterized in that: The method of pushing the file attributes of the latest version of the source file to the message queue in the form of a message specifically includes: The file source obtains the policy of the policy center. When the latest version of the source file to be downloaded by the client is available in the policy, the latest version of the source file to be downloaded by the client is generated into a file attribute; the generated file attribute is pushed to the message queue in the form of a message; wherein, If the source file meets the sharing requirement, the source file attribute is set when configuring the policy, and the source file is set to have a sharing attribute, the file source end generates a source file attribute with a sharing attribute for the source file; and the file source end slices the source file into multiple file sharing slices, and generates a corresponding file sharing slice attribute for each file sharing slice; If the source file does not meet the sharing requirements, the source file attributes are directly generated when the policy is configured, and the source file attributes do not set the source file to have sharing attributes. The file source generates source file attributes without setting sharing attributes for the source file.

4. The file downloading method in the Internet system according to claim 1, characterized in that: The downloading process of the source file specifically includes: After determining to download the source file corresponding to the file attribute, the client integrates the source file identifier corresponding to the file attribute and the selected download method to form a download command, and writes the download command into a message queue; Any device where the source file is located or any device where the file sharing segment is located obtains the client's download command from the message queue, and provides the client with the download of the source file or the file sharing segment according to the source file identifier contained in the download command and the selected download method; wherein, when the source file has a shared attribute, any device where the file sharing segment is located gives priority to obtaining the client's download command from the message queue.

5. The file downloading method in the Internet system according to claim 1, characterized in that: Also includes: After the client completes downloading the source file, the download information of the source file is written into the message queue; or, after the client completes downloading the file sharing segment, the download information of the file sharing segment is written into the message queue; The client obtains the download information of the source file or the download information of the file sharing segment from the message queue for display.

6. A file downloading system in an Internet system, characterized in that: In the same Internet system, multiple clients are provided, each client is responsible for a preset number of network resources allocated to it, and downloads the latest version of the source file for the network resources it is responsible for; the file download system includes a file attribute push unit arranged at the file source end, a file attribute acquisition unit and a download unit arranged at the client, wherein: A file attribute push unit, used to push the file attributes of the latest version of the source file to the message queue in the form of a message; The file attribute acquisition unit is used to subscribe to the message in the message queue and acquire the file attribute message from the message queue; wherein the file attribute categories include: source file attribute and file sharing slice attribute; A download unit is used to determine whether to download a corresponding source file according to the acquired file attributes, and after determining to download a source file corresponding to the file attribute, download the source file; the download unit specifically includes: The first download unit is used for, when the acquired file attribute is a file sharing segment attribute, downloading all file sharing segments of the source file corresponding to the file sharing segment from the port of the device that pushes the file sharing segment attribute message according to the file sharing segment attribute; merging all the file sharing segments to form a source file, and using the formed source file for the application program of the network resource managed by the client; the device is a file source terminal or other client; A second downloading unit is used to download the source file from the file source end when the acquired file attribute is a source file attribute and the source file attribute does not set the source file to have a sharing attribute, and use the source file for the application program of the network resource managed by the client end; A third downloading unit is used for, when the acquired file attribute is a source file attribute and the source file attribute is set to have a sharing attribute, searching for the file sharing segment attribute of the source file from the message queue, downloading all the file sharing segments of the source file from the port of the device that pushes the file sharing segment attribute message according to the found file sharing segment attribute of the source file; merging all the file sharing segments into a source file, and using the formed source file for the application program of the network resource managed by the client; A second file attribute pushing unit is used to generate respective file sharing segment attributes for all downloaded file sharing segments after the third downloading unit is executed, and push the generated file sharing segment attributes to a message queue in the form of a message; The file attribute pushing unit includes a third file attribute pushing unit, wherein: The third download unit is further configured to download the source file from the file source end according to the source file attribute when the acquired file attribute is a source file attribute and the source file attribute is set to have a sharing attribute, but the file sharing slice attribute of the source file is not found in the message queue, and use the source file for the application program of the network resource managed by the client; The third file attribute pushing unit is used to segment the source file downloaded by the client into multiple file sharing segments after the client downloads the source file from the source end of the file according to the source file attributes, and generate respective file sharing segment attributes for all the file sharing segments; and push the generated file sharing segment attributes to the message queue in the form of messages.

7. The file downloading system in the Internet system according to claim 6, characterized in that: The file downloading system also includes: The policy configuration unit is used to configure and write policies on the policy setting page of the policy center, wherein the policies include: the source file identifier to be downloaded by the client, the execution cycle of the client downloading the source file, the download method provided for the client, and whether to set the sharing attribute of the source file, wherein the download method provided for the client includes at least one of the following: http protocol, rsync protocol, and P2P protocol.

8. The file downloading system in the Internet system according to claim 7, characterized in that: The file attribute pushing unit includes: The first file attribute push unit is used to obtain the policy of the policy center, and when the latest version of the source file to be downloaded by the client in the policy is available, the latest version of the source file to be downloaded by the client is generated into a file attribute; and the generated file attribute is pushed to the message queue in the form of a message; wherein, If the source file meets the sharing requirement, the source file attribute is set when configuring the policy, and the source file attribute is set to have a sharing attribute, then a source file attribute with a sharing attribute is generated for the source file; and the source file is sliced ​​to form a plurality of file sharing slices, and a corresponding file sharing slice attribute is generated for each file sharing slice; If the source file does not meet the sharing requirement, the source file attributes are directly generated when the policy is configured, and the source file attributes do not set the sharing attribute of the source file, then the source file attributes without setting the sharing attribute are generated for the source file.

9. The file downloading system in the Internet system according to claim 6, characterized in that: The download unit also includes a download command generating unit: The download command generating unit is used for integrating the source file identifier corresponding to the file attribute and the selected download mode to form a download command after determining to download the source file corresponding to the file attribute, and writing the download command into the message queue; Any device where the source file is located or any device where the file sharing segment is located is provided with a download command processing unit, which is used to obtain the client's download command from the message queue, and provide the client with the download of the source file or the file sharing segment according to the source file identifier contained in the download command and the selected download method; wherein, when the source file has a shared attribute, any device where the file sharing segment is located gives priority to obtaining the client's download command from the message queue.

10. The file downloading system in the Internet system according to claim 6, characterized in that: The client is also provided with a download information feedback unit and a display unit, wherein: A download information feedback unit, used to write the download information of the source file into a message queue after the download of the source file is completed; Alternatively, after downloading the file sharing segment is completed, the download information of the file sharing segment is written into the message queue; The display unit is used to obtain the download information of the source file or the download information of the file sharing segment from the message queue for display.