WO2022016896A1 - Data download method and apparatus, computer device and computer-readable storage medium - Google Patents

Data download method and apparatus, computer device and computer-readable storage medium Download PDF

Info

Publication number
WO2022016896A1
WO2022016896A1 PCT/CN2021/082915 CN2021082915W WO2022016896A1 WO 2022016896 A1 WO2022016896 A1 WO 2022016896A1 CN 2021082915 W CN2021082915 W CN 2021082915W WO 2022016896 A1 WO2022016896 A1 WO 2022016896A1
Authority
WO
WIPO (PCT)
Prior art keywords
download
data
target
rate
average
Prior art date
Application number
PCT/CN2021/082915
Other languages
French (fr)
Chinese (zh)
Inventor
许英俊
Original Assignee
广州华多网络科技有限公司
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 广州华多网络科技有限公司 filed Critical 广州华多网络科技有限公司
Publication of WO2022016896A1 publication Critical patent/WO2022016896A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/43Querying
    • G06F16/438Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/44Browsing; Visualisation therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • 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]

Definitions

  • the present application relates to the field of Internet technologies, and in particular, to a data downloading method, apparatus, computer equipment and computer-readable storage medium.
  • the terminal when a user watches multimedia data such as video data and picture data, the terminal generally downloads high-definition multimedia data by default and displays it to the user.
  • an embodiment of the present application provides a method for downloading data, the method comprising:
  • mapping table represents the corresponding relationship between the download rate and the data quality parameter
  • the data quality parameter represents the clarity of multimedia data
  • obtaining the average download rate according to the data volume and download duration of the downloaded multimedia data includes:
  • the download information corresponding to each time interval is obtained according to the preset time interval;
  • the download information includes the download data amount and the download rate of the current time interval;
  • the average download rate is obtained based on the download rate included in each of the target download information.
  • acquiring download information corresponding to each time interval according to a preset time interval including:
  • the download rate corresponding to each of the time intervals is calculated according to the amount of downloaded data in each of the time intervals and the duration of the corresponding time interval.
  • determining at least one target download information from each download information according to the download data amount included in each download information includes:
  • the download information retained after the traversal is completed is determined as the target download information.
  • the obtaining the average download rate based on the download rate included in each of the target download information includes:
  • the average download rate included in each of the target download information is calculated to obtain the average download rate.
  • the multimedia data includes video data and/or picture data; in the case where the multimedia data includes video data, the data quality parameter includes a video bit rate, and when the multimedia data includes picture data In the case of , the data quality parameter includes the picture resolution.
  • obtaining the average download rate according to the data volume and download duration of the downloaded multimedia data includes:
  • the trigger condition includes any of the following:
  • a video playback instruction is detected for the first time within a preset time period
  • the video playback instruction for the target live room is detected for the first time within the preset time period
  • an embodiment of the present application provides a data downloading device, the device comprising:
  • an acquisition module used to acquire the average download rate according to the data volume and download duration of the downloaded multimedia data
  • a search module is used to search for a target data quality parameter matching the average download rate in a preset mapping table; the mapping table represents the corresponding relationship between the download rate and the data quality parameter, and the data quality parameter represents the data quality of the multimedia data. clarity;
  • a download module configured to determine a target download address corresponding to the target data quality parameter from multiple download addresses, and download the corresponding target multimedia data based on the target download address; the definition of the multimedia data corresponding to each of the download addresses different.
  • an embodiment of the present application provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the method in the first aspect when the processor executes the computer program.
  • an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of the method in the first aspect.
  • the average download rate is obtained according to the data volume and download duration of the downloaded multimedia data, and the average download rate is used to approximately characterize the current network download environment quality of the terminal; then, in the mapping table representing the correspondence between the download rate and the data quality parameters , find the target data quality parameter that matches the average download rate, and the data quality parameter represents the clarity of the multimedia data; then, determine the target download address corresponding to the target data quality parameter from multiple download addresses, and each download address corresponds to the target download address.
  • the definition of multimedia data is different, that is, the target download address matching the current network download environment quality of the terminal is determined from multiple download addresses, and the corresponding target multimedia data is downloaded based on the target download address, that is, the current download address of the terminal is obtained.
  • the network downloads the target multimedia data with the definition matching the environmental quality, so that the definition of the multimedia data to be downloaded is selected according to the average download rate of the downloaded multimedia data.
  • the download clarity can be achieved. lower target multimedia data; and in the case where the average download rate is higher, that is, the current network download environment quality of the terminal is better, similarly, the target multimedia data with higher definition can be downloaded; this avoids the traditional technology.
  • the terminal downloads high-definition multimedia data by default and displays it to the user, and downloading high-definition multimedia data even when the quality of the terminal network download environment is not good may easily lead to the problems of slow playback and slow loading of the multimedia data.
  • Fig. 1 is the application environment diagram of the data downloading method in one embodiment
  • FIG. 2 is a schematic flowchart of a data download method in one embodiment
  • FIG. 3 is a schematic diagram of the refinement steps of step S100 in one embodiment
  • FIG. 4 is a schematic diagram of the refinement steps of step S101 in one embodiment
  • FIG. 5 is a schematic diagram of the refinement steps of step S102 in one embodiment
  • FIG. 6 is a schematic diagram of a terminal interface corresponding to a switching operation between live broadcasts in one embodiment
  • FIG. 7 is a structural block diagram of a data downloading apparatus in one embodiment
  • FIG. 8 is a structural block diagram of a data downloading apparatus in one embodiment
  • Figure 9 is a diagram of the internal structure of a computer device in one embodiment.
  • the data downloading method provided in this application can be applied to the implementation environment as shown in FIG. 1 .
  • the terminal 102 communicates with the server 104 through the network.
  • the terminal 102 may be a personal computer, a notebook computer, a media player, a smart TV, a smart phone, a tablet computer, a portable wearable device, or the like, and the embodiment of the present application does not specifically limit the type of the terminal 102 .
  • the server 104 may be a single server, or a server cluster composed of multiple servers, and the server 104 may be a tower server, a rack server, a blade server, a high-density server, a single-socket server, a dual-socket server, or a multi-socket server. Servers, etc., the embodiment of the present application does not specifically limit the type of the server 104 .
  • a data download method is provided, and the method is applied to the terminal in FIG. 1 as an example for description, including the following steps:
  • Step S100 the terminal obtains an average download rate according to the data volume and download duration of the downloaded multimedia data.
  • the multimedia data may include video data and/or picture data
  • the video data may be, for example, drama videos, live videos, short videos, etc.
  • the picture data may be pictures in various formats.
  • the terminal may obtain the total data volume of the downloaded multimedia data and the total download duration for downloading the multimedia data, and then divide the total data volume by the total data volume. Download time, then get the average download rate.
  • the terminal may also acquire a dynamic average download rate in the process of downloading the multimedia data.
  • the terminal can set a time window, the length of the time window is fixed, and the length of the time window can be set by itself during the implementation; the terminal can move the time window periodically during the downloading process of multimedia data, such as moving once per second, every time it moves time window, the terminal calculates the sum of the download data volume in the current time window once, and then divides the total download data volume in the current time window by the length of the time window to obtain the dynamic average download rate in the current time window.
  • the dynamic average download rate corresponding to the last time window calculated by the terminal is the average download rate obtained by the terminal in step S100.
  • the way for the terminal to obtain the dynamic average download rate may also be implemented by setting a data amount window.
  • the data volume corresponding to the data volume window is fixed.
  • the data volume window is set to be fixed at 900K.
  • the terminal can calculate the download data volume and download rate at each time interval according to preset time intervals. Each time the terminal calculates the download data volume and download rate of the current time interval, it corresponds to sliding the data volume window once, and the sliding data volume window includes the latest calculated data of the terminal; the terminal detects the downloaded data volume in the sliding data volume window.
  • the terminal Whether the sum exceeds the data volume corresponding to the data volume window (for example, 900K), if it exceeds, the terminal will remove the longest downloaded data volume in the data volume window, so as to keep the sum of the downloaded data volume in the data volume window not exceeding 900K; the terminal calculates the average value of each download rate in the excluded data volume window, and then obtains the dynamic average download rate corresponding to the data volume window.
  • the data volume window for example, 900K
  • the dynamic average download rate corresponding to the last data volume window calculated by the terminal is the average download rate obtained by the terminal in step S100.
  • This embodiment does not specifically limit the manner in which the terminal obtains the average download rate according to the data volume and download duration of the downloaded multimedia data.
  • the downloaded multimedia data may be the multimedia data downloaded by the terminal most recently, and the terminal obtains an average download rate according to the data volume and download duration of the downloaded multimedia data, and the average download rate is the average download rate of the downloaded multimedia data in The average download rate during the download process can be used to approximately characterize the current network download environment quality of the terminal.
  • the time difference between the download end time and the current time of the downloaded multimedia data may be less than a preset threshold, and the smaller the time difference, the more the average download rate obtained by the terminal is closer to the current Actual network download environment quality.
  • Step S200 the terminal searches the preset mapping table for the target data quality parameter matching the average download rate.
  • a mapping table is preset in the terminal, and the mapping table represents the corresponding relationship between the download rate and the data quality parameter, wherein the data quality parameter represents the definition of multimedia data.
  • the data quality parameter represents the definition of multimedia data.
  • the data quality parameter includes a video bit rate
  • the data quality parameter includes the picture resolution.
  • the mapping table may include the correspondence between each download rate interval and the data quality parameter. For example, taking the multimedia data as video data and the data quality parameter as the video bit rate as an example, the mapping table may Including the video bit rate corresponding to the download rate interval 100k/s-500k/s is 500kbps, the video bit rate corresponding to the download rate interval 500k/s-1000k/s is 1000kbps, and the video bit rate corresponding to the download rate interval greater than 1000k/s is 2000kbps.
  • the terminal searches the preset mapping table for the target data quality parameter that matches the average download rate, and may first search the mapping table for the download rate interval that matches the average download rate, and then, according to the determined download rate interval, finds the target data quality parameter in the mapping table. Search for the video bit rate corresponding to the download rate interval in the download rate range, and then obtain the target data quality parameter.
  • mapping table represents the form of the corresponding relationship between the download rate and the data quality parameter, and it may also be that different download rates correspond to different data quality parameters, which is not specifically limited here.
  • Step S300 the terminal determines a target download address corresponding to the target data quality parameter from multiple download addresses, and downloads the corresponding target multimedia data based on the target download address.
  • the definition of multimedia data corresponding to each download address is different.
  • the video data A corresponds to four download addresses, which are respectively used for downloading files whose definition is "stream-saving".
  • the multiple download addresses may be requested by the terminal from the server after detecting that the user has entered multimedia software, such as multimedia software such as live broadcast software, video playback software, etc.
  • multimedia software such as live broadcast software, video playback software, etc.
  • the server will transcode it into a multi-bit rate video and store it under different download addresses. If receiving the address of the terminal requesting multimedia data, the server will deliver multiple download addresses corresponding to the multimedia data, and deliver a mapping comparison table including the correspondence between each download address and each data quality parameter.
  • the terminal can look up the download address corresponding to the target data quality parameter according to the mapping comparison table, and then obtain the target download address. After the terminal determines the target download address, the terminal downloads the corresponding target multimedia data from the target download address, and thus the obtained target multimedia data is multimedia data with a definition matching the average download rate.
  • the terminal obtains the average download rate according to the data volume and download duration of the downloaded multimedia data. If the average download rate is small, it indicates that the current network download environment quality of the terminal is poor, and the terminal selects the target multimedia data with low definition. If the average download rate is high, it indicates that the current network download environment quality of the terminal is good, and the terminal selects the target multimedia data with high definition to download.
  • the average download rate is obtained according to the data volume and download duration of the downloaded multimedia data, and the average download rate is used to characterize the current network download environment quality of the terminal; then, in the mapping representing the correspondence between the download rate and the data quality parameters In the table, find the target data quality parameter that matches the average download rate, and the data quality parameter represents the clarity of the multimedia data; then, determine the target download address corresponding to the target data quality parameter from multiple download addresses, and each download address
  • the definition of the corresponding multimedia data is different, that is, the target download address that matches the current network download environment quality of the terminal is determined from the multiple download addresses, and the corresponding target multimedia data is downloaded based on the target download address, that is, the terminal is obtained.
  • the current network downloads the target multimedia data with the resolution matching the quality of the environment, so that the resolution of the multimedia data to be downloaded can be selected according to the average download rate of the downloaded multimedia data.
  • the download clarity can be achieved. lower target multimedia data; and in the case where the average download rate is higher, that is, the current network download environment quality of the terminal is better, similarly, the target multimedia data with higher definition can be downloaded; this avoids the traditional technology.
  • the terminal downloads high-definition multimedia data by default and displays it to the user, and downloading high-definition multimedia data even when the quality of the terminal network download environment is not good may easily lead to the problems of slow playback and slow loading of the multimedia data.
  • step S100 includes S101, step S102 and step S103:
  • Step S101 During the process of downloading the multimedia data, the terminal acquires download information corresponding to each time interval according to a preset time interval.
  • the time interval may be fixed or variable.
  • a fixed time interval of 1s may be used as a time interval, or the time interval may be set to be 5s, 2s, 1s, 3s, 5s, and so on. There is no specific restriction here.
  • step S101 referring to FIG. 4, the terminal may implement the process of step S101 by executing step S1011, step S1012 and step S1013 as shown in FIG. 4:
  • Step S1011 the terminal acquires the first download data volume at the start time of each time interval and the second download data volume at the end time.
  • the terminal may detect the first downloaded data amount at the start time of the time interval and the second downloaded data amount at the end time of the time interval.
  • the terminal may collect the amount of downloaded data once at the termination time of each time interval.
  • Step S1012 the terminal takes the difference between the second download data amount and the first download data amount as the download data amount of the time interval.
  • the terminal For each time interval, the terminal subtracts the first downloaded data volume at the start time of the time interval from the second downloaded data volume at the termination time corresponding to the time interval, and the first downloaded data volume is also the previous time interval The download data volume at the termination time of , thus, the download data volume corresponding to the time interval is obtained.
  • Step S1013 the terminal calculates the download rate corresponding to each time interval according to the download data amount of each time interval and the duration of the corresponding time interval.
  • the terminal divides the download data volume of the time interval by the duration of the time interval to obtain the download rate corresponding to the time interval. For example, if the download data volume corresponding to a certain time interval is 500k, and the duration of the time interval is 5s, then The download rate corresponding to this time interval is 100k/s.
  • the terminal obtains the download information of the current time interval once at the termination time of each time interval.
  • Step S102 the terminal determines at least one target download information from the download information according to the download data amount included in the download information.
  • the download rate closer to the current moment is closer to the actual download rate at the current moment.
  • the terminal determines the download information closest to the current moment as the target download information, or determines a plurality of continuous download information closest to the current moment as the target download information.
  • the at least one target download information obtains an average download rate that is closer to the current actual network download environment quality of the terminal.
  • the terminal may implement the process of step S102 by performing steps S1021 , S1022 , S1023 and S1024 as shown in FIG. 5 :
  • Step S1021 the terminal sequentially traverses the download data volume included in each download information by using a preset data volume window in the order of the acquisition time of each download information from early to late.
  • the data volume corresponding to the data volume window is fixed. For example, if the data volume window is set to 900K, the terminal slides the data volume window once every time the terminal calculates the download information for a time interval.
  • the sliding data volume window includes the latest download information calculated by the terminal.
  • the download information corresponding to the first five time intervals is (500k, 100k/s), (400k, 200k/s), (300k, 300k/s), (600k, 200k/s) in sequence. s), (500k, 100k/s), after the download information (500k, 100k/s) of the first time interval is calculated, the terminal slides the data volume window once, and the sliding data volume window includes the download information ( 500k, 100k/s), after the download information (400k, 200k/s) of the second time interval is calculated, the terminal slides the data volume window once again, and the sliding data volume window includes the download information (500k, 100k/s) and (400k, 200k/s).
  • Step S1022 each time the terminal traverses the download data amount included in a piece of download information, it detects whether the sum of the traversed download data amounts exceeds the data amount window.
  • Each time the terminal slides the data volume window it detects whether the sum of the traversed downloaded data volume exceeds the data volume window, that is, detects whether the sum of the download data volume of each download information included in the data volume window exceeds the data volume corresponding to the data volume window. For example, it is detected whether the sum of the download data amount of each download information included in the data amount window exceeds 900k.
  • the terminal slides the data volume window once again, and the sliding data volume window includes the download information (500k, 100k/s) and ( 400k, 200k/s), the sum of the downloaded data volume is 900k, which does not exceed the data volume window.
  • the terminal slides the data volume window again.
  • Step S1023 if it exceeds, the terminal removes at least one download information with the earliest acquisition time among the traversed download data volumes.
  • the terminal will sequentially remove one or more download information exceeding the data volume window in the order of the acquisition time of the download information from early to late, so as to maintain the data volume
  • the sum of the download data of each download information in the window does not exceed 900k.
  • Step S1024 the terminal determines the download information retained after the traversal is completed as the target download information.
  • the terminal determines the download information retained after the traversal is completed as the target download information. For example, if the last download information is retained after the traversal is completed, the last download information is determined as the target download information, or the last two download information are retained after the traversal is completed. , the terminal determines that the last two download information are two target download information.
  • Step S103 the terminal obtains an average download rate based on the download rate included in the download information of each target.
  • the terminal can calculate the average value of the download rates included in each target download information to obtain the average download information. rate.
  • the download rate included in the target download information is the average download rate obtained by the terminal. make specific restrictions.
  • the data volume window terminal can be implemented in the form of creating an array, so as to realize the collection of new download information and the discarding of old download information exceeding the data volume window.
  • the average download rate in the data amount window is dynamically obtained during the downloading process of the downloaded multimedia data through a preset data amount window, and the average download rate in the last data amount window is determined as the average download rate , since the download time of the download data volume corresponding to the last data volume window is closest to the current time, the average download rate obtained based on the last data volume window can more approximately characterize the current network download environment quality of the terminal; and based on the last data volume window Obtaining the average download rate from the download rate included in the download information of each target in the data volume window is beneficial to avoid errors caused by a sudden change in a single download rate, thereby improving the accuracy of the average download rate, and is conducive to the download based on the average download rate and the current terminal's current rate.
  • the network downloads the target multimedia data whose environmental quality is more matched.
  • step S100 may include step A:
  • Step A Under the condition that the preset trigger condition is met, obtain the average download rate according to the data volume and download duration of the downloaded multimedia data;
  • the trigger condition includes any of the following:
  • the terminal detects the video playback instruction for the first time within the preset time period
  • the terminal detects the video playback instruction for the target live room for the first time within the preset time period
  • the terminal detects a video preloading operation
  • the terminal detects an image loading operation.
  • different trigger conditions may correspond to different application scenarios.
  • the following will describe the implementation process of the data downloading method according to the embodiment of the present application in conjunction with some application scenarios of the data downloading method according to the embodiment of the present application.
  • the terminal downloads high-definition video data by default and plays it, but when the quality of the terminal network download environment is poor It often leads to slow downloads and video freezes, which seriously affects the user's viewing experience and is not conducive to improving user stickiness.
  • the terminal detects the video playback instruction for the first time within a preset time period, the average download rate is obtained according to the data volume and download duration of the downloaded video data.
  • the video playback instruction may be input to the terminal by the user.
  • the time period may be, for example, one day or several hours, which is not specifically limited here.
  • the terminal After the terminal detects the video playback instruction for the first time within the preset time period, it needs to play the video data specified by the user, and the terminal downloads the video data with the default definition, and in the process of downloading the video data, according to The data volume and download duration of the downloaded video data get the average download rate.
  • the specific implementation manner in which the terminal obtains the average download rate according to the data amount and download duration of the downloaded video data refers to the above-mentioned embodiment, and details are not repeated here.
  • the terminal searches the preset mapping table for a target video bit rate matching the average download rate according to the average download rate, and the target video bit rate is used as the video bit rate used by the terminal to download the second video data.
  • the terminal downloads the second video data, for example, the user inputs the video playback instruction again, or when the terminal detects that the current video data is played and needs to automatically play the next video data, the terminal downloads the second video data from multiple downloads corresponding to the second video data.
  • the target download address corresponding to the target video bit rate is determined in the address, and the target video data (ie the second video data) having the target video bit rate is downloaded from the target download address.
  • the terminal continues to obtain the average download rate according to the data volume and the download duration of the downloaded video data in the second video data download process, and then searches the mapping table for corresponding The target video bit rate, so as to determine the download address for downloading the third video data with the target video bit rate, and so on. Therefore, it is realized that the video bit rate of the next video data, that is, the definition, is selected according to the average download rate of the previous video data, which can alleviate the situation that the video data is stuck and loaded slowly, so that the video of the terminal can be improved. Data display effect.
  • the interval between the download end time and the download start time of adjacent video data is less than a preset threshold, for example, the download end time of the first video data and the download start time of the second video data
  • the interval between times is less than the preset threshold
  • the interval between the download end time of the second video data and the download start time of the third video data is less than the preset threshold, etc., thus avoiding the time interval of adjacent video data If it is too large, the average download rate of the previous video data may be quite different from the actual network download environment quality of the terminal when the next adjacent video data is downloaded.
  • the terminal downloads high-definition live video data by default and plays it.
  • the quality of the terminal network download environment is not good, it often leads to slow download and live video cards.
  • the problem of pauses seriously affects the viewing experience of users and is not conducive to improving user stickiness.
  • the terminal detects the video playback instruction for the target live broadcast room for the first time within a preset time period, in the process of downloading the live video data, the average download is obtained according to the data volume and download duration of the downloaded live video data. rate, the video playback instruction may be input to the terminal by the user, and the preset time period may be, for example, several hours, etc., which is not specifically limited here.
  • the terminal After the terminal detects the video playback instruction for the first time within the preset time period, it needs to play the live video data specified by the user, and the terminal downloads the live video data with the default definition, and in the process of downloading the live video data. , and obtain the average download rate according to the data volume and download duration of the downloaded live video data.
  • the terminal obtains the average download rate according to the data amount and download duration of the downloaded live video data.
  • the terminal searches the preset mapping table for a target video bit rate matching the average download rate according to the average download rate, and the target video bit rate is used as the video bit rate corresponding to the terminal downloading the second live video data.
  • FIG. 6 is a schematic diagram of an interface corresponding to a switching operation between live broadcasts in one embodiment.
  • the terminal monitors the switching operation of the user switching between live broadcasts (for example, the user slides up the interface)
  • the terminal needs to download the second live video data and display it on the interface after sliding.
  • the terminal determines the target download address corresponding to the target video bit rate from the multiple download addresses corresponding to the second live video data, and downloads the target live video data with the target video bit rate from the target download address (that is, the second live video data).
  • the terminal continues to obtain the average download rate according to the data volume and download duration of the second downloaded live video data, and then searches the mapping table for the corresponding target video code. rate, so as to determine the download address for downloading the third live video data with the target video bit rate, and so on.
  • the video bit rate of the next live video data that is, the definition, can be selected according to the average download rate of the previous live video data, which can alleviate the situation that the playback of live video data is stuck and the loading is slow, so that the terminal can be improved.
  • the display effect of the live video data is not limited to obtain the average download rate according to the data volume and download duration of the second downloaded live video data, and then searches the mapping table for the corresponding target video code. rate, so as to determine the download address for downloading the third live video data with the target video bit rate, and so on.
  • the definition of the live video data will not change, and the next live video data will be changed according to the average download rate, which can avoid constantly switching the definition.
  • the problem of poor user viewing experience is caused, so that the user experience can be improved, which is beneficial to increase the daily activity of users.
  • the terminal uses the same video bit rate to preload each preloaded video data.
  • the quality of the terminal network download environment is poor, it is often Problems causing slow preloading.
  • the average download rate is obtained according to the data amount and download duration of the downloaded video data.
  • the terminal can use the default definition to load video data, and during the video data loading process, obtain the average download rate according to the data volume and download duration of the downloaded video data.
  • the specific implementation manner in which the terminal obtains the average download rate according to the data amount and download duration of the downloaded video data refers to the above-mentioned embodiment, and details are not repeated here.
  • the terminal searches the preset mapping table for a target video bit rate matching the average download rate according to the average download rate, and the target video bit rate is used as the video bit rate corresponding to the terminal loading the second video data.
  • the terminal may detect that the previous video data is loaded, and then determine the target download address corresponding to the target video bit rate from the multiple download addresses corresponding to the second video data, Download the target video data (ie, the second video data) with the target video bit rate from the target download address.
  • the terminal continues to obtain the average download rate according to the data volume and the download duration of the second downloaded video data, and then looks up the corresponding target video bit rate in the mapping table, Thereby, the download address for downloading the third video data with the target video bit rate is determined, and so on. Therefore, the video bit rate of the next video data to be loaded, that is, the definition, can be selected according to the average download rate of the last loaded video data, which can alleviate the problem of slow terminal preloading and improve terminal video preloading. speed.
  • the terminal uses the same picture resolution to download each picture.
  • the picture download is likely to be slow, and the user views the picture. Bad experience.
  • the average download rate is obtained according to the data amount and download duration of the downloaded picture data.
  • the terminal can download the picture data with the default definition (that is, the picture resolution), and in the process of downloading the picture data, the average download is obtained according to the data volume and the download time of the downloaded picture data. rate.
  • the specific manner in which the terminal acquires the average download rate according to the data amount and download duration of the downloaded picture data is similar to the manner in which the average download rate of the video data is acquired in the foregoing embodiment, and will not be repeated here.
  • the terminal searches the preset mapping table for a target picture resolution matching the average download rate according to the average download rate, and the target picture resolution is used as the picture resolution used by the terminal to download the second picture data.
  • the terminal detects the image loading operation again, determines the target download address corresponding to the resolution of the target image from the multiple download addresses corresponding to the second image data, and downloads the image from the target.
  • the address downloads the target picture data (ie the second picture data) with the target picture resolution.
  • the server will transcode it into pictures of different resolutions and store them under different download addresses. If the terminal requests the address of a picture data, the server will deliver multiple download addresses corresponding to the picture data, and deliver a mapping table including the correspondence between the download addresses and the resolutions of the pictures for the terminal to distinguish according to the target picture rate to find the corresponding target download address.
  • the terminal continues to obtain the average download rate according to the data amount and the download duration of the downloaded second picture data, and then looks up the corresponding target picture resolution in the mapping table, Thereby, the download address for downloading the third picture data with the target picture resolution is determined, and so on.
  • the image resolution of the next image data that needs to be loaded that is, the clarity
  • the average download rate of the last downloaded image data is selected according to the average download rate of the last downloaded image data, which can alleviate the problem of slow loading of terminal images, thereby improving the speed of image loading. , improve the user experience, and help increase the daily activity of users.
  • steps in the flowcharts of FIGS. 2-5 are shown in sequence according to the arrows, these steps are not necessarily executed in the sequence shown by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and these steps may be performed in other orders. Moreover, at least a part of the steps in FIGS. 2-5 may include multiple steps or multiple stages. These steps or stages are not necessarily executed and completed at the same time, but may be executed at different times. The execution of these steps or stages The order is also not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the steps or phases within the other steps.
  • a data downloading apparatus including:
  • the obtaining module 10 is used for obtaining the average download rate according to the data volume and the download duration of the downloaded multimedia data;
  • a search module 20 configured to search for a target data quality parameter matching the average download rate in a preset mapping table; the mapping table represents the corresponding relationship between the download rate and the data quality parameter, and the data quality parameter represents multimedia data clarity;
  • the download module 30 is configured to determine the target download address corresponding to the target data quality parameter from multiple download addresses, and download the corresponding target multimedia data based on the target download address; the multimedia data corresponding to each of the download addresses is clear different degrees.
  • FIG. 8 is a block diagram of a data downloading apparatus provided by another embodiment.
  • the acquisition module 10 includes:
  • the first obtaining unit 101 is configured to obtain download information corresponding to each time interval according to a preset time interval during the process of downloading the multimedia data, where the download information includes the download data amount and the download rate of the current time interval;
  • a determining unit 102 configured to determine at least one target download information from each of the download information according to the download data amount included in each of the download information
  • the second obtaining unit 103 is configured to obtain the average download rate based on the download rate included in each target download information.
  • the first obtaining unit 101 is specifically configured to obtain the first download data amount at the start time of each time interval and the second data volume at the end time of each time interval.
  • Download data volume ; take the difference between the second download data volume and the first download data volume as the download data volume of the time interval; download data volume according to each said time interval and the corresponding time interval time length, calculate the download rate corresponding to each of the time intervals.
  • the determining unit 102 is specifically configured to use a preset data volume window in order according to the acquisition time of each download information from early to late Traverse the download data volume included in each of the download information; each time you traverse the download data volume included in each download information, check whether the sum of the traversed download data volume exceeds the data volume window; if it exceeds, remove the traversed download data volume. At least one download information with the earliest acquisition time in the download data volume of the traversal is determined; the download information retained after the traversal is completed is determined as the target download information.
  • the second obtaining unit 103 is specifically configured to calculate the average value of the download rates included in each of the target download information to obtain the average download rate.
  • the multimedia data includes video data and/or picture data; in the case where the multimedia data includes video data, the data quality parameter includes video data bit rate, in the case that the multimedia data includes picture data, the data quality parameter includes picture resolution.
  • the obtaining module 10 is specifically configured to obtain data according to the data volume and download duration of the downloaded multimedia data when a preset trigger condition is satisfied. average download rate;
  • the trigger condition includes any of the following:
  • a video playback instruction is detected for the first time within a preset time period
  • the video playback instruction for the target live room is detected for the first time within the preset time period
  • Each module in the above-mentioned data downloading apparatus may be implemented in whole or in part by software, hardware and combinations thereof.
  • the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of the above modules.
  • a computer device is provided, and the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 9 .
  • the computer equipment includes a processor, memory, a communication interface, a display screen, and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, an internal memory.
  • the nonvolatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium.
  • the communication interface of the computer device is used for wired or wireless communication with an external terminal, and the wireless communication can be realized by WIFI, operator network, NFC (Near Field Communication) or other technologies.
  • the computer program when executed by the processor, implements a data downloading method.
  • the display screen of the computer equipment may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the computer equipment , or an external keyboard, trackpad, or mouse.
  • FIG. 9 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • a computer device including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
  • mapping table represents the corresponding relationship between the download rate and the data quality parameter
  • the data quality parameter represents the clarity of multimedia data
  • a target download address corresponding to the target data quality parameter is determined from a plurality of download addresses, and the corresponding target multimedia data is downloaded based on the target download address; the definition of multimedia data corresponding to each download address is different.
  • the processor further implements the following steps when executing the computer program:
  • the average download rate is obtained based on the download rate included in each of the target download information.
  • the processor further implements the following steps when executing the computer program:
  • the download rate corresponding to each of the time intervals is calculated according to the amount of downloaded data in each of the time intervals and the duration of the corresponding time interval.
  • the processor further implements the following steps when executing the computer program:
  • the download information retained after the traversal is completed is determined as the target download information.
  • the processor further implements the following steps when executing the computer program:
  • the average download rate included in each target download information is calculated to obtain the average download rate.
  • the multimedia data includes video data and/or picture data; in the case where the multimedia data includes video data, the data quality parameter includes a video bit rate, and when the multimedia data includes picture data In this case, the data quality parameter includes picture resolution.
  • the processor further implements the following steps when executing the computer program:
  • the trigger condition includes any of the following:
  • a video playback instruction is detected for the first time within a preset time period
  • the video playback instruction for the target live room is detected for the first time within the preset time period
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • mapping table represents the corresponding relationship between the download rate and the data quality parameter
  • the data quality parameter represents the clarity of multimedia data
  • a target download address corresponding to the target data quality parameter is determined from a plurality of download addresses, and the corresponding target multimedia data is downloaded based on the target download address; the definition of multimedia data corresponding to each download address is different.
  • the computer program further implements the following steps when executed by the processor:
  • the average download rate is obtained based on the download rate included in each of the target download information.
  • the computer program further implements the following steps when executed by the processor:
  • the download rate corresponding to each of the time intervals is calculated according to the amount of downloaded data in each of the time intervals and the duration of the corresponding time interval.
  • the computer program further implements the following steps when executed by the processor:
  • the download information retained after the traversal is completed is determined as the target download information.
  • the computer program further implements the following steps when executed by the processor:
  • the average download rate included in each target download information is calculated to obtain the average download rate.
  • the multimedia data includes video data and/or picture data; in the case where the multimedia data includes video data, the data quality parameter includes a video bit rate, and when the multimedia data includes picture data In this case, the data quality parameter includes picture resolution.
  • the computer program further implements the following steps when executed by the processor:
  • the trigger condition includes any of the following:
  • a video playback instruction is detected for the first time within a preset time period
  • the video playback instruction for the target live room is detected for the first time within the preset time period
  • Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, or optical memory, and the like.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • the RAM may be in various forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

