WO2016161706A1 - 数据传输的方法和终端 - Google Patents

数据传输的方法和终端 Download PDF

Info

Publication number
WO2016161706A1
WO2016161706A1 PCT/CN2015/082681 CN2015082681W WO2016161706A1 WO 2016161706 A1 WO2016161706 A1 WO 2016161706A1 CN 2015082681 W CN2015082681 W CN 2015082681W WO 2016161706 A1 WO2016161706 A1 WO 2016161706A1
Authority
WO
WIPO (PCT)
Prior art keywords
download range
network card
download
range
downloaded
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.)
Ceased
Application number
PCT/CN2015/082681
Other languages
English (en)
French (fr)
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to KR1020177031364A priority Critical patent/KR101943933B1/ko
Priority to EP15888261.3A priority patent/EP3282734B1/en
Priority to JP2017552798A priority patent/JP6581665B2/ja
Priority to CN201580046827.9A priority patent/CN106797557B/zh
Publication of WO2016161706A1 publication Critical patent/WO2016161706A1/zh
Priority to US15/728,108 priority patent/US10506020B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

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]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/14Multichannel or multilink protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/22Processing or transfer of terminal data, e.g. status or physical capabilities
    • H04W8/24Transfer of terminal data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/15Setup of multiple wireless link connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices

Definitions

  • the present invention relates to communication technologies, and in particular, to a data transmission method and terminal.
  • dual-card terminals are becoming more and more popular in people's lives.
  • most of the current dual-card terminals are single-channel, that is, only one card can perform data services at the same time, and the network speed of the terminal is limited by the speed at which the single card acquires network data, and the user downloads the file by using the terminal. Brought more or less obstacles.
  • the prior art downloads the file of the server by adopting the HTTP 1.1 protocol supporting dual channel downloading, that is, adopts Hypertext Transfer Protocol (HTTP) 1.1 protocol, dual card.
  • HTTP Hypertext Transfer Protocol
  • the two cards of the phone can simultaneously download files from the server.
  • the file can be divided into multiple copies, and each copy is transmitted on a physical link to achieve concurrent download.
  • the first 50 M can be downloaded on the physical cell (CELL) link 1, and 50 M after downloading on the CELL link 2, and simultaneously downloaded, so that Speed up the download speed.
  • the embodiment of the present invention provides a data transmission method and a terminal, which are used to solve the technical problem that the time when the download speed of a certain network card suddenly drops, causing the file download time to expire or the download fails in the prior art.
  • an embodiment of the present invention provides a data transmission method, where the method is applicable to a terminal including a first network card and a second network card; the method includes:
  • the terminal acquires a download range range of data to be downloaded
  • the terminal allocates a first download range to the first network card and a second download range to the second network card according to the download range of the data to be downloaded;
  • the terminal Determining, by the terminal, that when the preset download time arrives, the first network card completes downloading of the first download range and the second network card does not complete downloading of the second download range, the terminal performs at least a first allocation operation until the first network card completes a new first download range, the second network card completes a new second download range, and the second download range is completely downloaded;
  • the first allocating operation includes: allocating the new first download range to the first network card and the new second download range to the second network card according to the second download range.
  • the terminal allocates a first download range to the first network card and allocates the second network card according to the download range of the data to be downloaded.
  • the second download range includes:
  • the terminal divides all download ranges of the data to be downloaded into the first download range and the second download range according to a network speed ratio of the first network card and the second network card, and respectively allocates The first network card and the second network card.
  • the terminal allocates a first download range to the first network card and allocates the second network card according to the download range of the data to be downloaded.
  • the second download range includes:
  • the terminal divides the partial download range of the data to be downloaded into the first download range and the second download range according to a preset allocation rule, and respectively allocates the first download range and the second download range to the first network card and the second Network card
  • the method further includes:
  • the terminal performs at least one second allocation operation until all the data to be downloaded is completely downloaded
  • the second allocation operation includes: the terminal respectively assigning a next data download range to the first network card and the second network card from the current remaining download range of the data to be downloaded.
  • the terminal allocates the new first download range for the first network card and the new second for the second network card according to the second download range.
  • Download range including:
  • the new first download range to the first network card and the new network to the second network card from a remaining download range of the second download range according to a preset allocation rule Second download the range.
  • the terminal according to the second download range, assigning the new first card to the first network card Downloading the range and allocating the new second download range to the second network card, specifically including:
  • the terminal allocates a next download range for the first network card that completes the first download range from the current remaining download range of the data to be downloaded, and further determines that the second network card arrives at a preset time Whether to complete the download of the second download range;
  • the terminal allocates the new network card to the first network card from the remaining download range of the second download range according to a preset allocation rule after the first network card downloads the current download range.
  • the first download range and the new second download range are assigned to the second network card.
  • a network card assigning the new first download range and allocating the new second download range to the second network card specifically:
  • the terminal When the terminal determines that the first time is greater than the first preset time, the terminal allocates the new first card to the first network card from the remaining download range of the second download range according to a preset allocation rule. Downloading range and assigning the new second download range to the second NIC.
  • the terminal is The first network card allocates the new first download range and allocates the new second download range to the second network card, specifically including:
  • the terminal allocates the new first download range and the first network card from the second download range according to the preset allocation rule. Assigning the new second download range to the second network card.
  • the terminal determines the real-time performance of the data to be downloaded, and specifically includes:
  • the terminal determines that the real-time performance of the data to be downloaded is higher than a preset first threshold
  • the terminal determines that the real-time performance of the data to be downloaded is lower than a preset first threshold.
  • the terminal determines the real-time performance of the data to be downloaded, and specifically includes:
  • the terminal determines that the real-time performance of the data to be downloaded is higher than a preset first threshold; otherwise, the terminal determines that the real-time performance of the data to be downloaded is lower than a preset first threshold.
  • the preset allocation The rule is a product of a current network speed of the first network card or the second network card and the preset download time.
  • an embodiment of the present invention provides a terminal, where the terminal is a terminal having a first network card and a second network card, where the terminal includes:
  • An obtaining module configured to acquire, by the terminal, a download range range of data to be downloaded
  • a first allocation module configured to allocate a first download range to the first network card and a second download range to the second network card according to the download range of the data to be downloaded;
  • a second allocation module configured to determine, when the preset download time arrives, the first network card completes the download of the first download range and the second network card does not complete the download of the second download range, and then executes At least one first allocation operation until the first network card completes a new first download range, the second network card completes a new second download range, and the second download range is all downloaded; the first allocation The operations include: allocating the new first download range to the first network card and the new second download range to the second network card according to the second download range.
  • the first allocation module is configured to: according to a network speed ratio of the first network card and the second network card, The download range of the download data is divided into the first download range and the second download range, and is respectively allocated to the first network card and the second network card.
  • the first allocation module is configured to divide, according to a preset allocation rule, a partial download range of the data to be downloaded into the a first download range and the second download range, and respectively allocated to the first network card and the second network card;
  • the second allocation module is further configured to perform at least one second allocation operation until the downloading of the data to be downloaded is completed; the second allocating operation includes: from the current remaining download range of the data to be downloaded Assigning a next data download range to the first network card and the second network card respectively.
  • the second distribution module is specifically configured to follow a preset Assigning rules, assigning the new first download range to the first network card and the new second download range to the second network card from the second download range; or, from the second The first NIC is allocated the new first download range and the remaining download range of the range Assigning the new second download range to the second network card.
  • the second allocation module is specifically configured to use the current remaining download range of the data to be downloaded Completing the first download range of the first network card of the first download range, and further determining whether the second network card completes downloading of the second download range when the preset time arrives; if not, the end After the first network card downloads the current download range, the new first download range and the first network card are allocated from the remaining download range of the second download range according to a preset allocation rule. The second network card allocates the new second download range.
  • the second distribution module is specifically configured to be used according to the Determining, by the second network card, the first time required for the second network card to download the remaining download range of the second download range, and determining that the first time is greater than the first preset time, according to the preset And an allocation rule of assigning the new first download range to the first network card and the new second download range to the second network card from a remaining download range of the second download range.
  • the second distribution module is specifically configured to be Determining, by the current network speed of the second network card, a first time required for the second network card to download the remaining download range of the second download range, and according to the current network speed of the first network card, the current network card a network speed, determining a second time required for the first network card and the second network card to jointly download the second download range, and determining, when the first time is greater than the second time, according to the a preset allocation rule, assigning the new first download range to the first network card and the new second download range to the second network card from the second download range.
  • the terminal further includes:
  • a determining module configured to determine real-time performance of the data to be downloaded.
  • the determining module is specifically configured to determine a first application that initiates a connection request for downloading the to-be-downloaded data a software APP, and determining whether the first APP matches an APP in a preset APP set; if yes, determining that the real-time performance of the data to be downloaded is higher than a preset first threshold; Then, it is determined that the real-time performance of the data to be downloaded is lower than a preset first threshold.
  • the determining module is specifically configured to determine a to-be-held in the hypertext transfer protocol acquisition request sent to the server Downloading a type of the data, and determining whether the type of the data to be downloaded matches the type in the preset data type library; if yes, determining that the real-time performance of the data to be downloaded is higher than a preset first threshold; otherwise, Then determining that the real-time performance of the data to be downloaded is lower than a preset first threshold.
  • the preset allocation The rule is a product of a current network speed of the first network card or the second network card and the preset download time.
  • the method and the terminal for data transmission provided by the embodiment of the present invention, by determining the download range of the data to be downloaded by the terminal, assigning the first download range to the first network card according to the download range of the data to be downloaded, and assigning the second download range to the second network card. And determining that, when the preset download time arrives, the first network card completes the download of the first download range and the second network card does not complete the download of the second download range, the terminal performs at least one first allocation operation Until the first network card completes the new first download range, the second network card completes the new second download range, and the second download range is completely downloaded.
  • the method provided by the embodiment of the present invention when the second network card does not complete the download task on time, the first network card can share the download task for the second network card, thereby preventing the second network card from downloading the allocated download task at a lower network speed.
  • the resulting downloading time is too long or the downloading fails. That is, the method provided by the embodiment of the present invention reduces the downloading time of the data to be downloaded, improves the downloading efficiency of the terminal, and ensures reliable downloading of data.
  • an embodiment of the present invention provides a data transmission method, where the method is applicable to a terminal that includes a first network card and a second network card, and the method includes:
  • the terminal acquires a download range of data to be downloaded
  • the terminal allocates a first download range to the first network card and a second download range to the second network card according to the download range of the data to be downloaded;
  • the second network card does not complete the download of the second download range, and the remaining download range of the second download range is greater than the first preset threshold, Said terminal performs at least one first allocation operation until all downloads of the second download range are completed;
  • the first allocating operation includes: according to the remaining download range of the second download range, The first network card allocates a new first download range and assigns a new second download range to the second network card.
  • an embodiment of the present invention provides a terminal, where the terminal is a terminal having a first network card and a second network card, where the terminal includes:
  • An obtaining module configured to obtain a download range of data to be downloaded
  • a first allocation module configured to allocate a first download range to the first network card and a second download range to the second network card according to the download range of the to-be-downloaded data
  • a second allocation module configured to: when the first network card completes downloading of the first download range, the second network card does not complete downloading of the second download range, and the remaining download range of the second download range is greater than When a preset threshold is performed, at least one first allocation operation is performed until all downloads of the second download range are completed;
  • the first allocating operation includes: allocating a new first download range to the first network card and a new second download range to the second network card according to a remaining download range of the second download range.
  • the terminal allocates a first download range for the first network card and a second download range for the second network card according to the download range of the data to be downloaded, and completes the first download at the first terminal. If the second network card does not complete the second downloading range, the terminal may perform the first allocation operation to allocate the remaining download range of the second download range to the first network card to share the download task of the second network card, thereby preventing the second network card from being used for the second network card.
  • the downloading task assigned by the lower network speed downloading task is too long or the downloading failure occurs, that is, the downloading time of the data to be downloaded is reduced, and the downloading efficiency of the terminal is improved, thereby ensuring reliable downloading of data.
  • Embodiment 1 is a schematic flowchart of Embodiment 1 of a method for data transmission according to an embodiment of the present invention
  • Embodiment 2 is a schematic flowchart of Embodiment 2 of a method for data transmission according to an embodiment of the present disclosure
  • Embodiment 3 is a schematic flowchart of Embodiment 3 of a method for data transmission according to an embodiment of the present invention
  • Embodiment 4 is a schematic flowchart of Embodiment 4 of a method for data transmission according to an embodiment of the present disclosure
  • FIG. 5 is a schematic flowchart of Embodiment 5 of a method for data transmission according to an embodiment of the present disclosure
  • FIG. 6 is a schematic flowchart of Embodiment 6 of a method for data transmission according to an embodiment of the present disclosure
  • FIG. 7 is a schematic flowchart diagram of Embodiment 7 of a method for data transmission according to an embodiment of the present disclosure
  • FIG. 8 is a schematic flowchart of Embodiment 8 of a method for data transmission according to an embodiment of the present disclosure
  • FIG. 9 is a schematic structural diagram of Embodiment 1 of a terminal according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of Embodiment 2 of a terminal according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of Embodiment 3 of a terminal according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic flowchart of Embodiment 9 of a method for data transmission according to an embodiment of the present disclosure
  • FIG. 13 is a schematic flowchart diagram of Embodiment 10 of a method for data transmission according to an embodiment of the present disclosure
  • FIG. 14 is a schematic flowchart diagram of Embodiment 11 of a method for data transmission according to an embodiment of the present disclosure
  • FIG. 15 is a schematic structural diagram of Embodiment 4 of a terminal according to an embodiment of the present disclosure.
  • FIG. 16 is a schematic structural diagram of Embodiment 5 of a terminal according to an embodiment of the present disclosure.
  • FIG. 17 is a schematic structural diagram of Embodiment 6 of a terminal according to an embodiment of the present disclosure.
  • the terminal involved in the embodiment of the present invention may include, but is not limited to, a mobile phone, a personal digital assistant (PDA), a tablet computer, a portable device (for example, a portable computer), and the like including a first network card and a second network card.
  • the communication device includes an apparatus including a first network card and a second network card, or a communication chip supporting the first network card and the second network card, and the type of the terminal is not in the embodiment of the present invention. Make a limit.
  • the first network card and the second network card may be a Subscriber Identity Module (SIM) card in a 2G network, or may be a Universal Integrated Circuit Card (3d).
  • SIM Subscriber Identity Module
  • UICC Universal Integrated Circuit Card
  • UICC which can also be an internet module in the terminal, for example, specifically a 4G network or Internet access module for 3G network or 2G network or Wireless Fidelity (WiFi) Internet access module.
  • the method of the embodiment of the present invention is to solve the technical problem that the time when the file downloading timeout or the download fails when the network speed of a certain network card suddenly drops in the terminal with the dual network card in the prior art;
  • the technology cannot solve the technical problem of data download delay caused by the timely downloading of the download mode for the data to be downloaded.
  • FIG. 1 is a schematic flowchart diagram of Embodiment 1 of a method for data transmission according to an embodiment of the present disclosure.
  • the method in this embodiment is a specific process of saving the download time by adjusting the allocation manner of the data to be downloaded so that the first network card and the second network card can download the data to be downloaded in time.
  • the method includes:
  • S101 The terminal acquires a download range of data to be downloaded.
  • the application software (Aplication, abbreviated as APP) on the terminal may initiate a request for downloading or acquiring network data to the terminal, or the user may click the link on the webpage to make the terminal know the request for the user to obtain the network data, so that the terminal can
  • the download range of the data to be downloaded is obtained by sending a HyperText Transfer Protocol GET Request (HTTP GET Request) to the server on the network side.
  • the download range of the data to be downloaded may include the size of the data to be downloaded, or the byte start position of the data to be downloaded and the byte end position of the download data.
  • S102 The terminal allocates a first download range to the first network card and a second download range to the second network card according to the download range of the to-be-downloaded data.
  • the first download range and the second download range are byte start positions and byte end positions of data that the terminal needs to download to the first network card and the second network card.
  • the terminal allocates a corresponding download range for the first network card and the second network card according to the download range of the data to be downloaded.
  • the terminal may allocate a corresponding download range to the first network card and the second network card according to the download time and the download range of the data to be downloaded, by using a preset download time; optionally, the terminal may also be preset Download time, and according to the current network speed of the first network card and the current network speed of the second network card
  • the first network card allocates a first download range and assigns a second download range to the second network card.
  • the terminal allocates the download amount of the download time of 1s for the first network card and the second network card respectively (ie, 1M bit), that is, the first download range allocated by the terminal for the first network card is (0-1M), and the second download range allocated for the second terminal is (1M-2M).
  • the preset download time of the terminal may be a value dynamically generated by the terminal according to the download range of the data to be downloaded, that is, the setting of the download time is changed according to the change of the distribution manner of the download range of the data to be downloaded; for example; It is assumed that the terminal divides the to-be-downloaded range into a first download range and a second download range (how to allocate a download range of data to be downloaded, which is not limited in this embodiment of the present invention), and assigns the corresponding to the first network card and the second. The network card, at this time, the preset download time of the terminal is longer; and it is assumed that the terminal downloads the range from the download range of the data to be downloaded, and divides the partial download range into the first download range and the second download range. The default download time of the terminal will be shorter than the download time of the aforementioned distribution mode.
  • the terminal allocates the corresponding download range or the allocation principle for the first network card and the second network card for the first time.
  • the terminal determines that, when the preset download time arrives, the first network card completes the download of the first download range and the second network card does not complete the download of the second download range, the terminal performs at least a first allocation operation until the first network card completes the download of the new first download range, the second network card completes the download of the new second download range, and the second download range is completely downloaded;
  • the first allocating operation includes: allocating the new first download range to the first network card and the new second download range to the second network card according to the second download range.
  • the terminal may be in a mobile state during the download process, that is, the terminal may switch between networks of different standards, so that the network speed of the network card is unstable or the network speed of a certain network card is suddenly decreased.
  • the second network card has a sudden drop in network speed due to the switching between the terminals in different standard networks. Therefore, the second download range allocated by the terminal to the second network card cannot be in the preset download time. (for example, 1s in the above example) is completed on time when it arrives.
  • the terminal determines that the first network card completes the download of the first download range and the second network card does not complete the download of the second download range when the preset download time arrives, the terminal performs the first allocation operation at least once until the first The network card completes the new first download range, and the second network card completes the new second download.
  • the first allocation operation includes: the terminal assigning a new first download range to the first network card according to the second download range and allocating the new second download range to the second network card according to the second download range. .
  • the first allocation operation may be that the terminal divides the second download range into two, that is, the second download range is divided into a new first download range and a new second download range, and the two The part is respectively allocated to the first network card and the second network card; or a part of the download range is taken out from the second download range, and the part of the download range is divided into a new first download range and a new second download range, and The two parts are respectively allocated to the first network card and the second network card; or the download range (that is, the remaining download range of the second download range) that is not downloaded by the second network card is divided into two, that is, the second network card is not downloaded.
  • the completed download range is divided into a new first download range and a new second download range, and the two parts are respectively assigned to the first network card and the second network card; or the downloaded from the second network card is not downloaded.
  • the range extracts a part of the download range, and divides the part of the download range into a new first download range and a new second download range, and assigns the two parts to the first network card and the second network card respectively. That is to say, the first allocation operation is actually the sharing of the download range of the second network card by the first network card when the second network card does not download the second download range.
  • the terminal uses the second download range as the first network card. Allocating a new first download range and allocating a new second download range to the second network card; thereafter, the first network card performs a download operation of the new first download rang, and the second network card performs a download operation of the new second download range ( It should be noted that, when the terminal allocates a new download range for the two network cards, a new download time is also preset, and the new download time may be equal to the preset download time duration, or may not be equal.
  • the terminal continues to determine whether the two new network cards complete the download of the corresponding new download range when the new download time arrives; If the two network cards have completed the download of the corresponding new download range when the new download time arrives, the terminal determines that the second time is first allocated to the second network card. Whether the range is completely downloaded at this time, if yes, it indicates that the first network card and the second network card have completed the download of the first allocated download range, and if not, the second download range initially allocated to the second network card is still not all downloaded.
  • the terminal Upon completion, the terminal continues to allocate another new first download for the first network card and the second network card from the second download range except for the new first download range and the new second download range. Range and another new second download range, and repeat the above process until the first network card completes the download of the currently allocated new first download range, the second network card completes the download of the current new second download range, and the second Download the range all downloads are complete.
  • the terminal may And continuing to allocate another new first download range for the first network card that completes the new first download range from the new second download range, and redistributing the second network card for the uncompleted new second download range. Another new second download range, until all downloads of the new second download range of the second network card are completed, and then continue to determine whether the second download range that the terminal first allocated to the second network card is completely downloaded.
  • the download range of the data to be downloaded is 0-100M
  • the network speed of the first network card and the second network card are both 1M/s
  • the terminal allocates the download amount of the download time to the first network card and the second network card respectively, that is, the terminal is
  • the first download range allocated by the first network card is (0-1M)
  • the second download range allocated for the second terminal is (1M-2M).
  • both network cards can complete the download when the 1s arrives.
  • the second network card is switched from the 4G network to the 3G network, the network speed becomes 0.1M Byte/s.
  • the terminal performs the first allocation operation, that is, The terminal terminates the download of the second network card at this time (the second network card currently only downloads 0.1M).
  • the terminal downloads the remaining download range (1.1M-2M) of the second network card between the first network card and the second network card. Re-allocate.
  • the terminal determines whether the new first download range and the new second download range have been downloaded when the preset download time (1s) arrives; assuming that the preset download time is (1s) Upon arrival, the first NIC completes the download of the new first download range (1.2M-2M), and the second NIC still does not complete the download of the new second download range (1.1M-1.2M), only completed After downloading (1.1M-1.15M), the terminal continues to perform the above first allocation operation, and the remaining (1.15M-1.2M) of the second network card is re-allocated between the two network cards.
  • the terminal determines whether the new first download range and the new second download range have been downloaded after the preset download time arrives, and determines whether to perform the first allocation operation again according to the determination result until the first network card is completed.
  • the downloading of the new first download range, the downloading of the current new second download range by the second network card, and the downloading of the second download range of the second network card by the terminal are all completed.
  • the terminal when the network speed of the second network card is suddenly unable to complete the download task, the terminal can share the download task for the second network card by using the first network card, thereby preventing the second network card from always having a lower network.
  • the download time that is caused by the quick download of the assigned download task is too long or the download fails.
  • the method for data transmission provided by the embodiment of the present invention, by the terminal determining the download range of the data to be downloaded, assigning a first download range to the first network card according to the download range of the data to be downloaded, and assigning a second download range to the second network card, and Determining that, when the preset download time arrives, the first network card completes the download of the first download range and the second network card does not complete the download of the second download range, the terminal performs at least one first allocation operation until The first network card completes the new first download range, the second network card completes the new second download range, and the second download range is completely downloaded.
  • the method provided by the embodiment of the present invention when the second network card does not complete the download task on time, the first network card can share the download task for the second network card, thereby preventing the second network card from downloading the allocated download task at a lower network speed.
  • the resulting downloading time is too long or the downloading fails. That is, the method provided by the embodiment of the present invention reduces the downloading time of the data to be downloaded, improves the downloading efficiency of the terminal, and ensures reliable downloading of data.
  • FIG. 2 is a schematic flowchart diagram of Embodiment 2 of a method for data transmission according to an embodiment of the present disclosure.
  • the embodiment relates to a specific process in which the terminal allocates a first download range for the first network card and a second download range for the second network card according to the download range of the data to be downloaded, and the terminal determines that the pre-predetermined When the download time arrives, when the first network card completes the download of the first download range and the second network card does not complete the download of the second download range, the terminal performs a specific process of the first allocation operation.
  • the method includes:
  • S201 The terminal acquires a download range of data to be downloaded.
  • S202 The terminal downloads the to-be-download according to a network speed ratio of the first network card and the second network card.
  • the entire download range of data is divided into the first download range and the second download range, and is respectively allocated to the first network card and the second network card.
  • the terminal learns the current network speed of the first network card and the current network speed of the second network card, and determines the network speed ratio of the first network card and the second network card according to the current network speed of the first network card and the current network speed of the second network card. After that, according to the network speed ratio, the entire download range of the data to be downloaded is divided into a first download range and a second download range (ie, the total amount of the first download range and the second download range is equal to the download of the data to be downloaded) Range), and assigning the first download range to the first network card and the second download range to the second network card.
  • a first download range and a second download range ie, the total amount of the first download range and the second download range is equal to the download of the data to be downloaded
  • S203 The terminal determines that, when the preset download time arrives, the first network card completes the download of the first download range, and the second network card does not complete the download of the second download range, the terminal performs at least A first allocation operation until the first network card completes a new first download range, the second network card completes a new second download range, and the second download range is all downloaded.
  • the terminal may be in a mobile state during the download process, that is, the terminal may switch between networks of different standards, so that the network speed of the network card is unstable or the network speed of a certain network card is suddenly decreased.
  • the second network card has a sudden drop in network speed due to the switching between the terminals in different standard networks. Therefore, the second download range allocated by the terminal to the second network card cannot be in the preset download time. (for example, 1s in the example of the first embodiment described above) is completed on time when it arrives.
  • the terminal determines that the first network card completes the download of the first download range and the second network card does not complete the download of the second download range when the preset download time arrives, the terminal performs the first allocation operation at least once, being the first The network card allocates a new first download range and allocates a new second download range for the second network card until the first network card completes a new first download range, the second network card completes a new second download range, and the second download range downloads all Finished.
  • the terminal performs a first allocation operation, and allocates a new first download range for the first network card and a new second download range for the second network card.
  • the first type the terminal allocates the new first download range for the first network card and the new second download range for the second network card from the second download range according to a preset allocation rule.
  • the preset allocation rule may be the current network speed of the first network card.
  • the product of the preset download time may also be the product of the current network speed of the second network card and the preset download time.
  • the terminal allocates a new first download range for the first network card and a new second download range for the second network card from the second download range, where the terminal divides the second download range into two, that is, The second download range is divided into a new first download range and a new second download range, and the two parts are respectively assigned to the first network card and the second network card.
  • the terminal will again judge whether the two network cards have completed downloading when the preset download time arrives, and when one of the network cards is not completed, the first allocation operation is still performed, that is, The terminal will continuously redistribute the download range on the undownloaded network card to the two network cards until the first download range assigned by the terminal to the first network card and the second download range of the second network card are all downloaded.
  • the terminal allocates a new first download range for the first network card from the second download range, and allocates a new second download range for the second network card, or the terminal may extract a part of the download range from the second download range.
  • the part of the download range is divided into a new first download range and a new second download range, and the two parts are respectively assigned to the first network card and the second network card, and the terminal will again judge the download in the preset.
  • both network cards have completed the download of the new download range, and when one of them is not completed, the above first allocation operation is continued, until the corresponding new download range is downloaded on both network cards. Finished. Thereafter, the terminal continues to perform the first allocation operation again from the remaining download range except the new first download range and the new second download range in the second download range until the terminal is initially allocated to the second network card.
  • the second download range is all downloaded.
  • the second type the terminal allocates the new first download range for the first network card and the new network for the second network card from the remaining download range of the second download range according to a preset allocation rule The second download range.
  • the terminal allocates a new first download range for the first network card and a new second download range for the second network card from the remaining download range of the second download range, where the terminal may reserve the second download range.
  • the download range is divided into two, that is, the remaining download range of the second download range is divided into a new first download range and a new second download range, and the two parts are respectively assigned to the first network card and the second network card.
  • the terminal will again judge whether the two network cards have completed downloading when the preset download time arrives, and one of them is not completed.
  • the terminal continuously redistributes the download range on the undownloaded network card to the two network cards until the terminal allocates the first download range and the first network card to the first network card.
  • the second download range of the second network card is completed until the download is completed.
  • the terminal allocates a new first download range for the first network card and a new second download range for the second network card from the remaining download ranges of the second download range, and may also be the terminal downloading the range from the second download range.
  • the remaining download range a part of the download range is taken out, and the part of the download range is divided into a new first download range and a new second download range, and the two parts are respectively assigned to the first network card and the second network card, and the terminal will Re-determining whether the two network cards have completed the download of the new download range when the preset download time arrives, and when one of them is not completed, the above first allocation operation is still performed until the two network cards are up.
  • the corresponding new download range is downloaded.
  • the terminal will continue to perform the first allocation operation again from the remaining download range of the second download range except the new first download range and the new second download range, until the second download range is performed.
  • the remaining download range is all downloaded.
  • the method includes:
  • S301 The terminal determines, according to the current network speed of the second network card, a first time required for the second network card to download the remaining download range of the second download range.
  • the mobile phone determines, according to the downloaded range of the second download range, the remaining download range of the second download range, and then determines, according to the current network speed of the second network card, that the second network card downloads the remaining download range of the second download range. The first time needed.
  • S302 The terminal allocates the new first card to the first network card from the remaining download range of the second download range according to a preset allocation rule when determining that the first time is greater than the first preset time. Downloading range and assigning the new second download range to the second NIC.
  • the first preset time may be a maximum waiting time when the user preset by the terminal waits for the download.
  • the new first download range is allocated for the first network card and the new network card is allocated for the second network card from the remaining download range of the second download range according to a preset allocation rule.
  • the second download range refer to the specific process of the second implementation in this embodiment, and details are not described herein again.
  • the terminal determines that the first time is less than the first preset time, the terminal determines to continue to download the current remaining download range of the second download range by the second network card.
  • the method includes:
  • the terminal determines, according to the current network speed of the second network card, a first time required for the second network card to download the remaining download range of the second download range.
  • the mobile phone determines, according to the downloaded range of the second download range, the remaining download range of the second download range, and then determines, according to the current network speed of the second network card, that the second network card downloads the remaining download range of the second download range. The first time needed.
  • the terminal determines, according to the current network speed of the first network card and the current network speed of the second network card, a second time required for the first network card and the second network card to jointly download the second download range. .
  • the terminal may determine, by the (second download range) / (the current network speed of the first network card + the current network speed of the second network card), the second time required for the first network card and the second network card to jointly download the second download range. .
  • the terminal selects that the first network card and the second network card simultaneously download the second download range, that is, the terminal allocates the first network card from the second download range according to the foregoing preset allocation rule.
  • the new first download range and the new second download range are allocated for the second network card, thereby saving time for the terminal to download the second download range.
  • the terminal allocates the new first download range and the second network card to the first network card from the second download range according to the preset allocation rule.
  • the specific second download range refer to the specific process of the first implementation in this embodiment, and details are not described herein again.
  • the second network card continues to download the remaining download range of the second download range that has not been downloaded, and downloads the second download range at the same time as the first network card and the second network card.
  • the time required is short, so the terminal instructs the second network card to continue downloading the remaining download range of the second download range without reassignment.
  • the terminal allocates a new download range for the first network card and the second network card respectively, because the download range of the data to be downloaded is divided into the first download range and the first The two parts of the range are downloaded. Therefore, when the first download range assigned by the terminal to the first network card and the second download range of the second network card are all downloaded, the downloading of the data to be downloaded obtained by the terminal from the network side is completed.
  • the method provided by the embodiment of the present invention dynamically allocates a download range for the first network card and the second network card by the terminal, so that when the second network card does not complete the download task on time, the first network card can share the download task for the second network card, thereby avoiding The second network card always downloads the allocated download task at a lower network speed, and the downloading time is too long or the download fails. That is, the method provided by the embodiment of the present invention reduces the downloading time of the data to be downloaded, and improves The download efficiency of the terminal can ensure reliable download of data.
  • FIG. 5 is a schematic flowchart diagram of Embodiment 5 of a method for data transmission according to an embodiment of the present invention.
  • the embodiment relates to another specific process for the terminal to allocate the first download range to the first network card and the second download range for the second network card according to the download range of the data to be downloaded, and the terminal. Determining, in the case that the first network card completes the download of the first download range and the second network card does not complete the download of the second download range when the preset download time arrives, the terminal performs a specific process of the first allocation operation.
  • the method includes:
  • S501 The terminal acquires a download range of data to be downloaded.
  • S502 The terminal divides the partial download range of the to-be-downloaded data into the first download range and the second download range according to a preset allocation rule, and respectively allocates the first download range and the second download range to the first network card and the second Network card.
  • the preset allocation rule may be a product of a current network speed of the first network card and the preset download time, and may also be a current network speed of the second network card and the preset download. The product of time.
  • S503 The terminal determines that, when the preset download time arrives, the first network card completes the download of the first download range, and the second network card does not complete the download of the second download range, the terminal performs at least A first allocation operation until the first network card completes a new first download range, the second network card completes a new second download range, and the second download range is all downloaded.
  • the specific process of S503 may refer to the specific description of S203 in the foregoing Embodiment 2. The process will not be repeated here.
  • the terminal performs the second allocation operation at least once until the data to be downloaded is completely downloaded.
  • the second allocation operation includes: the terminal is the first in the current remaining download range of the data to be downloaded.
  • the network card and the second network card respectively allocate the next data download range.
  • the terminal determines that the first network card completes the new first download range, the second network card completes the new second download range, and the second download range is completely downloaded.
  • the terminal performs a second allocation operation, that is, the terminal further removes the data from the to-be-downloaded data except the first download range and the second download.
  • the next data download range is assigned to the first network card and the second network card again, and the download process is executed in combination with the scheme of the above S503 until the download range of the data to be downloaded is all downloaded.
  • the terminal when the terminal allocates the next data download range for the first network card and the second network card again from the current remaining download range of the data to be downloaded, the terminal continues to determine that when the preset download time arrives, the corresponding two network cards Whether the download range is completely downloaded, and when one of the downloads is not completed, the first allocation operation is still performed, that is, the terminal continuously redistributes the download range on the undownloaded network card to the two network cards. Until the corresponding download range on both network cards is downloaded.
  • the terminal performs two or more second allocation operations, that is, after the first network card downloads its current download range, and the second network card downloads its current download range, but the data to be downloaded has not been completely downloaded yet.
  • the terminal performs the second allocation operation again, so that each time the terminal performs the second allocation operation, it is based on the currently remaining download range in the data to be downloaded after the previous allocation.
  • the method provided by the embodiment of the present invention dynamically allocates a download range for the first network card and the second network card by the terminal, so that when the second network card does not complete the download task on time, the first network card can share the download task for the second network card, thereby avoiding The second network card always downloads the allocated download task at a lower network speed, and the downloading time is too long or the download fails. That is, the method provided by the embodiment of the present invention reduces the downloading time of the data to be downloaded, and improves The download efficiency of the terminal can ensure reliable download of data.
  • the embodiment relates to the terminal according to the second download.
  • the foregoing first allocation operation specifically includes: the terminal allocates a next download range for the first network card that completes the first download range from the current remaining download range of the data to be downloaded, and further determines the Whether the second network card completes the download of the second download range when the preset time arrives; if not, the terminal, after the first network card downloads the current download range, follows the preset allocation rule The remaining download range of the second download range allocates the new first download range for the first network card and the new second download range for the second network card.
  • the terminal determines that, when the preset download time arrives, the first network card completes the download of the first download range and the second network card does not complete the download of the second download range,
  • the terminal may be the first remaining network card from the current remaining download range of the data to be downloaded (the remaining download range of the data to be downloaded is the remainder except the first download range and the second download range) Assigning the next download range; at the same time, the terminal instructs the second network card to continue downloading the remaining download range of the uncompleted second download range, and determining whether the second network card completes the second download range when the preset time arrives Download.
  • the terminal may set the preset time by using a preset timer period.
  • the terminal determines that the downloading of the second download range is not completed when the second network card arrives at the preset time, the terminal terminates the downloading of the second network card, and allocates a new second download range to the second network card according to the preset allocation rule.
  • the terminal downloads the range from the second download range
  • the first remaining download range is assigned to the first network card in the current remaining download range (ie, the portion of the remaining download range of the second download range described above except for the new second download range that has been assigned to the second network card). And so on, until the download of the remaining download range of the second download range is completed.
  • the terminal allocates a download range of 1 second to the first network card and the second network card respectively from the determined download range of the data to be downloaded, that is, the terminal gives The first download range of the first network card allocation is (0M-1M), and the second download range allocated by the terminal to the second network card is (1M-2M). Moreover, the terminal specifies a preset time of 2.5 s.
  • the terminal continues to allocate the next second download range (2-3M) to the first network card, and the second network card continues to download the above uncompleted second download range.
  • the terminal continues to allocate the next download range to the first network card, that is, the allocation is performed.
  • One second download range (3M-4M)
  • the second network card continues to download the above uncompleted second download range.
  • the terminal determines that the time of the second network card is up, ends the download of the second network card, and saves the downloaded range (1M-1.25M) of the second network card in the downloaded range of the terminal, and according to The current network speed of the second network card and the preset download time (still assumed to be 1 s) allocate a new second download range (1.25M-1.35M) for the second network card; and, after the end of the third second, the first The network card completes the current download range (that is, the download of 3M-4M is completed), and the terminal determines that there is a remaining portion (1.35M-2M) in the remaining download range in the second download range, and then allocates the remaining portion to the first network card. Until the second network card completes the download of the new second download range, the first network card completes the download of the new first download range.
  • the terminal may pause the downloading of the second network card, and simultaneously download the current download task of the first network card through the two network cards, in the first network card. After the download task is completed, the current download task of the second network card is simultaneously downloaded through two network cards, and the method can also save the time for the terminal to download the data to be downloaded.
  • the method provided by the embodiment of the present invention dynamically allocates a download range for the first network card and the second network card by the terminal, so that when the second network card does not complete the download task on time, the first network card can share the download task for the second network card, thereby avoiding The second network card always downloads the allocated download task at a lower network speed, and the downloading time is too long or the download fails. That is, the method provided by the embodiment of the present invention reduces the downloading time of the data to be downloaded, and improves The download efficiency of the terminal can ensure reliable download of data.
  • FIG. 6 is a schematic flowchart of Embodiment 6 of a method for data transmission according to an embodiment of the present invention.
  • the embodiment relates to a specific process for determining the real-time performance of the data to be downloaded before the terminal allocates the download range for the first network card and the second network card.
  • the method further includes:
  • S601 The terminal determines real-time performance of the data to be downloaded.
  • the real-time performance in this embodiment may be understood as the speed requirement of the user to display the download data, or may be understood as the user's requirement for the length of time to obtain the data to be downloaded.
  • the real-time requirement for the video is relatively high when the network is downloaded in real time, that is, the video is a high-time to-be-downloaded data.
  • the real-time performance of the terminal to determine the data to be downloaded may be the following two implementation manners, specifically:
  • the method for determining, by the terminal, the real-time performance of the data to be downloaded may include:
  • S701 The terminal determines to initiate a download of the first APP to download the data connection request.
  • S702 The terminal determines whether the first APP matches the APP in the preset APP set; if yes, the terminal determines that the real-time performance of the data to be downloaded is higher than a preset first threshold; otherwise, the terminal Determining that the real-time performance of the data to be downloaded is lower than a preset first threshold.
  • the terminal may determine, by using the detection software in the processor or the processor, which APP to initiate the download of the to-be-downloaded data is sent by the APP, and determine the first APP, and then determine the first Whether the APP matches the APP in the preset APP collection.
  • the program corresponding to the APP in the preset APP set may be that the terminal is loaded into the terminal by using a corresponding loading program, and may be pre-stored in the memory of the terminal or on the server on the network side;
  • the fixtures on the line are preset to the terminal, and can also be saved in the terminal according to the user experience.
  • the APP in the preset APP collection may be a video class APP such as Youku and Sohu video.
  • the terminal determines that the real-time performance of the data to be downloaded requested by the first APP is higher than a first preset threshold, that is, the data to be downloaded may be If the terminal determines that the first APP does not match the APP in the preset APP set, the terminal determines that the real-time performance of the data to be downloaded requested by the first APP is lower than a preset.
  • the first threshold that is, the data to be downloaded may be a file that requires less real-time performance.
  • the term “matching” as used herein may be understood as whether the first APP is the same as or similar to the attribute of the APP in the preset APP set, for example, it is assumed that the preset APP set includes Youku, Sohu, and Mango. TV, potato four APP, but the first APP determined by the terminal is "Baidu video", the terminal can also think that the first APP matches the APP in the preset APP set.
  • the terminal may determine the historical download data type of the APP in the preset APP set by determining Whether the data type of the data to be downloaded currently downloaded by the first APP is similar, and determining whether the first APP matches the APP in the preset APP set.
  • the method for determining, by the terminal, the real-time performance of the data to be downloaded may include:
  • S801 The terminal determines the type of data to be downloaded carried in the HTTP GET Request sent to the server.
  • the terminal may send an HTTP GET Request to the server on the network side according to the URL link that the user clicks, requesting to establish a connection with the server, and the terminal may determine the type of the data to be downloaded according to the HTTP GET Request.
  • S802 The terminal determines whether the type of the data to be downloaded matches the type in the preset data type library; if yes, the terminal determines that the real-time performance of the data to be downloaded is higher than a preset first threshold; otherwise, The terminal determines that the real-time performance of the data to be downloaded is lower than a preset first threshold.
  • the terminal may determine, according to the determined type of the data to be downloaded, whether it matches the type in the preset data type library; the data type in the preset data type library may be that the terminal loads through the corresponding loader. To the terminal, it can be pre-stored in the memory of the terminal or on the server on the network side; it can also be preset to the terminal through the fixture on the production line when the terminal is shipped from the factory, and can also be saved in the terminal according to the user experience. middle.
  • the data types in the preset data type library can be .mp4, .flv, .rm, .rmvb, .avi, .wmv., etc.
  • the terminal determines that the real-time performance of the data to be downloaded is higher than a preset first threshold, that is, the data to be downloaded may be If the terminal determines that the type of the data to be downloaded does not match the data type in the preset data type library, the terminal determines that the real-time performance of the data to be downloaded is lower than a preset first threshold. That is, the data to be downloaded may be a file with lower requirements for real-time performance.
  • the term “matching” as used herein may be understood as whether the type of data to be downloaded is the same as or similar to the data type in the preset data type library, for example, it is assumed that the preset data type library includes .mp4, There are four types of .flv, .rm, and .rmvb, but the terminal determines that the type of data to be downloaded is “.wmv”, and the terminal can also consider that the type of data to be downloaded matches the data type in the preset data type library.
  • the terminal when the terminal determines that the real-time performance of the data to be downloaded is higher than a preset first threshold, the terminal completes downloading of the first download range and the second network card in the first network card.
  • the terminal may refer to all the allocation manners in the first embodiment to the third embodiment.
  • the terminal may select the first implementation manner in the second embodiment and the third embodiment. A solution of the second implementation manner and a possible implementation manner of the foregoing third embodiment.
  • the terminal determines that the real-time performance of the data to be downloaded is lower than a preset first threshold, when the terminal completes the download of the first download range and the second network card does not complete the second download range of the second network card, the terminal For example, all the allocation manners in the first embodiment to the third embodiment may be referred to. Preferably, the terminal may select the third implementation manner and the fourth implementation manner in the second embodiment.
  • the terminal may select different download range allocation manners for different real-time data to be downloaded, so that the download range allocated by the terminal for the first network card and the second network card is timely and appropriate.
  • the download data delay is avoided, and the real-time download of the data to be downloaded is more guaranteed.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
  • FIG. 9 is a schematic structural diagram of Embodiment 1 of a terminal according to an embodiment of the present disclosure. As shown in FIG. 9, the terminal includes an acquisition module 10, a first distribution module 11, and a second distribution module 12.
  • the obtaining module 10 is configured to acquire, by the terminal, a download range range of the data to be downloaded.
  • the first allocation module 11 is configured to allocate a first download range to the first network card according to the download range of the data to be downloaded.
  • the second network card allocates a second download range; the second allocating module 12 is configured to determine that, when the preset download time arrives, the first network card completes downloading of the first download range and the second network card is not completed.
  • the first allocating operation includes: allocating the new first download range to the first network card according to the second download range and allocating the new second download to the second network card according to the second download range Range.
  • the terminal provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
  • the first allocation module 11 is specifically configured to download all the data to be downloaded according to a network speed ratio of the first network card and the second network card.
  • the range is divided into the first download range and the second download range, and is respectively allocated to the first network card and the second network card.
  • the first allocation module 11 is specifically configured to divide the partial download range of the data to be downloaded into the first download range according to a preset allocation rule. And the second download range is respectively allocated to the first network card and the second network card; and the second allocation module 12 is further configured to perform at least one second allocation operation until the data to be downloaded
  • the second allocation operation includes: assigning the next data download range to the first network card and the second network card respectively from the current remaining download range of the data to be downloaded.
  • the terminal provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
  • the second allocation module 12 is specifically configured to allocate the new network card from the second download range according to a preset allocation rule. a first download range and assigning the new second download range to the second network card; or assigning the new first download to the first network card from a remaining download range of the second download range Range and assigning the new second download range to the second network card.
  • the second allocation module 12 is specifically configured to complete the first of the first download range from the current remaining download range of the data to be downloaded.
  • the network card allocates the next download range, and further determines whether the second network card completes the download of the second download range when the preset time arrives; if not, the end downloads the current download range on the first network card Afterwards, assigning the new first download range to the first network card and allocating the new second to the second network card from a remaining download range of the second download range according to a preset allocation rule Download range.
  • the second allocating module 12 is configured to determine, according to the current network speed of the second network card, that the second network card downloads the second download range. Remaining the first time required to download the range, and when determining that the first time is greater than the first preset time, according to a preset allocation rule, the first download range from the second download range is the first time The network card allocates the new first download range and assigns the second network card to the second network card New second download range.
  • the second distribution module 12 is configured to determine, according to the current network speed of the second network card, that the second network card downloads the second download range. Remaining the first time required to download the range, and determining, according to the current network speed of the first network card and the current network speed of the second network card, that the first network card and the second network card jointly download the second Downloading a second time required by the range, and determining, when the first time is greater than the second time, assigning the first network card from the second download range according to the preset allocation rule The new first download range and the new second download range are assigned to the second network card.
  • the terminal provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
  • FIG. 10 is a schematic structural diagram of Embodiment 2 of a terminal according to an embodiment of the present disclosure.
  • the terminal may further include: a determining module 13.
  • the determining module 13 is configured to determine real-time performance of the data to be downloaded.
  • the determining module 13 is specifically configured to determine a first application software APP that initiates a connection request for downloading the to-be-downloaded data, and determine whether the first APP matches an APP in a preset APP set. If yes, determining that the real-time performance of the data to be downloaded is higher than a preset first threshold; otherwise, determining that the real-time performance of the data to be downloaded is lower than a preset first threshold.
  • the determining module 13 is specifically configured to determine a type of data to be downloaded carried in the hypertext transfer protocol acquisition request sent to the server, and determine whether the type of the data to be downloaded is related to a preset data type. The type matching in the library; if yes, determining that the real-time performance of the data to be downloaded is higher than a preset first threshold; otherwise, determining that the real-time performance of the data to be downloaded is lower than a preset first threshold.
  • the preset allocation rule is a product of a current network speed of the first network card or the second network card and the preset download time.
  • the terminal provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
  • FIG. 11 is a schematic structural diagram of Embodiment 3 of a terminal according to an embodiment of the present disclosure.
  • the terminal includes a processor 20, such as a CPU, a memory 21, and at least one communication bus 22.
  • Communication bus 22 is used to implement a communication connection between components.
  • Memory 21 may contain high speed RAM
  • the memory may also include a non-volatile memory NVM, such as at least one disk storage, in which various programs may be stored for performing various processing functions and implementing the method steps of the present embodiment.
  • NVM non-volatile memory
  • the processor 20 is configured to acquire a download range of data to be downloaded, and allocate a first download range to the first network card and a second download range to the second network card according to the download range of the data to be downloaded. And determining, when the preset download time arrives, that the first network card completes the download of the first download range and the second network card does not complete the download of the second download range, performing at least once a distribution operation until the first network card completes a new first download range, the second network card completes a new second download range, and the second download range is completely downloaded; the first allocation operation includes: Allocating the new first download range to the first network card and the new second download range to the second network card according to the second download range.
  • the terminal provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
  • the processor 20 is configured to divide, according to the network speed ratio of the first network card and the second network card, all download ranges of the data to be downloaded into the first download range and the The second download range is described and assigned to the first network card and the second network card, respectively.
  • the processor 20 is configured to divide, according to a preset allocation rule, a partial download range of the data to be downloaded into the first download range and the second download range, and respectively allocate
  • the first network card and the second network card are further configured to perform at least one first allocation operation until the first network card completes a new first download range, and the second network card completes a new second download range
  • the second allocating operation comprises: the terminal from the data to be downloaded The next remaining download range allocates the next data download range for the first network card and the second network card respectively.
  • the processor 20 is configured to allocate the new first download range and the second network card to the first network card from the second download range according to a preset allocation rule. Allocating the new second download range; or assigning the new first download range to the first network card from the remaining download range of the second download range according to a preset allocation rule The second NIC allocates the new second download range.
  • the processor 20 is configured to allocate a next download range for the first network card that completes the first download range from the current remaining download range of the data to be downloaded, and further determine Whether the downloading of the second download range is completed when the second network card arrives at the preset time; if not, after the first network card downloads the current download range, according to the preset allocation rule, from the first The remaining download range of the second download range allocates the new first download range for the first network card and the new second download range for the second network card.
  • the processor 20 is configured to determine, according to the current network speed of the second network card, a first time required for the second network card to download the remaining download range of the second download range, and When the first time is greater than the first preset time, the new first download range and the first network card are allocated from the remaining download range of the second download range according to a preset allocation rule.
  • the second network card allocates the new second download range.
  • the processor 20 is configured to determine, according to the current network speed of the second network card, a first time required for the second network card to download the remaining download range of the second download range;
  • the current network speed of the first network card and the current network speed of the second network card determine a second time required for the first network card and the second network card to jointly download the second download range;
  • assigning the new first download range and the second to the first network card from the second download range according to the preset allocation rule The network card allocates the new second download range.
  • the preset allocation rule is a product of a current network speed of the first network card or the second network card and the preset download time.
  • the terminal provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
  • the processor 20 is further configured to determine real-time performance of the data to be downloaded.
  • the processor 20 is specifically configured to determine a first application software APP that initiates a connection request for downloading the to-be-downloaded data, and determine whether the first APP matches an APP in a preset APP set. If yes, determining that the real-time performance of the data to be downloaded is higher than a preset first threshold; otherwise, determining that the real-time performance of the data to be downloaded is lower than a preset first threshold.
  • the processor 20 is specifically configured to determine a type of data to be downloaded carried in a hypertext transfer protocol acquisition request sent to the server, and determine whether the type of the data to be downloaded is pre- Setting the type matching in the data type library; if yes, determining that the real-time performance of the data to be downloaded is higher than a preset first threshold; otherwise, determining that the real-time performance of the data to be downloaded is lower than a preset first Threshold.
  • the terminal provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
  • FIG. 12 is a schematic flowchart of Embodiment 9 of a method for data transmission according to an embodiment of the present disclosure, where the method is used for a terminal including a first network card and a second network card. Specifically, referring to FIG. 12, the method includes:
  • S1201 The terminal acquires a download range of data to be downloaded.
  • the APP on the terminal may initiate a request for downloading or acquiring network data to the terminal, or the user may click the link on the webpage to make the terminal know the user's request for acquiring network data, so that the terminal can send the server to the network side server.
  • the HTTP GET Request obtains the range of the entire file to be downloaded, and determines the download range of the data to be downloaded in the file to be downloaded.
  • the download range of the data to be downloaded may include the size of the data to be downloaded, or the byte start position of the data to be downloaded and the byte end position of the download data, or the byte start position of the data to be downloaded and the data to be downloaded. size.
  • S1202 The terminal allocates a first download range to the first network card and a second download range to the second network card according to the download range of the data to be downloaded.
  • the terminal performs at least once. An allocation operation until all downloads of the second download range are completed.
  • the first allocation operation includes: allocating a new first download range to the first network card and assigning a new second download range to the second network card according to the remaining download range of the second download range.
  • the terminal may be in a mobile state during the download process, that is, the terminal may switch between networks of different standards, so that the network speed of the network card may be unstable or the network speed of a certain network card may drop suddenly.
  • the network speed of the first network card is stable, and the network speed of the second network card is suddenly decreased due to the switching between the terminals in different standard networks. Therefore, when the first network card completes the download of the first download range, the second network card is not Complete the download of the second download range.
  • the first network card and the second network card are all general concepts.
  • the second network card completes the download of the second download range, and the first network card does not complete the download of the first download range, if the first download range is remaining
  • the load range is greater than the first preset threshold, and the second network card can also share the download task of the first network card. That is, in the process of allocating a new first download range and a new second download range, as long as one network card completes downloading and another is not completed, and meets the preset threshold requirement, the network card sharing download of the uncompleted download can be assisted. task.
  • the download range of the network card can be understood as the data transmission channel allocation download range corresponding to the network card.
  • the two network cards in the terminal include: China Mobile's 4G card and China Unicom's 3G card, which allocates the download range for China Mobile's 4G card, which can be understood as the download range of the data transmission channel corresponding to China Mobile's 4G card.
  • the data transmission channel corresponding to the network card may be given a different name, such as a download engine, but not limited thereto.
  • the terminal allocates a first download range for the first network card and a second download range for the second network card according to the download range of the data to be downloaded, and the first download range is completed by the first terminal and the second network card is not completed by the second network card.
  • the terminal may perform the first allocation operation to allocate the remaining download range allocation part of the second download range to the first network card to share the download task of the second network card, thereby preventing the second network card from always downloading the allocated network at a lower network speed.
  • the downloading time caused by the download task is too long or the download failure occurs, that is, the downloading time of the data to be downloaded is reduced, and the downloading efficiency of the terminal is improved, thereby ensuring reliable downloading of data.
  • the terminal may further include: determining, by the terminal, that the download range of the to-be-downloaded data has an undownloaded range in addition to the first downloading range and the second downloading range, and if so, Then, the first value is taken as the first preset threshold, and if not, the second value is taken as the first preset threshold. Wherein the first value is greater than the second value.
  • the first download range and the second download range in the download range of the data to be downloaded are allocated to the first network card and the second network card for downloading, and the first network card completes the downloading of the first download range and the second network card is not completed.
  • it may first determine whether there is still a portion that is not allocated to the first network card or the second network card for downloading in the download range of the data to be downloaded, and if so, the first preset threshold is larger, if not, then The first preset threshold may take a smaller value.
  • the implementation may take a first value of 4 megabytes (M) and a second value of 1M.
  • FIG. 13 is a schematic flowchart of Embodiment 10 of a method for data transmission according to an embodiment of the present invention. As shown in FIG. 13, the method includes:
  • S1301 The terminal divides the file to be downloaded into a first speed download range, a second speed download range, and a download range of data to be downloaded.
  • the file to be downloaded may refer to the entire download object that the terminal will download, for example, a 100M data packet.
  • Two speed measuring packets are first separated from the entire file to be downloaded, that is, the first speed download range and the second speed download range, and the remaining part is used as the download range of the aforementioned data to be downloaded.
  • S1302 The terminal allocates the first speed download range to the first network card for downloading, and allocates the second speed download range to the second network card for downloading.
  • the first speed download range and the second speed download range may be divided according to the current network format of the first network card and the second network card, but are not limited thereto. Assuming that the first network card is currently a 4G network and the second network card is a 3G network, the first speed download range assigned to the first network card is greater than the second speed download range assigned to the second network card.
  • the 10M (0-10M) in the above 100M is divided into the first speed download range, and 1M (10M-11M) is further divided into the second speed download range.
  • the terminal may divide the first speed download range and the second speed download range according to Table 1, but it is not limited thereto.
  • WCDMA 3G is Wideband Code Division Multiple Access (WCDMA) third-generation mobile communication system (3rd Generation, 3G) network; EVDO 3G is called: CDMA20001xEV-DO (Evolution, Data, Only); TDSCDMA 3G is Time Division-Synchronous Code Division Multiple Access (TDSCDMA) 3G; 4G is a 4th generation mobile communication system (4th Generation).
  • WCDMA Wideband Code Division Multiple Access
  • 3G Third-generation mobile communication system
  • EVDO 3G is called: CDMA20001xEV-DO (Evolution, Data, Only)
  • TDSCDMA 3G is Time Division-Synchronous Code Division Multiple Access (TDSCDMA) 3G
  • 4G is a 4th generation mobile communication system (4th Generation).
  • the terminal acquires a current network speed of the first network card according to the downloading of the first speed measurement range by the first network card, and obtains a current network speed of the second network card according to the downloading of the second speed measurement download range by the second network card.
  • S1304 The terminal acquires a download range of data to be downloaded.
  • the terminal allocates a first download range to the first network card and a second download range to the second network card according to the download range of the data to be downloaded.
  • the terminal performs at least once. An allocation operation until all downloads of the second download range are completed.
  • the first network card and the second network card may also be shared with each other. Specifically, after the terminal allocates the first speed download range to the first network card for downloading, and allocates the second speed download range to the second network card for downloading, if the first network card completes the first speed download range, the second network card is not completed. And the second speed measurement download range is greater than the second preset threshold, and the terminal performs the second allocation operation at least once until the second speed download range is completely downloaded.
  • the second preset threshold may be equal to the foregoing first preset threshold, but is not limited thereto.
  • the second allocation operation includes: allocating a new first speed download range to the first network card and assigning a new second speed download range to the second network card according to the remaining download range of the second speed measurement download range. That is, during the process of downloading the new first speed download range and the new second speed download range, as long as one network card completes the download and the other is not completed, and the preset threshold is met, the network card that has not completed the download can be assisted. Share the download task.
  • the terminal allocates a new first speed downloading range to the first network card and a new second speed downloading range to the second network card according to the remaining download range of the second speed downloading range, which may be:
  • the current network speed ratio of the second network card of the network card divides the remaining download range of the second speed download range into a first sub-speed download range and a second sub-speed download range, and uses the first sub-speed download range as the new first speed
  • the download range is selected, and the sum of the second speed download range and the second sub-speed download range that the second network card has downloaded is used as the new second speed download range.
  • the new second speed download range is used as a new second speed download range.
  • the buffer range may be reserved for the second network card to download, and the buffer range is removed.
  • the remaining download range of the second second speed download range is divided.
  • the first sub-speed download range can be used as the new first speed download range
  • the second network card has been
  • the sum of the downloaded second speed download range, the buffer range, and the second sub-speed download range is used as the new second speed download range, or the sum of the buffer range and the second sub-speed download range is used as the new second speed download range. .
  • the first speed download range assigned to the first network card is 10M (0M-10M), and the second speed download range assigned to the second network card is 1M (10-11M).
  • the actual download range of the second speed download range of the second network card is 0.5M (10-10.5M), and the remaining 0.5M.
  • the second preset threshold is 0.4M
  • the remaining amount of the second network card is 0.5M greater than the second preset threshold of 0.4M
  • the remaining amount of the second network card is 0.5M according to the current network speed ratio.
  • the new first sub-speed download range is 0.38M (10.62-11M); the new second sub-speed download range is 0.12 (10.5-10.62), or the new second sub-speed download range is 0.62 (10-10.62) .
  • the terminal allocates a new second sub-speed download range for the second network card; for the second sub-speed download range of 0.62, the terminal is the second NIC modification original.
  • the second speed range is obtained, thereby obtaining a new sub-second speed download range.
  • the file to be downloaded is divided into an ordinary file and a large file. Specifically, a file larger than the third preset threshold is used as a large file, and a file smaller than or equal to the third preset threshold is used as an ordinary file.
  • the terminal allocates a first download range for the first network card and a second download range for the second network card according to the download range of the data to be downloaded, and may have two Implementation mode:
  • the terminal divides the file to be downloaded into the first part and the second part according to the current network speed ratio of the first network card and the second network card, and subtracts the value of the first speed download range according to the first part from the data to be downloaded.
  • the first download range is divided in the download range
  • the second download range is divided in the download range of the data to be downloaded according to the value of the second part minus the second speed download range.
  • the current network speed of the first network card is 9 M/s
  • the current network speed of the second network card is 1 M/s.
  • the terminal divides the download range of the data to be downloaded into the first download range and the second download range according to the current network speed ratio of the first network card and the second network card.
  • the download range of the first speed measurement is 5M (0-5M) and the second speed is measured.
  • FIG. 14 is a schematic flowchart of Embodiment 11 of the data transmission method according to the embodiment of the present invention.
  • the terminal downloads according to the data to be downloaded.
  • the range of assigning the first download range to the first network card and the second download range to the second network card include:
  • S1401 The terminal cuts out a first to-be-downloaded part from the downloading range of the to-be-downloaded data, where a size of the first to-be-downloaded part is equal to a fourth preset threshold.
  • the fourth preset threshold may be determined according to the download partition of the terminal. Generally, the fourth preset threshold is equal to the size of the download partition of the terminal, but is not limited thereto, and may be smaller than the size of the download partition of the terminal.
  • the fourth preset threshold is equal to the size of the download partition is 20M
  • the size of the first speed download range is 5M
  • the size of the second speed download range is 1M
  • S1402 The terminal divides the first to-be-downloaded portion into a first sub-download range and a second sub-download range according to a current network speed ratio of the first network card and the second network card, and removes the first download range of the to-be-downloaded data. The remaining portion of the download portion is used as the download range of the new data to be downloaded.
  • the first sub-download range belongs to the first download range
  • the second sub-download range belongs to the second download range, that is, the first sub-download range is allocated to the first network card for downloading, and the second sub-download The load range is assigned to the second network card for download.
  • S1403 The terminal determines whether the size of the download range of the new data to be downloaded is less than or equal to the fourth preset threshold. If yes, execute S1404. If not, return to execute S1401.
  • the terminal divides the download range of the new data to be downloaded into a new first sub-download range and a new second sub-download range according to a current network speed ratio of the first network card and the second network card.
  • the new first sub-download range belongs to the first download range
  • the new second sub-download range belongs to the second download range
  • the new first sub-download range is allocated to the first network card for downloading
  • the new The second sub-download range is assigned to the second network card for download.
  • the first to-be-downloaded part is continuously cut out from the download range of the data to be downloaded, and in this process, after the terminal cuts out the first to-be-downloaded part for the first time, it will be divided.
  • the first sub-download range and the second sub-download range are allocated to the first network card and the second network card for downloading. If the first network card completes the download of the first sub-download range, the second network card does not complete the download of the second sub-download range.
  • the terminal cuts out the second to-be-downloaded part from the downloading range of the new data to be downloaded, that is, the downloading range is selected from the downloading range of the data to be downloaded.
  • the second to-be-downloaded portion is further divided into the remaining portion after the first to-be-downloaded portion, and the size of the second to-be-downloaded portion is also equal to the fourth predetermined threshold.
  • the terminal further divides the second to-be-downloaded portion into the third sub-download range and the fourth sub-download range according to the current network speed ratio of the first network card and the second network card, and if the first network card completes the first sub-download range and completes When the second sub-download range is not completed, the second network card does not complete the second sub-download range, and the terminal allocates the fourth download range to the first network card for downloading. That is, in the process of cyclic allocation, the first network card and the second network card can share the download task with each other.
  • the third sub-download range belongs to the first download range
  • the fourth sub-download range belongs to the second download range, that is, the third download range is allocated to the first network card download, and the fourth download range is allocated to the second network card download.
  • the first network card After downloading the first sub-download range, the first network card directly downloads the third sub-download range. If the first network card downloads the third sub-download range, the second network card has not downloaded the second sub-download range. Then, the fourth sub-download range is directly distributed to the first network card for downloading.
  • the fifth preset threshold may also be equal to the foregoing first preset threshold, but is not limited thereto.
  • the terminal performs the foregoing first allocation operation at least once, specifically, For the first allocation operation, the terminal allocates a new first download range to the first network card and a new second download range to the second network card according to the remaining download range of the second download range, which may be: the terminal will be the second The remaining download range of the download range is divided into a buffer range and a range to be allocated, and then a new first download range is allocated for the first network card and a new second download range is allocated for the second network card according to the to-be-allocated range.
  • the original second download range is 5-30M
  • 5-10M has been downloaded
  • the remaining download range of the second download range is 10-30M
  • the 2M of 10-12M is left as a buffer range for the second network card to download
  • 12-30M is allocated as the to-be-allocated range to the first network card and the second network card.
  • the terminal allocates a new first download range to the first network card according to the to-be-assigned range, and allocates a new second download range to the second network card, which may include: the terminal according to the current network speed of the first network card and the second network card Comparing, the foregoing to-be-allocated range is divided into a first sub-allocation range and a second sub-allocation range, and the first sub-allocation range is used as a new first download range, and the second network card in the second download range is downloaded.
  • the range, the above buffer range, and the second sub-allocation range are used as the new second download range.
  • a download range is 10-14M.
  • the terminal is modifying the original second download range for the second network card; for the case where the second download range is 10-14M, the terminal assigns a new second to the second network card. Download the scope of the situation.
  • Embodiments of the present invention support both of the above cases.
  • the terminal performs at least one first allocation operation, specifically: when the first network card completes the download of the first download range, the second network card does not complete the download of the second download range, and the download range of the data to be downloaded is divided If there is no undownloaded range outside the download range and the second download range, and the remaining download range of the second download range is greater than the first preset threshold, the terminal determines that the current download speed of the first network card is greater than the current download speed of the second network card.
  • the terminal performs the first allocation operation at least once. That is, in addition to the first download range and the second If there is no other undownloaded data outside the download range, it may further determine whether the first network card has the condition for sharing the second network card, that is, whether the current download speed of the first network card is greater than the current download speed of the second network card meets the preset. Condition, the second network card is downloaded when the condition is met, otherwise the second network card is downloaded by itself.
  • the preset condition may be that the current download speed of the first network card is greater than 11.1% of the current download speed of the second network card.
  • FIG. 15 is a schematic structural diagram of Embodiment 4 of a terminal according to an embodiment of the present invention. As shown in FIG. 15, the terminal includes: an obtaining module 1501, a first allocating module 1502, and a second allocating module 1503, where:
  • the obtaining module 1501 is configured to obtain a download range of data to be downloaded.
  • the first distribution module 1502 is configured to allocate a first download range to the first network card and a second download range to the second network card according to the download range of the to-be-downloaded data.
  • the second distribution module 1503 is configured to: when the first network card completes the downloading of the first download range, the second network card does not complete the download of the second download range, and the remaining download range of the second download range is greater than At the first preset threshold, the first allocation operation is performed at least once until the second download range is completely downloaded.
  • the first allocation operation includes: allocating a new first download range to the first network card and a new second download range to the second network card according to the remaining download range of the second download range.
  • the terminal allocates a first download range for the first network card and a second download range for the second network card according to the download range of the data to be downloaded, and the first download range is completed by the first terminal and the second network card is not completed by the second network card.
  • the terminal may perform the first allocation operation to allocate the remaining download range allocation part of the second download range to the first network card to share the download task of the second network card, thereby preventing the second network card from always downloading the allocated network at a lower network speed.
  • the downloading time caused by the download task is too long or the download failure occurs, that is, the downloading time of the data to be downloaded is reduced, and the downloading efficiency of the terminal is improved, thereby ensuring reliable downloading of data.
  • FIG. 16 is a schematic structural diagram of Embodiment 5 of a terminal according to an embodiment of the present invention.
  • the terminal may further include: a determining module 1504, configured to perform at least the second allocating module 1503.
  • determining whether the download range of the data to be downloaded includes an undownloaded range in addition to the first download range and the second download range, and if yes, taking the first value as the a first preset threshold, if not, taking the second value as the The first preset threshold. Wherein the first value is greater than the second value.
  • FIG. 17 is a schematic structural diagram of Embodiment 6 of a terminal according to an embodiment of the present invention. As shown in FIG. 17, the terminal may further include: a splitting module 1701 and a speed measuring module 1702. Of course, the determination module 1504 in FIG. 16 can also be included.
  • the segmentation module 1701 is configured to divide the file to be downloaded into a first speed download range, a second speed download range, and a download range of the to-be-downloaded data before the acquiring module 1501 obtains a download range of the data to be downloaded.
  • the first distribution module 1502 is further configured to allocate the first speed download range to the first network card for downloading, and allocate the second speed download range to the second network card for downloading.
  • the speed measuring module 1702 is configured to acquire a current network speed of the first network card according to the downloading of the first speed download range by the first network card, and download the second speed download range according to the second network card Obtaining a current network speed of the second network card.
  • the second allocation module 1503 is further configured to: when the first network card completes the first speed downloading range, and the second network card does not complete the second speed downloading range, And when the remaining download range of the second speed measurement download range that is not completed by the second network card is greater than the second preset threshold, the second allocation operation is performed at least once until all downloads of the second speed download range are completed.
  • the second allocation operation includes: allocating a new first speed download range to the first network card and assigning a new second speed download range to the second network card according to the remaining download range of the second speed measurement download range.
  • the second network card does not complete the second speed download range, and the second network card
  • the second allocation module 1503 is further configured to complete the first download range and the second network card is still in the first network card, where the remaining download range of the uncompleted second speed downloading range is less than or equal to the second preset threshold.
  • the second download range is allocated to the first network card for downloading.
  • the file to be downloaded is divided into an ordinary file and a large file. Specifically, a file larger than the third preset threshold is used as a large file, and a file smaller than or equal to the third preset threshold is used as an ordinary file.
  • the first distribution module 1502 is configured to allocate the first download to the first network card according to the download range of the data to be downloaded.
  • the second downloading range is allocated to the second network card, specifically: dividing the file to be downloaded into the first part and the second part according to the current network speed ratio of the first network card and the second network card, Dividing the first download range within a download range of the data to be downloaded according to the value of the first portion minus the first speed download range, and subtracting the second speed according to the second part Downloading the range-sized value to divide the second download range within the download range of the data to be downloaded; or, according to the current network speed ratio of the first network card and the second network card, the data to be downloaded
  • the download range is divided into the first download range and the second download range.
  • the first allocation module 1502 is configured to allocate the first download range and the second network card to the first network card according to the download range of the data to be downloaded.
  • the second downloading range is allocated, specifically: the first to-be-downloaded portion is segmented from the downloading range of the to-be-downloaded data, wherein the size of the first to-be-downloaded portion is equal to a fourth preset threshold; a current network speed ratio of a network card and the second network card, dividing the first to-be-downloaded portion into a first sub-download range and a second sub-download range, and removing the download range of the data to be downloaded.
  • the remaining portion of the first to-be-downloaded portion is the download range of the new data to be downloaded, wherein the first sub-download range belongs to the first download range, and the second sub-download range belongs to the second download range; Until the size of the download range of the new data to be downloaded is less than or equal to the fourth preset threshold
  • the first allocation module 1502 removes the remaining portion of the first to-be-downloaded portion from the download range of the data to be downloaded as a new data to be downloaded. After the downloading range, if the first network card completes the download of the first sub-download range, the second network card does not complete the download of the second sub-download range, and the remaining download of the second sub-download range If the range is less than or equal to the fifth preset threshold, the second to-be-downloaded portion is further cut out from the download range of the new data to be downloaded, where the size of the second to-be-downloaded portion is equal to the first a fourth preset threshold; the first to-be-downloaded portion is divided into a third sub-download range and a fourth sub-download range according to the current network speed ratio of the first network card and the second network card, where the The three sub-download range belongs to the first download range, and the fourth sub- The loading range belongs to the second download range; when the first network card completes the first sub-
  • the second allocation module 1503 is configured to allocate the new first download range and the second network card to the first network card according to the remaining download range of the second download range.
  • the new second downloading range is specifically: dividing the remaining download range of the second downloading range into a buffering range and a to-be-allocated range; and assigning the new number to the first network card according to the to-be-allocated range a download range and assigning the new second download range to the second network card.
  • the second distribution module 1503 is configured to allocate the new first download range to the first network card and the new second download range to the second network card according to the to-be-allocated range, specifically: according to The current network speed ratio of the first network card and the second network card, the range to be allocated is divided into a first child to be allocated range and a second child to be allocated range, and the first child to be allocated is used as the And the new first download range, the sum of the second network card downloaded range, the buffer range, and the second sub-allocation range in the second download range is used as the new second download range. Or, the first sub-allocation range is used as the new first download range, and the sum of the buffer range and the second sub-allocation range is used as the new second download range.
  • the second distribution module 1503 is configured to allocate a new first speed download range to the first network card and a new second speed measurement to the second network card according to the remaining download range of the second speed measurement download range.
  • the download range is specifically: dividing the remaining download range of the second speed download range into the first sub-speed download range and the second sub-speed download according to the current network speed ratio of the first network card and the second network card a range, the first sub-speed download range is used as the new first speed download range, and the sum of the second speed download range and the second sub-speed download range that the second network card has downloaded is taken as The new second speed download range.
  • the new second speed download range is used as a new second speed download range.
  • the second distribution module 1503 is configured to complete downloading of the first download range in the first network card, downloading the second download range by the second network card, and the to-be-downloaded Determining that the first network card is currently downloaded when there is no undownloaded range except the first download range and the second download range, and the remaining download range of the second download range is greater than the first preset threshold. Whether the portion whose speed is greater than the current download speed of the second network card satisfies the preset condition, and if so, performs the first allocation operation at least once.
  • the terminal provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
  • the terminal includes a processor 20, such as a CPU, a memory 21, and at least one communication bus 22.
  • Communication bus 22 is used to implement a communication connection between components.
  • the memory 21 may include a high speed RAM memory, and may also include a non-volatile memory NVM, such as at least one disk memory, in which various programs may be stored for performing various processing functions and implementing the implementation shown in Figures 12-14. The method steps of the example. Among them, specifically,
  • the processor 20 is configured to obtain a download range of data to be downloaded, allocate a first download range to the first network card, and allocate a second download range to the second network card according to the download range of the data to be downloaded; When the first network card completes the downloading of the first download range, the second network card does not complete the download of the second download range, and when the remaining download range of the second download range is greater than the first preset threshold, the execution is performed at least once. An allocation operation until all downloads of the second download range are completed.
  • the first allocation operation includes: allocating a new first download range to the first network card and a new second download range to the second network card according to the remaining download range of the second download range.
  • the processor 20 is configured to: after the first network card completes downloading of the first download range, the second network card does not complete downloading of the second download range, and the data to be downloaded is Determining that the current download speed of the first network card is greater than the first download threshold when the remaining download range of the second download range is greater than the first preset threshold except the first download range and the second download range. Whether the part of the current download speed of the second network card satisfies a preset condition, and if so, performing the first allocation operation at least once.
  • the terminal provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
  • the processor 20 is configured to determine, before the at least one first allocation operation, whether the download range of the data to be downloaded is not downloaded except the first download range and the second download range. The range, if yes, takes the first value as the first preset threshold, and if not, takes the second value as the first preset threshold; the first value is greater than the second value.
  • the processor 20 is configured to divide the file to be downloaded into a first speed download range, a second speed download range, and a download range of the to-be-downloaded data before acquiring the download range of the data to be downloaded; downloading the first speed Range is allocated to the first network card for downloading, and the second speed is measured The load range is allocated to the second network card for downloading; obtaining the current network speed of the first network card according to the downloading of the first speed download range by the first network card, and according to the second network card pair The downloading of the second speed download range obtains the current network speed of the second network card.
  • the processor 20 after the first network card completes the first speed download range, the second network card does not complete the second speed download range, and the second network card does not complete the second speed download
  • the second allocation operation is performed at least once until the second speed download range is completely downloaded.
  • the second allocation operation includes: allocating a new first speed download range to the first network card and assigning a new second speed download range to the second network card according to the remaining download range of the second speed measurement download range.
  • the processor 20 is further configured to: after the first network card completes the first download range, and the second network card still does not complete the second speed downloading range, And transmitting the second download range to the first network card for downloading.
  • the processor 20 is configured to allocate the first download range and the second network card to the first network card according to the download range of the data to be downloaded. And allocating the second downloading range, specifically: dividing the to-be-downloaded file into the first part and the second part according to the current network speed ratio of the first network card and the second network card, and subtracting the first part according to the first part.
  • the value of the first speed download range is divided into the first download range in the download range of the data to be downloaded, and the value after subtracting the second speed download range according to the second part is Decoding the second download range within the download range of the data to be downloaded; or dividing the download range of the data to be downloaded into the first according to the current network speed ratio of the first network card and the second network card A download range and the second download range.
  • the processor 20 is configured to allocate a first download range to the first network card and a second network card according to the download range of the data to be downloaded.
  • the second downloading range is specifically: the first to be downloaded part is segmented from the downloading range of the data to be downloaded, wherein the size of the first to-be-downloaded portion is equal to a fourth preset threshold; according to the first network card And the current network speed ratio of the second network card, dividing the first to-be-downloaded portion into a first sub-download range and a second sub-download range, and removing the download range of the to-be-downloaded data
  • the remaining portion of the first to-be-downloaded portion serves as a download range of the new data to be downloaded, wherein the first sub-download range belongs to the first download range, and the second sub-download range belongs to the second download a range; until the size of the download range of the new data to be downloaded is less than or equal to the fourth preset threshold; and
  • the first network card and the second network card may also share the download task with each other.
  • the processor 20 removes the first to be downloaded from the download range of the data to be downloaded. After the remaining portion of the portion is the download range of the new data to be downloaded, if the first network card completes the download of the first sub-download range, the second network card does not complete the download of the second sub-download range, and And the remaining download range of the second sub-download range is less than or equal to the fifth preset threshold, and is further configured to: cut off a second to-be-downloaded part from the download range of the new data to be downloaded, where the The size of the second to-be-downloaded portion is equal to the fourth preset threshold; and the first to-be-downloaded portion is divided into the third sub-download range and the first according to the current network speed ratio of the first network card and the second network card.
  • the third sub-download range belongs to the first download range
  • the fourth sub-download range belongs to the second download range
  • the first sub-download is completed on the first network card Fan And downloading the third sub-range is completed, the second card is not completed downloading the second sub range, the fourth sub-range assigned to the first download card download.
  • the processor 20 is configured to allocate the new first download range to the first network card and allocate the new network card to the second network card according to a remaining download range of the second download range.
  • the new second downloading range is specifically: dividing the remaining download range of the second download range into a buffer range and a to-be-allocated range; and allocating the new first download to the first network card according to the to-be-allocated range Range and assigning the new second download range to the second network card.
  • the processor 20 is configured to allocate the new first download range to the first network card and the new second download range to the second network card according to the to-be-allocated range, specifically: according to the a current network speed ratio of the first network card and the second network card, the range to be allocated is divided into a first child to be allocated range and a second child to be allocated, and the first child to be allocated is used as the a new first download range, where the second network card has been downloaded in the second download range, and the cached range And a sum of the second sub-allocation range as the new second download range; or, the first sub-allocation range is used as the new first download range, the cache range and the The sum of the second sub-allocation range is described as the new second download range.
  • the processor 20 is configured to allocate a new first speed download range to the first network card and a new second speed download range to the second network card according to the remaining download range of the second speed download range, specifically And dividing, according to the current network speed ratio of the first network card and the second network card, a remaining download range of the second speed download range into a first sub-speed download range and a second sub-speed download range, where a first sub-speed download range as the new first speed download range, and a sum of the second speed download range and the second sub-speed download range that the second network card has downloaded as the new number The second speed download range.
  • the new second speed download range is used as a new second speed download range.
  • the terminal provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Environmental & Geological Engineering (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本发明提供一种数据传输的方法和终端。该方法包括:终端根据所获取的待下载数据的下载range为第一网卡分配第一下载range和为第二网卡分配第二下载range;终端判断在预设的下载时间到达时,第一网卡完成第一下载range的下载且第二网卡未完成第二下载range的下载,则终端执行至少一次第一分配操作,从而减少待下载数据的下载时长。

Description

数据传输的方法和终端
本申请为2015年04月10日向中华人民共和国国家知识产权局递交的申请号为PCT/CN2015/076284的发明申请的在后申请。
技术领域
本发明涉及通信技术,尤其涉及一种数据传输的方法和终端。
背景技术
随着通信技术的不断发展,双卡的终端在人们的生活中越来越普及。但是,目前大部分的双卡终端都是单通道的,即同一个时刻,只有1个卡能够进行数据业务,终端的网速受限于单卡获取网络数据的速度,给用户利用终端下载文件带来了或多或少的障碍。
为了改善上述情况,以手机为例,现有技术通过采用支持双通道下载的HTTP1.1协议对服务端的文件进行下载,即采用超文本传输协议(HyperText Transfer Protocol,简称HTTP)1.1协议,双卡手机的两个卡可以同时从服务器上下载文件。例如,当终端从服务器下载一个文件时,可以把文件分割成多份,然后每一份在一种物理链路上进行传输,以达到并发下载的目的。比如,通过HTTP1.1协议下载一个100M字节的文件时,可以在物理小区(CELL)链路1上下载前50M,在CELL链路2上下载后50M,而且是同时下载,这样就可以达到加快下载速度的目的。
但是,当终端在移动过程中,会出现不同制式网络间的切换(例如3G、4G网络间的切换),由于不同制式网络的上网速率差异很大,在这种情况下,可能出现某个卡的下载速度骤降,导致文件下载的时间超时或者下载失败,即现有技术无法保证文件的正常下载。
发明内容
本发明实施例提供一种数据传输的方法和终端,用以解决现有技术中具有双网卡的终端在某个网卡的下载速度骤降时,导致文件下载的时间超时或者下载失败的技术问题。
第一方面,本发明实施例提供一种数据传输的方法,所述方法适用于包括第一网卡和第二网卡的终端;所述方法包括:
所述终端获取待下载数据的下载范围range;
所述终端根据所述待下载数据的下载range为所述第一网卡分配第一下载range和为所述第二网卡分配第二下载range;
所述终端判断在预设的下载时间到达时,所述第一网卡完成所述第一下载range的下载且所述第二网卡未完成所述第二下载range的下载,则所述终端执行至少一次第一分配操作,直至所述第一网卡完成新的第一下载range、所述第二网卡完成新的第二下载range以及所述第二下载range全部下载完成为止;
所述第一分配操作包括:根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
结合第一方面,在第一方面的第一种可能的实施方式中,所述终端根据所述待下载数据的下载range为所述第一网卡分配第一下载range和为所述第二网卡分配第二下载range,包括:
所述终端按照所述第一网卡和所述第二网卡的网速比,将所述待下载数据的全部下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡。
结合第一方面,在第一方面的第二种可能的实施方式中,所述终端根据所述待下载数据的下载range为所述第一网卡分配第一下载range和为所述第二网卡分配第二下载range,包括:
所述终端按照预设的分配规则,将所述待下载数据的部分下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡;
所述方法之后,还包括:
所述终端执行至少一次第二分配操作,直至所述待下载数据全部下载完成为止;
所述第二分配操作包括:所述终端从所述待下载数据的当前剩余下载range中为所述第一网卡和所述第二网卡分别分配下一次的数据下载range。
结合第一方面至第一方面的第二种可能的实施方式中的任一项,在第一 方面的第三种可能的实施方式中,所述终端根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range,具体包括:
所述终端按照预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range;
或者
所述终端按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
结合第一方面的第二种可能的实施方式,在第一方面的第四种可能的实施方式中,所述终端根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range,具体包括:
所述终端从所述待下载数据的当前剩余下载range中为完成所述第一下载range的所述第一网卡分配下一次的下载range,并进一步判断所述第二网卡在预设时刻到达时是否完成所述第二下载range的下载;
若否,则所述终端在所述第一网卡下载完当前的下载range后,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
结合第一方面至第一方面的第二种可能的实施方式中的任一项,在第一方面的第五种可能的实施方式中,所述终端根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range,具体包括:
所述终端根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间;
所述终端在判断所述第一时间大于第一预设时间时,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
结合第一方面至第一方面的第二种可能的实施方式中的任一项,在第一方面的第六种可能的实施方式中,所述终端根据所述第二下载range为所述 第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range,具体包括:
所述终端根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间;
所述终端根据所述第一网卡当前的网速、所述第二网卡当前的网速,确定所述第一网卡和所述第二网卡共同下载所述第二下载range所需要的第二时间;
当所述第一时间大于所述第二时间时,所述终端按照所述预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
结合第一方面至第一方面的第六种可能的实施方式中的任一项,在第一方面的第七种可能的实施方式中,所述方法之前,还包括:所述终端确定所述待下载数据的实时性。
结合第一方面的第七种可能的实施方式,在第一方面的第八种可能的实施方式中,所述终端确定待下载数据的实时性,具体包括:
所述终端确定发起下载所述待下载数据的连接请求的第一应用软件APP;
所述终端判断所述第一APP是否与预设的APP集合中的APP匹配;
若是,则所述终端确定所述待下载数据的实时性高于预设的第一阈值;
否则,所述终端确定所述待下载数据的实时性低于预设的第一阈值。
结合第一方面的第七种可能的实施方式,在第一方面的第九种可能的实施方式中,所述终端确定待下载数据的实时性,具体包括:
所述终端确定发给服务器的超文本传输协议获取请求中携带的待下载数据的类型;
所述终端判断所述待下载数据的类型是否与预设的数据类型库中的类型匹配;
若是,则所述终端确定所述待下载数据的实时性高于预设的第一阈值;否则,所述终端确定所述待下载数据的实时性低于预设的第一阈值。
结合第一方面的第二种可能的实施方式至第一方面的第九种可能的实施方式中的任一项,在第一方面的第十种可能的实施方式中,所述预设的分配 规则为所述第一网卡或第二网卡的当前网速和所述预设的下载时间的乘积。
第二方面,本发明实施例提供一种终端,所述终端为具有第一网卡和第二网卡的终端,所述终端包括:
获取模块,用于终端获取待下载数据的下载范围range;
第一分配模块,用于根据所述待下载数据的下载range为所述第一网卡分配第一下载range和为所述第二网卡分配第二下载range;
第二分配模块,用于判断在预设的下载时间到达时,所述第一网卡完成所述第一下载range的下载且所述第二网卡未完成所述第二下载range的下载,则执行至少一次第一分配操作,直至所述第一网卡完成新的第一下载range、所述第二网卡完成新的第二下载range以及所述第二下载range全部下载完成为止;所述第一分配操作包括:根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
结合第二方面,在第二方面的第一种可能的实施方式中,所述第一分配模块,具体用于按照所述第一网卡和所述第二网卡的网速比,将所述待下载数据的全部下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡。
结合第二方面,在第二方面的第二种可能的实施方式中,所述第一分配模块,具体用于按照预设的分配规则,将所述待下载数据的部分下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡;
则所述第二分配模块,还用于执行至少一次第二分配操作,直至所述待下载数据全部下载完成为止;所述第二分配操作包括:从所述待下载数据的当前剩余下载range中为所述第一网卡和所述第二网卡分别分配下一次的数据下载range。
结合第二方面至第二方面的第二种可能的实施方式中的任一项,在第二方面的第三种可能的实施方式中,所述第二分配模块,具体用于按照预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range;或者,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和 为所述第二网卡分配所述新的第二下载range。
结合第二方面的第二种可能的实施方式,在第二方面的第四种可能的实施方式中,所述第二分配模块,具体用于从所述待下载数据的当前剩余下载range中为完成所述第一下载range的所述第一网卡分配下一次的下载range,并进一步判断所述第二网卡在预设时刻到达时是否完成所述第二下载range的下载;若否,则端在所述第一网卡下载完当前的下载range后,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
结合第二方面至第二方面的第二种可能的实施方式中的任一项,在第二方面的第五种可能的实施方式中,所述第二分配模块,具体用于根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间,并在判断所述第一时间大于第一预设时间时,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
结合第二方面至第二方面的第二种可能的实施方式中的任一项,在第二方面的第六种可能的实施方式中,所述第二分配模块,具体用于根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间,并根据所述第一网卡当前的网速、所述第二网卡当前的网速,确定所述第一网卡和所述第二网卡共同下载所述第二下载range所需要的第二时间,并在判断当所述第一时间大于所述第二时间时,按照所述预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
结合第二方面至第二方面的第六种可能的实施方式中的任一项,在第二方面的第七种可能的实施方式中,所述终端还包括:
确定模块,用于确定所述待下载数据的实时性。
结合第二方面的第七种可能的实施方式,在第二方面的第八种可能的实施方式中,所述确定模块,具体用于确定发起下载所述待下载数据的连接请求的第一应用软件APP,并判断所述第一APP是否与预设的APP集合中的APP匹配;若是,则确定所述待下载数据的实时性高于预设的第一阈值;否 则,则确定所述待下载数据的实时性低于预设的第一阈值。
结合第二方面的第七种可能的实施方式,在第二方面的第九种可能的实施方式中,所述确定模块,具体用于确定发给服务器的超文本传输协议获取请求中携带的待下载数据的类型,并判断所述待下载数据的类型是否与预设的数据类型库中的类型匹配;若是,则确定所述待下载数据的实时性高于预设的第一阈值;否则,则确定所述待下载数据的实时性低于预设的第一阈值。
结合第二方面的第二种可能的实施方式至第二方面的第九种可能的实施方式中的任一项,在第二方面的第十种可能的实施方式中,所述预设的分配规则为所述第一网卡或第二网卡的当前网速和所述预设的下载时间的乘积。
本发明实施例提供的数据传输的方法和终端,通过终端在确定待下载数据的下载range,根据待下载数据的下载range为第一网卡分配第一下载range和为第二网卡分配第二下载range,并判断在预设的下载时间到达时,第一网卡完成所述第一下载range的下载且第二网卡未完成所述第二下载range的下载的情况下,终端执行至少一次第一分配操作,直至第一网卡完成新的第一下载range、第二网卡完成新的第二下载range以及第二下载range全部下载完成为止。本发明实施例提供的方法,在第二网卡未按时完成下载任务时,第一网卡可以为第二网卡分担下载任务,从而避免第二网卡一直以较低的网速下载所分配的下载任务而导致的下载时间过长或者下载失败的情况发生,即,本发明实施例提供的方法,减少了待下载数据的下载时长,提高了终端的下载效率,从而可以保证数据的可靠下载。
第三方面,本发明实施例提供一种数据传输的方法,所述方法适用于包括第一网卡和第二网卡的终端,所述方法包括:
所述终端获取待下载数据的下载范围;
所述终端根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围;
若所述第一网卡完成所述第一下载范围的下载时所述第二网卡未完成所述第二下载范围的下载,且第二下载范围的剩余下载范围大于第一预设阈值,则所述终端执行至少一次第一分配操作,直至所述第二下载范围全部下载完成为止;
所述第一分配操作包括:根据所述第二下载范围的剩余下载范围为所述 第一网卡分配新的第一下载范围和为所述第二网卡分配新的第二下载范围。
第四方面,本发明实施例提供一种终端,所述终端为具有第一网卡和第二网卡的终端,所述终端包括:
获取模块,用于获取待下载数据的下载范围;
第一分配模块,用于根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围;
第二分配模块,用于在所述第一网卡完成所述第一下载范围的下载时所述第二网卡未完成所述第二下载范围的下载,且第二下载范围的剩余下载范围大于第一预设阈值时,执行至少一次第一分配操作,直至所述第二下载范围全部下载完成为止;
所述第一分配操作包括:根据所述第二下载范围的剩余下载范围为所述第一网卡分配新的第一下载范围和为所述第二网卡分配新的第二下载范围。
本发明实施例提供的数据传输的方法和终端中,终端根据待下载数据的下载范围为第一网卡分配第一下载范围和为第二网卡分配第二下载范围,在第一终端完成第一下载范围而第二网卡未完成第二下载范围时,终端可以执行第一分配操作将第二下载范围剩余下载范围分配部分给第一网卡来分担第二网卡的下载任务,从而避免第二网卡一直以较低的网速下载所分配的下载任务而导致的下载时间过长或者下载失败的情况发生,即减少了待下载数据的下载时长,提高了终端的下载效率,从而可以保证数据的可靠下载。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的数据传输的方法实施例一的流程示意图;
图2为本发明实施例提供的数据传输的方法实施例二的流程示意图;
图3为本发明实施例提供的数据传输的方法实施例三的流程示意图;
图4为本发明实施例提供的数据传输的方法实施例四的流程示意图;
图5为本发明实施例提供的数据传输的方法实施例五的流程示意图;
图6为本发明实施例提供的数据传输的方法实施例六的流程示意图;
图7为本发明实施例提供的数据传输的方法实施例七的流程示意图;
图8为本发明实施例提供的数据传输的方法实施例八的流程示意图;
图9为本发明实施例提供的终端实施例一的结构示意图;
图10为本发明实施例提供的终端实施例二的结构示意图;
图11为本发明实施例提供的终端实施例三的结构示意图;
图12为本发明实施例提供的数据传输的方法实施例九的流程示意图;
图13为本发明实施例提供的数据传输的方法实施例十的流程示意图;
图14为本发明实施例提供的数据传输的方法实施例十一的流程示意图;
图15为本发明实施例提供的终端实施例四的结构示意图;
图16为本发明实施例提供的终端实施例五的结构示意图;
图17为本发明实施例提供的终端实施例六的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例所涉及的终端,可以包括但不限于手机、个人数字助理(Personal Digital Assistant,简称PDA)、平板电脑、便携设备(例如,便携式计算机)等包括第一网卡和第二网卡的移动通讯设备,也包括自动柜员机(Automatic Teller Machine,简称ATM)等包括第一网卡和第二网卡的设备,或者支持第一网卡和第二网卡的通信芯片,本发明实施例对终端的种类并不做限定。需要说明的是,上述第一网卡和第二网卡可以为2G网络下的客户识别模块(Subscriber Identity Module,简称SIM)卡,也可以为3G网络下的通用集成电路卡(Universal Integrated Circuit Card,简称UICC),还可以为终端中的上网模块,例如,具体可以是4G网络或 3G网络或2G网络的上网模块或无线保真(Wireless Fidelity,简称WiFi)上网模块等。
本发明实施例涉及的方法,旨在解决现有技术中具有双网卡的终端在某个网卡的网速骤降时,导致文件下载的时间超时或者下载失败的技术问题;并且还可以解决现有技术无法针对待下载数据的实时性及时调整下载方式而引发的数据下载延迟的技术问题。
下面以具体地实施例对本发明的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。
图1为本发明实施例提供的数据传输的方法实施例一的流程示意图。本实施例涉及的方法是通过调整待下载数据的分配方式使得第一网卡和第二网卡可以及时下载待下载数据,节约下载时间的具体过程。如图1所示,该方法包括:
S101:终端获取待下载数据的下载range。
具体的,终端上的应用软件(Aplication,简称APP)可以向终端发起下载或者获取网络数据的请求,或者,用户可以通过点击网页上的链接使得终端获知用户获取网络数据的请求,从而使得终端可以通过向网络侧的服务器发送超文本传输协议获取请求(HyperText Transfer Protocol GET Request,简称HTTP GET Request)获取待下载数据的下载范围(range)。待下载数据的下载range可以包括待下载数据的大小,或者,待下载数据的字节起始位置和下载数据的字节终止位置。
S102:终端根据所述待下载数据的下载range为所述第一网卡分配第一下载range和为所述第二网卡分配第二下载range。
这里的第一下载range和第二下载range为终端分配给第一网卡和第二网卡的需要下载的数据的字节起始位置和字节终止位置。
具体的,当终端获知待下载数据的下载range后,终端根据上述待下载数据的下载range分别为第一网卡和第二网卡分配相应的下载range。可选的,终端可以通过预设一下载时间,根据该下载时间以及待下载数据的下载range,为第一网卡和第二网卡分配对应的下载range;可选的,终端还可以通过所预设的下载时间,并根据第一网卡当前的网速和第二网卡当前的网速为 第一网卡分配第一下载range以及为第二网卡分配第二下载range。例如:假设待下载数据的下载range为0-100M,第一网卡和第二网卡的网速均为1M/s,终端为第一网卡和第二网卡分别分配下载时间为1s的下载量(即1M的比特),即终端为第一网卡分配的第一下载range为(0-1M),为第二终端分配的第二下载range为(1M-2M)。上述终端预设的下载时间,可以是终端根据待下载数据的下载range动态生成的值,也就是说下载时间的设定是随着待下载数据的下载range的分配方式的变化而变化的;例如,假设终端将待下载range分为第一下载range和第二下载range(如何分配待下载数据的下载range,本发明实施例对此不做限制),将其对应分配给第一网卡和第二网卡,此时终端预设的下载时间就会较长;又假设,终端从待下载数据的下载range的部分下载range,将该部分下载range分为第一下载range和第二下载range,则此时终端预设的下载时间将会较前述的分配方式下的下载时间较短。
在本实施例中,对终端初次如何为第一网卡和第二网卡分配相应的下载range的分配方式或者分配原则并不做限制。
S103:终端判断在预设的下载时间到达时,所述第一网卡完成所述第一下载range的下载且所述第二网卡未完成所述第二下载range的下载,则所述终端执行至少一次第一分配操作,直至所述第一网卡完成新的第一下载range的下载、所述第二网卡完成新的第二下载range的下载以及所述第二下载range全部下载完成为止;所述第一分配操作包括:根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
具体的,终端在下载过程中,可能会处于移动的状态,即终端可能在不同制式的网络间切换,因此容易造成网卡的网速不稳定或者造成某一个网卡的网速骤降,本实施例中,假设第一网卡的网速稳定,第二网卡由于终端在不同制式网络间的切换,其网速骤降,因此,终端分配给第二网卡的第二下载range无法在预设的下载时间(例如上述例子中的1s)到达时按时完成。
故,当终端判断在预设的下载时间到达时,第一网卡完成第一下载range的下载且第二网卡未完成第二下载range的下载,则终端执行至少一次第一分配操作,直至第一网卡完成新的第一下载range、第二网卡完成新的第二下 载range以及第二下载range全部下载完成为止,该第一分配操作包括:终端根据第二下载range为第一网卡分配新的第一下载range和为第二网卡分配所述新的第二下载range。本实施例中,该第一分配操作可以是终端将第二下载range一分为二,即将第二下载range分为新的第一下载range和新的第二下载range两部分,并将这两部分分别分配给第一网卡和第二网卡;还可以是从第二下载range中取出一部分下载range,将这部分下载range分为新的第一下载range和新的第二下载range两部分,并将这两部分分别分配给第一网卡和第二网卡;还可以是将第二网卡未下载完的下载range(即第二下载range的剩余下载range)一分为二,即将第二网卡未下载完的下载range分为新的第一下载range和新的第二下载range两部分,并将这两部分分别分配给第一网卡和第二网卡;还可以是从第二网卡未下载完的下载range取出一部分下载range,将这部分下载range分为新的第一下载range和新的第二下载range两部分,并将这两部分分别分配给第一网卡和第二网卡。也就是说,上述第一分配操作实际上是第一网卡在第二网卡没有下载完第二下载range时,对第二网卡的下载range的分担。
即,终端在判断预设的下载时间到达时,第一网卡完成上述第一下载range的下载且第二网卡未完成上述第二下载range的下载,则终端根据上述第二下载range为第一网卡分配新的第一下载range和为第二网卡分配新的第二下载range;之后,第一网卡执行新的第一下载rang的下载操作,第二网卡执行新的第二下载range的下载操作(需要说明的是,终端在为两个网卡分配新的下载range时也会预设一新的下载时间,该新的下载时间可以与上述预设的下载时间时长相等,也可以不相等,本实施例中为了方便描述,可以假设预设的新的下载时间等于上述预设的下载时间),终端继续判断两个网卡在新的下载时间到达时,是否均完成了相应新的下载range的下载;若两个网卡在新的下载时间到达时均已完成相应新的下载range的下载,则终端判断上述初次分配给第二网卡的第二下载range此时是否全部下载完成,若是,则说明第一网卡和第二网卡均完成了初次分配的下载range的下载,若否,则说明初次分配给第二网卡的第二下载range仍然没有全部下载完成,终端继续从第二下载range除新的第一下载range和新的第二下载range之外的剩余下载range中,再次为第一网卡和第二网卡分配另一新的第一下载 range和另一新的第二下载range,并重复上述过程,直至第一网卡完成当前所分配的新的第一下载range的下载、第二网卡完成当前新的第二下载range的下载以及第二下载range全部下载完成为止。
可选的,若终端判断两个网卡在新的下载时间到达时,第一网卡完成了新的第一下载range的下载,第二网卡仍然没有完成新的第二下载range的下载,则终端会继续从该新的第二下载range中为上述完成新的第一下载range的第一网卡再次分配另一新的第一下载range,为上述未完成新的第二下载range的第二网卡再次分配另一新的第二下载range,直至第二网卡的新的第二下载range全部下载完成为止,再继续判断终端初次分配给第二网卡的第二下载range是否全部下载完成。
为了更好的理解上述第一分配操作,此处可以以一个简单的例子来说明,具体为:
假设待下载数据的下载range为0-100M,第一网卡和第二网卡的网速均为1M/s,终端为第一网卡和第二网卡分别分配下载时间为1s的下载量,即终端为第一网卡分配的第一下载range为(0-1M),为第二终端分配的第二下载range为(1M-2M),正常情况下,两个网卡都可以在1s到达时完成下载。但是,由于第二网卡从4G网络切换到了3G网络,网速变为了0.1M Byte/s,因此第二网卡在1s到达时未完成第二下载range的下载,则终端执行第一分配操作,即终端此时终止第二网卡的下载(第二网卡当前只下载了0.1M),可选的,终端将第二网卡的剩余下载range(1.1M-2M)在第一网卡和第二网卡之间重新进行分配。假设终端预设的新的下载时间也为1s,则终端可以给第二网卡分配的新的第二下载range为(1.1M-1.2M),给第一网卡分配的新的第一下载range为(1.2M-2M),最后终端判断在该预设的下载时间(1s)到达时,新的第一下载range和新的第二下载range是否均已下载完成;假设在该预设的下载时间(1s)到达时,第一网卡完成了新的第一下载range(1.2M-2M)的下载,第二网卡仍然没有完成新的第二下载range(1.1M-1.2M)的下载,只完成了(1.1M-1.15M)的下载,故,终端继续执行上述第一分配操作,将第二网卡剩余的(1.15M-1.2M)在两个网卡之间再次重新进行分配。假设终端再次给第二网卡分配的新的第二下载range为(1.15M-1.18M),给第一网卡分配的新的第一下载range为(1.18M-2M), 最后终端判断在预设的下载时间到达时,新的第一下载range和新的第二下载range是否均已下载完成,并根据判断结果确定是否再次执行上述第一分配操作,直至第一网卡完成当前新的第一下载range的下载、第二网卡完成当前新的第二下载range的下载以及上述终端初次分配给第二网卡的第二下载range全部下载完成为止。
即,在本发明实施例中,终端可以在第二网卡的网速骤降无法按时完成下载任务时,通过第一网卡为第二网卡分担下载任务,从而避免第二网卡一直以较低的网速下载所分配的下载任务而导致的下载时间过长或者下载失败的情况发生。
本发明实施例提供的数据传输的方法,通过终端在确定待下载数据的下载range,根据待下载数据的下载range为第一网卡分配第一下载range和为第二网卡分配第二下载range,并判断在预设的下载时间到达时,第一网卡完成所述第一下载range的下载且第二网卡未完成所述第二下载range的下载的情况下,终端执行至少一次第一分配操作,直至第一网卡完成新的第一下载range、第二网卡完成新的第二下载range以及第二下载range全部下载完成为止。本发明实施例提供的方法,在第二网卡未按时完成下载任务时,第一网卡可以为第二网卡分担下载任务,从而避免第二网卡一直以较低的网速下载所分配的下载任务而导致的下载时间过长或者下载失败的情况发生,即,本发明实施例提供的方法,减少了待下载数据的下载时长,提高了终端的下载效率,从而可以保证数据的可靠下载。
图2为本发明实施例提供的数据传输的方法实施例二的流程示意图。在上述实施例的基础上,本实施例涉及的是终端根据待下载数据的下载range为第一网卡分配第一下载range和为第二网卡分配第二下载range的具体过程、以及终端判断在预设的下载时间到达时,第一网卡完成第一下载range的下载且第二网卡未完成第二下载range的下载的情况下,终端执行第一分配操作的具体过程。如图2所示,该方法包括:
S201:终端获取待下载数据的下载range。
具体的,S201的执行过程可以参照上述S101的具体描述,在此不再赘述。
S202:终端按照所述第一网卡和所述第二网卡的网速比,将所述待下载 数据的全部下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡。
具体的,终端获知第一网卡当前的网速以及第二网卡当前的网速,并根据第一网卡当前的网速以及第二网卡当前的网速确定第一网卡和第二网卡的网速比;之后,根据该网速比,将上述待下载数据的全部下载range分为第一下载range和第二下载range(即第一下载range和第二下载range的总量等于上述待下载数据的下载range),并将第一下载range分配给第一网卡,将第二下载range分配给第二网卡。
S203:终端判断在预设的下载时间到达时,所述第一网卡完成所述第一下载range的下载且所述第二网卡未完成所述第二下载range的下载,则所述终端执行至少一次第一分配操作,直至所述第一网卡完成新的第一下载range、所述第二网卡完成新的第二下载range以及所述第二下载range全部下载完成为止。
具体的,终端在下载过程中,可能会处于移动的状态,即终端可能在不同制式的网络间切换,因此容易造成网卡的网速不稳定或者造成某一个网卡的网速骤降,本实施例中,假设第一网卡的网速稳定,第二网卡由于终端在不同制式网络间的切换,其网速骤降,因此,终端分配给第二网卡的第二下载range无法在预设的下载时间(例如上述实施例一的例子中的1s)到达时按时完成。
故,当终端判断在预设的下载时间到达时,第一网卡完成第一下载range的下载且第二网卡未完成第二下载range的下载,则终端执行至少一次第一分配操作,为第一网卡分配新的第一下载range以及为第二网卡分配新的第二下载range,直至第一网卡完成新的第一下载range、第二网卡完成新的第二下载range以及第二下载range全部下载完成为止。
具体的,终端执行第一分配操作,为第一网卡分配新的第一下载range以及为第二网卡分配新的第二下载range,具体可以包括四种实现方式:
第一种:终端按照预设的分配规则,从上述第二下载range中为第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
可选的,本实施例中,该预设的分配规则可以为第一网卡当前的网速与 上述预设的下载时间的乘积,还可以为第二网卡当前的网速与上述预设的下载时间的乘积。
可选的,终端从上述第二下载range中为第一网卡分配新的第一下载range和为第二网卡分配新的第二下载range,可以是终端将第二下载range一分为二,即将第二下载range分为新的第一下载range和新的第二下载range两部分,并将这两部分分别分配给第一网卡和第二网卡。这种分配方式下,终端会再次判断在该预设的下载时间到达时,两个网卡是否均已完成下载,并且在其中之一未完成时,仍然继续执行上述第一分配操作,也就是说,终端会不断的将未下载完成的网卡上的下载range重新分配给两个网卡,直至终端分配给第一网卡的第一下载range以及第二网卡的第二下载range均完成下载为止。
可选的,终端从上述第二下载range中为第一网卡分配新的第一下载range和为第二网卡分配新的第二下载range,还可以是终端从第二下载range中取出一部分下载range,将这部分下载range分为新的第一下载range和新的第二下载range两部分,并将这两部分分别分配给第一网卡和第二网卡,终端会再次判断在该预设的下载时间到达时,两个网卡是否均已完成该新的下载range的下载,并且在其中之一未完成时,仍然继续执行上述第一分配操作,直至两个网卡上相应的新的下载range均下载完成为止。之后,终端会继续从第二下载range中除新的第一下载range和新的第二下载range之外的剩余下载range中,再次执行第一分配操作,直至上述终端初次分配给第二网卡上的第二下载range全部下载完成为止。
第二种:终端按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
可选的,终端从上述第二下载range的剩余下载range中为第一网卡分配新的第一下载range和为第二网卡分配新的第二下载range,可以是终端将第二下载range的剩余下载range一分为二,即将第二下载range的剩余下载range分为新的第一下载range和新的第二下载range两部分,并将这两部分分别分配给第一网卡和第二网卡。这种分配方式下,终端会再次判断在该预设的下载时间到达时,两个网卡是否均已完成下载,并且在其中之一未完成 时,仍然继续执行上述第一分配操作,也就是说,终端会不断的将未下载完成的网卡上的下载range重新分配给两个网卡,直至终端分配给第一网卡的第一下载range以及第二网卡的第二下载range均完成下载为止。
可选的,终端从上述第二下载range的剩余下载range中为第一网卡分配新的第一下载range和为第二网卡分配新的第二下载range,还可以是终端从第二下载range的剩余下载range中取出一部分下载range,将这部分下载range分为新的第一下载range和新的第二下载range两部分,并将这两部分分别分配给第一网卡和第二网卡,终端会再次判断在该预设的下载时间到达时,两个网卡是否均已完成该新的下载range的下载,并且在其中之一未完成时,仍然继续执行上述第一分配操作,直至两个网卡上相应的新的下载range均下载完成为止。之后,终端会继续从第二下载range的剩余下载range中除新的第一下载range和新的第二下载range之外的剩余下载range中,再次执行第一分配操作,直至上第二下载range的剩余下载range全部下载完成为止。
第三种:参见图3所示的实施例三,该方法包括:
S301:终端根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间。
具体的,手机根据第二下载range的已下载range确定出第二下载range的剩余下载range,然后根据第二网卡当前的网速,确定第二网卡下载所述第二下载range的剩余下载range所需要的第一时间。
S302:终端在判断所述第一时间大于第一预设时间时,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
可选的,该第一预设时间可以是终端预先设置的用户等待下载时的最大等待时长。对于S302中终端“按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range”,具体可以参见本实施例中第二种实现方式的具体过程,在此不再赘述。
可选的,若终端在判断所述第一时间小于第一预设时间时,则终端确定继续由第二网卡下载第二下载range的当前剩余下载range。
第四种:参见图4所示的实施例四,该方法包括:
S401:终端根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间。
具体的,手机根据第二下载range的已下载range确定出第二下载range的剩余下载range,然后根据第二网卡当前的网速,确定第二网卡下载所述第二下载range的剩余下载range所需要的第一时间。
S402:终端根据所述第一网卡当前的网速、所述第二网卡当前的网速,确定所述第一网卡和所述第二网卡共同下载所述第二下载range所需要的第二时间。
具体的,终端可以通过(第二下载range)/(第一网卡当前的网速+第二网卡当前的网速)确定第一网卡和第二网卡共同下载第二下载range所需要的第二时间。
S403:当所述第一时间大于所述第二时间时,所述终端按照所述预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
具体的,当上述第一时间大于第二时间时,说明第二网卡继续下载自己未下载完的第二下载range的剩余下载range的时间比第一网卡和第二网卡同时下载第二下载range所需要的时间要长,因此,终端选择让第一网卡和第二网卡同时下载第二下载range,即终端按照上述预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range,从而节省了终端下载第二下载range的时间。需要说明的是,对于S403中终端“按照所述预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range”,具体可以参见本实施例中第一种实现方式的具体过程,在此不再赘述。
可选的,当上述第一时间小于第二时间时,说明第二网卡继续下载自己未下载完的第二下载range的剩余下载range的时间比第一网卡和第二网卡同时下载第二下载range所需要的时间要短,因此,终端指示第二网卡继续下载第二下载range的剩余下载range,无需进行重新分配。
综上,无论终端按照上述哪一种方式为第一网卡和第二网卡分别分配新的下载range,由于上述待下载数据的下载range被分为第一下载range和第 二下载range两部分,因此当终端分配给第一网卡的第一下载range以及第二网卡的第二下载range均完成下载时,也就说明终端从网络侧获取的待下载数据全部下载完成。
本发明实施例提供的方法,通过终端动态的为第一网卡和第二网卡分配下载range,使得在第二网卡未按时完成下载任务时,第一网卡可以为第二网卡分担下载任务,从而避免第二网卡一直以较低的网速下载所分配的下载任务而导致的下载时间过长或者下载失败的情况发生,即,本发明实施例提供的方法,减少了待下载数据的下载时长,提高了终端的下载效率,从而可以保证数据的可靠下载。
图5为本发明实施例提供的数据传输的方法实施例五的流程示意图。在上述实施例一的基础上,本实施例涉及的是终端根据待下载数据的下载range为第一网卡分配第一下载range和为第二网卡分配第二下载range的另一具体过程、以及终端判断在预设的下载时间到达时,第一网卡完成第一下载range的下载且第二网卡未完成第二下载range的下载的情况下,终端执行第一分配操作的具体过程。如图5所示,该方法包括:
S501:终端获取待下载数据的下载range。
具体的,S501的执行过程可以参照上述S101的具体描述,在此不再赘述。
S502:终端按照预设的分配规则,将所述待下载数据的部分下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡。
可选的,本实施例中,该预设的分配规则可以为第一网卡当前的网速与上述预设的下载时间的乘积,还可以为第二网卡当前的网速与上述预设的下载时间的乘积。
S503:终端判断在预设的下载时间到达时,所述第一网卡完成所述第一下载range的下载且所述第二网卡未完成所述第二下载range的下载,则所述终端执行至少一次第一分配操作,直至所述第一网卡完成新的第一下载range、所述第二网卡完成新的第二下载range以及所述第二下载range全部下载完成为止。
具体的,S503的具体过程可以参照上述实施例二中的S203的具体描述 过程,在此不再赘述。
S504:终端执行至少一次第二分配操作,直至所述待下载数据全部下载完成为止;所述第二分配操作包括:所述终端从所述待下载数据的当前剩余下载range中为所述第一网卡和所述第二网卡分别分配下一次的数据下载range。
具体的,当终端判断第一网卡完成新的第一下载range、第二网卡完成新的第二下载range以及上述第二下载range全部下载完成之后,说明之前从待下载数据的部分下载range中分配给第一网卡的第一下载range和第二网卡的第二下载range均已下载完成,则终端会执行第二分配操作,即终端会进一步从待下载数据除上述第一下载range和第二下载range之外的当前剩余下载range中,再次为第一网卡和第二网卡分配下一次的数据下载range,并结合上述S503的方案执行下载过程,直至上述待下载数据的下载range全部下载完成为止。即,当终端从待下载数据的当前剩余下载range中再次为第一网卡和第二网卡分配下一次的数据下载range后,终端会继续判断在预设的下载时间到达时,两个网卡上相应的下载range是否全部下载完成,并且在其中之一未完成时,仍然执行上述第一分配操作,也就是说,终端会不断的将未下载完成的网卡上的下载range重新分配给两个网卡,直至两个网卡上相应的下载range均下载完成为止。
需要说明的是,当终端执行两次以上第二分配操作时,即在第一网卡下载完自身当前的下载range、第二网卡下载完自身当前的下载range但待下载数据还没有全部下载完成时,终端会再次执行上述第二分配操作,所以在终端每次执行第二分配操作时,基于的均是前一次分配后的待下载数据中当前剩余的下载range。
本发明实施例提供的方法,通过终端动态的为第一网卡和第二网卡分配下载range,使得在第二网卡未按时完成下载任务时,第一网卡可以为第二网卡分担下载任务,从而避免第二网卡一直以较低的网速下载所分配的下载任务而导致的下载时间过长或者下载失败的情况发生,即,本发明实施例提供的方法,减少了待下载数据的下载时长,提高了终端的下载效率,从而可以保证数据的可靠下载。
在上述实施例三的基础上,本实施例涉及的是终端根据所述第二下载 range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range的另一具体过程。进一步地,上述第一分配操作具体包括:终端从所述待下载数据的当前剩余下载range中为完成所述第一下载range的所述第一网卡分配下一次的下载range,并进一步判断所述第二网卡在预设时刻到达时是否完成所述第二下载range的下载;若否,则所述终端在所述第一网卡下载完当前的下载range后,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
具体的,由于第二网卡的网速骤降,终端判断在上述预设的下载时间到达时,第一网卡完成第一下载range的下载且第二网卡未完成第二下载range的下载时,则终端会从上述待下载数据的当前剩余下载range中(该待下载数据的剩余下载range是除第一下载range和第二下载range之外的剩余部分)为当前完成第一下载range的第一网卡分配下一次的下载range;与此同时,终端指示第二网卡继续下载上述未完成的第二下载range的剩余下载range,并判断在上述预设时刻到达时第二网卡是否完成上述第二下载range的下载。可选的,终端可以通过预设的定时器的定时周期来设置上述预设时刻。
当终端判断第二网卡在预设时刻到达时依然未完成上述第二下载range的下载,则终端终止第二网卡的下载,并根据预设的分配规则给第二网卡分配新的第二下载range,并且,在第一网卡下载完当前的下载range后(第一网卡当前的下载range是上述终端从待下载数据的剩余下载range中分配给第一网卡的),终端从上述第二下载range的当前剩余下载range中(即上述第二下载range的剩余下载range中除已分配给第二网卡的新的第二下载range之外的部分)为第一网卡分配新的第一下载range。以此类推,直至第二下载range的剩余下载range下载完成为止。
为了更好的说明该过程,本实施例以一个简单的例子来进行介绍:
假设第一网卡和第二网卡的初始网速都是1M/s,则终端从所确定的待下载数据的下载range中给第一网卡和第二网卡分别分配1秒的下载range,即终端给第一网卡分配的第一下载range为(0M-1M),终端给第二网卡分配的第二下载range为(1M-2M)。并且,终端规定预设时刻为2.5s。
假设第二网卡在下载过程中网速骤降(例如降到0.1M/s),则在1秒时, 第二网卡未完成第二下载range的下载,第一网卡完成了第一下载range的下载。因此,终端此时继续给第一网卡分配下一秒的下载range(2-3M),第二网卡则继续下载上述未完成的第二下载range。
假设在第2秒结束后,第一网卡再次完成了当前的下载range,第二网卡仍未完成上述第二下载range的下载,则终端继续给第一网卡分配下一次的下载range,即分配下一秒的下载range(3M-4M),第二网卡继续下载上述未完成的第二下载range。
当时间到达2.5秒时,终端判断第二网卡的时间到了,则结束第二网卡的下载,并把第二网卡的已下载range(1M-1.25M)保存在终端的已下载range内,并根据第二网卡当前的网速和上述预设的下载时间(依然假设为1s)为第二网卡分配新的第二下载range(1.25M-1.35M);并且,在第3秒结束后,第一网卡完成了当前的下载range(即完成了3M-4M的下载),终端确定上述第二下载range中剩余下载range还有剩余部分(1.35M-2M),则将该剩余部分配给第一网卡,直至第二网卡完成新的第二下载range的下载,第一网卡完成新的第一下载range的下载为止。
可选的,若上述第一网卡和第二网卡在下载过程中速度都骤降,则终端可以暂停第二网卡的下载,通过两个网卡同时下载第一网卡当前的下载任务,在第一网卡的下载任务完成之后,再通过两个网卡同时下载第二网卡当前的下载任务,该种方法也可以节省终端下载待下载数据的时间。
本发明实施例提供的方法,通过终端动态的为第一网卡和第二网卡分配下载range,使得在第二网卡未按时完成下载任务时,第一网卡可以为第二网卡分担下载任务,从而避免第二网卡一直以较低的网速下载所分配的下载任务而导致的下载时间过长或者下载失败的情况发生,即,本发明实施例提供的方法,减少了待下载数据的下载时长,提高了终端的下载效率,从而可以保证数据的可靠下载。
图6为本发明实施例提供的数据传输的方法实施例六的流程示意图。本实施例涉及的是终端在为第一网卡和第二网卡分配下载range之前,确定待下载数据的实时性的具体过程。如图4所示,在上述S101或S201或S501之前(图4仅示出了在S101之前的示意图),该方法还包括:
S601:终端确定所述待下载数据的实时性。
可选的,本实施例中的实时性可以理解为用户对待下载数据的显示速度的快慢要求,或者可以理解为用户对获取到待下载数据的时间长短上的要求。例如,用户需要获取一段视频,且用户希望看到流畅的视频,那么在网络实时下载实时观看时,对视频的实时性要求就比较高,即视频就为实时性高的待下载数据。
具体的,终端确定待下载数据的实时性可以为下述两种实现方式,具体为:
第一种:参见图7所示的实施例七,终端确定待下载数据的实时性的方法可以包括:
S701:终端确定发起下载待下载数据连接请求的第一APP。
S702:终端判断所述第一APP是否与预设的APP集合中的APP匹配;若是,则所述终端确定所述待下载数据的实时性高于预设的第一阈值;否则,所述终端确定所述待下载数据的实时性低于预设的第一阈值。
可选的,终端可以通过处理器或者处理器中的检测软件确定发起下载所述待下载数据的连接请求是通过哪一个APP发送的,并将其确定为第一APP,然后通过判断该第一APP是否与预设的APP集合中的APP匹配。该预设的APP集合中的APP对应的程序可以是终端通过相应的加载程序加载至终端中,其可以预存在终端的内存中或者网络侧的服务器上;还可以为终端在出厂时,通过产线上的夹具预置给终端,还可以为用户根据使用经验保存在终端中的。该预设的APP集合中的APP可以为优酷、搜狐视频等视频类APP。
当终端确定第一APP与上述预设的APP集合中的APP匹配时,则终端确定该第一APP所请求的待下载数据的实时性高于第一预设阈值,即该待下载数据可以为对实时性要求较高的文件;当终端确定第一APP与上述预设的APP集合中的APP不匹配时,则终端确定该第一APP所请求的待下载数据的实时性低于预设的第一阈值,即该待下载数据可以为对实时性要求较低的文件。需要说明的是,这里所说的“匹配”可以理解为第一APP是否与预设的APP集合中的APP的属性相同或者相似,例如:假设上述预设的APP集合中包括优酷、搜狐、芒果TV、土豆四个APP,但终端确定的第一APP为“百度视频”,则终端也可以认为第一APP与预设的APP集合中的APP匹配。可选的,终端可以通过判断预设APP集合中的APP的历史下载数据类型 和第一APP当前所要下载的待下载数据的数据类型是否类似,进而确定出第一APP是否与预设APP集合中的APP匹配。
第二种:参见图8所示的实施例八,终端确定待下载数据的实时性的方法可以包括:
S801:终端确定发给服务器的HTTP GET Request中携带的待下载数据的类型。
具体的,终端可以根据用户点击的网址链接,向网络侧的服务器发HTTP GET Request,请求与服务器建立连接,并且终端可以根据HTTP GET Request确定待下载数据的类型。
S802:终端判断所述待下载数据的类型是否与预设的数据类型库中的类型匹配;若是,则所述终端确定所述待下载数据的实时性高于预设的第一阈值;否则,所述终端确定所述待下载数据的实时性低于预设的第一阈值。
具体的,终端可以根据上述所确定的待下载数据的类型判断其是否与预设的数据类型库中的类型匹配;该预设的数据类型库中的数据类型可以是终端通过相应的加载程序加载至终端中的,其可以预存在终端的内存中或者网络侧的服务器上;还可以为终端在出厂时,通过产线上的夹具预置给终端的,还可以为用户根据使用经验保存在终端中的。该预设的数据类型库中的数据类型可以为.mp4、.flv、.rm、.rmvb、.avi、.wmv.等类型
当终端确定待下载数据的类型与上述预设的数据类型库中的数据类型匹配时,则终端确定该待下载数据的实时性高于预设的第一阈值,即该待下载数据可以为对实时性要求较高的文件;当终端确定待下载数据的类型与上述预设的数据类型库中的数据类型不匹配时,则终端确定该待下载数据的实时性低于预设的第一阈值,即该待下载数据可以为对实时性要求较低的文件。需要说明的是,这里所说的“匹配”可以理解为待下载数据的类型是否与预设的数据类型库中的数据类型相同或者相似,例如假设上述预设的数据类型库中包括.mp4、.flv、.rm、.rmvb四种类型,但终端确定的待下载数据的类型为“.wmv”,则终端也可以认为待下载数据的类型与预设的数据类型库中的数据类型匹配。
可选的,在本发明实施例中,当终端确定所述待下载数据的实时性高于预设的第一阈值时,终端在第一网卡完成第一下载range的下载且第二网卡 未完成第二网卡的第二下载range时,终端均可以参照上述实施例一至实施例三中所有的分配方式,优选的,终端可以选择实施例二、实施例三中的第一种实现方式和第二种实现方式的方案以及上述实施例三的可能的实施方式。当终端确定所述待下载数据的实时性低于预设的第一阈值时,终端在第一网卡完成第一下载range的下载且第二网卡未完成第二网卡的第二下载range时,终端也均可以参照上述实施例一至实施例三中所有的分配方式,优选的,终端可以选择实施例二、实施例三中的第三种实现方式和第四种实现方式的方案。
本发明实施例提供的数据传输的方法,针对不同实时性的待下载数据,终端可以选择不同的下载range分配方式,从而使得终端为第一网卡和第二网卡分配的下载range是适量适时的,进而避免下载数据延迟,更能保证待下载数据的实时下载。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
图9为本发明实施例提供的终端实施例一的结构示意图。如图9所示,该终端包括:获取模块10、第一分配模块11和第二分配模块12。
其中,获取模块10,用于终端获取待下载数据的下载范围range;第一分配模块11,用于根据所述待下载数据的下载range为所述第一网卡分配第一下载range和为所述第二网卡分配第二下载range;第二分配模块12,用于判断在预设的下载时间到达时,所述第一网卡完成所述第一下载range的下载且所述第二网卡未完成所述第二下载range的下载,则执行至少一次第一分配操作,直至所述第一网卡完成新的第一下载range、所述第二网卡完成新的第二下载range以及所述第二下载range全部下载完成为止;所述第一分配操作包括:根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
本发明实施例提供的终端,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
作为本发明实施例的一种可能的实施方式,所述第一分配模块11,具体用于按照所述第一网卡和所述第二网卡的网速比,将所述待下载数据的全部下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡。
作为本发明实施例的另一种可能的实施方式,所述第一分配模块11,具体用于按照预设的分配规则,将所述待下载数据的部分下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡;则所述第二分配模块12,还用于执行至少一次第二分配操作,直至所述待下载数据全部下载完成为止;所述第二分配操作包括:从所述待下载数据的当前剩余下载range中为所述第一网卡和所述第二网卡分别分配下一次的数据下载range。
本发明实施例提供的终端,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
作为本发明实施例的第三种可能的实施方式,所述第二分配模块12,具体用于按照预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range;或者,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
作为本发明实施例的第四种可能的实施方式,所述第二分配模块12,具体用于从所述待下载数据的当前剩余下载range中为完成所述第一下载range的所述第一网卡分配下一次的下载range,并进一步判断所述第二网卡在预设时刻到达时是否完成所述第二下载range的下载;若否,则端在所述第一网卡下载完当前的下载range后,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
作为本发明实施例的第五种可能的实施方式,所述第二分配模块12,具体用于根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间,并在判断所述第一时间大于第一预设时间时,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述 新的第二下载range。
作为本发明实施例的第六种可能的实施方式,所述第二分配模块12,具体用于根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间,并根据所述第一网卡当前的网速、所述第二网卡当前的网速,确定所述第一网卡和所述第二网卡共同下载所述第二下载range所需要的第二时间,并在判断当所述第一时间大于所述第二时间时,按照所述预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
本发明实施例提供的终端,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
图10为本发明实施例提供的终端实施例二的结构示意图。在上述实施例的基础上,如图10所示,该终端还可以包括:确定模块13。该确定模块13,用于确定所述待下载数据的实时性。
可选的,所述确定模块13,具体可以用于确定发起下载所述待下载数据的连接请求的第一应用软件APP,并判断所述第一APP是否与预设的APP集合中的APP匹配;若是,则确定所述待下载数据的实时性高于预设的第一阈值;否则,则确定所述待下载数据的实时性低于预设的第一阈值。
可选的,所述确定模块13,具体可以用于确定发给服务器的超文本传输协议获取请求中携带的待下载数据的类型,并判断所述待下载数据的类型是否与预设的数据类型库中的类型匹配;若是,则确定所述待下载数据的实时性高于预设的第一阈值;否则,则确定所述待下载数据的实时性低于预设的第一阈值。
进一步地,上述预设的分配规则为所述第一网卡或第二网卡的当前网速和所述预设的下载时间的乘积。
本发明实施例提供的终端,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
图11为本发明实施例提供的终端实施例三的结构示意图。如图11所示,该终端包括:处理器20,例如CPU;存储器21和至少一个通信总线22。通信总线22用于实现元件之间的通信连接。存储器21可能包含高速RAM 存储器,也可能还包括非易失性存储器NVM,例如至少一个磁盘存储器,存储器21中可以存储各种程序,用于完成各种处理功能以及实现本实施例的方法步骤。
其中,处理器20,用于获取待下载数据的下载range,并根据所述待下载数据的下载range为所述第一网卡分配第一下载range和为所述第二网卡分配第二下载range;并在判断在预设的下载时间到达时,所述第一网卡完成所述第一下载range的下载且所述第二网卡未完成所述第二下载range的下载的情况下,执行至少一次第一分配操作,直至所述第一网卡完成新的第一下载range、所述第二网卡完成新的第二下载range以及所述第二下载range全部下载完成为止;所述第一分配操作包括:根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
本发明实施例提供的终端,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
可选的,所述处理器20,具体用于按照所述第一网卡和所述第二网卡的网速比,将所述待下载数据的全部下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡。
可选的,所述处理器20,具体用于按照预设的分配规则,将所述待下载数据的部分下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡;还用于在执行至少一次第一分配操作,直至所述第一网卡完成新的第一下载range、所述第二网卡完成新的第二下载range以及所述第二下载range全部下载完成为止之后,执行至少一次第二分配操作,直至所述待下载数据全部下载完成为止;所述第二分配操作包括:所述终端从所述待下载数据的当前剩余下载range中为所述第一网卡和所述第二网卡分别分配下一次的数据下载range。
可选的,所述处理器20,具体用于按照预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range;或者,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
可选的,所述处理器20,具体用于从所述待下载数据的当前剩余下载range中为完成所述第一下载range的所述第一网卡分配下一次的下载range,并进一步判断所述第二网卡在预设时刻到达时是否完成所述第二下载range的下载;若否,则在所述第一网卡下载完当前的下载range后,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
可选的,所述处理器20,具体用于根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间,并在判断所述第一时间大于第一预设时间时,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
可选的,所述处理器20,具体用于根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间;并根据所述第一网卡当前的网速、所述第二网卡当前的网速,确定所述第一网卡和所述第二网卡共同下载所述第二下载range所需要的第二时间;并在所述第一时间大于所述第二时间时,按照所述预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
上述预设的分配规则为所述第一网卡或第二网卡的当前网速和所述预设的下载时间的乘积。
本发明实施例提供的终端,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
进一步地,在上述实施例的基础上,上述处理器20,还用于确定所述待下载数据的实时性。
可选的,所述处理器20,具体用于确定发起下载所述待下载数据的连接请求的第一应用软件APP,并判断所述第一APP是否与预设的APP集合中的APP匹配;若是,则确定所述待下载数据的实时性高于预设的第一阈值;否则,则确定所述待下载数据的实时性低于预设的第一阈值。
可选的,所述处理器20,具体用于确定发给服务器的超文本传输协议获取请求中携带的待下载数据的类型,并判断所述待下载数据的类型是否与预 设的数据类型库中的类型匹配;若是,则确定所述待下载数据的实时性高于预设的第一阈值;否则,则确定所述待下载数据的实时性低于预设的第一阈值。
本发明实施例提供的终端,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
图12为本发明实施例提供的数据传输的方法实施例九的流程示意图,该方法是用于包括第一网卡和第二网卡的终端。具体地,参照图12,该方法包括:
S1201、终端获取待下载数据的下载范围。
具体的,终端上的APP可以向终端发起下载或者获取网络数据的请求,或者,用户可以通过点击网页上的链接使得终端获知用户获取网络数据的请求,从而使得终端可以通过向网络侧的服务器发送HTTP GET Request获取整个待下载文件的范围,并确定待下载文件中待下载数据的下载范围。待下载数据的下载range可以包括待下载数据的大小,或者,待下载数据的字节起始位置和下载数据的字节终止位置,或者,待下载数据的字节起始位置和待下载数据的大小。
S1202、终端根据待下载数据的下载范围为第一网卡分配第一下载范围和为第二网卡分配第二下载范围。
S1203、若第一网卡完成上述第一下载范围的下载时第二网卡未完成第二下载范围的下载,且第二下载范围的剩余下载范围大于第一预设阈值,则该终端执行至少一次第一分配操作,直至上述第二下载范围全部下载完成为止。
其中,上述第一分配操作包括:根据上述第二下载范围的剩余下载范围为第一网卡分配新的第一下载范围和为第二网卡分配新的第二下载范围。
需要说明的是,终端在下载过程中,可能会处于移动的状态,即终端可能在不同制式的网络间切换,因此容易造成网卡的网速不稳定或者造成某一个网卡的网速骤降,本实施例中,假设第一网卡的网速稳定,第二网卡由于终端在不同制式网络间的切换,其网速骤降,因此,第一网卡完成上述第一下载范围的下载时第二网卡未完成第二下载范围的下载。
上述第一网卡和第二网卡均为泛指概念,在第二网卡完成第二下载范围的下载、第一网卡未完成第一下载范围的下载时,若第一下载范围的剩余下 载范围大于第一预设阈值,第二网卡也可以通用分担第一网卡的下载任务。即分配新的第一下载范围、新的第二下载范围后进行下载的过程中,只要一个网卡完成下载另一个未完成,且满足预设阈值的要求,就可以帮助未完成下载的网卡分担下载任务。
另外,本发明实施例中为网卡分配下载范围可以理解成为该网卡对应的数据传输通道分配下载范围。例如,终端内的两个网卡包括:中国移动的4G卡和中国联通的3G卡,则为中国移动的4G卡分配下载范围,可以理解为中国移动的4G卡对应的数据传输通道分配下载范围。在具体实现过程中可以为网卡对应的数据传输通道起不同的名字,例如下载引擎,但并不以此为限。
本实施例中,终端根据待下载数据的下载范围为第一网卡分配第一下载范围和为第二网卡分配第二下载范围,在第一终端完成第一下载范围而第二网卡未完成第二下载范围时,终端可以执行第一分配操作将第二下载范围剩余下载范围分配部分给第一网卡来分担第二网卡的下载任务,从而避免第二网卡一直以较低的网速下载所分配的下载任务而导致的下载时间过长或者下载失败的情况发生,即减少了待下载数据的下载时长,提高了终端的下载效率,从而可以保证数据的可靠下载。
进一步地,上述终端执行上述第一次分配操作之前,还可以包括:终端判断上述待下载数据的下载范围除上述第一下载范围和第二下载范围之外,是否还存在未下载范围,若是,则取第一值作为上述第一预设阈值,若否,则取第二值作为上述第一预设阈值。其中,第一值大于第二值。
即将待下载数据的下载范围中的第一下载范围和第二下载范围分配给第一网卡、第二网卡进行下载,在第一网卡完成上述第一下载范围的下载且第二网卡未完成第二下载范围的下载时,可以先判断待下载数据的下载范围中是否还存在未分配给第一网卡或第二网卡下载的部分,如果有,则上述第一预设阈值较大,如果没有,则上述第一预设阈值可以取较小的值。例如实现时可以取第一值为4兆(M),第二值为1M。
图13为本发明实施例提供的数据传输的方法实施例十的流程示意图,如图13所示,该方法包括:
S1301、终端将待下载文件划分为第一测速下载范围、第二测速下载范围和待下载数据的下载范围。
待下载文件可以指终端将要下载的整个下载对象,例如是一个100M的数据包。从整个待下载文件中先分出两个测速包,即第一测速下载范围和第二测速下载范围,剩下的部分作为前述待下载数据的下载范围。
S1302、终端将第一测速下载范围分配给第一网卡进行下载,并将第二测速下载范围分配给第二网卡进行下载。
第一测速下载范围、第二测速下载范围可以根据第一网卡、第二网卡当前的网络制式进行划分,但并不以此为限。假设第一网卡当前是4G网络,第二网卡是3G网络,那么分给第一网卡的第一测速下载范围大于分给第二网卡的第二测速下载范围。将上述100M中的10M(0-10M)划分为第一测速下载范围,再将1M(10M-11M)划分为第二测速下载范围。
具体实现过程中,终端可以以表1为标准划分第一测速下载范围和第二测速下载范围,但并不以此为限。
表1
Figure PCTCN2015082681-appb-000001
表1中,WCDMA 3G为宽带码分多址(Wideband Code Division Multiple Access,简称WCDMA)第三代移动通信系统(3rd Generation,简称3G)网络;EVDO 3G全称为:CDMA20001xEV-DO(Evolution、Data、Only);TDSCDMA 3G为时分同步码分多址(Time Division-Synchronous Code Division Multiple Access,简称TDSCDMA)3G;4G为第四代移动通信系统(4th Generation)。
S1303、终端根据第一网卡对第一测速下载范围的下载获取第一网卡的当前网速,并根据上述第二网卡对第二测速下载范围的下载获取第二网卡的当前网速。
S1304、终端获取待下载数据的下载范围。
S1305、终端根据待下载数据的下载范围为第一网卡分配第一下载范围和为第二网卡分配第二下载范围。
S1306、若第一网卡完成上述第一下载范围的下载时第二网卡未完成第二下载范围的下载,且第二下载范围的剩余下载范围大于第一预设阈值,则该终端执行至少一次第一分配操作,直至上述第二下载范围全部下载完成为止。
另一实施例中,在上述第一测速下载范围、第二测速下载范围的过程中,第一网卡和第二网卡也可以彼此进行分担。具体地,终端将第一测速下载范围分配给第一网卡进行下载,并将第二测速下载范围分配给第二网卡进行下载之后,若第一网卡完成第一测速下载范围时第二网卡未完成第二测速下载范围,且第二网卡未完成的第二测速下载范围剩余下载范围大于第二预设阈值,则终端执行至少一次第二分配操作,直至上述第二测速下载范围全部下载完成为止。具体实现过程中,该第二预设阈值可以等于前述第一预设阈值,但并不以此为限。
其中,第二分配操作包括:根据上述第二测速下载范围的剩余下载范围为上述第一网卡分配新的第一测速下载范围和为第二网卡分配新的第二测速下载范围。即分配新的第一测速下载范围、新的第二测速下载范围后进行下载的过程中,只要一个网卡完成下载另一个未完成,且满足预设阈值的要求,就可以帮助未完成下载的网卡分担下载任务。
具体地,终端根据上述第二测速下载范围的剩余下载范围为上述第一网卡分配新的第一测速下载范围和为第二网卡分配新的第二测速下载范围,具体可以为:终端根据第一网卡的第二网卡的当前网速比,将第二测速下载范围的剩余下载范围分为第一子测速下载范围和第二子测速下载范围,将第一子测速下载范围作为新的第一测速下载范围,并将第二网卡已下载的第二测速下载范围和第二子测速下载范围的和作为新的第二测速下载范围。或者,将所述新的第二测速下载范围作为新的第二测速下载范围。
需要说明的是,将第二测速下载范围的剩余下载范围分为第一子测速下载范围和第二子测速下载范围之前,还可以预留缓冲范围留给第二网卡下载,将除缓冲范围之外的第二测速下载范围的剩余下载范围进行划分。其中,可以将第一子测速下载范围作为新的第一测速下载范围,将第二网卡已 下载的第二测速下载范围、缓存范围以及第二子测速下载范围的和作为新的第二测速下载范围,或者,将缓存范围以及第二子测速下载范围的和作为新的第二测速下载范围。
例如,假设第一网卡当前是4G网络,第二网卡是3G网络,那么分给第一网卡的第一测速下载范围为10M(0M-10M),分给第二网卡的第二测速下载范围为1M(10-11M)。当第一网卡下载完第一测速下载范围后,第二网卡的第二测速下载范围的实际下载范围为0.5M(10-10.5M),剩余0.5M。假设第二预设阈值为0.4M,当前第二网卡的剩余量0.5M大于第二预设阈值0.4M,则将第二网卡的剩余量0.5M按照当前网速比进行划分。假设当前第一网卡与第二网卡的网速比为20:1,缓冲范围为0.1M。则分配给第一网卡的下载量为(0.5-0.1)*19/20=0.38M,分配给第二网卡的下载量为(0.5-0.1)*1/20+0.1=0.12M。则新的第一子测速下载范围为0.38M(10.62-11M);新的第二子测速下载范围为0.12(10.5-10.62),或者新的第二子测速下载范围为0.62(10-10.62)。
对于第二子测速下载范围为0.12的情况,为终端为第二网卡分配新的第二子测速下载范围的情况;对于第二子测速下载范围为0.62的情况,为终端为第二网卡修改原第二测速范围,从而得到新的子第二测速下载范围的情况。本发明实施例对于以上2种情况均支持。
本实施例中,将上述待下载文件分为普通文件和大文件,具体地,将大于第三预设阈值的文件作为大文件,小于或等于第三预设阈值的文件作为普通文件。
对于普通文件,即若待下载文件小于或等于第三预设阈值,上述终端根据待下载数据的下载范围为第一网卡分配第一下载范围和为第二网卡分配第二下载范围,可以有两种实施方式:
(1)终端按照上述第一网卡和第二网卡的当前网速比,将待下载文件分为第一部分和第二部分,根据第一部分减去第一测速下载范围后的值在待下载数据的下载范围内划分上述第一下载范围,并根据上述第二部分减去第二测速下载范围大小后的值在上述待下载数据的下载范围内划分第二下载范围。
例如,第一网卡当前网速为9M/s,第二网卡当前网速为1M/s,待下载文 件为30M,按照网速比分为两部分后,第一部分为27M,第二部分为3M,假设第一测速下载范围的大小为5M(0-5M)、第二测速下载范围的大小为1M(5-6M),于是第一下载范围的大小为27-5=22M,第二下载范围的大小为3-1=2M,按照这个数值在待下载数据的下载范围(6-30M)内划分第6-28M为第一下载范围,并划分28-30M为第二下载范围。
(2)终端按照上述第一网卡和第二网卡的当前网速比,将上述待下载数据的下载范围分为上述第一下载范围和第二下载范围。
例如,假设第一网卡当前网速为9M/s,第二网卡当前网速为1M/s,待下载文件为30M,假设第一测速下载范围的大小为5M(0-5M)、第二测速下载范围的大小为1M(5-6M)。于是按照网速比分为两部分后,第一下载范围的大小为(30-5-1)*9/10=21.6M,第二下载范围的大小为(30-5-1)*1/10=2.4M,按照这个数值在待下载数据的下载范围(6-30M)内划分第6-27.6M为第一下载范围,并划分27.6-30M为第二下载范围。
图14为本发明实施例提供的数据传输的方法实施例十一的流程示意图,对于大文件,即待下载文件大于第三预设阈值,如图14所示,上述终端根据待下载数据的下载范围为第一网卡分配第一下载范围和为第二网卡分配第二下载范围包括:
S1401、终端从上述待下载数据的下载范围中切分出第一待下载部分,其中,该第一待下载部分的大小等于第四预设阈值。
该第四预设阈值可以根据终端的下载分区来确定,一般地,第四预设阈值等于终端的下载分区的大小,但并不以此为限,也可以小于终端的下载分区的大小。
例如,待下载文件为100M,第四预设阈值等于下载分区的大小为20M,第一测速下载范围的大小为5M、第二测速下载范围的大小为1M,则在终端下载过程中,会有4个20M和1个14M的待下载部分。
S1402、终端按照第一网卡和第二网卡的当前网速比,将第一待下载部分分为第一子下载范围和第二子下载范围,并将上述待下载数据的下载范围中除去该第一待下载部分的剩余部分作为新的待下载数据的下载范围。
其中,第一子下载范围属于上述第一下载范围,第二子下载范围属于上述第二下载范围,即该第一子下载范围分配给第一网卡进行下载,第二子下 载范围分配给第二网卡进行下载。
S1403、终端判断新的待下载数据的下载范围的大小是否小于或等于上述第四预设阈值,若是,则执行S1404,若否,则返回执行S1401。
S1404、终端按照第一网卡和第二网卡的当前网速比,将上述新的待下载数据的下载范围分为新的第一子下载范围和新的第二子下载范围。其中,新的第一子下载范围属于上述第一下载范围,新的第二子下载范围属于上述第二下载范围,即将新的第一子下载范围分配给第一网卡进行下载,将新的第二子下载范围分配给第二网卡进行下载。
进一步地,对于上述大文件,要不断地从待下载数据的下载范围中切分出第一待下载部分,在这一过程中,终端第一次切分出第一待下载部分后,将划分的第一子下载范围、第二子下载范围分配给第一网卡、第二网卡进行下载,若第一网卡完成第一子下载范围的下载,第二网卡未完成第二子下载范围的下载,并且第二网卡未完成的下载量小于或等于第五预设阈值,则终端从新的待下载数据的下载范围中切分出第二待下载部分,即从待下载数据的下载范围中切分出第一待下载部分后的剩余部分中再切分出第二待下载部分,该第二待下载部分的大小也等于第四预设阈值。进而,终端也按照第一网卡和第二网卡的当前网速比,将第二待下载部分分为第三子下载范围和第四子下载范围,若第一网卡完成第一子下载范围且完成第三子下载范围时,第二网卡未完成第二子下载范围,则终端将上述第四下载范围分配给第一网卡进行下载。即在循环分配的过程中,第一网卡和第二网卡可以互相分担下载任务。其中,上述第三子下载范围属于上述第一下载范围,第四子下载范围属于第二下载范围,即将第三下载范围分配给第一网卡下载,而将第四下载范围分配给第二网卡下载,第一网卡在下载完第一子下载范围后直接下载第三子下载范围,如果第一网卡将第三子下载范围也下载完之后,第二网卡还未将第二子下载范围下载完,则直接将第四子下载范围分给第一网卡下载。上述第五预设阈值也可以等于前述第一预设阈值,但并不以此为限。
在上述实施例的基础上,若所述第一网卡完成所述第一下载范围的下载时所述第二网卡未完成所述第二下载范围的下载,且第二下载范围的剩余下载范围大于第一预设阈值,则终端执行至少一次上述第一分配操作,具体地, 对于第一次分配操作,上述终端根据第二下载范围的剩余下载范围为第一网卡分配新的第一下载范围和为第二网卡分配新的第二下载范围,具体可以是:终端将第二下载范围的剩余下载范围划分为缓冲范围和待分配范围,然后根据待分配范围为第一网卡分配新的第一下载范围和为第二网卡分配新的第二下载范围。例如,假设原第二下载范围为5-30M,已下载5-10M,第二下载范围的剩余下载范围为10-30M,将10-12M这2M作为缓冲范围留给第二网卡下载,然后,然后将12-30M作为待分配范围分给第一网卡和第二网卡。
更具体地,上述终端根据待分配范围为第一网卡分配新的第一下载范围和为第二网卡分配新的第二下载范围,可以包括:终端按照第一网卡和第二网卡的当前网速比,将上述待分配范围分为第一子待分配范围和第二子待分配范围,并将第一子待分配范围作为新的第一下载范围,将第二下载范围中第二网卡已下载范围、上述缓冲范围以及第二子待分配范围作为新的第二下载范围。例如,第一网卡和第二网卡网速比为8:1,待分配范围12-30M中,(30-12)*8/9=16M分配给第一网卡作为新的第一下载范围,即新的第一下载范围为14-30M;而新的第二下载范围包括:已下载的5-10M、缓冲范围10-12M以及第二子待分配范围的大小(30-12)*1/9=2M,即新的第一下载范围为5-14M。
但并不以此为限,另一个实施方式中,第二下载范围包括:缓冲范围10-12M以及第二子待分配范围的大小(30-12)*1/9=2M,即新的第一下载范围为10-14M。对于第二下载范围为5-14M的情况,为终端为第二网卡修改原第二下载范围的情况;对于第二下载范围为10-14M的情况,为终端为第二网卡分配新的第二下载范围的情况。本发明实施例对于以上2种情况均支持。
另一实施例中,S1203中若第一网卡完成上述第一下载范围的下载时第二网卡未完成第二下载范围的下载,且第二下载范围的剩余下载范围大于第一预设阈值,则该终端执行至少一次第一分配操作,具体为:上述若上述第一网卡完成第一下载范围的下载时,第二网卡未完成第二下载范围的下载,且上述待下载数据的下载范围除第一下载范围和第二下载范围之外不存在未下载范围、第二下载范围的剩余下载范围大于上述第一预设阈值,则终端判断第一网卡当前下载速度大于第二网卡当前下载速度的部分是否满足预设条件,若是,则终端执行至少一次第一分配操作。即在除第一下载范围和第二 下载范围之外不存在其他未下载数据时,还可以进一步判断第一网卡是否具备帮第二网卡分担的条件,即判断第一网卡当前下载速度大于第二网卡当前下载速度的部分是否满足预设条件,在满足条件时才帮助第二网卡下载,否则第二网卡自行下载完成。可选地,预设条件可以为第一网卡当前下载速度大于第二网卡当前下载速度的11.1%。
图15为本发明实施例提供的终端实施例四的结构示意图,如图15所示,该终端包括:获取模块1501、第一分配模块1502和第二分配模块1503,其中:
获取模块1501,用于获取待下载数据的下载范围。
第一分配模块1502,用于根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围。
第二分配模块1503,用于在所述第一网卡完成所述第一下载范围的下载时所述第二网卡未完成所述第二下载范围的下载,且第二下载范围的剩余下载范围大于第一预设阈值时,执行至少一次第一分配操作,直至所述第二下载范围全部下载完成为止。
其中,第一分配操作包括:根据所述第二下载范围的剩余下载范围为所述第一网卡分配新的第一下载范围和为所述第二网卡分配新的第二下载范围。
本实施例中,终端根据待下载数据的下载范围为第一网卡分配第一下载范围和为第二网卡分配第二下载范围,在第一终端完成第一下载范围而第二网卡未完成第二下载范围时,终端可以执行第一分配操作将第二下载范围剩余下载范围分配部分给第一网卡来分担第二网卡的下载任务,从而避免第二网卡一直以较低的网速下载所分配的下载任务而导致的下载时间过长或者下载失败的情况发生,即减少了待下载数据的下载时长,提高了终端的下载效率,从而可以保证数据的可靠下载。
图16为本发明实施例提供的终端实施例五的结构示意图,如图16所示,在图15的基础上,该终端还可以包括:确定模块1504,用于在第二分配模块1503执行至少一次第一分配操作之前,判断所述待下载数据的下载范围除所述第一下载范围和所述第二下载范围之外,是否还存在未下载范围,若是,则取第一值作为所述第一预设阈值,若否,则取第二值作为所述 第一预设阈值。其中,第一值大于第二值。
图17为本发明实施例提供的终端实施例六的结构示意图,如图17所示,在图15的基础上,该终端还可以包括:分割模块1701和测速模块1702。当然也可以包括图16中的确定模块1504。
分割模块1701,用于在所述获取模块1501获取待下载数据的下载范围之前,将待下载文件划分为第一测速下载范围、第二测速下载范围和所述待下载数据的下载范围。
第一分配模块1502,还用于将所述第一测速下载范围分配给所述第一网卡进行下载,并将所述第二测速下载范围分配给所述第二网卡进行下载。
测速模块1702,用于根据所述第一网卡对所述第一测速下载范围的下载获取所述第一网卡的当前网速,并根据所述第二网卡对所述第二测速下载范围的下载获取所述第二网卡的当前网速。
进一步地,在上述实施例的基础上,第二分配模块1503,还用于在所述第一网卡完成所述第一测速下载范围、所述第二网卡未完成所述第二测速下载范围,且所述第二网卡未完成的第二测速下载范围剩余下载范围大于第二预设阈值时,执行至少一次第二分配操作,直至所述第二测速下载范围全部下载完成为止。其中,第二分配操作包括:根据所述第二测速下载范围的剩余下载范围为所述第一网卡分配新的第一测速下载范围和为所述第二网卡分配新的第二测速下载范围。
另一实施例中,若所述第一网卡完成所述第一测速下载范围开始下载所述第一下载范围、所述第二网卡未完成所述第二测速下载范围,且所述第二网卡未完成的第二测速下载范围剩余下载范围小于或等于第二预设阈值,则第二分配模块1503,还用于在所述第一网卡完成所述第一下载范围且所述第二网卡仍未完成所述第二测速下载范围时,将所述第二下载范围分配给所述第一网卡进行下载。
本实施例中,将上述待下载文件分为普通文件和大文件,具体地,将大于第三预设阈值的文件作为大文件,小于或等于第三预设阈值的文件作为普通文件。
对于普通文件,即若待下载文件小于或等于第三预设阈值,第一分配模块1502,用于根据所述待下载数据的下载范围为所述第一网卡分配第一下载 范围和为所述第二网卡分配第二下载范围,具体为:按照所述第一网卡和所述第二网卡的当前网速比,将所述待下载文件分为第一部分和第二部分,根据所述第一部分减去所述第一测速下载范围大小后的值在所述待下载数据的下载范围内划分所述第一下载范围,并根据所述第二部分减去所述第二测速下载范围大小后的值在所述待下载数据的下载范围内划分所述第二下载范围;或者,按照所述第一网卡和所述第二网卡的当前网速比,将所述待下载数据的下载范围分为所述第一下载范围和所述第二下载范围。
对于大文件,即待下载文件大于第三预设阈值,第一分配模块1502,用于根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围,具体为:从所述待下载数据的下载范围中切分出第一待下载部分,其中,所述第一待下载部分的大小等于第四预设阈值;按照所述第一网卡和所述第二网卡的当前网速比,将所述第一待下载部分分为第一子下载范围和第二子下载范围,并将所述待下载数据的下载范围中除去所述第一待下载部分的剩余部分作为新的待下载数据的下载范围,其中,所述第一子下载范围属于所述第一下载范围,所述第二子下载范围属于所述第二下载范围;直到将所述新的待下载数据的下载范围的大小小于或等于所述第四预设阈值;进而,按照所述第一网卡和所述第二网卡的当前网速比,将小于或等于所述第三阈值的所述新的待下载数据的下载范围分为新的第一子下载范围和新的第二子下载范围,其中,所述新的第一子下载范围属于所述第一下载范围,所述新的第二子下载范围属于所述第二下载范围。
进一步地,对于上述大文件,在依次进行切分的过程中,第一分配模块1502,将所述待下载数据的下载范围中除去所述第一待下载部分的剩余部分作为新的待下载数据的下载范围之后,若所述第一网卡完成所述第一子下载范围的下载、所述第二网卡未完成所述第二子下载范围的下载,且所述第二子下载范围的剩余下载范围小于或等于第五预设阈值,则还用于从所述新的待下载数据的下载范围中切分出第二待下载部分,其中,所述第二待下载部分的大小等于所述第四预设阈值;按照所述第一网卡和所述第二网卡的当前网速比,将所述第一待下载部分分为第三子下载范围和第四子下载范围,其中,所述第三子下载范围属于所述第一下载范围,所述第四子下 载范围属于所述第二下载范围;在所述第一网卡完成所述第一子下载范围且完成所述第三子下载范围、所述第二网卡未完成所述第二子下载范围时,将所述第四子下载范围分配给所述第一网卡进行下载。
在上述实施例的基础上,第二分配模块1503,用于根据所述第二下载范围的剩余下载范围为所述第一网卡分配所述新的第一下载范围和为所述第二网卡分配所述新的第二下载范围,具体为:将所述第二下载范围的剩余下载范围划分为缓冲范围和待分配范围;根据所述待分配范围为所述第一网卡分配所述新的第一下载范围和为所述第二网卡分配所述新的第二下载范围。
第二分配模块1503,用于根据所述待分配范围为所述第一网卡分配所述新的第一下载范围和为所述第二网卡分配所述新的第二下载范围,具体为:按照所述第一网卡和所述第二网卡的当前网速比,将所述待分配范围分为第一子待分配范围和第二子待分配范围,并将所述第一子待分配范围作为所述新的第一下载范围,将所述第二下载范围中所述第二网卡已下载范围、所述缓存范围以及所述第二子待分配范围的和作为所述新的第二下载范围;或者,将所述第一子待分配范围作为所述新的第一下载范围,将所述缓存范围以及所述第二子待分配范围的和作为所述新的第二下载范围。
同理,第二分配模块1503,用于根据所述第二测速下载范围的剩余下载范围为所述第一网卡分配新的第一测速下载范围和为所述第二网卡分配新的第二测速下载范围,具体为:按照所述第一网卡和所述第二网卡的当前网速比,将所述第二测速下载范围的剩余下载范围分为第一子测速下载范围和第二子测速下载范围,将所述第一子测速下载范围作为所述新的第一测速下载范围,将所述第二网卡已下载的所述第二测速下载范围和所述第二子测速下载范围的和作为所述新的第二测速下载范围。或者,将所述新的第二测速下载范围作为新的第二测速下载范围。
可选地,第二分配模块1503,具体用于在所述第一网卡完成所述第一下载范围的下载、所述第二网卡未完成所述第二下载范围的下载,且所述待下载数据的下载范围除所述第一下载范围和所述第二下载范围之外不存在未下载范围、第二下载范围的剩余下载范围大于第一预设阈值时,判断所述第一网卡当前下载速度大于所述第二网卡当前下载速度的部分是否满足预设条件,若是,则执行至少一次第一分配操作。
本发明实施例提供的终端,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
本发明另一实施例中还提供一种终端,与图11所示的终端结构相同,参照图11,该终端包括:处理器20,例如CPU;存储器21和至少一个通信总线22。通信总线22用于实现元件之间的通信连接。存储器21可能包含高速RAM存储器,也可能还包括非易失性存储器NVM,例如至少一个磁盘存储器,存储器21中可以存储各种程序,用于完成各种处理功能以及实现图12-14所示实施例的方法步骤。其中,具体地,
处理器20,用于获取待下载数据的下载范围;根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围;在所述第一网卡完成所述第一下载范围的下载时所述第二网卡未完成所述第二下载范围的下载,且第二下载范围的剩余下载范围大于第一预设阈值时,执行至少一次第一分配操作,直至所述第二下载范围全部下载完成为止。其中,第一分配操作包括:根据所述第二下载范围的剩余下载范围为所述第一网卡分配新的第一下载范围和为所述第二网卡分配新的第二下载范围。
可选地,处理器20,具体用于在所述第一网卡完成所述第一下载范围的下载、所述第二网卡未完成所述第二下载范围的下载,且所述待下载数据的下载范围除所述第一下载范围和所述第二下载范围之外不存在未下载范围、第二下载范围的剩余下载范围大于第一预设阈值时,判断所述第一网卡当前下载速度大于所述第二网卡当前下载速度的部分是否满足预设条件,若是,则执行至少一次第一分配操作。
本发明实施例提供的终端,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
进一步地,处理器20,用于在执行至少一次第一分配操作之前,判断所述待下载数据的下载范围除所述第一下载范围和所述第二下载范围之外,是否还存在未下载范围,若是,则取第一值作为所述第一预设阈值,若否,则取第二值作为所述第一预设阈值;所述第一值大于所述第二值。
处理器20,用于在获取待下载数据的下载范围之前,将待下载文件划分为第一测速下载范围、第二测速下载范围和所述待下载数据的下载范围;将所述第一测速下载范围分配给所述第一网卡进行下载,并将所述第二测速下 载范围分配给所述第二网卡进行下载;根据所述第一网卡对所述第一测速下载范围的下载获取所述第一网卡的当前网速,并根据所述第二网卡对所述第二测速下载范围的下载获取所述第二网卡的当前网速。
进一步地,处理器20,在所述第一网卡完成所述第一测速下载范围、所述第二网卡未完成所述第二测速下载范围,且所述第二网卡未完成的第二测速下载范围剩余下载范围大于第二预设阈值时,执行至少一次第二分配操作,直至所述第二测速下载范围全部下载完成为止。其中,第二分配操作包括:根据所述第二测速下载范围的剩余下载范围为所述第一网卡分配新的第一测速下载范围和为所述第二网卡分配新的第二测速下载范围。
若所述第一网卡完成所述第一测速下载范围开始下载所述第一下载范围、所述第二网卡未完成所述第二测速下载范围,且所述第二网卡未完成的第二测速下载范围剩余下载范围小于或等于第二预设阈值,处理器20,还用于在所述第一网卡完成所述第一下载范围且所述第二网卡仍未完成所述第二测速下载范围时,将所述第二下载范围分配给所述第一网卡进行下载。
对于普通文件,即待下载文件小于或等于第三预设阈值,处理器20,用于根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围,具体为:按照所述第一网卡和所述第二网卡的当前网速比,将所述待下载文件分为第一部分和第二部分,根据所述第一部分减去所述第一测速下载范围大小后的值在所述待下载数据的下载范围内划分所述第一下载范围,并根据所述第二部分减去所述第二测速下载范围大小后的值在所述待下载数据的下载范围内划分所述第二下载范围;或者,按照所述第一网卡和所述第二网卡的当前网速比,将所述待下载数据的下载范围分为所述第一下载范围和所述第二下载范围。
对于大文件,即待下载文件大于第三预设阈值,处理器20,用于根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围,具体为:从所述待下载数据的下载范围中切分出第一待下载部分,其中,所述第一待下载部分的大小等于第四预设阈值;按照所述第一网卡和所述第二网卡的当前网速比,将所述第一待下载部分分为第一子下载范围和第二子下载范围,并将所述待下载数据的下载范围中除去 所述第一待下载部分的剩余部分作为新的待下载数据的下载范围,其中,所述第一子下载范围属于所述第一下载范围,所述第二子下载范围属于所述第二下载范围;直到将所述新的待下载数据的下载范围的大小小于或等于所述第四预设阈值;进而,按照所述第一网卡和所述第二网卡的当前网速比,将小于或等于所述第三阈值的所述新的待下载数据的下载范围分为新的第一子下载范围和新的第二子下载范围,其中,所述新的第一子下载范围属于所述第一下载范围,所述新的第二子下载范围属于所述第二下载范围。
另一实施例中,大文件分配过程中,第一网卡和第二网卡也可以彼此分担下载任务,具体地,处理器20,将所述待下载数据的下载范围中除去所述第一待下载部分的剩余部分作为新的待下载数据的下载范围之后,若所述第一网卡完成所述第一子下载范围的下载、所述第二网卡未完成所述第二子下载范围的下载,且所述第二子下载范围的剩余下载范围小于或等于第五预设阈值,则还用于从所述新的待下载数据的下载范围中切分出第二待下载部分,其中,所述第二待下载部分的大小等于所述第四预设阈值;按照所述第一网卡和所述第二网卡的当前网速比,将所述第一待下载部分分为第三子下载范围和第四子下载范围,其中,所述第三子下载范围属于所述第一下载范围,所述第四子下载范围属于所述第二下载范围;在所述第一网卡完成所述第一子下载范围且完成所述第三子下载范围、所述第二网卡未完成所述第二子下载范围时,将所述第四子下载范围分配给所述第一网卡进行下载。
在上述实施例的基础上,处理器20,用于根据所述第二下载范围的剩余下载范围为所述第一网卡分配所述新的第一下载范围和为所述第二网卡分配所述新的第二下载范围,具体为:将所述第二下载范围的剩余下载范围划分为缓冲范围和待分配范围;根据所述待分配范围为所述第一网卡分配所述新的第一下载范围和为所述第二网卡分配所述新的第二下载范围。
处理器20,用于根据所述待分配范围为所述第一网卡分配所述新的第一下载范围和为所述第二网卡分配所述新的第二下载范围,具体为:按照所述第一网卡和所述第二网卡的当前网速比,将所述待分配范围分为第一子待分配范围和第二子待分配范围,并将所述第一子待分配范围作为所述新的第一下载范围,将所述第二下载范围中所述第二网卡已下载范围、所述缓存范 围以及所述第二子待分配范围的和作为所述新的第二下载范围;或者,将所述第一子待分配范围作为所述新的第一下载范围,将所述缓存范围以及所述第二子待分配范围的和作为所述新的第二下载范围。
处理器20,用于根据所述第二测速下载范围的剩余下载范围为所述第一网卡分配新的第一测速下载范围和为所述第二网卡分配新的第二测速下载范围,具体为:按照所述第一网卡和所述第二网卡的当前网速比,将所述第二测速下载范围的剩余下载范围分为第一子测速下载范围和第二子测速下载范围,将所述第一子测速下载范围作为所述新的第一测速下载范围,将所述第二网卡已下载的所述第二测速下载范围和所述第二子测速下载范围的和作为所述新的第二测速下载范围。或者,将所述新的第二测速下载范围作为新的第二测速下载范围。
本发明实施例提供的终端,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (46)

  1. 一种数据传输的方法,其特征在于,所述方法适用于包括第一网卡和第二网卡的终端;所述方法包括:
    所述终端获取待下载数据的下载范围range;
    所述终端根据所述待下载数据的下载range为所述第一网卡分配第一下载range和为所述第二网卡分配第二下载range;
    所述终端判断在预设的下载时间到达时,所述第一网卡完成所述第一下载range的下载且所述第二网卡未完成所述第二下载range的下载,则所述终端执行至少一次第一分配操作,直至所述第一网卡完成新的第一下载range、所述第二网卡完成新的第二下载range以及所述第二下载range全部下载完成为止;
    所述第一分配操作包括:根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
  2. 据权利要求1所述的方法,其特征在于,所述终端根据所述待下载数据的下载range为所述第一网卡分配第一下载range和为所述第二网卡分配第二下载range,包括:
    所述终端按照所述第一网卡和所述第二网卡的网速比,将所述待下载数据的全部下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡。
  3. 根据权利要求1所述的方法,其特征在于,所述终端根据所述待下载数据的下载range为所述第一网卡分配第一下载range和为所述第二网卡分配第二下载range,包括:
    所述终端按照预设的分配规则,将所述待下载数据的部分下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡;
    所述方法之后,还包括:
    所述终端执行至少一次第二分配操作,直至所述待下载数据全部下载完成为止;
    所述第二分配操作包括:所述终端从所述待下载数据的当前剩余下载range中为所述第一网卡和所述第二网卡分别分配下一次的数据下载range。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述终端根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range,具体包括:
    所述终端按照预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range;
    或者
    所述终端按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
  5. 根据权利要求3所述的方法,其特征在于,所述终端根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range,具体包括:
    所述终端从所述待下载数据的当前剩余下载range中为完成所述第一下载range的所述第一网卡分配下一次的下载range,并进一步判断所述第二网卡在预设时刻到达时是否完成所述第二下载range的下载;
    若否,则所述终端在所述第一网卡下载完当前的下载range后,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
  6. 根据权利要求1-3任一项所述的方法,其特征在于,所述终端根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range,具体包括:
    所述终端根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间;
    所述终端在判断所述第一时间大于第一预设时间时,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
  7. 根据权利要求1-3任一项所述的方法,其特征在于,所述终端根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range,具体包括:
    所述终端根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间;
    所述终端根据所述第一网卡当前的网速、所述第二网卡当前的网速,确定所述第一网卡和所述第二网卡共同下载所述第二下载range所需要的第二时间;
    当所述第一时间大于所述第二时间时,所述终端按照所述预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述方法之前,还包括:所述终端确定所述待下载数据的实时性。
  9. 根据权利要求8所述的方法,其特征在于,所述终端确定待下载数据的实时性,具体包括:
    所述终端确定发起下载所述待下载数据的连接请求的第一应用软件APP;
    所述终端判断所述第一APP是否与预设的APP集合中的APP匹配;
    若是,则所述终端确定所述待下载数据的实时性高于预设的第一阈值;
    否则,所述终端确定所述待下载数据的实时性低于预设的第一阈值。
  10. 根据权利要求8所述的方法,其特征在于,所述终端确定待下载数据的实时性,具体包括:
    所述终端确定发给服务器的超文本传输协议获取请求中携带的待下载数据的类型;
    所述终端判断所述待下载数据的类型是否与预设的数据类型库中的类型匹配;
    若是,则所述终端确定所述待下载数据的实时性高于预设的第一阈值;否则,所述终端确定所述待下载数据的实时性低于预设的第一阈值。
  11. 根据权利要求3-10任一项所述的方法,其特征在于,所述预设的分配规则为所述第一网卡或第二网卡的当前网速和所述预设的下载时间的乘积。
  12. 一种终端,其特征在于,所述终端为具有第一网卡和第二网卡的终端,所述终端包括:
    获取模块,用于终端获取待下载数据的下载范围range;
    第一分配模块,用于根据所述待下载数据的下载range为所述第一网卡分配第一下载range和为所述第二网卡分配第二下载range;
    第二分配模块,用于判断在预设的下载时间到达时,所述第一网卡完成所述第一下载range的下载且所述第二网卡未完成所述第二下载range的下载,则执行至少一次第一分配操作,直至所述第一网卡完成新的第一下载range、所述第二网卡完成新的第二下载range以及所述第二下载range全部下载完成为止;所述第一分配操作包括:根据所述第二下载range为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
  13. 根据权利要求12所述的终端,其特征在于,所述第一分配模块,具体用于按照所述第一网卡和所述第二网卡的网速比,将所述待下载数据的全部下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡。
  14. 根据权利要求12所述的终端,其特征在于,所述第一分配模块,具体用于按照预设的分配规则,将所述待下载数据的部分下载range分为所述第一下载range和所述第二下载range,并分别分配给所述第一网卡和所述第二网卡;
    则所述第二分配模块,还用于执行至少一次第二分配操作,直至所述待下载数据全部下载完成为止;所述第二分配操作包括:从所述待下载数据的当前剩余下载range中为所述第一网卡和所述第二网卡分别分配下一次的数据下载range。
  15. 根据权利要求12-14任一项所述的终端,其特征在于,所述第二分配模块,具体用于按照预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range;或者,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
  16. 根据权利要求14所述的终端,其特征在于,所述第二分配模块,具体用于从所述待下载数据的当前剩余下载range中为完成所述第一下载range 的所述第一网卡分配下一次的下载range,并进一步判断所述第二网卡在预设时刻到达时是否完成所述第二下载range的下载;若否,则端在所述第一网卡下载完当前的下载range后,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
  17. 根据权利要求12-14任一项所述的终端,其特征在于,所述第二分配模块,具体用于根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间,并在判断所述第一时间大于第一预设时间时,按照预设的分配规则,从所述第二下载range的剩余下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
  18. 根据权利要求12-14任一项所述的终端,其特征在于,所述第二分配模块,具体用于根据所述第二网卡当前的网速,确定所述第二网卡下载所述第二下载range的剩余下载range所需要的第一时间,并根据所述第一网卡当前的网速、所述第二网卡当前的网速,确定所述第一网卡和所述第二网卡共同下载所述第二下载range所需要的第二时间,并在判断当所述第一时间大于所述第二时间时,按照所述预设的分配规则,从所述第二下载range中为所述第一网卡分配所述新的第一下载range和为所述第二网卡分配所述新的第二下载range。
  19. 根据权利要求12-18任一项所述的终端,其特征在于,所述终端还包括:
    确定模块,用于确定所述待下载数据的实时性。
  20. 根据权利要求19所述的终端,其特征在于,所述确定模块,具体用于确定发起下载所述待下载数据的连接请求的第一应用软件APP,并判断所述第一APP是否与预设的APP集合中的APP匹配;若是,则确定所述待下载数据的实时性高于预设的第一阈值;否则,则确定所述待下载数据的实时性低于预设的第一阈值。
  21. 根据权利要求19所述的终端,其特征在于,所述确定模块,具体用于确定发给服务器的超文本传输协议获取请求中携带的待下载数据的类型,并判断所述待下载数据的类型是否与预设的数据类型库中的类型匹配;若是, 则确定所述待下载数据的实时性高于预设的第一阈值;否则,则确定所述待下载数据的实时性低于预设的第一阈值。
  22. 根据权利要求14-21任一项所述的终端,其特征在于,所述预设的分配规则为所述第一网卡或第二网卡的当前网速和所述预设的下载时间的乘积。
  23. 一种数据传输的方法,其特征在于,所述方法适用于包括第一网卡和第二网卡的终端;所述方法包括:
    所述终端获取待下载数据的下载范围;
    所述终端根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围;
    若所述第一网卡完成所述第一下载范围的下载时所述第二网卡未完成所述第二下载范围的下载,且第二下载范围的剩余下载范围大于第一预设阈值,则所述终端执行至少一次第一分配操作,直至所述第二下载范围全部下载完成为止;
    所述第一分配操作包括:根据所述第二下载范围的剩余下载范围为所述第一网卡分配新的第一下载范围和为所述第二网卡分配新的第二下载范围。
  24. 根据权利要求23所述的方法,其特征在于,所述终端执行至少一次第一分配操作之前,还包括:
    所述终端判断所述待下载数据的下载范围除所述第一下载范围和所述第二下载范围之外,是否还存在未下载范围,若是,则取第一值作为所述第一预设阈值,若否,则取第二值作为所述第一预设阈值;
    所述第一值大于所述第二值。
  25. 根据权利要求23所述的方法,其特征在于,所述终端获取待下载数据的下载范围之前,还包括:
    所述终端将待下载文件划分为第一测速下载范围、第二测速下载范围和所述待下载数据的下载范围;
    所述终端将所述第一测速下载范围分配给所述第一网卡进行下载,并将所述第二测速下载范围分配给所述第二网卡进行下载;
    所述终端根据所述第一网卡对所述第一测速下载范围的下载获取所述第一网卡的当前网速,并根据所述第二网卡对所述第二测速下载范围的下载获 取所述第二网卡的当前网速。
  26. 根据权利要求25所述的方法,其特征在于,所述终端将所述第一测速下载范围分配给所述第一网卡进行下载,并将所述第二测速下载范围分配给所述第二网卡进行下载之后,还包括:
    若所述第一网卡完成所述第一测速下载范围时所述第二网卡未完成所述第二测速下载范围,且所述第二网卡未完成的第二测速下载范围剩余下载范围大于第二预设阈值,则所述终端执行至少一次第二分配操作,直至所述第二测速下载范围全部下载完成为止;
    所述第二分配操作包括:根据所述第二测速下载范围的剩余下载范围为所述第一网卡分配新的第一测速下载范围和为所述第二网卡分配新的第二测速下载范围。
  27. 根据权利要求25所述的方法,其特征在于,所述终端将所述第一测速下载范围分配给所述第一网卡进行下载,并将所述第二测速下载范围分配给所述第二网卡进行下载之后,还包括:
    若所述第一网卡完成所述第一测速下载范围开始下载所述第一下载范围、所述第二网卡未完成所述第二测速下载范围,且所述第二网卡未完成的第二测速下载范围剩余下载范围小于或等于第二预设阈值,则所述终端在所述第一网卡完成所述第一下载范围且所述第二网卡仍未完成所述第二测速下载范围时,将所述第二下载范围分配给所述第一网卡进行下载。
  28. 根据权利要求25-27任一项所述的方法,其特征在于,若待下载文件小于或等于第三预设阈值,
    所述终端根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围,包括:
    所述终端按照所述第一网卡和所述第二网卡的当前网速比,将所述待下载文件分为第一部分和第二部分,根据所述第一部分减去所述第一测速下载范围大小后的值在所述待下载数据的下载范围内划分所述第一下载范围,并根据所述第二部分减去所述第二测速下载范围大小后的值在所述待下载数据的下载范围内划分所述第二下载范围;或者,
    所述终端按照所述第一网卡和所述第二网卡的当前网速比,将所述待下载数据的下载范围分为所述第一下载范围和所述第二下载范围。
  29. 根据权利要求23-27任一项所述的方法,其特征在于,若待下载文件大于第三预设阈值,
    所述终端根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围,包括:
    A、所述终端从所述待下载数据的下载范围中切分出第一待下载部分,其中,所述第一待下载部分的大小等于第四预设阈值;
    B、所述终端按照所述第一网卡和所述第二网卡的当前网速比,将所述第一待下载部分分为第一子下载范围和第二子下载范围,并将所述待下载数据的下载范围中除去所述第一待下载部分的剩余部分作为新的待下载数据的下载范围,其中,所述第一子下载范围属于所述第一下载范围,所述第二子下载范围属于所述第二下载范围;
    循环执行A~B,直到将所述新的待下载数据的下载范围的大小小于或等于所述第四预设阈值;
    所述终端按照所述第一网卡和所述第二网卡的当前网速比,将小于或等于所述第四预设阈值的所述新的待下载数据的下载范围分为新的第一子下载范围和新的第二子下载范围,其中,所述新的第一子下载范围属于所述第一下载范围,所述新的第二子下载范围属于所述第二下载范围。
  30. 根据权利要求29所述的方法,其特征在于,所述终端将所述待下载数据的下载范围中除去所述第一待下载部分的剩余部分作为新的待下载数据的下载范围之后,还包括:
    若所述第一网卡完成所述第一子下载范围的下载、所述第二网卡未完成所述第二子下载范围的下载,且所述第二子下载范围的剩余下载范围小于或等于第五预设阈值,则所述终端从所述新的待下载数据的下载范围中切分出第二待下载部分,其中,所述第二待下载部分的大小等于所述第四预设阈值;
    所述终端按照所述第一网卡和所述第二网卡的当前网速比,将所述第一待下载部分分为第三子下载范围和第四子下载范围,其中,所述第三子下载范围属于所述第一下载范围,所述第四子下载范围属于所述第二下载范围;
    若所述第一网卡完成所述第一子下载范围且完成所述第三子下载范 围时,所述第二网卡未完成所述第二子下载范围,则所述终端将所述第四子下载范围分配给所述第一网卡进行下载。
  31. 根据权利要求23所述的方法,其特征在于,所述终端根据所述第二下载范围的剩余下载范围为所述第一网卡分配所述新的第一下载范围和为所述第二网卡分配所述新的第二下载范围,包括:
    所述终端将所述第二下载范围的剩余下载范围划分为缓冲范围和待分配范围;
    所述终端根据所述待分配范围为所述第一网卡分配所述新的第一下载范围和为所述第二网卡分配所述新的第二下载范围。
  32. 根据权利要求31所述的方法,其特征在于,所述终端根据所述待分配范围为所述第一网卡分配所述新的第一下载范围和为所述第二网卡分配所述新的第二下载范围,包括:
    所述终端按照所述第一网卡和所述第二网卡的当前网速比,将所述待分配范围分为第一子待分配范围和第二子待分配范围,并将所述第一子待分配范围作为所述新的第一下载范围,将所述第二下载范围中所述第二网卡已下载范围、所述缓存范围以及所述第二子待分配范围的和作为所述新的第二下载范围;或者,将所述第一子待分配范围作为所述新的第一下载范围,将所述缓存范围以及所述第二子待分配范围的和作为所述新的第二下载范围。
  33. 根据权利要求26所述的方法,其特征在于,所述终端根据所述第二测速下载范围的剩余下载范围为所述第一网卡分配新的第一测速下载范围和为所述第二网卡分配新的第二测速下载范围,包括:
    所述终端按照所述第一网卡和所述第二网卡的当前网速比,将所述第二测速下载范围的剩余下载范围分为第一子测速下载范围和第二子测速下载范围,将所述第一子测速下载范围作为所述新的第一测速下载范围,将所述第二网卡已下载的所述第二测速下载范围和所述第二子测速下载范围的和作为所述新的第二测速下载范围。
  34. 根据权利要求23-33任一项所述的方法,其特征在于,若所述第一网卡完成所述第一下载范围的下载时所述第二网卡未完成所述第二下载范围的下载,且第二下载范围的剩余下载范围大于所述第一预设阈值,则所述终端执行至少一次第一分配操作,包括:
    若所述第一网卡完成所述第一下载范围的下载时所述第二网卡未完成所述第二下载范围的下载,且所述待下载数据的下载范围除所述第一下载范围和所述第二下载范围之外不存在未下载范围、第二下载范围的剩余下载范围大于所述第一预设阈值,则所述终端判断所述第一网卡当前下载速度大于所述第二网卡当前下载速度的部分是否满足预设条件,若是,则所述终端执行至少一次第一分配操作。
  35. 一种终端,其特征在于,所述终端为具有第一网卡和第二网卡的终端,所述终端包括:
    获取模块,用于获取待下载数据的下载范围;
    第一分配模块,用于根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围;
    第二分配模块,用于在所述第一网卡完成所述第一下载范围的下载时所述第二网卡未完成所述第二下载范围的下载,且第二下载范围的剩余下载范围大于第一预设阈值时,执行至少一次第一分配操作,直至所述第二下载范围全部下载完成为止;
    所述第一分配操作包括:根据所述第二下载范围的剩余下载范围为所述第一网卡分配新的第一下载范围和为所述第二网卡分配新的第二下载范围。
  36. 根据权利要求35所述的终端,其特征在于,还包括:确定模块;
    所述确定模块,用于在所述第二分配模块执行至少一次第一分配操作之前,判断所述待下载数据的下载范围除所述第一下载范围和所述第二下载范围之外,是否还存在未下载范围,若是,则取第一值作为所述第一预设阈值,若否,则取第二值作为所述第一预设阈值;
    所述第一值大于所述第二值。
  37. 根据权利要求35所述的终端,其特征在于,还包括:分割模块和测速模块;
    所述分割模块,用于在所述获取模块获取待下载数据的下载范围之前,将待下载文件划分为第一测速下载范围、第二测速下载范围和所述待下载数据的下载范围;
    所述第一分配模块,还用于将所述第一测速下载范围分配给所述第一网卡进行下载,并将所述第二测速下载范围分配给所述第二网卡进行下载;
    所述测速模块,用于根据所述第一网卡对所述第一测速下载范围的下载获取所述第一网卡的当前网速,并根据所述第二网卡对所述第二测速下载范围的下载获取所述第二网卡的当前网速。
  38. 根据权利要求37所述的终端,其特征在于,所述第二分配模块,还用于在所述第一网卡完成所述第一测速下载范围、所述第二网卡未完成所述第二测速下载范围,且所述第二网卡未完成的第二测速下载范围剩余下载范围大于第二预设阈值时,执行至少一次第二分配操作,直至所述第二测速下载范围全部下载完成为止;
    所述第二分配操作包括:根据所述第二测速下载范围的剩余下载范围为所述第一网卡分配新的第一测速下载范围和为所述第二网卡分配新的第二测速下载范围。
  39. 根据权利要求37所述的终端,其特征在于,若所述第一网卡完成所述第一测速下载范围开始下载所述第一下载范围、所述第二网卡未完成所述第二测速下载范围,且所述第二网卡未完成的第二测速下载范围剩余下载范围小于或等于第二预设阈值,所述第二分配模块,还用于在所述第一网卡完成所述第一下载范围且所述第二网卡仍未完成所述第二测速下载范围时,将所述第二下载范围分配给所述第一网卡进行下载。
  40. 根据权利要求37-39任一项所述的终端,其特征在于,若待下载文件小于或等于第三预设阈值,
    所述第一分配模块用于根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围,具体为:按照所述第一网卡和所述第二网卡的当前网速比,将所述待下载文件分为第一部分和第二部分,根据所述第一部分减去所述第一测速下载范围大小后的值在所述待下载数据的下载范围内划分所述第一下载范围,并根据所述第二部分减去所述第二测速下载范围大小后的值在所述待下载数据的下载范围内划分所述第二下载范围;或者,按照所述第一网卡和所述第二网卡的当前网速比,将所述待下载数据的下载范围分为所述第一下载范围和所述第二下载范围。
  41. 根据权利要求35-39任一项所述的终端,其特征在于,若待下载文件大于第三预设阈值,
    所述第一分配模块用于根据所述待下载数据的下载范围为所述第一网卡分配第一下载范围和为所述第二网卡分配第二下载范围,具体为:从所述待下载数据的下载范围中切分出第一待下载部分,其中,所述第一待下载部分的大小等于第四预设阈值;按照所述第一网卡和所述第二网卡的当前网速比,将所述第一待下载部分分为第一子下载范围和第二子下载范围,并将所述待下载数据的下载范围中除去所述第一待下载部分的剩余部分作为新的待下载数据的下载范围,其中,所述第一子下载范围属于所述第一下载范围,所述第二子下载范围属于所述第二下载范围;直到将所述新的待下载数据的下载范围的大小小于或等于所述第四预设阈值;
    按照所述第一网卡和所述第二网卡的当前网速比,将小于或等于所述第三阈值的所述新的待下载数据的下载范围分为新的第一子下载范围和新的第二子下载范围,其中,所述新的第一子下载范围属于所述第一下载范围,所述新的第二子下载范围属于所述第二下载范围。
  42. 根据权利要求41所述的终端,其特征在于,所述第一分配模块将所述待下载数据的下载范围中除去所述第一待下载部分的剩余部分作为新的待下载数据的下载范围之后,若所述第一网卡完成所述第一子下载范围的下载、所述第二网卡未完成所述第二子下载范围的下载,且所述第二子下载范围的剩余下载范围小于或等于第五预设阈值,则还用于从所述新的待下载数据的下载范围中切分出第二待下载部分,其中,所述第二待下载部分的大小等于所述第四预设阈值;按照所述第一网卡和所述第二网卡的当前网速比,将所述第一待下载部分分为第三子下载范围和第四子下载范围,其中,所述第三子下载范围属于所述第一下载范围,所述第四子下载范围属于所述第二下载范围;
    在所述第一网卡完成所述第一子下载范围且完成所述第三子下载范围、所述第二网卡未完成所述第二子下载范围时,将所述第四子下载范围分配给所述第一网卡进行下载。
  43. 根据权利要求35所述的终端,其特征在于,所述第二分配模块用于根据所述第二下载范围的剩余下载范围为所述第一网卡分配所述新的第一下载范围和为所述第二网卡分配所述新的第二下载范围,具体为:将所述第二下载范围的剩余下载范围划分为缓冲范围和待分配范围;根据所述待分配 范围为所述第一网卡分配所述新的第一下载范围和为所述第二网卡分配所述新的第二下载范围。
  44. 根据权利要求43所述的终端,其特征在于,所述第二分配模块用于根据所述待分配范围为所述第一网卡分配所述新的第一下载范围和为所述第二网卡分配所述新的第二下载范围,具体为:按照所述第一网卡和所述第二网卡的当前网速比,将所述待分配范围分为第一子待分配范围和第二子待分配范围,并将所述第一子待分配范围作为所述新的第一下载范围,将所述第二下载范围中所述第二网卡已下载范围、所述缓存范围以及所述第二子待分配范围的和作为所述新的第二下载范围;或者,将所述第一子待分配范围作为所述新的第一下载范围,将所述缓存范围以及所述第二子待分配范围的和作为所述新的第二下载范围。
  45. 根据权利要求38所述的终端,其特征在于,所述第二分配模块用于根据所述第二测速下载范围的剩余下载范围为所述第一网卡分配新的第一测速下载范围和为所述第二网卡分配新的第二测速下载范围,具体为:按照所述第一网卡和所述第二网卡的当前网速比,将所述第二测速下载范围的剩余下载范围分为第一子测速下载范围和第二子测速下载范围,将所述第一子测速下载范围作为所述新的第一测速下载范围,将所述第二网卡已下载的所述第二测速下载范围和所述第二子测速下载范围的和作为所述新的第二测速下载范围。
  46. 根据权利要求38所述的终端,其特征在于,所述第二分配模块,具体用于在所述第一网卡完成所述第一下载范围的下载、所述第二网卡未完成所述第二下载范围的下载,且所述待下载数据的下载范围除所述第一下载范围和所述第二下载范围之外不存在未下载范围、第二下载范围的剩余下载范围大于第一预设阈值时,判断所述第一网卡当前下载速度大于所述第二网卡当前下载速度的部分是否满足预设条件,若是,则执行至少一次第一分配操作。
PCT/CN2015/082681 2015-04-10 2015-06-29 数据传输的方法和终端 Ceased WO2016161706A1 (zh)

Priority Applications (5)

Application Number Priority Date Filing Date Title
KR1020177031364A KR101943933B1 (ko) 2015-04-10 2015-06-29 데이터 전송 방법, 및 단말
EP15888261.3A EP3282734B1 (en) 2015-04-10 2015-06-29 Data transmission method and terminal
JP2017552798A JP6581665B2 (ja) 2015-04-10 2015-06-29 データ送信方法及び端末
CN201580046827.9A CN106797557B (zh) 2015-04-10 2015-06-29 数据传输的方法和终端
US15/728,108 US10506020B2 (en) 2015-04-10 2017-10-09 Data transmission method, and terminal

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CNPCT/CN2015/076284 2015-04-10
CN2015076284 2015-04-10

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/728,108 Continuation US10506020B2 (en) 2015-04-10 2017-10-09 Data transmission method, and terminal

Publications (1)

Publication Number Publication Date
WO2016161706A1 true WO2016161706A1 (zh) 2016-10-13

Family

ID=57071744

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/082681 Ceased WO2016161706A1 (zh) 2015-04-10 2015-06-29 数据传输的方法和终端

Country Status (6)

Country Link
US (1) US10506020B2 (zh)
EP (1) EP3282734B1 (zh)
JP (1) JP6581665B2 (zh)
KR (1) KR101943933B1 (zh)
CN (1) CN106797557B (zh)
WO (1) WO2016161706A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107743144A (zh) * 2017-10-27 2018-02-27 广东欧珀移动通信有限公司 资源配置方法及相关产品

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9813299B2 (en) * 2016-02-24 2017-11-07 Ciena Corporation Systems and methods for bandwidth management in software defined networking controlled multi-layer networks
CN109962946B (zh) * 2017-12-22 2022-03-15 阿里巴巴集团控股有限公司 下载资源的方法及装置
CN109862065B (zh) * 2018-12-06 2021-09-14 北京字节跳动网络技术有限公司 文件下载方法、装置和电子设备
CN109547360B (zh) * 2019-02-01 2022-02-15 中国联合网络通信集团有限公司 数据传输调度方法和装置
CN111935781B (zh) * 2020-06-28 2023-04-25 中国科学院深圳先进技术研究院 数据分享网络的控制方法、网络系统及相关装置
CN115174557B (zh) * 2022-07-01 2024-03-01 济南浪潮数据技术有限公司 一种日志下载的调度方法、装置以及介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101389092A (zh) * 2007-09-12 2009-03-18 中兴通讯股份有限公司 一种双模双待手机使用双线程下载的方法
CN103297451A (zh) * 2012-02-27 2013-09-11 宇龙计算机通信科技(深圳)有限公司 终端和网页下载方法
CN104093142A (zh) * 2014-03-31 2014-10-08 宇龙计算机通信科技(深圳)有限公司 加速移动终端下载速度的方法及其装置

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020083193A1 (en) * 2000-11-03 2002-06-27 Henry Terefenko Parallel network data transmission
WO2007012662A1 (fr) 2005-07-28 2007-02-01 Gemplus Telechargement de donnees initie par des objets communicants portables pendant une campagne
FR2889326A1 (fr) 2005-07-28 2007-02-02 Gemplus Sa Telechargement de donnees initie par des objets communicants portables pendant une campagne
JP2008304980A (ja) * 2007-06-05 2008-12-18 Kansai Electric Power Co Inc:The データファイル配信システム
CN101287255A (zh) 2008-05-30 2008-10-15 德信智能手机技术(北京)有限公司 一种双卡双待移动终端的数据连接方法及装置
US8966001B2 (en) * 2008-09-02 2015-02-24 Qualcomm Incorporated Deployment and distribution model for improved content delivery system
JP2011015190A (ja) * 2009-07-02 2011-01-20 Panasonic Corp サーバ装置およびサーバ装置におけるデータ配信方法
CN101778491A (zh) 2009-12-23 2010-07-14 中兴通讯股份有限公司 一种无线数据终端及其网络切换方法
US8516147B2 (en) * 2010-02-26 2013-08-20 Simula Innovation Sa Data segmentation, request and transfer method
CN101925051B (zh) 2010-08-23 2015-08-12 中兴通讯股份有限公司 一种移动终端及其下载方法
KR102164457B1 (ko) 2013-04-25 2020-10-14 삼성전자주식회사 다중 무선 억세스를 위한 전자 장치 및 그 방법
KR20150022385A (ko) * 2013-08-23 2015-03-04 에스케이텔레콤 주식회사 데이터 전송 완료시간을 단축하기 위한 트래픽 제어 장치 및 방법
CN104363580B (zh) 2014-11-03 2018-07-24 中国联合网络通信集团有限公司 数据下载方法及通信系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101389092A (zh) * 2007-09-12 2009-03-18 中兴通讯股份有限公司 一种双模双待手机使用双线程下载的方法
CN103297451A (zh) * 2012-02-27 2013-09-11 宇龙计算机通信科技(深圳)有限公司 终端和网页下载方法
CN104093142A (zh) * 2014-03-31 2014-10-08 宇龙计算机通信科技(深圳)有限公司 加速移动终端下载速度的方法及其装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3282734A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107743144A (zh) * 2017-10-27 2018-02-27 广东欧珀移动通信有限公司 资源配置方法及相关产品
CN107743144B (zh) * 2017-10-27 2019-05-17 Oppo广东移动通信有限公司 资源配置方法及相关产品

Also Published As

Publication number Publication date
KR101943933B1 (ko) 2019-01-30
US20180034894A1 (en) 2018-02-01
JP2018514863A (ja) 2018-06-07
EP3282734B1 (en) 2020-03-04
KR20170132289A (ko) 2017-12-01
CN106797557B (zh) 2020-06-26
EP3282734A1 (en) 2018-02-14
US10506020B2 (en) 2019-12-10
JP6581665B2 (ja) 2019-09-25
EP3282734A4 (en) 2018-04-18
CN106797557A (zh) 2017-05-31

Similar Documents

Publication Publication Date Title
CN106797557B (zh) 数据传输的方法和终端
CN110227259B (zh) 一种数据处理的方法、装置、服务器和系统
US10540196B2 (en) Techniques to enable live migration of virtual environments
CN111142788B (zh) 一种数据迁移方法、装置和计算机可读存储介质
JP6754734B2 (ja) Ranスライスにおけるリソース管理装置及びranスライスにおけるリソース管理方法
EP2664214B1 (en) Method for multipath scheduling based on a lookup table
CN108647089A (zh) 资源配置方法、装置、终端及存储介质
CN102791032A (zh) 网络带宽分配方法及终端
CN111666148A (zh) 计算机,控制设备和数据处理方法
WO2019228344A1 (zh) 资源配置方法、装置、终端及存储介质
CN112243038B (zh) 下载方法、终端及计算机存储介质
WO2020063008A1 (zh) 资源配置方法、装置、终端及存储介质
CN103634336A (zh) 文件协同下载系统、装置及方法
CN111278051A (zh) 文件传输方法、装置、存储介质及电子设备
CN112491978A (zh) 一种调度方法和设备
CN106330504B (zh) 一种实现应用的方法及业务控制器
CN108076139B (zh) 用于云流送服务的方法和设备
CN119766743B (zh) 一种数据流传输方法、装置、设备及存储介质
CN114513506A (zh) 业务处理方法、接入边缘云服务器及业务处理系统
CN110662257A (zh) 报文传输方法、装置、计算机设备和存储介质
CN113765819B (zh) 资源访问方法、装置、电子设备及存储介质
CN103746844B (zh) 一种终端上网的分配方法及装置
WO2021120843A1 (zh) 云主机内存分配方法及云主机、设备及存储介质
CN106161549A (zh) 一种数据传输的方法、系统、控制服务器及客户端
JP7802960B2 (ja) データ伝送方法及びデータ伝送デバイス

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: 15888261

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2017552798

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 20177031364

Country of ref document: KR

Kind code of ref document: A