WO2023217106A1 - 视频播放方法及装置 - Google Patents

视频播放方法及装置 Download PDF

Info

Publication number
WO2023217106A1
WO2023217106A1 PCT/CN2023/092899 CN2023092899W WO2023217106A1 WO 2023217106 A1 WO2023217106 A1 WO 2023217106A1 CN 2023092899 W CN2023092899 W CN 2023092899W WO 2023217106 A1 WO2023217106 A1 WO 2023217106A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
playback
playback data
server
recommended
Prior art date
Application number
PCT/CN2023/092899
Other languages
English (en)
French (fr)
Inventor
杨一帆
侯安康
陶海庆
温海霖
Original Assignee
北京字节跳动网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2023217106A1 publication Critical patent/WO2023217106A1/zh

Links

Classifications

    • 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/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/466Learning process for intelligent management, e.g. learning user preferences for recommending movies
    • H04N21/4668Learning process for intelligent management, e.g. learning user preferences for recommending movies for recommending content, e.g. movies
    • 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/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • 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/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/251Learning process for intelligent management, e.g. learning user preferences for recommending movies
    • 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/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • 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/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • 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/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/466Learning process for intelligent management, e.g. learning user preferences for recommending movies
    • 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/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/466Learning process for intelligent management, e.g. learning user preferences for recommending movies
    • H04N21/4667Processing of monitored end-user data, e.g. trend analysis based on the log file of viewer selections
    • 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/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content

