Video playing optimization method and device, storage medium and computer equipment

By predicting network conditions, segmenting videos, expanding resolution specifications and dynamic adjustments, the problem that traditional video playback methods are difficult to ensure smoothness and quality is solved, and a more efficient video playback experience is achieved.

CN119583887APending Publication Date: 2025-03-07GUANGZHOU QUYAN NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411892350.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

Traditional video playback methods are difficult to ensure the smoothness and video quality of playback, especially in the case of network jitter or signal fluctuations.

Method used

By detecting video request instructions, obtaining network status information, predicting future network conditions, determining the video segmentation time, segmenting the video, and expanding multiple resolution specifications for each video segment. Select the resolution specification that matches the current network status when preloaded and dynamically adjust the resolution specification during video playback to adapt to the real-time network status.

Benefits of technology

It improves the loading efficiency of video segments, ensures the smoothness of video playback, and improves the quality of video playback while ensuring fluency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583887A_ABST
    Figure CN119583887A_ABST
Patent Text Reader

Abstract

The invention provides a video playing optimization method and device, a storage medium and computer equipment, and the method comprises the steps: determining a to-be-played video, obtaining the network state information to predict a future network condition, determining a segmentation time length according to the future network condition, segmenting the to-be-played video based on the segmentation time length, and carrying out the segmentation of the to-be-played video based on the segmentation time length. And the segmentation duration is adjusted according to the future network condition, so that bandwidth resources can be fully utilized when the video segments are loaded subsequently. The method comprises the following steps: firstly, for each video segment, expanding the video segment into video segments with various resolution specifications, and then selecting the video segment with the resolution specification matched with the current network condition for loading when the video segment is preloaded, so as to ensure the fluency of video playing. And the resolution specification of the video segment which is loaded after the current playing position but not played is dynamically adjusted according to the real-time network condition in the video playing process, so that the video playing quality is improved while the video playing fluency is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of streaming media technology, and in particular to a video playback optimization method, device, storage medium and computer equipment. Background Art

[0002] With the booming development of the Internet, video has become the core content presentation form of various Web applications. In this development process, the traditional video playback method mainly relies on the server to maintain a stable operating state and sufficient network bandwidth to achieve the purpose of quickly responding to the audience's playback request. That is, after receiving the user's video playback request, the server side efficiently retrieves storage resources and uses a stable and bandwidth-rich network connection to continuously transmit video data to Web applications.

[0003] However, in the process of traditional video playback, if the network jitter or the network signal fluctuates frequently, the video data transmission will be blocked, resulting in problems such as video playback freezes, the picture freezes, or the sound and picture are out of sync. In summary, traditional video playback methods are difficult to effectively guarantee the smoothness of playback and the quality of the played video. Summary of the invention

[0004] The purpose of the present application is to solve at least one of the above-mentioned technical defects, especially the technical defect that the video playback method in the prior art is difficult to effectively guarantee the smoothness of playback and the quality of the played video.

[0005] In a first aspect, the present application provides a video playback optimization method, the method comprising:

[0006] When a video request instruction is detected, a to-be-played video corresponding to the video request instruction is obtained, and network status information is obtained, and a future network status is predicted according to the network status information;

[0007] Determine the segment duration of the video to be played according to the future network status, and divide the video to be played according to the segment duration to obtain multiple video segments;

[0008] For each video segment, the video segment is expanded into video segments of multiple resolution specifications, and when preloading the video segment, a video segment of a resolution specification matching the current network condition is selected for loading; wherein each video segment of a resolution specification corresponds to a network condition;

[0009] During video playback, the resolution specifications of the video segments loaded after the current playback position are dynamically adjusted according to the real-time network conditions.

[0010] In one embodiment, obtaining the to-be-played video corresponding to the video request instruction includes:

[0011] Determine the video number requested by the browser according to the video request instruction;

[0012] Querying whether there is video data corresponding to the video number in a preset buffer pool, and if so, obtaining the video data corresponding to the video number from the buffer pool, and determining the video data as the video to be played;

[0013] If not, the target node closest to the browser is determined, and after sending the video request instruction to the target node, the video data corresponding to the video number sent by the target node is received, and the video data is determined as the video to be played.

[0014] In one embodiment, the method further comprises:

[0015] When the video data corresponding to the video number does not exist in the cache pool and the video data corresponding to the video number sent by the target node is received, determining a current network status, and determining a cache segment length according to the current network status;

[0016] Determine whether the free space in the buffer pool meets a preset condition, and if so, gradually cache the video data into the buffer pool according to the buffer segment length;

[0017] If not satisfied, the user behavior data corresponding to the browser is determined, and after determining replaceable data in the cache pool according to the user behavior data, the replaceable data is gradually replaced with the video data according to the cache segment length.

[0018] In one embodiment, the acquiring network status information and predicting future network status according to the network status information includes:

[0019] Determine multiple data sources and obtain historical network information from each data source to form network status information;

[0020] Preprocessing the network status information, and inputting the preprocessed network status information into a preset network prediction model;

[0021] Based on the network prediction model, the linear trend and the periodic fluctuation in the preprocessed network status information are captured to determine the future network status according to the linear trend and the periodic fluctuation.

