Disclosure of Invention
The invention aims at providing a video transmission method, a device and a system aiming at the defects of the prior art, and the aim is achieved through the following technical scheme.
A first aspect of the present invention proposes a video transmission method, the method being applied to a server, the method comprising:
receiving a video request from a user side;
Determining the current transmission resolution and resolution enhancement value according to the related parameters and the current state parameters of the last video block carried by the video request;
And after the video block to be transmitted with the current transmission resolution is obtained, transmitting the video block to be transmitted and the resolution improvement value to the user side.
The second aspect of the present invention proposes a video transmission method, where the method is applied to a user terminal, and the method includes:
Receiving a video block and a resolution enhancement value transmitted by a server;
According to the resolution ratio lifting value, carrying out resolution ratio lifting on the video block, and playing the video block with the resolution ratio lifted;
Acquiring a current state parameter and a parameter related to the video block;
And generating a video request for the next video block according to the parameters related to the video block and the current state parameters, and sending the video request to the server.
A third aspect of the present invention proposes a video transmission apparatus, the apparatus being applied to a server, the apparatus comprising:
The request receiving module is used for receiving a video request from a user side;
The determining module is used for determining the current transmission resolution and the resolution enhancement value according to the related parameter and the current state parameter of the last video block carried by the video request;
and the transmission module is used for transmitting the video block to be transmitted and the resolution improvement value to the user side after acquiring the video block to be transmitted with the current transmission resolution.
A fourth aspect of the present invention proposes a video transmission apparatus, the apparatus being applied to a user terminal, the apparatus comprising:
the video receiving module is used for receiving the video block and the resolution ratio lifting value transmitted by the server;
the video playing module is used for carrying out resolution enhancement on the video blocks according to the resolution enhancement value and playing the video blocks with the enhanced resolution;
the parameter acquisition module is used for acquiring the current state parameter and the parameter related to the video block;
And the request sending module is used for generating a video request containing the parameters related to the video block and the current state parameters and sending the video request to the server.
A fifth aspect of the present invention proposes a video transmission system, the system comprising:
the server is used for determining the current transmission resolution and the resolution enhancement value according to the related parameter and the current state parameter of the last video block transmitted carried by the video request after receiving the video request from the user side;
the client is used for carrying out resolution enhancement on the received video block to be transmitted according to the received resolution enhancement value, playing the video block with the enhanced resolution, acquiring the current state parameter and the parameter related to the video block, generating a video request for the next video block according to the parameter related to the video block and the current state parameter, and sending the video request to the server.
A sixth aspect of the invention proposes a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the method according to the first or second aspect described above.
Based on the video transmission method described in the first aspect and the second aspect, the application has the following beneficial effects:
When each video block is requested by the user side, the calculation capacity of the user side is considered to be poor compared with that of the server, so that the current state parameter and the related parameter of the previous video block are sent to the server, the server decides the resolution and the resolution lifting size of the next video block to be transmitted according to the related parameters and the current state parameter, and after the video block with the resolution is obtained, the obtained video block and the resolution lifting size obtained by decision are transmitted to the user side, and the user side performs resolution lifting on the received video block according to the received resolution lifting size and plays the video block with the resolution being lifted. The server integrates the related parameters and the current state parameters of the last video block to dynamically decide the resolution of the next video block to be transmitted, so that the average transmission code rate can be reduced, the bandwidth requirement can be reduced, the overall user experience can be improved, and the optimal video transmission service can be realized.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the invention. Rather, they are merely examples of apparatus and methods consistent with aspects of the invention as detailed in the accompanying claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the invention. The term "if" as used herein may be interpreted as "at..once" or "when..once" or "in response to a determination", depending on the context.
Example 1
Fig. 1 is a flowchart of an embodiment of a video transmission method according to an exemplary embodiment of the present application, where the video transmission method is applied to a server side providing a video service, in the embodiment of the present application, for each video stored in the server, each video block is divided into video blocks of the same duration in advance, and each video block is processed into video blocks of different resolution sizes for selecting different resolutions for transmission. As shown in fig. 1, the video transmission method includes the steps of:
step 101, receiving a video request from a user.
The video request carries the video identifier of the video requested by the user terminal, the related parameter of the last video block transmitted and the current state parameter.
It will be appreciated by those skilled in the art that if the video request is a request for the first video block sent by the client, the video request does not include the related parameter for transmitting the previous video block, or includes a default related parameter.
In this embodiment, the related parameters for transmitting the previous video block carried in the video request represent a series of action parameters related to playing the previous video block, and the current state parameters carried in the video request represent the current state between the server and the client, for example, the computing power currently allocated to the video playing task by the client, the current network state parameters between the client and the server, and the like.
Step 102, determining the current transmission resolution and resolution enhancement value according to the related parameters and the current state parameters of the last video block carried by the video request.
In an alternative embodiment, the relevant parameters and current state parameters of the last video block to be transmitted may be input into a trained neural network decision model to decide by the neural network decision model the current transmission resolution and resolution enhancement values based on the relevant parameters and current state parameters.
The neural network decision model adopts a decision model realized by a reinforcement learning method, before the decision model is used, model parameters need to be initialized in advance, continuous data with the duration of N is sampled in training data, namely data of N continuous video block transmission processes, and the data of each video block comprises:
(1) State s, state parameters between the server and the user side, such as bandwidth size and network congestion state used for representing the network state, and computing capacity allocated by the user side for video playing task;
(2) Act a, the current transmission resolution of the video block, resolution when playing the video block promotes the size;
(3) And reporting r, namely, the average resolution of the played video blocks, namely, the average resolution after resolution is improved by adopting a super resolution technology.
When training a decision model, a Q value function for evaluating the value of each action is used, Q is Q (S, a), namely, under the state S (S epsilon S) at a certain moment, the action of taking the action a (a epsilon A) can obtain a profit, and the environment feeds back the corresponding return r according to the action of the agent, so that the main idea of the algorithm is to construct the state S and the action a into a Q-table to store the Q value, and then select the action capable of obtaining the maximum profit according to the Q value.
Assuming that the data for N consecutive video blocks contains { si,ai,ri }, i ε [1, N ], the Q function Q is initialized (si,ai) and then the Q value is calculated using the following formula:
Wherein Q (si,ai) is the Q value of the transition from state si to state si+1 after taking an action ai, alpha is the learning rate, fixed value, ri is the return obtained from the transition from state si to state si+1 after executing an action ai; Is the maximum value of the Q value for all executable actions a' in the next state si+1.
Finally, the model parameters are updated by a random gradient descent method.
It is thus seen that the current state parameters include the computing power (expressed in flops units) currently allocated by the client for the video playback task, the current network state between the client and the server. The parameters related to the video block include the resolution and resolution enhancement value of the previous video block.
That is, the server can determine the action of transmitting the next video block according to the resolution and resolution enhancement value of the last video block, the current computing power of the user side and the network state.
Step 103, after obtaining the video block to be transmitted with the current transmission resolution, transmitting the video block to be transmitted and the resolution enhancement value to the user terminal.
In an alternative embodiment, since the server stores a corresponding series of consecutive video blocks in different resolution states for the same video data, video blocks of the same video content but different resolutions can be used as the associated video blocks.
Specifically, the video identifier of the video to which the previous video block belongs can be obtained, the video data of the current transmission resolution corresponding to the video identifier can be determined, and the next video block of the video block associated with the previous video block can be read from the video data as the video block to be transmitted. Wherein the associated video block is a video block of the current transmission resolution size.
The video transmission process at the server side shown in fig. 1 is completed, when the client requests a video block, the client considers that the calculation capability of the client is inferior to that of the server, so that the server sends the current state parameter and the related parameter of the previous video block to the server, and decides the resolution and resolution improvement size of the next video block to be transmitted according to the related parameter and the current state parameter, so that after the server acquires the video block with the resolution, the server transmits the acquired video block and the resolution improvement size obtained by decision to the client, and the client performs resolution improvement on the received video block according to the received resolution improvement size and plays the video block with the resolution improved. The server integrates the related parameters and the current state parameters of the last video block to dynamically decide the resolution of the next video block to be transmitted, so that the average transmission code rate can be reduced, the bandwidth requirement can be reduced, the overall user experience can be improved, and the optimal video transmission service can be realized.
Example two
Fig. 2 is a flowchart of another embodiment of a video transmission method according to the present invention, where the video transmission method is applied to a client side providing a video service, and based on the embodiment shown in fig. 1, as shown in fig. 2, the video transmission method includes the following steps:
step 201, receiving video blocks and resolution enhancement values transmitted by a server.
The resolution enhancement value transmitted by the server is the resolution enhancement size required for the video block.
And 202, carrying out resolution enhancement on the video block according to the resolution enhancement value, and playing the video block with the enhanced resolution.
In an alternative embodiment, for the resolution enhancement process, a target resolution may be determined based on the resolution enhancement value and the current resolution of the video block, and then the current resolution of the video block may be enhanced to the target resolution.
For example, the current resolution of the transmitted video block is 720p, the transmitted resolution enhancement value is 360p, and then the target resolution is 720 p+360p=1080 p.
For example, super resolution techniques may be employed to resolution boost video blocks.
Step 203, obtaining the current state parameter and the parameter related to the video block.
In an alternative embodiment, the computing power currently allocated to the video playing task by the user side and the current network state between the user side and the server may be obtained, and the computing power and the current network state are used as current state parameters, and the resolution enhancement value and the current resolution of the video block are used as parameters related to the video block.
Step 204, generating a video request for the next video block according to the parameters related to the video block and the current state parameters and sending the video request to the server.
The video transmission process of the client side shown in fig. 2 is completed, when the client requests a video block, the client side considers that the calculation capability of the client side is inferior to that of the server, so that the current state parameter and the related parameter of the previous video block are sent to the server, the server decides the resolution and the resolution enhancement size of the next video block to be transmitted according to the related parameters and the current state parameter, so that after the server acquires the video block with the resolution size, the server transmits the acquired video block and the resolution enhancement size obtained by decision to the client side, and the client side performs resolution enhancement on the received video block according to the received resolution enhancement size and plays the video block with the resolution enhancement. The server integrates the related parameters and the current state parameters of the last video block to dynamically decide the resolution of the next video block to be transmitted, so that the average transmission code rate can be reduced, the bandwidth requirement can be reduced, the overall user experience can be improved, and the optimal video transmission service can be realized.
Example III
Fig. 3 is a schematic structural diagram of a video transmission system according to an exemplary embodiment of the present invention, and based on the embodiments shown in fig. 1 to 2, the system includes:
the server is used for determining the current transmission resolution and the resolution enhancement value according to the related parameter and the current state parameter of the last video block transmitted carried by the video request after receiving the video request from the user side;
the client is used for carrying out resolution enhancement on the received video block to be transmitted according to the received resolution enhancement value, playing the video block with the enhanced resolution, acquiring the current state parameter and the parameter related to the video block, generating a video request for the next video block according to the parameter related to the video block and the current state parameter, and sending the video request to the server.
The specific flow is as follows:
When the server receives the video request, according to the related parameter and the current state parameter of the last video block transmitted carried by the video request, deciding the current transmission resolution and the resolution enhancement value, then reading the next video block of the video block (the video block with the current transmission resolution) related to the last video block by the server as a video block to be transmitted, and transmitting the video block to be transmitted and the resolution enhancement value to the user side.
When a user receives a video block and a resolution enhancement value transmitted by a server, resolution enhancement is performed on the video block according to the resolution enhancement value, the video block with the resolution enhanced is played, then the computing capacity currently distributed by the user side for a video playing task and the current network state between the user side and the server are obtained as current state parameters, the resolution enhancement value and the current resolution of the video block are simultaneously taken as parameters related to the video block, finally a video request for the next video block is generated according to the parameters related to the video block and the current state parameters, and the video request is sent to the server, and the like until the server finishes transmitting all video contents of certain video data.
Fig. 4 is a schematic structural diagram of a video transmission device according to an exemplary embodiment of the present invention, where the video transmission device is applied to a server side providing a video service, and based on the above-described method embodiment, as shown in fig. 4, the video transmission device includes:
A request receiving module 410, configured to receive a video request from a user terminal;
A determining module 420, configured to determine a current transmission resolution and a resolution enhancement value according to the relevant parameter and the current status parameter of the last video block carried by the video request;
And the transmission module 430 is configured to transmit the video block to be transmitted and the resolution enhancement value to the user terminal after obtaining the video block to be transmitted with the current transmission resolution.
Fig. 5 is a schematic structural diagram of another video transmission device according to an exemplary embodiment of the present invention, where the video transmission device is applied to a user side, and based on the above-described method embodiment, as shown in fig. 5, the video transmission device includes:
A video receiving module 510, configured to receive a video block and a resolution enhancement value transmitted by a server;
The video playing module 520 is configured to perform resolution enhancement on the video block according to the resolution enhancement value, and play the video block with the resolution enhanced;
A parameter obtaining module 530, configured to obtain a current state parameter and a parameter related to the video block;
a request sending module 540, configured to generate and send a video request including the parameter related to the video block and the current state parameter to the server.
The implementation process of the functions and roles of each unit in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present invention. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The embodiment of the present application further provides a computer readable storage medium corresponding to the video transmission method provided in the foregoing embodiment, referring to fig. 6, the computer readable storage medium is shown as an optical disc 30, on which a computer program (i.e. a program product) is stored, where the computer program, when executed by a processor, performs the video transmission method provided in any of the foregoing embodiments.
It should be noted that examples of the computer readable storage medium may also include, but are not limited to, a phase change memory (PRAM), a Static Random Access Memory (SRAM), a Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a flash memory, or other optical or magnetic storage medium, which will not be described in detail herein.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the invention.