Definitions

  • the present disclosure relates to the technical field of video recommendation, and in particular, to a video playback method and device.
  • the implementation of providing videos to users through recommendations includes: after the terminal device receives the user's video playback operation, it sends a video recommendation request to the recommendation server. After the recommendation server receives the video recommendation request sent by the terminal device, it The recommendation algorithm generates recommendation information including the video download address, and returns the recommendation information to the terminal device. The terminal device then downloads the video from the corresponding video resource server based on the recommendation information, and then can start playing the video.
  • embodiments of the present disclosure provide a video playback method, which is applied to a terminal device.
  • the method includes:
  • Video playback is started based on the playback data of the first video.
  • embodiments of the present disclosure provide a video playback method application server, where the method includes:
  • the video recommendation response information is sent to the terminal device, so that the terminal device parses the video recommendation response information to obtain the playback data of the first video, and starts video playback based on the playback data of the first video.
  • an embodiment of the present disclosure provides a terminal device, including:
  • a sending unit configured to send video recommendation request information to the server in response to the video playback operation
  • a receiving unit configured to receive video recommendation response information sent by the server, where the video recommendation response information includes the download address of at least one recommended video and the playback data of the first video;
  • a processing unit configured to parse the video recommendation response information and obtain the playback data of the first video
  • a playback unit configured to start video playback based on the playback data of the first video.
  • a server including:
  • a receiving unit configured to receive video recommendation request information sent by the terminal device
  • the acquisition unit is used to acquire the download address of at least one recommended video and the playback data of the first video
  • a generating unit configured to generate video recommendation response information based on the download address of the at least one recommended video and the playback data of the first video
  • a sending unit configured to send the video recommendation response information to a terminal device, so that the terminal device parses the video recommendation response information to obtain the playback data of the first video, and starts video playback based on the playback data of the first video. Play.
  • an embodiment of the present disclosure provides an electronic device, including: a memory and a processor, the memory is used to store a computer program; the processor is used to enable the electronic device to implement any of the above when executing the computer program.
  • the video playback method described in the embodiment is used to enable the electronic device to implement any of the above when executing the computer program.
  • embodiments of the present disclosure provide a computer-readable storage medium, which when the computer program is executed by a computing device, causes the computing device to implement the video playback method described in any of the above embodiments.
  • embodiments of the present disclosure provide a computer program product.
  • the computer program product When the computer program product is run on a computer, it causes the computer to implement the video playback method described in any of the above embodiments.
  • Figure 1 is a scene structure diagram of a video playback method provided by an embodiment of the present disclosure
  • Figure 2 is one step flow chart of a video playback method provided by an embodiment of the present disclosure
  • Figure 3 is the second step flow chart of the video playback method provided by the embodiment of the present disclosure.
  • Figure 4 is a schematic structural diagram of a terminal device provided by an embodiment of the present disclosure.
  • Figure 5 is a schematic structural diagram of a server provided by an embodiment of the present disclosure.
  • FIG. 6 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present disclosure.
  • words such as “exemplary” or “such as” are used to represent examples, illustrations or explanations. Any embodiment or design described as “exemplary” or “such as” in the present disclosure is not intended to be construed as preferred or advantageous over other embodiments or designs. Rather, invocations of the words “exemplary” or “such as” are intended to present the relevant concept in a concrete manner. Furthermore, in the description of the embodiments of the present disclosure, unless otherwise specified, the meaning of “plurality” means two or more.
  • the terminal device when the terminal device receives the user's video playback operation, it needs to obtain recommendation information including the video download address from the recommendation server, and then downloads the video from the video resource server according to the video download address to play the video, and obtains the recommendation from the recommendation server.
  • Both information and video downloading from the video resource server will have network delays and transmission times. The superposition of two network delays and transmission times will cause the video playback delay of the terminal device to be very long, which will greatly affect the user experience.
  • embodiments of the present disclosure provide a video playback method and device for shortening the video playback delay of a terminal device.
  • the scene architecture of the video playback method provided by the embodiment of the present disclosure includes: a terminal device 11 , a server 12 , a recommendation server 13 and a resource server 14 .
  • a video playback application is installed on the terminal device 11, and in response to user input, the video can be played through the video playback application;
  • the server 12 can provide video playback data to the terminal device for the terminal device 11 in response to the request of the terminal device;
  • the recommendation server 13 saves a predefined recommendation algorithm and can respond to the recommendation request, determine the recommended video and return the download address of the recommended video;
  • the resource server 14 saves the playback data of all videos, and other devices (terminal devices or servers) can according to the video The download address obtains the playback data of the corresponding video from the resource server.
  • the terminal device 11 When the terminal device 11 receives an operation input by the user to control the player to perform video playback, the terminal device 11 sends video recommendation request information to the server 12 .
  • the server 12 When the server 12 receives the video recommendation request information sent by the terminal device 11, it first sends the request information to the recommendation server 13 for requesting the recommendation server 13 to return the recommended video, and receives the download address of at least one recommended video sent by the recommendation server 13, and then Obtain the playback data of the first video from the resource server 14 based on the download address of at least one recommended video, generate video recommendation response information based on the download address of at least one recommended video and the playback data of the first video, and return the video recommendation response information to the terminal.
  • Device 11 When the terminal device 11 receives an operation input by the user to control the player to perform video playback, the terminal device 11 sends video recommendation request information to the server 12 .
  • the server 12 When the terminal device 11 receives the video recommendation request information sent by the terminal device 11, it first sends the request information to the recommendation server 13
  • the terminal device 11 After receiving the video recommendation response information, the terminal device 11 obtains the playback data of the first video carried in the video recommendation response information, and starts video playback based on the playback data of the first video. The terminal device 11 also obtains the playback data of the at least one recommended video from the resource server 14 based on the download address of the at least one recommended video and performs subsequent video playback based on the playback data of the at least one recommended video.
  • the terminal device 11 in the embodiment of the present disclosure can be a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA), a smart watch, a smart phone
  • UMPC ultra-mobile personal computer
  • PDA personal digital assistant
  • a terminal device such as a bracelet, or the terminal device 11 may also be other types of terminal devices, which are not limited in the embodiment of the present disclosure.
  • the server 12 in the embodiment of the present disclosure may be an application server. For example, if the terminal device 11 receives an operation to control the startup of application A installed on the terminal device 11 for video playback, the server 12 may be the server of application A.
  • the scenario architecture shown in Figure 1 takes the server 12, the recommendation server 13 and the resource server 14 as independent hardware devices as an example, but the embodiments of the present disclosure are not limited thereto.
  • Two or more of the server 12, the recommendation server 13, and the resource server 14 are integrated into the same hardware device.
  • the resource server 14 may be a single server or a server cluster.
  • the video playback method includes the following steps S21 to S26:
  • the terminal device responds to the video playback operation and sends video recommendation request information to the server.
  • the server receives the video recommendation request information sent by the terminal device.
  • the video playback operation in the embodiment of the present disclosure may be an operation for starting the video playback application, for example: input to the icon of the video playback application, or voice input to control the startup of the video playback application; in the embodiment of the present disclosure
  • the video playback operation can also be an input for switching the video being played by the video playback application, for example: a downward sliding input input in the video playback interface of the terminal device.
  • the video playback operation may specifically be a user's click operation on a virtual control or a voice command input by the user, or a specific gesture input by the user.
  • the specific gesture may be any one of a click gesture, a sliding gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double press gesture, and a double click gesture.
  • the video recommendation request information may also carry the identification information of the terminal device and/or the identification information of the logged-in user of the terminal device, so that the server can make the request based on the identification information of the terminal device and/or the identification information of the logged-in user of the terminal device. Make video recommendations.
  • the server obtains the download address of at least one recommended video and the playback data of the first video.
  • the terminal device may send request information carrying the identification information of the terminal device and/or the identification information of the logged-in user of the terminal device to the recommendation server, so that the recommendation server determines the recommended video according to a preset recommendation algorithm, and Return the download address of the recommended video to the server.
  • the first video may be one of the at least one recommended video.
  • the first video can be the first video among the recommended videos.
  • the first video may also be a video cached by the server corresponding to the terminal device or the logged-in user of the terminal device. That is, the server caches videos for each user or terminal device, and when receiving the video recommendation request information sent by the terminal device, obtains the corresponding playback data of the first video based on the cached data.
  • the playback data of the first video includes playback data corresponding to all video frames of the first video. That is, the playback data of the first video completely includes all the playback data of the first video.
  • the playback data of the first video includes playback data corresponding to the first preset number of video frames of the first video. That is, the playback data of the first video only includes part of the playback data of the first video.
  • the server generates video recommendation response information based on the download address of the at least one recommended video and the playback data of the first video.
  • the video recommendation response information generated by the server not only includes the download address of the at least one recommended video, but also includes the playback data of the first video.
  • the server sends the video recommendation response information to the terminal device.
  • the terminal device receives the video recommendation response information sent by the server.
  • the terminal device parses the video recommendation response information and obtains the playback data of the first video.
  • the terminal device extracts the playback data of the first video from the video recommendation response information.
  • the terminal device starts video playback based on the playback data of the first video.
  • the video recommendation sent by the server includes the download address of at least one recommended video and the playback data of the first video. response information, and then parses the video recommendation response information, obtains the playback data of the first video, and starts video playback based on the playback data of the first video. Since the video playback method provided by the embodiment of the present disclosure sends the video recommendation request information to the server, the received video recommendation response information includes the playback data of the first video, so the embodiment of the present disclosure can obtain the playback data of the first video. And start video playback based on the playback data of the first video.
  • the recommended video is first downloaded and then the video playback can be started.
  • it only needs to Video playback can be started with one network request, which reduces network delay and transmission time. Therefore, embodiments of the present disclosure can shorten the video playback delay of the terminal device.
  • the terminal device during the video playback process, the terminal device has to make two network requests (one is used to request the download address of the recommended video, and the other is used to request the playback data of the recommended video), and the two Network requests have a certain probability of failure, and any failure of the network request will cause video playback to fail. Therefore, the probability of video playback failure in related technologies is relatively high.
  • the terminal device only needs to make a network request to start video playback. Therefore, the embodiment of the present disclosure can also reduce the probability of failure of video playback.
  • An embodiment of the present disclosure provides another video playback method.
  • the video playback method includes the following steps:
  • the terminal device responds to the video playback operation and sends video recommendation request information to the server.
  • the server receives the video recommendation request information sent by the terminal device.
  • the server obtains the download address of at least one recommended video from the recommendation server.
  • the implementation of the above step S302 may include the following steps a and d:
  • Step a The server sends request information carrying the target user's identification to the recommendation server.
  • the target user is a logged-in user of the terminal device, and the request information is used to request a recommendation server Returns the download address of the corresponding recommended video.
  • Step b The recommendation server obtains the attribute information of the target user according to the identification of the target user.
  • the target user's attribute information may include the target user's video viewing history, the target user's video viewing preferences, and other information.
  • Step c The recommendation server determines at least one recommended video based on the attribute information of the target user and the predefined recommendation algorithm.
  • the implementation of the above step c (the recommendation server determines the at least one recommended video based on the attribute information of the target user and the predefined recommendation algorithm) may include:
  • the recommendation server determines the recommendation degree of each video in the video resource library based on the attribute information of the target user and the predefined recommendation algorithm, sorts the videos in the video resource library in descending order according to the recommendation degree, and sorts the top n videos in the sorting result. videos are determined as the at least one recommended video, where n is a positive integer.
  • Step d The recommendation server sends the download address of the at least one recommended video to the server.
  • the server determines the first video from the at least one recommended video.
  • the above step S303 (the server determines the first video from the at least one recommended video) includes:
  • the server determines a first recommended video in the at least one recommended video as the first video.
  • the video with the highest ranking among the at least one recommended video is determined as the first video.
  • the server obtains the playback data of the first video from the resource server according to the download address of the first video.
  • the server Since the server obtains the download address of each video in the at least one recommended video from the recommendation server, and the first video is determined by the server in the at least one recommended video, the server can obtain the first video The download address of the video, and then obtain the playback data of the first video from the resource server according to the download address of the first video.
  • the above step S304 (the server obtains the playback data of the first video from the resource server according to the download address of the first video) includes:
  • the server obtains playback data corresponding to all video frames of the first video from the resource server according to the download address of the first video.
  • the server completely obtains the playback data corresponding to the entire content of the first video from the resource server.
  • the terminal device when the server obtains the playback data corresponding to all video frames of the first video from the resource server based on the download address of the first video, the terminal device no longer needs to obtain the playback data corresponding to all video frames of the first video from the resource server based on the download address of the first video.
  • the resource server obtains the playback data of the first video, so the method provided by the embodiment of the present disclosure may also include:
  • the above step S304 (the server obtains the playback data of the first video from the resource server according to the download address of the first video) includes:
  • the server obtains playback data corresponding to the first preset number of video frames of the first video from the resource server according to the download address of the first video.
  • the server only obtains playback data corresponding to part of the content of the first video from the resource server.
  • the terminal device In the case where the server obtains the playback data corresponding to the first preset number of video frames of the first video from the resource server according to the download address of the first video, the terminal device also needs to obtain the playback data corresponding to the first preset number of video frames according to the download address of the first video. Playback data corresponding to other video frames after the first preset number of video frames of the first video is obtained from the resource server. Therefore, the download address of the first video needs to be retained in the download address of the at least one recommended video.
  • the server generates video recommendation response information based on the download address of the at least one recommended video and the playback data of the first video.
  • the above step S305 (the server generates video recommendation response information based on the download address of the at least one recommended video and the playback data of the first video) includes the following steps 1 and 2:
  • Step 1 Merge the download address of the at least one recommended video and the playback data of the first video according to a preset format to generate merged data.
  • the preset format can be pre-agreed by the server and the terminal device, or pre-configured by the operation and maintenance personnel.
  • Step 2 Generate the video recommendation response information according to the merged data.
  • the server sends the video recommendation response information to the terminal device.
  • the terminal device receives the video recommendation response information sent by the server.
  • the terminal device parses the video recommendation response information and obtains the playback data of the first video and the download address of the at least one recommended video.
  • the terminal device may parse the video recommendation response information according to the preset format, thereby obtaining the playback data of the first video and the download address of the at least one recommended video.
  • the download address of the at least one recommended video includes the download address of the first video. In some embodiments, the download address of the at least one recommended video does not include the download address of the first video. first video download address.
  • the terminal device starts video playback based on the playback data of the first video.
  • step S304 if the server obtains the playback data corresponding to the first preset number of video frames of the first video (partial playback data of the first video) from the resource server based on the download address of the first video, , then perform the following steps S309 to S312, and if the server obtains the playback data corresponding to all video frames of the first video from the resource server according to the download address of the first video (all playback data of the first video) , then skip steps S309 and S310 and directly execute the following steps S311 and S312.
  • the terminal device obtains playback data corresponding to other video frames after the first preset video frames of the first video according to the download address of the first video.
  • the terminal device caches playback data corresponding to other video frames after the first preset video frames of the first video to after the playback data corresponding to the first preset video frames of the first video.
  • the terminal device obtains the playback data corresponding to the at least one recommended video according to the download address of the at least one recommended video.
  • the terminal device caches the playback data corresponding to the at least one recommended video after the playback data of the first video.
  • steps S309 to S312 and the above-mentioned step S308 may be executed synchronously, that is, when the terminal device starts video playback based on the playback data of the first video, it also starts acquiring subsequent playback data.
  • the video recommendation sent by the server includes the download address of at least one recommended video and the playback data of the first video. response information, and then parses the video recommendation response information, obtains the playback data of the first video, and starts video playback based on the playback data of the first video. Since the video playback method provided by the embodiment of the present disclosure sends the video recommendation request information to the server, the received video recommendation response information includes the playback data of the first video, so the embodiment of the present disclosure can obtain the playback data of the first video. And start video playback based on the playback data of the first video.
  • the recommended video is first downloaded and then the video playback can be started.
  • it only needs to Video playback can be started with one network request, which reduces network delay and transmission time. Therefore, embodiments of the present disclosure can shorten the video playback delay of the terminal device.
  • the terminal device If the terminal device does not receive the video recommendation response information sent by the server within the preset time period, the terminal device reads the playback data of the second video stored in the preset storage space, and performs playback based on the playback data of the second video. Start video playback.
  • the terminal device After the terminal device sends the video recommendation request information to the server, but the server does not respond for a long time, it reads the cached playback data of the second video, and starts video playback based on the playback data of the second video, so as to further When the network request is abnormal, shorten the video playback delay of the terminal device.
  • Abnormalities may also occur when the terminal device starts video playback based on the playback data of the first video. For example, necessary data such as the bit rate and resolution of the first video are missing or lost in the playback data.
  • the embodiments of this disclosure also cover such anomalies, specifically including:
  • the playback data of the second video stored in the preset storage space is read, and the playback data of the second video is started based on the playback data.
  • the video recommendation response information returned by the server is received, video playback cannot be started based on the playback data of the first video.
  • the cached playback data of the second video is read and based on the playback data of the second video.
  • the playback data starts video playback, thereby further shortening the video playback delay of the terminal device when the playback data obtained through the network request is abnormal.
  • the video playback method provided by the embodiment of the present disclosure also includes:
  • the second video is updated according to the playback data of the recommended video.
  • the terminal device obtains the playback data of the recommended video A, but has not yet played the recommended video A, but the user stops playing the video through the terminal device, then the video A can be updated to the second video .
  • some embodiments of the present disclosure also provide a terminal device and a server.
  • This embodiment corresponds to the foregoing method embodiment.
  • the foregoing method is no longer implemented.
  • the details in the examples will be described one by one, but it should be clear that the terminal device and server in the following embodiments can correspondingly implement all the contents in the foregoing method embodiments.
  • FIG. 4 is a schematic structural diagram of the terminal device. As shown in Figure 4, the terminal device 400 includes:
  • the sending unit 41 is configured to send video recommendation request information to the server in response to the video playback operation
  • the receiving unit 42 is configured to receive video recommendation response information sent by the server, where the video recommendation response information includes the download address of at least one recommended video and the playback data of the first video;
  • the processing unit 43 is configured to parse the video recommendation response information and obtain the playback data of the first video
  • the playback unit 44 is configured to start video playback based on the playback data of the first video.
  • the processing unit 43 is further configured to, after receiving the video recommendation response information sent by the server, parse the video recommendation response information and obtain the download address of the at least one recommended video; according to the Obtain the playback data corresponding to the at least one recommended video from the download address of at least one recommended video; and cache the playback data corresponding to the at least one recommended video after the playback data of the first video.
  • the playback data of the first video includes playback data corresponding to the first preset video frames of the first video, and the video recommendation response information also includes the download address of the first video;
  • the processing unit 43 is also configured to parse the video recommendation response information and obtain the download address of the first video; obtain the first preset video frames of the first video according to the download address of the first video. Playback data corresponding to other video frames; cache playback data corresponding to other video frames after the first preset video frames of the first video to after the playback data corresponding to the first preset video frames of the first video .
  • the playback unit 44 is also configured to read the second video stored in the preset storage space if the video recommendation response information sent by the server is not received within a preset time period. Play data, and start video playback based on the play data of the second video.
  • the playback unit 44 is also configured to read the second video stored in the preset storage space if an abnormality occurs in playing the first video based on the playback data of the first video. Play data, and start video playback based on the play data of the second video.
  • FIG. 5 is a schematic structural diagram of the server. As shown in Figure 5, the server 500 includes:
  • the receiving unit 51 is used to receive the video recommendation request information sent by the terminal device;
  • the obtaining unit 52 is used to obtain the download address of at least one recommended video and the playback data of the first video;
  • Generating unit 53 configured to generate video recommendation response information according to the download address of the at least one recommended video and the playback data of the first video
  • the sending unit 54 is configured to send the video recommendation response information to the terminal device, so that the terminal device parses the video recommendation response information to obtain the playback data of the first video, and starts based on the playback data of the first video. Play video.
  • the obtaining unit 52 is specifically configured to obtain the download address of the at least one recommended video from a recommendation server; determine the first video from the at least one recommended video; and according to the first video The download address obtains the playback data of the first video from the resource server.
  • the obtaining unit 52 is specifically configured to determine the first recommended video in the at least one recommended video as the first video.
  • the obtaining unit 52 is specifically configured to obtain the playback data corresponding to the first preset number of video frames of the first video from the resource server according to the download address of the first video.
  • the generating unit 53 is specifically configured to merge the download address of the at least one recommended video and the playback data of the first video according to a preset format to generate merged data; according to the merged data Generate the video recommendation response information.
  • the terminal device and server provided by this embodiment can execute the video playback method provided by the above method embodiment.
  • the implementation principles and technical effects are similar and will not be described again here.
  • the above-described units may be implemented as software components executing on one or more general-purpose processors, or as hardware such as programmable logic devices and/or application-specific integrated circuits that perform certain functions or a combination thereof.
  • these units may be embodied in the form of a software product, which may be stored in a non-volatile storage medium that includes a computer device (e.g., personal computer, server, network devices, mobile terminals, etc.) to implement the methods described in the embodiments of the present disclosure.
  • the above unit can also be implemented on a single device or distributed on multiple devices. The functions of these units can be combined with each other or further split into sub-units.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • the electronic device provided by this embodiment includes: a memory 601 and a processor 602.
  • the memory 601 is used to store computer program instructions;
  • the processor 602 is configured to execute the video playback method provided by the above embodiments when executing computer program instructions.
  • embodiments of the present disclosure also provide a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computing device implements the above embodiments. Provided video playback methods.
  • embodiments of the present disclosure also provide a computer program product.
  • the computing device implements the video playback method provided in the above embodiments.
  • Embodiments of the present disclosure also provide a computer program, which includes instructions that, when executed by a processor, cause the processor to execute the video playback method provided by the above embodiments.
  • embodiments of the present disclosure may be provided as a method, system, computer program product, or computer program. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein.
  • the processor can be a Central Processing Unit (CPU), other general-purpose processors, Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), or off-the-shelf programmable processors. Gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • Memory may include non-volatile memory in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media includes permanent and non-permanent, removable and non-removable storage media.
  • Storage media can be implemented by any method or technology to store information, and information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • read-only memory read-only memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • compact disc read-only memory CD-ROM
  • DVD digital versatile disc
  • Magnetic tape cassettes disk storage or other magnetic storage devices, or any other non-transmission medium, can be used to store information that can be accessed by a computing device.
  • computer-readable media does not include transitory media, such as modulated data signals and carrier waves.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本公开实施例提供了一种视频播放方法及装置,涉及视频处理技术领域。该方法应用于终端设备,所述方法包括:响应于视频播放操作,向服务器发送视频推荐请求信息;接收所述服务器发送的视频推荐响应信息,所述视频推荐响应信息包括至少一个推荐视频的下载地址和第一视频的播放数据;解析所述视频推荐响应信息,获取所述第一视频的播放数据;基于所述第一视频的播放数据开始进行视频播放。

