Data packet download method, device, computing device and storage medium
By dividing the local cache space on the target device to obtain the pre-download window space and dividing data packets according to the download address, the problem of extended waiting time for data packets is solved, and high-speed download of data packets is achieved.
Patent Information
- Application Number
- CN202411097656.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-08-12
AI Technical Summary
In the prior art, as the amount of data packets increases, the waiting time for users to download data is extended, affecting the user's user experience.
By dividing the local cache space of the target device, the pre-download window space is obtained; the data quantity parameters of the target data packet are queried according to the download address received by the target device, and the target data packet is divided according to the data quantity parameters to obtain multiple data segments to be downloaded; the data segment to be downloaded is downloaded based on the pre-download window space; the download request is received through the download program of the target device, and in response to the download request, the data segment to be downloaded in the pre-download window space is read.
It realizes that the target data packet is downloaded in segments, and through the pre-set pre-download window space, the target data packet is pre-downloaded without affecting the use of the user's target device, thereby improving the packet download speed.
Smart Images

Figure CN118646756B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of network downloading, and in particular to a method for downloading a data packet. The present application also relates to a device for downloading a data packet, a computing device, and a computer-readable storage medium. Background Art
[0002] With the advancement of science and technology, current electronic products have been widely used in various industries. Users can realize rich functions by using terminal devices. With the advancement of computing technology, the amount of data transmitted in the data communication process is increasing, and users' demand for data download is also increasing. However, the increase in download volume and the increase in the amount of data packets have further prolonged the waiting time for users to download data, which is not conducive to the user experience. Summary of the invention
[0003] In view of this, the embodiment of the present application provides a data packet downloading method to solve the technical defects existing in the prior art. The embodiment of the present application also provides a data packet downloading device, a computing device, and a computer-readable storage medium.
[0004] According to a first aspect of an embodiment of the present application, a method for downloading a data packet is provided, comprising:
[0005] Dividing a local cache space of a target device to obtain a pre-download window space, wherein the target device is used to download a target data packet;
[0006] According to the download address received by the target device, query the data volume parameter of the target data packet, and divide the target data packet according to the data volume parameter to obtain a plurality of data segments to be downloaded;
[0007] Downloading the data segment to be downloaded based on the pre-download window space;
[0008] A download request is received through a download program of the target device, and in response to the download request, the download program reads the to-be-downloaded data segment in the pre-download window space.
[0009] Optionally, dividing the local cache space of the target device to obtain the pre-download window space includes:
[0010] Determining a local cache space capacity of the local cache space;
[0011] Calculating the window space capacity of the pre-download window space by a preset proportionality coefficient according to the local cache space capacity;
[0012] The local cache space is divided based on the window space capacity to obtain a pre-download window space.
[0013] Optionally, the calculating the window space capacity of the pre-download window space by a preset proportionality coefficient according to the local cache space capacity includes:
[0014] Query the historical space utilization of the local cache space;
[0015] According to the historical space utilization rate, a target proportionality coefficient is selected in a preset proportionality coefficient interval;
[0016] The window space capacity is calculated according to the local cache space capacity by using the target proportionality coefficient.
[0017] Optionally, it also includes:
[0018] Collecting the space utilization rate of the local cache space during the period when the download program responds to the download request;
[0019] The local cache space is divided according to the space utilization, and the window space capacity of the pre-download window space is adjusted based on the division result.
[0020] Optionally, in response to the download request, the download program reading the to-be-downloaded data segment in the pre-download window space comprises:
[0021] Determining a target data segment to be downloaded among the plurality of data segments to be downloaded according to the download node included in the download request;
[0022] Querying the storage location of the target data segment to be downloaded in the pre-download window space;
[0023] According to the storage location, the download program reads the target to-be-downloaded data segment in the pre-download window space.
[0024] Optionally, downloading the to-be-downloaded data segment based on the pre-download window space includes:
[0025] Determining a predicted download node according to the download node included in the download request;
[0026] Determining, according to the predicted download node, a predicted data segment to be downloaded among the plurality of data segments to be downloaded;
[0027] The predicted data segment to be downloaded is downloaded based on the pre-download window space.
[0028] Optionally, downloading the to-be-downloaded data segment based on the pre-download window space includes:
[0029] Dividing the data segment to be downloaded to obtain multiple data fields to be downloaded;
[0030] Based on the pre-download window space, multiple data fields to be downloaded are asynchronously downloaded.
[0031] According to a second aspect of an embodiment of the present application, a data packet downloading device is provided, including:
[0032] a partitioning module configured to partition a local cache space of a target device to obtain a pre-download window space, wherein the target device is used to download a target data packet;
[0033] A query module, configured to query a data volume parameter of the target data packet according to the download address received by the target device, and divide the target data packet according to the data volume parameter to obtain a plurality of data segments to be downloaded;
[0034] A download module, configured to download the data segment to be downloaded based on the pre-download window space;
[0035] The response module is configured to receive a download request through a download program of the target device, and in response to the download request, the download program reads the to-be-downloaded data segment in the pre-download window space.
[0036] According to a third aspect of an embodiment of the present application, a computing device is provided, including:
[0037] Memory and processor;
[0038] The memory is used to store computer executable instructions, and the processor implements the steps of the data packet downloading method when executing the computer executable instructions.
[0039] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the data packet downloading method are implemented.
[0040] According to a fifth aspect of an embodiment of the present application, a chip is provided, which stores a computer program, and the computer program implements the steps of the data packet downloading method when executed by the chip.
[0041] The data packet download method provided by the present application obtains a pre-download window space by dividing the local cache space of the target device; inquires the data volume parameter of the target data packet according to the download address received by the target device, and divides the target data packet according to the data volume parameter to obtain multiple data segments to be downloaded; downloads the data segments to be downloaded based on the pre-download window space; receives a download request through the download program of the target device, and in response to the download request, the download program reads the data segments to be downloaded in the pre-download window space. The target data packet is downloaded in segments, and the target data packet is pre-downloaded through the pre-set pre-download window space without affecting the use of the user's target device, thereby improving the data packet download speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 is a flow chart of a method for downloading a data packet provided by an embodiment of the present application;
[0044] Figure 2 It is a structural schematic diagram of a data packet downloading device provided by an embodiment of the present application;
[0045] Figure 3 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0046] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0047] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0048] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0049] First, the terms involved in one or more embodiments of the present invention are explained.
[0050] CDN: (Content Delivery Network), which is a content distribution network. Its basic idea is to avoid bottlenecks and links on the Internet that may affect the speed and stability of data transmission as much as possible, so as to make content transmission faster and more stable.
[0051] HTTP: (Hypertext Transfer Protocol), the Hypertext Transfer Protocol, is a simple request-response protocol that usually runs on top of TCP. It specifies what kind of messages a client may send to a server and what kind of response it may get.
[0052] Range: Used to anchor a portion of a file.
[0053] In the present application, a data packet downloading method is provided. The present application also relates to a data packet downloading device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0054] Figure 1 A flowchart of a method for downloading a data packet according to an embodiment of the present application is shown, which specifically includes the following steps:
[0055] Step S102: Divide the local cache space of the target device to obtain a pre-download window space, wherein the target device is used to download the target data packet;
[0056] Step S104: querying the data volume parameter of the target data packet according to the download address received by the target device, and dividing the target data packet according to the data volume parameter to obtain a plurality of data segments to be downloaded;
[0057] Step S106: downloading the data segment to be downloaded based on the pre-download window space;
[0058] Step S108: receiving a download request through the download program of the target device, and in response to the download request, the download program reads the to-be-downloaded data segment in the pre-download window space.
[0059] In actual usage scenarios, the size of data packets is getting larger and larger. For example, the size of game installation packages is generally above 40G, and users have higher and higher requirements for the download speed of data packets. However, even if gigabit broadband is installed, the ideal full-speed download speed cannot be achieved. The reason for this problem is that CDN has no cache, and CDN cannot achieve cache at every edge node.
[0060] Among the existing data packet download solutions, most use the HTTP protocol for data download and combine it with multiple streams for downloading. That is, the client initiates multiple HTTP sessions to the CDN node. Each HTTP session downloads a different Range, which are then merged after the download is completed. In this way, different parts of the same file can be downloaded at the same time, realizing segmented downloading to achieve the purpose of speeding up. However, this segmented download method still cannot achieve the ideal speed of full-speed download.
[0061] Based on this, the pre-download window space is obtained by dividing the local cache of the target device, where the target device is the client device from which the user downloads the target data packet. Then, the size of the data packet, i.e., the data volume parameter, is queried through the download position of the target data packet, and then the target data packet is divided to obtain multiple data segments to be downloaded, so as to achieve the purpose of segmented downloading.
[0062] Afterwards, the data segment to be downloaded is downloaded through the pre-download window space. It should be noted that the download process of the data segment to be downloaded in the pre-download window space can be performed in the background, which does not affect the user's other operations on the target device. When the user downloads the target data packet through the download program, the user triggers the download action through the preset UI control. After generating the corresponding download request, the download program responds to the download request, grabs the data that has been downloaded in the pre-download window space, and realizes the high-speed download of the target data packet. It should be noted that the download program can be a partial management system program, an upgrade program or an accelerator of the software to be upgraded, etc. The specific download program type is determined by the actual use scenario and is not limited by the embodiment itself.
[0063] Furthermore, the process of dividing the local cache space of the target device to obtain the pre-download window space is specifically implemented as follows in this embodiment:
[0064] Determine the local cache space capacity of the local cache space; calculate the window space capacity of the pre-download window space by a preset proportionality coefficient according to the local cache space capacity; divide the local cache space based on the window space capacity to obtain the pre-download window space.
[0065] Among them, the pre-download window space is divided out from the local cache space to ensure the normal operation of the target device. Therefore, the capacity of the divided pre-download window space should not be too large. According to actual measurements, the capacity of the pre-download window space is 5%-20% of the local cache space, which will not affect the normal use of the target device.
[0066] Based on this, the capacity of the local cache space, i.e., the local cache space capacity, is determined, and then the capacity of the divided pre-download window space, i.e., the window space capacity, is calculated according to a preset ratio coefficient. In actual usage scenarios, the ratio coefficient is generally set to 5% to minimize the impact on the normal use of the target device. The local cache space is divided according to the determined window space capacity to obtain the pre-download window space.
[0067] Furthermore, in addition to setting a fixed proportional coefficient to divide the local cache space to obtain the pre-download window space, the proportional coefficient can also be associated with the utilization rate of the local cache space of the target device. In this embodiment, the specific implementation method is as follows:
[0068] Query the historical space utilization of the local cache space; select a target proportional coefficient in a preset proportional coefficient interval according to the historical space utilization; and calculate the window space capacity through the target proportional coefficient according to the local cache space capacity.
[0069] Among them, by calling the log of the target device, the historical space utilization of the local cache space is determined, that is, the average utilization of the local cache space during the operation of the target device; the target proportional coefficient is selected according to the historical space utilization. Specifically, when the utilization rate of the local cache space is not high, it proves that there is long-term unused space in the local cache space. In this case, the selected target proportional coefficient will be larger to obtain a larger capacity pre-download window space. Conversely, when the utilization rate of the local cache space is high, it proves that the space in the local cache space has been occupied for a long time. In this case, the selected target proportional coefficient should be smaller to avoid the division of the pre-download window space from affecting the normal use of the target device.
[0070] Furthermore, in some scenarios, the historical space utilization rate of the local cache space is high, while during the current download of the target data packet through the pre-download window space, the space utilization rate of the local cache space is not high. In this case, the capacity of the pre-download window space can be increased. In this embodiment, the specific implementation method is as follows:
[0071] The space utilization rate of the local cache space is collected during the period when the download program responds to the download request; the local cache space is divided according to the space utilization rate, and the window space capacity of the pre-download window space is adjusted based on the division result.
[0072] Among them, since the space utilization rate of the local cache space is not high during the download of the target data packet through the pre-download window space, the capacity increase of the pre-download window space will not affect the normal operation of the target device.
[0073] Based on this, the space utilization rate of the local cache space is collected during the download program's response to the download request, and the local cache space is divided secondary according to the collected space utilization rate to increase the space capacity of the pre-download window space, thereby further improving the download speed of the target data packet without affecting the normal operation of the target device.
[0074] Furthermore, in response to the download request, the download program reads the data segment to be downloaded in the pre-download window space. In this embodiment, the specific implementation is as follows:
[0075] According to the download node included in the download request, a target data segment to be downloaded among the multiple data segments to be downloaded is determined; the storage location of the target data segment to be downloaded in the pre-download window space is queried; according to the storage location, the download program reads the target data segment to be downloaded in the pre-download window space.
[0076] Among them, in the prior art, after the user starts the download program, the download program downloads the target data packet according to the network, and the network quality and bandwidth conditions will restrict the download speed. Through the pre-download window space, the target data packet is downloaded continuously, and the data segment to be downloaded of the target data packet is cached until the download program needs to execute the download task, and the corresponding download target, that is, the target data segment to be downloaded, is read from the pre-download window space. The network quality and bandwidth conditions have no effect on the download speed, thereby improving the download speed.
[0077] Based on this, in actual usage scenarios, the target device downloads the data segment to be downloaded through the pre-download window space according to the HTTP request initiated by the client. After starting the download program of the target device, when the client's Range request reaches the download program, the target data segment to be downloaded is determined, and the download program reads the target data segment to be downloaded from the corresponding storage location of the pre-download window space.
[0078] Furthermore, the process of downloading the data segment to be downloaded based on the pre-download window space is specifically implemented as follows in this embodiment:
[0079] Determine a predicted download node according to the download node included in the download request; determine a predicted data segment to be downloaded among the multiple data segments to be downloaded according to the predicted download node; and download the predicted data segment to be downloaded based on the pre-download window space.
[0080] Among them, since the target data packet is downloaded in segments, the data segment to be downloaded currently can be determined according to the download node contained in the download request, and then the data segment to be downloaded that needs to be downloaded later is predicted, that is, the data segment to be downloaded including the predicted download node, and the predicted data segment to be downloaded is downloaded through the pre-download window space. When the download program subsequently reads the data segment to be downloaded, it can directly read it without waiting, thereby improving the download efficiency.
[0081] Specifically, in the actual usage scenario, assuming that the target data packet A (x 0 , x 4 ) is divided into a 1 (x 0 ,x 1 )、a 2 (x 1 ,x 2 )、a 3 (x 2 ,x 3 )、a 4 (x 3 ,x 4 ) These four data segments to be downloaded, among which x 0 -x 4 For downloading nodes. In the downloading program, the download data segment a 1 (x 0 ,x 1 ) is in the process of downloading, at this time, according to the download node x contained in the download request 0 , determine the current download is from the download node x 0 Start by predicting the subsequent download nodes, that is, predicting the download node to be x 1 , then it can be predicted that the data segment a to be downloaded will be downloaded later 2 (x 1 ,x 2 ), the pre-download window space can be used to download data segment a 2 (x 1 ,x 2 ) to download.
[0082] Furthermore, during the process of downloading the data segments to be downloaded in the pre-download window, the data segments to be downloaded may be downloaded in segments to increase the download speed. In this embodiment, the specific implementation is as follows:
[0083] The data segments to be downloaded are divided to obtain a plurality of data fields to be downloaded; and the plurality of data fields to be downloaded are asynchronously downloaded based on the pre-download window space.
[0084] Among them, the pre-download window space in the above example is used to treat the download data segment a 2 (x1 ,x 2 ) is used to download data. At this time, the data segment to be downloaded is divided into a 21 (x 1 ,x 1.2 ), a 22 (x 1.2 ,x 1.4 ), a 23 (x 1.4 ,x 1.6 )a 24 (x 1.6 ,x 1.8 ), a 25 (x 1.8 ,x 2 ) These five data fields to be downloaded are then downloaded asynchronously to increase the download speed.
[0085] Corresponding to the above method embodiment, the present application also provides a data packet downloading device embodiment, Figure 2 FIG. 1 is a schematic diagram showing the structure of a data packet downloading device provided by an embodiment of the present application. Figure 2 As shown, the device comprises:
[0086] A division module 202 is configured to divide a local cache space of a target device to obtain a pre-download window space, wherein the target device is used to download a target data packet;
[0087] The query module 204 is configured to query the data volume parameter of the target data packet according to the download address received by the target device, and divide the target data packet according to the data volume parameter to obtain a plurality of data segments to be downloaded;
[0088] A download module 206, configured to download the data segment to be downloaded based on the pre-download window space;
[0089] The response module 208 is configured to receive a download request through a download program of the target device, and in response to the download request, the download program reads the to-be-downloaded data segment in the pre-download window space.
[0090] In an optional embodiment, the division module 202 is further configured to:
[0091] Determine the local cache space capacity of the local cache space; calculate the window space capacity of the pre-download window space by a preset proportionality coefficient according to the local cache space capacity; divide the local cache space based on the window space capacity to obtain the pre-download window space.
[0092] In an optional embodiment, the division module 202 is further configured to:
[0093] Query the historical space utilization of the local cache space; select a target proportional coefficient in a preset proportional coefficient interval according to the historical space utilization; and calculate the window space capacity through the target proportional coefficient according to the local cache space capacity.
[0094] In an optional embodiment, the data packet downloading device further includes:
[0095] The secondary partitioning module is configured to collect the space utilization of the local cache space during the period when the download program responds to the download request; divide the local cache space according to the space utilization, and adjust the window space capacity of the pre-download window space based on the partition result.
[0096] In an optional embodiment, the response module 208 is further configured to:
[0097] According to the download node included in the download request, a target data segment to be downloaded among the multiple data segments to be downloaded is determined; the storage location of the target data segment to be downloaded in the pre-download window space is queried; according to the storage location, the download program reads the target data segment to be downloaded in the pre-download window space.
[0098] In an optional embodiment, the response module 208 is further configured to:
[0099] Determine a predicted download node according to the download node included in the download request; determine a predicted data segment to be downloaded among the multiple data segments to be downloaded according to the predicted download node; and download the predicted data segment to be downloaded based on the pre-download window space.
[0100] In an optional embodiment, the response module 208 is further configured to:
[0101] The data segments to be downloaded are divided to obtain a plurality of data fields to be downloaded; and the plurality of data fields to be downloaded are asynchronously downloaded based on the pre-download window space.
[0102] The data packet downloading device provided by the present application obtains a pre-download window space by dividing the local cache space of the target device; inquires the data volume parameter of the target data packet according to the download address received by the target device, and divides the target data packet according to the data volume parameter to obtain multiple data segments to be downloaded; downloads the data segments to be downloaded based on the pre-download window space; receives a download request through the download program of the target device, and in response to the download request, the download program reads the data segments to be downloaded in the pre-download window space. The target data packet is downloaded in segments, and the target data packet is pre-downloaded through the pre-set pre-download window space without affecting the use of the user's target device, thereby improving the data packet download speed.
[0103] The above is a schematic scheme of a data packet downloading device of the present embodiment. It should be noted that the technical scheme of the data packet downloading device and the technical scheme of the data packet downloading method described above belong to the same concept. For details not described in detail in the technical scheme of the data packet downloading device, please refer to the description of the technical scheme of the data packet downloading method described above. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.
[0104] Figure 3 The block diagram of a computing device 300 provided according to an embodiment of the present application is shown. The components of the computing device 300 include but are not limited to a memory 310 and a processor 320. The processor 320 is connected to the memory 310 via a bus 330, and the database 350 is used to store data.
[0105] The computing device 300 also includes an access device 340 that enables the computing device 300 to communicate via one or more networks 360. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 340 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0106] In one embodiment of the present application, the above components of the computing device 300 and Figure 3 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 3 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0107] The computing device 300 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 300 may also be a mobile or stationary server.
[0108] The processor 320 is used to execute computer executable instructions of each step of the data packet downloading method.
[0109] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned data packet downloading method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned data packet downloading method.
[0110] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which are used to implement the steps of the data packet downloading method when executed by a processor.
[0111] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned data packet downloading method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned data packet downloading method.
[0112] An embodiment of the present application further provides a chip storing a computer program, which implements the steps of the data packet downloading method when executed by the chip.
[0113] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0114] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0115] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0116] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0117] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A method for downloading a data packet, characterized in that: include: Divide the local cache space of the target device to obtain a pre-download window space, wherein the target device is used to download a target data packet. Specifically, determine the local cache space capacity of the local cache space, calculate the window space capacity of the pre-download window space by a preset proportional coefficient according to the local cache space capacity, divide the local cache space based on the window space capacity to obtain the pre-download window space, and calculate the window space capacity by querying the historical space utilization rate of the local cache space, selecting a target proportional coefficient in a preset proportional coefficient interval according to the historical space utilization rate, and calculating the window space capacity by the target proportional coefficient according to the local cache space capacity; According to the download address received by the target device, query the data packet size of the target data packet, and divide the target data packet according to the data packet size to obtain a plurality of data segments to be downloaded; The data segments to be downloaded are downloaded based on the pre-download window space. Specifically, the data segments to be downloaded are divided to obtain multiple data fields to be downloaded. The multiple data fields to be downloaded are asynchronously downloaded based on the pre-download window space. A predicted download node is determined based on the download node included in the download request. A predicted data segment to be downloaded among the multiple data segments to be downloaded is determined based on the predicted download node. The predicted data segment to be downloaded is downloaded based on the pre-download window space. A download request is received through a download program of the target device, and in response to the download request, the download program reads the data segment to be downloaded in the pre-download window space. Specifically, according to the download node included in the download request, a target data segment to be downloaded among the multiple data segments to be downloaded is determined, and a storage location of the target data segment to be downloaded in the pre-download window space is queried. According to the storage location, the download program reads the target data segment to be downloaded in the pre-download window space.
2. The method according to claim 1, characterized in that In response to the download request, after the download program reads the data segment to be downloaded in the pre-download window space, the download program further includes: Collecting the space utilization rate of the local cache space during the period when the download program responds to the download request; The local cache space is divided according to the space utilization rate, and the window space capacity of the pre-download window space is adjusted based on the division result.
3. A data packet downloading device, characterized in that: include: A partitioning module is configured to partition a local cache space of a target device to obtain a pre-download window space, wherein the target device is used to download a target data packet, specifically, determine a local cache space capacity of the local cache space, calculate a window space capacity of the pre-download window space by a preset proportionality coefficient according to the local cache space capacity, partition the local cache space based on the window space capacity to obtain the pre-download window space, and calculate the window space capacity by querying a historical space utilization rate of the local cache space, selecting a target proportionality coefficient in a preset proportionality coefficient interval according to the historical space utilization rate, and calculating the window space capacity by the target proportionality coefficient according to the local cache space capacity; A query module, configured to query the data packet size of the target data packet according to the download address received by the target device, and divide the target data packet according to the data packet size to obtain a plurality of data segments to be downloaded; A download module is configured to download the data segment to be downloaded based on the pre-download window space, specifically, divide the data segment to be downloaded to obtain multiple data fields to be downloaded, asynchronously download the multiple data fields to be downloaded based on the pre-download window space, and determine a predicted download node according to the download node included in the download request, determine a predicted data segment to be downloaded among the multiple data segments to be downloaded according to the predicted download node, and download the predicted data segment to be downloaded based on the pre-download window space; The response module is configured to receive a download request through a download program of the target device, and in response to the download request, the download program reads the data segment to be downloaded in the pre-download window space, specifically, according to the download node included in the download request, determines a target data segment to be downloaded among the multiple data segments to be downloaded, queries the storage location of the target data segment to be downloaded in the pre-download window space, and according to the storage location, the download program reads the target data segment to be downloaded in the pre-download window space.
4. A computing device, characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the data packet downloading method according to any one of claims 1 to 2.
5. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by the processor, the steps of the data packet downloading method described in any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
File downloading method and device and computer equipment
CN112199052A