Video playing method and device, electronic equipment and storage medium
By acquiring the current state of the video player and the historical network state sequence, and using a target decision model to dynamically adjust the playback level, the problem of image quality and smoothness imbalance caused by fixed parameters in existing technologies is solved, and high-quality video playback is achieved in complex network environments.
Patent Information
- Application Number
- CN202511920293.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-03-03
AI Technical Summary
Existing video players rely on fixed parameters when adaptively switching playback levels, which cannot effectively adapt to complex network environments, resulting in an imbalance between image quality and smoothness, and a poor user viewing experience.
By acquiring the current state of the video player and the historical network state sequence, the playback level is determined using a trained target decision model. Combined with deep reinforcement learning and model predictive control, the playback level is dynamically adjusted to adapt to network changes.
In complex network environments, it achieves a balance between smooth video playback and high image quality, thus improving the user viewing experience.
Smart Images

Figure CN121603741A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video playback technology, and in particular to a video playback method, apparatus, electronic device and storage medium. Background Technology
[0002] In streaming media services such as online video-on-demand and live streaming, network environments often experience bandwidth fluctuations, interference, and congestion. Using a single playback level cannot simultaneously guarantee smooth playback and high image quality. Therefore, video servers provide multiple playback levels for video players to adaptively switch between. Currently, when video players adaptively switch playback levels, they typically predefine maximum and minimum buffer duration thresholds for the video player's buffer. This is done by comparing the monitored current buffer duration with these thresholds to automatically switch to the appropriate playback level. However, this method relies on fixed parameters and has extremely poor adaptability to complex network dynamics, easily leading to an imbalance between image quality and smoothness, resulting in a poor user viewing experience. Summary of the Invention
[0003] In view of this, in order to solve the above-mentioned technical problems or some of the technical problems, the embodiments of this application provide a video playback method, apparatus, electronic device and storage medium.
[0004] Firstly, this application provides a video playback method, including: When downloading a target video segment, obtain the current player state corresponding to the video player playing the video and the historical network state sequence of the network environment where the video player is located. Based on the current player state and the historical network state sequence, the target decision model that has been trained is used to make a decision on the playback level of the target video segment in order to obtain the target playback level. Based on the target playback level, download the target video segment; When it is necessary to play the target video segment, control the video player to play the downloaded target video segment.
[0005] In one optional implementation, the target decision model includes a prediction layer and a decision layer; The step of determining the playback level of the target video segment based on the current player state and the historical network state sequence, using a trained target decision model, to obtain the target playback level, includes: The historical network state sequence is input into the prediction layer so that the prediction layer outputs the future network state sequence; The future network state sequence and the current player state are input to the decision layer, so that the decision layer can make a decision on the playback level of the target video segment to obtain the target playback level.
[0006] In an optional implementation, the future network state sequence includes the future network state corresponding to each future video fragment in the future video fragment set, the future video fragment set including the target video fragment; the method further includes: When the target video segment of the video needs to be downloaded, for each future video segment in the future video segment set, obtain the segment size of the future video segment under each preset playback level in the preset playback level set; The step of inputting the future network state sequence and the current player state to the decision layer, so that the decision layer makes a decision on the playback level of the target video segment to obtain the target playback level, includes: The future network state sequence, the current player state, and the size of each future video segment in the future video segment set are input to the decision layer. The decision layer constructs a set of candidate playback paths based on the future network state sequence, the current player state, and all the segment sizes. Each candidate playback path in the set of candidate playback paths is used to indicate the playback level used for playing each of the future video segments in the future video segment set. The decision-making layer determines the target playback path from the set of candidate playback paths, and determines the playback level corresponding to the target video segment in the target playback path as the target playback level.
[0007] In an optional implementation, constructing a candidate playback path set based on the future network state sequence, the current player state, and all the segment sizes includes: Based on preset segmentation rules, all future video segments in the future video segment set are divided to obtain multiple consecutive future video segments, and all future video segments within each future video segment use the same playback level. Based on preset pruning rules, candidate playback level sets corresponding to each future video segment are determined from the preset playback level set; Based on the association between the candidate playback level sets corresponding to each of the future video segments, an initial playback path set is constructed. Based on the future network state sequence, the current player state, and all the segment sizes, the initial playback path set is filtered to obtain a candidate playback path set.
[0008] In an optional implementation, each initial playback path in the initial playback path set includes a candidate playback level for playing each of the future video segments in the future video segment set in the future video segment set, and the candidate playback level is located within the candidate playback level set corresponding to the future video segment to which the future video segment belongs; The initial playback path set is filtered based on the future network state sequence, the current player state, and all the segment sizes to obtain a candidate playback path set, including: For each initial playback path in the initial playback path set, traverse each of the future video segments in the initial playback path according to the following steps, until all the future video segments in the initial playback path have been traversed: Based on the segment size of the future video segment under each preset playback level in the preset playback level set, determine the target segment size of the future video segment under the candidate playback level corresponding to the future video segment; Based on the future network state, the current player state, and the target segment size in the future network state sequence corresponding to the download of the future video segment, the buffer duration of the video player's buffer after downloading the target segment size is predicted, so as to obtain the predicted buffer duration corresponding to the future video segment. The current player state is updated using the predicted buffer duration, and the updated current player state is used to traverse the next future video segment. After traversing the initial playback path set, all initial playback paths that satisfy the first preset condition are determined from the initial playback path set. The first preset condition includes that the predicted buffer playback duration corresponding to each future video segment in the initial playback path is greater than a preset duration threshold. All initial playback paths that meet the first preset condition are determined as a set of candidate playback paths.
[0009] In an optional implementation, the preset pruning rules are determined in the following manner: Obtain the device information of the device that the video player is equipped with; Based on the device information, a performance capability score for the device is determined; Based on the performance capability score, a preset pruning rule corresponding to the performance capability score is determined from a preset pruning rule set. The pruning intensity of the preset pruning rule decreases as the performance capability score increases.
[0010] In an optional implementation, determining the target playback path from the candidate playback path set includes: For each candidate playback path in the candidate playback path set, determine the target value score corresponding to each candidate playback path; The highest target value score is determined from all the obtained value scores; The candidate playback path corresponding to the largest target value score in the candidate playback path set is determined as the target playback path.
[0011] Secondly, this application provides a video playback device, including: The acquisition module is used to acquire the current player status of the video player playing the video and the historical network status sequence of the network environment in which the video player is located when the target video segment to be downloaded is being acquired. The decision module is used to make a decision on the playback level of the target video segment based on the current player state and the historical network state sequence, using a trained target decision model, so as to obtain the target playback level. The download module is used to download the target video segment based on the target playback level; The playback module is used to control the video player to play the downloaded target video segment when it is necessary to play the target video segment.
[0012] Thirdly, this application provides an electronic device, including a processor and a memory, wherein the processor is configured to execute a video playback program stored in the memory to implement the video playback method described above.
[0013] Fourthly, this application also provides a storage medium storing one or more programs that can be executed by one or more processors to implement the video playback method described above.
[0014] Compared with the prior art, the technical solution provided in this application has the following advantages. The method provided in this application includes: when a target video segment needs to be downloaded, obtaining the current player state corresponding to the video player playing the video and the historical network state sequence of the network environment where the video player is located; based on the current player state and the historical network state sequence, using a trained target decision model to decide the playback level of the target video segment to obtain the target playback level; based on the target playback level, downloading the target video segment; and when the target video segment needs to be played, controlling the video player to play the downloaded target video segment. In this embodiment, when a target video segment needs to be downloaded, the current player state corresponding to the video player playing the video and the historical network state sequence of the network environment in which the video player is located are obtained. The trained target decision model is used to make a decision on the playback level of the target video segment. Then, the target video segment is downloaded and played based on the decision-made target playback level. This allows the playback level decision to fully combine the characteristics of the player state and the historical network state, ensuring that the decided playback level can fit the complex network environment. This avoids the problem of poor adaptability to complex network dynamics caused by fixed parameters, and ensures that the smoothness of video playback and the quality of picture quality are taken into account in complex and ever-changing network environments, thereby improving the user's viewing experience. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0018] Figure 1 A flowchart illustrating a video playback method provided in an embodiment of this application; Figure 2 A flowchart illustrating another video playback method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a video playback device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0020] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0021] refer to Figure 1 , Figure 1 This is a flowchart illustrating a video playback method provided in an embodiment of this application. The video playback method provided in this embodiment includes the following steps: S101: When downloading a target video segment, obtain the current player state corresponding to the video player playing the video and the historical network state sequence of the network environment where the video player is located.
[0022] In this embodiment, the method is applied to the client. The video player is a software application integrated into the client and is the core carrier connecting users and video content in the streaming media service. The target video segment is an independent video block in the video being played, and the video block is obtained by dividing the video based on a preset duration. The current player state describes the running state of the video player and the buffer state of the video player's buffer. The current running state may include the playback position of the video, and the buffer state may include the current buffering duration. The historical network state sequence includes the historical network states corresponding to multiple historical video segments downloaded. The historical video segments are located before the target video segment, and the historical network state may be the historical network bandwidth.
[0023] Once the previous video segment has been downloaded, the target video segment can be determined. At this point, the player state corresponding to the video player is obtained based on the video player's built-in API. When downloading historical video segments, the historical network states corresponding to those segments are stored. This allows the historical network state sequence to be retrieved from the stored historical network states corresponding to multiple historical video segments when needed.
[0024] S102: Based on the current player state and the historical network state sequence, use the trained target decision model to make a decision on the playback level of the target video segment to obtain the target playback level.
[0025] In this embodiment, the target decision model refers to an end-to-end target decision model based on a combination of deep reinforcement learning and model predictive control, which has the ability to map the current player state and historical network state sequence as inputs and the target playback level as output.
[0026] After obtaining the current player state and the historical network state sequence, the current player state and the historical network state sequence are concatenated to form a multi-dimensional input vector. The target decision model is then loaded, and the formed multi-dimensional input vector is input into the target decision model so that the target decision model outputs the target playback level, which is the playback level of the target video segment being played.
[0027] S103: Download target video segments based on the target playback level.
[0028] In this embodiment, after determining the target playback level, the client sends a download request for the target video segment corresponding to the target playback level to the video server. After receiving the download request, the video server transmits the target video segment corresponding to the target playback level to the client, which receives and stores it in the buffer of the video player.
[0029] S104: When it is necessary to play the target video segment, control the video player to play the downloaded target video segment.
[0030] In this embodiment, if the previous video segment of the target video segment has finished playing, it is determined that the target video segment needs to be played. At this time, the video player is controlled to obtain the target video segment from the video player's buffer and play the target video segment, ensuring the smoothness of video playback.
[0031] This embodiment provides a video playback method. When a target video segment needs to be downloaded, the method obtains the current player state of the video player playing the video and the historical network state sequence of the network environment in which the video player is located. It then uses a trained target decision model to decide the playback level of the target video segment, and downloads and plays the target video segment based on the decided target playback level. This ensures that the playback level decision fully combines the characteristics of the player state and the historical network state, ensuring that the decided playback level can adapt to complex network environments. It avoids the problem of poor adaptability to complex network dynamics caused by fixed parameters, and thus balances the smoothness of video playback and image quality in complex and ever-changing network environments, improving the user's viewing experience.
[0032] refer to Figure 2 , Figure 2 This is a flowchart illustrating another video playback method provided in an embodiment of this application. The video playback method provided in this embodiment includes the following steps: S201: When downloading a target video segment, obtain the current player state corresponding to the video player playing the video and the historical network state sequence of the network environment in which the video player is located.
[0033] In this embodiment, step S201 is the same as step S101 described above. For details, please refer to step S101 described above. This embodiment will not repeat the details here.
[0034] S202: Input the historical network state sequence into the prediction layer in the target decision model so that the prediction layer outputs the future network state sequence.
[0035] S203: Input the future network state sequence and the current player state into the decision layer in the target decision model, so that the decision layer can make a decision on the playback level of the target video segment to obtain the target playback level.
[0036] Regarding steps S202 and S203 above, the target decision model includes a prediction layer and a decision layer. The prediction layer is constructed using a deep reinforcement learning network. It deeply mines the features of the network environment to output a sequence of future network states. This sequence includes the future network states corresponding to each future video segment in the future video segment set. The future video segment set includes the target video segment and all subsequent future video segments. The future network states include the future network bandwidth. The decision layer is constructed based on an improved model prediction control algorithm. It takes the future network state sequence output by the prediction layer and, combined with the current player state, selects the optimal preset playback level (i.e., the target playback level) from the predicted playback level set.
[0037] After obtaining the historical network state sequence and the current player state, the historical network state sequence is first preprocessed to obtain a temporal feature vector. The preprocessed temporal feature vector is then input into the prediction layer in the target decision model, so that the prediction layer can extract local temporal features based on the temporal feature vector. Based on the extracted local temporal features, the future network state at each future time point is predicted, and then the future network state sequence is output.
[0038] The future network state sequence is concatenated with the current player state to form a fused feature vector. This fused feature vector is input into the decision layer, enabling the decision layer to decide on the playback level for each future video segment included in the future network state sequence. This results in multiple candidate playback paths, from which a target playback path that meets the criteria is selected. Based on the target playback path, the target playback level corresponding to the target video segment is determined. The candidate playback path is formed by combining the playback levels adopted by each future video segment. Through this method, this embodiment designs a target decision model with a two-layer architecture including a prediction layer and a decision layer. The prediction layer accurately predicts the future network state sequence, and then, combined with the current real-time player state and the future network state sequence, the decision layer determines the optimal playback level. This allows the final determined playback level to avoid the risk of stuttering caused by future network fluctuations in advance and to fully utilize the advantages of the future network to improve playback quality, thereby enhancing the user's viewing experience.
[0039] In the above-mentioned method, if only the historical network state sequence and the current player state are used to determine the target playback level of the target video segment, the decision-making layer will be unable to determine the target playback level by combining the download time of the target video segment under different playback levels. This will lead to a significant increase in the risk of stuttering and affect the user's viewing experience. Therefore, in order to avoid the above-mentioned problems, this embodiment obtains the segment size of each future video segment in the future video segment set under each preset playback level in the preset playback level set before inputting the predicted network state sequence and the current player state to the decision-making layer. This allows the decision-making layer to estimate the download time based on the predicted network state sequence, the current player state, and the segment size, and obtain a more accurate target playback level. Therefore, based on the above, this embodiment provides the following method.
[0040] The target decision model described above can be trained in the following way: Initialization: Create an initial decision model with a prediction layer (Actor) and a decision layer (Critic) and initialize the experience replay pool; Training sample set construction: The training samples in the training sample set are obtained through the simulation environment. The training samples include the historical network state sequence input to the prediction layer, the future network state sequence output by the prediction layer, the current player state and future network state sequence input to the decision layer, the target playback level output by the decision layer, and the instant reward value (Qoe) returned by the simulation environment after the simulation environment executes the simulated playback level. The training sample set is stored in the experience recycling pool. Model parameter iterative update: Randomly select some training samples from the experience pool to train the prediction layer and decision layer. The decision layer outputs an instant reward value. Based on the instant reward value, the parameters of the prediction layer and decision layer are updated using the policy gradient method. The above steps are performed to iteratively update the parameters of the prediction layer and decision layer until convergence, resulting in a target decision model including the prediction layer and decision layer.
[0041] It should be noted that the target decision model is trained on the video server and deployed on the client so that the client can execute the video playback steps based on the target decision model.
[0042] In this embodiment, when downloading a target video segment, the video playback method provided by this embodiment further includes the following steps: For each future video segment in the future video segment set, obtain the segment size of the future video segment under each preset playback level in the preset playback level set.
[0043] Step S203 specifically includes: Input the future network state sequence, the current player state, and the size of each segment corresponding to each future video segment in the future video segment set into the decision layer; The decision-making layer constructs a set of candidate playback paths based on the future network state sequence, the current player state, and the size of all segments; The decision-making level determines the target playback path from the set of candidate playback paths, and determines the playback level corresponding to the target video segment in the target playback path as the target playback level.
[0044] The preset playback level set includes multiple preset playback levels. This set is a collection of playback levels predefined by the video server and covers different image quality levels. It provides the video player with a selectable range for switching playback levels, ensuring standardization and compatibility in playback level selection. The size of each future video segment in the future video segment set within each preset playback level in the preset playback level set is pre-set by the video server. When needed, the client can send a request to the video server to obtain the size of each future video segment within the future video segment set within each preset playback level. The segment size is a direct indicator of the network bandwidth requirements of future video segments at different playback levels. Each candidate playback path in the candidate playback path set indicates the playback level used for playing each future video segment in the future video segment set.
[0045] After obtaining the future network state sequence, the current player state, and the sizes of all segments, these data are input into the decision layer. This allows the decision layer to determine the candidate playback level set corresponding to each future video segment. The decision layer then associates these candidate playback level sets to construct a candidate playback path set. After obtaining the candidate playback path set, the target playback path set is determined from it, and the playback level corresponding to the target video segment within the target playback path is identified as the target playback level. This achieves accurate determination of the target playback level used by the target video segment. Through this method, this embodiment obtains the segment size of each future video segment in the future video segment set at each preset playback level in the preset playback level set. Combined with the future network state sequence and the current player state, this upgrades the construction of the candidate playback path set from blind combination to precise and feasible continuous planning. This avoids the increased risk of stuttering due to missing segment size data, further improving the user's viewing experience.
[0046] In the above, a set of candidate playback paths is constructed based on the future network state sequence, the current player state, and all segment sizes, including: Based on preset segmentation rules, all future video segments in the future video segment set are divided to obtain multiple consecutive future video segments. Based on preset pruning rules, candidate playback level sets corresponding to each future video segment are determined from the preset playback level set; Based on the relationship between the candidate playback level sets corresponding to each future video segment, an initial playback path set is constructed. Based on the future network state sequence, the current player state, and all segment sizes, the initial playback path set is filtered to obtain a candidate playback path set.
[0047] In this embodiment, the preset segmentation rule can be understood as a pre-defined rule for dividing the future video segment set. It can divide the video into multiple consecutive future video segments based on the number of consecutive future video segments. All future video segments within each future video segment use the same playback level, thereby reducing the complexity of playback level combinations. The preset pruning rule is a pre-defined rule for filtering candidate playback levels for each future video segment, ensuring that the candidate playback level set corresponding to each future video segment contains only a few levels suitable for the current scene. For example, the preset pruning rule could be that the difference between the playback levels of adjacent video segments is less than or equal to 1. The candidate playback level set can be understood as the set of remaining feasible preset playback levels after each future video segment has undergone the preset pruning rule. The initial playback path set includes multiple initial playback paths, each of which includes the candidate playback levels used by each future video segment in the future video segment set. The candidate playback levels are located within the candidate playback level set corresponding to the future video segment to which the future video segment belongs.
[0048] The decision layer loads preset segmentation rules and continuously divides the future video segment set according to these rules, ensuring that video segments within each segment do not overlap and that all video segments cover all future video segments in the future video segment set. For each future video segment, preset pruning rules are loaded, and each preset playback level in the preset playback level set is traversed to filter the preset playback levels using the preset pruning rules, thereby obtaining a candidate playback level set corresponding to the future video segment. After obtaining each candidate playback level set, the candidate playback level sets corresponding to each video segment are arranged and combined based on the temporal correlation between each video segment to construct an initial playback path set. For example, given video segment 1 and video segment 2, where the candidate playback level set corresponding to video segment 1 includes A and B, and the candidate playback level set corresponding to video segment 2 includes B and C, the initial playback path set includes initial playback path (A, B), initial playback path (A, C), initial playback path (B, B), and initial playback path (B, C).
[0049] After obtaining the initial playback path set, the download time of each future video segment and the buffer state of the video player's buffer are calculated one by one, based on the future network state sequence, the current player state, and the size of all segments. The initial playback path set is then filtered based on the calculation results to select all initial playback paths that meet the requirements, thus forming a candidate playback path set. In this embodiment, by introducing preset segmentation rules, continuous future video segments are divided into coarser-grained future video segments. Based on preset pruning rules, all candidate positions corresponding to each future video segment are quickly filtered to construct the initial playback path set. This reduces the complexity of constructing the initial playback path set and avoids the computational explosion and decision delay caused by directly enumerating all possible playback paths. After obtaining the initial playback path set, all initial playback paths in the initial playback path set are verified by combining the future network state sequence, the current player state, and the size of all segments to obtain a candidate playback path set that meets the requirements. This ensures a dynamic balance between video playback quality and smoothness while maintaining decision-making efficiency, further improving the user's viewing experience.
[0050] The preset pruning rules mentioned above can be determined in the following way: Obtain device information of the device that the video player is equipped with; Based on the equipment information, determine the equipment's performance capability score; Based on the performance capability score, preset pruning rules corresponding to the performance capability score are determined from the preset pruning rule set. The pruning intensity of the preset pruning rules decreases as the performance capability score increases.
[0051] Here, "device" can be understood as the client, and device information includes hardware information for each component within the client, such as the processor, memory, graphics card, and operating system version. The performance score is a comprehensive score quantified based on device information, reflecting the client's playback capacity. A higher comprehensive score indicates higher client performance and better decoding and processing capabilities for high-playback-level videos. The preset pruning rule set is a predefined combination of multiple preset pruning rules with varying pruning intensities. Pruning intensity refers to the strictness with which the preset pruning rules filter the preset playback-level set; higher pruning intensity means more high-playback-level videos need to be removed.
[0052] When pruning is needed, the device information of the device equipped in the video player is obtained. For each hardware component in the device information, based on the correspondence between hardware information and hardware ratings, the corresponding hardware rating is determined, and a preset weight for each hardware component is determined. A weighted sum is then calculated based on the hardware ratings and preset weights of all hardware components in the device information to obtain the device's performance rating. From multiple performance rating ranges, the performance rating range to which the performance rating belongs is determined. Based on the correspondence between the performance rating range and preset pruning rules, the preset pruning rules corresponding to the performance rating range to which the performance rating belongs are determined. Through this method, this embodiment achieves dynamic adaptation between preset pruning rules and device performance, avoiding the performance waste of high-end devices and decoding stuttering issues on low-end devices caused by fixed pruning rules. This ensures playback stability and image quality compatibility across devices with different performance levels, further improving the user's viewing experience.
[0053] In the above, based on the future network state sequence, the current player state, and all segment sizes, the initial playback path set is filtered to obtain a candidate playback path set, including: For each initial playback path in the initial playback path set, traverse each future video segment in the initial playback path according to the following steps, until all future video segments in the initial playback path have been traversed: Based on the segment size of the future video segment under each preset playback level in the preset playback level set, determine the target segment size of the future video segment under the corresponding candidate playback level. Based on the future network state, current player state, and target segment size corresponding to the future network state sequence when downloading future video segments, the buffer duration of the video player's buffer after downloading the target segment size is predicted, so as to obtain the predicted buffer duration corresponding to the future video segments. The current player state is updated using the predicted buffer duration, and the updated current player state is used to traverse the next future video segment. After traversing the initial playback path set, determine all initial playback paths that satisfy the first preset condition from the initial playback path set; All initial playback paths that meet the first preset condition are identified as the candidate playback path set.
[0054] In the above, the first preset condition includes that the predicted buffer playback duration of each future video segment in the initial playback path is greater than a preset duration threshold. The preset duration threshold can be set according to actual needs. In this embodiment, the specific value of the preset duration threshold is not limited.
[0055] After obtaining the initial playback path set, for each initial playback path, the future video segments in the initial playback path are traversed according to their temporal order until all future video segments in the initial playback path have been traversed. While traversing a future video segment, based on the candidate playback level corresponding to that future video segment in the initial playback path, the segment size corresponding to the candidate playback level is extracted from the segment size of the future video segment under each preset playback level in the preset playback level set, and used as the target segment size.
[0056] After obtaining the target chunk size, the future network state (i.e., future network bandwidth) corresponding to the download of future video chunks is determined from the future network state sequence. The download time for the future video chunk is then determined using the ratio between the target chunk size and the future network bandwidth. The predicted buffer duration for the future video chunk is obtained by adding the chunk playback duration to the current player state (the current buffer duration corresponding to the video player's buffer) and subtracting the chunk download time. The chunk playback duration is the playback duration of each pre-divided video chunk.
[0057] After obtaining the predicted buffer duration, the predicted buffer duration is used as the current buffer duration of the new buffer to update the current player state, which is used for the calculation of the next future video segment, thus realizing the iterative transmission of the buffer state.
[0058] After traversing the initial playback path set, for each initial playback path, it is determined whether the predicted buffer duration corresponding to all future video segments in that initial playback path is greater than a preset duration threshold. If all are greater than the preset duration threshold, it indicates that there is no risk of video stuttering when using that initial playback path to play the subsequent target video. Therefore, this initial playback path is used as a candidate playback path until the initial playback path set is filtered, resulting in the final candidate playback path set. In this embodiment, each initial playback path in the initial playback path set is traversed segment by segment to determine the predicted buffer duration corresponding to the traversed future video segments. The buffer state of the video player's buffer is then iteratively updated using the predicted buffer duration until the initial playback path set is traversed. Using the predicted buffer duration as a constraint, each initial playback path is verified, thus determining the candidate playback path set. This ensures that each candidate playback path in the determined candidate playback path set has realistic and feasible smoothness support, avoiding stuttering problems caused by inaccurate path selection and further improving the user's viewing experience.
[0059] The process of determining the target playback path from the candidate playback path set, as described above, specifically includes: For each candidate playback path in the candidate playback path set, determine the target value score corresponding to each candidate playback path; Identify the highest target value score from all the obtained value scores; The candidate playback path corresponding to the highest target value score in the candidate playback path set is determined as the target playback path.
[0060] For each candidate playback path, the Quality of Playback Experience (Qoe) of each future video segment within that path is calculated at its corresponding candidate playback level to obtain a value score. The value scores of all future video segments are summed to obtain the target value score for the candidate playback path. After obtaining all target value scores, the candidate playback path with the highest target value score is selected. This path corresponds to the candidate playback path with the best video playback experience quality. Therefore, the candidate playback path with the highest target value score in the set of candidate playback paths is determined as the target playback path. Through this method, this embodiment calculates quantified target value scores for all feasible candidate playback paths and automatically selects the highest target value score, accurately determining the optimal target playback path from multiple feasible options. This avoids subjective biases that may result from relying on manual rules and maximizes the user's viewing experience while ensuring uninterrupted video playback.
[0061] S204: Download target video segments based on the target playback level.
[0062] S205: When it is necessary to play a target video segment, control the video player to play the downloaded target video segment.
[0063] Regarding steps S204 and S205, step S204 is the same as step S103, and step S205 is the same as step S104. For details, please refer to steps S103 and S104. This embodiment will not repeat them here.
[0064] This embodiment provides a video playback method. When a target video segment needs to be downloaded, the method obtains the current player state of the video player playing the video and the historical network state sequence of the network environment in which the video player is located. It then uses a trained target decision model to decide the playback level of the target video segment, and downloads and plays the target video segment based on the decided target playback level. This ensures that the playback level decision fully combines the characteristics of the player state and the historical network state, ensuring that the decided playback level can adapt to complex network environments. It avoids the problem of poor adaptability to complex network dynamics caused by fixed parameters, and thus balances the smoothness of video playback and image quality in complex and ever-changing network environments, improving the user's viewing experience.
[0065] refer to Figure 3 , Figure 3 This is a schematic diagram of a video playback device provided in an embodiment of this application. The video playback device provided in this embodiment includes: an acquisition module 10, a decision module 20, a download module 30, and a playback module 40. The acquisition module 10 is used to acquire the current player state corresponding to the video player playing the video and the historical network state sequence of the network environment in which the video player is located when a target video segment needs to be downloaded; the decision module 20 is used to make a decision on the playback level of the target video segment based on the current player state and the historical network state sequence, using a trained target decision model to obtain the target playback level; the download module 30 is used to download the target video segment based on the target playback level; and the playback module 40 is used to control the video player to play the downloaded target video segment when it is necessary to play the target video segment.
[0066] In this embodiment, the target decision model includes a prediction layer and a decision layer, and the decision module 20 is further used for: The historical network state sequence is input into the prediction layer so that the prediction layer outputs the future network state sequence; The future network state sequence and the current player state are input to the decision layer, so that the decision layer can make a decision on the playback level of the target video segment to obtain the target playback level.
[0067] In this embodiment, the future network state sequence includes the future network state corresponding to each future video segment in the future video segment set, and the future video segment set includes the target video segment; the acquisition module 10 is further configured to: When the target video segment of the video needs to be downloaded, for each future video segment in the future video segment set, the segment size of the future video segment under each preset playback level in the preset playback level set is obtained.
[0068] In this embodiment, the decision module 20 is further configured to: The future network state sequence, the current player state, and the size of each future video segment in the future video segment set are input to the decision layer. The decision layer constructs a set of candidate playback paths based on the future network state sequence, the current player state, and all the segment sizes. Each candidate playback path in the set of candidate playback paths is used to indicate the playback level used for playing each of the future video segments in the future video segment set. The decision-making layer determines the target playback path from the set of candidate playback paths, and determines the playback level corresponding to the target video segment in the target playback path as the target playback level.
[0069] In this embodiment, the decision module 20 is further configured to: Based on preset segmentation rules, all future video segments in the future video segment set are divided to obtain multiple consecutive future video segments, and all future video segments within each future video segment use the same playback level. Based on preset pruning rules, candidate playback level sets corresponding to each future video segment are determined from the preset playback level set; Based on the association between the candidate playback level sets corresponding to each of the future video segments, an initial playback path set is constructed. Based on the future network state sequence, the current player state, and all the segment sizes, the initial playback path set is filtered to obtain a candidate playback path set.
[0070] In this embodiment, each initial playback path in the initial playback path set includes a candidate playback level for each future video segment in the future video segment set, and the candidate playback level is located within the candidate playback level set corresponding to the future video segment to which the future video segment belongs; the decision module 20 is further configured to: For each initial playback path in the initial playback path set, traverse each of the future video segments in the initial playback path according to the following steps, until all the future video segments in the initial playback path have been traversed: Based on the segment size of the future video segment under each preset playback level in the preset playback level set, determine the target segment size of the future video segment under the candidate playback level corresponding to the future video segment; Based on the future network state, the current player state, and the target segment size in the future network state sequence corresponding to the download of the future video segment, the buffer duration of the video player's buffer after downloading the target segment size is predicted, so as to obtain the predicted buffer duration corresponding to the future video segment. The current player state is updated using the predicted buffer duration, and the updated current player state is used to traverse the next future video segment. After traversing the initial playback path set, all initial playback paths that satisfy the first preset condition are determined from the initial playback path set. The first preset condition includes that the predicted buffer playback duration corresponding to each future video segment in the initial playback path is greater than a preset duration threshold. All initial playback paths that meet the first preset condition are determined as a set of candidate playback paths.
[0071] The video playback method provided in this embodiment further includes a determining module, which is used for: Obtain the device information of the device that the video player is equipped with; Based on the device information, a performance capability score for the device is determined; Based on the performance capability score, a preset pruning rule corresponding to the performance capability score is determined from a preset pruning rule set. The pruning intensity of the preset pruning rule decreases as the performance capability score increases.
[0072] In this embodiment, the decision module 20 is further configured to: For each candidate playback path in the candidate playback path set, determine the target value score corresponding to each candidate playback path; The highest target value score is determined from all the obtained value scores; The candidate playback path corresponding to the largest target value score in the candidate playback path set is determined as the target playback path.
[0073] This embodiment provides a video playback device that, when downloading a target video segment, obtains the current player state of the video player playing the video and the historical network state sequence of the network environment in which the video player is located. It then uses a trained target decision model to determine the playback level of the target video segment, and downloads and plays the target video segment based on the determined playback level. This ensures that the playback level decision fully combines the player state and historical network state characteristics, guaranteeing that the determined playback level adapts to complex network environments. It avoids the problem of poor adaptability to complex network dynamics caused by fixed parameters, thus balancing video playback smoothness and image quality in complex and ever-changing network environments, improving the user's viewing experience.
[0074] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 The illustrated electronic device 400 includes at least one processor 401, a memory 402, at least one network interface 404, and other user interfaces 403. The various components in the electronic device 400 are coupled together via a bus system 405. It is understood that the bus system 405 is used to implement communication between these components. In addition to a data bus, the bus system 405 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 4 The general designated all buses as Bus System 405.
[0075] The user interface 403 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).
[0076] It is understood that the memory 402 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 402 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0077] In some implementations, memory 402 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 4021 and application program 4022.
[0078] The operating system 4021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 4022 includes various applications, such as a media player and a browser, used to implement various application functions. Programs implementing the methods of this application embodiment can be included in application program 4022.
[0079] In this embodiment of the application, the processor 401 executes the method steps provided by each method embodiment by calling the program or instructions stored in the memory 402, specifically the program or instructions stored in the application program 4022.
[0080] The methods disclosed in the embodiments of this application can be applied to processor 401, or implemented by processor 401. Processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 401 or by instructions in the form of software. The processor 401 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 402. Processor 401 reads the information in memory 402 and, in conjunction with its hardware, completes the steps of the above method.
[0081] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0082] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0083] The electronic device provided in this embodiment may be as follows: Figure 4 The electronic device shown can perform the following: Figure 1 and Figure 2 All steps of the video playback method, thereby achieving Figure 1 and Figure 2 For details on the technical effects of the video playback method shown, please refer to [link / reference]. Figure 1 and Figure 2 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0084] This application also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; it may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; and it may also include combinations of the above types of memory.
[0085] One or more programs in the storage medium can be executed by one or more processors to implement the video playback method described above that is executed on the video playback device side.
[0086] The processor is used to execute a video playback program stored in the memory to implement the following steps of a video playback method executed on the video playback device side.
[0087] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0088] It should be noted that the terms "one implementation," "embodiment," "exemplary embodiment," and "some embodiments" used in the specification indicate that the described embodiment may include a specific feature, structure, or characteristic, but not every embodiment necessarily includes that specific feature, structure, or characteristic. Furthermore, such phrases do not necessarily refer to the same embodiment. Moreover, when a specific feature, structure, or characteristic is described in connection with an embodiment, implementing such a feature, structure, or characteristic in conjunction with other embodiments, whether explicitly described or not, is within the knowledge scope of those skilled in the art.
[0089] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A video playback method, characterized in that, include: When downloading a target video segment, obtain the current player state corresponding to the video player playing the video and the historical network state sequence of the network environment where the video player is located. Based on the current player state and the historical network state sequence, the target decision model that has been trained is used to make a decision on the playback level of the target video segment in order to obtain the target playback level. Based on the target playback level, download the target video segment; When it is necessary to play the target video segment, control the video player to play the downloaded target video segment.
2. The method according to claim 1, characterized in that, The target decision-making model includes a prediction layer and a decision-making layer; The step of determining the playback level of the target video segment based on the current player state and the historical network state sequence, using a trained target decision model, to obtain the target playback level, includes: The historical network state sequence is input into the prediction layer so that the prediction layer outputs the future network state sequence; The future network state sequence and the current player state are input to the decision layer, so that the decision layer can make a decision on the playback level of the target video segment to obtain the target playback level.
3. The method according to claim 2, characterized in that, The future network state sequence includes the future network state corresponding to each future video segment when downloading the future video segment set, and the future video segment set includes the target video segment; The method further includes: When the target video segment of the video needs to be downloaded, for each future video segment in the future video segment set, obtain the segment size of the future video segment under each preset playback level in the preset playback level set; The step of inputting the future network state sequence and the current player state to the decision layer, so that the decision layer makes a decision on the playback level of the target video segment to obtain the target playback level, includes: The future network state sequence, the current player state, and the size of each future video segment in the future video segment set are input to the decision layer. The decision layer constructs a set of candidate playback paths based on the future network state sequence, the current player state, and all the segment sizes. Each candidate playback path in the set of candidate playback paths is used to indicate the playback level used for playing each of the future video segments in the future video segment set. The decision-making layer determines the target playback path from the set of candidate playback paths, and determines the playback level corresponding to the target video segment in the target playback path as the target playback level.
4. The method according to claim 3, characterized in that, The process of constructing a candidate playback path set based on the future network state sequence, the current player state, and all the segment sizes includes: Based on preset segmentation rules, all future video segments in the future video segment set are divided to obtain multiple consecutive future video segments, and all future video segments within each future video segment use the same playback level. Based on preset pruning rules, candidate playback level sets corresponding to each future video segment are determined from the preset playback level set; Based on the association between the candidate playback level sets corresponding to each of the future video segments, an initial playback path set is constructed. Based on the future network state sequence, the current player state, and all the segment sizes, the initial playback path set is filtered to obtain a candidate playback path set.
5. The method according to claim 4, characterized in that, Each initial playback path in the initial playback path set includes a candidate playback level for playing each of the future video segments in the future video segment set in the future video segment set. The candidate playback level is located within the candidate playback level set corresponding to the future video segment to which the future video segment belongs. The initial playback path set is filtered based on the future network state sequence, the current player state, and all the segment sizes to obtain a candidate playback path set, including: For each initial playback path in the initial playback path set, traverse each of the future video segments in the initial playback path according to the following steps, until all the future video segments in the initial playback path have been traversed: Based on the segment size of the future video segment under each preset playback level in the preset playback level set, determine the target segment size of the future video segment under the candidate playback level corresponding to the future video segment; Based on the future network state, the current player state, and the target segment size in the future network state sequence corresponding to the download of the future video segment, the buffer duration of the video player's buffer after downloading the target segment size is predicted, so as to obtain the predicted buffer duration corresponding to the future video segment. The current player state is updated using the predicted buffer duration, and the updated current player state is used to traverse the next future video segment. After traversing the initial playback path set, all initial playback paths that satisfy the first preset condition are determined from the initial playback path set. The first preset condition includes that the predicted buffer playback duration corresponding to each future video segment in the initial playback path is greater than a preset duration threshold. All initial playback paths that meet the first preset condition are determined as a set of candidate playback paths.
6. The method according to claim 4, characterized in that, The preset pruning rules are determined in the following way: Obtain the device information of the device that the video player is equipped with; Based on the device information, a performance capability score for the device is determined; Based on the performance capability score, a preset pruning rule corresponding to the performance capability score is determined from a preset pruning rule set. The pruning intensity of the preset pruning rule decreases as the performance capability score increases.
7. The method according to claim 3, characterized in that, Determining the target playback path from the candidate playback path set includes: For each candidate playback path in the candidate playback path set, determine the target value score corresponding to each candidate playback path; The highest target value score is determined from all the obtained value scores; The candidate playback path corresponding to the largest target value score in the candidate playback path set is determined as the target playback path.
8. A video playback device, characterized in that, include: The acquisition module is used to acquire the current player status of the video player playing the video and the historical network status sequence of the network environment in which the video player is located when the target video segment to be downloaded is being acquired. The decision module is used to make a decision on the playback level of the target video segment based on the current player state and the historical network state sequence, using a trained target decision model, so as to obtain the target playback level. The download module is used to download the target video segment based on the target playback level; The playback module is used to control the video player to play the downloaded target video segment when it is necessary to play the target video segment.
9. An electronic device, characterized in that, include: A processor and a memory, the processor being configured to execute a video playback program stored in the memory to implement the video playback method according to any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the video playback method according to any one of claims 1 to 7.