CN113395549A - Play resource downloading method, device, equipment, storage medium and program product - Google Patents

Play resource downloading method, device, equipment, storage medium and program product Download PDF

Info

Publication number
CN113395549A
CN113395549A CN202110710762.0A CN202110710762A CN113395549A CN 113395549 A CN113395549 A CN 113395549A CN 202110710762 A CN202110710762 A CN 202110710762A CN 113395549 A CN113395549 A CN 113395549A
Authority
CN
China
Prior art keywords
playing
resource
time
downloading
resources
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110710762.0A
Other languages
Chinese (zh)
Other versions
CN113395549B (en
Inventor
饶少艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110710762.0A priority Critical patent/CN113395549B/en
Publication of CN113395549A publication Critical patent/CN113395549A/en
Application granted granted Critical
Publication of CN113395549B publication Critical patent/CN113395549B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/438Interfacing the downstream path of the transmission network originating from a server, e.g. retrieving encoded video stream packets from an IP network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/475End-user interface for inputting end-user data, e.g. personal identification number [PIN], preference data
    • H04N21/4758End-user interface for inputting end-user data, e.g. personal identification number [PIN], preference data for providing answers, e.g. voting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4781Games

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Information Transfer Between Computers (AREA)
  • Indexing, Searching, Synchronizing, And The Amount Of Synchronization Travel Of Record Carriers (AREA)

Abstract

The present disclosure discloses a method, an apparatus, a device, a storage medium and a program product for downloading a playing resource, which relate to the technical field of data processing, in particular to the technical field of video playing. The specific implementation scheme is as follows: acquiring the resource amount and the loading time of each playing resource; predicting the downloading duration of each playing resource according to the resource amount and the network speed of each playing resource; determining the initial downloading time of each playing resource before the loading time of each playing resource according to the downloading time of each playing resource; and in the video playing process, downloading each playing resource after the initial downloading time of each playing resource is reached. By applying the scheme provided by the embodiment of the disclosure to download the playing resources, the timeliness of video playing can be improved.

Description

Play resource downloading method, device, equipment, storage medium and program product
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to the field of video playback technologies.
Background
In the video playing process, in order to enhance interactivity, users can be guided to participate in games, answer questions and the like, and in order to enhance playing interestingness, background pictures, background music and the like can be replaced. Therefore, in the process of playing the video, playing resources such as games, titles, background pictures, background music and the like need to be downloaded.
In the prior art, when playing a video, all playing resources required in the whole video playing process are generally downloaded before starting the video playing.
Disclosure of Invention
The present disclosure provides a method, apparatus, device, storage medium, and program product for playback resource downloading.
According to an aspect of the present disclosure, there is provided a play resource downloading method, the method including:
acquiring the resource amount and the loading time of each playing resource;
predicting the downloading duration of each playing resource according to the resource amount and the network speed of each playing resource;
determining the initial downloading time of each playing resource before the loading time of each playing resource according to the downloading time of each playing resource;
and in the video playing process, downloading each playing resource after the initial downloading time of each playing resource is reached.
According to another aspect of the present disclosure, there is provided a playback resource downloading apparatus, the apparatus including:
the information acquisition module is used for acquiring the resource amount and the loading time of each playing resource;
the time length prediction module is used for predicting the downloading time length of each playing resource according to the resource amount and the network speed of each playing resource;
the time determining module is used for determining the initial downloading time of each playing resource before the loading time of each playing resource according to the downloading time of each playing resource;
and the resource downloading module is used for downloading each playing resource after the initial downloading time of each playing resource is reached in the video playing process.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a playout resource download method.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to execute the method for downloading according to the above-described playback resource.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the above-described playout resource download method.
As can be seen from the above, the downloading of the playing resources by applying the scheme provided by the embodiment of the present disclosure is to download each playing resource in the video playing process, that is, to perform video playing and download the playing resources at the same time.
In addition, in the scheme provided by the embodiment of the disclosure, each playing resource is downloaded, and specifically, in the video playing process, the playing resources are started after the starting downloading time of each playing resource is reached. And the initial downloading time is positioned before the loading time of the playing resource and is determined according to the downloading time of the playing resource. The downloading duration represents the duration required for downloading the playing resources at the current network speed, so that the playing resources are downloaded from the initial downloading time, the playing resources can be effectively guaranteed to be downloaded to the local when the loading time is reached, the playing resources downloaded to the local can be directly loaded at the loading time, the situation of waiting for the downloading of the playing resources in the video playing process is reduced, and the timeliness of video playing is further improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic flowchart of a method for downloading a playback resource according to an embodiment of the present disclosure;
fig. 2a is a schematic diagram of a download duration provided by an embodiment of the present disclosure;
FIG. 2b is a timing diagram according to an embodiment of the disclosure;
FIG. 2c is another timing diagram provided by an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another method for downloading a playback resource according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a playback resource downloading apparatus according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In order to solve the technical problem that timeliness of video playing is poor due to the fact that all playing resources are downloaded before video playing starts in the prior art, embodiments of the present disclosure provide a playing resource downloading method, device, apparatus, storage medium, and program product.
In an embodiment of the present disclosure, a method for downloading a playback resource is provided, where the method includes:
acquiring the resource amount and the loading time of each playing resource;
predicting the downloading duration of each playing resource according to the resource amount and the network speed of each playing resource;
determining the initial downloading time of each playing resource before the loading time of each playing resource according to the downloading time of each playing resource;
and in the video playing process, downloading each playing resource after the initial downloading time of each playing resource is reached.
As can be seen from the above, the downloading of the playing resources by applying the scheme provided by the embodiment of the present disclosure is to download each playing resource in the video playing process, that is, to perform video playing and download the playing resources at the same time.
In addition, in the scheme provided by the embodiment of the disclosure, each playing resource is downloaded, and specifically, in the video playing process, the playing resources are started after the starting downloading time of each playing resource is reached. And the initial downloading time is positioned before the loading time of the playing resource and is determined according to the downloading time of the playing resource. The downloading duration represents the duration required for downloading the playing resources at the current network speed, so that the playing resources are downloaded from the initial downloading time, the playing resources can be effectively guaranteed to be downloaded to the local when the loading time is reached, the playing resources downloaded to the local can be directly loaded at the loading time, the situation of waiting for the downloading of the playing resources in the video playing process is reduced, and the timeliness of video playing is further improved.
Several concepts involved in embodiments of the present disclosure are described below.
The "video playing process" mentioned in the embodiments of the present disclosure may be: the process of playing the video, in which interaction with the user is required, in the playing process may also be a process of playing the video, in which the auxiliary information needs to be updated in the playing process. Wherein the auxiliary information is: information that assists in completing the playing of the video, such as the title of the video, background pictures, background music, etc.
In view of the above, resources such as resources interacting with the user, titles of videos, background pictures, background music, and the like need to be loaded during the video playing process. In the embodiments of the present disclosure, the above resources are referred to as play resources.
In an embodiment of the present disclosure, the video playing process may be divided into a process of playing a live video and a process of playing a recorded video. Thus, the video playing modes can be considered as including: a live mode and a recorded mode.
Next, an application scenario of the scheme provided by the embodiment of the present disclosure is described.
The scheme provided by the embodiment of the disclosure is applied to video playing scenes, such as a course video playing scene, a shopping video playing scene and the like.
In a video playing scene, a client acquires data related to video playing from a server and displays a playing video to a user according to the acquired data. In the video playing process, the client needs to load various different playing resources.
As can be known from the foregoing, different modes can exist for video playing, and the mode of video playing can be a recording mode or a live mode. In the recording and playing mode, the video played in the video playing process is a pre-recorded video, which is also called a recorded video. In the live mode, the video played in the video playing process is a video recorded in real time, which is also called live video.
In the video playing process, besides playing the video, various resources can be displayed or played for the user, and the resources are playing resources. The playing resources comprise interactive resources and non-interactive resources. The interactive resources are resources for guiding users to participate in playing interaction, and the interactive resources can enhance playing interaction and improve the frequency of the users participating in playing interaction. For example, the interactive resources may include: interactive game resources, interactive question and answer resources, interactive virtual cartoon character resources and the like. Corresponding to the interactive resources, the non-interactive resources cannot guide the user to participate in the playing interaction, but the non-interactive resources can be used for enhancing the playing interest and attracting the user to watch the playing. For example, non-interactive resources may include: background pictures, background music, video titles, etc.
The following description is directed to specific application scenarios.
Course video playing scene
Suppose that the playback resources include: interactive game resources, background pictures, and background music.
The first condition is as follows: the video playing mode is as follows: and (5) recording and broadcasting mode.
In this case, the played video is a pre-recorded curriculum video, the curriculum content played at each time in the playing process is determined, and the curriculum content determines the loading time of each playing resource, so the loading time of each playing resource is predetermined, and the predetermined loading time is the actual loading time of the playing resource.
In the video playing process, after the loading time of each playing resource is reached, the playing resources are started to be loaded. Therefore, in the recording and playing mode, the trigger conditions for loading the playing resources are as follows: and the loading time of the preset playing resources is reached in the video playing process.
For example, the loading time of the interactive game resource is T1, the loading time of the background picture is T2, and the loading time of the background music is T3. In the course of playing the curriculum video, after the playing time reaches the time T1, loading and displaying the interactive game resources; after the playing time reaches the time T2, loading and displaying a background picture; when the playing time reaches the time T3, the background music is loaded and played.
Case two: the video playing mode is as follows: and (4) a live mode.
In this case, the played video is a curriculum video recorded in real time, although a teacher may teach the curriculum content according to a teaching plan prepared in advance in the playing process, the played resource required to be loaded cannot be played at a preset time due to factors such as randomness of the expression mode of the teacher, and may be played in advance or wrong, even if the played resource is played in advance, a possible loading time needs to be preset for each played resource to provide a time reference for downloading of the played resource. The loading time is not the time at which the playing resource is actually loaded, and the loading time can be used as a downloading reference time for determining the initial downloading time of the playing resource.
In view of the above situation, in the live broadcast mode, the teacher may control the actual loading time of the play resource, and after obtaining the play resource loading instruction of the teacher, the server forwards the play resource loading instruction of the teacher to the client, so that the client starts the play resource loading. Therefore, in the live mode, the trigger conditions for loading the play resources are as follows: a play resource load instruction is obtained.
For example, loading times T4, T5, and T6 are respectively configured in advance for the interactive game resources, the background pictures, and the background music, where T4, T5, and T6 are used to determine starting downloading times of the interactive game resources, the background pictures, and the background music. In the video playing process, if a play resource loading instruction of a teacher for interactive game resources, background pictures and background music is not received, the play resource loading is not started even if the playing time reaches T4, T5 and T6, and the loading is started after the loading instruction of the teacher for the play resource is received.
Second, shopping video playing scene
The video playing mode in the shopping video playing scene is generally a live broadcasting mode, and it is assumed that the playing resources include: interactive game resources, commodity pictures, background music.
In this case, the played video is a shopping video recorded in real time, and although the shopping guide introduces each commodity according to a commodity introduction flow prepared in advance in the playing process, the shopping guide may answer questions of customers and the like in the product introduction process, the playing resources that need to be loaded cannot be played at a preset time, and may be advanced or wrong, even if so, a possible loading time needs to be preset for each playing resource to provide a time reference for downloading the playing resources. The loading time is not the time at which the playing resource is actually loaded, and the loading time can be used as a downloading reference time for determining the initial downloading time of the playing resource.
In view of the above situation, in the live broadcast mode, the actual loading time of the broadcast resource may be controlled by the shopping guide, and after the broadcast server obtains the shopping-guided broadcast resource loading instruction, the broadcast server forwards the shopping-guided broadcast resource loading instruction to the client, so that the client starts the broadcast resource loading. It can also be seen from this scenario that, in the live mode, the trigger condition for loading the play resource is: a play resource load instruction is obtained.
For example, loading times T7, T8, and T9 are respectively configured in advance for the interactive game resources, the commodity pictures, and the background music, where T7, T8, and T9 are used to determine starting downloading times of the interactive game resources, the commodity pictures, and the background music. In the video playing process, if a playing resource loading instruction of a shopping guide for interactive game resources, commodity pictures and background music is not received, even if the playing time reaches T7, T8 and T9, the playing resource loading is not started, and the loading is started after the loading instruction of the shopping guide for the playing resources is received.
The execution body of the embodiment of the present disclosure will be described below.
The execution subject of the embodiment of the present disclosure is a client. The client can operate in electronic equipment capable of being networked, such as a smart phone, a tablet computer, a computer, vehicle-mounted intelligent equipment and the like.
The following describes a play resource downloading method provided by an embodiment of the present disclosure in detail.
Referring to fig. 1, fig. 1 is a schematic flowchart of a method for downloading a playback resource according to an embodiment of the present disclosure, where the method includes the following steps S101 to S104.
Step S101: and acquiring the resource quantity and the loading time of each playing resource.
The loading time of the playing resources indicates that: in the video playing process, the actual loading time or the possible loading time of the playing resource is aimed at.
In the video playing process, the client needs to download the playing resources to the local, and after the loading time is reached, the client loads the playing resources downloaded to the local, so that the displaying or playing of the playing resources is realized.
The playing server stores data related to the played video, so that the client and the playing server perform data interaction in the video playing process to obtain the data related to the played video. Based on this, the video playing server may store configuration information of the played video, where the configuration information includes: the resource amount and the loading time of each playing resource which needs to be loaded in the video playing process.
In view of the above, in one implementation, the client may obtain the resource amount and the loading time of all the playing resources from the configuration information stored in the playing server before the video playing starts.
Specifically, the client may pull the configuration information stored in the playing server, analyze the configuration information, and obtain the resource amount and the loading time of each playing resource.
Step S102: and predicting the downloading duration of each playing resource according to the resource amount and the network speed of each playing resource.
The network speed is: the network speed of the network used by the client. The network speed generally refers to the amount of data uploaded and downloaded per unit time when networking.
Specifically, the network speed of the network at the current time may be directly determined as the network speed.
And determining a time period of a preset forward duration from the current moment, and taking the statistic value of the network speed in the time period as the network speed. The statistical value may be an average value of the network speed, a maximum value of the network speed, a minimum value of the network speed, an average value of the maximum value of the network speed and the minimum value of the network speed, and the like in the time period.
The download duration of each playback resource may be a duration determined by a reference duration of each playback resource, where the reference duration is equal to a ratio between the resource amount of the playback resource and the network speed.
In one embodiment, for each broadcast resource, the reference time length of the broadcast resource may be directly determined as the download time length of the broadcast resource.
For example: the resource amount of the playing resources is 60MB, the network speed is 6MB/s, and the reference time length of the playing resources is as follows: 60/6 is 10s, and 10s is directly determined as the download duration of the playing resource.
In another embodiment, for each play resource, the reference duration of the play resource may be adjusted according to the first preset duration error, and the adjusted reference duration is determined as the download duration of the play resource.
The first preset time length error may be set by a worker according to experience, for example: the first preset duration error may be 1s, 2s, 5s, etc.
When the reference time length is adjusted, the difference between the reference time length and the first preset time length error can be calculated and used as the downloading time length of the playing resource; the sum value of the error between the reference time length and the first preset time length can be calculated and used as the downloading time length of the playing resource; and selecting a time length from the time length range formed by the difference value and the sum value to be used as the downloading time length of the playing resource.
For example: the reference time length is 60s, the first preset time length error is 5s, and the difference between the reference time length and the first preset time length error is calculated as follows: 60s-5 s-55 s, which can be 55s as the download duration of the playing resource; calculating to obtain a sum value between the reference time length and the first preset time length error as follows: 60s +5s is 65s, and 65s can be used as the download duration of the playing resource; and randomly selecting a time length 58s from a time length range [55s, 65s ] formed by the difference value and the sum value as the downloading time length of the playing resource.
Step S103: and determining the initial downloading time of each playing resource before the loading time of each playing resource according to the downloading time of each playing resource.
The initial downloading time of the playing resources is as follows: and starting to download the playing resources. The initial downloading time of the playing resources is before the loading time of the playing resources.
Because the time length required for downloading the playing resources is influenced by the resource amount of the playing resources and the network speed, the downloading time length is predicted according to the resource amount of the playing resources and the network speed, and the accuracy of the obtained downloading time length is higher. On the basis, according to the downloading duration, before the loading time of each playing resource, after the initial downloading time is determined, the playing resources are downloaded from the initial downloading time, and the playing resources can be effectively guaranteed to be downloaded to the local when the loading time is reached, so that the situations that the playing resources are still downloaded at the loading time and the video playing is blocked are reduced.
In an embodiment of the present disclosure, for each playback resource, a time before the loading time and separated from the loading time by the downloading duration may be determined as the initial downloading time.
For example: the loading time of the playing resource is 01:00:00, the downloading time length is 20s, and the time before 01:00:00 and 20s away from 01:00:00 is: 00:59:40, and determining 00:59:40 as the initial downloading time.
Therefore, the initial downloading time is before the loading time and the downloading time is separated from the loading time, so that the playing resources are downloaded sufficiently before the loading time, the playing resources are effectively guaranteed to be downloaded to the local before the loading time, and the situation that the video playing is blocked due to waiting for the downloading of the playing resources in the video playing process is reduced.
In addition to the above manner, in determining the initial download time, in an embodiment of the present disclosure, for each play resource, a target time before the loading time and separated from the loading time by a download time may be determined, the target time is adjusted, and the adjusted target time is determined as the initial download time.
Specifically, the target time may be adjusted in combination with the second preset duration error. For example: determining the time before the target time and separated from the target time by a second preset time length error as the adjusted time; or determining the time after the target time and separated from the target time by a second preset time length error as the adjusted time.
Step S104: and in the video playing process, downloading each playing resource after the initial downloading time of each playing resource is reached.
In the video playing process, a plurality of threads can be started, wherein one thread is used for executing a video playing task, and the other threads are used for executing a playing resource downloading task. And after the playing time reaches the initial downloading time of each playing resource, triggering other threads to start downloading the playing resources, so that the video is played and the playing resources are downloaded at the same time through multi-thread parallel work, and synchronously downloading each playing resource in the video playing process.
Specifically, the other threads may execute a download task of a plurality of play resources, or may execute a download task of one play resource.
Since the video playing process starts to download each playing resource after the initial downloading time of the playing resource is reached, the triggering conditions for downloading the playing resource are as follows: the video playing process reaches the initial downloading time of the playing resources.
And successfully downloading the playing resources, and after the triggering condition of loading the playing resources is met, loading the playing resources by the client to realize playing of the playing resources.
In one implementation, when the playing resource is information to be displayed, such as a video, a picture, a text, and the like, the configuration information may further include: the playing time length and the playing area of the playing resources. Based on this, when the client loads the playing resources, the playing resources can be loaded to the loading area in the user interface according to the configuration information, and played according to the playing duration.
As can be seen from the above, the downloading of the playing resources by using the scheme provided in this embodiment is to download each playing resource in the video playing process, that is, to perform video playing and download the playing resources at the same time.
In addition, in the scheme provided in this embodiment, each play resource is downloaded, specifically, in the video playing process, the start is started after the start download time of each play resource is reached. And the initial downloading time is positioned before the loading time of the playing resource and is determined according to the downloading time of the playing resource. The downloading duration represents the duration required for downloading the playing resources at the current network speed, so that the playing resources are downloaded from the initial downloading time, the playing resources can be effectively guaranteed to be downloaded to the local when the loading time is reached, the playing resources downloaded to the local can be directly loaded at the loading time, the situation of waiting for the downloading of the playing resources in the video playing process is reduced, and the timeliness of video playing is further improved.
In addition, because the playing resources are downloaded while video playing is performed, the user stops downloading the playing resources when the user finishes watching the video playing in the middle of the video playing, and the playing resources downloaded to the local are part of the playing resources for playing the video.
A specific procedure for determining the start download time of each broadcast resource will be described below with reference to fig. 2a and 2 b.
It is assumed that the playing resources to be loaded during the video playing process include: the playback resource 1, the playback resource 2, the playback resource 3, and the playback resource 4, where the loading time of each playback resource is: play resource 1:00: 00:40, Play resource 2: 00:01:10, play resource 3: 00:01:50, Play resources 4: 00:02:40.
The predicted download duration of each play resource is respectively as follows: play resource 1:20 s, Play resource 2:40 s, Play resources 3: 30s, Play resources 4: for 50 s. The various download durations described above are shown in bar graph form as shown in fig. 2 a.
According to the above conditions, the initial download time of the broadcast resource 1 is: 20s before the loading time 00:00:40, that is, the initial downloading time of the playing resource 1 is 00:00: 20; the initial download time of the play resource 2 is: 40s before the loading time 00:01:10, namely the initial downloading time of the playing resource 1 is 00:00: 30; the initial download time of the play resource 3 is: 30s before the loading time 00:01:50, namely the initial downloading time of the playing resource 3 is 00:01: 20; the initial download time of the play resource 4 is: 50s before the loading time 00:02:40, i.e. the initial downloading time of the playing resource 4 is 00:01: 50.
The starting download time and the loading time of each of the above-mentioned playing resources are shown in a time sequence diagram, as shown in fig. 2 b. In fig. 2b, the positions of the dots represent the loading time of the playback resources, and the positions pointed by the arrows represent the initial downloading time of the playback resources.
After the initial download time of each broadcast resource is determined in step S103, the download time of each broadcast resource can be determined according to the initial download time and the loading time of each broadcast resource. Specifically, for a broadcast resource, the time period from the start of downloading to the loading is called the loading time.
In this case, the network bandwidth for downloading the playing resources is shared by multiple playing resources in the overlapping time period, so that a phenomenon that a single playing resource is downloaded slowly occurs, and when the loading time is reached, the playing resources are not downloaded completely in a serious case. In order to alleviate the above phenomenon, after step S103, the following step a 1-step a2 may also be performed.
Step A1: and determining the target playing resources with overlapped downloading time according to the initial downloading time and the loading time of each playing resource.
The download time is: the time period from the start download time to the load time. For example: the initial downloading time of the playing resources is as follows: 00:00:58, the loading time is: 00:01:00, the download time of the playing resources is: 00:00:58-00:01:00.
The target playing resources with overlapped downloading time refer to: there are overlapping time periods of the playback resources between the download times. Specifically, when the download times satisfy an intersection relationship, an equality relationship, or an inclusion relationship, it indicates that there is an overlapping time period between the download times. And determining the playing resources with the overlapped time periods in the downloading time as target playing resources. The target play resources are grouped and do not exist independently.
Taking table 1 as an example, table 1 shows the download time of each playback resource.
TABLE 1
Playback resource Ls1 00:00:20-00:00:30
Playback resource Ls2 00:00:25-00:00:35
Playback resource Ls3 00:00:20-00:00:50
Playback resource Ls4 00:01:00-00:01:20
Playback resource Ls5 00:01:00-00:01:20
Playback resource Ls6 00:01:10-00:01:40
As can be obtained from table 1 above, the relationship between the download time of the playback resource Ls1 and the download time of the playback resource Ls2 satisfies the intersection relationship, and the overlap period between the download time of the playback resource Ls1 and the download time of the playback resource Ls2 is 00:00:25 to 00:00: 30.
The relation between the download time of the playback resource Ls1 and the download time of the playback resource Ls3 satisfies the inclusion relation, and the overlapping time period between the download time of the playback resource Ls1 and the download time of the playback resource Ls3 is 00:00:20 to 00:00: 30.
The relation between the download time of the playing resource Ls2 and the download time of the playing resource Ls3 satisfies the inclusion relation, and the overlapping time period between the download time of the playing resource Ls2 and the download time of the playing resource Ls3 is 00:00:25-00:00: 35;
due to the overlapping time periods among the downloading times of the playing resource Ls1, the playing resource Ls2 and the playing resource Ls3, the playing resource Ls1, the playing resource Ls2 and the playing resource Ls3 are a group of target playing resources; similarly, there are overlapping time periods between the downloading times of the playback resource Ls4, the playback resource Ls5, and the playback resource Ls6, and the playback resource Ls4, the playback resource Ls5, and the playback resource Ls6 are a set of target playback resources.
Specifically, when determining whether the download times are overlapped, for each play resource, in other play resources, a first play resource whose download time includes an initial download time of the play resource is determined, a second play resource whose download time includes a loading time of the play resource is determined, and the play resource, the first play resource, and the second play resource are used as target play resources, that is, the play resource, the first play resource, and the second play resource are a group of target play resources.
Taking the above table 1 as an example, for the playback resource Ls1, the download time 00:00:20-00:00:50 of the playback resource Ls3 includes the initial download time 00:00:20 of the playback resource Ls1, and the playback resource Ls3 is the first playback resource; the download time 00:00:25-00:00:35 of the playing resource Ls2 comprises the load time 00:00:30 of the playing resource Ls1, the download time 00:00:20-00:00:50 of the playing resource Ls3 comprises the load time 00:00:30 of the playing resource Ls1, the playing resource Ls2 and the playing resource Ls3 are second playing resources, and thus the playing resource Ls1, the playing resource Ls2 and the playing resource Ls3 are a set of target playing resources.
Step A2: and adjusting the initial downloading time of each target playing resource forward according to the number of the target playing resources and the overlapping duration of the downloading time.
The number of target playing resources is: there are overlapping time periods of the number of play resources.
Taking table 1 as an example, there are repeated time periods between the downloading times of the playing resource Ls1, the playing resource Ls2 and the playing resource Ls3, and the playing resource Ls1, the playing resource Ls2 and the playing resource Ls3 are a set of target playing resources, and in the set of target playing resources, the number of the target playing resources is 3.
There are repeated time periods between the downloading times of the playing resource Ls4, the playing resource Ls5 and the playing resource Ls6, and the playing resource Ls4, the playing resource Ls5 and the playing resource Ls6 are a group of target playing resources, in this group, the number of the target playing resources is 3.
Specifically, when the number of the target playing resources is 2, the overlapping duration of the downloading time is as follows: the overlapping duration of the download time of the two target playback resources.
When the number of the target playing resources is greater than 2, the overlapping duration of the downloading time is as follows: and determining the obtained time length according to the overlapping time length between the downloading times of every two target playing resources, such as determining the maximum time length and the minimum time length from all the overlapping time lengths or calculating the average time length.
Under the condition that the downloading time is overlapped, the initial downloading time of the target playing resource is adjusted forward, so that the time length between the adjusted initial downloading time and the loading time is prolonged, namely the time length for downloading the target playing resource is prolonged, and the target playing resource is effectively ensured to be downloaded to the local when the loading time of the target playing resource is reached.
In addition, when the initial downloading time of each target playing resource is adjusted forward, not only the overlapping duration of the downloading time is referred to, but also the number of the target playing resources is referred to, so that the more the playing resources with the overlapped downloading time are, the longer the duration of the adjusted downloading time is, and the target playing resources can be more effectively guaranteed to be downloaded to the local when the loading time of each target resource is reached.
The foregoing adjustment of the start downloading time of each target playing resource means to start downloading in advance, for example, to start downloading in advance by a time of "time extension". For example, assuming that the initial download time is 00:01:10 and the forward "extension time" is 10s, the time obtained after adjusting the initial download time forward is: 00:01:00.
The "extended duration" can be obtained by:
in an embodiment of the present disclosure, in which the "extended duration" is obtained, a product of the number of the target playing resources and the overlapping duration of the downloading time may be calculated to obtain the extended duration.
For example: the number of target playing resources is 3, and the overlapping duration of the downloading time is as follows: and 10s, calculating to obtain the delay time as follows: 3 × 10s ═ 30s, the initial download time of each target broadcast resource is: 00:00:30, 00:00:35 and 00:00:40, and adjusting the initial downloading time of each target playing resource forwards by the delay time length of 30s, wherein the adjusted initial downloading time of each target playing resource is 00:00:00, 00:00:05 and 00:00:10 respectively.
Taking fig. 2b as an example, in fig. 2b, the downloading time of the play resource 1 and the download time of the play resource 2 are overlapped, the play resource 1 and the play resource 2 are target play resources, the number of the target play resources is 2, the overlapping duration is 10s, and the delay duration is calculated to be 2 × 10s — 20 s. The initial downloading time of the playing resource 1 is extended forward by 20s, and the initial downloading time of the playing resource 2 is extended forward by 20s, the adjusted initial downloading time of the playing resource 1 is 00:00:00, and the adjusted initial downloading time of the playing resource 2 is: 00:00:10, the adjusted initial download time of each broadcast resource is shown in fig. 2 c.
Thus, the delay time length is obtained by calculating the product of the number of the target playing resources and the overlapping time length of the downloading time, and the delay time length is longer; the time delay duration is adjusted forward for the initial downloading time of each target playing resource, so that sufficient time is provided between the adjusted initial downloading time and the adjusted loading time for downloading the playing resources, and the playing resources are effectively guaranteed to be downloaded locally when the loading time is reached.
In another embodiment of the present disclosure, in which the "extended duration" is obtained, the delay duration may be calculated according to the foregoing manner, and then the delay duration is adjusted according to a third preset duration error, so as to be used as a final delay duration.
The third preset time error may be set by a worker according to experience. For example: the third preset duration error may be: 1s, 2s, etc.
When the delay time is adjusted, the difference between the delay time and the error of the third preset time can be calculated and used as the final delay time; the sum of the delay time and the error of the third preset time can be calculated to be used as the final delay time; and selecting a time length from the time length range formed by the difference value and the sum value as the final delay time length.
For example: the delay time is 30s, the third preset time error is 2s, and the difference between the delay time and the third preset time error is calculated as follows: 30s-2 s-28 s, and 28s can be used as the final delay time; calculating to obtain a sum value of the delay time and a third preset time error, wherein the sum value is as follows: 30s +2 s-32 s, and the final delay time duration can be 32 s; a time length 31s is randomly selected from the time length range [28s, 32s ] formed by the difference value and the sum value, and is used as the final delay time length.
After the adjusted initial downloading time is obtained in step a2, a new overlap may be generated in the downloading time, that is, a new target playing resource may be generated, so step a1 may be executed again to determine a new target playing resource. When a new target playback resource is determined, step a2 needs to be executed again to adjust the initial downloading time of each target playback resource. And circulating the steps until the target playing resources with overlapped downloading time do not exist, and obtaining the initial downloading time of each target playing resource after final adjustment.
After the adjusted initial download time is obtained in step a2, in step S104, when the adjusted initial download time of each target playback resource is reached in the video playback process, each target playback resource is downloaded.
In order to enable the initial downloading time of the playing resources to adapt to the real-time change of the network speed, in one embodiment of the disclosure, the network speed can be monitored, and the variation of the network speed is calculated; if the variable quantity is larger than the preset network speed variable quantity threshold value, the downloading time length of the un-downloaded playing resource is predicted again according to the resource quantity of the un-downloaded playing resource and the current network speed, and the initial downloading time of the un-downloaded playing resource is adjusted according to the re-predicted downloading time length.
Specifically, the network speed may be monitored at preset time intervals. The preset time interval may be 1s, 2s, 1min, 2min, etc.
The variation of the network speed is: the amount of difference between the currently monitored network speed and the network speed used in step S102. The absolute value of the difference between the network speed currently monitored and the network speed used in step S102 may be calculated as the amount of change in the network speed.
The preset network speed variation threshold value can be set by a worker according to experience.
When the variation is greater than the preset network speed variation threshold, it indicates that the variation of the network speed is large, that is, the duration required for downloading the playing resource may be much longer than or much shorter than the downloading duration predicted in step S102 at the current network speed. In this case, the download duration needs to be re-predicted.
Specifically, the downloading duration of the un-downloaded playing resource may be predicted again according to the resource amount of the un-downloaded playing resource and the current network speed in a similar prediction manner as in step S102.
In one embodiment, for each un-downloaded play resource, the initial download time may be adjusted according to the time difference between the re-predicted download time and the original download time, and when the time difference is greater than 0, the initial download time is adjusted forward by the time difference; and when the time length difference is less than 0, backwards adjusting the initial downloading time by the time length difference.
For example: the re-predicted downloading time length is 10s, the original downloading time length is 5s, and the time length difference between the two is as follows: 10s-5s ═ 5s >0, and the initial downloading time 00 of the un-downloaded playing resource is determined; the 00:30 adjustment is made forward for 5s, resulting in 00:00: 25.
The re-predicted downloading time length is 5s, the original downloading time length is 10s, and the time length difference between the two is as follows: 5s-10 s-5s <0, and the initial download time 00:00:30 of the un-downloaded playing resource is adjusted backward by 5s to obtain 00:00: 35.
In another embodiment, for each un-downloaded play resource, the initial downloading time may be determined again before the loading time according to the re-predicted downloading time length in the same manner as in step S103.
Therefore, the variation of the network speed is monitored, the downloading time of the playing resources which are not downloaded is predicted again according to the monitoring result, the downloading time is made to be adaptive to the current network speed, and the downloading of the playing resources can still be effectively guaranteed to be completed before the loading time under the condition that the network speed is changed.
In an embodiment of the present disclosure, before starting video playing, a pre-downloaded playing resource may be determined, and the pre-downloaded playing resource may be downloaded.
The pre-downloaded play resources are as follows: and the playing resources with the duration between the loading time and the initial playing time not exceeding a preset duration threshold value.
The start play time refers to a time at which video play is started.
The preset duration threshold may be set by a worker based on experience, for example: the preset duration threshold may be: 10s, 30s, 1 min.
In determining the pre-downloaded play resources, in one embodiment, the loading time of each play resource playing the video may be obtained, the duration between the loading time and the initial play time of each play resource is calculated, and the play resource whose duration does not exceed the preset duration threshold is determined as the pre-downloaded play resource.
For example: the loading time of each playing resource for playing the video is respectively as follows: 00:00:02, 00:00:04, 00:00:20:00 and 00:01:00, and the time lengths of the loading time and the initial playing time of each playing resource are calculated as follows: 2s, 4s, 20s and 60s, the preset time length threshold value is 5s, and due to the fact that 2s and 4s are less than 5s, 20s and 60s are greater than 5s, the playing resources with the loading time of 00:00:02 and the playing resources with the loading time of 00:00:04 are determined to be the playing resources to be downloaded in advance.
Specifically, in order to avoid waiting too long before the video is played, the number of the pre-downloaded play resources may be limited, and when the pre-downloaded play resources are determined, the pre-downloaded play resources are determined as the play resources whose duration does not exceed a preset duration threshold and whose number is preset. The preset number can be 3 or 5.
In one embodiment, in the configuration information mentioned in step S101, there may be further recorded: and whether each playing resource is the identification information of the pre-downloaded playing resource. In view of this, the client may further determine the pre-downloaded play resource according to the identification information recorded in the configuration information.
Thus, when the time length between the loading time and the starting playing time does not exceed the preset time length threshold value, the playing resource is indicated to start loading in a short time after the video playing is started. For such playback resources, it is difficult to ensure that the downloading is completed when the loading time is reached. In order to prevent the situation of video playing blockage, the pre-downloaded playing resources need to be downloaded to the local in an early downloading mode, and in the video playing process, when the loading time of the pre-downloaded playing resources is reached, the playing resources can be directly loaded, the situation of video playing blockage cannot occur, and the timeliness of the playing resources is improved.
Because there are target playing resources with overlapped downloading time in each playing resource, when downloading each target playing resource, a situation of downloading multiple target playing resources simultaneously may occur in the same time period, based on the above situation, in an embodiment of the present disclosure, when downloading each target resource in step S104, the bandwidth amount of the network bandwidth for downloading each target playing resource may be determined according to the sequence of the loading time of each target playing resource, the network bandwidth is allocated to each target playing resource according to the determined bandwidth amount, and each target playing resource is synchronously downloaded using the allocated network bandwidth.
The closer the loading time of the target playing resource is, the more network bandwidth is needed, so as to effectively ensure that the target playing resource is completely downloaded when the loading time is reached. Therefore, if the loading time of one target playing resource is earlier than the loading time of other target playing resources, the network bandwidth allocated to the target playing resource is greater than the network bandwidth allocated to other target playing resources.
Specifically, the weight of each target playing resource may be determined according to the sequence of the loading time of each target playing resource, and the bandwidth amount of the network bandwidth for downloading each target playing resource may be determined according to the proportion of the weight of each target playing resource.
For example: according to the sequence of the loading time of each target playing resource, the weight of each target playing resource is 5, 4, 3, 2, 1, the proportion of the weight of each target playing resource is 5/15, 4/15, 3/15, 2/15, 1/15, the total network bandwidth allocable by the client is 15M, and the network bandwidth allocable to each target playing resource is: (5/15) × 15M ═ 5M, (4/15) × 15M ═ 4M, (3/15) × 15M ═ 3M, (2/15) × 15M ═ 2M, (1/15) × 15M ═ 1M.
The following describes, with reference to fig. 3, an application of the play resource downloading method provided by the embodiment of the present disclosure to a course video playing scene as a whole.
In this scenario, the video playing mode is assumed to be a recording playing mode, and the playing resources include: the system comprises an interactive game resource 1, an interactive game resource 2, an interactive question and answer resource 1 and an interactive question and answer resource 2.
The above method includes the following steps S301 to S309.
Step S301: and acquiring configuration information of each playing resource required by video playing.
Step S302: and traversing the configuration information to obtain the resource amount and the loading time of each playing resource.
The actual loading time of each playback resource is recorded in the configuration information.
Traversing the configuration information to obtain the resource quantity of the interactive game resource 1 of 10M and the loading time of 00:01: 05; the resource amount of the interactive question answering resource 1 is 20M, and the loading time is 00:01: 10; the resource amount of the interactive game resource 2 is 10M, and the loading time is 00:05: 00; the resource amount of the interactive question-answering resource 2 is 20M, and the loading time is 00:10: 00.
Step S303: and calculating the average network speed of the network.
Specifically, an average value of the sum of the highest wire speed and the lowest wire speed of the network in the last 5 minutes may be calculated as the average wire speed.
For example: the highest network speed of the network in the last 5 minutes is 3M/s, the lowest network speed is 1M/s, and the average value of the sum of the two is calculated as follows: (3M/s +1M/s)/2 ═ 2M/s, giving an average wire speed of 2M/s.
Step S304: and calculating the downloading duration of each playing resource according to the average network speed and the resource amount of each playing resource.
Specifically, the ratio of the resource amount of each interactive resource to the average network speed is calculated, and the ratio is used as the download duration of each interactive resource.
For example: for interactive game resource 1, the ratio of the resource amount to the average network speed is: 10/2 is 5s, the download time of the interactive game resource 1 is 5 s;
for the interactive question answering resource 1, the ratio of the resource quantity to the average network speed is: 20/2, obtaining the download duration of the interactive question and answer resource 1 as 10 s;
for interactive game resource 2, the ratio of the resource amount to the average network speed is: 10/2 is 5s, the download time of the interactive game resource 2 is 5 s;
for the interactive question-answering resource 2, the ratio of the resource quantity to the average network speed is: 20/2 is 10s, the download duration of the interactive question and answer resource 2 is 10 s.
Step S305: and determining the time before the loading time of each playing resource and at intervals of the downloading time length as the initial downloading time.
Specifically, the time before the loading time of each broadcast resource and at intervals of the downloading duration may be directly determined as the initial downloading time.
For example: for the interactive game resource 1, the loading time is 00:01:00 before 00:01:05 and the time interval is 5s, and the initial downloading time of the interactive game resource 1 is 00:01: 00;
for the interactive question and answer resource 1, the loading time is 00:01:10 before the loading time is 00:01:10 and the time interval is 10s is 00:01:00, and the initial downloading time of the interactive question and answer resource 1 is 00:01: 00;
for the interactive game resource 2, the loading time is 00:04:55 before 00:05:00 and the time interval is 5s, and the initial downloading time of the interactive game resource 2 is 00:04: 55;
for the interactive question and answer resource 2, the loading time is 00:09:55 before 00:10:00 and the time interval is 10s, and the initial downloading time of the interactive question and answer resource 2 is 00:09: 55.
Step S306: and judging whether the downloading time of each playing resource has an overlapping time period. If yes, go to step S307; if not, go to step S309.
The download time of the playing resources is as follows: the time period from the start download time to the load time.
For example: the downloading time of the interactive game resource 1 is [00:01:00-00:01:05], the downloading time of the interactive question and answer resource 1 is [00:01:00-00:01:10], the downloading time of the interactive game resource 2 is [00:04:55-00:05:00], and the downloading time of the interactive question and answer resource 2 is [00:09:55-00:10:00 ].
Wherein, the download time [00:01:00-00:01:05] of the interactive game resource 1 and the download time [00:01:00-00:01:10] of the interactive question and answer resource 1 have an overlapping time period [00:01:00-00:01:05 ].
Step S307: and calculating the product of the number of the target playing resources with overlapped downloading time and the overlapped time length to obtain the extended time length.
The target playing resources with overlapped downloading time are an interactive game resource 1 and an interactive question and answer resource 1, wherein the number of the target playing resources is 2, the overlapping time is 5s, and the delay time is 10 s.
Step S308: and the initial downloading time of the target playing resource is adjusted forward by prolonging the time length to obtain the adjusted initial downloading time.
Specifically, the adjusted initial download time is obtained by extending the delay time before the initial download time of the target play resource.
For example: the initial download time of the interactive game resource 1 is extended by 5s before 00:01:00, resulting in 00:00:55, that is, the adjusted initial downloading time of the interactive game resource 1 is 00:00: 55; the initial download time of the interactive question and answer resource 1 is extended by 5 seconds before 00:01:00 to obtain 00:00:55, that is, the adjusted initial download time of the interactive question and answer resource 1 is 00:00: 55.
Step S309: and in the video playing process, the playing resources are downloaded when the initial downloading time of each playing resource is reached.
The adjusted initial downloading time of the interactive game resource 1 is 00:00:55, the adjusted initial downloading time of the interactive question and answer resource 1 is 00:00:55, the initial downloading time of the interactive game resource 2 is 00:04:55, and the initial downloading time of the interactive question and answer resource 2 is 00:09: 55;
in the video playing process, when the video playing reaches 00:00:55, synchronously downloading an interactive game resource 1 and an interactive question and answer resource 1, loading and displaying the interactive game resource 1 when the video playing reaches 00:01:05, and loading and displaying the interactive question and answer resource 1 when the video playing reaches 00:01: 10;
when the speed reaches 00:04:55, synchronously downloading the interactive game resource 2, and when the speed reaches 00:05:00, loading and displaying the interactive game resource 2; and when the speed reaches 00:09:55, synchronously downloading the interactive question and answer resource 2, and when the speed reaches 00:10:00, loading and displaying the interactive game resource 2.
Corresponding to the above playing resource downloading method, an embodiment of the present disclosure further provides a playing resource downloading device.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a playback resource downloading device according to an embodiment of the present disclosure, where the device includes the following modules 401 and 404.
An information obtaining module 401, configured to obtain a resource amount and a loading time of each playing resource;
a duration prediction module 402, configured to predict a download duration of each playing resource according to the resource amount and the network speed of each playing resource;
a time determining module 403, configured to determine, according to the download duration of each playing resource, an initial download time of each playing resource before the loading time of each playing resource;
the resource downloading module 404 is configured to download each playing resource after the initial downloading time of each playing resource is reached in the video playing process.
As can be seen from the above, the downloading of the playing resources by using the scheme provided in this embodiment is to download each playing resource in the video playing process, that is, to perform video playing and download the playing resources at the same time.
In addition, in the scheme provided in this embodiment, each play resource is downloaded, specifically, in the video playing process, the start is started after the start download time of each play resource is reached. And the initial downloading time is positioned before the loading time of the playing resource and is determined according to the downloading time of the playing resource. The downloading duration represents the duration required for downloading the playing resources at the current network speed, so that the playing resources are downloaded from the initial downloading time, the playing resources can be effectively guaranteed to be downloaded to the local when the loading time is reached, the playing resources downloaded to the local can be directly loaded at the loading time, the situation of waiting for the downloading of the playing resources in the video playing process is reduced, and the timeliness of video playing is further improved.
In one embodiment of the present disclosure, the apparatus further comprises:
the first resource determining module is used for determining target playing resources with overlapped downloading time according to the initial downloading time and the loading time of each playing resource after the time determining module;
and the first time adjusting module is used for adjusting the initial downloading time of each target playing resource forwards according to the number of the target playing resources and the overlapping duration of the downloading time.
Under the condition that the downloading time is overlapped, the initial downloading time of the target playing resource is adjusted forward, so that the time length between the adjusted initial downloading time and the loading time is prolonged, namely the time length for downloading the target playing resource is prolonged, and the target playing resource is effectively ensured to be downloaded to the local when the loading time of the target playing resource is reached.
In addition, when the initial downloading time of each target playing resource is adjusted forward, not only the overlapping duration of the downloading time is referred to, but also the number of the target playing resources is referred to, so that the more the playing resources with the overlapped downloading time are, the longer the duration of the adjusted downloading time is, and the target playing resources can be more effectively guaranteed to be downloaded to the local when the loading time of each target resource is reached.
In an embodiment of the present disclosure, the first time adjustment module is specifically configured to calculate a product of an amount of the target playing resource and an overlapping duration of the downloading time to obtain a delay duration; and forward adjusting the delay time length of the initial downloading time of each target playing resource.
Thus, the delay time length is obtained by calculating the product of the number of the target playing resources and the overlapping time length of the downloading time, and the delay time length is longer; the time delay duration is adjusted forward for the initial downloading time of each target playing resource, so that sufficient time is provided between the adjusted initial downloading time and the adjusted loading time for downloading the playing resources, and the playing resources are effectively guaranteed to be downloaded locally when the loading time is reached.
In an embodiment of the disclosure, the time determining module is specifically configured to determine, as the initial downloading time, a time that is before the loading time and is separated from the loading time by a downloading time duration for each playing resource.
Therefore, the initial downloading time is before the loading time and the downloading time is separated from the loading time, so that the playing resources are downloaded sufficiently before the loading time, the playing resources are effectively guaranteed to be downloaded to the local before the loading time, and the situation that the video playing is blocked due to waiting for the downloading of the playing resources in the video playing process is reduced.
In an embodiment of the present disclosure, the apparatus for downloading a playback resource further includes:
the variable quantity detection module is used for monitoring the network speed and calculating the variable quantity of the network speed;
and the second moment adjusting module is used for predicting the downloading time length of the un-downloaded playing resource again according to the resource quantity of the un-downloaded playing resource and the current network speed if the variable quantity is larger than the preset network speed variable quantity threshold value, and adjusting the initial downloading moment of the un-downloaded playing resource according to the re-predicted downloading time length.
Therefore, the variation of the network speed is monitored, the downloading time of the playing resources which are not downloaded is predicted again according to the monitoring result, the downloading time is made to be adaptive to the current network speed, and the downloading of the playing resources can still be effectively guaranteed to be completed before the loading time under the condition that the network speed is changed.
In an embodiment of the present disclosure, the apparatus for downloading a playback resource further includes:
a second resource determining module, configured to determine a pre-downloaded play resource before starting video playing, where the pre-downloaded play resource is: playing resources with the duration between the loading time and the initial playing time not exceeding a preset duration threshold;
and the second resource downloading module is used for downloading the pre-downloaded playing resources.
Thus, when the time length between the loading time and the starting playing time does not exceed the preset time length threshold value, the playing resource is indicated to start loading in a short time after the video playing is started. For such playback resources, it is difficult to ensure that the downloading is completed when the loading time is reached. In order to prevent the situation that the video playing is interrupted, the pre-downloaded playing resources need to be downloaded to the local in an early downloading mode, and in the video playing process, when the loading time of the pre-downloaded playing resources is reached, the playing resources can be directly loaded, the situation that the video playing is interrupted can not occur, and the timeliness of the playing resources is improved.
In an embodiment of the present disclosure, the playback resources include: and guiding the user to participate in playing the interactive resources of the interaction.
Therefore, the interestingness of video playing can be enhanced and the frequency of user parameter playing interaction can be improved by loading the interactive resources.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
In one embodiment of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any of the method embodiments of the method for downloading a playout resource.
In one embodiment of the present disclosure, a non-transitory computer readable storage medium storing computer instructions for causing a computer to execute any one of the method embodiments of the present invention for downloading a playback resource is provided.
In an embodiment of the present disclosure, a computer program product is provided, which includes a computer program, and when being executed by a processor, the computer program implements any one of the foregoing method embodiments of the broadcast resource downloading method.
FIG. 5 illustrates a schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the apparatus 500 comprises a computing unit 501 which may perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The calculation unit 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in the device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, or the like; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508, such as a magnetic disk, optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 501 executes the respective methods and processes described above, such as the playback resource downloading method. For example, in some embodiments, the playback resource download method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM 502 and/or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the above described downloading of playback resources may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the playback resource download method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (17)

1. A method for playback resource download, the method comprising:
acquiring the resource amount and the loading time of each playing resource;
predicting the downloading duration of each playing resource according to the resource amount and the network speed of each playing resource;
determining the initial downloading time of each playing resource before the loading time of each playing resource according to the downloading time of each playing resource;
and in the video playing process, downloading each playing resource after the initial downloading time of each playing resource is reached.
2. The method according to claim 1, wherein after determining the initial downloading time of each broadcast resource before the loading time of each broadcast resource according to the downloading time of each broadcast resource, further comprising:
determining target playing resources with overlapped downloading time according to the initial downloading time and the loading time of each playing resource;
and adjusting the initial downloading time of each target playing resource forward according to the number of the target playing resources and the overlapping duration of the downloading time.
3. The method according to claim 2, wherein the adjusting forward the initial downloading time of each target playing resource according to the number of the target playing resources and the overlapping duration of the downloading time comprises:
calculating the product of the number of the target playing resources and the overlapping duration of the downloading time to obtain the delay duration;
and forward adjusting the delay time length of the initial downloading time of each target playing resource.
4. The method according to claim 1, wherein the determining the initial downloading time of each playing resource before the loading time of each playing resource according to the downloading time of each playing resource comprises:
and determining the time before the loading time and separated from the loading time by the downloading time length as the initial downloading time aiming at each playing resource.
5. The method of any of claims 1-4, further comprising:
monitoring the network speed and calculating the variation of the network speed;
if the variable quantity is larger than the preset network speed variable quantity threshold value, the downloading time length of the un-downloaded playing resource is predicted again according to the resource quantity of the un-downloaded playing resource and the current network speed, and the initial downloading time of the un-downloaded playing resource is adjusted according to the re-predicted downloading time length.
6. The method according to any one of claims 1-4, wherein the method further comprises:
before starting video playing, determining a pre-downloaded playing resource, wherein the pre-downloaded playing resource is: playing resources with the duration between the loading time and the initial playing time not exceeding a preset duration threshold;
and downloading the pre-downloaded playing resources.
7. The method of any one of claims 1-4,
the playing resources comprise: and guiding the user to participate in playing the interactive resources of the interaction.
8. A playback resource downloading apparatus, the apparatus comprising:
the information acquisition module is used for acquiring the resource amount and the loading time of each playing resource;
the time length prediction module is used for predicting the downloading time length of each playing resource according to the resource amount and the network speed of each playing resource;
the time determining module is used for determining the initial downloading time of each playing resource before the loading time of each playing resource according to the downloading time of each playing resource;
and the resource downloading module is used for downloading each playing resource after the initial downloading time of each playing resource is reached in the video playing process.
9. The apparatus of claim 8, wherein the apparatus further comprises:
the first resource determining module is used for determining target playing resources with overlapped downloading time according to the initial downloading time and the loading time of each playing resource after the time determining module;
and the first time adjusting module is used for adjusting the initial downloading time of each target playing resource forwards according to the number of the target playing resources and the overlapping duration of the downloading time.
10. The apparatus of claim 9, wherein,
the first time adjusting module is specifically configured to calculate a product of the number of the target playing resources and an overlapping duration of the downloading time to obtain a delay duration; and forward adjusting the delay time length of the initial downloading time of each target playing resource.
11. The apparatus of claim 8, wherein,
the time determining module is specifically configured to determine, as an initial downloading time, a time that is before the loading time and is separated from the loading time by a downloading time duration for each playing resource.
12. The apparatus of any one of claims 8-11, wherein the apparatus further comprises:
the variable quantity detection module is used for monitoring the network speed and calculating the variable quantity of the network speed;
and the second moment adjusting module is used for predicting the downloading time length of the un-downloaded playing resource again according to the resource quantity of the un-downloaded playing resource and the current network speed if the variable quantity is larger than the preset network speed variable quantity threshold value, and adjusting the initial downloading moment of the un-downloaded playing resource according to the re-predicted downloading time length.
13. The apparatus of any one of claims 8-11, wherein the apparatus further comprises:
a second resource determining module, configured to determine a pre-downloaded play resource before starting video playing, where the pre-downloaded play resource is: playing resources with the duration between the loading time and the initial playing time not exceeding a preset duration threshold;
and the second resource downloading module is used for downloading the pre-downloaded playing resources.
14. The apparatus of any one of claims 8-11,
the playing resources comprise: and guiding the user to participate in playing the interactive resources of the interaction.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-7.
CN202110710762.0A 2021-06-25 2021-06-25 Play resource downloading method, device, equipment and storage medium Active CN113395549B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110710762.0A CN113395549B (en) 2021-06-25 2021-06-25 Play resource downloading method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110710762.0A CN113395549B (en) 2021-06-25 2021-06-25 Play resource downloading method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113395549A true CN113395549A (en) 2021-09-14
CN113395549B CN113395549B (en) 2022-09-13

Family

ID=77623905

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110710762.0A Active CN113395549B (en) 2021-06-25 2021-06-25 Play resource downloading method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113395549B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810773A (en) * 2021-09-17 2021-12-17 北京百度网讯科技有限公司 Video downloading method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105451034A (en) * 2015-12-04 2016-03-30 合一网络技术(北京)有限公司 Advertisement playing control method and system
CN105933741A (en) * 2016-05-16 2016-09-07 乐视控股(北京)有限公司 Advertisement playing method and device, and advertisement putting method, device and system
CN106412631A (en) * 2016-10-17 2017-02-15 合信息技术(北京)有限公司 Video playing method and device
CN106792139A (en) * 2017-02-24 2017-05-31 腾讯科技(深圳)有限公司 A kind of data dispatching method and data dispatch equipment
US20190384515A1 (en) * 2018-06-15 2019-12-19 EMC IP Holding Company LLC Method for configuring resources, electronic device and computer program product
CN110611829A (en) * 2019-09-11 2019-12-24 北京达佳互联信息技术有限公司 Video preloading method and device, electronic equipment and storage medium
US20200356381A1 (en) * 2019-05-08 2020-11-12 Sony Interactive Entertainment LLC Accelerated application start using estimated play duration

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105451034A (en) * 2015-12-04 2016-03-30 合一网络技术(北京)有限公司 Advertisement playing control method and system
CN105933741A (en) * 2016-05-16 2016-09-07 乐视控股(北京)有限公司 Advertisement playing method and device, and advertisement putting method, device and system
CN106412631A (en) * 2016-10-17 2017-02-15 合信息技术(北京)有限公司 Video playing method and device
CN106792139A (en) * 2017-02-24 2017-05-31 腾讯科技(深圳)有限公司 A kind of data dispatching method and data dispatch equipment
US20190384515A1 (en) * 2018-06-15 2019-12-19 EMC IP Holding Company LLC Method for configuring resources, electronic device and computer program product
US20200356381A1 (en) * 2019-05-08 2020-11-12 Sony Interactive Entertainment LLC Accelerated application start using estimated play duration
CN110611829A (en) * 2019-09-11 2019-12-24 北京达佳互联信息技术有限公司 Video preloading method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810773A (en) * 2021-09-17 2021-12-17 北京百度网讯科技有限公司 Video downloading method and device, electronic equipment and storage medium
CN113810773B (en) * 2021-09-17 2024-03-01 北京百度网讯科技有限公司 Video downloading method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113395549B (en) 2022-09-13

Similar Documents

Publication Publication Date Title
CN107423128B (en) Information processing method and system
CN112203111B (en) Multimedia resource preloading method and device, electronic equipment and storage medium
CN107659825A (en) Method, apparatus, server, main broadcaster end and the medium that a kind of live video is retained
CN107333148B (en) Method for processing video frequency and device, computer storage medium and equipment
CN112866809B (en) Video processing method, device, electronic equipment and readable storage medium
CN110087141A (en) Method of transmitting video data, device, client and server
CN107612844A (en) A kind of method for mitigating server pulse, server and client side
CN113395549B (en) Play resource downloading method, device, equipment and storage medium
CN113542887A (en) Program purchasing method, device, equipment and computer readable storage medium
CN105025358A (en) Video playing method and device based on EPG
CN113573146B (en) Method, apparatus, device, storage medium and program product for anchor interaction
CN116132742A (en) Method for determining video playing speed doubling value, video playing method, device and equipment
CN113810773A (en) Video downloading method and device, electronic equipment and storage medium
CN115375808A (en) Behavior control method and device for virtual live character
CN115037986A (en) Video self-adaptive playing method and device
CN107798718B (en) Animation playback method and device
CN107577808B (en) Method, device, server and medium for sorting multi-level list pages
CN114501084B (en) Play method, device, equipment and medium of player
CN110019197A (en) A kind of method, apparatus, server and the medium of data write-in
CN114679596B (en) Interaction method and device based on game live broadcast, electronic equipment and storage medium
CN118132278B (en) Android container optimization method and device and electronic equipment
CN117766099B (en) Training task providing method and device, electronic equipment and storage medium
CN107872477A (en) A kind of multimedia resource storage method and device
CN115842943A (en) Video playing method, device, equipment and storage medium
CN115134614A (en) Task parameter configuration method and device, electronic equipment and computer readable storage medium

Legal Events

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