A data download method and apparatus, a computer device and a computer-readable storage medium. Said method comprises: acquiring an average download rate according to the data amount and download duration of downloaded multimedia data; searching a preset mapping table for a target data quality parameter matching the average download rate, the mapping table representing a correlation between the download rate and the data quality parameter, and the data quality parameter representing the definition of the multimedia data; and determining a target download address corresponding to the target data quality parameter from multiple download addresses, and downloading corresponding target multimedia data on the basis of the target download address, the definition of the multimedia data corresponding to the download addresses being different. By means of the described solution, the display effect of the multimedia data of a terminal can be improved.

Description

数据下载方法、装置、计算机设备和计算机可读存储介质Data download method, apparatus, computer device, and computer-readable storage medium
本申请要求于2020年07月21日提交中国专利局、申请号为202010702886.X、发明名称为“数据下载方法、装置、计算机设备和计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on July 21, 2020, with the application number 202010702886.X and the invention titled "Data Download Method, Apparatus, Computer Equipment and Computer-readable Storage Medium", which The entire contents of this application are incorporated by reference.
技术领域technical field
本申请涉及互联网技术领域,特别是涉及一种数据下载方法、装置、计算机设备和计算机可读存储介质。The present application relates to the field of Internet technologies, and in particular, to a data downloading method, apparatus, computer equipment and computer-readable storage medium.
背景技术Background technique
随着互联网技术的快速发展,用户通过终端浏览视频以及图片在日常生活中越来越常见。With the rapid development of Internet technology, it is more and more common for users to browse videos and pictures through terminals in daily life.
目前,用户在观看视频数据、图片数据等多媒体数据的时候,终端一般都是默认下载高清的多媒体数据展示给用户。Currently, when a user watches multimedia data such as video data and picture data, the terminal generally downloads high-definition multimedia data by default and displays it to the user.
然而,在用户实际观看过程中,常常存在多媒体数据卡顿、加载缓慢的现象,严重影响终端的多媒体数据的展示效果。However, in the actual viewing process of the user, there are often phenomena that the multimedia data is stuck and the loading is slow, which seriously affects the display effect of the multimedia data of the terminal.
发明内容SUMMARY OF THE INVENTION
基于此,有必要针对上述技术问题,提供一种能够提升终端的多媒体数据的展示效果的数据下载方法、装置、计算机设备和计算机可读存储介质。Based on this, it is necessary to provide a data download method, apparatus, computer device and computer-readable storage medium that can improve the display effect of multimedia data of a terminal in view of the above technical problems.
第一方面,本申请实施例提供一种数据下载方法,所述方法包括:In a first aspect, an embodiment of the present application provides a method for downloading data, the method comprising:
根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;Obtain the average download rate according to the data volume and download duration of the downloaded multimedia data;
在预设的映射表中查找与所述平均下载速率匹配的目标数据质量参数;所述映射表表征下载速率和数据质量参数的对应关系,所述数据质量参数表示多媒体数据的清晰度;Searching for a target data quality parameter matching the average download rate in a preset mapping table; the mapping table represents the corresponding relationship between the download rate and the data quality parameter, and the data quality parameter represents the clarity of multimedia data;
从多个下载地址中确定所述目标数据质量参数对应的目标下载地址,并基于所述目标下载地址下载对应的目标多媒体数据;各所述下载地址对 应的多媒体数据的清晰度不同。Determine the target download address corresponding to the target data quality parameter from a plurality of download addresses, and download the corresponding target multimedia data based on the target download address; the definition of the multimedia data corresponding to each of the download addresses is different.
在其中一个实施例中,所述根据已下载的多媒体数据的数据量和下载时长获取平均下载速率,包括:In one embodiment, obtaining the average download rate according to the data volume and download duration of the downloaded multimedia data includes:
在下载所述多媒体数据的过程中,按照预设的时间间隔,获取各时间间隔对应的下载信息;所述下载信息包括当前时间间隔的下载数据量以及下载速率;In the process of downloading the multimedia data, the download information corresponding to each time interval is obtained according to the preset time interval; the download information includes the download data amount and the download rate of the current time interval;
根据各所述下载信息包括的下载数据量,从各所述下载信息中确定至少一个目标下载信息;determining at least one target download information from the download information according to the download data amount included in the download information;
基于各所述目标下载信息包括的下载速率获取所述平均下载速率。The average download rate is obtained based on the download rate included in each of the target download information.
在其中一个实施例中,所述在下载所述多媒体数据的过程中,按照预设的时间间隔,获取各时间间隔对应的下载信息,包括:In one embodiment, in the process of downloading the multimedia data, acquiring download information corresponding to each time interval according to a preset time interval, including:
获取各所述时间间隔的起始时刻的第一下载数据量和终止时刻的第二下载数据量;Obtain the first download data volume at the start time of each of the time intervals and the second download data volume at the end time;
将所述第二下载数据量和所述第一下载数据量之间的差值作为所述时间间隔的下载数据量;Taking the difference between the second download data amount and the first download data amount as the download data amount of the time interval;
根据各所述时间间隔的下载数据量和对应的时间间隔的时长,计算各所述时间间隔对应的下载速率。The download rate corresponding to each of the time intervals is calculated according to the amount of downloaded data in each of the time intervals and the duration of the corresponding time interval.
在其中一个实施例中,所述根据各所述下载信息包括的下载数据量,从各所述下载信息中确定至少一个目标下载信息,包括:In one of the embodiments, determining at least one target download information from each download information according to the download data amount included in each download information includes:
按照各所述下载信息的获取时间从早到晚的顺序,采用预设的数据量窗口依次遍历各所述下载信息包括的下载数据量;According to the order of the acquisition time of each download information from early to late, using a preset data volume window to sequentially traverse the download data volume included in each of the download information;
每遍历一个所述下载信息包括的下载数据量,则检测已遍历的下载数据量之和是否超出所述数据量窗口;Each time the download data amount included in the download information is traversed, it is detected whether the sum of the traversed download data amounts exceeds the data amount window;
若超出,则剔除已遍历的下载数据量中获取时间最早的至少一个下载信息;If it exceeds, at least one download information with the earliest acquisition time in the traversed download data volume is eliminated;
将遍历完成后保留的下载信息确定为所述目标下载信息。The download information retained after the traversal is completed is determined as the target download information.
在其中一个实施例中,所述基于各所述目标下载信息包括的下载速率获取所述平均下载速率,包括:In one embodiment, the obtaining the average download rate based on the download rate included in each of the target download information includes:
计算各所述目标下载信息包括的下载速率的平均值,得到所述平均下 载速率。The average download rate included in each of the target download information is calculated to obtain the average download rate.
在其中一个实施例中,所述多媒体数据包括视频数据和/或图片数据;在所述多媒体数据包括视频数据的情况下,所述数据质量参数包括视频码率,在所述多媒体数据包括图片数据的情况下,所述数据质量参数包括图片分辨率。In one embodiment, the multimedia data includes video data and/or picture data; in the case where the multimedia data includes video data, the data quality parameter includes a video bit rate, and when the multimedia data includes picture data In the case of , the data quality parameter includes the picture resolution.
在其中一个实施例中,所述根据已下载的多媒体数据的数据量和下载时长获取平均下载速率,包括:In one embodiment, obtaining the average download rate according to the data volume and download duration of the downloaded multimedia data includes:
在满足预设的触发条件的情况下,根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;Under the condition that the preset trigger condition is met, obtain the average download rate according to the data volume and download duration of the downloaded multimedia data;
其中,所述触发条件包括以下任一种:Wherein, the trigger condition includes any of the following:
在预设时间段内首次检测到视频播放指令;A video playback instruction is detected for the first time within a preset time period;
在预设时间段内首次检测到针对目标直播间的视频播放指令;The video playback instruction for the target live room is detected for the first time within the preset time period;
检测到视频预加载操作;Video preload operation detected;
检测到图片加载操作。Image load operation detected.
第二方面,本申请实施例提供一种数据下载装置,所述装置包括:In a second aspect, an embodiment of the present application provides a data downloading device, the device comprising:
获取模块,用于根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;an acquisition module, used to acquire the average download rate according to the data volume and download duration of the downloaded multimedia data;
查找模块,用于在预设的映射表中查找与所述平均下载速率匹配的目标数据质量参数;所述映射表表征下载速率和数据质量参数的对应关系,所述数据质量参数表示多媒体数据的清晰度;A search module is used to search for a target data quality parameter matching the average download rate in a preset mapping table; the mapping table represents the corresponding relationship between the download rate and the data quality parameter, and the data quality parameter represents the data quality of the multimedia data. clarity;
下载模块,用于从多个下载地址中确定所述目标数据质量参数对应的目标下载地址,并基于所述目标下载地址下载对应的目标多媒体数据;各所述下载地址对应的多媒体数据的清晰度不同。A download module, configured to determine a target download address corresponding to the target data quality parameter from multiple download addresses, and download the corresponding target multimedia data based on the target download address; the definition of the multimedia data corresponding to each of the download addresses different.
第三方面,本申请实施例提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面的方法的步骤。In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the method in the first aspect when the processor executes the computer program.
第四方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面的方法的步骤。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of the method in the first aspect.
本申请实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solutions provided in the embodiments of the present application include at least:
通过根据已下载的多媒体数据的数据量和下载时长获取平均下载速率,利用该平均下载速率近似表征终端当前的网络下载环境质量;然后,在表征下载速率和数据质量参数的对应关系的映射表中,查找与该平均下载速率匹配的目标数据质量参数,数据质量参数表示的是多媒体数据的清晰度;而后,从多个下载地址中确定目标数据质量参数对应的目标下载地址,各下载地址对应的多媒体数据的清晰度不同,也即,从多个下载地址中确定与终端当前的网络下载环境质量匹配的目标下载地址,并基于该目标下载地址下载对应的目标多媒体数据,即得到与终端当前的网络下载环境质量匹配的清晰度的目标多媒体数据,从而实现了根据已下载的多媒体数据的平均下载速率来选择将要下载的多媒体数据的清晰度。The average download rate is obtained according to the data volume and download duration of the downloaded multimedia data, and the average download rate is used to approximately characterize the current network download environment quality of the terminal; then, in the mapping table representing the correspondence between the download rate and the data quality parameters , find the target data quality parameter that matches the average download rate, and the data quality parameter represents the clarity of the multimedia data; then, determine the target download address corresponding to the target data quality parameter from multiple download addresses, and each download address corresponds to the target download address. The definition of multimedia data is different, that is, the target download address matching the current network download environment quality of the terminal is determined from multiple download addresses, and the corresponding target multimedia data is downloaded based on the target download address, that is, the current download address of the terminal is obtained. The network downloads the target multimedia data with the definition matching the environmental quality, so that the definition of the multimedia data to be downloaded is selected according to the average download rate of the downloaded multimedia data.
例如,在平均下载速率较低即终端当前的网络下载环境质量较差的情况下,通过选择与当前平均下载速率匹配的目标数据质量参数并确定与之匹配的目标下载地址,则可以下载清晰度较低的目标多媒体数据;而在平均下载速率较高即终端当前的网络下载环境质量较佳的情况下,同理,则可以下载清晰度较高的目标多媒体数据;这就避免了传统技术中,终端默认下载高清的多媒体数据展示给用户,在终端网络下载环境质量不佳的情况下仍然下载高清的多媒体数据容易导致多媒体数据播放卡顿、加载缓慢的问题。本申请实施例通过根据不同的平均下载速率选择与之匹配的目标下载地址来下载对应清晰度的目标多媒体数据,可以缓解多媒体数据的播放卡顿、加载缓慢的情况,从而可以提升终端的多媒体数据的展示效果。For example, in the case that the average download rate is low, that is, the current network download environment quality of the terminal is poor, by selecting the target data quality parameter matching the current average download rate and determining the matching target download address, the download clarity can be achieved. lower target multimedia data; and in the case where the average download rate is higher, that is, the current network download environment quality of the terminal is better, similarly, the target multimedia data with higher definition can be downloaded; this avoids the traditional technology. , the terminal downloads high-definition multimedia data by default and displays it to the user, and downloading high-definition multimedia data even when the quality of the terminal network download environment is not good may easily lead to the problems of slow playback and slow loading of the multimedia data. In this embodiment of the present application, by selecting a matching target download address according to different average download rates to download the target multimedia data of the corresponding definition, the situation that the playback of multimedia data is stuck and the loading is slow can be alleviated, so that the multimedia data of the terminal can be improved. display effect.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.
图1为一个实施例中数据下载方法的应用环境图;Fig. 1 is the application environment diagram of the data downloading method in one embodiment;
图2为一个实施例中数据下载方法的流程示意图;2 is a schematic flowchart of a data download method in one embodiment;
图3为一个实施例中步骤S100的细化步骤示意图;FIG. 3 is a schematic diagram of the refinement steps of step S100 in one embodiment;
图4为一个实施例中步骤S101的细化步骤示意图;FIG. 4 is a schematic diagram of the refinement steps of step S101 in one embodiment;
图5为一个实施例中步骤S102的细化步骤示意图;FIG. 5 is a schematic diagram of the refinement steps of step S102 in one embodiment;
图6为一个实施例中直播间切换操作对应的终端界面示意图;6 is a schematic diagram of a terminal interface corresponding to a switching operation between live broadcasts in one embodiment;
图7为一个实施例中数据下载装置的结构框图;7 is a structural block diagram of a data downloading apparatus in one embodiment;
图8为一个实施例中数据下载装置的结构框图;8 is a structural block diagram of a data downloading apparatus in one embodiment;
图9为一个实施例中计算机设备的内部结构图。Figure 9 is a diagram of the internal structure of a computer device in one embodiment.
具体实施方式detailed description
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
本申请提供的数据下载方法,可以应用于如图1所示的实施环境中。其中,终端102通过网络与服务器104进行通信。其中,终端102可以是个人计算机、笔记本电脑、媒体播放器、智能电视、智能手机、平板电脑和便携式可穿戴设备等,本申请实施例对终端102的类型也不作具体限定。服务器104可以是一台服务器,也可以是由多台服务器组成的服务器集群,服务器104可以是塔式服务器、机架服务器、刀片式服务器、高密度服务器、单路服务器、双路服务器或者多路服务器等,本申请实施例对服务器104的类型不作具体限定。The data downloading method provided in this application can be applied to the implementation environment as shown in FIG. 1 . The terminal 102 communicates with the server 104 through the network. The terminal 102 may be a personal computer, a notebook computer, a media player, a smart TV, a smart phone, a tablet computer, a portable wearable device, or the like, and the embodiment of the present application does not specifically limit the type of the terminal 102 . The server 104 may be a single server, or a server cluster composed of multiple servers, and the server 104 may be a tower server, a rack server, a blade server, a high-density server, a single-socket server, a dual-socket server, or a multi-socket server. Servers, etc., the embodiment of the present application does not specifically limit the type of the server 104 .
在一个实施例中,如图2所示,提供了一种数据下载方法,以该方法应用于图1中的终端为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2 , a data download method is provided, and the method is applied to the terminal in FIG. 1 as an example for description, including the following steps:
步骤S100,终端根据已下载的多媒体数据的数据量和下载时长获取平均下载速率。Step S100, the terminal obtains an average download rate according to the data volume and download duration of the downloaded multimedia data.
本申请实施例中,多媒体数据可以包括视频数据和/或图片数据,视频数据例如可以是剧集视频、直播视频、短视频等,图片数据则可以是各种格式的图片。In this embodiment of the present application, the multimedia data may include video data and/or picture data, and the video data may be, for example, drama videos, live videos, short videos, etc., and the picture data may be pictures in various formats.
在步骤S100一种可能的实施方式中,终端可以在多媒体数据下载完成 后,获取已下载的多媒体数据的总数据量以及下载该多媒体数据的总下载时长,然后采用该总数据量除以该总下载时长,则得到平均下载速率。In a possible implementation manner of step S100, after the multimedia data download is completed, the terminal may obtain the total data volume of the downloaded multimedia data and the total download duration for downloading the multimedia data, and then divide the total data volume by the total data volume. Download time, then get the average download rate.
在步骤S100另一种可能的实施方式中,终端还可以在多媒体数据的下载过程中,获取动态平均下载速率。例如,终端可以设定一个时间窗口,时间窗口的长度固定,时间窗口的长度在实施时可以自行设置;终端在多媒体数据的下载过程中可以定时移动时间窗口,如每秒移动一次,每移动一次时间窗口,终端则计算一次当前时间窗口内的下载数据量之和,然后采用当前时间窗口内的下载数据量之和除以该时间窗口的长度,则得到当前时间窗口内的动态平均下载速率。In another possible implementation manner of step S100, the terminal may also acquire a dynamic average download rate in the process of downloading the multimedia data. For example, the terminal can set a time window, the length of the time window is fixed, and the length of the time window can be set by itself during the implementation; the terminal can move the time window periodically during the downloading process of multimedia data, such as moving once per second, every time it moves time window, the terminal calculates the sum of the download data volume in the current time window once, and then divides the total download data volume in the current time window by the length of the time window to obtain the dynamic average download rate in the current time window.
在多媒体数据的下载过程中,终端计算的最后一个时间窗口对应的动态平均下载速率即为步骤S100中终端获取的平均下载速率。In the process of downloading multimedia data, the dynamic average download rate corresponding to the last time window calculated by the terminal is the average download rate obtained by the terminal in step S100.
在步骤S100另一种可能的实施方式中,终端获取动态平均下载速率的方式,还可以通过设置数据量窗口实现。数据量窗口对应的数据量固定,例如设置数据量窗口固定为900K,终端在多媒体数据的下载过程中,可以按照预设的时间间隔计算每个时间间隔的下载数据量和下载速率。终端每计算一次当前时间间隔的下载数据量和下载速率,则对应滑动数据量窗口一次,滑动后的数据量窗口内包括终端最新计算的数据;终端检测滑动后的数据量窗口内的下载数据量之和是否超过该数据量窗口对应的数据量(例如900K),若超过,终端则剔除在数据量窗口内时间最久的下载数据量,以保持数据量窗口内的下载数据量之和不超过900K;终端计算剔除后的数据量窗口内各下载速率的平均值,则得到该数据量窗口对应的动态平均下载速率。In another possible implementation manner of step S100, the way for the terminal to obtain the dynamic average download rate may also be implemented by setting a data amount window. The data volume corresponding to the data volume window is fixed. For example, the data volume window is set to be fixed at 900K. During the multimedia data download process, the terminal can calculate the download data volume and download rate at each time interval according to preset time intervals. Each time the terminal calculates the download data volume and download rate of the current time interval, it corresponds to sliding the data volume window once, and the sliding data volume window includes the latest calculated data of the terminal; the terminal detects the downloaded data volume in the sliding data volume window. Whether the sum exceeds the data volume corresponding to the data volume window (for example, 900K), if it exceeds, the terminal will remove the longest downloaded data volume in the data volume window, so as to keep the sum of the downloaded data volume in the data volume window not exceeding 900K; the terminal calculates the average value of each download rate in the excluded data volume window, and then obtains the dynamic average download rate corresponding to the data volume window.
在多媒体数据的下载过程中,终端计算的最后一个数据量窗口对应的动态平均下载速率即为步骤S100中终端获取的平均下载速率。In the process of downloading multimedia data, the dynamic average download rate corresponding to the last data volume window calculated by the terminal is the average download rate obtained by the terminal in step S100.
本实施例对终端根据已下载的多媒体数据的数据量和下载时长,获取平均下载速率的方式不做具体限制。This embodiment does not specifically limit the manner in which the terminal obtains the average download rate according to the data volume and download duration of the downloaded multimedia data.
本申请实施例中,已下载的多媒体数据可以是最近一次终端下载的多媒体数据,终端根据已下载的多媒体数据的数据量和下载时长获取平均下载速率,该平均下载速率是已下载的多媒体数据在下载过程中的下载速率 均值,可以用于近似表征终端当前的网络下载环境质量。在一种可能的实施方式中,该已下载的多媒体数据的下载结束时刻与当前时刻的时间差值可以小于预设阈值,时间差值越小,则终端获取的平均下载速率更接近于终端当前实际的网络下载环境质量。In this embodiment of the present application, the downloaded multimedia data may be the multimedia data downloaded by the terminal most recently, and the terminal obtains an average download rate according to the data volume and download duration of the downloaded multimedia data, and the average download rate is the average download rate of the downloaded multimedia data in The average download rate during the download process can be used to approximately characterize the current network download environment quality of the terminal. In a possible implementation manner, the time difference between the download end time and the current time of the downloaded multimedia data may be less than a preset threshold, and the smaller the time difference, the more the average download rate obtained by the terminal is closer to the current Actual network download environment quality.
步骤S200,终端在预设的映射表中查找与平均下载速率匹配的目标数据质量参数。Step S200, the terminal searches the preset mapping table for the target data quality parameter matching the average download rate.
本申请实施例中,终端中预设有映射表,该映射表表征下载速率和数据质量参数的对应关系,其中,数据质量参数表示多媒体数据的清晰度。作为一种实施方式,在多媒体数据包括视频数据的情况下,数据质量参数包括视频码率,在多媒体数据包括图片数据的情况下,数据质量参数包括图片分辨率。In the embodiment of the present application, a mapping table is preset in the terminal, and the mapping table represents the corresponding relationship between the download rate and the data quality parameter, wherein the data quality parameter represents the definition of multimedia data. As an embodiment, in the case that the multimedia data includes video data, the data quality parameter includes a video bit rate, and in the case that the multimedia data includes picture data, the data quality parameter includes the picture resolution.
在一种可能的实施方式中,映射表中可以包括各下载速率区间与数据质量参数的对应关系,例如,以多媒体数据是视频数据、数据质量参数为视频码率为例,映射表中则可以包括下载速率区间100k/s-500k/s对应的视频码率为500kbps、下载速率区间500k/s-1000k/s对应的视频码率为1000kbps、下载速率区间为大于1000k/s对应的视频码率为2000kbps。In a possible implementation manner, the mapping table may include the correspondence between each download rate interval and the data quality parameter. For example, taking the multimedia data as video data and the data quality parameter as the video bit rate as an example, the mapping table may Including the video bit rate corresponding to the download rate interval 100k/s-500k/s is 500kbps, the video bit rate corresponding to the download rate interval 500k/s-1000k/s is 1000kbps, and the video bit rate corresponding to the download rate interval greater than 1000k/s is 2000kbps.
终端在预设的映射表中查找与平均下载速率匹配的目标数据质量参数,可以是首先在映射表中查找与该平均下载速率匹配的下载速率区间,然后根据确定的下载速率区间,在映射表中查找与该下载速率区间对应的视频码率,则得到该目标数据质量参数。The terminal searches the preset mapping table for the target data quality parameter that matches the average download rate, and may first search the mapping table for the download rate interval that matches the average download rate, and then, according to the determined download rate interval, finds the target data quality parameter in the mapping table. Search for the video bit rate corresponding to the download rate interval in the download rate range, and then obtain the target data quality parameter.
需要说明的是,在其它实施例中,映射表表征下载速率和数据质量参数的对应关系的形式,也可以是不同的下载速率对应不同的数据质量参数,在此不做具体限制。It should be noted that, in other embodiments, the mapping table represents the form of the corresponding relationship between the download rate and the data quality parameter, and it may also be that different download rates correspond to different data quality parameters, which is not specifically limited here.
步骤S300,终端从多个下载地址中确定目标数据质量参数对应的目标下载地址,并基于目标下载地址下载对应的目标多媒体数据。Step S300, the terminal determines a target download address corresponding to the target data quality parameter from multiple download addresses, and downloads the corresponding target multimedia data based on the target download address.
本申请实施例中,各下载地址对应的多媒体数据的清晰度不同,例如,以多媒体数据是视频数据为例,视频数据A对应四个下载地址,分别用于下载清晰度为“省流”的视频数据A、清晰度为“高清”的视频数据A、清晰度为“超清”的视频数据A以清晰度为“蓝光”的视频数据A。In the embodiment of the present application, the definition of multimedia data corresponding to each download address is different. For example, taking the multimedia data as video data as an example, the video data A corresponds to four download addresses, which are respectively used for downloading files whose definition is "stream-saving". Video data A, video data A with a resolution of "HD", video data A with a resolution of "Ultra-Definition", and video data A with a resolution of "Blu-ray".
本申请实施例中,多个下载地址可以是终端在检测到用户进入多媒体软件后向服务器请求,再由服务器下发至终端的,多媒体软件例如直播软件、视频播放软件等。In this embodiment of the present application, the multiple download addresses may be requested by the terminal from the server after detecting that the user has entered multimedia software, such as multimedia software such as live broadcast software, video playback software, etc.
作为一种实施方式,服务器对于每个上传的多媒体数据,如视频数据,服务器会将其转码成多码率视频,存储在不同的下载地址下。若接收到终端请求多媒体数据的地址,服务器则会下发该多媒体数据对应的多个下载地址,并下发包括各下载地址和各数据质量参数的对应关系的映射对照表。As an implementation manner, for each uploaded multimedia data, such as video data, the server will transcode it into a multi-bit rate video and store it under different download addresses. If receiving the address of the terminal requesting multimedia data, the server will deliver multiple download addresses corresponding to the multimedia data, and deliver a mapping comparison table including the correspondence between each download address and each data quality parameter.
终端根据该映射对照表,即可查找目标数据质量参数对应的下载地址,则得到该目标下载地址。终端确定目标下载地址后,从该目标下载地址下载对应的目标多媒体数据,由此,得到的目标多媒体数据则为与平均下载速率匹配的清晰度的多媒体数据。The terminal can look up the download address corresponding to the target data quality parameter according to the mapping comparison table, and then obtain the target download address. After the terminal determines the target download address, the terminal downloads the corresponding target multimedia data from the target download address, and thus the obtained target multimedia data is multimedia data with a definition matching the average download rate.
例如,终端根据已下载的多媒体数据的数据量和下载时长获取平均下载速率,该平均下载速率较小,则表征终端当前的网络下载环境质量较差,终端则选择清晰度较低的目标多媒体数据下载,而若平均下载速率较大,则表征终端当前的网络下载环境质量较好,终端则选择清晰度较高的目标多媒体数据下载。For example, the terminal obtains the average download rate according to the data volume and download duration of the downloaded multimedia data. If the average download rate is small, it indicates that the current network download environment quality of the terminal is poor, and the terminal selects the target multimedia data with low definition. If the average download rate is high, it indicates that the current network download environment quality of the terminal is good, and the terminal selects the target multimedia data with high definition to download.
本实施例通过根据已下载的多媒体数据的数据量和下载时长获取平均下载速率,利用该平均下载速率表征终端当前的网络下载环境质量;然后,在表征下载速率和数据质量参数的对应关系的映射表中,查找与该平均下载速率匹配的目标数据质量参数,数据质量参数表示的是多媒体数据的清晰度;而后,从多个下载地址中确定目标数据质量参数对应的目标下载地址,各下载地址对应的多媒体数据的清晰度不同,也即,从多个下载地址中确定与终端当前的网络下载环境质量匹配的目标下载地址,并基于该目标下载地址下载对应的目标多媒体数据,即得到与终端当前的网络下载环境质量匹配的清晰度的目标多媒体数据,从而实现了根据已下载的多媒体数据的平均下载速率来选择将要下载的多媒体数据的清晰度。In this embodiment, the average download rate is obtained according to the data volume and download duration of the downloaded multimedia data, and the average download rate is used to characterize the current network download environment quality of the terminal; then, in the mapping representing the correspondence between the download rate and the data quality parameters In the table, find the target data quality parameter that matches the average download rate, and the data quality parameter represents the clarity of the multimedia data; then, determine the target download address corresponding to the target data quality parameter from multiple download addresses, and each download address The definition of the corresponding multimedia data is different, that is, the target download address that matches the current network download environment quality of the terminal is determined from the multiple download addresses, and the corresponding target multimedia data is downloaded based on the target download address, that is, the terminal is obtained. The current network downloads the target multimedia data with the resolution matching the quality of the environment, so that the resolution of the multimedia data to be downloaded can be selected according to the average download rate of the downloaded multimedia data.
例如,在平均下载速率较低即终端当前的网络下载环境质量较差的情况下,通过选择与当前平均下载速率匹配的目标数据质量参数并确定与之匹配的目标下载地址,则可以下载清晰度较低的目标多媒体数据;而在平 均下载速率较高即终端当前的网络下载环境质量较佳的情况下,同理,则可以下载清晰度较高的目标多媒体数据;这就避免了传统技术中,终端默认下载高清的多媒体数据展示给用户,在终端网络下载环境质量不佳的情况下仍然下载高清的多媒体数据容易导致多媒体数据播放卡顿、加载缓慢的问题。For example, in the case that the average download rate is low, that is, the current network download environment quality of the terminal is poor, by selecting the target data quality parameter matching the current average download rate and determining the matching target download address, the download clarity can be achieved. lower target multimedia data; and in the case where the average download rate is higher, that is, the current network download environment quality of the terminal is better, similarly, the target multimedia data with higher definition can be downloaded; this avoids the traditional technology. , the terminal downloads high-definition multimedia data by default and displays it to the user, and downloading high-definition multimedia data even when the quality of the terminal network download environment is not good may easily lead to the problems of slow playback and slow loading of the multimedia data.
本申请实施例通过根据不同的平均下载速率选择与之匹配的目标下载地址来下载对应清晰度的目标多媒体数据,可以缓解多媒体数据的播放卡顿、加载缓慢的情况,从而可以提升终端的多媒体数据的展示效果。In this embodiment of the present application, by selecting a matching target download address according to different average download rates to download the target multimedia data of the corresponding definition, the situation that the playback of multimedia data is stuck and the loading is slow can be alleviated, so that the multimedia data of the terminal can be improved. display effect.
在一个实施例中,基于上述图2所示的实施例,本实施例涉及的是终端如何根据已下载的多媒体数据的数据量和下载时长获取平均下载速率的过程。如图3所示,本实施例中,步骤S100包括S101、步骤S102和步骤S103:In one embodiment, based on the above-mentioned embodiment shown in FIG. 2 , this embodiment relates to the process of how the terminal obtains the average download rate according to the data amount and download duration of the downloaded multimedia data. As shown in FIG. 3, in this embodiment, step S100 includes S101, step S102 and step S103:
步骤S101,终端在下载多媒体数据的过程中,按照预设的时间间隔,获取各时间间隔对应的下载信息。Step S101: During the process of downloading the multimedia data, the terminal acquires download information corresponding to each time interval according to a preset time interval.
本申请实施例中,时间间隔可以是固定的,也可以是变化的,例如,可以是固定的1s为一个时间间隔,也可以设置时间间隔依次为5s、2s、1s、3s、5s等等,在此不做具体限制。In this embodiment of the present application, the time interval may be fixed or variable. For example, a fixed time interval of 1s may be used as a time interval, or the time interval may be set to be 5s, 2s, 1s, 3s, 5s, and so on. There is no specific restriction here.
在步骤S101一种可能的实施方式中,参见图4,终端可以通过执行如图4所示的步骤S1011、步骤S1012和步骤S1013,实现步骤S101的过程:In a possible implementation manner of step S101, referring to FIG. 4, the terminal may implement the process of step S101 by executing step S1011, step S1012 and step S1013 as shown in FIG. 4:
步骤S1011,终端获取各时间间隔的起始时刻的第一下载数据量和终止时刻的第二下载数据量。Step S1011, the terminal acquires the first download data volume at the start time of each time interval and the second download data volume at the end time.
对于每个时间间隔,终端可以检测该时间间隔的起始时刻的第一下载数据量和终止时刻的第二下载数据量。作为一种实施方式,由于在多媒体数据的下载过程中,各时间间隔连续,终端则可以在每个时间间隔的终止时刻采集一次下载数据量。For each time interval, the terminal may detect the first downloaded data amount at the start time of the time interval and the second downloaded data amount at the end time of the time interval. As an implementation manner, since in the process of downloading multimedia data, each time interval is continuous, the terminal may collect the amount of downloaded data once at the termination time of each time interval.
步骤S1012,终端将第二下载数据量和第一下载数据量之间的差值作为时间间隔的下载数据量。Step S1012, the terminal takes the difference between the second download data amount and the first download data amount as the download data amount of the time interval.
对于每个时间间隔,终端将该时间间隔对应的终止时刻的第二下载数据量减去该时间间隔的起始时刻的第一下载数据量,该第一下载数据量也 即是上一个时间间隔的终止时刻的下载数据量,由此,则得到该时间间隔对应的下载数据量。For each time interval, the terminal subtracts the first downloaded data volume at the start time of the time interval from the second downloaded data volume at the termination time corresponding to the time interval, and the first downloaded data volume is also the previous time interval The download data volume at the termination time of , thus, the download data volume corresponding to the time interval is obtained.
步骤S1013,终端根据各时间间隔的下载数据量和对应的时间间隔的时长,计算各时间间隔对应的下载速率。Step S1013, the terminal calculates the download rate corresponding to each time interval according to the download data amount of each time interval and the duration of the corresponding time interval.
终端采用该时间间隔的下载数据量除以该时间间隔的时长,得到该时间间隔对应的下载速率,例如,某个时间间隔对应的下载数据量为500k,且该时间间隔的时长为5s,则该时间间隔对应的下载速率为100k/s。The terminal divides the download data volume of the time interval by the duration of the time interval to obtain the download rate corresponding to the time interval. For example, if the download data volume corresponding to a certain time interval is 500k, and the duration of the time interval is 5s, then The download rate corresponding to this time interval is 100k/s.
由此,终端在下载多媒体数据的过程中,在每个时间间隔的终止时刻,获取一次当前时间间隔的下载信息。Therefore, in the process of downloading multimedia data, the terminal obtains the download information of the current time interval once at the termination time of each time interval.
步骤S102,终端根据各下载信息包括的下载数据量,从各下载信息中确定至少一个目标下载信息。Step S102, the terminal determines at least one target download information from the download information according to the download data amount included in the download information.
可以理解的是,在该已下载的多媒体数据的下载过程中,距离当前时刻越近的下载速率与当前时刻的实际下载速率越接近。终端在各时间间隔对应的下载信息中确定距离当前时刻最近的一个下载信息作为目标下载信息,或者,确定距离当前时刻最近的多个连续下载信息作为多个目标下载信息,由此,有利于基于该至少一个目标下载信息获取更接近于终端当前的实际网络下载环境质量的平均下载速率。It can be understood that, in the process of downloading the downloaded multimedia data, the download rate closer to the current moment is closer to the actual download rate at the current moment. In the download information corresponding to each time interval, the terminal determines the download information closest to the current moment as the target download information, or determines a plurality of continuous download information closest to the current moment as the target download information. The at least one target download information obtains an average download rate that is closer to the current actual network download environment quality of the terminal.
在一种可能的实施方式中,参见图5,终端可以通过执行如图5所示的步骤S1021、步骤S1022、步骤S1023和步骤S1024,实现步骤S102的过程:In a possible implementation manner, referring to FIG. 5 , the terminal may implement the process of step S102 by performing steps S1021 , S1022 , S1023 and S1024 as shown in FIG. 5 :
步骤S1021,终端按照各下载信息的获取时间从早到晚的顺序,采用预设的数据量窗口依次遍历各下载信息包括的下载数据量。Step S1021, the terminal sequentially traverses the download data volume included in each download information by using a preset data volume window in the order of the acquisition time of each download information from early to late.
数据量窗口对应的数据量固定,例如设置数据量窗口固定为900K,终端每计算一个时间间隔的下载信息,则滑动数据量窗口一次,滑动后的数据量窗口内包括终端最新计算的下载信息。The data volume corresponding to the data volume window is fixed. For example, if the data volume window is set to 900K, the terminal slides the data volume window once every time the terminal calculates the download information for a time interval. The sliding data volume window includes the latest download information calculated by the terminal.
例如,在多媒体数据的下载过程中,前5个时间间隔对应的下载信息依次为(500k,100k/s)、(400k,200k/s)、(300k,300k/s)、(600k,200k/s)、(500k,100k/s),在第一个时间间隔的下载信息(500k,100k/s)计算完后,终端则滑动数据量窗口一次,滑动后的数据量窗口内包括下载信息(500k,100k/s),在第二个时间间隔的下载信息(400k,200k/s)计算完后,终端 则再次滑动数据量窗口一次,滑动后的数据量窗口内则包括下载信息(500k,100k/s)和(400k,200k/s)。For example, in the process of downloading multimedia data, the download information corresponding to the first five time intervals is (500k, 100k/s), (400k, 200k/s), (300k, 300k/s), (600k, 200k/s) in sequence. s), (500k, 100k/s), after the download information (500k, 100k/s) of the first time interval is calculated, the terminal slides the data volume window once, and the sliding data volume window includes the download information ( 500k, 100k/s), after the download information (400k, 200k/s) of the second time interval is calculated, the terminal slides the data volume window once again, and the sliding data volume window includes the download information (500k, 100k/s) and (400k, 200k/s).
步骤S1022,终端每遍历一个下载信息包括的下载数据量,则检测已遍历的下载数据量之和是否超出数据量窗口。Step S1022, each time the terminal traverses the download data amount included in a piece of download information, it detects whether the sum of the traversed download data amounts exceeds the data amount window.
终端每滑动一次数据量窗口,则检测已遍历的下载数据量之和是否超出数据量窗口,即检测数据量窗口内包括的各下载信息的下载数据量之和是否超过数据量窗口对应的数据量,例如,检测数据量窗口内包括的各下载信息的下载数据量之和是否超过900k。Each time the terminal slides the data volume window, it detects whether the sum of the traversed downloaded data volume exceeds the data volume window, that is, detects whether the sum of the download data volume of each download information included in the data volume window exceeds the data volume corresponding to the data volume window. For example, it is detected whether the sum of the download data amount of each download information included in the data amount window exceeds 900k.
例如,在第二个时间间隔的下载信息(400k,200k/s)计算完后,终端则再次滑动数据量窗口一次,滑动后的数据量窗口内包括下载信息(500k,100k/s)和(400k,200k/s),下载数据量之和则为900k,未超过数据量窗口,但是,在第三个时间间隔的下载信息(300k,300k/s)计算结束后,终端再次滑动数据量窗口,则滑动后的数据量窗口内的下载数据量之和为500k+400k+300k=1200k,则超过设置的数据量窗口900k。For example, after the download information (400k, 200k/s) of the second time interval is calculated, the terminal slides the data volume window once again, and the sliding data volume window includes the download information (500k, 100k/s) and ( 400k, 200k/s), the sum of the downloaded data volume is 900k, which does not exceed the data volume window. However, after the calculation of the download information (300k, 300k/s) in the third time interval, the terminal slides the data volume window again. , the sum of the downloaded data volume in the sliding data volume window is 500k+400k+300k=1200k, which exceeds the set data volume window by 900k.
步骤S1023,若超出,终端则剔除已遍历的下载数据量中获取时间最早的至少一个下载信息。Step S1023, if it exceeds, the terminal removes at least one download information with the earliest acquisition time among the traversed download data volumes.
若检测到已遍历的下载数据量之和是否超出数据量窗口,终端则按照下载信息的获取时间从早到晚的顺序,依次剔除超出数据量窗口的一个或者多个下载信息,从而保持数据量窗口内各下载信息的下载数据量之和不超过900k。If it is detected whether the sum of the traversed downloaded data volume exceeds the data volume window, the terminal will sequentially remove one or more download information exceeding the data volume window in the order of the acquisition time of the download information from early to late, so as to maintain the data volume The sum of the download data of each download information in the window does not exceed 900k.
步骤S1024,终端将遍历完成后保留的下载信息确定为目标下载信息。Step S1024, the terminal determines the download information retained after the traversal is completed as the target download information.
终端将遍历完成后保留的下载信息确定为目标下载信息,例如,遍历完成后保留了最后一个下载信息,则确定该最后一个下载信息为目标下载信息,或者遍历完成后保留了最后两个下载信息,终端则确定该最后两个下载信息为两个目标下载信息。The terminal determines the download information retained after the traversal is completed as the target download information. For example, if the last download information is retained after the traversal is completed, the last download information is determined as the target download information, or the last two download information are retained after the traversal is completed. , the terminal determines that the last two download information are two target download information.
步骤S103,终端基于各目标下载信息包括的下载速率获取平均下载速率。Step S103, the terminal obtains an average download rate based on the download rate included in the download information of each target.
在一种可能的实施方式中,若遍历完成后数据量窗口内包括多个下载信息,即确定多个目标下载信息,终端则可以计算各目标下载信息包括的 下载速率的平均值,得到平均下载速率。In a possible implementation, if the data volume window includes multiple download information after the traversal is completed, that is, multiple target download information is determined, the terminal can calculate the average value of the download rates included in each target download information to obtain the average download information. rate.
在本申请其它实施例中,若遍历完成后数据量窗口内包括一个下载信息,即终端确定一个目标下载信息,则该目标下载信息包括的下载速率即为终端获取的平均下载速率,在此不做具体限制。In other embodiments of the present application, if the data volume window includes a piece of download information after the traversal is completed, that is, the terminal determines a target download information, the download rate included in the target download information is the average download rate obtained by the terminal. make specific restrictions.
本申请实施例中,数据量窗口终端可以通过创建数组的形式实现,从而实现对新的下载信息的采集和超出数据量窗口的旧的下载信息的丢弃。In the embodiment of the present application, the data volume window terminal can be implemented in the form of creating an array, so as to realize the collection of new download information and the discarding of old download information exceeding the data volume window.
本申请实施例通过预设的数据量窗口,在已下载的多媒体数据的下载过程中动态获取数据量窗口内的下载速率均值,并将最后一个数据量窗口内的下载速率均值确定为平均下载速率,由于最后一个数据量窗口对应的下载数据量的下载时刻与当前时刻最接近,因此基于最后一个数据量窗口获取的平均下载速率可以更加近似的表征终端的当前网络下载环境质量;且基于最后一个数据量窗口内各目标下载信息包括的下载速率获取平均下载速率,有利于避免单个下载速率突变造成的误差,从而可以提升平均下载速率的准确性,有利于基于该平均下载速率下载与终端当前的网络下载环境质量更为匹配的目标多媒体数据。In this embodiment of the present application, the average download rate in the data amount window is dynamically obtained during the downloading process of the downloaded multimedia data through a preset data amount window, and the average download rate in the last data amount window is determined as the average download rate , since the download time of the download data volume corresponding to the last data volume window is closest to the current time, the average download rate obtained based on the last data volume window can more approximately characterize the current network download environment quality of the terminal; and based on the last data volume window Obtaining the average download rate from the download rate included in the download information of each target in the data volume window is beneficial to avoid errors caused by a sudden change in a single download rate, thereby improving the accuracy of the average download rate, and is conducive to the download based on the average download rate and the current terminal's current rate. The network downloads the target multimedia data whose environmental quality is more matched.
在一个实施例中,在上述图2所示实施例的基础上,步骤S100可以包括步骤A:In one embodiment, on the basis of the above-mentioned embodiment shown in FIG. 2 , step S100 may include step A:
步骤A:在满足预设的触发条件的情况下,根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;Step A: Under the condition that the preset trigger condition is met, obtain the average download rate according to the data volume and download duration of the downloaded multimedia data;
其中,触发条件包括以下任一种:The trigger condition includes any of the following:
终端在预设时间段内首次检测到视频播放指令;The terminal detects the video playback instruction for the first time within the preset time period;
终端在预设时间段内首次检测到针对目标直播间的视频播放指令;The terminal detects the video playback instruction for the target live room for the first time within the preset time period;
终端检测到视频预加载操作;The terminal detects a video preloading operation;
终端检测到图片加载操作。The terminal detects an image loading operation.
本申请实施例中,不同的触发条件可以对应不同的应用场景。以下将结合本申请实施例数据下载方法的部分应用场景,对本申请实施例数据下载方法的实施过程进行说明。In the embodiments of the present application, different trigger conditions may correspond to different application scenarios. The following will describe the implementation process of the data downloading method according to the embodiment of the present application in conjunction with some application scenarios of the data downloading method according to the embodiment of the present application.
在一个实施例中,以视频播放场景为例,传统的视频播放,在用户没 有选择清晰度的情况下,终端都是默认下载高清视频数据并播放,而在终端网络下载环境质量不佳的情况下,常常导致下载缓慢、视频卡顿的问题,这严重影响了用户的观看体验,不利于提升用户粘性。In one embodiment, taking a video playback scenario as an example, in traditional video playback, when the user does not select a definition, the terminal downloads high-definition video data by default and plays it, but when the quality of the terminal network download environment is poor It often leads to slow downloads and video freezes, which seriously affects the user's viewing experience and is not conducive to improving user stickiness.
本实施例中,终端在预设时间段内首次检测到视频播放指令,则根据已下载的视频数据的数据量和下载时长获取平均下载速率,该视频播放指令可以是用户输入终端的,该预设时间段例如可以是一天或者几小时等,在此不做具体限制。In this embodiment, if the terminal detects the video playback instruction for the first time within a preset time period, the average download rate is obtained according to the data volume and download duration of the downloaded video data. The video playback instruction may be input to the terminal by the user. The time period may be, for example, one day or several hours, which is not specifically limited here.
终端在该预设时间段内第一次检测到视频播放指令后,则需要播放用户指定的视频数据,终端则采用默认的清晰度下载该视频数据,并在该视频数据的下载过程中,根据已下载的视频数据的数据量和下载时长获取平均下载速率。终端根据已下载的视频数据的数据量和下载时长获取平均下载速率的具体实施方式参见上述实施例,在此不再赘述。After the terminal detects the video playback instruction for the first time within the preset time period, it needs to play the video data specified by the user, and the terminal downloads the video data with the default definition, and in the process of downloading the video data, according to The data volume and download duration of the downloaded video data get the average download rate. The specific implementation manner in which the terminal obtains the average download rate according to the data amount and download duration of the downloaded video data refers to the above-mentioned embodiment, and details are not repeated here.
终端根据该平均下载速率在预设的映射表中查找与该平均下载速率匹配的目标视频码率,该目标视频码率即作为终端下载第二个视频数据时采用的视频码率。The terminal searches the preset mapping table for a target video bit rate matching the average download rate according to the average download rate, and the target video bit rate is used as the video bit rate used by the terminal to download the second video data.
终端在下载第二个视频数据时,例如,用户再次输入视频播放指令,或者终端监测到当前视频数据播放完毕需要自动播放下一个视频数据时,终端则从第二个视频数据对应的多个下载地址中确定该目标视频码率对应的目标下载地址,并从该目标下载地址中下载具有该目标视频码率的目标视频数据(即第二个视频数据)。When the terminal downloads the second video data, for example, the user inputs the video playback instruction again, or when the terminal detects that the current video data is played and needs to automatically play the next video data, the terminal downloads the second video data from multiple downloads corresponding to the second video data. The target download address corresponding to the target video bit rate is determined in the address, and the target video data (ie the second video data) having the target video bit rate is downloaded from the target download address.
进一步地,在终端下载第二个视频数据的过程中,终端继续根据第二个视频数据下载过程中已下载的视频数据的数据量和下载时长获取平均下载速率,然后在映射表中查找对应的目标视频码率,从而确定下载具有该目标视频码率的第三个视频数据的下载地址,以此类推。从而,实现了根据上一个视频数据的平均下载速率来选择下一个视频数据的视频码率,即清晰度,由此可以缓解视频数据的播放卡顿、加载缓慢的情况,从而可以提升终端的视频数据的展示效果。Further, in the process that the terminal downloads the second video data, the terminal continues to obtain the average download rate according to the data volume and the download duration of the downloaded video data in the second video data download process, and then searches the mapping table for corresponding The target video bit rate, so as to determine the download address for downloading the third video data with the target video bit rate, and so on. Therefore, it is realized that the video bit rate of the next video data, that is, the definition, is selected according to the average download rate of the previous video data, which can alleviate the situation that the video data is stuck and loaded slowly, so that the video of the terminal can be improved. Data display effect.
在一种可能的实施方式中,相邻视频数据的下载结束时间和下载开始时间之间的间隔小于预设阈值,例如,第一个视频数据的下载结束时间和 第二个视频数据的下载开始时间之间的间隔小于预设阈值,第二个视频数据的下载结束时间和第三个视频数据的下载开始时间之间的间隔小于预设阈值等,这样,避免了相邻视频数据的时间间隔太大,上一个视频数据的平均下载速率可能与下一个相邻的视频数据下载时终端的实际网络下载环境质量差异较大的情况。In a possible implementation manner, the interval between the download end time and the download start time of adjacent video data is less than a preset threshold, for example, the download end time of the first video data and the download start time of the second video data The interval between times is less than the preset threshold, the interval between the download end time of the second video data and the download start time of the third video data is less than the preset threshold, etc., thus avoiding the time interval of adjacent video data If it is too large, the average download rate of the previous video data may be quite different from the actual network download environment quality of the terminal when the next adjacent video data is downloaded.
在一个实施例中,以直播播放场景为例,传统的直播播放,终端都是默认下载高清的直播视频数据并播放,在终端网络下载环境质量不佳的环境下常常导致下载缓慢、直播视频卡顿的问题,严重影响用户的观看体验,不利于提升用户粘性。In one embodiment, taking a live broadcast scenario as an example, in traditional live broadcast, the terminal downloads high-definition live video data by default and plays it. In an environment where the quality of the terminal network download environment is not good, it often leads to slow download and live video cards. The problem of pauses seriously affects the viewing experience of users and is not conducive to improving user stickiness.
本实施例中,终端在预设时间段内首次检测到针对目标直播间的视频播放指令,则在直播视频数据的下载过程中,根据已下载的直播视频数据的数据量和下载时长获取平均下载速率,该视频播放指令可以是用户输入终端的,该预设时间段例如可以是几小时等,在此不做具体限制。In this embodiment, if the terminal detects the video playback instruction for the target live broadcast room for the first time within a preset time period, in the process of downloading the live video data, the average download is obtained according to the data volume and download duration of the downloaded live video data. rate, the video playback instruction may be input to the terminal by the user, and the preset time period may be, for example, several hours, etc., which is not specifically limited here.
终端在该预设时间段内第一次检测到视频播放指令后,需要播放用户指定的直播视频数据,终端则采用默认的清晰度下载该直播视频数据,并在该直播视频数据的下载过程中,根据已下载的直播视频数据的数据量和下载时长获取平均下载速率。终端根据已下载的直播视频数据的数据量和下载时长获取平均下载速率的具体实施方式参见上述实施例,在此不再赘述。After the terminal detects the video playback instruction for the first time within the preset time period, it needs to play the live video data specified by the user, and the terminal downloads the live video data with the default definition, and in the process of downloading the live video data. , and obtain the average download rate according to the data volume and download duration of the downloaded live video data. For the specific implementation manner in which the terminal obtains the average download rate according to the data amount and download duration of the downloaded live video data, refer to the foregoing embodiment, and details are not repeated here.
终端根据该平均下载速率在预设的映射表中查找与该平均下载速率匹配的目标视频码率,该目标视频码率即作为终端下载第二个直播视频数据所对应的视频码率。The terminal searches the preset mapping table for a target video bit rate matching the average download rate according to the average download rate, and the target video bit rate is used as the video bit rate corresponding to the terminal downloading the second live video data.
参见图6,图6为一个实施例中,直播间切换操作对应的界面示意图。终端监测到用户切换直播间的切换操作(例如用户向上滑动界面),终端则需要下载第二个直播视频数据并展示在滑动后的界面中。终端则从第二个直播视频数据对应的多个下载地址中确定该目标视频码率对应的目标下载地址,从该目标下载地址下载具有该目标视频码率的目标直播视频数据(即第二个直播视频数据)。Referring to FIG. 6, FIG. 6 is a schematic diagram of an interface corresponding to a switching operation between live broadcasts in one embodiment. When the terminal monitors the switching operation of the user switching between live broadcasts (for example, the user slides up the interface), the terminal needs to download the second live video data and display it on the interface after sliding. The terminal then determines the target download address corresponding to the target video bit rate from the multiple download addresses corresponding to the second live video data, and downloads the target live video data with the target video bit rate from the target download address (that is, the second live video data).
进一步地,在终端下载第二个直播视频数据的过程中,终端继续根据 已下载的第二个直播视频数据的数据量和下载时长获取平均下载速率,然后在映射表中查找对应的目标视频码率,从而确定下载具有该目标视频码率的第三个直播视频数据的下载地址,以此类推。从而实现了根据上一个直播视频数据的平均下载速率来选择下一个直播视频数据的视频码率,即清晰度,由此可以缓解直播视频数据的播放卡顿、加载缓慢的情况,从而可以提升终端的直播视频数据的展示效果。此外,本实施例中,用户在观看当前直播视频数据的过程中,直播视频数据的清晰度不会发生改变,而根据平均下载速率改变的是下一个直播视频数据,这样可以避免不断切换清晰度造成的用户观看体验差的问题,从而可以提升用户体验,有利于提升用户日活跃量。Further, in the process that the terminal downloads the second live video data, the terminal continues to obtain the average download rate according to the data volume and download duration of the second downloaded live video data, and then searches the mapping table for the corresponding target video code. rate, so as to determine the download address for downloading the third live video data with the target video bit rate, and so on. In this way, the video bit rate of the next live video data, that is, the definition, can be selected according to the average download rate of the previous live video data, which can alleviate the situation that the playback of live video data is stuck and the loading is slow, so that the terminal can be improved. The display effect of the live video data. In addition, in this embodiment, when the user is watching the current live video data, the definition of the live video data will not change, and the next live video data will be changed according to the average download rate, which can avoid constantly switching the definition. The problem of poor user viewing experience is caused, so that the user experience can be improved, which is beneficial to increase the daily activity of users.
在一个实施例中,以视频预加载场景为例,传统的视频预加载,终端对各个预加载的视频数据均采用相同的视频码率预加载,在终端网络下载环境质量不佳的环境下常常导致预加载缓慢的问题。In one embodiment, taking a video preloading scenario as an example, in traditional video preloading, the terminal uses the same video bit rate to preload each preloaded video data. In an environment where the quality of the terminal network download environment is poor, it is often Problems causing slow preloading.
本实施例中,终端检测到视频预加载操作,则在预加载过程中,根据已下载的视频数据的数据量和下载时长获取平均下载速率。终端在首次视频预加载的过程中,可以采用默认的清晰度加载视频数据,并在视频数据的加载过程中,根据已下载的视频数据的数据量和下载时长获取平均下载速率。终端根据已下载的视频数据的数据量和下载时长获取平均下载速率的具体实施方式参见上述实施例,在此不再赘述。In this embodiment, when the terminal detects a video preloading operation, in the preloading process, the average download rate is obtained according to the data amount and download duration of the downloaded video data. During the first video preloading process, the terminal can use the default definition to load video data, and during the video data loading process, obtain the average download rate according to the data volume and download duration of the downloaded video data. The specific implementation manner in which the terminal obtains the average download rate according to the data amount and download duration of the downloaded video data refers to the above-mentioned embodiment, and details are not repeated here.
终端根据该平均下载速率在预设的映射表中查找与该平均下载速率匹配的目标视频码率,该目标视频码率即作为终端加载第二个视频数据所对应的视频码率。终端在需要加载第二个视频数据时,例如可以是终端检测到上一个视频数据加载完毕,则从第二个视频数据对应的多个下载地址中确定该目标视频码率对应的目标下载地址,从该目标下载地址下载具有该目标视频码率的目标视频数据(即第二个视频数据)。The terminal searches the preset mapping table for a target video bit rate matching the average download rate according to the average download rate, and the target video bit rate is used as the video bit rate corresponding to the terminal loading the second video data. When the terminal needs to load the second video data, for example, the terminal may detect that the previous video data is loaded, and then determine the target download address corresponding to the target video bit rate from the multiple download addresses corresponding to the second video data, Download the target video data (ie, the second video data) with the target video bit rate from the target download address.
进一步地,在终端加载第二个视频数据的过程中,终端继续根据已下载的第二个视频数据的数据量和下载时长获取平均下载速率,然后在映射表中查找对应的目标视频码率,从而确定下载具有该目标视频码率的第三个视频数据的下载地址,以此类推。从而实现了根据上一个加载的视频数 据的平均下载速率来选择下一个需要加载的视频数据的视频码率,即清晰度,由此可以缓解终端预加载缓慢的问题,从而可以提升终端视频预加载的速度。Further, in the process that the terminal loads the second video data, the terminal continues to obtain the average download rate according to the data volume and the download duration of the second downloaded video data, and then looks up the corresponding target video bit rate in the mapping table, Thereby, the download address for downloading the third video data with the target video bit rate is determined, and so on. Therefore, the video bit rate of the next video data to be loaded, that is, the definition, can be selected according to the average download rate of the last loaded video data, which can alleviate the problem of slow terminal preloading and improve terminal video preloading. speed.
在一个实施例中,以图片加载场景为例,传统的图片加载,终端采用相同的图片分辨率下载各个图片,在终端网络下载环境质量不佳的环境下容易导致图片下载缓慢,用户观看图片的体验差的问题。In one embodiment, taking a picture loading scenario as an example, in the traditional picture loading, the terminal uses the same picture resolution to download each picture. In an environment where the quality of the terminal network download environment is not good, the picture download is likely to be slow, and the user views the picture. Bad experience.
本实施例中,终端检测到图片加载操作,则在图片下载过程中,根据已下载的图片数据的数据量和下载时长获取平均下载速率。终端在首次下载图片数据的过程中,可以采用默认的清晰度(即图片分辨率)下载图片数据,并在图片数据的下载过程中,根据已下载的图片数据的数据量和下载时长获取平均下载速率。终端根据已下载的图片数据的数据量和下载时长获取平均下载速率的具体方式,与上述实施例视频数据的平均下载速率的获取方式类似,在此不再赘述。In this embodiment, when the terminal detects a picture loading operation, in the picture downloading process, the average download rate is obtained according to the data amount and download duration of the downloaded picture data. In the process of downloading the picture data for the first time, the terminal can download the picture data with the default definition (that is, the picture resolution), and in the process of downloading the picture data, the average download is obtained according to the data volume and the download time of the downloaded picture data. rate. The specific manner in which the terminal acquires the average download rate according to the data amount and download duration of the downloaded picture data is similar to the manner in which the average download rate of the video data is acquired in the foregoing embodiment, and will not be repeated here.
终端根据该平均下载速率在预设的映射表中查找与该平均下载速率匹配的目标图片分辨率,该目标图片分辨率即作为终端下载第二个图片数据所采用的图片分辨率。终端在需要加载第二个图片数据时,例如终端再次检测到图片加载操作,则从第二个图片数据对应的多个下载地址中确定该目标图片分辨率对应的目标下载地址,从该目标下载地址下载具有该目标图片分辨率的目标图片数据(即第二个图片数据)。The terminal searches the preset mapping table for a target picture resolution matching the average download rate according to the average download rate, and the target picture resolution is used as the picture resolution used by the terminal to download the second picture data. When the terminal needs to load the second image data, for example, the terminal detects the image loading operation again, determines the target download address corresponding to the resolution of the target image from the multiple download addresses corresponding to the second image data, and downloads the image from the target. The address downloads the target picture data (ie the second picture data) with the target picture resolution.
作为一种实施方式,服务器对于每个上传的图片数据,服务器会将其转码成不同分辨率的图片,存储在不同的下载地址下。若终端请求一个图片数据的地址,服务器则会下发该图片数据对应的多个下载地址,并下发包括各下载地址和各图片分辨率的对应关系的映射对照表,供终端根据目标图片分辨率查找对应的目标下载地址。As an implementation manner, for each uploaded picture data, the server will transcode it into pictures of different resolutions and store them under different download addresses. If the terminal requests the address of a picture data, the server will deliver multiple download addresses corresponding to the picture data, and deliver a mapping table including the correspondence between the download addresses and the resolutions of the pictures for the terminal to distinguish according to the target picture rate to find the corresponding target download address.
进一步地,在终端加载第二个图片数据的过程中,终端继续根据已下载的第二个图片数据的数据量和下载时长获取平均下载速率,然后在映射表中查找对应的目标图片分辨率,从而确定下载具有该目标图片分辨率的第三个图片数据的下载地址,以此类推。从而实现了根据上一个下载的图片数据的平均下载速率来选择下一个需要加载的图片数据的图片分辨率, 即清晰度,由此可以缓解终端图片加载缓慢的问题,从而可以提升图片加载的速度,提升用户体验,有利于提升用户日活跃量。Further, in the process of loading the second picture data by the terminal, the terminal continues to obtain the average download rate according to the data amount and the download duration of the downloaded second picture data, and then looks up the corresponding target picture resolution in the mapping table, Thereby, the download address for downloading the third picture data with the target picture resolution is determined, and so on. Thus, the image resolution of the next image data that needs to be loaded, that is, the clarity, is selected according to the average download rate of the last downloaded image data, which can alleviate the problem of slow loading of terminal images, thereby improving the speed of image loading. , improve the user experience, and help increase the daily activity of users.
应该理解的是,虽然图2-5的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-5中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flowcharts of FIGS. 2-5 are shown in sequence according to the arrows, these steps are not necessarily executed in the sequence shown by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and these steps may be performed in other orders. Moreover, at least a part of the steps in FIGS. 2-5 may include multiple steps or multiple stages. These steps or stages are not necessarily executed and completed at the same time, but may be executed at different times. The execution of these steps or stages The order is also not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the steps or phases within the other steps.
在一个实施例中,如图7所示,提供了一种数据下载装置,包括:In one embodiment, as shown in FIG. 7, a data downloading apparatus is provided, including:
获取模块10,用于根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;The obtaining module 10 is used for obtaining the average download rate according to the data volume and the download duration of the downloaded multimedia data;
查找模块20,用于在预设的映射表中查找与所述平均下载速率匹配的目标数据质量参数;所述映射表表征下载速率和数据质量参数的对应关系,所述数据质量参数表示多媒体数据的清晰度;A search module 20, configured to search for a target data quality parameter matching the average download rate in a preset mapping table; the mapping table represents the corresponding relationship between the download rate and the data quality parameter, and the data quality parameter represents multimedia data clarity;
下载模块30,用于从多个下载地址中确定所述目标数据质量参数对应的目标下载地址,并基于所述目标下载地址下载对应的目标多媒体数据;各所述下载地址对应的多媒体数据的清晰度不同。The download module 30 is configured to determine the target download address corresponding to the target data quality parameter from multiple download addresses, and download the corresponding target multimedia data based on the target download address; the multimedia data corresponding to each of the download addresses is clear different degrees.
在一个实施例中,在上述图7所示实施例的基础上,参见图8,图8为另一个实施例提供的数据下载装置的框图。如图8所示,获取模块10包括:In one embodiment, on the basis of the embodiment shown in FIG. 7 above, referring to FIG. 8 , FIG. 8 is a block diagram of a data downloading apparatus provided by another embodiment. As shown in Figure 8, the acquisition module 10 includes:
第一获取单元101,用于在下载所述多媒体数据的过程中,按照预设的时间间隔,获取各时间间隔对应的下载信息,所述下载信息包括当前时间间隔的下载数据量以及下载速率;The first obtaining unit 101 is configured to obtain download information corresponding to each time interval according to a preset time interval during the process of downloading the multimedia data, where the download information includes the download data amount and the download rate of the current time interval;
确定单元102,用于根据各所述下载信息包括的下载数据量,从各所述下载信息中确定至少一个目标下载信息;a determining unit 102, configured to determine at least one target download information from each of the download information according to the download data amount included in each of the download information;
第二获取单元103,用于基于各所述目标下载信息包括的下载速率获取所述平均下载速率。The second obtaining unit 103 is configured to obtain the average download rate based on the download rate included in each target download information.
在一个实施例中,在上述图8所示实施例的基础上,所述第一获取单元101具体用于获取各所述时间间隔的起始时刻的第一下载数据量和终止时刻的第二下载数据量;将所述第二下载数据量和所述第一下载数据量之间的差值作为所述时间间隔的下载数据量;根据各所述时间间隔的下载数据量和对应的时间间隔的时长,计算各所述时间间隔对应的下载速率。In one embodiment, on the basis of the above-mentioned embodiment shown in FIG. 8 , the first obtaining unit 101 is specifically configured to obtain the first download data amount at the start time of each time interval and the second data volume at the end time of each time interval. Download data volume; take the difference between the second download data volume and the first download data volume as the download data volume of the time interval; download data volume according to each said time interval and the corresponding time interval time length, calculate the download rate corresponding to each of the time intervals.
在一个实施例中,在上述图8所示实施例的基础上,所述确定单元102具体用于按照各所述下载信息的获取时间从早到晚的顺序,采用预设的数据量窗口依次遍历各所述下载信息包括的下载数据量;每遍历一个所述下载信息包括的下载数据量,则检测已遍历的下载数据量之和是否超出所述数据量窗口;若超出,则剔除已遍历的下载数据量中获取时间最早的至少一个下载信息;将遍历完成后保留的下载信息确定为所述目标下载信息。In one embodiment, on the basis of the above-mentioned embodiment shown in FIG. 8 , the determining unit 102 is specifically configured to use a preset data volume window in order according to the acquisition time of each download information from early to late Traverse the download data volume included in each of the download information; each time you traverse the download data volume included in each download information, check whether the sum of the traversed download data volume exceeds the data volume window; if it exceeds, remove the traversed download data volume. At least one download information with the earliest acquisition time in the download data volume of the traversal is determined; the download information retained after the traversal is completed is determined as the target download information.
在一个实施例中,在上述图8所示实施例的基础上,所述第二获取单元103具体用于计算各所述目标下载信息包括的下载速率的平均值,得到所述平均下载速率。In an embodiment, on the basis of the embodiment shown in FIG. 8 above, the second obtaining unit 103 is specifically configured to calculate the average value of the download rates included in each of the target download information to obtain the average download rate.
在一个实施例中,在上述图7所示实施例的基础上,所述多媒体数据包括视频数据和/或图片数据;在所述多媒体数据包括视频数据的情况下,所述数据质量参数包括视频码率,在所述多媒体数据包括图片数据的情况下,所述数据质量参数包括图片分辨率。In one embodiment, on the basis of the above-mentioned embodiment shown in FIG. 7 , the multimedia data includes video data and/or picture data; in the case where the multimedia data includes video data, the data quality parameter includes video data bit rate, in the case that the multimedia data includes picture data, the data quality parameter includes picture resolution.
在一个实施例中,在上述图7所示实施例的基础上,所述获取模块10具体用于在满足预设的触发条件的情况下,根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;In one embodiment, on the basis of the above-mentioned embodiment shown in FIG. 7 , the obtaining module 10 is specifically configured to obtain data according to the data volume and download duration of the downloaded multimedia data when a preset trigger condition is satisfied. average download rate;
其中,所述触发条件包括以下任一种:Wherein, the trigger condition includes any of the following:
在预设时间段内首次检测到视频播放指令;A video playback instruction is detected for the first time within a preset time period;
在预设时间段内首次检测到针对目标直播间的视频播放指令;The video playback instruction for the target live room is detected for the first time within the preset time period;
检测到视频预加载操作;Video preload operation detected;
检测到图片加载操作。Image load operation detected.
关于数据下载装置的具体限定可以参见上文中对于数据下载方法的限定,在此不再赘述。上述数据下载装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算 机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the data downloading apparatus, please refer to the limitation on the data downloading method above, which will not be repeated here. Each module in the above-mentioned data downloading apparatus may be implemented in whole or in part by software, hardware and combinations thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of the above modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图9所示。该计算机设备包括通过系统总线连接的处理器、存储器、通信接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、运营商网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种数据下载方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided, and the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 9 . The computer equipment includes a processor, memory, a communication interface, a display screen, and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium, an internal memory. The nonvolatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for wired or wireless communication with an external terminal, and the wireless communication can be realized by WIFI, operator network, NFC (Near Field Communication) or other technologies. The computer program, when executed by the processor, implements a data downloading method. The display screen of the computer equipment may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the computer equipment , or an external keyboard, trackpad, or mouse.
本领域技术人员可以理解,图9中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 9 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment, a computer device is provided, including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;Obtain the average download rate according to the data volume and download duration of the downloaded multimedia data;
在预设的映射表中查找与所述平均下载速率匹配的目标数据质量参数;所述映射表表征下载速率和数据质量参数的对应关系,所述数据质量参数表示多媒体数据的清晰度;Searching for a target data quality parameter matching the average download rate in a preset mapping table; the mapping table represents the corresponding relationship between the download rate and the data quality parameter, and the data quality parameter represents the clarity of multimedia data;
从多个下载地址中确定所述目标数据质量参数对应的目标下载地址,并基于所述目标下载地址下载对应的目标多媒体数据;各所述下载地址对应的多媒体数据的清晰度不同。A target download address corresponding to the target data quality parameter is determined from a plurality of download addresses, and the corresponding target multimedia data is downloaded based on the target download address; the definition of multimedia data corresponding to each download address is different.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the processor further implements the following steps when executing the computer program:
在下载所述多媒体数据的过程中,按照预设的时间间隔,获取各时间间隔对应的下载信息,所述下载信息包括当前时间间隔的下载数据量以及下载速率;In the process of downloading the multimedia data, according to a preset time interval, obtain download information corresponding to each time interval, where the download information includes the download data amount and the download rate of the current time interval;
根据各所述下载信息包括的下载数据量,从各所述下载信息中确定至少一个目标下载信息;determining at least one target download information from the download information according to the download data amount included in the download information;
基于各所述目标下载信息包括的下载速率获取所述平均下载速率。The average download rate is obtained based on the download rate included in each of the target download information.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the processor further implements the following steps when executing the computer program:
获取各所述时间间隔的起始时刻的第一下载数据量和终止时刻的第二下载数据量;Obtain the first download data volume at the start time of each of the time intervals and the second download data volume at the end time;
将所述第二下载数据量和所述第一下载数据量之间的差值作为所述时间间隔的下载数据量;Taking the difference between the second download data amount and the first download data amount as the download data amount of the time interval;
根据各所述时间间隔的下载数据量和对应的时间间隔的时长,计算各所述时间间隔对应的下载速率。The download rate corresponding to each of the time intervals is calculated according to the amount of downloaded data in each of the time intervals and the duration of the corresponding time interval.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the processor further implements the following steps when executing the computer program:
按照各所述下载信息的获取时间从早到晚的顺序,采用预设的数据量窗口依次遍历各所述下载信息包括的下载数据量;According to the order of the acquisition time of each download information from early to late, using a preset data volume window to sequentially traverse the download data volume included in each of the download information;
每遍历一个所述下载信息包括的下载数据量,则检测已遍历的下载数据量之和是否超出所述数据量窗口;Each time the download data amount included in the download information is traversed, it is detected whether the sum of the traversed download data amounts exceeds the data amount window;
若超出,则剔除已遍历的下载数据量中获取时间最早的至少一个下载信息;If it exceeds, at least one download information with the earliest acquisition time in the traversed download data volume is eliminated;
将遍历完成后保留的下载信息确定为所述目标下载信息。The download information retained after the traversal is completed is determined as the target download information.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the processor further implements the following steps when executing the computer program:
计算各所述目标下载信息包括的下载速率的平均值,得到所述平均下载速率。The average download rate included in each target download information is calculated to obtain the average download rate.
在一个实施例中,所述多媒体数据包括视频数据和/或图片数据;在所述多媒体数据包括视频数据的情况下,所述数据质量参数包括视频码率,在所述多媒体数据包括图片数据的情况下,所述数据质量参数包括图片分辨率。In one embodiment, the multimedia data includes video data and/or picture data; in the case where the multimedia data includes video data, the data quality parameter includes a video bit rate, and when the multimedia data includes picture data In this case, the data quality parameter includes picture resolution.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the processor further implements the following steps when executing the computer program:
在满足预设的触发条件的情况下,根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;Under the condition that the preset trigger condition is met, obtain the average download rate according to the data volume and download duration of the downloaded multimedia data;
其中,所述触发条件包括以下任一种:Wherein, the trigger condition includes any of the following:
在预设时间段内首次检测到视频播放指令;A video playback instruction is detected for the first time within a preset time period;
在预设时间段内首次检测到针对目标直播间的视频播放指令;The video playback instruction for the target live room is detected for the first time within the preset time period;
检测到视频预加载操作;Video preload operation detected;
检测到图片加载操作。Image load operation detected.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;Obtain the average download rate according to the data volume and download duration of the downloaded multimedia data;
在预设的映射表中查找与所述平均下载速率匹配的目标数据质量参数;所述映射表表征下载速率和数据质量参数的对应关系,所述数据质量参数表示多媒体数据的清晰度;Searching for a target data quality parameter matching the average download rate in a preset mapping table; the mapping table represents the corresponding relationship between the download rate and the data quality parameter, and the data quality parameter represents the clarity of multimedia data;
从多个下载地址中确定所述目标数据质量参数对应的目标下载地址,并基于所述目标下载地址下载对应的目标多媒体数据;各所述下载地址对应的多媒体数据的清晰度不同。A target download address corresponding to the target data quality parameter is determined from a plurality of download addresses, and the corresponding target multimedia data is downloaded based on the target download address; the definition of multimedia data corresponding to each download address is different.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, the computer program further implements the following steps when executed by the processor:
在下载所述多媒体数据的过程中,按照预设的时间间隔,获取各时间间隔对应的下载信息,所述下载信息包括当前时间间隔的下载数据量以及下载速率;In the process of downloading the multimedia data, according to a preset time interval, obtain download information corresponding to each time interval, where the download information includes the download data amount and the download rate of the current time interval;
根据各所述下载信息包括的下载数据量,从各所述下载信息中确定至少一个目标下载信息;determining at least one target download information from the download information according to the download data amount included in the download information;
基于各所述目标下载信息包括的下载速率获取所述平均下载速率。The average download rate is obtained based on the download rate included in each of the target download information.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, the computer program further implements the following steps when executed by the processor:
获取各所述时间间隔的起始时刻的第一下载数据量和终止时刻的第二下载数据量;Obtain the first download data volume at the start time of each of the time intervals and the second download data volume at the end time;
将所述第二下载数据量和所述第一下载数据量之间的差值作为所述时间间隔的下载数据量;Taking the difference between the second download data amount and the first download data amount as the download data amount of the time interval;
根据各所述时间间隔的下载数据量和对应的时间间隔的时长,计算各所述时间间隔对应的下载速率。The download rate corresponding to each of the time intervals is calculated according to the amount of downloaded data in each of the time intervals and the duration of the corresponding time interval.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, the computer program further implements the following steps when executed by the processor:
按照各所述下载信息的获取时间从早到晚的顺序,采用预设的数据量窗口依次遍历各所述下载信息包括的下载数据量;According to the order of the acquisition time of each download information from early to late, using a preset data volume window to sequentially traverse the download data volume included in each of the download information;
每遍历一个所述下载信息包括的下载数据量,则检测已遍历的下载数据量之和是否超出所述数据量窗口;Each time the download data amount included in the download information is traversed, it is detected whether the sum of the traversed download data amounts exceeds the data amount window;
若超出,则剔除已遍历的下载数据量中获取时间最早的至少一个下载信息;If it exceeds, at least one download information with the earliest acquisition time in the traversed download data volume is eliminated;
将遍历完成后保留的下载信息确定为所述目标下载信息。The download information retained after the traversal is completed is determined as the target download information.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, the computer program further implements the following steps when executed by the processor:
计算各所述目标下载信息包括的下载速率的平均值,得到所述平均下载速率。The average download rate included in each target download information is calculated to obtain the average download rate.
在一个实施例中,所述多媒体数据包括视频数据和/或图片数据;在所述多媒体数据包括视频数据的情况下,所述数据质量参数包括视频码率,在所述多媒体数据包括图片数据的情况下,所述数据质量参数包括图片分辨率。In one embodiment, the multimedia data includes video data and/or picture data; in the case where the multimedia data includes video data, the data quality parameter includes a video bit rate, and when the multimedia data includes picture data In this case, the data quality parameter includes picture resolution.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:In one embodiment, the computer program further implements the following steps when executed by the processor:
在满足预设的触发条件的情况下,根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;Under the condition that the preset trigger condition is met, obtain the average download rate according to the data volume and download duration of the downloaded multimedia data;
其中,所述触发条件包括以下任一种:Wherein, the trigger condition includes any of the following:
在预设时间段内首次检测到视频播放指令;A video playback instruction is detected for the first time within a preset time period;
在预设时间段内首次检测到针对目标直播间的视频播放指令;The video playback instruction for the target live room is detected for the first time within the preset time period;
检测到视频预加载操作;Video preload operation detected;
检测到图片加载操作。Image load operation detected.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中 所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage In the medium, when the computer program is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other media used in the various embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, or optical memory, and the like. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, the RAM may be in various forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features It is considered to be the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present application, and the descriptions thereof are specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.