Description

视频播放方法及装置
相关申请的交叉引用
本公开是以中国申请号为202210500761.8,申请日为2022年05月09日的申请为基础,并主张其优先权,该中国申请的公开内容在此作为整体引入本公开中。
技术领域
本公开涉及视频推荐技术领域,尤其涉及一种视频播放方法及装置。
背景技术
随着互联网技术和智能电子设备的快速发展,视频播放作为电子设备的一项实用性功能得到了越来越多人的青睐,通过电子设备观看视频的用户也越来越多。然而,视频作品通常数量庞大且内容混杂,用户很难快速地从大量视频资源中找到自己感兴趣的视频,因此基于用户喜好通过推荐的方式向用户提供视频已成为一种非常普遍的视频提供方式。
相关技术中,通过推荐的方式向用户提供视频的实现方式包括:终端设备接收到用户的视频播放操作后向推荐服务端发送视频推荐请求,推荐服务器接收到终端设备发送的视频推荐请求后,根据推荐算法生成包含视频下载地址的推荐信息,并将推荐信息返回终端设备,终端设备再根据推荐信息从相应的视频资源服务器中下载视频,然后才能够开始进行视频的播放。
发明内容
本公开实施例提供技术方案如下:
第一方面,本公开的实施例提供了一种视频播放方法,应用于终端设备,所述方法包括:
响应于视频播放操作,向服务器发送视频推荐请求信息;
接收所述服务器发送的视频推荐响应信息,所述视频推荐响应信息包括至少一个推荐视频的下载地址和第一视频的播放数据;
解析所述视频推荐响应信息,获取所述第一视频的播放数据;
基于所述第一视频的播放数据开始进行视频播放。
第二方面,本公开的实施例提供了一种视频播放方法应用服务器,所述方法包括:
接收终端设备发送的视频推荐请求信息;
获取至少一个推荐视频的下载地址和第一视频的播放数据;
根据所述至少一个推荐视频的下载地址和所述第一视频的播放数据生成视频推荐响 应信息;
向终端设备发送所述视频推荐响应信息,以使终端设备解析所述视频推荐响应信息获取所述第一视频的播放数据,以及基于所述第一视频的播放数据开始进行视频播放。
第三方面,本公开实施例提供一种终端设备,包括:
发送单元,用于响应于视频播放操作,向服务器发送视频推荐请求信息;
接收单元,用于接收所述服务器发送的视频推荐响应信息,所述视频推荐响应信息包括至少一个推荐视频的下载地址和第一视频的播放数据;
处理单元,用于解析所述视频推荐响应信息,获取所述第一视频的播放数据;
播放单元,用于基于所述第一视频的播放数据开始进行视频播放。
第四方面,本公开实施例提供了一种服务器,包括:
接收单元,用于接收终端设备发送的视频推荐请求信息;
获取单元,用于获取至少一个推荐视频的下载地址和第一视频的播放数据;
生成单元,用于根据所述至少一个推荐视频的下载地址和所述第一视频的播放数据生成视频推荐响应信息;
发送单元,用于向终端设备发送所述视频推荐响应信息,以使终端设备解析所述视频推荐响应信息获取所述第一视频的播放数据,以及基于所述第一视频的播放数据开始进行视频播放。
第五方面,本公开实施例提供一种电子设备,包括:存储器和处理器,所述存储器用于存储计算机程序;所述处理器用于在执行计算机程序时,使得所述电子设备实现上述任一实施方式所述的视频播放方法。
第六方面,本公开实施例提供一种计算机可读存储介质,当所述计算机程序被计算设备执行时,使得所述计算设备实现上述任一实施方式所述的视频播放方法。
第七方面,本公开实施例提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机实现上述任一实施方式所述的视频播放方法。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要调用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言, 在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的视频播放方法场景结构图;
图2为本公开实施例提供的视频播放方法的步骤流程图之一;
图3为本公开实施例提供的视频播放方法的步骤流程图之二;
图4为本公开实施例提供的终端设备的结构示意图;
图5为本公开实施例提供的服务器的结构示意图;
图6为本公开实施例提供的电子设备的硬件结构示意图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。
在本公开实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本公开实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,调用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。此外,在本公开实施例的描述中,除非另有说明,“多个”的含义是指两个或两个以上。
相关技术中,终端设备接收到用户的视频播放操作需要从推荐服务器获取包含视频下载地址的推荐信息,然后再根据视频下载地址从视频资源服务器下载视频才能进行视频的播放,而从推荐服务器获取推荐信息和从视频资源服务器下载视频均会有网络延时和传输耗时,两次网络延时和传输耗时的叠加会导致终端设备的视频播放延时很长,非常影响用户的使用体验。
有鉴于此,本公开实施例提供了一种视频播放方法及装置,用于缩短终端设备的视频播放延时。
以下首先对本公开实施例提供的视频播放方法的场景架构进行说明。
参照图1所示,本公开实施例提供的视频播放方法的场景架构中包括:终端设备11、服务器12、推荐服务器13以及资源服务器14。
其中,终端设备11上安装有视频播放应用程序,响应用户输入,通过视频播放应用程序,能够进行视频的播放;服务器12可以为终端设备11响应于终端设备的请求向终端设备提供视频播放数据;推荐服务器13保存有预定义的推荐算法,可以响应于推荐请求,确定推荐视频以及返回推荐视频的下载地址;资源服务器14保存有所有视频的播放数据,其它设备(终端设备或服务器)可以根据视频下载地址从资源服务器获取对应视频的播放数据。
当终端设备11接收到用户输入的控制播放器进行视频播放的操作时,终端设备11向服务器12发送视频推荐请求信息。服务器12接收到终端设备11发送的视频推荐请求信息时,首先向推荐服务器13发送用于请求推荐服务器13返回推荐视频的请求信息,并接收推荐服务器13发送的至少一个推荐视频的下载地址,然后根据至少一个推荐视频的下载地址从资源服务器14获取第一视频的播放数据,再根据至少一个推荐视频的下载地址和第一视频的播放数据生成视频推荐响应信息,以及将视频推荐响应信息返回终端设备11。终端设备11接收到视频推荐响应信息后,获取视频推荐响应信息中携带的第一视频的播放数据,并基于所述第一视频的播放数据开始进行视频播放。终端设备11还根据所述至少一个推荐视频的下载地址从资源服务器14获取所述至少一个推荐视频的播放数据以及根据所述至少一个推荐视频的播放数据进行后续视频播放。
本公开实施例中的终端设备11可以为手机、平板电脑、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)、智能手表、智能手环等终端设备,或者该终端设备11还可以为其他类型的终端设备,本公开实施例不作限定。本公开实施例中的服务器12可以为应用程序服务器,例如:终端设备11接收到控制安装在终端设备11的应用程序A启动以进行视频播放的操作,则服务器12可以为应用程序A的服务器。
需要说明的是,图1所示场景架构中以服务器12、推荐服务器13以及资源服务器14分别为独立的硬件设备为例示出,但本公开实施例并不限定于此,在一些实施例中,将服务器12、推荐服务器13以及资源服务器14中的两个或两个以上集成硬件设备同一硬件设备中。例如:将服务器12和推荐服务器13集成到一个硬件设备中。此外,资源服务器14可以为单个服务器,也可以为服务器集群。
在上述内容的基础上,本公开实施例提供了一种视频播放方法,参照图2所示,该视频播放方法包括如下步骤S21至S26:
S21、终端设备响应于视频播放操作,向服务器发送视频推荐请求信息。
对应的,服务器接收终端设备发送的视频推荐请求信息。
本公开实施例中的视频播放操作可以是用于启动视频播放应用程序的操作,例如:对视频播放应用程序的图标的输入,或者是控制启动视频播放应用程序的语音输入;本公开实施例中的视频播放操作也可以是用于切换视频频播放应用程序正在播放的视频的输入,例如:在终端设备的视频播放界面中输入的向下滑动输入。此外,视频播放操作具体可以是用户对虚拟控件的点击操作或者是用户输入的语音指令,或者是用户输入的特定手势。在本公开的一些实施例中,所述特定手势可以为单击手势、滑动手势、压力识别手势、长按手势、面积变化手势、双按手势、双击手势中的任意一种。
需要说明的是,视频推荐请求信息还可以携带终端设备的标识信息和/或终端设备的登录用户的标识信息,以使服务器可以根据终端设备的标识信息和/或终端设备的登录用户的标识信息进行视频推荐。
S22、服务器获取至少一个推荐视频的下载地址和第一视频的播放数据。
在一些实施例中,终端设备可以向推荐服务器发送携带有终端设备的标识信息和/或终端设备的登录用户的标识信息的请求信息,以便推荐服务器根据预设定的推荐算法确定推荐视频,以及将推荐视频的下载地址返回服务器。
在一些实施例中,第一视频可以为所述至少一个推荐视频中的一个。例如:第一视频可以为推荐视频中的第一个视频。
在一些实施例中,第一视频还可以为服务器缓存的终端设备或终端设备的登录用户对应的视频。即,服务器针对每一个用户或终端设备进行视频缓存,当接收到终端设备发送的视频推荐请求信息时,根据缓存数据获取对应的第一视频的播放数据。
在一些实施例中,第一视频的播放数据包括第一视频的全部视频帧对应的播放数据。即,第一视频的播放数据完整包括第一视频的全部播放数据。
在一些实施例中,第一视频的播放数据包括第一视频的前预设数量个视频帧对应的播放数据。即,第一视频的播放数据仅包括第一视频的部分播放数据。
S23、服务器根据所述至少一个推荐视频的下载地址和所述第一视频的播放数据生成视频推荐响应信息。
即,服务器生成的视频推荐响应信息中不但包括所述至少一个推荐视频的下载地址,而且还包括所述第一视频的播放数据。
S24、服务器向终端设备发送所述视频推荐响应信息。
对应的,终端设备接收所述服务器发送的所述视频推荐响应信息。
S25、终端设备解析所述视频推荐响应信息,获取所述第一视频的播放数据。
即,终端设备从所述视频推荐响应信息中提取所述第一视频的播放数据。
S26、终端设备基于所述第一视频的播放数据开始进行视频播放。
本公开实施例提供的视频播放方法在终端设备响应于视频播放操作向服务器发送视频推荐请求信息后,接收所述服务器发送的包括至少一个推荐视频的下载地址和第一视频的播放数据的视频推荐响应信息,然后解析所述视频推荐响应信息,获取所述第一视频的播放数据以及基于所述第一视频的播放数据开始进行视频播放。由于本公开实施例提供的视频播放方法在向服务器发送视频推荐请求信息后,接收到的视频推荐响应信息包括第一视频的播放数据,因此本公开实施例可以获取所述第一视频的播放数据并基于所述第一视频的播放数据开始进行视频播放,相比于相关技术中接收服务器发送的推荐视频的下载地址后,先下载推荐视频然后才能开始进行视频播放,本公开实施例只需通过一次网络请求即可开始进行视频播放,减少了网络延时和传输耗时,因此本公开实施例可以缩短终端设备的视频播放延时。
还需要说明的是,相关技术中,在视频播放过程中,终端设备要进行两次网络请求(一次用于请求推荐视频的下载地址,另一次用于请求推荐视频的播放数据),而两次网络请求均有一定几率失败,且其中任一次网络请求失败都会导致视频播放失败,因此相关技术中视频播放的失败概率较大。本公开实施例中终端设备只要进行一次网络请求即可以开始进行视频播放,因此本公开实施例还可以减少视频播放的失败概率。
本公开实施例提供了另一种视频播放方法,参照图3所示,该视频播放方法包括如下步骤:
S301、终端设备响应于视频播放操作,向服务器发送视频推荐请求信息。
对应的,服务器接收所述终端设备发送的视频推荐请求信息。
S302、服务器从推荐服务器获取至少一个推荐视频的下载地址。
在一些实施例中,上述步骤S302(服务器从推荐服务器获取至少一个推荐视频的下载地址)的实现方式可以包括如下步骤a和步骤d:
步骤a、服务器向推荐服务器发送携带有目标用户的标识的请求信息。
其中,所述目标用户为所述终端设备的登录用户,所述请求信息用于请求推荐服务器 返回对应的推荐视频的下载地址。
步骤b、推荐服务器根据所述目标用户的标识,获取所述目标用户的属性信息。
其中,目标用户的属性信息可以包括目标用户的视频观看历史、目标用户的视频观看偏好等信息。
步骤c、推荐服务器根据所述目标用户的属性信息和预定义推荐算法,确定至少一个推荐视频。
上述步骤c(推荐服务器根据所述目标用户的属性信息和预定义推荐算法,确定所述至少一个推荐视频)的实现方式可以包括:
推荐服务器根据所述目标用户的属性信息和预定义推荐算法确定视频资源库中的各个视频的推荐度,并按照推荐度对视频资源库中的视频进行降序排序,以及将排序结果中的前n个视频确定为所述至少一个推荐视频,其中,n为正整数。
步骤d、推荐服务器向所述服务器发送所述至少一个推荐视频的下载地址。
S303、服务器从所述至少一个推荐视频中确定所述第一视频。
在一些实施例中,上步骤S303(服务器从所述至少一个推荐视频中确定所述第一视频)包括:
服务器将所述至少一个推荐视频中的第一个推荐视频确定为所述第一视频。
即,将所述至少一个推荐视频中排序最靠前的视频(推荐度最大的视频)确定为所述第一视频。
S304、服务器根据所述第一视频的下载地址从资源服务器获取所述第一视频的播放数据。
由于服务器从推荐服务器获取了所述至少一个推荐视频中的每一个视频的下载地址,且所述第一视频是由服务器在所述至少一个推荐视频中确定的,因此服务器可以获取所述第一视频的下载地址,进而根据所述第一视频的下载地址从资源服务器获取所述第一视频的播放数据。
在一些实施例中,上述步骤S304(服务器根据所述第一视频的下载地址从资源服务器获取所述第一视频的播放数据),包括:
服务器根据所述第一视频的下载地址从资源服务器获取所述第一视频所有视频帧对应的播放数据。
即,服务器从资源服务器完整获取了所述第一视频全部内容对应的播放数据。
在一些实施例中,在服务器根据所述第一视频的下载地址从资源服务器获取了所述第一视频所有视频帧对应的播放数据的情况下,终端设备无需再根据第一视频的下载地址从资源服务器获取第一视频的播放数据,因此本公开实施例提供的方法还可以包括:
将所述第一视频的下载地址从所述至少一个推荐视频的下载地址中删除。
在一些实施例中,上述步骤S304(服务器根据所述第一视频的下载地址从资源服务器获取所述第一视频的播放数据),包括:
服务器根据所述第一视频的下载地址从所述资源服务器获取所述第一视频的前预设数量个视频帧对应的播放数据。
即,服务器从资源服务器仅获取了所述第一视频的部分内容对应的播放数据。
在服务器根据所述第一视频的下载地址从所述资源服务器获取所述第一视频的前预设数量个视频帧对应的播放数据的情况下,终端设备还需再根据第一视频的下载地址从资源服务器获取第一视频的前预设数量个视频帧之后的其它视频帧对应的播放数据,因此所述至少一个推荐视频的下载地址中需要保留所述第一视频的下载地址。
S305、服务器根据所述至少一个推荐视频的下载地址和所述第一视频的播放数据生成视频推荐响应信息。
在一些实施例中,上述步骤S305(服务器根据所述至少一个推荐视频的下载地址和所述第一视频的播放数据生成视频推荐响应信息),包括如下步骤1和步骤2:
步骤1、按照预设格式对所述至少一个推荐视频的下载地址和所述第一视频的播放数据进行合并,生成合并数据。
其中,预设格式可以由服务器与终端设备预先约定,或者由运维人员预先配置。
步骤2、根据所述合并数据生成所述视频推荐响应信息。
S306、服务器向终端设备发送所述视频推荐响应信息。
对应的,终端设备接收服务器发送的视频推荐响应信息。
S307、终端设备解析所述视频推荐响应信息,获取所述第一视频的播放数据和所述至少一个推荐视频的下载地址。
在一些实施例中,终端设备可以按照所述预设格式对所述视频推荐响应信息进行解析,从而获取所述第一视频的播放数据和所述至少一个推荐视频的下载地址。
如上所述,在一些实施例中,所述至少一个推荐视频的下载地址中包括所述第一视频的下载地址,在一些实施例中,所述至少一个推荐视频的下载地址中不包括所述第一视频 的下载地址。
S308、终端设备基于所述第一视频的播放数据开始进行视频播放。
在上述步骤S304中,若服务器根据所述第一视频的下载地址从所述资源服务器获取了所述第一视频的前预设数量个视频帧对应的播放数据(第一视频的部分播放数据),则执行如下步骤S309至S312,而若服务器根据所述第一视频的下载地址从所述资源服务器获取了所述第一视频的全部视频帧对应的播放数据(第一视频的全部播放数据),则跳过步骤S309和S310,直接执行如下步骤S311和S312。
S309、终端设备根据所述第一视频的下载地址获取所述第一视频的前预设个视频帧之后的其它视频帧对应的播放数据。
S310、终端设备将所述第一视频的前预设个视频帧之后的其它视频帧对应的播放数据缓存到所述第一视频的前预设个视频帧对应的播放数据之后。
S311、终端设备根据所述至少一个推荐视频的下载地址获取所述至少一个推荐视频对应的播放数据。
S312、终端设备将所述至少一个推荐视频对应的播放数据缓存到所述第一视频的播放数据之后。
需要说明的是,上述步骤S309至S312与上述步骤S308可以是同步执行的,即,终端设备基于所述第一视频的播放数据开始进行视频播放的同时,开始进行后续播放数据的获取。
本公开实施例提供的视频播放方法在终端设备响应于视频播放操作向服务器发送视频推荐请求信息后,接收所述服务器发送的包括至少一个推荐视频的下载地址和第一视频的播放数据的视频推荐响应信息,然后解析所述视频推荐响应信息,获取所述第一视频的播放数据以及基于所述第一视频的播放数据开始进行视频播放。由于本公开实施例提供的视频播放方法在向服务器发送视频推荐请求信息后,接收到的视频推荐响应信息包括第一视频的播放数据,因此本公开实施例可以获取所述第一视频的播放数据并基于所述第一视频的播放数据开始进行视频播放,相比于相关技术中接收服务器发送的推荐视频的下载地址后,先下载推荐视频然后才能开始进行视频播放,本公开实施例只需通过一次网络请求即可开始进行视频播放,减少了网络延时和传输耗时,因此本公开实施例可以缩短终端设备的视频播放延时。
网络请求均会有一定的失败概率,而若本公开实施例中的网络请求失败(终端设备向 服务器发送视频推荐请求信息失败或终端设备接收所述服务器发送的视频推荐响应信息失败),则会导致终端设备无法开始进行视频的播放。为了解决该问题,本公开实施例提供了一种进行异常兜底的方案,具体包括:
若终端设备在预设时长内未接收到所述服务器发送的所述视频推荐响应信息,则读取预设存储空间中存储的第二视频的播放数据,并基于所述第二视频的播放数据开始进行视频播放。
即,终端设备向服务器发送视频推荐请求信息后,服务器很久都没有进行响应,则读取缓存的第二视频的播放数据,并基于所述第二视频的播放数据开始进行视频播放,从而进一步在网络请求异常时,缩短终端设备的视频播放延时。
终端设备基于所述第一视频的播放数据开始进行视频播放时也可能会出现异常,例如:播放数据中缺少或丢失了第一视频的码率、分辨率等必要数据。本公开实施例同样对此类异常进行了兜底,具体包括:
若基于所述第一视频的播放数据对所述第一视频进行播放出现异常,则读取预设存储空间中存储的第二视频的播放数据,并基于所述第二视频的播放数据开始进行视频播放。
即,虽然收到了服务器返回的视频推荐响应信息,但无法基于所述第一视频的播放数据开始进行视频播放,此时读取缓存的第二视频的播放数据,并基于所述第二视频的播放数据开始进行视频播放,从而进一步在通过网络请求获取的播放数据异常时缩短终端设备的视频播放延时。
在正常获取了推荐视频的播放数据后,本公开实施例提供的视频播放方法还包括:
根据推荐视频的播放数据对第二视频进行更新。
例如:在某一时刻,终端设备获取了推荐视频A的播放数据,但尚未对推荐视频A进行播放,但用户停止了通过终端设备进行视频播放,则可以将视频A更新为所述第二视频。
基于同一发明构思,作为对上述方法的实现,本公开的一些实施例还提供了一种终端设备和一种服务器,该实施例与前述方法实施例对应,为便于阅读,不再对前述方法实施例中的细节内容进行逐一赘述,但应当明确,以下实施例中的终端设备和服务器能够对应实现前述方法实施例中的全部内容。
本公开实施例提供了一种终端设备,图4为该终端设备的结构示意图,如图4所示,该终端设备400包括:
发送单元41,用于响应于视频播放操作,向服务器发送视频推荐请求信息;
接收单元42,用于接收所述服务器发送的视频推荐响应信息,所述视频推荐响应信息包括至少一个推荐视频的下载地址和第一视频的播放数据;
处理单元43,用于解析所述视频推荐响应信息,获取所述第一视频的播放数据;
播放单元44,用于基于所述第一视频的播放数据开始进行视频播放。
在一些实施例中,所述处理单元43,还用于在接收所述服务器发送的视频推荐响应信息之后,解析所述视频推荐响应信息,获取所述至少一个推荐视频的下载地址;根据所述至少一个推荐视频的下载地址获取所述至少一个推荐视频对应的播放数据;以及将所述至少一个推荐视频对应的播放数据缓存到所述第一视频的播放数据之后。
在一些实施例中,在所述第一视频的播放数据包括所述第一视频的前预设个视频帧对应的播放数据,所述视频推荐响应信息还包括所述第一视频的下载地址;
所述处理单元43,还用于解析所述视频推荐响应信息,获取所述第一视频的下载地址;根据所述第一视频的下载地址获取所述第一视频的前预设个视频帧之后的其它视频帧对应的播放数据;将所述第一视频的前预设个视频帧之后的其它视频帧对应的播放数据缓存到所述第一视频的前预设个视频帧对应的播放数据之后。
在一些实施例中,所述播放单元44,还用于若在预设时长内未接收到所述服务器发送的所述视频推荐响应信息,则读取预设存储空间中存储的第二视频的播放数据,并基于所述第二视频的播放数据开始进行视频播放。
在一些实施例中,所述播放单元44,还用于若基于所述第一视频的播放数据对所述第一视频进行播放出现异常,则读取预设存储空间中存储的第二视频的播放数据,并基于所述第二视频的播放数据开始进行视频播放。
本公开实施例提供了一种服务器,图5为该服务器的结构示意图,如图5所示,该服务器500包括:
接收单元51,用于接收终端设备发送的视频推荐请求信息;
获取单元52,用于获取至少一个推荐视频的下载地址和第一视频的播放数据;
生成单元53,用于根据所述至少一个推荐视频的下载地址和所述第一视频的播放数据生成视频推荐响应信息;
发送单元54,用于向终端设备发送所述视频推荐响应信息,以使终端设备解析所述视频推荐响应信息获取所述第一视频的播放数据,以及基于所述第一视频的播放数据开始 进行视频播放。
在一些实施例中,所述获取单元52,具体用于从推荐服务器获取所述至少一个推荐视频的下载地址;从所述至少一个推荐视频中确定所述第一视频;根据所述第一视频的下载地址从资源服务器获取所述第一视频的播放数据。
在一些实施例中,所述获取单元52,具体用于将所述至少一个推荐视频中的第一个推荐视频确定为所述第一视频。
在一些实施例中,所述获取单元52,具体用于根据所述第一视频的下载地址从所述资源服务器获取所述第一视频的前预设数量个视频帧对应的播放数据。
在一些实施例中,所述生成单元53,具体用于按照预设格式对所述至少一个推荐视频的下载地址和所述第一视频的播放数据进行合并,生成合并数据;根据所述合并数据生成所述视频推荐响应信息。
本实施例提供的终端设备和服务器可以执行上述方法实施例提供的视频播放方法,其实现原理与技术效果类似,此处不再赘述。
上述单元可以被实现为在一个或多个通用处理器上执行的软件组件,也可以被实现为诸如执行某些功能或其组合的硬件,诸如可编程逻辑设备和/或专用集成电路。在一些实施例中,这些单元可以体现为软件产品的形式,该软件产品可以存储在非易失性存储介质中,这些非易失性存储介质中包括使得计算机设备(例如个人计算机、服务器、网络设备、移动终端等)实现本公开实施例中描述的方法。在另一些实施例中,上述单元还可以在单个设备上实现,也可以分布在多个设备上。这些单元的功能可以相互合并,也可以进一步拆分为多个子单元。
基于同一发明构思,本公开实施例还提供了一种电子设备。图6为本公开实施例提供的电子设备的结构示意图,如图6所示,本实施例提供的电子设备包括:存储器601和处理器602,所述存储器601用于存储计算机程序指令;所述处理器602用于在执行计算机程序指令时执行上述实施例提供的视频播放方法。
基于同一发明构思,本公开实施例还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,当计算机程序被处理器执行时,使得所述计算设备实现上述实施例提供的视频播放方法。
基于同一发明构思,本公开实施例还提供了一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算设备实现上述实施例提供的视频播放方法。
本公开实施例还提供了一种计算机程序,包括指令,所述指令当由处理器执行时使所述处理器执行上述实施例提供的视频播放方法。
本领域技术人员应明白,本公开的实施例可提供为方法、系统、计算机程序产品或计算机程序。因此,本公开可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质上实施的计算机程序产品的形式。
处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。存储器是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动存储介质。存储介质可以由任何方法或技术来实现信息存储,信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。根据本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
最后应说明的是:以上各实施例仅用以说明本公开的技术方案,而非对其限制;尽管参照前述各实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本公开各实施例技术方案的范围。

