A video transcoding decision method, apparatus, device and medium

By adaptively measuring the traffic distribution of short video platforms, using traffic prediction and weight models to calculate transcoding efficiency values, and selecting target videos for transcoding, the problem of low utilization efficiency of computing resources on short video platforms is solved, achieving maximum utilization and efficiency optimization of transcoding resources.

CN118741141BActive Publication Date: 2025-11-04TSINGHUA SHENZHEN INTERNATIONAL GRADUATE SCHOOL +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410865529.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2025-11-04
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

On short video platforms, how to efficiently utilize limited computing resources for video transcoding to achieve the best balance between user experience and cost control is a challenge in the face of massive video uploads.

Method used

By adaptively measuring the video traffic distribution in different time windows, the transcoding efficiency value is calculated using traffic prediction sequences and weight sequences. Target videos are selected for transcoding, and a traffic weight model is trained using deep reinforcement learning combined with policy networks and value networks. The traffic weights are then dynamically adjusted to optimize transcoding decisions.

Benefits of technology

It achieves full utilization of transcoding computing resources, maximizes transcoding efficiency, adaptively balances short-term and long-term video bandwidth, and optimizes video transcoding decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118741141B_ABST
    Figure CN118741141B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a video transcoding decision method, device, equipment, medium and program product. The method comprises: obtaining a traffic prediction sequence of a plurality of videos to be transcoded; the traffic prediction sequence comprising traffic prediction values corresponding to a plurality of time windows; obtaining a traffic weight sequence; the traffic weight sequence comprising traffic weight values corresponding to the plurality of time windows; calculating a transcoding efficiency value of the plurality of videos to be transcoded according to the traffic prediction sequence and the traffic weight sequence; and selecting at least one target video to be transcoded for video transcoding according to the transcoding efficiency value of the plurality of videos to be transcoded. The method can adaptively weigh the long-term and short-term traffic of the video to be transcoded according to the video environment, and adjust the video transcoding decision, so as to fully utilize the transcoding computing resources and maximize the transcoding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and in particular, to a video transcoding decision method and device, electronic equipment, storage medium and computer program product. BACKGROUND

[0002] With the rapid development of short video industry, the content on short video platform grows explosively. In video streaming service, after the works are uploaded, different resolution and bit rate video files will be generated through transcoding to meet the playback needs of users in different network conditions. Facing the massive daily video uploads, how to efficiently utilize limited computing resources for video transcoding to achieve the optimal balance between user experience and cost control has become a key challenge in the industry. SUMMARY

[0003] The embodiments of the present disclosure provide a video transcoding decision method, device, electronic equipment, storage medium and computer program product, which adaptively measure long and short term traffic by traffic distribution of different time windows, so as to make a decision on video transcoding.

[0004] According to a first aspect of the embodiments of the present disclosure, a video transcoding decision method is provided, comprising: obtaining a traffic prediction sequence of a plurality of videos to be transcoded; the traffic prediction sequence comprising traffic prediction values of a plurality of time windows corresponding to the videos to be transcoded; obtaining a traffic weight sequence; the traffic weight sequence comprising traffic weight values corresponding to the plurality of time windows; calculating transcoding efficiency values of the plurality of videos to be transcoded according to the traffic prediction sequence and the traffic weight sequence; and selecting at least one target video to be transcoded for video transcoding according to the transcoding efficiency values of the plurality of videos to be transcoded.

[0005] In some exemplary embodiments of the present disclosure, the obtaining of the traffic weight sequence comprises: obtaining environmental state characterization information; inputting the environmental state characterization information into a pre-trained traffic weight model to obtain the traffic weight sequence.

[0006] In some example embodiments of the present disclosure, the traffic weight model comprises at least a policy network and a value network; a training process of the traffic weight model comprises: obtaining first environment state representation information at time t; inputting the first environment state representation information into the value network to obtain a first state value score; inputting the first environment state representation information into the policy network to obtain a first traffic weight sequence; determining a first transcoded video set according to the first traffic weight sequence; obtaining second environment state representation information at time t+1 and a first reward value; the first reward value is used to represent a reward value accumulated by the first transcoded video set between time t and time t+1; inputting the second environment state representation information into the value network to obtain a second state value score; calculating a first differential target value according to the second state value score and the first reward value; calculating a loss function according to the first differential target value and the first state value score; updating the policy network and the value network according to the loss function; and obtaining a target traffic weight model in response to convergence of the loss function.

[0007] In some example embodiments of the present disclosure, the determining the first transcoded video set according to the first traffic weight sequence comprises: obtaining a first traffic prediction sequence of a plurality of to-be-transcoded videos in a training data set; calculating a first transcoding efficiency value of the plurality of to-be-transcoded videos in the training data set according to the first traffic prediction sequence and the first traffic weight sequence; and selecting the first transcoded video set for video transcoding from the plurality of to-be-transcoded videos in the training data set according to the first transcoding efficiency value.

[0008] In some example embodiments of the present disclosure, the obtaining the first reward value at time t+1 comprises: obtaining a bitrate reduction of each video in the first transcoded video set for video transcoding; obtaining a playing time length of each video in the first transcoded video set between time t and time t+1; and calculating the first reward value according to the bitrate reduction and the playing time length of each video in the first transcoded video set.

[0009] In some example embodiments of the present disclosure, the calculating the transcoding efficiency value of the plurality of to-be-transcoded videos according to the traffic prediction sequence and the traffic weight sequence comprises: obtaining a bitrate reduction and a transcoding calculation value of the plurality of to-be-transcoded videos for video transcoding; and calculating the transcoding efficiency value of the plurality of to-be-transcoded videos according to the traffic prediction sequence, the traffic weight sequence, the bitrate reduction and the transcoding calculation value corresponding to the plurality of to-be-transcoded videos.

[0010] In some example embodiments of the present disclosure, the selecting at least one target video to be transcoded according to the transcoding efficiency values of the plurality of videos to be transcoded comprises: sorting the plurality of videos to be transcoded according to the transcoding efficiency values; and selecting a preset number of the target videos to be transcoded according to the sorting.