Claims (10)

  1. 一种数据下载方法,其特征在于,所述方法包括:A data downloading method, characterized in that the method comprises:
    根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;Obtain the average download rate according to the data volume and download duration of the downloaded multimedia data;
    在预设的映射表中查找与所述平均下载速率匹配的目标数据质量参数;所述映射表表征下载速率和数据质量参数的对应关系,所述数据质量参数表示多媒体数据的清晰度;Searching for a target data quality parameter matching the average download rate in a preset mapping table; the mapping table represents the corresponding relationship between the download rate and the data quality parameter, and the data quality parameter represents the clarity of multimedia data;
    从多个下载地址中确定所述目标数据质量参数对应的目标下载地址,并基于所述目标下载地址下载对应的目标多媒体数据;各所述下载地址对应的多媒体数据的清晰度不同。A target download address corresponding to the target data quality parameter is determined from a plurality of download addresses, and the corresponding target multimedia data is downloaded based on the target download address; the definition of multimedia data corresponding to each download address is different.
  2. 根据权利要求1所述的方法,其特征在于,所述根据已下载的多媒体数据的数据量和下载时长获取平均下载速率,包括:The method according to claim 1, wherein the obtaining an average download rate according to the data volume and download duration of the downloaded multimedia data, comprising:
    在下载所述多媒体数据的过程中,按照预设的时间间隔,获取各时间间隔对应的下载信息;所述下载信息包括当前时间间隔的下载数据量以及下载速率;In the process of downloading the multimedia data, the download information corresponding to each time interval is obtained according to the preset time interval; the download information includes the download data amount and the download rate of the current time interval;
    根据各所述下载信息包括的下载数据量,从各所述下载信息中确定至少一个目标下载信息;determining at least one target download information from the download information according to the download data amount included in the download information;
    基于各所述目标下载信息包括的下载速率获取所述平均下载速率。The average download rate is obtained based on the download rate included in each of the target download information.
  3. 根据权利要求2所述的方法,其特征在于,所述在下载所述多媒体数据的过程中,按照预设的时间间隔,获取各时间间隔对应的下载信息,包括:The method according to claim 2, wherein, in the process of downloading the multimedia data, acquiring download information corresponding to each time interval according to a preset time interval, comprising:
    获取各所述时间间隔的起始时刻的第一下载数据量和终止时刻的第二下载数据量;Obtain the first download data volume at the start time of each of the time intervals and the second download data volume at the end time;
    将所述第二下载数据量和所述第一下载数据量之间的差值作为所述时间间隔的下载数据量;Taking the difference between the second download data amount and the first download data amount as the download data amount of the time interval;
    根据各所述时间间隔的下载数据量和对应的时间间隔的时长,计算各所述时间间隔对应的下载速率。The download rate corresponding to each of the time intervals is calculated according to the amount of downloaded data in each of the time intervals and the duration of the corresponding time interval.
  4. 根据权利要求2所述的方法,其特征在于,所述根据各所述下载信息包括的下载数据量,从各所述下载信息中确定至少一个目标下载信息,包括:The method according to claim 2, wherein the determining at least one target download information from the download information according to the download data amount included in the download information comprises:
    按照各所述下载信息的获取时间从早到晚的顺序,采用预设的数据量窗口依次遍历各所述下载信息包括的下载数据量;According to the order of the acquisition time of each download information from early to late, using a preset data volume window to sequentially traverse the download data volume included in each of the download information;
    每遍历一个所述下载信息包括的下载数据量,则检测已遍历的下载数据量之和是否超出所述数据量窗口;Each time the download data amount included in the download information is traversed, it is detected whether the sum of the traversed download data amounts exceeds the data amount window;
    若超出,则剔除已遍历的下载数据量中获取时间最早的至少一个下载信息;If it exceeds, at least one download information with the earliest acquisition time in the traversed download data volume is eliminated;
    将遍历完成后保留的下载信息确定为所述目标下载信息。The download information retained after the traversal is completed is determined as the target download information.
  5. 根据权利要求2所述的方法,其特征在于,所述基于各所述目标下载信息包括的下载速率获取所述平均下载速率,包括:The method according to claim 2, wherein the obtaining the average download rate based on the download rate included in each of the target download information comprises:
    计算各所述目标下载信息包括的下载速率的平均值,得到所述平均下载速率。The average download rate included in each target download information is calculated to obtain the average download rate.
  6. 根据权利要求1所述的方法,其特征在于,所述多媒体数据包括视频数据和/或图片数据;在所述多媒体数据包括视频数据的情况下,所述数据质量参数包括视频码率,在所述多媒体数据包括图片数据的情况下,所述数据质量参数包括图片分辨率。The method according to claim 1, wherein the multimedia data includes video data and/or picture data; in the case that the multimedia data includes video data, the data quality parameter includes a video bit rate, and in the In the case where the multimedia data includes picture data, the data quality parameter includes picture resolution.
  7. 根据权利要求1所述的方法,其特征在于,所述根据已下载的多媒体数据的数据量和下载时长获取平均下载速率,包括:The method according to claim 1, wherein the obtaining an average download rate according to the data volume and download duration of the downloaded multimedia data, comprising:
    在满足预设的触发条件的情况下,根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;Under the condition that the preset trigger condition is met, obtain the average download rate according to the data volume and download duration of the downloaded multimedia data;
    其中,所述触发条件包括以下任一种:Wherein, the trigger condition includes any of the following:
    在预设时间段内首次检测到视频播放指令;A video playback instruction is detected for the first time within a preset time period;
    在预设时间段内首次检测到针对目标直播间的视频播放指令;The video playback instruction for the target live room is detected for the first time within the preset time period;
    检测到视频预加载操作;Video preload operation detected;
    检测到图片加载操作。Image load operation detected.
  8. 一种数据下载装置,其特征在于,所述装置包括:A data downloading device, characterized in that the device comprises:
    获取模块,用于根据已下载的多媒体数据的数据量和下载时长获取平均下载速率;an acquisition module, used to acquire the average download rate according to the data volume and download duration of the downloaded multimedia data;
    查找模块,用于在预设的映射表中查找与所述平均下载速率匹配的目标数据质量参数;所述映射表表征下载速率和数据质量参数的对应关系, 所述数据质量参数表示多媒体数据的清晰度;a search module, configured to search for a target data quality parameter matching the average download rate in a preset mapping table; the mapping table represents the corresponding relationship between the download rate and the data quality parameter, and the data quality parameter represents the data quality of the multimedia data. clarity;
    下载模块,用于从多个下载地址中确定所述目标数据质量参数对应的目标下载地址,并基于所述目标下载地址下载对应的目标多媒体数据;各所述下载地址对应的多媒体数据的清晰度不同。A download module, configured to determine a target download address corresponding to the target data quality parameter from a plurality of download addresses, and download the corresponding target multimedia data based on the target download address; the definition of the multimedia data corresponding to each of the download addresses different.
  9. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至7中任一项所述的方法的步骤。A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when the processor executes the computer program.
  10. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的方法的步骤。A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