[0022] In one embodiment, the step of expanding the video segment into video segments with multiple resolution specifications, and selecting a video segment with a resolution specification matching the current network condition for loading when preloading the video segment, includes:

[0023] Obtaining a preset resolution specification configuration, and determining multiple resolution specifications according to the resolution specification configuration;

[0024] Importing the video segment into a preset video processing tool, and writing the determined multiple resolution specifications into the export setting of the video processing tool to expand the video segment, thereby obtaining the video segment with the determined multiple resolution specifications after the video segment is expanded;

[0025] When the video segment is preloaded into a preset playback queue, the current network status is obtained, and after searching the preset mapping table for the resolution specification corresponding to the current network status, the video segment with the resolution specification corresponding to the current network status is selected from the video segments with multiple resolution specifications determined after expansion of the video segment for loading.

[0026] In one embodiment, dynamically adjusting the resolution specification of the video segment loaded after the current playback position according to the real-time network status during the video playback process includes:

[0027] Detecting network conditions in real time to obtain real-time network conditions, and determining a magnitude and direction of change of the network conditions according to the real-time network conditions;

[0028] When the change direction is from low network quality to high network quality, determine whether the change magnitude reaches a preset threshold, and if so, replace the video segment loaded after the current playback position with a corresponding video segment with a resolution specification higher than the current resolution specification;

[0029] When the change direction is from high network quality to low network quality, it is determined whether the change magnitude reaches the preset threshold. If so, the video segment loaded after the current playback position is replaced with a corresponding video segment with a resolution specification lower than the current resolution specification.

[0030] In one embodiment, dynamically adjusting the resolution specification of the video segment loaded after the current playback position according to the real-time network status during the video playback process includes:

[0031] Detecting network status in real time to obtain real-time network status, and determining a change direction of the network status according to the real-time network status;

[0032] Performing importance analysis on the video segments loaded after the current playback position to determine at least one key frame video in the video segments loaded after the current playback position;

[0033] When the change direction is from low network quality to high network quality, each key frame video in the video segment loaded after the current playback position is replaced with a corresponding video segment with a resolution specification higher than the current resolution specification;

[0034] When the change direction is from high network quality to low network quality, the video segments except the key frame video in the video segments loaded after the current playback position are replaced with corresponding video segments with a resolution specification lower than the current resolution specification.

[0035] In a second aspect, the present application provides a video playback optimization device, the device comprising:

[0036] The instruction receiving module is used to obtain the to-be-played video corresponding to the video request instruction and obtain network status information when a video request instruction is detected, and predict the future network status according to the network status information;

[0037] A video segmentation module, used to determine the segment duration of the video to be played according to the future network status, and segment the video to be played according to the segment duration to obtain multiple video segments;

[0038] The video extension module is used to expand each video segment into video segments of multiple resolution specifications, and when preloading the video segment, select the video segment of the resolution specification matching the current network status for loading; wherein each video segment of the resolution specification corresponds to a network status;

[0039] The dynamic adjustment module is used to dynamically adjust the resolution specifications of the video segments loaded after the current playback position according to the real-time network conditions during the video playback process.

[0040] In a third aspect, the present application provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the video playback optimization method described in any of the above embodiments.

[0041] In a fourth aspect, the present application provides a computer device, comprising: one or more processors, and a memory;

[0042] The memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, the steps of the video playback optimization method described in any one of the above embodiments are performed.

[0043] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0044] The video playback optimization method, device, storage medium and computer equipment provided by the present application include: when a video request instruction is detected and the video to be played is determined based on it, the network status information is obtained, and the future network status is predicted based on the network status information, and then the segment duration of the video to be played is determined based on the future network status, so as to divide the video to be played based on the segment duration, and determine a longer segment duration when the future network status is good, and determine a shorter segment duration when the future network status is poor, so that the bandwidth resources can be fully utilized when the video segment is subsequently loaded, and the loading efficiency of the video segment is improved. Then, for each video segment, the video segment is expanded into video segments with multiple resolution specifications, and then when the video segment is preloaded, the video segment with a resolution specification that matches the current network status is selected for loading. In addition, during the video playback process, the resolution specification of the video segment loaded after the current playback position will be dynamically adjusted according to the real-time network status. In this way, on the one hand, video segments with resolution specifications that match the current network conditions can be pre-loaded to ensure smooth video playback. On the other hand, the resolution specifications of subsequent loaded but not played video segments can be dynamically adjusted according to the real-time network conditions during video playback, thereby maximizing the quality of video playback while ensuring smooth video playback. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0046] Figure 1 A flowchart of a video playback optimization method provided in an embodiment of the present application;

[0047] Figure 2 A schematic diagram of a process for obtaining a video to be played corresponding to a video request instruction provided in an embodiment of the present application;

[0048] Figure 3 A schematic diagram of a process for obtaining network status information and predicting future network status based on the network status information provided in an embodiment of the present application;

[0049] Figure 4 A schematic diagram of the structure of a video playback optimization device provided in an embodiment of the present application;

[0050] Figure 5 An internal structure diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0052] In one of the embodiments, the present application provides a video playback optimization method. The following embodiments are described by applying the method to a Web application client, hereinafter referred to as the client.

[0053] like Figure 1 As shown, the present application provides a video playback optimization method, the method comprising:

[0054] S101: When a video request instruction is detected, a to-be-played video corresponding to the video request instruction is obtained, and network status information is obtained, and future network status is predicted according to the network status information.

[0055] In this step, when the client initiates a video request instruction to the corresponding server, the video request instruction initiated by the client is detected by the service plug-in pre-set on the client. When the service plug-in detects that the client initiates a video request instruction, the service plug-in will intercept the detected video request instruction and then determine the corresponding video to be played according to the video request instruction. Then, the client can obtain network status information to predict the future network status based on the network status information.

[0056] Among them, the future network status is used to measure the network performance and network status in the future. Network status information refers to various data related to network connection and network activity, including but not limited to bandwidth, delay, jitter, download speed, upload speed, etc. In addition, in one example, the service plug-in can be built based on the Service Worker script, which can run independently on the client and can enhance the functionality and performance of the Web application.

[0057] Specifically, when the client obtains the network status information, the network status information can be used as sequence data based on the time dimension to perform time series analysis, and then determine the future network status according to the result of the time series analysis.

[0058] 102: Determine the segment duration of the video to be played according to the future network condition, and divide the video to be played according to the segment duration to obtain multiple video segments.

[0059] In this step, when the future network status is predicted based on the network status information, the segment durations of the video to be played are determined according to the future network status, and then the video to be played is segmented into fixed durations according to the segment durations, thereby obtaining multiple fixed-length video segments separated from the video to be played.

[0060] Furthermore, in the process of determining the segment duration of the video to be played according to the future network status, the network status level can be determined according to the future network status, and then the preset relationship table is queried based on the network status level to determine the segment duration corresponding to the network status level, and finally the queried segment duration is determined as the segment duration of the video to be played. In addition, the preset duration determination model can be trained according to the previously determined future network status and the corresponding segment duration. When the training is completed, the final duration determination model will be obtained, and then the network status information will be input into the duration determination model to obtain the segment duration of the video to be played. The present application does not impose specific restrictions on the implementation of this process.

[0061] It is understandable that by determining the segment duration of the video to be played based on the future network conditions and segmenting the video to be played based on the segment duration, on the one hand, a longer segment duration can be determined when the network conditions are good in the future, so as to make full use of network bandwidth resources and further improve the efficiency of subsequent loading of video segments. On the other hand, a shorter segment duration can be determined when the network conditions are poor in the future, so as to avoid the subsequent loading of overly long video segments due to insufficient network bandwidth resources or poor network stability, thereby ensuring the efficiency of subsequent loading of video segments.

[0062] S103: for each video segment, expand the video segment into video segments with multiple resolution specifications, and when preloading the video segment, select the video segment with a resolution specification matching the current network condition for loading.

[0063] Each video segment of a resolution specification corresponds to a network condition. The resolution specification can be used to measure the fineness of the video. In an example, the resolution specification can be divided into low definition, standard definition, and high definition.

[0064] In this step, for each video segment obtained by segmentation, the video segment is expanded into video segments with multiple resolution specifications, that is, multiple video segments with different resolution specifications can be obtained for the video segment. Then, when preloading the video segment, a video segment with a resolution specification matching the current network status can be selected from the multiple video segments with different resolution specifications obtained above, and the selected video segment can be loaded.

[0065] S104: During the video playback process, dynamically adjust the resolution specifications of the video segments loaded after the current playback position according to the real-time network status.

[0066] In this step, when multiple video segments have been loaded, the client can play the loaded video segments in sequence. During the video playback process, the client will detect the network status in real time, and then dynamically adjust the resolution specifications of the video segments loaded after the current playback position according to the real-time network status.

[0067] Specifically, the client can start video playback after loading all video segments, or can start video playback after loading a portion of video segments, and gradually load subsequent unloaded video segments during video playback. This application does not make specific restrictions on this.

[0068] For example, it is assumed that the video A to be played is segmented into video segment a, video segment b and video segment c. When the client has loaded video segment a, video segment b and video segment c, the client plays the loaded video segments. When playing video segment a, dynamic adjustment is triggered due to real-time network status changes. In this case, the resolution specifications of the video segments (video segment b and video segment c) loaded after video segment a can be adjusted.

[0069] It can be understood that, on the premise that all or part of the video segments have been loaded, the resolution specifications of the subsequent video segments to be played are adjusted according to the real-time network conditions. At this time, since all or part of the video segments have been loaded, the smoothness of the video playback can be guaranteed. On this basis, if the real-time network conditions improve, the resolution specifications of the subsequent video segments that have not been played can be adjusted to improve the quality of the played video without affecting the smoothness of the playback. If the real-time network conditions deteriorate, the resolution specifications of the subsequent video segments that have not been played can be adjusted to ensure the smoothness of the video playback in the future as much as possible.

[0070] The video playback optimization method, device, storage medium and computer equipment provided by the present application include: when a video request instruction is detected and the video to be played is determined based on it, the network status information is obtained, and the future network status is predicted based on the network status information, and then the segment duration of the video to be played is determined based on the future network status, so as to divide the video to be played based on the segment duration, and determine a longer segment duration when the future network status is good, and determine a shorter segment duration when the future network status is poor, so that the bandwidth resources can be fully utilized when the video segment is subsequently loaded, and the loading efficiency of the video segment is improved. Then, for each video segment, the video segment is expanded into video segments with multiple resolution specifications, and then when the video segment is preloaded, the video segment with a resolution specification that matches the current network status is selected for loading. In addition, during the video playback process, the resolution specification of the video segment loaded after the current playback position will be dynamically adjusted according to the real-time network status. In this way, on the one hand, video segments with resolution specifications that match the current network conditions can be pre-loaded to ensure smooth video playback. On the other hand, the resolution specifications of subsequent loaded but not played video segments can be dynamically adjusted according to the real-time network conditions during video playback, thereby maximizing the quality of video playback while ensuring smooth video playback.

[0071] like Figure 2 As shown, in one embodiment, obtaining a to-be-played video corresponding to a video request instruction includes:

[0072] S201: Determine the video number requested by the browser according to the video request instruction.

[0073] Specifically, each video uniquely corresponds to a video number. When initiating a video request instruction, the client will carry the video number corresponding to the video it wants to request, and then can obtain the corresponding video resource according to the video number.

[0074] S202: Query whether there is video data corresponding to the video number in a preset buffer pool.

[0075] In this step, a preset cache pool is first determined, and then a traversal query is performed in the cache pool based on the video number. When video data matching the video number is queried, it indicates that video data corresponding to the video number exists in the cache pool. When video data matching the video number is not queried after traversing the cache pool, it indicates that video data corresponding to the video number does not exist in the cache pool.

[0076] Specifically, the cache pool refers to a database for caching video data. By setting the cache pool, frequent access to the server can be avoided and the response speed to the video request instruction can be improved.

[0077] S203: If so, obtain the video data corresponding to the video number from the buffer pool, and determine the video data as the video to be played.

[0078] When video data corresponding to the video number exists in the buffer pool, the video data is obtained from the buffer pool and determined as the video to be played.

[0079] S204: If it does not exist, determine the target node closest to the browser, send a video request instruction to the target node, receive the video data corresponding to the video number sent by the target node, and determine the video data as the video to be played.

[0080] When there is no video data corresponding to the video number in the cache pool, the geographical location of the browser client can be determined first, and then the CDN server (target node) closest to the browser client can be selected according to the determined geographical location, and then the video request instruction is sent to the target node. When the target node receives the video request instruction, it will parse the video request instruction to determine the video number and send the video data corresponding to the video number to the browser client. After receiving the video data corresponding to the video number sent by the target node, the browser client determines the video data as the video to be played.

[0081] It is understandable that this embodiment can reduce resource requests to the server and reduce server pressure by giving priority to reading data from the cache pool, while also improving the efficiency of obtaining video data. In addition, when the cache pool cannot hit the cache, the node closest to the client is selected to request video data to improve the response speed of the request.

[0082] In another embodiment, when determining the target node, the target node may be determined by evaluating the idle resources of each node, or the target node may be determined by comprehensively considering the distance and the idle resources.

[0083] In one embodiment, the video playback optimization method further includes:

[0084] S1: When there is no video data corresponding to the video number in the cache pool and the video data corresponding to the video number sent by the target node is received, the current network status is determined, and the cache segment length is determined according to the current network status.

[0085] When there is no video data corresponding to the video number in the cache pool, and the video data corresponding to the video number sent by the target node is received, the finally obtained video data will be cached in the cache pool. In this process, the current network status can be determined first, and then the corresponding cache segment length can be determined according to the current network status. Among them, each network status corresponds to a cache segment length. Based on this, when determining the cache segment length, the correspondence between the preset network status and the cache segment length can be obtained, and the cache segment length corresponding to the current network status can be determined based on the correspondence.

[0086] S2: Determine whether the free space in the buffer pool meets a preset condition. If so, cache the video data gradually into the buffer pool according to the buffer segment length.

[0087] The preset condition is that the free space in the buffer pool is greater than or equal to the space required for buffering video data.

[0088] S3: If not satisfied, determine the user behavior data corresponding to the browser, and after determining replaceable data in the cache pool according to the user behavior data, gradually replace the replaceable data with video data according to the cache segment length.

[0089] Among them, user behavior data refers to various data information generated when users interact with browser clients. User behavior data includes but is not limited to viewing habits, viewing frequency, length of stay, etc.

[0090] In this embodiment, when the free space in the buffer pool is sufficient to cache the video data, the video data is gradually cached in the buffer pool according to the length of the buffer segment. When the free space in the buffer pool is insufficient to cache the video data, the client will determine the user behavior data, and then perform a hit probability score on each video data in the buffer pool based on the user behavior data, so that one or more video data with the lowest score in the hit probability score can be determined as replaceable data under the premise of sufficient free space. Finally, the replaceable data is gradually replaced with the video data to be cached according to the length of the buffer segment.

[0091] It is understandable that the cache segment length is adjusted according to the current network conditions, and the video data is gradually cached based on the cache segment length. In this way, a longer cache segment length can be set when the current network conditions are good to reduce the number of caches and make full use of network resources. At the same time, a longer cache segment length can be set when the current network conditions are poor to avoid network jitter. Moreover, when the free space in the cache pool is insufficient to cache video data, replaceable data with a low cache hit rate in the cache pool can be determined based on user behavior data. This cache replacement strategy can maximize the hit rate of the cache pool and further improve the response speed of video request instructions.

[0092] like Figure 3 As shown, in one embodiment, obtaining network status information and predicting future network status according to the network status information includes:

[0093] S301: Determine multiple data sources, and obtain historical network information from each data source to form network status information.

[0094] In this step, multiple data sources related to network performance and network status are determined, and then network information over a period of time in the past is obtained from each of the determined data sources as historical network information. The historical network information obtained from each data source is then summarized to obtain network status information.

[0095] Specifically, the multiple data sources include but are not limited to WebRTC measurements, Ping requests, NetworkInformation API, etc.

[0096] S302: pre-processing the network status information, and inputting the pre-processed network status information into a preset network prediction model.

[0097] In this step, the client can select one or more processing methods of averaging, smoothing and weighting to pre-process the network status information to improve the accuracy of the network status information. Then, the pre-processed network status information is input into the pre-trained network prediction model to infer the pre-processed network status information based on the network prediction model.

[0098] S303: Capturing the linear trend and periodic fluctuation in the preprocessed network status information based on the network prediction model, so as to determine the future network status according to the linear trend and periodic fluctuation.

[0099] In this step, the linear trend and periodic fluctuations in the preprocessed network status information are captured based on the network prediction model, where the linear trend can describe the changing trend of the network status information over time, and the periodic fluctuation can describe the fluctuation change of the network status information in a certain period. Then, the linear trend and periodic fluctuation are used to predict the future network status.

[0100] Specifically, the network prediction model of the present application can be obtained by using pre-processed network status information samples as training samples, using the future network status corresponding to the training samples as sample labels, and using the loss function to train the preset pre-trained model. During the training process, the server can input the training samples and their corresponding sample labels into the pre-trained model for forward propagation, and use the loss function in the back propagation of the pre-trained model to adjust the parameters of the pre-trained model until the pre-trained model meets certain iteration conditions. The pre-trained model that has been trained can be used as the network prediction model. In addition, after obtaining the network prediction model, it can be updated regularly or irregularly using the latest sample data.

[0101] In this embodiment, the future network status is determined by capturing the linear trend and periodic fluctuations in the preprocessed network status information, so as to ensure the accuracy of the future network status as much as possible, so that the subsequent video segmentation based on the future network status can fit the network situation as much as possible and maximize the use of network resources.

[0102] In one embodiment, the video segment is expanded into video segments with multiple resolution specifications, and when preloading the video segment, a video segment with a resolution specification matching the current network condition is selected for loading, including:

[0103] S1: Obtain a preset resolution specification configuration, and determine multiple resolution specifications according to the resolution specification configuration.

[0104] S2: Importing the video segment into a preset video processing tool, and writing the determined multiple resolution specifications into the export setting of the video processing tool to expand the video segment, thereby obtaining a video segment with multiple resolution specifications determined after the video segment is expanded.

[0105] S3: When preloading the video segment into a preset playback queue, the current network status is obtained, and after searching the preset mapping table for a resolution specification corresponding to the current network status, a video segment with a resolution specification corresponding to the current network status is selected from the video segments with multiple resolution specifications determined after expansion of the video segment for loading.

[0106] In this embodiment, multiple resolution specifications are determined by pre-setting the resolution specification configuration, and then the video segment is imported into the video processing tool, and the multiple resolution specifications determined above are written into the export settings of the video processing tool, so that the video processing tool expands the video segment based on the export settings to obtain the video segment with multiple resolution specifications determined after the expansion. Then, when the video segment is preloaded into the play queue, the current network status and the preset mapping table are obtained, and the resolution specification corresponding to the current network status is determined in the mapping table, and finally the video segment with the determined resolution specification is selected from the video segments with multiple resolution specifications obtained by expansion for loading.

[0107] The mapping table is used to record the correspondence between the network status and the resolution specification. The video processing tool can be used to perform video processing operations such as editing and expansion on the video data. In one example, the video processing tool can be Shotcut, DaVinci Resolve or FFmpeg plug-in, etc. This application does not make specific restrictions on this.

[0108] Specifically, when loading video segments into the playback queue, a resolution specification is determined according to the current network conditions, and based on the resolution specification, each video segment that meets the resolution specification is loaded into the playback queue. This can determine the smoothness of subsequent video playback on the one hand, and on the other hand, it can determine a suitable resolution specification based on the current network conditions to improve the video playback quality while ensuring the smoothness of subsequent video playback.

[0109] In one embodiment, during video playback, the resolution specification of the video segment loaded after the current playback position is dynamically adjusted according to the real-time network status, including:

[0110] S1: Detect the network status in real time to obtain the real-time network status, and determine the change magnitude and change direction of the network status according to the real-time network status.

[0111] The magnitude of change refers to the level of change in network conditions.

[0112] In this step, the change magnitude and change direction of the network status can be determined by comparing the currently acquired real-time network status with the real-time network status at the previous moment.

[0113] S2: When the change direction is from low network quality to high network quality, determine whether the change magnitude reaches a preset threshold. If so, replace the video segment loaded after the current playback position with a corresponding video segment with a resolution specification higher than the current resolution specification.

[0114] S3: When the change direction is from high network quality to low network quality, determine whether the magnitude of the change reaches a preset threshold. If so, replace the video segment loaded after the current playback position with a corresponding video segment with a resolution specification lower than the current resolution specification.

[0115] The preset threshold is an empirical value and can be set and adjusted according to actual conditions. The current resolution specification refers to the resolution specification of the video segment to be replaced.

[0116] In this embodiment, when the magnitude of the change reaches a preset threshold, it indicates that the network status has changed significantly. At this time, the video segment loaded after the current playback position can be replaced with a corresponding video segment with a resolution specification lower or higher than the current resolution specification according to the change direction. In this process, the resolution specification after replacement can be determined according to the real-time network status. When the magnitude of the change does not reach the preset threshold, the resolution specification of the video segment loaded after the current playback position is not adjusted.

[0117] It is understandable that in the process of dynamically adjusting the resolution, if the real-time network conditions improve, the resolution specifications of the subsequent unplayed video segments can be increased, thereby improving the quality of the played video without affecting the smoothness of the playback; if the real-time network conditions deteriorate, the resolution specifications of the subsequent unplayed video segments can be reduced, thereby ensuring the smoothness of the video playback in the future as much as possible.

[0118] In one embodiment, during video playback, the resolution specification of the video segment loaded after the current playback position is dynamically adjusted according to the real-time network status, including:

[0119] S1: Detect the network status in real time to obtain the real-time network status and determine the change direction of the network status according to the real-time network status.

[0120] The description of this step can refer to the description of S1 in the previous embodiment.

[0121] S2: Perform importance analysis on the video segments loaded after the current playback position to determine at least one key frame video in the video segments loaded after the current playback position.

[0122] In this step, the client can perform importance analysis on the video segments loaded after the current playback position, obtain the importance score of each video segment loaded after the current playback position, and then determine the video segments with a score higher than the preset score as key frame videos. The importance score is used to measure the perception of the video segment during the complete video playback process.

[0123] Furthermore, when performing importance analysis on video segments, the client can score the video segments based on preset analysis rules, or perform importance analysis on the video segments through a pre-trained deep learning model and obtain importance scores. This application does not impose specific restrictions on this.

[0124] S3: When the change direction is from low network quality to high network quality, each key frame video in the video segment loaded after the current playback position is replaced with a corresponding video segment with a resolution specification higher than the current resolution specification.

[0125] S4: When the change direction is from high network quality to low network quality, the video segments other than the key frame video in the video segments loaded after the current playback position are replaced with corresponding video segments with a resolution specification lower than the current resolution specification.

[0126] The current resolution specification refers to the resolution specification of the replaced video segment. The resolution specification after replacement can be determined according to the real-time network status.

[0127] In this embodiment, when the real-time network status changes, each key frame video is directly replaced according to the change direction, so that even if the network status changes slightly, network resources can be fully utilized as much as possible. Moreover, since the key frame video is the video with the highest perception of each video segment in the complete video playback, even if only the resolution specification of the key frame video is increased or only the resolution specification of other video segments except the key frame video is reduced, the quality of the played video can be improved or maintained as much as possible. In this way, the quality of the played video is maintained to the greatest extent while saving network resources, and the user's viewing experience is guaranteed.

[0128] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0129] The video playback optimization device provided in an embodiment of the present application is described below. The video playback optimization device described below and the video playback optimization method described above can be referenced to each other.

[0130] like Figure 4 As shown, the present application provides a video playback optimization device 400, the device comprising:

[0131] The instruction receiving module 401 is used to obtain the to-be-played video corresponding to the video request instruction and obtain network status information when a video request instruction is detected, and predict the future network status according to the network status information;

[0132] The video segmentation module 402 is used to determine the segment duration of the video to be played according to the future network status, and to segment the video to be played according to the segment duration to obtain multiple video segments;

[0133] The video expansion module 403 is used to expand each video segment into video segments of multiple resolution specifications, and when preloading the video segment, select the video segment of the resolution specification matching the current network status for loading; wherein each video segment of the resolution specification corresponds to a network status;

[0134] The dynamic adjustment module 404 is used to dynamically adjust the resolution specifications of the video segments loaded after the current playback position according to the real-time network status during the video playback process.

[0135] In one embodiment, the instruction receiving module includes:

[0136] The number determination submodule is used to determine the video number requested by the browser according to the video request instruction;

[0137] The data query submodule is used to query whether there is video data corresponding to the video number in the preset buffer pool. If so, the video data corresponding to the video number is obtained from the buffer pool, and the video data is determined as the video to be played;

[0138] The request forwarding submodule is used to determine the target node closest to the browser if it does not exist, and after sending a video request instruction to the target node, receive the video data corresponding to the video number sent by the target node, and determine the video data as the video to be played.

[0139] In one embodiment, the instruction receiving module further includes:

[0140] A cache length determination submodule, for determining the current network status when the video data corresponding to the video number does not exist in the cache pool and the video data corresponding to the video number sent by the target node is received, and determining the cache segment length according to the current network status;

[0141] A first cache submodule is used to determine whether the free space in the cache pool meets a preset condition, and if so, gradually cache the video data into the cache pool according to the cache segment length;

[0142] The second cache submodule is used to determine the user behavior data corresponding to the browser if it is not satisfied, and after determining the replaceable data in the cache pool according to the user behavior data, gradually replace the replaceable data with video data according to the cache segment length.

[0143] In one embodiment, the instruction receiving module includes:

[0144] A data source determination submodule is used to determine multiple data sources and obtain historical network information from each data source to form network status information;

[0145] The information preprocessing submodule is used to preprocess the network status information and input the preprocessed network status information into a preset network prediction model;

[0146] The network prediction submodule is used to capture the linear trend and periodic fluctuation in the preprocessed network status information based on the network prediction model, so as to determine the future network status according to the linear trend and periodic fluctuation.

[0147] In one embodiment, the video extension module includes:

[0148] The configuration acquisition submodule is used to acquire a preset resolution specification configuration and determine multiple resolution specifications according to the resolution specification configuration;

[0149] The video extension submodule is used to import the video segment into a preset video processing tool, and write the determined multiple resolution specifications into the export setting of the video processing tool to extend the video segment, so as to obtain the video segment of the multiple resolution specifications determined after the video segment is extended;

[0150] The video loading submodule is used to obtain the current network status when preloading the video segment into the preset playback queue, and after querying the resolution specification corresponding to the current network status in the preset mapping table, select the video segment with the resolution specification corresponding to the current network status from the video segments with multiple resolution specifications determined after expansion of the video segment for loading.

[0151] In one embodiment, the dynamic adjustment module includes:

[0152] The first detection submodule is used to detect the network status in real time to obtain the real-time network status and determine the change magnitude and change direction of the network status according to the real-time network status;

[0153] The first adjustment submodule is used to determine whether the magnitude of the change reaches a preset threshold when the change direction is from low network quality to high network quality. If so, the video segment loaded after the current playback position is replaced with a corresponding video segment with a resolution specification higher than the current resolution specification.

[0154] The second adjustment submodule is used to determine whether the magnitude of the change reaches a preset threshold when the change direction is from high network quality to low network quality. If so, the video segment loaded after the current playback position is replaced with a corresponding video segment with a resolution specification lower than the current resolution specification.

[0155] In one embodiment, the dynamic adjustment module includes:

[0156] The second inspection submodule is used to detect the network status in real time to obtain the real-time network status and determine the change direction of the network status according to the real-time network status;

[0157] An analysis submodule, configured to perform importance analysis on the video segments loaded after the current playback position, so as to determine at least one key frame video in the video segments loaded after the current playback position;

[0158] The third adjustment submodule is used to replace each key frame video in the video segment loaded after the current playback position with a corresponding video segment with a resolution specification higher than the current resolution specification when the change direction changes from low network quality to high quality;

[0159] The fourth adjustment submodule is used to replace the video segments other than the key frame video in the video segments loaded after the current playback position with corresponding video segments with a resolution specification lower than the current resolution specification when the change direction is from high network quality to low network quality.

[0160] The division of each module in the above-mentioned video playback optimization device is only for illustration. In other embodiments, the video playback optimization device can be divided into different modules as needed to complete all or part of the functions of the above-mentioned video playback optimization device. Each module in the above-mentioned video playback optimization device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0161] In one embodiment, the present application also provides a storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the video playback optimization method described in any of the above embodiments.

[0162] In one embodiment, the present application also provides a computer device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the video playback optimization method as described in any one of the above embodiments.

[0163] Indicatively, Figure 5 As shown, Figure 5 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 500 may be provided as a server. Figure 5 , the computer device 500 includes a processing component 502, which further includes one or more processors, and a memory resource represented by a memory 501, for storing instructions that can be executed by the processing component 502, such as an application. The application stored in the memory 501 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 502 is configured to execute instructions to perform the video playback optimization method of any of the above embodiments.

[0164] The computer device 500 may further include a power supply component 503 configured to perform power management of the computer device 500, a wired or wireless network interface 504 configured to connect the computer device 500 to a network, and an input / output (I / O) interface 505. The computer device 500 may operate based on an operating system stored in the memory 501, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.

[0165] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0166] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish an entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only include those elements, but also include other elements that are not clearly listed, or also include elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. Herein, the singular "one", "one" and "described / the" may also include plural forms, unless the context clearly indicates another way. It should also be understood that the terms "include / comprise" or "have" etc. specify the existence of stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the existence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.