[0011] In some example embodiments of the present disclosure, the selecting at least one target video to be transcoded according to the transcoding efficiency values of the plurality of videos to be transcoded comprises: sorting the plurality of videos to be transcoded according to the transcoding efficiency values; and selecting the target videos to be transcoded according to the sorting in a preset time period.

[0012] In some example embodiments of the present disclosure, the obtaining the traffic prediction sequence of the plurality of videos to be transcoded comprises: extracting a play feature of the plurality of videos to be transcoded according to historical play data of the plurality of videos to be transcoded; and inputting the play feature into at least one traffic prediction model to obtain the traffic prediction sequence.

[0013] In some example embodiments of the present disclosure, the extracting the play feature of the plurality of videos to be transcoded according to the historical play data of the plurality of videos to be transcoded comprises: performing attenuation calculation on the historical play data by at least one exponential decay kernel function to obtain the corresponding play feature.

[0014] In some example embodiments of the present disclosure, the inputting the play feature into at least one traffic prediction model to obtain the traffic prediction sequence comprises: inputting the play feature into each of the traffic prediction models to obtain a traffic prediction value corresponding to the time window; each of the traffic prediction models corresponds to a different time window; and collecting the traffic prediction values corresponding to each of the time windows to obtain the traffic prediction sequence.

[0015] According to a second aspect of the embodiments of the present disclosure, a video transcoding decision device is provided, comprising: a traffic prediction module configured to obtain a traffic prediction sequence of a plurality of videos to be transcoded; the traffic prediction sequence comprising traffic prediction values corresponding to a plurality of time windows of the videos to be transcoded; a traffic weight module configured to obtain a traffic weight sequence; the traffic weight sequence comprising traffic weight values corresponding to the plurality of time windows; a transcoding efficiency value module configured to calculate transcoding efficiency values of the plurality of videos to be transcoded according to the traffic prediction sequence and the traffic weight sequence; and a video selection module configured to select at least one target video to be transcoded according to the transcoding efficiency values of the plurality of videos to be transcoded.

[0016] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the executable instructions to implement any of the video transcoding decision methods.

[0017] According to a fourth aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, when instructions in the computer readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform any of the video transcoding decision methods.

[0018] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, comprising computer programs / instructions, wherein the computer programs / instructions are executed by a processor to implement any of the video transcoding decision methods.

[0019] The video transcoding decision method provided by the embodiments of the present disclosure calculates the transcoding efficiency value of each video to be transcoded by performing traffic prediction based on a plurality of time windows and corresponding traffic weight value distribution of the plurality of time windows, and selects the video to be transcoded based on the transcoding efficiency value to prioritize video transcoding. Through this method, the long-term and short-term traffic of the video can be adaptively weighed according to the video environment to adjust the video transcoding decision, so as to fully utilize the transcoding computing resources to maximize the transcoding efficiency.

[0020] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0021] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor based on these drawings.

[0022] Figure 1 A schematic diagram of an exemplary system architecture to which the method of the embodiments of the present disclosure can be applied is shown.

[0023] Figure 2 is a flowchart of a video transcoding decision method according to an exemplary embodiment.

[0024] Figure 3 is a flowchart of a training method of a traffic weight model according to an example.

[0025] Figure 4 is a training framework diagram of a traffic weight model according to an example.

[0026] Figure 5 is a flowchart of a traffic prediction sequence obtaining method according to an example.

[0027] Figure 6 is a framework diagram of a video transcoding decision system according to an example.

[0028] Figure 7 is a block diagram of a video transcoding decision device according to an example embodiment.

[0029] Figure 8 is a structural schematic diagram of an electronic device suitable for implementing the example embodiments of the present disclosure according to an example embodiment. DETAILED DESCRIPTION

[0030] Example embodiments now will be described more fully hereinafter with reference to the accompanying drawings. Example embodiments, however, can be implemented in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example embodiments to those skilled in the art. Like reference numerals refer to like elements throughout the several views.

[0031] The features, structures, or characteristics described in connection with the disclosure can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the embodiments of the disclosure can be practiced without one or more of the specific details, or with other methods, components, materials, and so forth. In other instances, well-known structures, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the disclosure.

[0032] The accompanying drawings are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification. The drawings illustrate examples of the present disclosure and, together with the description, serve to explain principles of the present disclosure. In the drawings:

[0033] The flowcharts shown in the drawings are only illustrative and do not necessarily include all contents and steps, nor are they necessarily executed in the order described. For example, some steps can be further divided, and some steps can be combined or partially combined, so the actual execution order can be changed according to actual conditions.

[0034] In this specification, the terms "one", "a", "an", "said", and "the" are used to indicate that there is at least one of the elements / components / etc.; the terms "comprise", "include" and "have" are used to indicate an open-ended inclusion in such a way that additional elements / components / etc. can be present in addition to the listed elements / components / etc.; the terms "first", "second" and "third" etc. are used only as labels, not as a numerical limitation of their objects.

[0035] Figure 1 A schematic diagram showing an exemplary system architecture to which the method of the embodiments of the present disclosure can be applied is shown.

[0036] As Figure 1 shown, the system architecture can include a server 101, a network 102, a terminal device 103, a terminal device 104, and a terminal device 105. The network 102 is a medium to provide a communication link between the terminal device 103, the terminal device 104, or the terminal device 105 and the server 101. The network 102 can include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0037] The server 101 can be a server that provides various services, such as a background management server that provides support for the operation of the device by the user using the terminal device 103, the terminal device 104, or the terminal device 105. The background management server can analyze and process received request data, etc., and feed back the processing result to the terminal device 103, the terminal device 104, or the terminal device 105.

[0038] The terminal device 103, the terminal device 104, and the terminal device 105 can be a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a wearable smart device, a virtual reality device, an augmented reality device, etc., but are not limited thereto.

[0039] It should be understood that Figure 1 the number of the terminal device 103, the terminal device 104, the terminal device 105, the network 102, and the server 101 in

[0040] In the following, the various steps of the method in the example embodiments of the present disclosure will be described in more detail in conjunction with the accompanying drawings and embodiments.

[0041] Figure 2 is a flowchart of a video transcoding decision method according to an example embodiment. Figure 2The method provided by the embodiment can be executed by any electronic device, for example, the terminal device in the above Figure 1 , or the server in the above Figure 1 , or the terminal device and the server in the above Figure 1 jointly execute, but the present disclosure does not limit this.

[0042] In step S210, a plurality of traffic prediction sequences of to-be-transcoded videos are obtained; the traffic prediction sequence includes traffic prediction values corresponding to a plurality of time windows of the to-be-transcoded video.

[0043] As described above, in the short video content consumption scenario, thousands of video works are uploaded every day, and the traffic of most works will rapidly rise after uploading, and then gradually decline after reaching the peak. According to the life cycle characteristics of short video content, the traffic change process of short video can be generally divided into a climbing period, a recession period and a silent period, that is, the traffic rapidly rises in the initial stage of uploading and then slowly declines. In order to better allocate video transcoding resources of a short video platform, it is necessary to predict the future video traffic change of the video based on the existing historical playback of the video through a traffic prediction model.

[0044] In the embodiment of the present disclosure, traffic prediction is performed on a plurality of to-be-transcoded videos through a traffic prediction model to obtain corresponding traffic prediction sequences N t = [N(t, t+τ1), N(t, t+τ2), …, N(t, t+τ n )]. The traffic prediction sequence includes traffic prediction values N(t, t+τ n ) corresponding to a plurality of time windows of the to-be-transcoded video. Wherein τ n represents the time of each time window. The plurality of time windows are a plurality of future time windows, such as 1 hour, 2 hours, 4 hours, 12 hours, 1 day, 3 days, 5 days, etc. The traffic prediction value is the playback duration accumulated by the to-be-transcoded video in the future time window predicted by the traffic prediction model. Through the discrete traffic prediction values corresponding to a plurality of time windows, the traffic prediction sequence of the to-be-transcoded video is formed.

[0045] In the exemplary embodiment, the traffic prediction sequence of the plurality of to-be-transcoded videos can be represented in the form of the following matrix p t .

[0046]

[0047] The matrix p t represents the traffic prediction sequence of m to-be-transcoded videos in n time windows. Wherein, a row in the matrix represents the traffic prediction sequence N(t, t+τ1), N(t, t+τ2), …, N(t, t+τ n), a list indicates the traffic prediction value of each video to be transcoded in a time window N1(t, t+τ n ), N2(t, t+τ n ), …, N m (t, t+τ n ).

[0048] In an example embodiment, the traffic prediction model can adopt one or more of a plurality of traffic prediction models. For example, a logistic regression model LR, a support vector regression model SVR, a recurrent neural network model RNN, a long-short term memory network model LSTM, etc.

[0049] In step S220, a traffic weight sequence is obtained; the traffic weight sequence includes traffic weight values corresponding to the plurality of time windows.

[0050] In an embodiment of the present disclosure, the traffic weight sequence A t = [w1, w2, …, w n ] is obtained. The traffic weight sequence includes traffic weight values w n corresponding to the plurality of time windows. The plurality of time windows corresponding to the traffic weight values correspond to the plurality of time windows corresponding to the traffic prediction values described above. That is, the time window step granularity of the traffic weight values and the traffic prediction values remains consistent. The traffic weight values are used to represent the weight size of the future corresponding time window traffic value. The traffic weight values corresponding to the plurality of discrete time windows constitute the traffic weight sequence. In actual application, the traffic weight values of different time windows can be adjusted according to the current environment needs of the short video platform, to indirectly affect the decision of video transcoding.

[0051] In an example embodiment, the traffic weight sequence can be pre-configured or output by a pre-trained traffic weight model.

[0052] In step S230, the transcoding efficiency values of the plurality of videos to be transcoded are calculated according to the traffic prediction sequence and the traffic weight sequence.

[0053] In the embodiments of the present disclosure, according to the traffic prediction sequence and the traffic weight sequence obtained in the foregoing steps S210 and S220, the transcoding efficiency values corresponding to the plurality of to-be-transcoded videos are calculated. The transcoding efficiency value is used to represent the efficiency of video transcoding. In the scenario of video transcoding, the transcoding efficiency value is the ratio between the bandwidth resource saved by video transcoding and the transcoding computing resource invested in video transcoding. By calculating the transcoding efficiency value of each to-be-transcoded video, the transcoding efficiency of unit transcoding computing resource can be maximized.

[0054] In the exemplary embodiments, the step S230 further includes:

[0055] The code rate reduction amplitude and the transcoding computing value of the plurality of to-be-transcoded videos are obtained. The code rate reduction amplitude is the reduction amplitude of the code rate of the to-be-transcoded video after transcoding, and the transcoding computing value is the amount of computing resource required for transcoding the to-be-transcoded video.

[0056] According to the traffic prediction sequence, the traffic weight sequence, the code rate reduction amplitude, and the transcoding computing value corresponding to the plurality of to-be-transcoded videos, the transcoding efficiency values of the plurality of to-be-transcoded videos are calculated, and the corresponding formula is as follows:

[0057]

[0058] wherein, R i is the transcoding efficiency value of the i th to-be-transcoded video, Δb i is the code rate reduction amplitude of the i th to-be-transcoded video, c i is the transcoding computing value of the i th to-be-transcoded video, N i (t, t+τ j ) is the traffic prediction value of the i th to-be-transcoded video for the j th time window, w j is the traffic weight value for the j th time window.

[0059] In the exemplary embodiments, the prediction value of the future play amount of the i th to-be-transcoded video is obtained based on the sum of the products of the traffic prediction value and the traffic weight value of the i th to-be-transcoded video for each time window. The total bandwidth resource saved by transcoding the i th to-be-transcoded video is obtained by the prediction value and the code rate reduction amplitude. The transcoding efficiency value of the i th to-be-transcoded video is obtained by the ratio between the total bandwidth resource and the corresponding transcoding computing value.

[0060] In step S240, according to the transcoding efficiency values of the plurality of to-be-transcoded videos, at least one target to-be-transcoded video is selected for video transcoding.

[0061] In the embodiments of the present disclosure, the transcoding efficiency values of the plurality of to-be-transcoded videos are calculated through the step S230. Based on the transcoding efficiency values, at least one target to-be-transcoded video can be selected from the plurality of to-be-transcoded videos for video transcoding, so as to maximize the utilization of transcoding computing resources and obtain maximum transcoding efficiency. It should be noted that, according to the transcoding strategy design of each short video platform, different target to-be-transcoded video selection strategies can be designed according to the transcoding efficiency values, which should all be considered within the protection scope of the present disclosure.

[0062] In the step S240, the method further includes:

[0063] The plurality of to-be-transcoded videos are sorted according to the transcoding efficiency values.

[0064] According to the sorting, a preset number of target to-be-transcoded videos are selected for video transcoding.

[0065] In the embodiments of the present disclosure, the plurality of to-be-transcoded videos are sorted from high to low according to the transcoding efficiency values. The higher the transcoding efficiency value is, the greater the bandwidth saved by unit transcoding computing resource input is, and vice versa. According to the sorting, a preset K number of to-be-transcoded videos are selected as target to-be-transcoded videos for video transcoding.

[0066] In the step S240, the method further includes:

[0067] The plurality of to-be-transcoded videos are sorted according to the transcoding efficiency values.

[0068] In a preset time period, the target to-be-transcoded videos are selected in sequence according to the sorting for video transcoding.

[0069] In the embodiments of the present disclosure, the plurality of to-be-transcoded videos are sorted from high to low according to the transcoding efficiency values. In a preset time period, the to-be-transcoded video with the maximum transcoding efficiency value in the sorting is selected as a target to-be-transcoded video for video transcoding. When the video transcoding processing unit has idle computing resources, the to-be-transcoded video is taken out from the sorting for transcoding processing. When the preset time period ends, the transcoding decision process is repeated, and the to-be-transcoded videos are sorted again.

[0070] Through the transcoding decision process, the to-be-transcoded video with a relatively large transcoding efficiency value can be selected for transcoding, so as to maximize the utilization of transcoding computing resources and obtain maximum transcoding efficiency.

[0071] The video transcoding decision method provided by the embodiments of the present disclosure can calculate the transcoding efficiency value of each video to be transcoded by performing traffic prediction based on multiple time windows and assigning traffic weight values corresponding to the multiple time windows, and select the video to be transcoded based on the transcoding efficiency value to perform priority video transcoding. Through this method, the long-term and short-term traffic of the video can be adaptively weighed according to the video environment needs to adjust the video transcoding decision, thereby achieving full use of transcoding computing resources to maximize transcoding efficiency.

[0072] In the embodiments of the present disclosure, the traffic weight sequence obtained in the foregoing step S220 comprises:

[0073] Obtaining environment state representation information.

[0074] Inputting the environment state representation information into a pre-trained traffic weight model to obtain the traffic weight sequence.

[0075] In the embodiments of the present disclosure, the environment state representation information is used to represent the environment state information related to video transcoding in the current short video platform. The environment state information can include: current time, video upload time distribution, video duration distribution, number of untranscoded videos, and / or transcoding computing processing capacity, etc. These environment state information is used to represent the environment state of the current short video platform from a macro perspective to determine the weight size of different time windows in the future. For example, if the current time is evening, which is a peak time period of short video playing, the video with short duration is focused on. If the current time is midnight, which is a trough time period of short video playing, the video with long duration is focused on. Similarly, if the current idle transcoding computing processing capacity is limited, the video with rapid traffic growth in the near future is focused on. If the current idle transcoding computing processing capacity is abundant, the video with large cumulative play amount in the long future is focused on. According to the different needs of the short video platform, the types of environment state representation information selected are also different, but as long as it is used to represent the environment state of the current short video platform, it should be considered within the protection scope of the present disclosure.

[0076] In the embodiments of the present disclosure, the traffic weight model is a pre-trained model that can output a traffic weight sequence according to the input environment state information. Through the traffic weight model, the traffic weight value corresponding to each time window in the traffic weight sequence can be dynamically adjusted according to the current environment state.

[0077] Figure 4 is a training framework diagram of a traffic weight model according to an example. As shown in Figure 4As shown, in the embodiments of the present disclosure, the traffic weight model at least includes a policy network and a value network. The policy network is used to determine the traffic weight value corresponding to each time window. The value network is used to score the environment state. The traffic weight model uses the deep reinforcement learning (RL) method to train the adaptive adjustment of the long-term and short-term weights, and takes the relative traffic distribution of works at each time and the resource supply situation into consideration, and adaptively learns and adjusts the traffic weight value corresponding to different time windows.

[0078] Figure 3 is a flow weight model training method flowchart according to an example. As Figure 3 shown, in the embodiments of the present disclosure, the training process of the traffic weight model can include the following steps.

[0079] In step S310, the first environment state representation information at time t is obtained.

[0080] In the embodiments of the present disclosure, the first environment state representation information s t at time t is obtained in the training data set. t The first environment state representation information s t , refer to the foregoing environment state representation information, which will not be repeated here.

[0081] In step S320, the first environment state representation information is input into the value network to obtain a first state value score.

[0082] In the embodiments of the present disclosure, the first environment state representation information s t is input into the value network to obtain a first state value score Wherein, ω now represents the parameters of the current value network.

[0083] In step S330, the first environment state representation information is input into the policy network to obtain a first traffic weight sequence; and a first transcoding video set is determined according to the first traffic weight sequence.

[0084] In the embodiments of the present disclosure, the first environment state representation information s t is input into the policy network to obtain a first traffic weight sequence A t , A t ~ π (·|s t ; θ now ). Wherein, θ now represents the parameters of the current policy network. The first traffic weight sequence A t , refer to the foregoing traffic weight sequence, which will not be repeated here.

[0085] Further, according to the first traffic weight sequence A t , a first transcoded video set d t is determined. The determination process of the first transcoded video set d t may include the following steps.

[0086] A first traffic prediction sequence of the plurality of to-be-transcoded videos in the training data set is obtained.

[0087] According to the first traffic prediction sequence and the first traffic weight sequence, a first transcoding efficiency value of the plurality of to-be-transcoded videos in the training data set is calculated.

[0088] According to the first transcoding efficiency value, the first transcoded video set from the plurality of to-be-transcoded videos in the training data set is selected for video transcoding.

[0089] The determination process of the first transcoded video set d t is similar to the determination process of the target to-be-transcoded video shown in the foregoing Figure 2 , and will not be described here again.

[0090] In step S340, second environment state representation information at time t+1 and a first reward value are obtained; the first reward value is used to represent the reward value accumulated by the first transcoded video set between time t and time t+1.

[0091] In the embodiments of the present disclosure, the second environment state representation information s t+1 at time t+1 is obtained in the training data set. The second environment state representation information s t+1 refers to the foregoing environment state representation information, and will not be described here again.

[0092] In the embodiments of the present disclosure, a first reward value r t is also obtained at time t+1. The first reward value r t is used to represent the reward value accumulated by the first transcoded video set d t between time t and time t+1. The so-called reward value is the bandwidth saved by the first transcoded video set d t through video transcoding.

[0093] The obtaining process of the first reward value r t may include the following steps.

[0094] The bitrate reduction amplitude Δb i of each video in the first transcoded video set for video transcoding is obtained.

[0095] The playing time length N i (t, t+1) of each video in the first transcoded video set between time t and time t+1 is obtained.

[0096] According to the code rate reduction Δb of each video in the first transcoded video set i And the playing time N i (t, t+1), the first reward value r is calculated t , the corresponding formula is as follows:

[0097]

[0098] Wherein, N i (t, t+1) is the playing time of the i-th video between time t and time t+1, Δb i is the code rate reduction of the i-th video, d t is the first transcoded video set.

[0099] The first reward value r calculated by the above-mentioned manner t , that is, the real value of the cumulative bandwidth saved by video transcoding between time t and time t+1 by the first transcoded video set selected at time t.

[0100] In step S350, the second environment state representation information is input into the value network to obtain a second state value score.

[0101] In the embodiment of the present disclosure, the second environment state representation information s t+1 is input into the value network to obtain a second state value score Wherein, ω now represents the parameters of the current value network.

[0102] In step S360, a first difference target value is calculated according to the second state value score and the first reward value.

[0103] In the embodiment of the present disclosure, the first difference target value is calculated according to the second state value score And the first reward value r t Wherein, γ is a preselected decay coefficient.

[0104] In step S370, a loss function is calculated according to the first difference target value and the first state value score.

[0105] In the embodiment of the present disclosure, the loss function δ is calculated according to the first difference target value And the first state value score t , Since the first difference target value ​​The first reward value r is added in the calculation t This bandwidth saving real value can thus correct the calculation of the state value score. Based on the first difference target value And the first state value score The loss function δ calculated t can be used to train the model.

[0106] In step S380, the policy network and the value network are updated according to the loss function.

[0107] In the embodiments of the present disclosure, the policy network and the value network are updated according to the loss function δ t , and the corresponding formula is as follows:

[0108]

[0109]

[0110] where ω new is the updated value network parameter, a is the value network learning coefficient, θ new is the updated policy network parameter, and β is the policy network learning coefficient.

[0111] In step S390, the target traffic weight model is obtained in response to the convergence of the loss function.

[0112] In the embodiments of the present disclosure, when the loss function does not converge, the traffic weight model is constantly updated in a loop based on the preceding steps S310 to S380. When the loss function converges, the target traffic weight model is obtained, which is the traffic weight model pre-trained in the process of obtaining the traffic weight sequence.

[0113] The video transcoding decision method provided by the embodiments of the present disclosure can dynamically output a suitable traffic weight sequence according to the video environment state through the pre-trained traffic prediction model, and then indirectly adjust the video transcoding decision, so as to adaptively weigh the long-term and short-term traffic of the video, realize the full use of transcoding computing resources, and obtain the maximum transcoding efficiency.

[0114] Figure 5 is a flow chart of a traffic prediction sequence obtaining method according to an example. As Figure 5 shown, in the embodiments of the present disclosure, the traffic prediction sequence of the plurality of videos to be transcoded obtained in the preceding step S210 can include the following steps.

[0115] In step S510, the playback features of the plurality of videos to be transcoded are extracted according to the historical playback data of the plurality of videos to be transcoded.

[0116] In the embodiments of the present disclosure, the traffic prediction of the video to be transcoded is generally based on the prediction of the future traffic of the video to be transcoded from the historical playback data of the video to be transcoded. Therefore, in this step, the corresponding playback features are extracted from the historical playback data of the plurality of videos to be transcoded for the traffic prediction model to perform traffic prediction.

[0117] In the example embodiments, in the extraction process of the playback features, the historical playback data is calculated by at least one exponential decay kernel function to obtain the corresponding playback features.

[0118] In the example embodiments, different exponential decay kernel functions φ(t) = e -γt are used to extract the playback features of the historical playback data of the video to be transcoded to adapt to the traffic decay rate of different videos. Since there are a large amount of video content on the short video platform, the historical playback data of each video is also a very large amount of data, which brings challenges to the access of the historical playback data of the related videos. In this embodiment, the historical playback data is calculated by a plurality of exponential decay kernel functions to abstract the historical playback data into a plurality of discrete playback feature data, which facilitates the access of the related data and provides a data basis for subsequent traffic prediction.

[0119] In step S520, the playback features are input into at least one traffic prediction model to obtain the traffic prediction sequence.

[0120] As mentioned earlier, there are many models for video traffic prediction at present, such as the logistic regression model LR, the support vector regression model SVR, the recurrent neural network model RNN, the long short-term memory network model LSTM, etc. Since different traffic prediction models have different prediction accuracies for different time windows. In order to more accurately predict the traffic of the video to be transcoded, in this embodiment, a plurality of traffic prediction models can be selected at the same time, and different traffic prediction models are selected for different time windows to perform traffic prediction. Specifically, the following steps can be included.

[0121] The playback features are input into each of the traffic prediction models to obtain the traffic prediction value corresponding to the time window; each of the traffic prediction models corresponds to a different time window.

[0122] The traffic prediction values corresponding to each of the time windows are collected to obtain the traffic prediction sequence.

[0123] In the embodiments of the present disclosure, different traffic prediction models correspond to different time windows set in advance. When calculating the traffic prediction value of the time window, the corresponding traffic prediction model is selected for prediction to obtain the traffic prediction value corresponding to the time window. The traffic prediction values corresponding to each time window are collected to form the traffic prediction sequence of the video to be transcoded.

[0124] In the example embodiment, the correspondence between each traffic prediction model and the time window can also be determined by training. The playback features of the videos in the training data set are input into each traffic prediction model, and the traffic prediction values corresponding to different time windows of each traffic prediction model are obtained respectively. Based on the relationship between the traffic prediction values of each traffic prediction model and the actual true values, the traffic prediction model corresponding to different time windows is determined.

[0125] The video transcoding decision method provided by the embodiments of the present disclosure greatly simplifies the historical playback data of the to-be-transcoded videos by extracting the playback features of each to-be-transcoded video through multiple exponential decay kernel functions, facilitates the access of related data, and provides a data basis for subsequent traffic prediction. At the same time, the method also obtains more accurate video traffic prediction by using different traffic prediction models for traffic prediction for different time windows.

[0126] Figure 6 is a video transcoding decision system framework diagram shown according to an example. As Figure 6 shown, the video transcoding decision system includes:

[0127] A video environment is used to represent the video environment state of a short video platform. At least includes: a to-be-transcoded video set and a video transcoding resource. The to-be-transcoded video set includes a plurality of to-be-transcoded videos. The video transcoding resource includes a computing processing resource for video transcoding.

[0128] A traffic prediction module is used to predict the traffic of the to-be-transcoded video and generate a corresponding traffic prediction sequence. The related content has been described in the foregoing Figure 5 embodiment, and will not be repeated here.

[0129] A transcoding simulator is the core processing module of the video transcoding decision system. At least includes: a transcoding efficiency value calculation module, a video queue and a video transcoding. The transcoding efficiency value calculation module calculates the transcoding efficiency value of each to-be-transcoded video according to the traffic prediction sequence and the traffic weight sequence. The video queue is a queue for sorting each to-be-transcoded video based on the transcoding efficiency value. The video transcoding performs video transcoding according to the video queue.

[0130] A state representation module is used to obtain environment state representation information according to the video environment.

[0131] A traffic weight model generates a traffic weight sequence according to the environment state representation information.

[0132] In the traffic weight model training process, the video transcoding decision system further includes:

[0133] The reward module is configured to monitor the video after video transcoding, calculate a reward value of the related transcoded video, and input the reward value into the traffic weight model to provide training of the traffic weight model.

[0134] The following is an apparatus embodiment of the present disclosure, which can be used to perform the method embodiments of the present disclosure. For details not disclosed in the apparatus embodiments of the present disclosure, please refer to the method embodiments of the present disclosure.

[0135] Figure 7 is a block diagram of a video transcoding decision apparatus according to an exemplary embodiment. Referring to Figure 7 The apparatus 700 can include a traffic prediction module 710, a traffic weight module 720, a transcoding efficiency value module 730, and a video selection module 740.

[0136] The traffic prediction module 710 is configured to obtain a traffic prediction sequence of a plurality of videos to be transcoded; the traffic prediction sequence includes traffic prediction values corresponding to a plurality of time windows of the videos to be transcoded.

[0137] The traffic weight module 720 is configured to obtain a traffic weight sequence; the traffic weight sequence includes traffic weight values corresponding to the plurality of time windows.

[0138] The transcoding efficiency value module 730 is configured to calculate transcoding efficiency values of the plurality of videos to be transcoded according to the traffic prediction sequence and the traffic weight sequence.

[0139] The video selection module 740 is configured to select at least one target video to be transcoded for video transcoding according to the transcoding efficiency values of the plurality of videos to be transcoded.

[0140] In some exemplary embodiments of the present disclosure, the traffic weight module 720 is further configured to obtain environmental state representation information; input the environmental state representation information into a pre-trained traffic weight model to obtain the traffic weight sequence.

[0141] In some example embodiments of the present disclosure, the traffic weight module 720 is further configured to include at least a policy network and a value network in the traffic weight model; a training process of the traffic weight model includes: obtaining first environment state representation information at time t; inputting the first environment state representation information into the value network to obtain a first state value score; inputting the first environment state representation information into the policy network to obtain a first traffic weight sequence; determining a first transcoding video set according to the first traffic weight sequence; obtaining second environment state representation information at time t+1 and a first reward value; the first reward value is used to represent a reward value accumulated by the first transcoding video set between time t and time t+1; inputting the second environment state representation information into the value network to obtain a second state value score; calculating a first difference target value according to the second state value score and the first reward value; calculating a loss function according to the first difference target value and the first state value score; updating the policy network and the value network according to the loss function; and obtaining a target traffic weight model in response to convergence of the loss function.

[0142] In some example embodiments of the present disclosure, the traffic weight module 720 is further configured to obtain a first traffic prediction sequence of a plurality of to-be-transcoded videos in a training data set; calculate a first transcoding efficiency value of the plurality of to-be-transcoded videos in the training data set according to the first traffic prediction sequence and a first traffic weight sequence; and select the first transcoding video set for video transcoding from the plurality of to-be-transcoded videos in the training data set according to the first transcoding efficiency value.

[0143] In some example embodiments of the present disclosure, the traffic weight module 720 is further configured to obtain a bitrate reduction amplitude of each video in the first transcoding video set for video transcoding; obtain a playing duration of each video in the first transcoding video set between time t and time t+1; and calculate the first reward value according to the bitrate reduction amplitude and the playing duration of each video in the first transcoding video set.

[0144] In some example embodiments of the present disclosure, the transcoding efficiency value module 730 is further configured to obtain a bitrate reduction amplitude and a transcoding calculation value of the plurality of to-be-transcoded videos for video transcoding; and calculate a transcoding efficiency value of the plurality of to-be-transcoded videos according to the traffic prediction sequence, the traffic weight sequence, the bitrate reduction amplitude and the transcoding calculation value corresponding to the plurality of to-be-transcoded videos.

[0145] In some example embodiments of the present disclosure, the video selection module 740 is further configured to sort the plurality of to-be-transcoded videos according to the transcoding efficiency value; and select a preset number of target to-be-transcoded videos for video transcoding according to the sorting.

[0146] In some example embodiments of the present disclosure, the video selection module 740 is further configured to sort the plurality of videos to be transcoded according to the transcoding efficiency values; and select the target video to be transcoded according to the sorting in a preset time period.

[0147] In some example embodiments of the present disclosure, the traffic prediction module 710 is further configured to extract a play feature of the plurality of videos to be transcoded according to historical play data of the plurality of videos to be transcoded; and input the play feature into at least one traffic prediction model to obtain the traffic prediction sequence.

[0148] In some example embodiments of the present disclosure, the traffic prediction module 710 is further configured to perform attenuation calculation on the historical play data by at least one exponential decay kernel function to obtain the corresponding play feature.

[0149] In some example embodiments of the present disclosure, the traffic prediction module 710 is further configured to input the play feature into each of the traffic prediction models to obtain a traffic prediction value corresponding to the time window; each of the traffic prediction models corresponds to a different time window; and collect the traffic prediction values corresponding to each of the time windows to obtain the traffic prediction sequence.

[0150] As to the apparatus in the above-mentioned embodiments, the specific manners in which various modules perform operations have been described in detail in the embodiments of the method, and thus will not be described here in detail.

[0151] The electronic device 800 according to such an embodiment of the present disclosure will be described below with reference to Figure 8 Figure 8 The display electronic device 800 is merely an example and should not impose any limitation on the functions and usage range of the embodiments of the present disclosure.

[0152] As shown in Figure 8 , the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 can include, but are not limited to, the above-mentioned at least one processing unit 810, the above-mentioned at least one storage unit 820, a bus 830 connecting different system components including the storage unit 820 and the processing unit 810, and a display unit 840.

[0153] The storage unit stores program codes which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various example embodiments of the present disclosure described in the above-mentioned “example method” section of the present specification. For example, the processing unit 810 can perform each step as shown in Figure 2

[0154] ​​For example, the electronic device can implement each of the steps as shown in Figure 2

[0155] The storage unit 820 can include a readable medium in the form of volatile storage such as random access memory (RAM) 821 and / or cache memory 822, and also can include a non-volatile storage such as read only memory (ROM) 823.

[0156] The storage unit 820 can also include a program / utility 824 having a set of program modules 825 such as an operating system, one or more application programs, other program modules, and program data, each of which can give the electronic device its functionality, at least in part. The program modules 825 can include, but are not limited to, a network environment implementation, either alone or in some combination.

[0157] The bus 830 can represent one or more of several types of bus structures, including a storage bus or bus controller, a peripheral bus, an accelerated graphics port, an industry standard architecture bus, a video interface, a local bus, or any of a variety of other bus structures, using a bus structure or architectures in use both now and in the future.

[0158] The electronic device 800 can also communicate with one or more external devices 870 such as a keyboard or pointing device, a Bluetooth device, etc.; one or more devices that enable a user to interact with the electronic device 800; and / or one or more devices (e.g., a router, a modem, a server, etc.) that enable the electronic device 800 to communicate with one or more other computing devices. Such communication can occur via an input / output (I / O) interface 850. Still yet, the electronic device 800 can communicate with one or more networks, such as one or more local area networks (LANs), one or more wide area networks (WANs), and / or the Internet, through a network adapter 860. As depicted, the network adapter 860 can communicate with the other components of the electronic device 800 via the bus 830. It should be appreciated that the network adapter 860 and / or the one or more components of the electronic device 800 can be implemented as a "hardwired" component of the electronic device 800, or can be implemented in a "wireless" manner, such as is the case with Bluetooth devices. It should also be appreciated that the electronic device 800 might include one or more devices in addition to those shown, including but not limited to a universal serial bus (USB) adapter, a telephone modem, a Bluetooth® device, a wireless device, etc.

[0159] From the above description of the embodiments, those skilled in the art will readily perceive that the example embodiments described herein can be implemented by software and / or by hardware coupled with software. Accordingly, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, etc.) or a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to perform the methods according to the embodiments of the present disclosure.​

[0160] In an example embodiment, a computer readable storage medium including instructions, such as a memory including instructions, is also provided, which can be executed by a processor of an apparatus to accomplish the above method. Optionally, the computer readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.

[0161] In an example embodiment, a computer program product including computer programs / instructions, which, when executed by a processor, implements the method in the above embodiments, is also provided.

[0162] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the present disclosure cover any and all variations of the present disclosure that come within the scope of the following claims and their equivalents. It is intended that the specification and examples be considered exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.

[0163] It should be understood that the present disclosure is not limited to the precise structures herein described and illustrated in the drawings, and that various modifications and changes can be made without departing from its scope. The scope of the present disclosure is limited only by the claims that follow.

Claims

1. A video transcoding decision-making method, characterized in that, include: Obtain a traffic prediction sequence for multiple videos to be transcoded; the traffic prediction sequence includes traffic prediction values ​​for multiple time windows corresponding to the videos to be transcoded; Obtain a traffic weight sequence; the traffic weight sequence includes traffic weight values ​​corresponding to the plurality of time windows; Based on the traffic prediction sequence and the traffic weight sequence, calculate the transcoding efficiency value of the plurality of videos to be transcoded; Based on the transcoding efficiency values ​​of the plurality of videos to be transcoded, at least one target video to be transcoded is selected for video transcoding. The step of calculating the transcoding efficiency value of the plurality of videos to be transcoded based on the traffic prediction sequence and the traffic weight sequence includes: Obtain the bitrate reduction and transcoding calculation value for the multiple videos to be transcoded; Based on the traffic prediction sequence, traffic weight sequence, bitrate reduction, and transcoding calculation value corresponding to the plurality of videos to be transcoded, the transcoding efficiency value of the plurality of videos to be transcoded is calculated.

2. The method according to claim 1, characterized in that, The process of obtaining the traffic weight sequence includes: Obtain environmental state characterization information; The environmental state characterization information is input into a pre-trained traffic weight model to obtain the traffic weight sequence.

3. The method according to claim 2, characterized in that, The traffic weighting model includes at least a policy network and a value network; the training process of the traffic weighting model includes: Obtain the first environmental state representation information at time t; The first environmental state characterization information is input into the value network to obtain the first state value score; The first environmental state characterization information is input into the policy network to obtain a first traffic weight sequence; based on the first traffic weight sequence, a first transcoded video set is determined. Obtain the second environmental state representation information and the first reward value at time t+1; the first reward value is used to represent the cumulative reward value of the first transcoded video set between time t and time t+1; The second environmental state characterization information is input into the value network to obtain the second state value score; The first differential target value is calculated based on the second state value score and the first reward value; Calculate the loss function based on the first difference target value and the first state value score; Update the policy network and value network according to the loss function; In response to the convergence of the loss function, the target traffic weight model is obtained.

4. The method according to claim 3, characterized in that, The step of determining the first transcoded video set based on the first traffic weight sequence includes: Obtain the first traffic prediction sequence of multiple videos to be transcoded from the training dataset; Based on the first traffic prediction sequence and the first traffic weight sequence, calculate the first transcoding efficiency value of multiple videos to be transcoded in the training dataset; Based on the first transcoding efficiency value, the first set of transcoded videos to be transcoded is selected from multiple videos to be transcoded in the training dataset.

5. The method according to claim 3, characterized in that, The first reward value obtained at time t+1 includes: Obtain the bitrate reduction of each video in the first transcoded video set after video transcoding; Obtain the playback duration of each video in the first transcoded video set between time t and time t+1; The first reward value is calculated based on the bitrate reduction and playback duration of each video in the first transcoded video set.

6. The method according to claim 1, characterized in that, The step of selecting at least one target video to be transcoded for video transcoding based on the transcoding efficiency values ​​of the plurality of videos to be transcoded includes: The plurality of videos to be transcoded are sorted according to the transcoding efficiency value; Based on the sorting, a preset number of target videos to be transcoded are selected for video transcoding.

7. The method according to claim 1, characterized in that, The step of selecting at least one target video to be transcoded for video transcoding based on the transcoding efficiency values ​​of the plurality of videos to be transcoded includes: The plurality of videos to be transcoded are sorted according to the transcoding efficiency value; Within a preset time period, the target videos to be transcoded are selected sequentially according to the sorting order for video transcoding.

8. The method according to claim 1, characterized in that, The process of obtaining a traffic prediction sequence for multiple videos to be transcoded includes: Based on the historical playback data of the multiple videos to be transcoded, the playback features of the multiple videos to be transcoded are extracted; The playback features are input into at least one traffic prediction model to obtain the traffic prediction sequence.

9. The method according to claim 8, characterized in that, The step of extracting playback features of the multiple videos to be transcoded based on their historical playback data includes: The historical playback data is attenuated using at least one exponential decay kernel function to obtain the corresponding playback features.

10. The method according to claim 8, characterized in that, The step of inputting the playback features into at least one traffic prediction model to obtain the traffic prediction sequence includes: The playback features are input into each of the traffic prediction models to obtain the traffic prediction value corresponding to the time window; each of the traffic prediction models corresponds to a different time window. The traffic prediction values ​​corresponding to each time window are aggregated to obtain the traffic prediction sequence.

11. A video transcoding decision-making device, characterized in that, include: The traffic prediction module is configured to obtain a traffic prediction sequence of multiple videos to be transcoded; the traffic prediction sequence includes traffic prediction values ​​for multiple time windows corresponding to the videos to be transcoded. The traffic weighting module is configured to obtain a traffic weighting sequence; the traffic weighting sequence includes traffic weighting values ​​corresponding to the plurality of time windows; The transcoding efficiency value module is configured to calculate the transcoding efficiency value of the plurality of videos to be transcoded based on the traffic prediction sequence and the traffic weight sequence. The video selection module is configured to select at least one target video to be transcoded for video transcoding based on the transcoding efficiency values ​​of the plurality of videos to be transcoded. The transcoding efficiency value module is further configured to obtain the bitrate reduction and transcoding calculation value of the plurality of videos to be transcoded; and to calculate the transcoding efficiency value of the plurality of videos to be transcoded based on the traffic prediction sequence, traffic weight sequence, bitrate reduction and transcoding calculation value corresponding to the plurality of videos to be transcoded.

12. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the executable instructions to implement the video transcoding decision method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the video transcoding decision method as described in any one of claims 1 to 10.

14. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the video transcoding decision method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Content Optimization Based On Real Time Network Dynamics

    US20140026169A1

  • Video transcoding method and apparatus, and device and storage medium

    WO2023226742A1