CN109040230B - File downloading method, device, equipment/terminal/server and storage medium - Google Patents

File downloading method, device, equipment/terminal/server and storage medium Download PDF

Info

Publication number
CN109040230B
CN109040230B CN201810858653.1A CN201810858653A CN109040230B CN 109040230 B CN109040230 B CN 109040230B CN 201810858653 A CN201810858653 A CN 201810858653A CN 109040230 B CN109040230 B CN 109040230B
Authority
CN
China
Prior art keywords
target file
downloading
mobile terminal
network
network threads
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810858653.1A
Other languages
Chinese (zh)
Other versions
CN109040230A (en
Inventor
张志毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Youshi Technology Singapore Co ltd
Original Assignee
Youshi Technology Singapore Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Youshi Technology Singapore Co ltd filed Critical Youshi Technology Singapore Co ltd
Priority to CN201810858653.1A priority Critical patent/CN109040230B/en
Priority to PCT/IB2018/056504 priority patent/WO2020026018A1/en
Publication of CN109040230A publication Critical patent/CN109040230A/en
Application granted granted Critical
Publication of CN109040230B publication Critical patent/CN109040230B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the application provides a method and a device for downloading a target file, equipment/a terminal/a server and a computer readable storage medium, and relates to the field of mobile internet. The target file downloading method comprises the following steps: detecting the downloading speed of a target file in the mobile terminal; and adjusting the number of network threads for downloading the target file based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal. By the embodiment of the application, the network bandwidth of the mobile terminal can be fully utilized to improve the downloading speed of the target file.

Description

File downloading method, device, equipment/terminal/server and storage medium
Technical Field
The embodiment of the application relates to the field of mobile internet, in particular to a method and a device for downloading a target file, equipment/terminal/server and a computer readable storage medium.
Background
The bandwidth in the mobile internet, the cache and the processor in the switching node, etc. are all resources of the mobile internet. If, at some point in time, the demand for a resource in the network exceeds the available portion of the network that the resource can provide, the performance of the network may deteriorate, thereby creating a congested network. In order to solve the problem of network congestion, the prior art prevents excessive data injection into the network by using the congestion control strategy of TCP, so that routers or links in the network are not overloaded. In particular, TCP uses a windowing mechanism to control the flow of data. More specifically, when a connection is established, each end of the connection allocates a buffer to hold incoming data and sends the size of the buffer to the other end. When the data arrives, the receiver sends an acknowledgement containing its remaining buffer size. The size of the remaining buffer space is referred to as a window, and the notification indicating the window size is referred to as a window advertisement.
However, TCP window-based congestion control is not good enough. If the file is downloaded by a single thread, the single thread downloading is difficult to fully utilize the network bandwidth due to the limitation of the size of the TCP window, and the downloading speed of the file cannot be fully exerted.
Disclosure of Invention
In view of the above, one of the technical problems solved by the embodiments of the present application is to provide a target file downloading scheme to solve the problem that the network bandwidth of the mobile terminal cannot be fully utilized to increase the downloading speed of the target file in the prior art.
The embodiment of the application provides a method for downloading a target file, which comprises the following steps: detecting the downloading speed of a target file in the mobile terminal; and adjusting the number of network threads for downloading the target file based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal.
An embodiment of the present application further provides a device for downloading a target file, where the device includes: the first detection module is configured to detect the downloading speed of a target file in the mobile terminal; and the adjusting module is configured to adjust the number of network threads for downloading the target file based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal.
An embodiment of the present application further provides a device/terminal/server, including: one or more processors; a storage configured to store one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method for downloading the object file as described above.
The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the method for downloading the object file as described above.
According to the technical scheme for downloading the target file, the downloading speed of the target file in the mobile terminal is detected, the number of network threads used for downloading the target file is adjusted based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal, and compared with the existing other modes, the downloading speed of the target file can be improved by fully utilizing the network bandwidth of the mobile terminal.
Drawings
Some specific embodiments of the present application will be described in detail hereinafter by way of illustration and not limitation with reference to the accompanying drawings. The same reference numbers in the drawings identify the same or similar elements or components. Those skilled in the art will appreciate that the drawings are not necessarily drawn to scale. In the drawings:
fig. 1 is a flowchart illustrating steps of a method for downloading a target file according to a first embodiment of the present application;
FIG. 2 is a flowchart illustrating steps of a method for downloading a target file according to a second embodiment of the present application;
fig. 3 is a block diagram of a target file downloading apparatus according to a third embodiment of the present application;
fig. 4 is a block diagram of a target file downloading apparatus according to a fourth embodiment of the present application;
fig. 5 is a block diagram of a target file downloading apparatus according to a fifth embodiment of the present application;
fig. 6 is a schematic structural diagram of a device/terminal/server according to a sixth embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application shall fall within the scope of the protection of the embodiments in the present application.
Example one
Referring to fig. 1, a flowchart illustrating steps of a method for downloading a target file according to a first embodiment of the present application is shown.
The method for downloading the target file comprises the following steps:
step S101: and detecting the downloading speed of the target file in the mobile terminal.
In an embodiment of the present application, the mobile terminal may include at least one of: in-vehicle devices, entertainment devices, advertising devices, Personal Digital Assistants (PDAs), tablet computers, laptop computers, handheld game consoles, smart glasses, smart watches, wearable devices, virtual display devices, or display enhancement devices (e.g., Google Glass, accumus Rift, Hololens, Gear VR). The target file may include at least one of: text, pictures, video frame sequences, compression packages, installation packages. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, 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 downloading speed of the target file can be implemented by those skilled in the art by using any appropriate detection method according to actual needs, and this is not limited in this embodiment of the application.
Step S102: and adjusting the number of network threads for downloading the target file based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal.
In the embodiment of the application, when the mobile terminal executes the downloading task, the mobile terminal needs to be connected to a network and then download the required target file, and the network environment where the mobile terminal is connected to the network usually includes a mobile network and a WiFi network. The mobile network includes a common 2G network, a 3G network, a 4G network, and the like. The WiFi network uses WiFi wireless signals to enable the mobile terminal to wirelessly surf the internet without passing through mobile networks such as a 2G network, a 3G network and a 4G network. In addition, the stability and the data interaction speed of surfing the internet through the WiFi network are obviously superior to those of mobile networks such as a 2G network, a 3G network and a 4G network. Therefore, when the mobile terminal executes the downloading task, the network bandwidth of the mobile terminal is changed, and the maximum bandwidth of the mobile terminal can be obtained only by real-time detection and comparison. In some optional embodiments, a downlink flow value of the mobile terminal in a unit time is detected; determining the current bandwidth of the mobile terminal according to the downlink flow value of the mobile terminal in unit time; and if the current bandwidth of the mobile terminal is greater than the maximum bandwidth which is determined in advance, determining the current bandwidth of the mobile terminal as the maximum bandwidth of the mobile terminal. The downlink flow value of the mobile terminal in the unit time comprises the flow generated when the mobile terminal downloads a file in the unit time or receives feedback of an access object. It is understood that any implementation manner for determining the maximum bandwidth of the mobile terminal is applicable to this application, and the embodiment of the present application is not limited to this.
In some optional embodiments, when determining the current bandwidth of the mobile terminal, the current bandwidth of the mobile terminal may be scaled based on a downlink flow rate value of the mobile terminal in a unit time. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, the maximum bandwidth value of the terminal device stored locally may be obtained first, a variable is assigned, and then a background service for detecting downlink traffic of the mobile terminal at regular time is started to obtain the current bandwidth value of the mobile terminal. And if the current bandwidth value of the mobile terminal is larger than the maximum bandwidth of the predetermined mobile terminal, updating the maximum bandwidth of the mobile terminal by using the current bandwidth value of the mobile terminal, and assigning a variable. And if the current bandwidth value of the mobile terminal is less than or equal to the maximum bandwidth of the predetermined mobile terminal, acquiring the bandwidth value of the mobile terminal again at preset time intervals. And repeating the 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, and this is not limited in this embodiment of the application. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In the embodiment of the present application, the network thread may be understood as a download channel, where one network thread is a download channel of a target file, and multiple network threads are configured to open multiple download channels simultaneously to download the target file. The target file is downloaded by starting a plurality of network threads, so that the utilization rate of the network bandwidth of the mobile terminal can be improved, and the downloading speed of the target file is increased. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific embodiment, when the number of network threads used for downloading the target file is adjusted, the adjustment can be performed in a direction of fully utilizing the network bandwidth of the mobile terminal and increasing the downloading speed of the target file. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
According to the target file downloading method provided by the embodiment of the application, the downloading speed of the target file in the mobile terminal is detected, the number of the network threads for downloading the target file is adjusted based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal, and compared with the existing other modes, the downloading speed of the target file can be improved by fully utilizing the network bandwidth of the mobile terminal.
The downloading method of the target file of the present embodiment may be executed by any suitable device with data processing capability, including but not limited to: in-vehicle devices, entertainment devices, advertising devices, Personal Digital Assistants (PDAs), tablet computers, laptop computers, handheld game consoles, smart glasses, smart watches, wearable devices, virtual display devices or display enhancement devices (e.g., Google Glass, accumus Rift, Hololens, Gear VR), and the like.
Example two
Referring to fig. 2, a flowchart illustrating steps of a method for downloading a target file according to a second embodiment of the present application is shown.
The method for downloading the target file comprises the following steps:
in step S201, a download speed of a target file in the mobile terminal is detected.
Since step S201 is similar to step S101 described above, it is not described herein again.
In step S202, it is determined whether a ratio of the download speed of the target file to the maximum bandwidth of the mobile terminal is less than a preset ratio.
In some alternative embodiments, the preset ratio may be 80%. It is understood that the preset ratio can be set by a person skilled in the art according to actual needs, and the embodiment of the present application is not limited in any way.
When the ratio of the downloading speed of the target file to the maximum bandwidth of the mobile terminal is determined to be equal to or greater than the preset ratio, the number of the network threads used for downloading the target file is indicated to reach the standard of fully utilizing the maximum bandwidth of the mobile terminal to download the target file, and at the moment, the number of the network threads used for downloading the target file does not need to be adjusted. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In the embodiment of the application, after the number of the network threads is increased, the downloading speed of the target file is increased, the occupation of the network bandwidth of the mobile terminal is increased, the task is running in the system of the mobile terminal, the target file is not necessarily only a downloading task which needs to occupy a certain bandwidth, if the downloading task completely occupies the bandwidth, the normal work of other tasks is greatly influenced, so that the downloading task occupies more bandwidth as much as possible in order to ensure the normal work of other tasks, the downloading speed is as fast as possible, and the preset ratio can be set for the downloading task.
In 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 smaller than the preset ratio, it is determined whether the current number of network threads for downloading the target file is smaller than the preset number.
The preset number can be set by a person skilled in the art according to actual needs, and the embodiment of the present application is not limited in any way.
When the current number of the network threads used for downloading the target file is determined to be larger than or equal to the preset number, the number of the network threads used for downloading the target file exceeds the data transmission pressure of the mobile terminal, and at the moment, the number of the network threads used for downloading the target file does not need to be adjusted. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In the embodiment of the application, the normal work of various tasks of the mobile terminal not only needs bandwidth, but also needs various system resources such as CPU resources, memory resources and the like. When the number of the network threads used for downloading the target file exceeds the preset number, CPU resources and memory resources occupied by the target file downloading task exceed the preset threshold value, so that the mobile terminal does not have enough system resources to ensure normal work of other tasks. Therefore, in order to ensure the normal work of other tasks of the mobile terminal, the preset number may be set for the number of network threads for target file downloading.
In step S204, if it is determined that the current number of network threads for target file downloading is less than the preset number, the number of network threads for target file downloading is increased.
In some optional embodiments, if it is determined that the current number of network threads for the target file download is less than the preset number, one network thread for the target file download may be added. It is understood that the specific increase amount can be set by those skilled in the art according to actual needs, and the embodiment of the present application is not limited thereto.
In some optional embodiments, after increasing the number of network threads for the target file download, half of the undeleted file segments of the target file may be downloaded using the newly increased network threads. Therefore, the newly added network thread can be fully utilized to download the file fragments of the target file which are not downloaded completely. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S205, after increasing the number of network threads for downloading the target file, the downloading speed of the target file is detected at intervals of a preset time period.
In some alternative embodiments, the preset time period may be 5 seconds. It is understood that the preset time period may be set by a person skilled in the art according to actual needs, and the embodiment of the present application is not limited in any way.
In the embodiment of the application, the downloading speed of the target file is detected at intervals of a preset time period, so that the problem that the detection result is inaccurate when the downloading speed of the target file is not in a stable state can be solved.
In the embodiment of the application, if it is determined that the ratio of the download speed of the target file to the maximum bandwidth of the mobile terminal is smaller than a preset ratio and it is determined that the current number of network threads used for downloading the target file is smaller than a preset number, the number of network threads used for downloading the target file is continuously increased. That is, steps S202 to S205 in the embodiment of the present application are repeatedly executed until the target file in the mobile terminal is completely downloaded.
In the embodiment of the application, when the downloading tasks of all the network threads are completed, the file segments downloaded by all the network threads are combined into the target file.
According to the target file downloading method provided by the embodiment of the application, the downloading speed of the target file in the mobile terminal is detected, and if the ratio of the downloading speed of the target file to the maximum bandwidth of the mobile terminal is determined to be smaller than the preset ratio and the current number of the network threads used for downloading the target file is determined to be smaller than the preset number, the number of the network threads used for downloading the target file is increased.
The downloading method of the target file of the present embodiment may be executed by any suitable device with data processing capability, including but not limited to: in-vehicle devices, entertainment devices, advertising devices, Personal Digital Assistants (PDAs), tablet computers, laptop computers, handheld game consoles, smart glasses, smart watches, wearable devices, virtual display devices or display enhancement devices (e.g., Google Glass, accumus Rift, Hololens, Gear VR), and the like.
EXAMPLE III
Referring to fig. 3, a block diagram of a target file downloading apparatus according to a third embodiment of the present application is shown.
The target file downloading device of the embodiment comprises: a first detection module 301 configured to detect a download speed of a target file in the mobile terminal; an adjusting module 302 configured to adjust the number of network threads for downloading the target file based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal.
The target file downloading device of this embodiment is used to implement the corresponding target file downloading method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.
Example four
Referring to fig. 4, a block diagram of a target file downloading apparatus according to a fourth embodiment of the present application is shown.
The target file downloading device of the embodiment comprises: a first detection module 401 configured to detect a download speed of a target file in the mobile terminal; an adjusting module 405 configured to adjust the number of network threads for downloading the target file based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal.
Optionally, before the adjusting module, the apparatus further includes: a second detecting module 402 configured to detect a downstream flow value of the mobile terminal in a unit time; a first determining module 403, configured to determine a current bandwidth of the mobile terminal according to a downstream flow value of the mobile terminal in a unit time; a second determining module 404 configured to determine the current bandwidth of the mobile terminal as the maximum bandwidth of the mobile terminal if the current bandwidth of the mobile terminal is greater than the predetermined maximum bandwidth.
Optionally, the adjusting module 405 includes: a first increasing module 4051, configured to increase the number of network threads for downloading the target file if the ratio of the downloading speed of the target file to the maximum bandwidth of the mobile terminal is less than a preset ratio.
Optionally, the apparatus further comprises: a third detecting module 406, configured to detect the downloading speed of the target file at intervals of a preset time period after increasing the number of the network threads; a second increasing module 407, configured to continue to increase the number of network threads for downloading the target file if the ratio of the downloading speed of the target file to the maximum bandwidth of the mobile terminal is less than the preset ratio.
The target file downloading device of this embodiment is used to implement the corresponding target file downloading method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.
EXAMPLE five
Referring to fig. 5, a block diagram of a target file downloading apparatus according to a fifth embodiment of the present application is shown.
The target file downloading device of the embodiment comprises: a first detection module 501 configured to detect a download speed of a target file in the mobile terminal; an adjusting module 502 configured to adjust the number of network threads for downloading the target file based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal.
Optionally, the adjusting module 502 includes: a first increasing module 5021, configured to increase the number of network threads for downloading the target file if the ratio of the downloading speed of the target file to the maximum bandwidth of the mobile terminal is less than a preset ratio.
Optionally, the apparatus further comprises: and a downloading module 503 configured to download half of the undeleted file segments of the target file by using the newly added network thread.
Optionally, before the second adding module, the apparatus further comprises: a third determining module 504 configured to determine whether the current number of network threads is less than a preset number; a third increasing module 505, configured 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 target file downloading device of this embodiment is used to implement the corresponding target file downloading method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.
EXAMPLE six
Referring to fig. 6, a schematic structural diagram of a device/terminal/server according to a sixth embodiment of the present application is shown, and the specific embodiment of the present application does not limit specific implementations of the device/terminal/server.
As shown in fig. 6, the device/terminal/server may include: a processor (processor)601, a storage device 602.
Wherein:
the processor 601 is configured to execute the program 603, and may specifically execute relevant steps in the foregoing embodiment of the target file downloading method.
In particular, the program 603 may include program code that includes computer operating instructions.
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 embodiments of the present application. The one or more processors comprised by the device/terminal/server may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
A storage device 602 configured to store one or more programs 603. The storage device 602 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 603 may specifically be configured to cause the processor 601 to perform the following operations: detecting the downloading speed of a target file in the mobile terminal; and adjusting the number of network threads for downloading the target file based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal.
In an alternative embodiment, the program 603 is further configured to enable the processor 601 to detect a downstream flow value of the mobile terminal in a unit time before the adjusting the number of network threads for downloading the target file; determining the current bandwidth of the mobile terminal according to the downlink flow value of the mobile terminal in unit time; and if the current bandwidth of the mobile terminal is greater than the maximum bandwidth which is determined in advance, determining the current bandwidth of the mobile terminal as the maximum bandwidth of the mobile terminal.
In an alternative embodiment, the program 603 is further configured to enable the processor 601, when adjusting 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, to increase the number of network threads for downloading the target file if a ratio of the download speed of the target file to the maximum bandwidth of the mobile terminal is smaller than a preset ratio.
In an alternative embodiment, the program 603 is further configured to enable the processor 601 to download half of the undeleted file segments of the target file by using the new network thread.
In an alternative embodiment, the program 603 is further configured to enable the processor 601 to detect the downloading speed of the target file at a preset time interval after increasing the number of the network threads; and if the ratio of the downloading speed of the target file to the maximum bandwidth of the mobile terminal is smaller than the preset ratio, continuously increasing the number of the network threads for downloading the target file.
In an alternative embodiment, the program 603 is further configured to enable the processor 601 to determine whether the current number of network threads is less than a preset number before continuing to increase the number of network threads for downloading the target file; and if the current number of the network threads is smaller than the preset number, continuously increasing the number of the network threads used for downloading the target file.
For specific implementation of each step in the program 603, reference may be made to corresponding steps and corresponding descriptions in units in the foregoing embodiment of the target file downloading method, which are not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
By the device/terminal/server of the embodiment, the downloading speed of the target file in the mobile terminal is detected, and the number of the network threads for downloading the target file is adjusted based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal.
It should be noted that, according to the implementation requirement, each component/step described in the embodiment of the present application may be divided into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiment of the present application.
In particular, according to an embodiment of the present application, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the above method embodiments. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section, and/or installed from a removable medium. The computer program, when executed by a Central Processing Unit (CPU), performs the above-described functions defined in the method illustrated in the embodiments of the present application. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A 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 of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory device (RAM), a read-only memory device (ROM), an erasable programmable read-only memory device (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory device (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport 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, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a processing unit, and a test unit. The names of the units do not form a limitation to the unit itself in some cases, for example, 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.
As another aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the method as described in any of the embodiments above.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not 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 the downloading speed of the target file in the mobile terminal; and adjusting the number of network threads for downloading the target file based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A method for downloading a target file, the method comprising:
detecting the downloading speed of a target file in the mobile terminal;
adjusting the number of network threads used for downloading the target file based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal;
the adjusting the number of the network threads used for downloading the target file based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal comprises the following steps: and if the ratio of the downloading speed of the target file to the maximum bandwidth of the mobile terminal is smaller than a preset ratio, increasing the number of network threads for downloading the target file.
2. The method of claim 1, wherein prior to said adjusting the number of network threads for said target file download, said method further comprises:
detecting a downlink flow value of the mobile terminal in unit time;
determining the current bandwidth of the mobile terminal according to the downlink flow value of the mobile terminal in unit time;
and if the current bandwidth of the mobile terminal is greater than the maximum bandwidth which is determined in advance, determining the current bandwidth of the mobile terminal as the maximum bandwidth of the mobile terminal.
3. The method of claim 1, further comprising:
and downloading half of the undelivered file segments of the target file by using the newly added network thread.
4. The method of claim 1, further comprising:
after the number of the network threads is increased, detecting the downloading speed of the target file at intervals of a preset time period;
and if the ratio of the downloading speed of the target file to the maximum bandwidth of the mobile terminal is smaller than the preset ratio, continuously increasing the number of the network threads for downloading the target file.
5. The method of claim 4, wherein prior to said continuing to increase the number of network threads for said target file download, said method further comprises:
determining whether the current number of the network threads is less than a preset number;
and if the current number of the network threads is smaller than the preset number, continuously increasing the number of the network threads used for downloading the target file.
6. An apparatus for downloading a target file, the apparatus comprising:
the mobile terminal comprises a first detection module, a second detection module and a third detection module, wherein the first detection module is configured to detect the downloading speed of a target file in the mobile terminal;
the adjusting module is configured to adjust the number of network threads used for downloading the target file based on the downloading speed of the target file and the maximum bandwidth of the mobile terminal;
the adjustment module includes: a first increasing module configured to increase the number of network threads for the target file downloading if a ratio of the download speed of the target file to the maximum bandwidth of the mobile terminal is less than a preset ratio.
7. The apparatus of claim 6, wherein prior to the adjusting module, the apparatus further comprises:
a second detection module configured to detect a downstream flow value of the mobile terminal in a unit time;
the first determining module is configured to determine the current bandwidth of the mobile terminal according to the downstream flow value of the mobile terminal in unit time;
a second determining module configured to determine the current bandwidth of the mobile terminal as the maximum bandwidth of the mobile terminal if the current bandwidth of the mobile terminal is greater than a predetermined maximum bandwidth.
8. The apparatus of claim 6, further comprising:
and the downloading module is configured to download half of the undelivered file segments of the target file by using the newly added network thread.
9. The apparatus of claim 6, further comprising:
a third detection module configured to detect a download speed of the target file at intervals of a preset time period after increasing the number of the network threads;
and the second increasing module is configured to continuously increase the number of network threads for downloading the target file if the ratio of the downloading speed of the target file to the maximum bandwidth of the mobile terminal is less than the preset ratio.
10. The apparatus of claim 9, wherein prior to the second adding module, the apparatus further comprises:
a third determination module configured to determine whether the current number of network threads is less than a preset number;
a third increasing module configured to continue to increase the number of network threads used for the target file downloading if the current number of network threads is less than the preset number.
11. A device/terminal/server comprising:
one or more processors;
a storage configured to store one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method of downloading an object file as claimed in any one of claims 1-5.
12. A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements a method of downloading an object file as claimed in any one of claims 1 to 5.
CN201810858653.1A 2018-07-31 2018-07-31 File downloading method, device, equipment/terminal/server and storage medium Active CN109040230B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810858653.1A CN109040230B (en) 2018-07-31 2018-07-31 File downloading method, device, equipment/terminal/server and storage medium
PCT/IB2018/056504 WO2020026018A1 (en) 2018-07-31 2018-08-27 Method for downloading file, device, apparatus/terminal/ server, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810858653.1A CN109040230B (en) 2018-07-31 2018-07-31 File downloading method, device, equipment/terminal/server and storage medium

Publications (2)

Publication Number Publication Date
CN109040230A CN109040230A (en) 2018-12-18
CN109040230B true CN109040230B (en) 2021-06-04

Family

ID=64648017

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810858653.1A Active CN109040230B (en) 2018-07-31 2018-07-31 File downloading method, device, equipment/terminal/server and storage medium

Country Status (2)

Country Link
CN (1) CN109040230B (en)
WO (1) WO2020026018A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112055036A (en) * 2019-06-05 2020-12-08 阿里巴巴集团控股有限公司 Data downloading method, device, equipment, system and readable storage medium
CN110784520A (en) * 2019-09-30 2020-02-11 北京字节跳动网络技术有限公司 File downloading method and device and electronic equipment
CN111142900A (en) * 2019-12-17 2020-05-12 深圳市优必选科技股份有限公司 Program updating method and device and terminal equipment
CN113556408B (en) * 2021-09-23 2022-02-22 统信软件技术有限公司 Task downloading method and device, computing equipment and storage medium
CN113891170B (en) * 2021-11-23 2024-05-03 维沃移动通信有限公司 Downloading method, downloading device, electronic equipment and storage medium
CN114629895B (en) * 2022-03-22 2023-10-13 平安证券股份有限公司 File fragment breakpoint continuous transmission method, device, terminal equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103391454A (en) * 2013-07-12 2013-11-13 三星电子(中国)研发中心 Multithreading downloading method and device
CN105873022A (en) * 2015-12-07 2016-08-17 乐视移动智能信息技术(北京)有限公司 Downloading method and device for mobile terminal
CN106254566A (en) * 2016-10-31 2016-12-21 乐视控股(北京)有限公司 A kind of data download processing method and device
CN107786583A (en) * 2016-08-24 2018-03-09 中兴通讯股份有限公司 A kind of document down loading method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9203892B2 (en) * 2011-04-19 2015-12-01 Accenture Global Services Limited Content transfer accelerator
US9304823B2 (en) * 2012-07-17 2016-04-05 Adobe Systems Incorporated Method and apparatus for optimizing download operations
CN102811258B (en) * 2012-07-27 2015-11-25 北京星网锐捷网络技术有限公司 Data Concurrent method for down loading, device and the network equipment
CN106161524A (en) * 2015-04-03 2016-11-23 中国移动通信集团上海有限公司 A kind of resource downloading method based on distributed resource node and device
CN104967619B (en) * 2015-06-17 2018-09-04 深圳市腾讯计算机系统有限公司 File push methods, devices and systems
US20170142186A1 (en) * 2015-11-17 2017-05-18 Le Holdings (Beijing) Co., Ltd. Method, apparatus, and electronic device for downloading files
US10003634B2 (en) * 2016-05-14 2018-06-19 Richard Banister Multi-threaded download with asynchronous writing
CN106998349A (en) * 2016-10-18 2017-08-01 深圳大宇无限科技有限公司 Multithreading method for down loading and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103391454A (en) * 2013-07-12 2013-11-13 三星电子(中国)研发中心 Multithreading downloading method and device
CN105873022A (en) * 2015-12-07 2016-08-17 乐视移动智能信息技术(北京)有限公司 Downloading method and device for mobile terminal
CN107786583A (en) * 2016-08-24 2018-03-09 中兴通讯股份有限公司 A kind of document down loading method and device
CN106254566A (en) * 2016-10-31 2016-12-21 乐视控股(北京)有限公司 A kind of data download processing method and device

Also Published As

Publication number Publication date
WO2020026018A1 (en) 2020-02-06
CN109040230A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
CN109040230B (en) File downloading method, device, equipment/terminal/server and storage medium
CN110662085B (en) Message sending method, device, readable medium and electronic equipment
CN110765354B (en) Information pushing method and device, electronic equipment and storage medium
CN112637287B (en) Load balancing method and equipment
US20220353551A1 (en) Live broadcast room page loading method and apparatus, and terminal, server and storage medium
CN112272226B (en) Picture loading method and device and readable storage medium
CN111488185B (en) Page data processing method, device, electronic equipment and readable medium
CN111246228B (en) Method, device, medium and electronic equipment for updating gift resources of live broadcast room
CN110781432A (en) Page jump method and device, electronic equipment and computer readable storage medium
CN111432001B (en) Method, apparatus, electronic device and computer readable medium for jumping scenes
CN112379982B (en) Task processing method, device, electronic equipment and computer readable storage medium
CN110764892A (en) Task processing method, device and computer readable storage medium
CN115103210B (en) Information processing method, device, terminal and storage medium
CN114039926A (en) Transmission control protocol determining method and device, readable medium and electronic equipment
CN110557341A (en) Method and device for limiting data current
CN114979762B (en) Video downloading and transmitting method and device, terminal equipment, server and medium
CN113138883B (en) Message processing method and device, storage medium and electronic equipment
CN110324377B (en) Push interaction method and device, electronic equipment and medium
CN112636971A (en) Service degradation method and device, electronic equipment and storage medium
CN112860439A (en) Application starting method and device, terminal and storage medium
CN112162682A (en) Content display method and device, electronic equipment and computer readable storage medium
CN114257870B (en) Short video playing method, device, equipment and storage medium
CN111163138B (en) Method, device and server for reducing network load during game
CN117793444A (en) Video caching method and device, electronic equipment and storage medium
CN117527648A (en) Bandwidth detection method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant