Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide an intelligent video code rate adjustment and bandwidth allocation method based on deep learning, and the method utilizes the characteristic of high execution speed of a neural network inference process to quickly solve a code rate and bandwidth allocation scheme and improve the timeliness and the accuracy.
In order to achieve the above object, the method for adjusting the code rate and allocating the bandwidth of the intelligent video based on the deep learning of the present invention comprises the following steps:
s1: recording the maximum number of users which can simultaneously request DASH service flow and are controlled by a bottleneck link controller accessed to a core network as N, setting M user selectable code rate gears according to actual conditions, wherein the code rate is higher when the serial number of the code rate gear is larger;
s2: constructing a code rate distribution neural network, comprising an input layer, a full-connection hidden layer and an output layer, wherein the input layer comprises 2N +1 neural units, and the input is a 2N +1 dimensional state vector I ═ W, b
1,s
1,b
2,s
2,…,b
N,s
N) Wherein W represents a normalized value of available bandwidth for access of the bottleneck link controller to the core network,
s
nrespectively representing the time length normalization value and the active state s of the cached video of the
nth user n1 indicates that the user is active and needs to perform rate allocation,
s n0 means user inactivity, not requiredCode rate allocation is carried out, wherein N is 1,2, …, N; the output layer comprises N independent output layers, each independent output layer comprises M +1 nerve units, and the output vector of the nth independent output layer is O
n=(r
n,0,r
n,1,…,r
n,M) Wherein r is
n,mThe probability of selecting the mth gear code rate in the next time slot of the nth user is represented, and the value range is [0,1 ]]M-0, 1, …, M-0 indicates no code rate is allocated;
setting D user states and available bandwidth scenes, normalizing the user cache video time length and the available bandwidth according to the maximum value and the minimum value of the user cache video time length and the maximum value and the minimum value of the available bandwidth, and determining corresponding state vectors
Wherein D is 1,2, …, D, W
dA normalized value representing the available bandwidth for the bottleneck link controller to access the core network in scenario d,
respectively representing a normalized value and an active state of the nth user cache video time length in the d scene; obtaining the code rate selected by each user in the next time slot in the scene according to theoretical analysis, and allocating the code rate to the scheme vector
The corresponding element in the group is set to be 1, the other elements are set to be 0,
indicating that the nth user selects the mth gear rate in the next time slot in the d-th scenario,
indicating that the nth user does not select the mth gear code rate in the next time slot in the d scenes;
state vector of each scene
As input, a code rate allocation scheme vector for N users
As expected output, training a code rate distribution neural network;
s3: when each decision time slot comes, obtaining the number N' of DASH service users controlled by the current bottleneck link controller and the available bandwidth W of the bottleneck link controller accessed to the core network*Normalizing the time length and the available bandwidth of the user cache video according to the maximum value and the minimum value of the time length of the user cache video and the maximum value and the minimum value of the available bandwidth to obtain a normalized value b of the time length of the user cache videon′And normalizing the value W by the available bandwidth, and simultaneously determining the activity state s of each usern′N '═ 1,2, …, N'; constructing a current state vector I ═ (W, b)1,s1,b2,s2,…,bN,sN) When N is less than or equal to N', bn=bn′,sn=sn′Otherwise bn=0,sn=0;
S4: inputting the current state vector n' obtained in the step S3 into the code rate allocation neural network trained in the step S102 to obtain a code rate allocation scheme vector ω of each user in the next time slotn′For the current n' users, selecting the code rate gear corresponding to the probability maximum value in the code rate distribution scheme vector as the code rate gear R of the next time slot of the usern′,βn′Obtaining a code rate distribution scheme;
s5: and calculating the bandwidth allocated to each user according to the current available bandwidth and the code rate of the current n' users determined by the code rate allocation scheme, and completing bandwidth allocation.
The invention relates to an intelligent video code rate adjustment and bandwidth allocation method based on deep learning, wherein a code rate allocation neural network is constructed, the input of the neural network is a state vector comprising an available bandwidth normalization value, a user cache video time normalization value and a user active state, and the output of the neural network is a code rate allocation scheme vector of each user; setting a plurality of user states and available bandwidth scenes to obtain training samples, and training a code rate distribution neural network; and when each decision time slot arrives, acquiring a state vector, inputting the state vector to the trained code rate distribution neural network to obtain a code rate distribution scheme, and determining the bandwidth occupied by each user according to the code rate distribution scheme and the current available bandwidth to finish bandwidth distribution.
The invention has the following technical effects:
1) compared with the traditional solution, the invention designs a central control DASH service scheme capable of acquiring global user information and network state information, and the scheme can know the global state to adjust the code rate selection of all users, so that the service quality obtained by each user is fair under the condition of ensuring that the video playing of all users is not blocked;
2) the invention solves the problem of code rate allocation by applying a deep learning technology, and trains a neural network in advance by using a previously obtained optimal solution example as a data set. In actual implementation, a trained neural network is utilized, and a code rate distribution result close to an optimal solution can be obtained only within millisecond time;
3) the invention designs a cross-layer optimized DASH service scheme, and simultaneously regulates and controls the video code rate of an application layer and the bandwidth of a network layer, so that the service quality of a user is greatly improved, the smooth playing of a video can be ensured, and the video code rate and the high service quality fairness as high as possible can be obtained.
Detailed Description
The following description of the embodiments of the present invention is provided in order to better understand the present invention for those skilled in the art with reference to the accompanying drawings. It is to be expressly noted that in the following description, a detailed description of known functions and designs will be omitted when it may obscure the subject matter of the present invention.
Examples
Fig. 1 is a flowchart of an embodiment of an intelligent video bitrate adjustment and bandwidth allocation method based on deep learning according to the present invention. As shown in fig. 1, the method for adjusting the code rate and allocating the bandwidth of the intelligent video based on the deep learning of the present invention comprises the following specific steps:
s101: acquiring system data:
the maximum number of users which can simultaneously request DASH service flows and are controlled by a bottleneck link controller accessed to a core network is recorded as N, M user selectable code rate gears are set according to actual conditions, and the code rate is higher when the sequence number of the code rate gears is larger.
S102: constructing and training a code rate distribution neural network:
in order to rapidly and accurately allocate the code rate, the invention needs to construct a code rate allocation neural network. FIG. 2 is a block diagram of a rate allocation neural network in the present invention. As shown in fig. 2, the rate allocation neural network in the present invention includes an input layer, a fully-connected hidden layer and an output layer, wherein the input layer includes 2N +1 neural units, and the input is 2N +1 dimensional state vector I ═ W, b1,s1,b2,s2,…,bN,sN) Where W represents the available bandwidth normalization value for bottleneck link controller access to the core network, bn、snRespectively representing the time length normalization value and the active state s of the cached video of the nth user n1 indicates that the user is active and needs to perform rate allocation, s n0 means that the user is not active and no rate allocation is needed, N is 1,2, …, N; the output layer comprises N independent output layers, each independent output layer comprises M +1 nerve units, and the output vector of the nth independent output layer is On=(rn,0,rn,1,…,rn,M) Wherein r isn,mThe probability of selecting the mth gear code rate in the next time slot of the nth user is represented, and the value range is [0 ],1]M-0, 1, …, M-0 indicates no code rate is allocated. The number of the nerve units of the fully-connected hidden layer can be set according to actual needs.
Setting D user states and available bandwidth scenes, normalizing the user cache video time length and the available bandwidth according to the maximum value and the minimum value of the user cache video time length and the maximum value and the minimum value of the available bandwidth, and determining corresponding state vectors
Wherein D is 1,2, …, D, W
dA normalized value representing the available bandwidth for the bottleneck link controller to access the core network in scenario d,
respectively representing a normalized value and an active state of the nth user cache video time length in the d scene; obtaining the code rate selected by each user in the next time slot in the scene according to theoretical analysis, and allocating the code rate to the scheme vector
The corresponding element in the group is set to be 1, the other elements are set to be 0,
indicating that the nth user selects the mth gear rate in the next time slot in the d-th scene,
indicating that the nth user does not select the mth gear rate in the next time slot in the d-th scene.
State vector of each scene
As input, a code rate allocation scheme vector for N users
As the desired output, a code rate assignment neural network is trained.
S103: acquiring the current user state:
when each decision time slot comes, obtaining the number N' of DASH service users controlled by the current bottleneck link controller and the available bandwidth W of the bottleneck link controller accessed to the core network*The available bandwidth can directly grab the actual available bandwidth of the network end or call the available bandwidth estimator to acquire the actual available bandwidth. Normalizing the time length and the available bandwidth of the user cache video according to the maximum value and the minimum value of the time length of the user cache video and the maximum value and the minimum value of the available bandwidth to obtain a normalized value b of the time length of the user cache videon′And normalizing the value W by the available bandwidth, and simultaneously determining the activity state s of each usern′N 'is 1,2, …, N'. Constructing a current state vector I ═ (W, b)1,s1,b2,s2,…,bN,sN) When N is less than or equal to N', bn=bn′,sn=sn′Otherwise bn=0,sn=0。
For the active state of the user, the present embodiment provides a method for determining the active state of the user:
if the user leaves, the user DASH service flow request is completely completed, or the time length of the video cached by the user exceeds a decision time slot, which indicates that the user does not need bandwidth downloading and does not have video blocking in the next time slot, the states of the two types of users are set to be 0, which indicates that the user is not active, the next time slot does not need to allocate the code rate, the states of the other users are set to be 1, which indicates that the user is active, and the next time slot needs to allocate the code rate.
S104: determining a code rate allocation scheme:
the current state vector I obtained in step S103 is set to (W, b)1,s1,b2,s2,…,bN,sN) Inputting the code rate to the code rate distribution neural network trained in the step S102 to obtain a code rate distribution scheme vector O of each user in the next time slotn=(rn,0,rn,1,…,rn,M) For the current N' users, selecting the code rate gear corresponding to the probability maximum value in the code rate allocation scheme vector as the code rate of the next time slot of the userGear Rn′, R n′0,1, …, M, resulting in a rate allocation scheme.
The rate allocation scheme obtained by the rate allocation neural network has certain probability of the following three conditions: the next time slot with the user does not need to allocate code rate, but is allocated with the code rate; allocating code rate to the next time slot of a user, but not allocating; the overall allocation code rate of all users is too high, so that the total bandwidth allocation is insufficient, and the users watch the video in the next time slot. In order to avoid these situations, feasibility check can be performed on the code rate allocation scheme, and the code rate allocation result is finely adjusted to meet the scene service requirement, and the specific method is as follows:
1) for the nth 'user of the current N' DASH service users, if the user activity state s isn′0, and a code rate step R assigned thereton′Not equal to 0, then let Rn′When the code rate is not allocated, the code rate is adjusted to be 0;
2) for the nth 'user of the current N' DASH service users, if the user activity state s isn′1, and the code rate gear position R allocated to itn′When the value is equal to 0, then let R n′1, namely adjusting to allocate the lowest gear code rate;
3) after the two adjustments are completed, the following formula is used to calculate the minimum total bandwidth W' required for ensuring that all the user videos are not blocked under the current rate allocation scheme:
wherein r isn′Representing gear R according to code raten′The determined code rate, pi, represents a decision time slot for code rate adjustment and bandwidth allocation.
If the minimum total bandwidth W' is less than or equal to the current available bandwidth W*If not, the current available bandwidth cannot be ensured to be not blocked by each user video under the code rate allocation scheme, so that the video is not blocked by each user, and the video is not blocked by each user videoReducing the code rate of one random user in the users with the highest code rate by one gear, calculating the minimum total bandwidth W 'again, and repeating the processing process until W' is less than W*。
S105: and (3) bandwidth allocation:
and calculating the bandwidth allocated to each user according to the current available bandwidth and the code rates of the current N' users determined by the code rate allocation scheme, and completing bandwidth allocation.
In this embodiment, bandwidth allocation is performed based on a linear programming model, and the specific method is as follows:
according to the current available bandwidth and code rate allocation scheme, constructing the following linear programming model:
subject to:
βn'-ωn'≤0
wherein S isn′The buffer duration of the nth' user is represented as the contribution of the user service quality, and the calculation formula is as follows:
ωn′indicates the bandwidth allocation result of the nth' user, rn′Code rate, beta, representing the nth usern′Indicating that the minimum bandwidth allocation is required to ensure that the nth' user video is not played.
And solving by using a basic linear programming solving method to obtain the bandwidth allocation result of each user.
And after the code rate distribution and the bandwidth distribution are finished, transmitting the code rate distribution result and the bandwidth distribution result to the user side, and performing the next round of decision when the next decision time slot comes.
The invention can be applied to a scenario where multiple DASH services compete for the same bottleneck link, and common scenarios include:
firstly, a home network: a plurality of family members in a family may watch videos by using terminals such as a personal computer, a smart phone, a tablet personal computer and a smart television, and due to the randomness of behaviors and different lengths of videos, the number of frequent requests changes, and at the moment, intelligent code rate selection and bandwidth allocation are particularly important, so that the scheme of the invention can be used;
II, ultra-dense cellular network: the intelligent devices of users in the same cell are connected with the core network through the base station to obtain the DASH video, and the high dynamic property of the number of the users and the difference of the characteristics of the video need reasonable resource allocation, so the scheme of the invention can be used.
In order to better illustrate the technical solution of the present invention, the present invention is illustrated by a specific example.
Fig. 3 is a schematic diagram of an application scenario of intelligent rate adjustment and bandwidth allocation in this embodiment. As shown in fig. 3, in this embodiment, the application scenario of intelligent rate adjustment and bandwidth allocation is a home network scenario, the bottleneck link controller is a central controller, and the maximum number N of users controlled by the central controller is 10, that is, the system can accommodate up to 10 people simultaneously requesting DASH service flows, and has a variable bandwidth W of 2.5Mbps to 10Mbps, and the selectable rate steps are 5: 350Kbps, 700Kbps, 1Mbps, 1.5Mbps, and 2.5 Mbps. Setting the decision time slot pi to 5 seconds, setting the maximum value of the video caching time length of the user for normalization to 5 seconds (namely, the normalization values of the video caching time length exceeding 5 seconds are all 1), and setting the minimum value to 0 second. The present invention can be implemented in a central controller, or can be implemented by using a separate decision module, and the present embodiment deploys a functional module for implementing the present invention in the central controller.
From the above information, it can be seen that the input layer of the rate allocation neural network in the present embodiment includes 21 neural units, and the input is 21-dimensional state vector I ═ (W, b)1,s1,b2,s2,…,b10,s10) The output layer comprises 10 independent output layers, each independent output layer comprises 6 nervesA unit, the output vector of the nth independent output layer is On=(rn,0,rn,1,…,rn,5). The fully-connected hidden layer comprises 2 layers, the width of each layer is 128, the hidden layer activation function is ReLU (rectified Linear Unit), the network update uses RMSprop (root Mean Square Prop) optimizer, and the learning rate is 1 multiplied by 10-4The sum of the cross-entropies of all output layer data and label data is used as a loss function, and the L2 norm is added to prevent overfitting. Setting a plurality of user states and available bandwidth scenes to obtain corresponding state vectors, solving an optimal solution of code rate allocation by using mixed integer programming to obtain code rate allocation scheme vectors serving as marking data, and training a code rate allocation neural network.
When each decision time slot comes, the central controller obtains the number of the currently controlled users and the available bandwidth of the central controller accessing the core network. Assuming that the number of users currently requesting DASH traffic flow is 5, the length of the state vector is 1+2 × 5 — 11, and then 0 is added to make up the 21-dimensional state vector. And inputting the state vector into a trained code rate distribution neural network to obtain a code rate distribution scheme. And then carrying out feasibility check on the code rate distribution scheme, and adjusting to obtain a final code rate distribution scheme. And then obtaining a bandwidth allocation result based on the linear programming model of the embodiment. And the central controller transmits the code rate distribution scheme and the bandwidth distribution result to each user and network equipment.
Fig. 4 is a schematic diagram of information interaction between the central controller and the user in the present embodiment. As shown in fig. 4, the interaction of the central controller and the user client can be summarized as the following steps:
step 1: the central controller firstly sends an information collection request to all access user terminals which provide DASH service flow requests so as to obtain the video cache state and the active state of the user at the moment;
step 2: after receiving an information collection request of a central controller, each user client requesting a DASH service flow transmits information such as the caching duration of a currently played video, whether the video is cached completely and the like to the central controller;
and step 3: after the central controller collects the user information, the central controller captures the actual available total bandwidth at the gateway, and then the code rate and bandwidth allocation in the next decision time slot of each user are obtained by adopting the quick decision of the invention according to the collected information;
and 4, step 4: the central controller distributes the code rate in the decided user next decision time slot to the corresponding user client and writes the bandwidth distribution result into the gateway controller;
and 5: the user client receives the code rate selection scheme issued by the central controller, applies the code rate, waits for receiving the video and sends confirmation information to the central controller;
step 6: and (4) the central controller receives the user confirmation information, waits for the next decision time slot and repeats the operation from the step 1.
Although illustrative embodiments of the present invention have been described above to facilitate the understanding of the present invention by those skilled in the art, it should be understood that the present invention is not limited to the scope of the embodiments, and various changes may be made apparent to those skilled in the art as long as they are within the spirit and scope of the present invention as defined and defined by the appended claims, and all matters of the invention which utilize the inventive concepts are protected.