PCT/CN2021/082915 2020-07-21 2021-03-25 Data download method and apparatus, computer device and computer-readable storage medium WO2022016896A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010702886.XA CN111859218A (en) 2020-07-21 2020-07-21 Data downloading method and device, computer equipment and computer readable storage medium
CN202010702886.X 2020-07-21

Publications (1)

Publication Number Publication Date
WO2022016896A1 true WO2022016896A1 (en) 2022-01-27

Family

ID=73002191

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/082915 WO2022016896A1 (en) 2020-07-21 2021-03-25 Data download method and apparatus, computer device and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN111859218A (en)
WO (1) WO2022016896A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002216A (en) * 2022-04-27 2022-09-02 北京奇艺世纪科技有限公司 Downloading method, downloading device, terminal equipment and readable storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111859218A (en) * 2020-07-21 2020-10-30 广州华多网络科技有限公司 Data downloading method and device, computer equipment and computer readable storage medium
CN112383638B (en) * 2020-11-27 2023-12-05 北京小米移动软件有限公司 Fragment downloading method, device and medium
CN114189715A (en) * 2021-12-07 2022-03-15 北京奇艺世纪科技有限公司 Download address switching method and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103716719A (en) * 2013-12-02 2014-04-09 乐视网信息技术(北京)股份有限公司 Multimedia file downloading method and user terminal
CN105721340A (en) * 2014-12-05 2016-06-29 北大方正集团有限公司 Method and device for calculating online reading preloading amount
CN109729385A (en) * 2018-12-25 2019-05-07 广州市百果园信息技术有限公司 Method for downloading video, device, computer equipment, storage medium and terminal
CN111859218A (en) * 2020-07-21 2020-10-30 广州华多网络科技有限公司 Data downloading method and device, computer equipment and computer readable storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8396983B1 (en) * 2012-03-13 2013-03-12 Google Inc. Predictive adaptive media streaming
CN105490886A (en) * 2015-12-31 2016-04-13 北京金山安全软件有限公司 Method and device for testing network speed and electronic equipment
CN109040801B (en) * 2018-07-19 2019-07-09 北京达佳互联信息技术有限公司 Media code rate by utilizing adaptive approach, device, computer equipment and storage medium
CN109040855B (en) * 2018-09-03 2021-01-29 重庆邮电大学 Wireless DASH streaming media code rate smooth self-adaptive transmission method
CN110087141A (en) * 2019-04-29 2019-08-02 北京金山云网络技术有限公司 Method of transmitting video data, device, client and server
CN111417000B (en) * 2020-03-27 2022-04-22 北京奇艺世纪科技有限公司 Method, device, electronic equipment and medium for switching video code rate

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103716719A (en) * 2013-12-02 2014-04-09 乐视网信息技术(北京)股份有限公司 Multimedia file downloading method and user terminal
CN105721340A (en) * 2014-12-05 2016-06-29 北大方正集团有限公司 Method and device for calculating online reading preloading amount
CN109729385A (en) * 2018-12-25 2019-05-07 广州市百果园信息技术有限公司 Method for downloading video, device, computer equipment, storage medium and terminal
CN111859218A (en) * 2020-07-21 2020-10-30 广州华多网络科技有限公司 Data downloading method and device, computer equipment and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002216A (en) * 2022-04-27 2022-09-02 北京奇艺世纪科技有限公司 Downloading method, downloading device, terminal equipment and readable storage medium
CN115002216B (en) * 2022-04-27 2024-02-23 北京奇艺世纪科技有限公司 Downloading method, downloading device, terminal equipment and readable storage medium

Also Published As

Publication number Publication date
CN111859218A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
WO2022016896A1 (en) Data download method and apparatus, computer device and computer-readable storage medium
US11303970B2 (en) Systems and methods for internet video delivery
US20070223878A1 (en) Image displaying method and video playback apparatus
US8959145B2 (en) System and method for preloading content segments to client devices in an electronic network
US9160960B2 (en) Video preview based browsing user interface
US7251790B1 (en) Media browsing system displaying thumbnails images based on preferences of plurality of users and placing the thumbnails images at a scene change
US9674253B2 (en) Method for allocating a specific portion of multimedia file and skipping the specific portion automatically and electronic device thereof
US20160261930A1 (en) Video-providing method and video-providing system
US20120321281A1 (en) Systems and Methods for Recording Content within Digital Video
US9552361B2 (en) Method and system for prefetching music for devices
US10515476B2 (en) Image fetching for timeline scrubbing of digital media
CN112672186B (en) Video preloading method and device
JP2021506196A (en) Video processing methods, devices, terminals and media
US20140188791A1 (en) System and Method for Selectively Routing Cached Objects
WO2005059694A2 (en) Method and apparatus for buffering streaming media
JP6120781B2 (en) Scene-based variable compression
US9959322B1 (en) Ranking channels in search
CN114257861B (en) Video processing method, device, storage medium and equipment
US10003834B1 (en) Enhanced trick mode to enable presentation of information related to content being streamed
WO2023207513A1 (en) Video processing method and apparatus, and electronic device
US9501482B2 (en) Download queue as part of user interface library view for on-demand content systems and methods
EP3142115B1 (en) Information device and distribution device
CN113766325B (en) Video playing method and device, electronic equipment and storage medium
US11032347B2 (en) Bandwidth usage reduction employing media treading with reductive edging
WO2018000628A1 (en) Playback control method, device, and electronic apparatus

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21845943

Country of ref document: EP

Kind code of ref document: A1