Claims (16)

  1. 一种视频播放方法,包括:
    响应于视频播放操作,向服务器发送视频推荐请求信息;
    接收所述服务器发送的视频推荐响应信息,所述视频推荐响应信息包括至少一个推荐视频的下载地址和第一视频的播放数据;
    解析所述视频推荐响应信息,获取所述第一视频的播放数据;
    基于所述第一视频的播放数据开始进行视频播放。
  2. 根据权利要求1所述的视频播放方法,还包括:
    在接收所述服务器发送的视频推荐响应信息之后,解析所述视频推荐响应信息,获取所述至少一个推荐视频的下载地址;
    根据所述至少一个推荐视频的下载地址获取所述至少一个推荐视频对应的播放数据;
    将所述至少一个推荐视频对应的播放数据缓存到所述第一视频的播放数据之后。
  3. 根据权利要求1或2所述的视频播放方法,其中,所述第一视频的播放数据包括所述第一视频的前预设个视频帧对应的播放数据,所述视频推荐响应信息还包括所述第一视频的下载地址,所述视频播放方法还包括:
    解析所述视频推荐响应信息,获取所述第一视频的下载地址;
    根据所述第一视频的下载地址获取所述第一视频的前预设个视频帧之后的其它视频帧对应的播放数据;
    将所述第一视频的前预设个视频帧之后的其它视频帧对应的播放数据缓存到所述第一视频的前预设个视频帧对应的播放数据之后。
  4. 根据权利要求1-3任一项所述的视频播放方法,还包括:
    在预设时长内未接收到所述服务器发送的所述视频推荐响应信息的情况下,读取预设存储空间中存储的第二视频的播放数据,并基于所述第二视频的播放数据开始进行视频播放。
  5. 根据权利要求1-4任一项所述的视频播放方法,还包括:
    在基于所述第一视频的播放数据对所述第一视频进行播放出现异常的情况下,读取预设存储空间中存储的第二视频的播放数据,并基于所述第二视频的播放数据开始进行视频播放。
  6. 一种视频播放方法,包括:
    接收终端设备发送的视频推荐请求信息;
    获取至少一个推荐视频的下载地址和第一视频的播放数据;
    根据所述至少一个推荐视频的下载地址和所述第一视频的播放数据生成视频推荐响应信息;
    向终端设备发送所述视频推荐响应信息,以使终端设备解析所述视频推荐响应信息获取所述第一视频的播放数据,以及基于所述第一视频的播放数据开始进行视频播放。
  7. 根据权利要求6所述的视频播放方法,其中,所述获取至少一个推荐视频的下载地址和第一视频的播放数据,包括:
    从推荐服务器获取所述至少一个推荐视频的下载地址;
    从所述至少一个推荐视频中确定所述第一视频;
    根据所述第一视频的下载地址从资源服务器获取所述第一视频的播放数据。
  8. 根据权利要求7所述的视频播放方法,其中,所述从所述至少一个推荐视频中确定所述第一视频,包括:
    将所述至少一个推荐视频中的第一个推荐视频确定为所述第一视频。
  9. 根据权利要求7或8所述的视频播放方法,其中,所述根据所述第一视频的下载地址从资源服务器获取所述第一视频的播放数据,包括:
    根据所述第一视频的下载地址从所述资源服务器获取所述第一视频的前预设数量个视频帧对应的播放数据。
  10. 根据权利要求6至9任一项所述的视频播放方法,其中,所述根据所述至少一个推荐视频的下载地址和所述第一视频的播放数据生成视频推荐响应信息,包括:
    按照预设格式对所述至少一个推荐视频的下载地址和所述第一视频的播放数据进行合并,生成合并数据;
    根据所述合并数据生成所述视频推荐响应信息。
  11. 一种终端设备,包括:
    发送单元,用于响应于视频播放操作,向服务器发送视频推荐请求信息;
    接收单元,用于接收所述服务器发送的视频推荐响应信息,所述视频推荐响应信息包括至少一个推荐视频的下载地址和第一视频的播放数据;
    处理单元,用于解析所述视频推荐响应信息,获取所述第一视频的播放数据;
    播放单元,用于基于所述第一视频的播放数据开始进行视频播放。
  12. 一种服务器,包括:
    接收单元,用于接收终端设备发送的视频推荐请求信息;
    获取单元,用于获取至少一个推荐视频的下载地址和第一视频的播放数据;
    生成单元,用于根据所述至少一个推荐视频的下载地址和所述第一视频的播放数据生成视频推荐响应信息;
    发送单元,用于向终端设备发送所述视频推荐响应信息,以使终端设备解析所述视频推荐响应信息获取所述第一视频的播放数据,以及基于所述第一视频的播放数据开始进行视频播放。
  13. 一种电子设备,包括:存储器和处理器,所述存储器用于存储计算机程序;所述处理器用于在执行计算机程序时,使得所述电子设备实现权利要求1-10任一项所述的视频播放方法。
  14. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序指令,当所述计算机程序指令被计算设备执行时,使得所述计算设备实现权利要求1-10任一项所述的视频播放方法。
  15. 一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机实现如权利要求1-10任一项所述的视频播放方法。
  16. 一种计算机程序,包括:
    指令,所述指令当由处理器执行时使所述处理器执行如权利要求1-10任一项所述的视频播放方法。
