WO2020026018A1 - 文件的下载方法、装置、设备/终端/服务器及存储介质 - Google Patents
文件的下载方法、装置、设备/终端/服务器及存储介质 Download PDFInfo
- Publication number
- WO2020026018A1 WO2020026018A1 PCT/IB2018/056504 IB2018056504W WO2020026018A1 WO 2020026018 A1 WO2020026018 A1 WO 2020026018A1 IB 2018056504 W IB2018056504 W IB 2018056504W WO 2020026018 A1 WO2020026018 A1 WO 2020026018A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target file
- mobile terminal
- downloading
- network
- download speed
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
Definitions
- Embodiments of the present application relate to the field of mobile Internet, and in particular, to a method, an apparatus, a device / terminal / server, and a computer-readable storage medium for downloading a target file. Background technique
- the bandwidth in the mobile Internet, the caches and processors in the exchange nodes, etc., are all resources of the mobile Internet.
- the performance of the network will be deteriorated, which will cause network congestion.
- the prior art uses a TCP congestion control strategy to prevent excessive data from being injected into the network, which can prevent routers or links in the network from being overloaded.
- TCP uses a windowing mechanism to control data flow. More specifically, when a connection is established, each end of the connection allocates a buffer to hold the input data, and sends the size of the buffer to the other end. When the data arrives, the receiver sends an acknowledgement, which contains its remaining buffer size. Among them, the size of the remaining buffer space is called a window, and the notification indicating the size of the window is called a window notification.
- TCP window-based congestion control is not good enough. If the file is downloaded by a single thread, due to the limitation of the TCP window size, it is difficult to make full use of the network bandwidth in the single thread download, and the file download speed cannot be fully utilized. Summary of the invention
- one of the technical problems solved by the embodiments of the present application is to provide a solution for downloading a target file, so as to solve the problem in the prior art that the network bandwidth of the mobile terminal cannot be fully utilized to improve the download speed of the target file. .
- An embodiment of the present application provides a method for downloading a target file, the method includes: detecting a download speed of a target file in the mobile terminal; based on the download speed of the target file and the mobile Adjusting the maximum bandwidth of the terminal to the number of network threads used for downloading the target file.
- An embodiment of the present application further provides a device for downloading a target file, where the device includes: a first detection module configured to detect a download speed of the target file in the mobile terminal; an adjustment module configured to be based on the The download speed of the target file and the maximum bandwidth of the mobile terminal adjust the number of network threads used for downloading the target file.
- An embodiment of the present application further provides a device / terminal / server, including: one or more processors; a storage device configured to store one or more programs; when the one or more programs are stored by the one or more programs The two processors execute, so that the one or more processors implement the method for downloading the target file as described above.
- An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method for downloading a target file as described above is implemented.
- the download speed of the target file in the mobile terminal is detected, and the number of network threads used for target file download is adjusted based on the download speed of the target file and the maximum bandwidth of the mobile terminal.
- the network bandwidth of the mobile terminal can be fully utilized to improve the download speed of the target file.
- FIG. 1 is a flowchart of steps of a method for downloading a target file according to Embodiment 1 of the present application
- FIG. 2 is a flowchart of steps of a method of downloading a target file according to Embodiment 2 of the present application
- FIG. 3 is a flowchart according to this application
- FIG. 4 is a structural block diagram of a device for downloading a target file according to the fourth embodiment of the present application
- FIG. 5 is a block diagram of a device for downloading a target file according to the fourth embodiment of the present application
- FIG. 6 is a schematic structural diagram of a device / terminal / server according to Embodiment 6 of the present application. detailed description
- FIG. 1 there is shown a flowchart of steps of a method for downloading an object file according to the first embodiment of the present application.
- Step S101 Detect a download speed of a target file in the mobile terminal.
- the mobile terminal may include at least one of the following: in-vehicle equipment, entertainment equipment, advertising equipment, personal digital assistant (PDA), tablet computer, notebook computer, handheld game console, smart glasses, smart Watch, wearable device, virtual display device or display enhancement device (such as Google Glass, Oculus Rift, Hololens, Gear VR).
- the object file may include at least one of the following: text, picture, video frame sequence, compressed package, installation package. It can be understood that the above description is only exemplary, and the embodiment of the present application does not limit this in any way.
- the download speed of the target file may be detected by a corresponding client of the mobile terminal. It can be understood that the detection of the download speed of the target file may be implemented by a person skilled in the art by using any appropriate detection method according to actual requirements, which is not limited in the embodiment of the present application.
- Step S102 Adjust the number of network threads used for downloading the target file based on the download speed of the target file and the maximum bandwidth of the mobile terminal.
- the network environment in which the mobile terminal is connected to the network usually includes a mobile network and a WiFi network.
- mobile networks include common 2G networks, 3G networks, 4G networks, and the like.
- the WiFi network uses a WiFi wireless signal to enable a mobile terminal to perform wireless Internet access without using a mobile network such as a 2G network, a 3G network, or a 4G network.
- the stability of Internet access through the WiFi network and the speed of data interaction are significantly better than mobile networks such as 2G networks, 3G networks, and 4G networks.
- the downlink traffic value of the mobile terminal in a unit time is detected; the current bandwidth of the mobile terminal is determined according to the downlink traffic value of the mobile terminal in a unit time; if the mobile terminal If the current bandwidth of the mobile terminal is greater than a predetermined maximum bandwidth, it is determined that the current bandwidth of the mobile terminal is the maximum bandwidth of the mobile terminal.
- the downlink traffic value of the mobile terminal in a unit time includes a traffic generated when the mobile terminal downloads a file in a unit time or receives feedback from an access object.
- the current bandwidth of the mobile terminal may be obtained by conversion based on the downlink traffic value of the mobile terminal in a unit time. It can be understood that the above description is only exemplary, and this embodiment of the present application does not limit this in any way.
- the maximum bandwidth value of the locally stored terminal device can be obtained first, a variable is assigned, and then a background service that periodically detects the downlink traffic of the mobile terminal is started to obtain the current bandwidth value of the mobile terminal. If the current bandwidth value of the mobile terminal is greater than a predetermined maximum bandwidth of the mobile terminal, the current bandwidth value of the mobile terminal is used to update the maximum bandwidth of the mobile terminal and a variable is assigned. If the current bandwidth value of the mobile terminal is less than or equal to a predetermined maximum bandwidth of the mobile terminal, the bandwidth value of the mobile terminal is obtained again at a preset time interval. Repeat the above process to update the maximum bandwidth of the mobile terminal in real time.
- the preset time period may be set by a person skilled in the art according to actual needs, which is not limited in the embodiment of the present application. It can be understood that the above description is only exemplary, and this embodiment of the present application does not limit this in any way.
- the network thread may be understood as a download channel, and one network thread is a download channel of a target file, and multiple network threads are simultaneously opened multiple download channels to download a target file.
- the utilization of the network bandwidth of the mobile terminal can be improved, and the download speed of the target file can be improved.
- the network bandwidth of the mobile terminal can be fully utilized to improve the download speed of the target file.
- the method for downloading the target file in this embodiment may be performed by any appropriate device having data processing capabilities, including, but not limited to: in-vehicle equipment, entertainment equipment, advertising equipment, personal digital assistant (PDA), tablet computer, notebook computer, palmtop Game console, smart glasses, smart watch, wearable device, virtual display device or display enhancement device (such as Google Glass, Oculus Rift, Hololens, Gear VR), etc.
- PDA personal digital assistant
- tablet computer tablet computer
- notebook computer palmtop Game console
- smart glasses smart watch
- wearable device virtual display device or display enhancement device (such as Google Glass, Oculus Rift, Hololens, Gear VR), etc.
- display enhancement device such as Google Glass, Oculus Rift, Hololens, Gear VR
- FIG. 2 a flowchart of steps of a method for downloading an object file according to Embodiment 2 of the present application is shown.
- step S201 a download speed of a target file in the mobile terminal is detected.
- step S201 is similar to step S101 described above, details are not described herein again.
- step S202 it is determined whether a ratio of a download speed of the target file to a maximum bandwidth of the mobile terminal is less than a preset ratio.
- the preset ratio may be 80%. It can be understood that the preset ratio may be set by a person skilled in the art according to actual needs, and this embodiment of the present application does not limit this.
- the download speed of the target file increases, and the occupation of the network bandwidth of the mobile terminal is increased.
- the tasks running in the system of the mobile terminal require a certain amount of bandwidth. There must be only download tasks. If the download task occupies all bandwidth, it will greatly affect the normal work of other tasks. Therefore, in order to ensure the normal work of other tasks, the download task can occupy as much bandwidth as possible to achieve the fastest possible speed.
- the preset ratio may be set for a download task.
- step S203 if it is determined that the ratio of the download speed of the target file to the maximum bandwidth of the mobile terminal is less than the preset ratio, it is determined whether the current number of network threads used for downloading the target file is less than the preset number.
- the preset number may be set by a person skilled in the art according to actual needs, which is not limited in the embodiment of the present application.
- the normal work of various tasks of the mobile terminal does not only require bandwidth, but also requires System resources such as various CPU resources and memory resources are required.
- System resources such as various CPU resources and memory resources are required.
- the preset number may be set for the number of network threads used for downloading the target file.
- step S204 if it is determined that the current number of network threads used for downloading the target file is less than a preset number, the number of network threads used for downloading the target file is increased.
- a network thread used for downloading the target file may be added. It can be understood that the specific increase amount can be set by those skilled in the art according to actual needs, and this embodiment of the present application does not limit this in any way.
- the newly-added network thread may be used to download half of the undownloaded file fragments of the target file. This makes it possible to take full advantage of the newly added network thread to download undownloaded file fragments of the target file. It can be understood that the above description is only exemplary, and the embodiment of the present application does not limit this in any way.
- step S205 after increasing the number of network threads used for downloading the target file, the download speed of the target file is detected at preset time intervals.
- the preset time period may be 5 seconds. It can be understood that the preset time period can be set by a person skilled in the art according to actual needs, and this embodiment of the present application does not limit this.
- the download speed of the target file is detected at a preset time interval, which can avoid the problem that the download speed of the target file is detected when the download speed of the target file has not reached a stable state, resulting in an inaccurate detection result.
- steps S202 to S205 in the embodiment of the present application are repeatedly performed until the target file in the mobile terminal is downloaded.
- the file fragments downloaded by all network threads are combined into an object file.
- the download speed of the target file in the mobile terminal is detected, and if the download speed of the target file and the maximum bandwidth of the mobile terminal are determined.
- the ratio of the ratio is smaller than the preset ratio and it is determined that the current number of network threads used for downloading the target file is less than the preset number, increasing the number of network threads used for downloading the target file, compared with other existing methods.
- the network bandwidth of the mobile terminal can be fully utilized to improve the download speed of the target file.
- the method for downloading the target file in this embodiment may be performed by any appropriate device having data processing capabilities, including, but not limited to: in-vehicle equipment, entertainment equipment, advertising equipment, personal digital assistant (PDA), tablet computer, notebook computer, palmtop Game console, smart glasses, smart watch, wearable device, virtual display device or display enhancement device (such as Google Glass, Oculus Rift, Hololens, Gear VR), etc.
- PDA personal digital assistant
- tablet computer tablet computer
- notebook computer notebook computer
- palmtop Game console smart glasses
- smart watch wearable device
- virtual display device or display enhancement device such as Google Glass, Oculus Rift, Hololens, Gear VR
- FIG. 3 a structural block diagram of a device for downloading an object file according to Embodiment 3 of the present application is shown.
- the device for downloading a target file in this embodiment includes: a first detection module 301 configured to detect a download speed of a target file in the mobile terminal; and an adjustment module 302 configured to be based on the download speed of the target file and the target file.
- the maximum bandwidth of the mobile terminal is described, and the number of network threads used for downloading the target file is adjusted.
- the device for downloading a target file in this embodiment is used to implement the method for downloading corresponding target files in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, and details are not described herein again.
- FIG. 4 there is shown a structural block diagram of a device for downloading an object file according to Embodiment 4 of the present application.
- the device for downloading a target file in this embodiment includes: a first detection module 401 configured to detect a download speed of a target file in the mobile terminal; and an adjustment module 405 configured to be based on the download speed of the target file and the target file.
- the maximum bandwidth of the mobile terminal is described, and the number of network threads used for downloading the target file is adjusted.
- the device further includes: a second detection module 402 configured to detect a downlink traffic value of the mobile terminal within a unit time; a first determination module 403 configured to A downlink traffic value of the mobile terminal within a unit time to determine a current bandwidth of the mobile terminal; a second determination module 404, configured to determine the current bandwidth of the mobile terminal if the current bandwidth of the mobile terminal is greater than a predetermined maximum bandwidth; The current bandwidth of the mobile terminal is the maximum bandwidth of the mobile terminal.
- a second detection module 402 configured to detect a downlink traffic value of the mobile terminal within a unit time
- a first determination module 403 configured to A downlink traffic value of the mobile terminal within a unit time to determine a current bandwidth of the mobile terminal
- a second determination module 404 configured to determine the current bandwidth of the mobile terminal if the current bandwidth of the mobile terminal is greater than a predetermined maximum bandwidth; The current bandwidth of the mobile terminal is the maximum bandwidth of the mobile terminal.
- the adjustment module 405 includes: a first adding module 4051, configured to increase the download speed for the target file and the maximum bandwidth of the mobile terminal if the ratio of the download speed of the target file to the maximum bandwidth of the mobile terminal is less than a preset ratio; The number of network threads downloaded by the target file.
- the apparatus further includes: a third detection module 406 configured to detect a download speed of the target file at a preset time interval after increasing the number of network threads; a second addition module 407 is configured to It is configured to continue to increase the number of network threads used for downloading the target file if the ratio of the download speed of the target file to the maximum bandwidth of the mobile terminal is less than the preset ratio.
- a third detection module 406 configured to detect a download speed of the target file at a preset time interval after increasing the number of network threads
- a second addition module 407 is configured to It is configured to continue to increase the number of network threads used for downloading the target file if the ratio of the download speed of the target file to the maximum bandwidth of the mobile terminal is less than the preset ratio.
- the device for downloading a target file in this embodiment is used to implement the method for downloading corresponding target files in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, and details are not described herein again.
- Example 5
- FIG. 5 there is shown a structural block diagram of a device for downloading an object file according to Embodiment 5 of the present application.
- the device for downloading a target file in this embodiment includes: a first detection module 501 configured to detect a download speed of a target file in the mobile terminal; and an adjustment module 502 configured to be based on the download speed of the target file and the target file.
- the maximum bandwidth of the mobile terminal is described, and the number of network threads used for downloading the target file is adjusted.
- the adjustment module 502 includes: a first adding module 5021, configured to add a value for the target file to the mobile terminal if the ratio between the download speed of the target file and the maximum bandwidth of the mobile terminal is less than a preset ratio; The number of network threads downloaded by the target file.
- the device further includes: a download module 503 configured to download half of the undownloaded file fragments of the target file by using a newly added network thread.
- a download module 503 configured to download half of the undownloaded file fragments of the target file by using a newly added network thread.
- the apparatus further includes: a third determining module 504 configured to determine whether the current number of the network threads is less than a preset number; a third adding module 505 is configured In order to continue to increase the number of network threads used for downloading the target file if the current number of network threads is less than the preset number.
- the device for downloading a target file in this embodiment is used to implement the method for downloading corresponding target files in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, and details are not described herein again.
- FIG. 6 a schematic structural diagram of a device / terminal / server according to Embodiment 6 of the present application is shown.
- the specific embodiment of the present application does not limit the specific implementation of the device / terminal / server.
- the device / terminal / server may include a processor 601 and a storage device 602.
- the processor 601 is configured to execute a program 603, and may specifically perform related steps in the foregoing method embodiment for downloading an object file.
- the program 603 may include program code, where the program code includes a computer operation instruction.
- the processor 601 may be a central processing unit CPU, or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
- the device / terminal / server includes one or more processors, which can be processors of the same type, such as one or more CPUs; or different types of processors, such as one or more CPUs and one or more ASICs .
- the storage device 602 is configured to store one or more programs 603.
- the storage device 602 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), for example, at least one disk memory.
- the program 603 may be specifically configured to cause the processor 601 to perform the following operations: detect a download speed of a target file in the mobile terminal; and adjust the target file for the target based on the download speed of the target file and the maximum bandwidth of the mobile terminal Number of network threads for file download.
- the program 603 is further configured to cause the processor 601 to detect a downlink traffic value of the mobile terminal within a unit time before the number of network threads used for the target file download is adjusted. Determining the current bandwidth of the mobile terminal according to the downlink traffic value of the mobile terminal within a unit time; if the current bandwidth of the mobile terminal is greater than a predetermined maximum bandwidth, determining that the current bandwidth of the mobile terminal is The maximum bandwidth of the mobile terminal is described.
- the program 603 is further configured to cause the processor 601 to adjust the number of network threads for downloading the target file based on the download speed of the target file and the maximum bandwidth of the mobile terminal.
- the ratio of the download speed of the target file to the maximum bandwidth of the mobile terminal is less than a preset ratio, the number of network threads used for downloading the target file is increased.
- the program 603 is further configured to cause the processor 601 to download half of the undownloaded file fragments of the target file by using the newly added network thread.
- the program 603 is further configured to cause the processor 601 to detect a download speed of the target file at a preset time interval after increasing the number of network threads; if the target file is downloaded If the ratio of the speed to the maximum bandwidth of the mobile terminal is less than the preset ratio, the number of network threads for downloading the target file continues to increase. In an optional implementation manner, the program 603 is further configured to cause the processor 601 to determine whether the current number of network threads is less than a preset value before the number of network threads for downloading the target file continues to increase. Quantity; if the current number of network threads is less than the preset number, continue to increase the number of network threads used for the download of the target file.
- the download speed of the target file in the mobile terminal is detected, and the number of network threads used for downloading the target file is adjusted based on the download speed of the target file and the maximum bandwidth of the mobile terminal.
- the network bandwidth of the mobile terminal can be fully utilized to improve the download speed of the target file.
- each component / step described in the embodiment of the present application may be split into more components / steps, or two or more components / steps or partial operations of components / steps may be combined into New components / steps to achieve the purpose of the embodiments of the present application.
- the process described above with reference to the flowchart may be implemented as a computer software program.
- the embodiment of the present application includes a computer program product including a computer program borne on a computer-readable medium, where the computer program includes program code for executing the methods shown in the foregoing multiple method embodiments.
- the computer program may be downloaded and installed from a network through a communication section, and / or installed from a removable medium.
- CPU central processing unit
- the above-mentioned functions defined in the method shown in the embodiment of the present application are performed.
- the computer-readable medium described in this application may be a computer-readable signal medium.
- the computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access storage (RAM), read-only storage (ROM), erasable Type programmable read-only storage device (EPROM or flash memory), optical fiber, portable compact disk read-only storage device (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
- a computer-readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
- a computer-readable signal medium may include a data signal that is included in baseband or propagated as part of a carrier wave, which carries a computer-readable code. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
- the computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
- Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
- Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, which includes an object-oriented programming language--such as
- Java, Smalltalk, C ++ also includes regular procedural programming languages such as "C” or similar programming languages.
- the program code can be executed entirely on the user's computer, partly on the user's computer, as an independent software package, partly on the user's computer, partly on a remote computer, or entirely on a remote computer or server.
- the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as provided by an Internet service) (Commercially connected via the Internet).
- LAN local area network
- WAN wide area network
- an Internet service Commercially connected via the Internet
- each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, which contains one or more functions for implementing a specified logical function Executable instructions.
- the functions marked in the boxes may also occur in a different order than those marked in the drawings. For example, two successively represented boxes may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.
- each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts may be implemented in a dedicated hardware-based system that performs the specified function or operation. Or, it can be implemented by a combination of dedicated hardware and computer instructions.
- the units described in the embodiments of the present application may be implemented in a software manner, or may be implemented in a hardware manner.
- the described unit may also be provided in a processor, for example, it may be described as:
- a processor includes an acquisition unit, a processing unit, and a test unit.
- the name of these units does not constitute a limitation on the unit itself in some cases.
- the obtaining unit may also be described as "a unit for obtaining a business test file of a target object to be tested according to a test instruction".
- the present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method described in any one of the foregoing embodiments is implemented.
- the present application further provides a computer-readable medium, which may be included in the device described in the foregoing embodiments; or may exist alone without being assembled into the device.
- the computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the mobile terminal where the device is located detects a download speed of a target file in the mobile terminal; based on the target The download speed of the file and the maximum bandwidth of the mobile terminal adjust the number of network threads used for downloading the target file.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Telephonic Communication Services (AREA)
Abstract
本申请实施例提供了一种目标文件的下载方法、装置、设备/终端/服务器及计算机可读存储介质,涉及移动互联网领域。其中,所述目标文件的下载方法包括:检测所述移动终端中的目标文件的下载速度;基于所述目标文件的下载速度与所述移动终端的最大带宽,调整用于所述目标文件下载的网络线程的数量。通过本申请实施例,能够充分利用移动终端的网络带宽来提高目标文件的下载速度。
Description
文件的下载方法、 装置、 设备 /终端 /服务器及存储介质 本申请要求在 2018 年 07 月 31 日提交中国专利局、 申请号为 201810858653.1、 发明名称为“文件的下载方法、 装置、 设备 /终端 /服务器及存 储介质” 的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本申请实施例涉及移动互联网领域, 尤其涉及一种目标文件的下载方法、 装置、 设备 /终端 /服务器及计算机可读存储介质。 背景技术
移动互联网中的带宽、 交换结点中的缓存和处理机等, 都是移动互联网的 资源。 在某段时间, 若对网络中某一资源的需求超过了该资源所能提供的可用 部分, 网络的性能就会变坏, 从而产生网络拥塞的情况。 为了解决网络拥塞的 问题, 现有技术是通过 TCP的拥塞控制策略来防止过多的数据注入网络中, 这 样可以使网络中的路由器或链路不致过载。 具体地, TCP使用一种窗口机制来 控制数据流。 更具体地, 当一个连接建立时, 连接的每一端分配一个缓冲区来 保存输入的数据, 并将缓冲区的尺寸发送给另一端。 当数据到达时, 接收方发 送确认, 其中包含了自己剩余的缓冲区尺寸。 其中, 剩余的缓冲区空间的大小 被称为窗口, 指出窗口大小的通知称为窗口通告。
然而, TCP基于窗口的拥塞控制并不够好。如果通过单线程进行文件下载, 由于 TCP窗口大小的限制, 单线程下载很难充分利用网络带宽, 并且文件的下 载速度不能得到充分的发挥。 发明内容
有鉴于此, 本申请实施例所解决的技术问题之一在于提供一种目标文件下 载的方案, 以解决现有技术中存在的无法充分利用移动终端的网络带宽来提高 目标文件的下载速度的问题。
本申请实施例提供了一种目标文件的下载方法, 所述方法包括: 检测所述 移动终端中的目标文件的下载速度; 基于所述目标文件的下载速度与所述移动
终端的最大带宽, 调整用于所述目标文件下载的网络线程的数量。
本申请实施例还提供了一种目标文件的下载装置, 所述装置包括: 第一检 测模块, 被配置为检测所述移动终端中的目标文件的下载速度; 调整模块, 被 配置为基于所述目标文件的下载速度与所述移动终端的最大带宽, 调整用于所 述目标文件下载的网络线程的数量。
本申请实施例还提供了一种设备 /终端 /服务器,包括:一个或多个处理器; 存储装置, 配置为存储一个或多个程序; 当所述一个或多个程序被所述一个或 多个处理器执行, 使得所述一个或多个处理器实现如上所述的目标文件的下载 方法。
本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序, 该程序被处理器执行时实现如上所述的目标文件的下载方法。
通过本申请实施例提供的目标文件下载的技术方案, 检测移动终端中的目 标文件的下载速度, 并基于目标文件的下载速度与移动终端的最大带宽, 调整 用于目标文件下载的网络线程的数量, 与现有的其它方式相比, 能够充分利用 移动终端的网络带宽来提高目标文件的下载速度。 附图说明
后文将参照附图以示例性而非限制性的方式详细描述本申请实施例的一些 具体实施例。 附图中相同的附图标记标示了相同或类似的部件或部分。 本领域 技术人员应该理解, 这些附图未必是按比例绘制的。 附图中:
图 1是根据本申请实施例一的一种目标文件的下载方法的步骤流程图; 图 2是根据本申请实施例二的一种目标文件的下载方法的步骤流程图; 图 3是根据本申请实施例三的一种目标文件的下载装置的结构框图; 图 4是根据本申请实施例四的一种目标文件的下载装置的结构框图; 图 5是根据本申请实施例五的一种目标文件的下载装置的结构框图; 图 6是根据本申请实施例六的一种设备 /终端 /服务器的结构示意图。 具体实施方式
为了使本领域的人员更好地理解本申请实施例中的技术方案, 下面将结合 本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述, 显然,所描述的实施例仅是本申请实施例一部分实施例,而不是全部的实施例。 基于本申请实施例中的实施例,本领域普通技术人员所获得的所有其他实施例,
都应当属于本申请实施例保护的范围。 实施例一
参照图 1, 示出了根据本申请实施例一的一种目标文件的下载方法的步骤 流程图。
本实施例的目标文件的下载方法包括以下步骤:
步骤 S101: 检测所述移动终端中的目标文件的下载速度。
在本申请实施例中, 所述移动终端可包括以下中的至少一者: 车载设备、 娱乐设备、 广告设备、 个人数码助理 (PDA) 、 平板电脑、 笔记本电脑、 掌上 游戏机、智能眼镜、智能手表、可穿戴设备、虚拟显示设备或显示增强设备(如 Google Glass、 Oculus Rift、 Hololens、 Gear VR) 。 所述目标文件可包括以下中 的至少一者: 文本、 图片、 视频帧序列、 压缩包、 安装包。 可以理解的是, 以 上描述仅为示例性的, 本申请实施例对此不做任何限定。
在一些可选实施例中, 可通过移动终端的相应客户端检测目标文件的下载 速度。 可以理解的是, 对目标文件的下载速度进行检测可以由本领域技术人员 根据实际需求采用任意适当的检测方式实现,本申请实施例对此不做任何限定。
步骤 S102: 基于所述目标文件的下载速度与所述移动终端的最大带宽, 调 整用于所述目标文件下载的网络线程的数量。
在本申请实施例中, 通过移动终端执行下载任务时, 需要将移动终端连接 上网络后下载所需要的目标文件, 其连接网络时所处的网络环境通常包括移动 网络和 WiFi网络。其中,移动网络包括常见的 2G网络、 3G网络、 4G网络等。 WiFi网络使用 WiFi无线信号使移动终端可以不通过 2G网络、 3G网络、 4G网 络等移动网络进行无线上网。此外,通过 WiFi网络上网的稳定性以及数据交互 速度都要明显优于 2G网络、 3G网络、 4G网络等移动网络。 由此可见, 移动 终端在执行下载任务时, 移动终端的网络带宽是变化的, 需要实时检测和比较 才能获得移动终端的最大带宽。 在一些可选实施例中, 检测所述移动终端在单 位时间内的下行流量值; 根据所述移动终端在单位时间内的下行流量值, 确定 所述移动终端的当前带宽; 如果所述移动终端的当前带宽大于预先确定的最大 带宽, 则确定所述移动终端的当前带宽为所述移动终端的最大带宽。 其中, 所 述移动终端在单位时间内的下行流量值包括所述移动终端在单位时间内下载文 件或者接收访问对象的反馈时产生的流量。 可以理解的是, 任何确定移动终端 的最大带宽的实施方式均可适用于此, 本申请实施例对此不做任何限定。
在一些可选实施例中, 在确定所述移动终端的当前带宽时, 可基于所述移 动终端在单位时间内的下行流量值换算得到所述移动终端的当前带宽。 可以理 解的是, 以上描述仅为示例性的, 本申请实施例对此不做任何限定。
在一个具体的例子中, 可首先获取本地存储的终端设备的最大带宽数值, 赋值变量, 然后启动定时检测移动终端下行流量的后台服务, 获取移动终端的 当前带宽数值。 如果移动终端的当前带宽数值大于预先确定的移动终端的最大 带宽,则使用移动终端的当前带宽数值更新移动终端的最大带宽,并赋值变量。 如果移动终端的当前带宽数值小于或等于预先确定的移动终端的最大带宽, 则 间隔预设时间段再次获取移动终端的带宽数值。 重复上述过程, 实时更新移动 终端的最大带宽。 其中, 所述预设时间段可由本领域技术人员根据实际需要进 行设定, 本申请实施例对此不做任何限定。 可以理解的是, 以上描述仅为示例 性的, 本申请实施例对此不做任何限定。
在本申请实施例中, 所述网络线程可理解为下载通道, 一个网络线程就是 一个目标文件的下载通道, 多个网络线程也就是同时开启多个下载通道对目标 文件进行下载。 通过开启多个网络线程对目标文件进行下载, 能够提高移动终 端的网络带宽的利用率, 并提高目标文件的下载速度。 可以理解的是, 以上描 述仅为示例性的, 本申请实施例对此不做任何限定。
在具体的实施方式中,在调整用于所述目标文件下载的网络线程的数量时, 可朝着既能充分利用移动终端的网络带宽又能提高目标文件的下载速度的方向 进行调整。 可以理解的是, 以上描述仅为示例性的, 本申请实施例对此不做任 何限定。
通过本申请实施例提供的目标文件的下载方法, 检测移动终端中的目标文 件的下载速度, 并基于目标文件的下载速度与移动终端的最大带宽, 调整用于 目标文件下载的网络线程的数量, 与现有的其它方式相比, 能够充分利用移动 终端的网络带宽来提高目标文件的下载速度。
本实施例的目标文件的下载方法可以由任意适当的具有数据处理能力的设 备执行,包括但不限于:车载设备、娱乐设备、广告设备、个人数码助理 (PDA)、 平板电脑、 笔记本电脑、 掌上游戏机、 智能眼镜、 智能手表、 可穿戴设备、 虚 拟显示设备或显示增强设备 (如 Google Glass、 Oculus Rift、 Hololens、 Gear VR) 等。
实施例二
参照图 2, 示出了根据本申请实施例二的一种目标文件的下载方法的步骤 流程图。
本实施例的目标文件的下载方法包括以下步骤:
在步骤 S201中, 检测所述移动终端中的目标文件的下载速度。
由于该步骤 S201与上述步骤 S101类似, 在此不再赘述。
在步骤 S202 中, 确定所述目标文件的下载速度与所述移动终端的最大带 宽的比值是否小于预设比值。
在一些可选实施例中, 所述预设比值可为 80%。 可以理解的是, 所述预设 比值可由本领域技术人员根据实际需要进行设定, 本申请实施例对此不做任何 限定。
在确定所述目标文件的下载速度与所述移动终端的最大带宽的比值等于或 大于预设比值时, 则说明用于目标文件下载的网络线程的数量已经达到充分利 用移动终端的最大带宽来对目标文件进行下载的标准, 此时, 不需要调整用于 目标文件下载的网络线程的数量。 可以理解的是, 以上描述仅为示例性的, 本 申请实施例对此不做任何限定。
在本申请实施例中, 增加网络线程的数量后, 目标文件的下载速度增加, 并增加对移动终端的网络带宽的占用,而移动终端的***中正在运行任务里面, 需要占用一定带宽的并不一定只有下载任务, 如果下载任务将带宽全部占用, 将会对其他任务的正常工作造成极大影响,所以为了保证其他任务的正常工作, 又能使下载任务占用尽量多的带宽, 达到尽量快的下载速度, 可以为下载任务 设置所述预设比值。
在步骤 S203 中, 如果确定所述目标文件的下载速度与所述移动终端的最 大带宽的比值小于预设比值时, 确定用于目标文件下载的网络线程的当前数量 是否小于预设数量。
其中, 所述预设数量可由本领域技术人员根据实际需要进行设定, 本申请 实施例对此不做任何限定。
在确定用于目标文件下载的网络线程的当前数量大于或等于预设数量时, 则说明当前用于目标文件下载的网络线程的数量超出了移动终端的数据传输压 力, 此时, 不需要调整用于目标文件下载的网络线程的数量。 可以理解的是, 以上描述仅为示例性的, 本申请实施例对此不做任何限定。
在本申请实施例中, 移动终端各种任务的正常工作并不只需要带宽, 还需
要各种 CPU资源和内存资源等***资源。当用于目标文件下载的网络线程的数 量超过预设数量时,目标文件下载任务占用的 CPU资源和内存资源超过预设阈 值, 使得移动终端没有足够的***资源来保证其他任务的正常工作。 因此, 为 了保证移动终端的其他任务的正常工作, 可以为用于目标文件下载的网络线程 的数量设置所述预设数量。
在步骤 S204 中, 如果确定用于目标文件下载的网络线程的当前数量小于 预设数量时, 增加用于所述目标文件下载的网络线程的数量。
在一些可选实施例中, 如果确定用于目标文件下载的网络线程的当前数量 小于预设数量时, 可增加一个用于所述目标文件下载的网络线程。 可以理解的 是, 具体的增加数量可由本领域技术人员根据实际需要进行设定, 本申请实施 例对此不做任何限定。
在一些可选实施例中, 在增加用于所述目标文件下载的网络线程的数量之 后,可利用新增的网络线程,下载所述目标文件的未下载完的文件片段的一半。 籍此, 能够充分利用新增的网络线程对目标文件的未下载完的文件片段进行下 载。可以理解的是,以上描述仅为示例性的,本申请实施例对此不做任何限定。
在步骤 S205中,在增加用于所述目标文件下载的网络线程的数量之后,间 隔预设时间段检测所述目标文件的下载速度。
在一些可选实施例中, 所述预设时间段可为 5秒。 可以理解的是, 所述预 设时间段可由本领域技术人员根据实际需要进行设定, 本申请实施例对此不做 任何限定。
在本申请实施例中, 间隔预设时间段检测所述目标文件的下载速度, 能够 避免目标文件的下载速度尚未达到稳定状态时对目标文件的下载速度进行检测 造成检测结果不准确的问题。
在本申请实施例中, 如果确定所述目标文件的下载速度与所述移动终端的 最大带宽的比值小于预设比值, 并且确定用于目标文件下载的网络线程的当前 数量小于预设数量时, 则继续增加用于所述目标文件下载的网络线程的数量。 也就是说, 重复执行本申请实施例中的步骤 S202至步骤 S205, 直到移动终端 中的目标文件下载完为止。
在本申请实施例中, 当所有网络线程的下载任务都已完成时, 将所有网络 线程下载的文件片段组合成目标文件。
通过本申请实施例提供的目标文件的下载方法, 检测移动终端中的目标文 件的下载速度, 如果确定所述目标文件的下载速度与所述移动终端的最大带宽
的比值小于预设比值, 并且确定用于目标文件下载的网络线程的当前数量小于 预设数量时, 则增加用于所述目标文件下载的网络线程的数量, 与现有的其它 方式相比, 在保证移动终端除下载任务之外的其他任务正常工作的情况下, 能 够充分利用移动终端的网络带宽来提高目标文件的下载速度。
本实施例的目标文件的下载方法可以由任意适当的具有数据处理能力的设 备执行,包括但不限于:车载设备、娱乐设备、广告设备、个人数码助理 (PDA)、 平板电脑、 笔记本电脑、 掌上游戏机、 智能眼镜、 智能手表、 可穿戴设备、 虚 拟显示设备或显示增强设备 (如 Google Glass、 Oculus Rift、 Hololens、 Gear VR) 等。 实施例三
参照图 3 , 示出了根据本申请实施例三的一种目标文件的下载装置的结构 框图。
本实施例的目标文件的下载装置包括: 第一检测模块 301, 被配置为检测 所述移动终端中的目标文件的下载速度; 调整模块 302, 被配置为基于所述目 标文件的下载速度与所述移动终端的最大带宽, 调整用于所述目标文件下载的 网络线程的数量。
本实施例的目标文件的下载装置用于实现前述多个方法实施例中相应的目 标文件的下载方法, 并具有相应的方法实施例的有益效果, 在此不再赘述。 实施例四
参照图 4, 示出了根据本申请实施例四的一种目标文件的下载装置的结构 框图。
本实施例的目标文件的下载装置包括: 第一检测模块 401, 被配置为检测 所述移动终端中的目标文件的下载速度; 调整模块 405 , 被配置为基于所述目 标文件的下载速度与所述移动终端的最大带宽, 调整用于所述目标文件下载的 网络线程的数量。
可选地, 在所述调整模块之前, 所述装置还包括: 第二检测模块 402, 被配 置为检测所述移动终端在单位时间内的下行流量值; 第一确定模块 403 , 被配 置为根据所述移动终端在单位时间内的下行流量值, 确定所述移动终端的当前 带宽; 第二确定模块 404, 被配置为如果所述移动终端的当前带宽大于预先确 定的最大带宽, 则确定所述移动终端的当前带宽为所述移动终端的最大带宽。
可选地, 所述调整模块 405 , 包括: 第一增加模块 4051, 被配置为如果所 述目标文件的下载速度与所述移动终端的最大带宽的比值小于预设比值, 则增 加用于所述目标文件下载的网络线程的数量。
可选地, 所述装置还包括: 第三检测模块 406, 被配置为在增加所述网络 线程的数量之后, 间隔预设时间段检测所述目标文件的下载速度; 第二增加模 块 407, 被配置为如果所述目标文件的下载速度与所述移动终端的最大带宽的 比值小于所述预设比值,则继续增加用于所述目标文件下载的网络线程的数量。
本实施例的目标文件的下载装置用于实现前述多个方法实施例中相应的目 标文件的下载方法, 并具有相应的方法实施例的有益效果, 在此不再赘述。 实施例五
参照图 5 , 示出了根据本申请实施例五的一种目标文件的下载装置的结构 框图。
本实施例的目标文件的下载装置包括: 第一检测模块 501, 被配置为检测 所述移动终端中的目标文件的下载速度; 调整模块 502, 被配置为基于所述目 标文件的下载速度与所述移动终端的最大带宽, 调整用于所述目标文件下载的 网络线程的数量。
可选地, 所述调整模块 502, 包括: 第一增加模块 5021, 被配置为如果所 述目标文件的下载速度与所述移动终端的最大带宽的比值小于预设比值, 则增 加用于所述目标文件下载的网络线程的数量。
可选地,所述装置还包括:下载模块 503 ,被配置为利用新增的网络线程, 下载所述目标文件的未下载完的文件片段的一半。
可选地,在所述第二增加模块之前,所述装置还包括:第三确定模块 504, 被配置为确定所述网络线程的当前数量是否小于预设数量;第三增加模块 505 , 被配置为若所述网络线程的当前数量小于所述预设数量, 则继续增加用于所述 目标文件下载的网络线程的数量。
本实施例的目标文件的下载装置用于实现前述多个方法实施例中相应的目 标文件的下载方法, 并具有相应的方法实施例的有益效果, 在此不再赘述。 实施例六
参照图 6, 示出了根据本申请实施例六的一种设备 /终端 /服务器的结构示 意图, 本申请具体实施例并不对设备 /终端 /服务器的具体实现做限定。
如图 6所示, 该设备 /终端 /服务器可以包括: 处理器 (processor)601、 存储 装置 602。
其中:
处理器 601,用于执行程序 603,具体可以执行上述目标文件的下载方法实 施例中的相关步骤。
具体地, 程序 603可以包括程序代码, 该程序代码包括计算机操作指令。 处理器 601可能是中央处理器 CPU,或者是特定集成电路 ASIC( Application Specific Integrated Circuit ),或者是被配置成实施本申请实施例的一个或多个集 成电路。 设备 /终端 /服务器包括的一个或多个处理器, 可以是同一类型的处理 器, 如一个或多个 CPU; 也可以是不同类型的处理器, 如一个或多个 CPU以 及一个或多个 ASIC。
存储装置 602,配置为存放一个或多个程序 603。存储装置 602可能包含高 速 RAM存储器, 也可能还包括非易失性存储器 ( non-volatile memory ) , 例如 至少一个磁盘存储器。
程序 603具体可以用于使得处理器 601执行以下操作: 检测所述移动终端 中的目标文件的下载速度; 基于所述目标文件的下载速度与所述移动终端的最 大带宽, 调整用于所述目标文件下载的网络线程的数量。
在一种可选的实施方式中, 程序 603还用于使得处理器 601在所述调整用 于所述目标文件下载的网络线程的数量之前, 检测所述移动终端在单位时间内 的下行流量值; 根据所述移动终端在单位时间内的下行流量值, 确定所述移动 终端的当前带宽; 如果所述移动终端的当前带宽大于预先确定的最大带宽, 则 确定所述移动终端的当前带宽为所述移动终端的最大带宽。
在一种可选的实施方式中, 程序 603还用于使得处理器 601在基于所述目 标文件的下载速度与所述移动终端的最大带宽, 调整用于所述目标文件下载的 网络线程的数量时, 如果所述目标文件的下载速度与所述移动终端的最大带宽 的比值小于预设比值, 则增加用于所述目标文件下载的网络线程的数量。
在一种可选的实施方式中, 程序 603还用于使得处理器 601利用新增的网 络线程, 下载所述目标文件的未下载完的文件片段的一半。
在一种可选的实施方式中, 程序 603还用于使得处理器 601在增加所述网 络线程的数量之后, 间隔预设时间段检测所述目标文件的下载速度; 如果所述 目标文件的下载速度与所述移动终端的最大带宽的比值小于所述预设比值, 则 继续增加用于所述目标文件下载的网络线程的数量。
在一种可选的实施方式中, 程序 603还用于使得处理器 601在所述继续增 加用于所述目标文件下载的网络线程的数量之前, 确定所述网络线程的当前数 量是否小于预设数量; 若所述网络线程的当前数量小于所述预设数量, 则继续 增加用于所述目标文件下载的网络线程的数量。
程序 603中各步骤的具体实现可以参见上述目标文件的下载方法实施例中 的相应步骤和单元中对应的描述, 在此不赘述。 所属领域的技术人员可以清楚 地了解到, 为描述的方便和简洁, 上述描述的设备和模块的具体工作过程, 可 以参考前述方法实施例中的对应过程描述, 在此不再赘述。
通过本实施例的设备 /终端 /服务器, 检测移动终端中的目标文件的下载速 度, 并基于目标文件的下载速度与移动终端的最大带宽, 调整用于目标文件下 载的网络线程的数量, 与现有的其它方式相比, 能够充分利用移动终端的网络 带宽来提高目标文件的下载速度。
需要指出, 根据实施的需要, 可将本申请实施例中描述的各个部件 /步骤拆 分为更多部件 /步骤, 也可将两个或多个部件 /步骤或者部件 /步骤的部分操作组 合成新的部件 /步骤, 以实现本申请实施例的目的。
特别地, 根据本申请实施例, 上文参考流程图描述的过程可以被实现为计 算机软件程序。 例如, 本申请实施例包括一种计算机程序产品, 其包括承载在 计算机可读介质上的计算机程序, 该计算机程序包含用于执行上文多个方法实 施例中所示的方法的程序代码。 在这样的实施例中, 该计算机程序可以通过通 信部分从网络上被下载和安装, 和 /或从可拆卸介质被安装。在该计算机程序被 中央处理单元 (CPU) 执行时, 执行本申请实施例示出的方法中限定的上述功 會 L 需要说明的是, 本申请所述的计算机可读介质可以是计算机可读信号介质 或者计算机可读存储介质或者是上述两者的任意组合。 计算机可读存储介质例 如可以是, 但不限于, 电、 磁、 光、 电磁、 红外线、 或半导体的***、 装置或 器件, 或者任意以上的组合。 计算机可读存储介质的更具体的例子可以包括但 不限于: 具有一个或多个导线的电连接、 便携式计算机磁盘、 硬盘、 随机访问 存储装置( RAM)、只读存储装置( ROM)、可擦式可编程只读存储装置( EPROM 或闪存)、光纤、便携式紧凑磁盘只读存储装置(CD-ROM)、光存储装置件、 磁存储装置件、 或者上述的任意合适的组合。 在本申请中, 计算机可读存储介 质可以是任何包含或存储程序的有形介质, 该程序可以被指令执行***、 装置 或者器件使用或者与其结合使用。 而在本申请中, 计算机可读的信号介质可以 包括在基带中或者作为载波一部分传播的数据信号, 其中承载了计算机可读的
程序代码。 这种传播的数据信号可以采用多种形式, 包括但不限于电磁信号、 光信号或上述的任意合适的组合。 计算机可读的信号介质还可以是计算机可读 存储介质以外的任何计算机可读介质, 该计算机可读介质可以发送、 传播或者 传输用于由指令执行***、 装置或者器件使用或者与其结合使用的程序。 计算 机可读介质上包含的程序代码可以用任何适当的介质传输, 包括但不限于: 无 线、 电线、 光缆、 RF等等, 或者上述的任意合适的组合。
可以以一种或多种程序设计语言或其组合来编写用于执行本申请的操作的 计算机程序代码, 所述程序设计语言包括面向对象的程序设计语言 ------诸如
Java、 Smalltalk, C++, 还包括常规的过程式程序设计语言 诸如” C”语言 或类似的程序设计语言。 程序代码可以完全地在用户计算机上执行、 部分地在 用户计算机上执行、 作为一个独立的软件包执行、 部分在用户计算机上部分在 远程计算机上执行、 或者完全在远程计算机或服务器上执行。 在涉及远程计算 机的情形中, 远程计算机可以通过任意种类的网络 ------包括局域网 (LAN)或广 域网 (WAN) 连接到用户计算机, 或者, 可以连接到外部计算机 (例如利用 因特网服务提供商来通过因特网连接) 。
附图中的流程图和框图, 图示了按照本申请各种实施例的***、 方法和计 算机程序产品的可能实现的体系架构、 功能和操作。 在这点上, 流程图或框图 中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、 或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。 也应 当注意, 在有些作为替换的实现中, 方框中所标注的功能也可以以不同于附图 中所标注的顺序发生。 例如, 两个接连地表示的方框实际上可以基本并行地执 行, 它们有时也可以按相反的顺序执行, 这依所涉及的功能而定。 也要注意的 是, 框图和 /或流程图中的每个方框、 以及框图和 /或流程图中的方框的组合, 可 以用执行规定的功能或操作的专用的基于硬件的***来实现, 或者可以用专用 硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现, 也可以 通过硬件的方式来实现。 所描述的单元也可以设置在处理器中, 例如, 可以描 述为: 一种处理器包括获取单元、 处理单元、 和测试单元。 其中, 这些单元的 名称在某种情况下并不构成对该单元本身的限定, 例如, 获取单元还可以被描 述为“根据测试指令获取待测试目标对象的业务测试文件的单元” 。
作为另一方面, 本申请还提供了一种计算机可读存储介质, 其上存储有计 算机程序, 该程序被处理器执行时实现如上述任一实施例所描述的方法。
作为另一方面, 本申请还提供了一种计算机可读介质, 该计算机可读介质 可以是上述实施例中描述的装置中所包含的; 也可以是单独存在, 而未装配入 该装置中。 上述计算机可读介质承载有一个或者多个程序, 当上述一个或者多 个程序被该装置执行时, 使得该装置所在的移动终端检测所述移动终端中的目 标文件的下载速度;基于所述目标文件的下载速度与所述移动终端的最大带宽, 调整用于所述目标文件下载的网络线程的数量。
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。 本领域 技术人员应当理解, 本申请中所涉及的发明范围, 并不限于上述技术特征的特 定组合而成的技术方案, 同时也应涵盖在不脱离上述发明构思的情况下, 由上 述技术特征或其等同特征进行任意组合而形成的其它技术方案。 例如上述特征 与本申请中公开的 (但不限于) 具有类似功能的技术特征进行互相替换而形成 的技术方案。
Claims
1、 一种目标文件的下载方法, 其特征在于, 所述方法包括:
检测所述移动终端中的目标文件的下载速度;
基于所述目标文件的下载速度与所述移动终端的最大带宽, 调整用于所述 目标文件下载的网络线程的数量。
2、根据权利要求 1所述的方法, 其特征在于, 在所述调整用于所述目标文 件下载的网络线程的数量之前, 所述方法还包括:
检测所述移动终端在单位时间内的下行流量值;
根据所述移动终端在单位时间内的下行流量值, 确定所述移动终端的当前 带宽;
如果所述移动终端的当前带宽大于预先确定的最大带宽, 则确定所述移动 终端的当前带宽为所述移动终端的最大带宽。
3、根据权利要求 1所述的方法, 其特征在于, 所述基于所述目标文件的下 载速度与所述移动终端的最大带宽, 调整用于所述目标文件下载的网络线程的 数量, 包括:
如果所述目标文件的下载速度与所述移动终端的最大带宽的比值小于预设 比值, 则增加用于所述目标文件下载的网络线程的数量。
4、 根据权利要求 3所述的方法, 其特征在于, 所述方法还包括: 利用新增的网络线程, 下载所述目标文件的未下载完的文件片段的一半。
5、 根据权利要求 3所述的方法, 其特征在于, 所述方法还包括: 在增加所述网络线程的数量之后, 间隔预设时间段检测所述目标文件的下 载速度;
如果所述目标文件的下载速度与所述移动终端的最大带宽的比值小于所述 预设比值, 则继续增加用于所述目标文件下载的网络线程的数量。
6、根据权利要求 5所述的方法, 其特征在于, 在所述继续增加用于所述目 标文件下载的网络线程的数量之前, 所述方法还包括:
确定所述网络线程的当前数量是否小于预设数量;
若所述网络线程的当前数量小于所述预设数量, 则继续增加用于所述目标 文件下载的网络线程的数量。
7、 一种目标文件的下载装置, 其特征在于, 所述装置包括:
第一检测模块, 被配置为检测所述移动终端中的目标文件的下载速度;
调整模块, 被配置为基于所述目标文件的下载速度与所述移动终端的最大 带宽, 调整用于所述目标文件下载的网络线程的数量。
8、 根据权利要求 7所述的装置, 其特征在于, 在所述调整模块之前, 所述 装置还包括:
第二检测模块, 被配置为检测所述移动终端在单位时间内的下行流量值; 第一确定模块, 被配置为根据所述移动终端在单位时间内的下行流量值, 确定所述移动终端的当前带宽;
第二确定模块, 被配置为如果所述移动终端的当前带宽大于预先确定的最 大带宽, 则确定所述移动终端的当前带宽为所述移动终端的最大带宽。
9、 根据权利要求 7所述的装置, 其特征在于, 所述调整模块, 包括: 第一增加模块, 被配置为如果所述目标文件的下载速度与所述移动终端的 最大带宽的比值小于预设比值, 则增加用于所述目标文件下载的网络线程的数 量。
10、 根据权利要求 9所述的装置, 其特征在于, 所述装置还包括: 下载模块, 被配置为利用新增的网络线程, 下载所述目标文件的未下载完 的文件片段的一半。
11、 根据权利要求 9所述的装置, 其特征在于, 所述装置还包括: 第三检测模块, 被配置为在增加所述网络线程的数量之后, 间隔预设时间 段检测所述目标文件的下载速度;
第二增加模块, 被配置为如果所述目标文件的下载速度与所述移动终端的 最大带宽的比值小于所述预设比值, 则继续增加用于所述目标文件下载的网络 线程的数量。
12、根据权利要求 11所述的装置,其特征在于,在所述第二增加模块之前, 所述装置还包括:
第三确定模块,被配置为确定所述网络线程的当前数量是否小于预设数量; 第三增加模块, 被配置为若所述网络线程的当前数量小于所述预设数量, 则继续增加用于所述目标文件下载的网络线程的数量。
13、 一种设备 /终端 /服务器, 包括:
一个或多个处理器;
存储装置, 配置为存储一个或多个程序;
当所述一个或多个程序被所述一个或多个处理器执行, 使得所述一个或多 个处理器实现如权利要求 1-6中任意一项权利要求所述的目标文件的下载方法。
14、 一种计算机可读存储介质, 其上存储有计算机程序, 该程序被处 理器执行时实现如权利要求 1-6中任意一项权利要求所述的目标文件的下 载方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810858653.1A CN109040230B (zh) | 2018-07-31 | 2018-07-31 | 文件的下载方法、装置、设备/终端/服务器及存储介质 |
CN201810858653.1 | 2018-07-31 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020026018A1 true WO2020026018A1 (zh) | 2020-02-06 |
Family
ID=64648017
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/IB2018/056504 WO2020026018A1 (zh) | 2018-07-31 | 2018-08-27 | 文件的下载方法、装置、设备/终端/服务器及存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109040230B (zh) |
WO (1) | WO2020026018A1 (zh) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112055036A (zh) * | 2019-06-05 | 2020-12-08 | 阿里巴巴集团控股有限公司 | 数据下载方法、装置、设备、***及可读存储介质 |
CN110784520A (zh) * | 2019-09-30 | 2020-02-11 | 北京字节跳动网络技术有限公司 | 文件下载方法、装置及电子设备 |
CN111142900A (zh) * | 2019-12-17 | 2020-05-12 | 深圳市优必选科技股份有限公司 | 程序更新方法、装置及终端设备 |
CN113452733A (zh) * | 2020-03-25 | 2021-09-28 | 北京沃东天骏信息技术有限公司 | 文件下载方法和装置 |
CN112286683A (zh) * | 2020-10-29 | 2021-01-29 | 北京小米移动软件有限公司 | 一种分片下载方法、装置及介质 |
CN113556408B (zh) * | 2021-09-23 | 2022-02-22 | 统信软件技术有限公司 | 一种任务下载方法、装置、计算设备及存储介质 |
CN113891170B (zh) * | 2021-11-23 | 2024-05-03 | 维沃移动通信有限公司 | 下载方法、装置、电子设备及存储介质 |
CN114629895B (zh) * | 2022-03-22 | 2023-10-13 | 平安证券股份有限公司 | 一种文件分片断点续传方法、装置、终端设备及介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120271880A1 (en) * | 2011-04-19 | 2012-10-25 | Accenture Global Services Limited | Content transfer accelerator |
CN102811258A (zh) * | 2012-07-27 | 2012-12-05 | 北京星网锐捷网络技术有限公司 | 数据并发下载方法、装置和网络设备 |
US20140026140A1 (en) * | 2012-07-17 | 2014-01-23 | Adobe Systems Inc. | Method and apparatus for optimizing download operations |
CN106161524A (zh) * | 2015-04-03 | 2016-11-23 | ***通信集团上海有限公司 | 一种基于分布式资源节点的资源下载方法及装置 |
CN106254566A (zh) * | 2016-10-31 | 2016-12-21 | 乐视控股(北京)有限公司 | 一种数据下载处理方法及装置 |
CN106998349A (zh) * | 2016-10-18 | 2017-08-01 | 深圳大宇无限科技有限公司 | 多线程下载方法和装置 |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103391454B (zh) * | 2013-07-12 | 2016-12-28 | 三星电子(中国)研发中心 | 一种多线程下载方法和装置 |
CN104967619B (zh) * | 2015-06-17 | 2018-09-04 | 深圳市腾讯计算机***有限公司 | 文件推送方法、装置和*** |
US20170142186A1 (en) * | 2015-11-17 | 2017-05-18 | Le Holdings (Beijing) Co., Ltd. | Method, apparatus, and electronic device for downloading files |
CN105873022A (zh) * | 2015-12-07 | 2016-08-17 | 乐视移动智能信息技术(北京)有限公司 | 移动终端下载方法及装置 |
US10003634B2 (en) * | 2016-05-14 | 2018-06-19 | Richard Banister | Multi-threaded download with asynchronous writing |
CN107786583A (zh) * | 2016-08-24 | 2018-03-09 | 中兴通讯股份有限公司 | 一种文件下载方法及装置 |
-
2018
- 2018-07-31 CN CN201810858653.1A patent/CN109040230B/zh active Active
- 2018-08-27 WO PCT/IB2018/056504 patent/WO2020026018A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120271880A1 (en) * | 2011-04-19 | 2012-10-25 | Accenture Global Services Limited | Content transfer accelerator |
US20140026140A1 (en) * | 2012-07-17 | 2014-01-23 | Adobe Systems Inc. | Method and apparatus for optimizing download operations |
CN102811258A (zh) * | 2012-07-27 | 2012-12-05 | 北京星网锐捷网络技术有限公司 | 数据并发下载方法、装置和网络设备 |
CN106161524A (zh) * | 2015-04-03 | 2016-11-23 | ***通信集团上海有限公司 | 一种基于分布式资源节点的资源下载方法及装置 |
CN106998349A (zh) * | 2016-10-18 | 2017-08-01 | 深圳大宇无限科技有限公司 | 多线程下载方法和装置 |
CN106254566A (zh) * | 2016-10-31 | 2016-12-21 | 乐视控股(北京)有限公司 | 一种数据下载处理方法及装置 |
Also Published As
Publication number | Publication date |
---|---|
CN109040230A (zh) | 2018-12-18 |
CN109040230B (zh) | 2021-06-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020026018A1 (zh) | 文件的下载方法、装置、设备/终端/服务器及存储介质 | |
US10594606B2 (en) | Wired data-connection aggregation | |
US10025614B2 (en) | Setting retransmission time of an application client during virtual machine migration | |
US10754686B2 (en) | Method and electronic device for application migration | |
US11582146B2 (en) | High-quality adaptive bitrate video through multiple links | |
US20150117199A1 (en) | Multi-Level iSCSI QoS for Target Differentiated Data in DCB Networks | |
US20130100955A1 (en) | Technique for prioritizing traffic at a router | |
US9769012B2 (en) | Notification normalization | |
CN113381944B (zh) | ***限流方法、装置、电子设备、介质和程序产品 | |
CN112261094A (zh) | 一种报文处理方法及代理服务器 | |
CN113285931A (zh) | 流媒体的传输方法、流媒体服务器及流媒体*** | |
US9363199B1 (en) | Bandwidth management for data services operating on a local network | |
US9819591B2 (en) | System and method of providing compression technique for jitter sensitive application through multiple network links | |
CN114039926B (zh) | 传输控制协议确定方法、装置、可读介质及电子设备 | |
CN110764892A (zh) | 任务处理方法、设备及计算机可读存储介质 | |
US10666565B2 (en) | Method to measure relative QOS gains and to reduce the variance in QOS for similar connections for during bandwidth contention | |
WO2022057131A1 (zh) | 数据拥塞处理方法、装置、计算机设备和存储介质 | |
US10681398B1 (en) | Video encoding based on viewer feedback | |
US11218394B1 (en) | Dynamic modifications to directional capacity of networking device interfaces | |
US11528187B1 (en) | Dynamically configurable networking device interfaces for directional capacity modifications | |
CN111200561B (zh) | 数据包传输方法和装置、计算机***和可读存储介质 | |
WO2023083367A1 (zh) | 文件后台续传方法、装置、存储介质及电子设备 | |
US20130060960A1 (en) | Optimizing software applications in a network | |
CN113824689A (zh) | 边缘计算网络、数据传输方法、装置、设备和存储介质 | |
US9674282B2 (en) | Synchronizing SLM statuses of a plurality of appliances in a cluster |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18928769 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18928769 Country of ref document: EP Kind code of ref document: A1 |