[0167] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0168] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A video playback optimization method, characterized in that: The method comprises: When a video request instruction is detected, a to-be-played video corresponding to the video request instruction is obtained, and network status information is obtained, and a future network status is predicted according to the network status information; Determine the segment duration of the video to be played according to the future network status, and divide the video to be played according to the segment duration to obtain multiple video segments; For each video segment, the video segment is expanded into video segments of multiple resolution specifications, and when preloading the video segment, a video segment of a resolution specification matching the current network condition is selected for loading; wherein each video segment of a resolution specification corresponds to a network condition; During video playback, the resolution specifications of the video segments loaded after the current playback position are dynamically adjusted according to the real-time network conditions.

2. The video playback optimization method according to claim 1, characterized in that: The obtaining of the to-be-played video corresponding to the video request instruction includes: Determine the video number requested by the browser according to the video request instruction; Querying whether there is video data corresponding to the video number in a preset buffer pool, and if so, obtaining the video data corresponding to the video number from the buffer pool, and determining the video data as the video to be played; If not, the target node closest to the browser is determined, and after sending the video request instruction to the target node, the video data corresponding to the video number sent by the target node is received, and the video data is determined as the video to be played.

3. The video playback optimization method according to claim 2, characterized in that: The method further comprises: When the video data corresponding to the video number does not exist in the cache pool and the video data corresponding to the video number sent by the target node is received, determining a current network status, and determining a cache segment length according to the current network status; Determine whether the free space in the buffer pool meets a preset condition, and if so, gradually cache the video data into the buffer pool according to the buffer segment length; If not satisfied, the user behavior data corresponding to the browser is determined, and after determining replaceable data in the cache pool according to the user behavior data, the replaceable data is gradually replaced with the video data according to the cache segment length.

4. The video playback optimization method according to claim 1, characterized in that: The obtaining of network status information and predicting future network status according to the network status information includes: Determine multiple data sources and obtain historical network information from each data source to form network status information; Preprocessing the network status information, and inputting the preprocessed network status information into a preset network prediction model; Based on the network prediction model, the linear trend and the periodic fluctuation in the preprocessed network status information are captured to determine the future network status according to the linear trend and the periodic fluctuation.

5. The video playback optimization method according to claim 1, characterized in that: The step of expanding the video segment into video segments with multiple resolution specifications, and selecting a video segment with a resolution specification matching the current network condition for loading when preloading the video segment, includes: Obtaining a preset resolution specification configuration, and determining multiple resolution specifications according to the resolution specification configuration; Importing the video segment into a preset video processing tool, and writing the determined multiple resolution specifications into the export setting of the video processing tool to expand the video segment, thereby obtaining the video segment with the determined multiple resolution specifications after the video segment is expanded; When the video segment is preloaded into a preset playback queue, the current network status is obtained, and after searching the preset mapping table for the resolution specification corresponding to the current network status, the video segment with the resolution specification corresponding to the current network status is selected from the video segments with multiple resolution specifications determined after expansion of the video segment for loading.

6. The video playback optimization method according to any one of claims 1 to 5, characterized in that: The method of dynamically adjusting the resolution specification of the video segment loaded after the current playback position according to the real-time network status during the video playback process includes: Detecting network conditions in real time to obtain real-time network conditions, and determining a magnitude and direction of change of the network conditions according to the real-time network conditions; When the change direction is from low network quality to high network quality, determine whether the change magnitude reaches a preset threshold, and if so, replace the video segment loaded after the current playback position with a corresponding video segment with a resolution specification higher than the current resolution specification; When the change direction is from high network quality to low network quality, it is determined whether the change magnitude reaches the preset threshold. If so, the video segment loaded after the current playback position is replaced with a corresponding video segment with a resolution specification lower than the current resolution specification.

7. The video playback optimization method according to any one of claims 1 to 5, characterized in that: The method of dynamically adjusting the resolution specification of the video segment loaded after the current playback position according to the real-time network status during the video playback process includes: Detecting network status in real time to obtain real-time network status, and determining a change direction of the network status according to the real-time network status; Performing importance analysis on the video segments loaded after the current playback position to determine at least one key frame video in the video segments loaded after the current playback position; When the change direction is from low network quality to high network quality, each key frame video in the video segment loaded after the current playback position is replaced with a corresponding video segment with a resolution specification higher than the current resolution specification; When the change direction is from high network quality to low network quality, the video segments except the key frame video in the video segments loaded after the current playback position are replaced with corresponding video segments with a resolution specification lower than the current resolution specification.

8. A video playback optimization device, characterized in that: The device comprises: The instruction receiving module is used to obtain the to-be-played video corresponding to the video request instruction and obtain network status information when a video request instruction is detected, and predict the future network status according to the network status information; A video segmentation module, used to determine the segment duration of the video to be played according to the future network status, and segment the video to be played according to the segment duration to obtain multiple video segments; The video extension module is used to expand each video segment into video segments of multiple resolution specifications, and when preloading the video segment, select the video segment of the resolution specification matching the current network status for loading; wherein each video segment of the resolution specification corresponds to a network status; The dynamic adjustment module is used to dynamically adjust the resolution specifications of the video segments loaded after the current playback position according to the real-time network conditions during the video playback process.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the video playback optimization method as described in any one of claims 1 to 7.

10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the video playback optimization method according to any one of claims 1 to 7 are performed.