PCT/CN2023/092899 2022-05-09 2023-05-09 视频播放方法及装置 WO2023217106A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210500761.8 2022-05-09
CN202210500761.8A CN117082296A (zh) 2022-05-09 2022-05-09 一种视频播放方法及装置

Publications (1)

Publication Number Publication Date
WO2023217106A1 true WO2023217106A1 (zh) 2023-11-16

Family

ID=88718096

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/092899 WO2023217106A1 (zh) 2022-05-09 2023-05-09 视频播放方法及装置

Country Status (2)

Country Link
CN (1) CN117082296A (zh)
WO (1) WO2023217106A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102843605A (zh) * 2012-08-22 2012-12-26 Tcl集团股份有限公司 视频播放方法、装置
US20170034233A1 (en) * 2010-12-09 2017-02-02 NETFLIX Inc. Pre-Buffering Audio Streams
CN107645674A (zh) * 2017-09-15 2018-01-30 成都视达科信息技术有限公司 一种视频播放方法和系统
CN109729419A (zh) * 2018-12-26 2019-05-07 上海众源网络有限公司 推送视频预加载方法、装置、电子设备及存储介质
CN110324680A (zh) * 2018-03-30 2019-10-11 腾讯科技(深圳)有限公司 一种视频推送方法、装置及服务器、客户端、存储介质
CN112565871A (zh) * 2020-11-06 2021-03-26 深圳市易平方网络科技有限公司 一种视频预加载方法、智能终端及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170034233A1 (en) * 2010-12-09 2017-02-02 NETFLIX Inc. Pre-Buffering Audio Streams
CN102843605A (zh) * 2012-08-22 2012-12-26 Tcl集团股份有限公司 视频播放方法、装置
CN107645674A (zh) * 2017-09-15 2018-01-30 成都视达科信息技术有限公司 一种视频播放方法和系统
CN110324680A (zh) * 2018-03-30 2019-10-11 腾讯科技(深圳)有限公司 一种视频推送方法、装置及服务器、客户端、存储介质
CN109729419A (zh) * 2018-12-26 2019-05-07 上海众源网络有限公司 推送视频预加载方法、装置、电子设备及存储介质
CN112565871A (zh) * 2020-11-06 2021-03-26 深圳市易平方网络科技有限公司 一种视频预加载方法、智能终端及存储介质

Also Published As

Publication number Publication date
CN117082296A (zh) 2023-11-17

Similar Documents

Publication Publication Date Title
US9141682B1 (en) Resolving conflicts within saved state data
CN109474843B (zh) 语音操控终端的方法、客户端、服务器
CN110677727B (zh) 音视频播放方法、装置、电子设备及存储介质
WO2017092313A1 (zh) 控制播放设备播放视频的方法和装置
CN108566561B (zh) 视频播放方法、装置及存储介质
CN111901674A (zh) 一种视频播放控制及装置
US20100268694A1 (en) System and method for sharing web applications
CN106657257B (zh) 产生用于交互式多媒体应用程序的音视频的方法和装置
US20220174346A1 (en) Video playing method and apparatus
CN111372115B (zh) 应用程序的访问方法及装置、通讯系统
CN102298947A (zh) 一种用于在多媒体播放器间进行播放切换的方法与设备
JP2020533862A (ja) ビデオ情報処理方法、コンピュータデバイス及び記憶媒体
US20170180805A1 (en) Method and electronic device for video follow-play
US20170195384A1 (en) Video Playing Method and Electronic Device
US11962837B2 (en) Video update push method and terminal
CN112449250B (zh) 一种视频资源的下载方法、装置、设备和介质
CN112584200A (zh) 投屏方法、系统、电子设备及存储介质
CN114553858A (zh) 一种资源预下载的方法、装置以及设备
WO2023217106A1 (zh) 视频播放方法及装置
CN110351581B (zh) 一种数据请求处理方法、装置、终端设备及存储介质
US20220365959A1 (en) Multimedia file storage and access method
CN111356006B (zh) 视频播放方法、装置、服务器及存储介质
CN113918849A (zh) 一种页面显示方法、装置、系统、电子设备及存储介质
US10630571B1 (en) Fault-tolerant request routing
CN111447490A (zh) 流媒体文件处理方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23802876

Country of ref document: EP

Kind code of ref document: A1