The present disclosure discloses a method and a device for downloading a resource file, which belongs to data transmission technologies. The method is applied to a client in a peer-to-peer network, including: receiving a download request for a target resource file, and determining a data block download sequence of the target resource file (201); adjusting a download priority of each of the data blocks of the target resource file in real time according to the data block download sequence and a data block consumption progress of the target resource file (202); and downloading the data blocks of the target resource file through a plurality of download paths with different network qualities based on the adjusted download priority of each of the data blocks (203).
|
1. A method for downloading a resource file, applied to a client in a peer-to-peer network, comprising:
receiving a download request for a target resource file, and determining a data block download sequence of the target resource file;
adjusting a download priority of each of data blocks of the target resource file in real time according to the data block download sequence and a data block consumption progress of the target resource file; and
downloading the data blocks of the target resource file through a plurality of download paths based on the adjusted download priority of each of the data blocks; wherein
the plurality of download paths are distinguished according to different network qualities, and have pre-established correspondences to download priorities; and
downloading the data blocks of the target resource file through the plurality of download paths based on the adjusted download priority of each of the data blocks comprises:
determining a data download range corresponding to a respective one of the plurality of download paths according to the pre-established correspondences; and
downloading data blocks within the data download range through the respective one of the download paths.
18. A computer readable storage medium, wherein the storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to perform the following method:
receiving a download request for a target resource file, and determining a data block download sequence of the target resource file;
adjusting a download priority of each of data blocks of the target resource file in real time according to the data block download sequence and a data block consumption progress of the target resource file; and
downloading the data blocks of the target resource file through a plurality of download paths based on the adjusted download priority of each of the data blocks; wherein
the plurality of download paths are distinguished according to different network qualities, and have pre-established correspondences to download priorities; and
downloading the data blocks of the target resource file through the plurality of download paths based on the adjusted download priority of each of the data blocks comprises:
determining a data download range corresponding to a respective one of the plurality of download paths according to the pre-established correspondences; and
downloading data blocks within the data download range through the respective one of the download paths.
10. A client, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to perform the following method:
receiving a download request for a target resource file, and determining a data block download sequence of the target resource file;
adjusting a download priority of each of data blocks of the target resource file in real time according to the data block download sequence and a data block consumption progress of the target resource file; and
downloading the data blocks of the target resource file through a plurality of download paths based on the adjusted download priority of each of the data blocks; wherein
the plurality of download paths are distinguished according to different network qualities, and have pre-established correspondences to download priorities; and
downloading the data blocks of the target resource file through the plurality of download paths based on the adjusted download priority of each of the data blocks comprises:
determining a data download range corresponding to a respective one of the plurality of download paths according to the pre-established correspondences; and
downloading data blocks within the data download range through the respective one of the download paths.
2. The method according to
3. The method according to
adjusting the download priority of each of the data blocks of the target resource file in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as a data cache capacity and a network quality that correspond to each of the download paths.
4. The method according to
determining a data download window corresponding to each of the download paths in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as the data cache capacity corresponding to each of the download paths; and
setting different download priorities for the data blocks in different data download windows according to the network quality of each of the download paths.
5. The method according to
adjusting the download priority of each of the data blocks of the target resource file in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as a minimum consumption rate of the target resource file.
6. The method according to
setting a data block coverage area corresponding to each of preset download priorities according to the minimum consumption rate of the target resource file; and
adjusting the download priority of each of the data blocks of the target resource file in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as the data block coverage area.
7. The method according to
setting a priority increasing threshold corresponding to each of the download paths according to a data download speed of each of the download paths and a minimum consumption rate of the target resource file;
determining a data download range corresponding to each of the download paths based on the adjusted download priority of each of the data blocks and the network qualities of different download paths; and
selecting, for the data blocks within any one of data download ranges, a target download path based on the priority increasing threshold and a random number, and downloading the data blocks through the target download path.
8. The method according to
acquiring download configuration information of the target resource file from a preset configuration server in the peer-to-peer network, wherein the download configuration information comprises data block information and a minimum consumption rate of the target resource file and a data cache capacity corresponding to each of the download paths.
9. The method according to
downloading the data blocks of the target resource file through the plurality of download paths with the different network qualities based on the adjusted download priority of each of the data blocks and node load conditions corresponding to different download paths.
11. The client according to
12. The client according to
adjusting the download priority of each of the data blocks of the target resource file in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as a data cache capacity and a network quality that correspond to each of the download paths.
13. The client according to
determining a data download window corresponding to each of the download paths in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as the data cache capacity corresponding to each of the download paths; and
setting different download priorities for the data blocks in different data download windows according to the network quality of each of the download paths.
14. The client according to
adjusting the download priority of each of the data blocks of the target resource file in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as a minimum consumption rate of the target resource file.
15. The client according to
setting a data block coverage area corresponding to each of preset download priorities according to the minimum consumption rate of the target resource file; and
adjusting the download priority of each of the data blocks of the target resource file in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as the data block coverage area.
16. The client according to
setting a priority increasing threshold corresponding to each of the download paths according to a data download speed of each of the download paths and a minimum consumption rate of the target resource file;
determining a data download range corresponding to each of the download paths based on the adjusted download priority of each of the data blocks and the network qualities of different download paths; and
selecting, for the data blocks within any one of data download ranges, a target download path based on the priority increasing threshold and a random number, and downloading the data blocks through the target download path.
17. The client according to
acquiring download configuration information of the target resource file from a preset configuration server in a peer-to-peer network, wherein the download configuration information comprises data block information and a minimum consumption rate of the target resource file and a data cache capacity corresponding to each of the download paths.
|
The present disclosure is a continuation of PCT Patent Application No. PCT/CN2020/074959, filed Feb. 12, 2020, entitled “METHOD AND DEVICE FOR DOWNLOADING RESOURCE FILE,” which claims priority to Chinese Patent Application No. 201911319000.7, filed Dec. 19, 2019, entitled “METHOD AND DEVICE FOR DOWNLOADING RESOURCE FILE,” each of which is incorporated by reference herein in its entirety.
The present disclosure relates to data transmission technologies, and in particular, to a method and a device for downloading a resource file.
P2P (peer-To-peer) technology is a communication technology that performs data transmission based on a peer-to-peer network, which establishes a client-to-client direct communication mechanism. In the peer-to-peer network, each node serves not only as a client, but also as a server for other nodes. In order to reduce a load pressure of a CDN node and save traffic cost of a content delivery network (CDN), a scheme for transmitting data blocks of a resource file based on the peer-to-peer network has been introduced on the basis of a CDN system.
A CDN service provider may deploy in advance a large number of devices with good performance as super peer nodes in the peer-to-peer network in a distributed manner, or select some clients with preferable network quality and device performance as the super peer nodes. The super peer nodes may download and store the data blocks of the resource file from a CDN server in advance. In this way, the client may request a list of nodes from a Tracker server when a certain resource file needs to be acquired, and the Tracker server may feed back node information of the nodes (which may include normal peer nodes, super peer nodes and/or CDN nodes) that have stored corresponding resource files to the client. Thus, the client may select some of the nodes and establish data connection with these nodes, thereby acquiring the data blocks of the resource files stored thereon from these nodes.
The inventor finds that the existing technology at least has the following problems. The client usually selects the node according to a bandwidth state of a network line between each node before the client downloads the data block of the resource file through the CDN node, the super peer node and the normal peer node at the same time. In this way, on the one hand, a download efficiency of the resource file is greatly affected if the resource file stored on the selected node is incomplete. On the other hand, the client is more probable to select the CDN node or the super peer node to download the resource file, which leads to over-high load of the CDN node and the super peer node and long-term idleness of a large number of normal peer nodes, thereby resulting in a low resource utilization rate of the peer-to-peer network.
In order to solve the problems of the existing technology, embodiments of the present disclosure provide a method and a device for downloading a resource file, using the following technical solutions. In a first aspect, the method for downloading the resource file is provided, which is applied to a client in a peer-to-peer network, and the method includes:
receiving a download request for a target resource file, and determining a data block download sequence of the target resource file;
adjusting a download priority of each of data blocks of the target resource file in real time according to the data block download sequence and a data block consumption progress of the target resource file; and
downloading the data blocks of the target resource file through a plurality of download paths with different network qualities based on the adjusted download priority of each of the data blocks.
In a second aspect, the device for downloading the resource file is provided, which is applied to a peer-to-peer network, and the device includes:
a download preparation module, configured to receive a download request for a target resource file, and determine a data block download sequence of the target resource file;
a download adjustment module, configured to adjust a download priority of each of data blocks of the target resource file in real time according to the data block download sequence and a data block consumption progress of the target resource file; and
a download control module, configured to download the data blocks of the target resource file through a plurality of download paths with different network qualities based on the adjusted download priority of each of the data blocks.
In a third aspect, a client is provided, where the client includes a processor and a memory, the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to perform the method for downloading the resource file as described in the first aspect.
In a fourth aspect, a computer readable storage medium is provided, where the storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to perform the method for downloading the resource file as described in the first aspect.
The technical solutions provided by the embodiments of the present disclosure have the following beneficial effects. In the embodiments of the present disclosure, the download request for the target resource file is received, and the data block download sequence of the target resource file is determined; the download priority of each of the data blocks of the target resource file is adjusted in real time according to the data block download sequence and the data block consumption progress of the target resource file; and the data blocks of the target resource file are downloaded through the plurality of download paths with the different network qualities based on the adjusted download priority of each of the data blocks. In this way, when the client downloads the resource file using the P2P technology, different download priorities are configured for different data blocks, and then the download paths with the different network qualities are selected to download the resource file at the same time based on the download priority, so that the data download process of each of the download paths can be effectively controlled, which not only ensures a download efficiency of the resource file, but also improves a resource utilization rate of high-quality nodes in the peer-to-peer network.
In order to illustrate the technical solutions in the embodiments of the present disclosure more clearly, the attached drawings required in the description of the embodiments are briefly described below. It is apparent that the drawings described below are merely some embodiments of the present disclosure. For those of ordinary skills in the art, other drawings may also be obtained based on these drawings without any creative works.
In order to make the objectives, technical solutions, and advantages of the present disclosure more clear, the embodiments of the present disclosure are described in detail in combination with the accompanying drawings hereafter.
An embodiment of the present disclosure provides a method for downloading a resource file, which may be applied to a client in a peer-to-peer network and specifically executed by a SDK auxiliary program installed on the client. Herein, the peer-to-peer network may include a large number of nodes, each of the nodes may be used as a data downloader (i.e., the client) to a download resource file from other nodes in a form of data blocks using a P2P technology, and each of the nodes may also be used as a data provider (i.e., a server) to provide the stored resource file to other nodes in the form of data blocks using the P2P technology. The nodes in the peer-to-peer network may be CDN nodes, super peer nodes or normal peer nodes. The client may simultaneously establish data connections with a plurality of servers and support to simultaneously download the data blocks of the resource file from the plurality of servers. The SDK auxiliary program may be an auxiliary program independent of a P2P download program, which is configured to acquire a download request for the resource file of the P2P download program and download a corresponding resource file based on the method disclosed in this embodiment.
The peer-to-peer network may further include a configuration server and a Tracker server. Herein, the configuration server is mainly configured to record and externally provide a network address of the Tracker server. In the present disclosure, the configuration server may also be configured to store download configuration information of the resource file. The download configuration information may at least include data block information of the resource file, and optionally, may also include a minimum consumption rate of the resource file and a data cache capacity corresponding to each of download paths. The data block information of the resource file may be a total number and size of the data blocks of the resource file and a corresponding data position of each of the data blocks in the resource file. The minimum consumption rate of the resource file may be set by a provider of the resource file and indicates a lower limit of an acquisition rate of the data block required by the P2P download program when the resource file is downloaded. There may be a plurality of data connections with the same or similar network quality in one download path, and different download paths are distinguished according to different network qualities. The client may download the data blocks of the resource file from other nodes through the plurality of data connections in the plurality of download paths simultaneously. The data cache capacity corresponding to the download path may be set by the provider of the resource file and indicates a size of a storage space corresponding to the data blocks downloaded by the client through the different download paths. For different resource files, the size of the data cache capacity corresponding to the same download path may also be different.
In this embodiment, three download paths are taken as examples for illustration, which includes downloading from the CDN node, downloading from the super peer node and downloading from normal peer node (which may be called as a CDN path, a P2SP path and a P2P path in turn). Different download paths are mainly distinguished by difference in the network quality. The processing is similar in the case of two, four or more download paths, which is not detailed herein again. A specific architecture of the peer-to-peer network may be shown in
A processing flow shown in
During implementation, when a user wants to acquire the target resource file through the client, the P2P download program installed on the client may be opened, and identification information of the target resource file is input into the P2P download program, so that the P2P download program may start to execute a download task of the target resource file. Meanwhile, the SDK auxiliary program on the client may be enabled automatically after the download task of the target resource file is started, so as to assist the P2P download program to download the target resource file. Specifically, the SDK auxiliary program may receive the download request for the target resource file sent by the P2P download program and acquire the data block information of the target resource file from the configuration server in the peer-to-peer network according to the identification information of the target resource file carried in the download request. Of course, in other embodiments, the SDK auxiliary program may also acquire the data block information of the target resource file by other means. For example, the download request sent by the P2P download program carries the corresponding data block information, or the SDK auxiliary program acquires the corresponding data block information from other nodes or servers in the peer-to-peer network.
Hereafter, the SDK auxiliary program may determine the data block download sequence of the target resource file based on the data block information. Generally speaking, the data block download sequence of the target resource file may be determined according to corresponding data positions of the data blocks in the resource file, that is, the data blocks are downloaded one by one from the data block at the front of the data position to the back by default. However, under special circumstances, the data block download sequence of the target resource file may be automatically adjusted according to actual needs. If a data content of a designated part needs to be downloaded first and a data content of a beginning part is not important, the data block download sequence corresponding to the designated part may be advanced and the data block download sequence corresponding to the beginning part may be adjusted to a later sequence. It should be noted that this embodiment mainly introduces a download process of the resource file, but this process is also applicable to a process of downloading only some data blocks in the resource file, which is only different in a determination process of the data block download sequence.
In addition, after acquiring the data block information of the target resource file, the SDK auxiliary program may trigger the client to initiate a connection to the Tracker server according to access information of the Tracker server recorded therein to acquire a node list of the target resource file. Thus, the SDK auxiliary program may select the CDN node, the super peer node and the normal peer node in the node list, and trigger the client to download the resource files from these nodes.
In step 202, a download priority of each of the data blocks of the target resource file is adjusted in real time according to the data block download sequence and a data block consumption progress of the target resource file.
During implementation, the SDK auxiliary program may further acquire the data block consumption progress of the target resource file after determining the data block download sequence of the target resource file, and then adjust the download priority of each of the data blocks of the target resource file in real time according to the data block download sequence and the data block consumption progress. Herein, the download priority of the data block belongs to intermediate data in the download process, and may be a judgment standard used only to complete the download without generating a specific value. The download priority of the data block that has a higher download sequence and needs to be downloaded in a shorter time is higher. A plurality of data blocks may correspond to the same download priority, or each of the data blocks may respectively correspond to a download priority. After a certain data block has been downloaded, the SDK auxiliary program provides the data block to the P2P download program, which means that the data block is consumed. Specifically, at an initial stage of downloading, the data block consumption progress is zero, so the data block with the highest data block download sequence has the highest download priority. During the downloading process, if the data block consumption progress is that an nth data block has been provided to the P2P download program, an (n+1)th data block and subsequent data blocks have the highest download priority, where n and n+1 are both sort numbers of the data block download sequence, the values of which are positive integers.
In step 203, the data blocks of the target resource file are downloaded through a plurality of download paths with the different network qualities based on the adjusted download priority of each of the data blocks.
During implementation, the SDK auxiliary program may download the data blocks of the target resource file through the plurality of download paths based on the download priority of each of the data blocks and the network quality of each of the download paths while adjusting the download priority of each of the data blocks. First, the SDK auxiliary program may retrieve pre-established correspondences between the download paths with the different network qualities and the download priorities. As shown in Table 1, the download paths with one of the network qualities may correspond to one or more download priorities, 1 is the highest download priority, and the download priorities from 2 to n decreases in sequence. The network quality of the download path A is the highest network quality, and the network qualities of the subsequent download paths decreases in sequence. In addition, n is the lowest download priority and the corresponding data block is not downloaded currently, so the corresponding download path is “None”.
TABLE 1
Download priority
Network quality
1
Download path A
2
Download path B
3
4
Download path C
5
6
. . .
. . .
n
None
Hereafter, the SDK auxiliary program may determine the download priority corresponding to each of the download paths according to the above correspondences, so as to determine a data download range corresponding to each of the download paths. In this way, for each of the download paths, the SDK auxiliary program may download the data blocks within the corresponding data download range through the download path.
Specifically, assuming that there are three download paths with the different network qualities including a CDN path, a P2SP path and a P2P path, the download priorities of the data blocks may be divided into four groups of “high”, “medium”, “primary” and “low” according to a sequence from high to low. Then, the SDK auxiliary program may download the data blocks corresponding to the “high” group through the download path with the highest network quality (i.e., the CDN path), download the data blocks corresponding to the “medium” group through the download path with the medium network quality (i.e., the P2SP path), and download the data blocks corresponding to the “primary” group through the download path with the lower network quality (i.e., the P2P path) at the same time. The data blocks corresponding to the “low” group may be not downloaded temporarily. Hereafter, the SDK auxiliary program may provide the downloaded data blocks to the P2P download program, thereby realizing the download processing of the target resource file.
In this embodiment, since the download priority of the same data block varies with changes in the data block consumption progress, there may be two cases including successful or unsuccessful download when downloading a certain data block through the download path with a certain network quality. For the data block that is successfully downloaded, there is no need to repeatedly download the data block even if the download priority of the data block changes. However, for the data block that is unsuccessfully downloaded, the SDK auxiliary program may download the data block through a new download path after the download priority of the data block changes.
In one embodiment, when setting the download priority of the data block, the data cache capacity corresponding to each of the download paths may be used for reference, and the corresponding processing may be as follows: adjusting the download priority of each of the data blocks of the target resource file in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as the data cache capacity and the network quality that correspond to each of the download paths.
During implementation, due to a limited storage space of the client, a corresponding data cache capacity may be set for each of the download paths in general. When a total amount of data blocks downloaded through a certain download path reaches the corresponding data cache capacity, the SDK auxiliary program stops downloading data blocks through this download path. However, the SDK auxiliary program may continue to download the data blocks through the download path after the SDK auxiliary program provides the downloaded data blocks to the P2P download program and deletes the corresponding data blocks from a cache space. In this way, when determining the download priority of each of the data blocks, the SDK auxiliary program may adjust the download priority of each of the data blocks of the target resource file in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as the data cache capacity and the network quality that correspond to each of the download paths.
During the process, the SDK auxiliary program may first determine the data blocks to be provided to the P2P download program according to the data block download sequence and the data block consumption progress of the target resource file, and then determine a data download window corresponding to each of the download paths in real time according to the data cache capacity corresponding to each of the download paths. When the data block is in a certain data download window, the SDK auxiliary program may download the data block through the corresponding download path. Hereafter, the SDK auxiliary program may set different download priorities for the data blocks in different data download windows according to the network quality of each of the download paths. Herein, the higher the network quality of the download path, the higher the download priority of the data block in the corresponding data download window thereof. In this way, by setting the data cache capacity, not only the download processes of the different download paths may be effectively controlled, but also cache resources of the client may be saved, thereby preventing the client from data reading and writing blocking caused by caching a large number of data blocks.
As shown in
In one embodiment, the minimum consumption rate of the data resource file may be ensured by setting the download priorities of the data blocks, and the corresponding processing may be as follows: adjusting the download priority of each of the data blocks of the target resource file in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as the minimum consumption rate of the target resource file.
During implementation, the minimum consumption rate of the corresponding data block may be set for the resource file in order to realize functions of some resource files in the peer-to-peer network. For example, some video resource files is able to be played while being downloaded. Therefore, in order to ensure smooth video playing, a certain minimum consumption rate needs to be set. In other words, smooth video playing may be realized only when the SDK auxiliary program provides the data blocks to the P2P download program at a rate greater than the minimum consumption rate. In this way, the SDK auxiliary program may acquire the minimum consumption progress of the target resource file from the configuration server, and then continuously adjust the download priority of each of the data blocks of the target resource file in combination with the data block download sequence and the data block consumption progress of the target resource file.
Specifically, the SDK auxiliary program may first calculate a data block coverage area corresponding to each of preset download priorities, i.e., the number of the data blocks corresponding to each of the download priorities, according to the minimum consumption rate of the target resource file and a preset data block size of the target resource file. Hereafter, the SDK auxiliary program may determine the data blocks corresponding to each of the data block coverage areas in real time in a data block queue of the target resource file according to the data block download sequence and the data block consumption progress of the target resource file, thereby realizing the adjustment to the download priority of each of the data blocks of the target resource file.
As shown in
In one embodiment, when downloading the data blocks through a plurality of download paths, the selection of the download paths may be adjusted according to a data download speed of each of the download paths. Accordingly, the processing of step 203 may be as follows: setting a priority increasing threshold corresponding to each of the download paths according to the data download speed of each of the download paths and the minimum consumption rate of the target resource file; determining a data download range corresponding to each of the download paths based on the adjusted download priority of each of the data blocks and the network qualities of different download paths; and selecting a target download path, for the data blocks within any one of data download ranges, based on the priority increasing threshold and a random number, and downloading the data blocks through the target download path.
During implementation, the SDK auxiliary program may periodically detect the data download speed of each of the download paths while downloading the data blocks of the target resource file. For example, a total amount of data downloaded through the download path A within a preset period may be counted, and then a calculated average download speed within the preset period may be used as the data download speed of the download path A. In this way, the SDK auxiliary program may set the priority increasing threshold corresponding to each of the download paths according to the detected data download speed of each of the download paths and the minimum consumption rate of the target resource file. Herein, since the download path with the highest network quality corresponds to the highest download priority, there is no need to increase the corresponding download priority thereof. Therefore, the data download speed of the download path may be not detected, and the download path does not have any corresponding priority promoting threshold as well. Specifically, taking the existence of three download paths with the different network qualities such as the CDN path, the P2SP path and the P2P path as an example, the data download speeds are Vcdn, Vp2sp and Vp2p in sequence, and the minimum consumption rate is Vmin. When Vp2p≥Vmin, a value of the priority increasing threshold of the P2P path is the highest, and the value of the priority increasing threshold of the P2SP path is the highest. When Vp2p<Vmin and Vp2sp+Vp2p≥Vmin, the value of the priority increasing threshold of the P2P path may be reduced to a certain extent according to a difference between Vp2p and Vmin, and the value of the priority increasing threshold of the P2SP path is the highest. When Vp2sp+Vp2p<Vmin, the value of the priority increasing threshold of the P2P path may be greatly reduced according to the difference between Vp2p and Vmin, and the value of the priority increasing threshold of the P2SP path may be reduced to a certain extent according to the difference between Vp2sp+Vp2p and Vmin. It should be noted that specific values of the priority increasing thresholds in the above process may be obtained based on practical data, which are not specifically limited in this embodiment.
Meanwhile, the SDK auxiliary program may determine the data download range corresponding to each of the download paths based on the adjusted download priority of each of the data blocks and the network qualities of the different download paths. Hereafter, for the data blocks within any one of the data download ranges, the SDK auxiliary program may first determine a download path X corresponding to the data download range to which the data block belongs when downloading this data block, and then select one random number within the value range of the priority increasing threshold and judge whether the random number is greater than the priority increasing threshold corresponding to the download path X. If the random number is greater than the priority increasing threshold corresponding to the download path X, the priority of the data block may be increased, that is, a download path X−1 with the network quality one level higher than the network quality of the download path X is taken as the target download path. If the random number is smaller than the priority increasing threshold corresponding to the download path X, the priority of the data block does not need to be increased, and the download path X may be taken as the target download path. In this way, the SDK auxiliary program may download the above data blocks through the selected target download path. It may be understood that, in the above process, a real-time network quality of each of the download paths is detected to judge whether the download condition of the data block is able to meet the consumption condition of the data block, the priority increasing threshold is adjusted in real time according to a judgment result, and then the download speed of the data block is controlled as a whole using a random number mechanism, so that not only node resources corresponding to the high-quality download paths may be saved when the network qualities are generally good, but also the minimum consumption rate of the resource file may be satisfied when the network qualities are generally poor.
In one embodiment, it is considered that the high-quality download paths may be used as many as possible to complete the downloading of the entire resource file as soon as possible when downloading the data blocks. Accordingly, the processing of step 203 may be as follows: downloading the data blocks of the target resource file through the plurality of download paths with the different network qualities based on the adjusted download priority of each of the data blocks and node load conditions corresponding to the different download paths.
During implementation, the SDK auxiliary program may continuously detect the node load conditions corresponding to the different download paths in the process of downloading the data blocks of the target resource file. If it is found that the load of the download path with better network quality is lower, original downloading the data blocks through the download path with lower network quality may be replaced with downloading the data blocks through the download path with better network quality on the basis that the download path corresponding to each of the data blocks is determined according to the download priority. However, if the load of the download path with better network quality is higher, the download path of each of the data blocks may be determined according to the download priority, and then the corresponding data block may be directly downloaded by using the determined download path. For example, for the existence of three paths including the CDN path, the P2SP path and the P2P path, when the load of the CDN node is detected to be low, some of the data blocks originally preset to be downloaded through the P2SP path may then be downloaded through the CDN path, and at the same time, some of the data blocks originally preset to be downloaded through the P2P path may then be downloaded through the P2SP path. When the load of the super peer node is detected to be low, some of the data blocks originally preset to be downloaded through the P2P path may then be downloaded through the P2SP path. In this way, the node/bandwidth resources of the high-quality download paths may be fully utilized to complete the download of the resource file as soon as possible, thereby improving the user experience.
In the embodiment of the present disclosure, the download request for the target resource file is received, and the data block download sequence of the target resource file is determined; the download priority of each of the data blocks of the target resource file is adjusted in real time according to the data block download sequence and the data block consumption progress of the target resource file; and the data blocks of the target resource file are downloaded through the plurality of download paths with different network qualities based on the adjusted download priority of each of the data blocks. In this way, when the client downloads the resource file using the P2P technology, different download priorities are configured for different data blocks, and then the download paths with the different network qualities are selected to download the resource file at the same time based on the download priority, so that the data download process of each of the download paths may be effectively controlled, which not only ensures a download efficiency of the resource file, but also improves a resource utilization rate of high-quality nodes in the peer-to-peer network.
Based on the same technical concept, an embodiment of the present disclosure also provides a device for downloading a resource file which is applied to a peer-to-peer network. As shown in
a download preparation module 501, configured to receive a download request for a target resource file and determine a data block download sequence of the target resource file;
a download adjustment module 502, configured to adjust a download priority of each of data blocks of the target resource file in real time according to the data block download sequence and a data block consumption progress of the target resource file; and
a download control module 503, configured to download the data blocks of the target resource file through a plurality of download paths with different network qualities based on the adjusted download priority of each of the data blocks.
In one embodiment, the download adjustment module 502 is configured to:
determine a data download window corresponding to each of the download paths in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as a data cache capacity corresponding to each of the download paths; and
set different download priorities for the data blocks in different data download windows according to the network quality of each of the download paths.
In one embodiment, the download adjustment module 502 is configured to:
set a data block coverage area corresponding to each of preset download priorities according to a minimum consumption rate of the target resource file; and
adjust the download priority of each of the data blocks of the target resource file in real time according to the data block download sequence and the data block consumption progress of the target resource file as well as the data block coverage area.
The client 600 may also include one or more power supplies 629, one or more wired or wireless network interfaces 650, one or more input and output interfaces 658, one or more keyboards 656, and/or one or more operating systems 641 such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, and the like.
The client 600 may include a memory and one or more programs, where the one or more programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs contains the instruction for performing the above resource file downloading.
Those of ordinary skills in the art may understand that all or some steps in the above embodiments may be implemented by hardware or by instructing relevant hardware through a program. The program may be stored in a computer-readable storage medium and the storage medium mentioned above may be a read-only memory, a magnetic disk, an optical disk, or the like.
Those described above are merely some embodiments of the present disclosure, which are not intended to limit the present disclosure. Any modification, equivalent replacement and improvement within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Patent | Priority | Assignee | Title |
11343306, | Nov 07 2018 | WANGSU SCIENCE & TECHNOLOGY CO , LTD | Method, device and system for downloading data block of resource file |
Patent | Priority | Assignee | Title |
10104514, | Dec 17 2015 | T-Mobile USA, Inc. | Systems and methods for the temporal shifting of data downloads or streaming |
10110657, | Jul 03 2014 | TELEFONAKTIEBOLAGET LM ERICSSON PUBL | System and method for pushing live media content in an adaptive streaming environment |
10225620, | Aug 25 2017 | Telefonaktiebolaget LM Ericsson (publ) | System and method for effectuating selective ABR segment delivery for ABR bandwidth control |
10291681, | Jun 18 2015 | Ericsson AB | Directory limit based system and method for storing media segments |
10313408, | Jun 22 2016 | TELEFONAKTIEBOLAGET LM ERICSSON PUBL | Client-assisted time-shift live media and advertisement content play for learned ABR video white spot coverage in a streaming network |
10349104, | Aug 19 2015 | Ericsson AB | System and method for managing segment delivery and bandwidth responsive to encoding complexity metrics |
10412467, | Sep 08 2017 | Amazon Technologies, Inc. | Personalized live media content |
10498368, | Nov 02 2015 | MK SYSTEMS US SUB-HOLDCO INC ; MK SYSTEMS USA INC ; MK SYSTEMS US HOLDCO INC | Dynamic client-side selection of FEC information |
10506262, | Dec 29 2015 | TELEFONAKTIEBOLAGET LM ERICSSON PUBL | Method and system for optimized media delivery |
10725859, | May 25 2017 | SanDisk Technologies, Inc | Parity generation offload using peer-to-peer data transfers in data storage system |
10761929, | May 25 2017 | SanDisk Technologies, Inc | Data storage drive rebuild with parity generation offload using peer-to-peer data transfers |
10805161, | Sep 13 2017 | Verizon Patent and Licensing Inc | Rapid configuration propagation in a distributed multi-tenant platform |
6337715, | Jul 04 1997 | MATSUSHITA ELECTRIC INDUSTRIAL CO , LTD | Broadcasting reception apparatus and data broadcasting method |
7522536, | Feb 14 2001 | Microsoft Technology Licensing, LLC | Method for transferring data over a network |
7558797, | Jun 30 2006 | Microsoft Technology Licensing, LLC | Metadata structures for mass P2P file sharing |
7593333, | Jul 07 2004 | Microsoft Technology Licensing, LLC | Efficient one-to-many content distribution in a peer-to-peer computer network |
7756051, | Jul 02 2004 | Microsoft Technology Licensing, LLC | Content distribution using network coding |
7920572, | Sep 20 2005 | Cisco Technology, Inc | Modifying operation of peer-to-peer networks based on integrating network routing information |
7996550, | Nov 30 2006 | Red Hat, Inc. | Peer-to-peer download with quality of service fallback |
8046426, | Dec 30 2004 | Massachusetts Institute of Technology | Random linear coding approach to distributed data storage |
8166186, | Oct 26 2004 | Sony Corporation | Content distribution method, program, and information processing apparatus |
8341283, | Dec 08 2006 | Deutsche Telekom AG | Method and system for peer-to-peer content dissemination |
8600220, | Apr 02 2012 | JBF Interlude 2009 LTD | Systems and methods for loading more than one video content at a time |
8838722, | Feb 16 2011 | MASQUE PUBLISHING, INC | Communications adaptable to mobile devices |
8838823, | Jun 27 2006 | Thomson Licensing | Performance aware peer-to-peer content-on-demand |
9219782, | Dec 11 2012 | Microsoft Technology Licensing, LLC | Identifying seed computing devices using estimates in peer-to-peer networks |
9438669, | Jan 19 2011 | NAVER CORPORATION | System and method for packetizing data stream in peer-to-peer (P2P) based streaming service |
9628760, | Feb 24 2009 | TELEFONAKTIEBOLAGET L M ERICSSON PUBL | Personalized data distribution based on peer-to-peer content delivery |
20040107242, | |||
20040255003, | |||
20050091167, | |||
20050203851, | |||
20070094279, | |||
20080098123, | |||
20110225312, | |||
20110262104, | |||
20180063232, | |||
20200228582, | |||
CN101478556, | |||
CN103428251, | |||
CN104320672, | |||
CN104348647, | |||
CN109167820, | |||
CN109862065, | |||
CN110048906, | |||
CN110247985, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Apr 08 2020 | DAI, XINYING | WANGSU SCIENCE & TECHNOLOGY CO LTD | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 056939 | /0712 | |
Apr 15 2020 | WANGSU SCIENCE AND TECHNOLOGY CO., LTD. | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
Apr 15 2020 | BIG: Entity status set to Undiscounted (note the period is included in the code). |
Date | Maintenance Schedule |
Aug 24 2024 | 4 years fee payment window open |
Feb 24 2025 | 6 months grace period start (w surcharge) |
Aug 24 2025 | patent expiry (for year 4) |
Aug 24 2027 | 2 years to revive unintentionally abandoned end. (for year 4) |
Aug 24 2028 | 8 years fee payment window open |
Feb 24 2029 | 6 months grace period start (w surcharge) |
Aug 24 2029 | patent expiry (for year 8) |
Aug 24 2031 | 2 years to revive unintentionally abandoned end. (for year 8) |
Aug 24 2032 | 12 years fee payment window open |
Feb 24 2033 | 6 months grace period start (w surcharge) |
Aug 24 2033 | patent expiry (for year 12) |
Aug 24 2035 | 2 years to revive unintentionally abandoned end. (for year 12) |