CN116366885A - Code rate determining method and device for multimedia resources, electronic equipment and storage medium - Google Patents

Code rate determining method and device for multimedia resources, electronic equipment and storage medium Download PDF

Info

Publication number
CN116366885A
CN116366885A CN202310147629.8A CN202310147629A CN116366885A CN 116366885 A CN116366885 A CN 116366885A CN 202310147629 A CN202310147629 A CN 202310147629A CN 116366885 A CN116366885 A CN 116366885A
Authority
CN
China
Prior art keywords
buffer
multimedia resource
rate
code rate
change gradient
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310147629.8A
Other languages
Chinese (zh)
Inventor
班怡璇
周超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202310147629.8A priority Critical patent/CN116366885A/en
Publication of CN116366885A publication Critical patent/CN116366885A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements

Abstract

The disclosure provides a method and a device for determining a code rate of a multimedia resource, electronic equipment and a storage medium, and belongs to the technical field of multimedia. The method comprises the following steps: acquiring a first buffer quantity of a multimedia resource and a first sending rate of the multimedia resource; determining a buffer change gradient of a buffer area of the receiving end based on the first buffer quantity and the first transmission rate; determining an objective function based on the buffer change gradient and the first code rate; and under the condition that the function value of the objective function is minimum, determining a second code rate, wherein the second code rate is used for representing the code rate of the multimedia resource at the current moment. According to the technical scheme, the stability of the data quantity of the multimedia resources cached in the buffer zone of the receiving end is maintained, the definition and smoothness of the multimedia resources are improved, the picture jitter of the multimedia resources caused by code rate switching is reduced, and the viewing experience of a user is improved.

Description

Code rate determining method and device for multimedia resources, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of multimedia, and in particular relates to a method and a device for determining a code rate of a multimedia resource, electronic equipment and a storage medium.
Background
With the development of multimedia technology, more and more people are used to watching multimedia resources such as video or live broadcast on line. Since the bitrate of the multimedia resource directly affects the definition and smoothness of the multimedia resource, how to determine the bitrate of the multimedia resource to maximize the definition and smoothness of the multimedia resource is the focus of research in the field.
In the related art, a congestion control algorithm is generally used to determine the code rate of the multimedia resource. That is, the bandwidth is estimated as the maximum transmission bandwidth by the congestion control algorithm; and then, selecting a code rate which is most matched with the maximum transmission bandwidth, and sending the multimedia resource of the code rate to the client, thereby maximizing the definition and fluency of the multimedia resource.
However, in the above technical solution, a situation of determining the buffer of the client may also cause serious clamping. For example, assuming that the buffer length of the buffer area of the client is about to be exhausted, more multimedia resources cannot be cached, but the current bandwidth is still insufficient, more multimedia resources can still be transmitted, at this time, the server cannot be quickly switched to a lower code rate in time, so that a frame loss situation occurs, and the multimedia resources played by the client are blocked, so that the viewing experience of a user is affected.
Disclosure of Invention
The method, the device, the electronic equipment and the storage medium for determining the code rate of the multimedia resource are beneficial to stabilizing the data quantity of the multimedia resource cached in the buffer zone of the receiving end, can improve the definition and fluency of the multimedia resource, and can reduce the picture jitter of the multimedia resource caused by code rate switching, thereby improving the watching experience of users. The technical scheme of the present disclosure is as follows:
according to an aspect of the embodiments of the present disclosure, there is provided a method for determining a code rate of a multimedia resource, including:
acquiring a first buffer quantity of a multimedia resource and a first sending rate of the multimedia resource, wherein the first buffer quantity is used for representing the condition that a buffer area of a receiving end at the current moment buffers the multimedia resource, and the first sending rate is used for representing the condition that a sending end at the current moment sends the multimedia resource;
determining a buffer change gradient of a buffer zone of the receiving end based on the first buffer quantity and the first sending rate, wherein the buffer change gradient is used for representing the increment of the multimedia resource cached in the buffer zone of the receiving end in unit time;
Determining an objective function based on the buffer change gradient and a first code rate, wherein the first code rate is the code rate used when the multimedia resource is transmitted last time, the objective function is used for representing the relation between the code rate at the current moment and the first code rate, and the function value of the objective function is used for representing the difference between two adjacent code rates;
and under the condition that the function value of the objective function is minimum, determining a second code rate, wherein the second code rate is used for representing the code rate of the multimedia resource at the current moment.
According to another aspect of the embodiments of the present disclosure, there is provided a code rate determining apparatus for a multimedia resource, including:
a first obtaining unit, configured to perform obtaining a first buffer amount of a multimedia resource and a first sending rate of the multimedia resource, where the first buffer amount is used to represent a situation that a buffer area of a receiving end caches the multimedia resource at a current time, and the first sending rate is used to represent a situation that a sending end sends the multimedia resource at the current time;
a first determining unit configured to perform determining a buffer change gradient of a buffer of the receiving end based on the first buffer amount and the first transmission rate, the buffer change gradient being used to represent an increment of the multimedia resource buffered by the buffer of the receiving end per unit time;
A second determining unit configured to perform determining an objective function based on the buffer change gradient and a first code rate, the first code rate being a code rate used when the multimedia resource is transmitted last time, the objective function being used to represent a relationship between the code rate at the current time and the first code rate, a function value of the objective function being used to represent a gap between adjacent two code rates;
and a third determining unit configured to determine a second code rate, which is used for representing the code rate of the multimedia resource at the current moment, when the function value of the objective function is minimum.
In some embodiments, the first determining unit includes:
an obtaining subunit configured to perform obtaining a first proportional control factor, a first integral control factor, a second proportional control factor, and a second integral control factor, where the first proportional control factor is used to control an effect of the first buffer quantity on the buffer change gradient, the first integral control factor is used to control an effect of the buffer quantity of the receiving end on the buffer change gradient at least one time before the current time, the second proportional control factor is used to control an effect of the first sending rate on the buffer change gradient, and the second integral control factor is used to control an effect of the sending rate of the sending end on the buffer change gradient at least one time before the current time;
A determining subunit configured to perform determining a buffer change gradient of a buffer of the receiving end based on the first buffer amount, the first transmission rate, the first proportional control factor, the first integral control factor, the second proportional control factor, and the second integral control factor.
In some embodiments, the determining subunit is configured to perform obtaining a target buffer amount, at least one second buffer amount, a target sending rate and at least one second sending rate, where the target buffer amount is used to indicate an amount of data of the multimedia resource that the receiving end can buffer, the at least one second buffer amount is used to indicate an amount of data of the multimedia resource that the receiving end buffers at least one time before the current time, the target sending rate is used to indicate a maximum rate at which the sending end sends the multimedia resource, and the at least one second sending rate is used to indicate a rate at which the sending end sends the multimedia resource at least one time before the current time; taking the difference between the target buffer quantity and the first buffer quantity as a first difference, taking the total difference between the target buffer quantity and the at least one second buffer quantity as a second difference, taking the difference between the target transmission rate and the first transmission rate as a third difference, and taking the total difference between the target transmission rate and the at least one second transmission rate as a fourth difference; and summing the product between the first proportional control factor and the first difference value, the product between the first integral control factor and the second difference value, the product between the second proportional control factor and the third difference value and the product between the second integral control factor and the fourth difference value to obtain the buffer change gradient.
In some embodiments, the apparatus further comprises:
a first processing unit configured to perform subtracting a product between the first integral control factor and the second difference value and a product between the second integral control factor and the fourth difference value on the basis of the buffer change gradient in a case where the buffer change gradient is smaller than a target value, to obtain a first numerical value;
a correction unit configured to perform the buffer change gradient correction to a maximum value of the first and second values, the second value being larger than the target value;
wherein, in the case that the buffer change gradient is greater than the target value, the greater the buffer change gradient, the lower the determined code rate of the multimedia resource; and under the condition that the buffer change gradient is smaller than the target value, the larger the buffer change gradient is, the higher the determined code rate of the multimedia resource is.
In some embodiments, the apparatus further comprises:
the second processing unit is configured to execute extremum of the objective function to obtain a first extremum and a second extremum, and the first extremum is smaller than the second extremum; and taking the second value as the target value.
In some embodiments, the apparatus further comprises: a second acquisition unit configured to perform selecting, as a third buffer amount representing the current time and a maximum buffer amount reached by the receiving end before the current time, a buffer amount having a largest value from the first buffer amount and the at least one second buffer amount; determining that the target buffer size is equal to a preset buffer size when the third buffer size is smaller than the preset buffer size; and taking an average value between the third buffer quantity and the preset buffer quantity as the target buffer quantity under the condition that the third buffer quantity is not smaller than the preset buffer quantity.
In some embodiments, the first transmission rate is used to represent a content duration of the multimedia resource transmitted in a unit time;
the apparatus further comprises: a third acquisition unit configured to perform acquisition of a fourth buffer amount representing a buffer amount of the buffer area of the transmitting end at the current time and a buffer amount threshold representing a maximum buffer amount of the buffer area of the transmitting end; determining that the first transmission rate is 1 if the fourth buffer size is less than the buffer size threshold; and under the condition that the fourth buffer quantity is not smaller than the buffer quantity threshold value, determining the first transmission rate based on the content duration and the transmission duration of the multimedia resource, wherein the transmission duration is the duration spent by the multimedia resource from the transmitting end to the receiving end.
In some embodiments, the second determining unit is configured to determine a first function based on the buffer change gradient and a transmission bandwidth of the multimedia resource, where a function value of the first function is used to represent an occupancy of the transmission bandwidth when the multimedia resource is transmitted at the current time; determining a second function based on the first code rate, wherein the function value of the second function is used for representing the difference between the code rates of the multimedia resources transmitted in two adjacent times; the objective function is determined based on a minimization of a sum of the first function and the second function.
In some embodiments, the apparatus further comprises: and the switching unit is configured to perform switching of the code rate of the multimedia resource to a code rate lower than the current moment when the frame loss condition of the multimedia resource occurs at the transmitting end.
According to another aspect of the embodiments of the present disclosure, there is provided an electronic device including:
one or more processors;
a memory for storing the processor-executable program code;
wherein the processor is configured to execute the program code to implement the above-described method for determining a code rate of a multimedia resource.
According to another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, which when executed by a processor of an electronic device, enables the electronic device to perform the above-described code rate determination method of multimedia resources.
According to another aspect of the embodiments of the present disclosure, there is provided a computer program product comprising a computer program/instruction which, when executed by a processor, implements the above-described method for determining a code rate of a multimedia resource.
The embodiment of the disclosure provides a method for determining a code rate of a multimedia resource, which is characterized in that by acquiring a first buffer quantity and a first sending rate, how many of the multimedia resource is buffered in a buffer area of a receiving end and a condition that the sending end sends the multimedia resource can be known, then, according to the first buffer quantity and the first sending rate, a buffer change gradient of the buffer area of the receiving end is determined, so that according to the conditions of the receiving end and the sending end, a data change quantity of the multimedia resource buffered in the buffer area of the receiving end can be determined, stability of the data quantity of the multimedia resource buffered in the buffer area of the receiving end is facilitated, definition and smoothness of the multimedia resource are improved, then, according to the buffer change gradient and the first code rate, an objective function is determined, and under the condition that a function value of the objective function is minimum, a function value of the objective function is used for representing a gap between two adjacent times when the multimedia resource is sent last time, the determined code rate and the code rate used when the multimedia resource is transmitted last time is different from the code rate, thus, the jitter of the user experience of the multimedia resource is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
Fig. 1 is a schematic diagram illustrating an implementation environment of a method for determining a code rate of a multimedia resource according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating a code rate determination method of a multimedia resource according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating another code rate determination method of a multimedia resource according to an exemplary embodiment.
Fig. 4 is a flowchart illustrating another code rate determination method of a multimedia resource according to an exemplary embodiment.
Fig. 5 is a diagram illustrating a relationship between a code rate and a buffer change gradient of a multimedia resource according to an exemplary embodiment.
Fig. 6 is a block diagram illustrating a code rate determining method of a multimedia resource according to an exemplary embodiment.
Fig. 7 is a block diagram illustrating a code rate determining apparatus of a multimedia resource according to an exemplary embodiment.
Fig. 8 is a block diagram illustrating another code rate determining apparatus of a multimedia resource according to an exemplary embodiment.
Fig. 9 is a block diagram of a terminal according to an exemplary embodiment.
Fig. 10 is a block diagram of a server, according to an example embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
It should be noted that, the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals related to the present disclosure are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions. For example, a first buffer volume of a multimedia resource referred to in this disclosure is obtained with sufficient authorization.
Fig. 1 is a schematic diagram illustrating an implementation environment of a method for determining a code rate of a multimedia resource according to an exemplary embodiment. Taking an example in which the electronic device is provided as a server, referring to fig. 1, the implementation environment specifically includes: a terminal 101 and a server 102.
The terminal 101 is at least one of a smart phone, a smart watch, a desktop computer, a laptop computer, an MP3 player (Moving Picture Experts Group Audio Layer III, dynamic image expert compression standard audio plane 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, dynamic image expert compression standard audio plane 4), and a laptop portable computer. The terminal 101 has an application installed and running thereon. The application can be used to display multimedia assets. The multimedia asset may be an online video or a live video, etc., which is not limited by the disclosed embodiments. The user can log in to the application program through the terminal 101 to view the multimedia asset. The terminal 101 can be connected to the server 102 through a wireless network or a wired network, and further can acquire and cache the multimedia resource from the server 102, and then display the multimedia resource. That is, the terminal 101 is a receiving end of the multimedia resource.
The terminal 101 refers broadly to one of a plurality of terminals, and this embodiment is illustrated with the terminal 101. Those skilled in the art will recognize that the number of terminals may be greater or lesser. For example, the number of the terminals may be several, or the number of the terminals may be tens or hundreds, or more, and the number and the device type of the terminals are not limited in the embodiments of the present disclosure.
Server 102 is at least one of a server, a plurality of servers, a cloud computing platform, and a virtualization center. The server 102 can be connected to the terminal 101 and other terminals through a wireless network or a wired network. Server 102 is able to determine the code rate and transmission rate of the multimedia resource. The server 102 can then transmit the multimedia resources to the terminal 101 at the determined code rate and transmission rate. That is, the server 102 is the sender of the multimedia asset. In some embodiments, the number of servers described above may be greater or lesser, and embodiments of the present disclosure are not limited in this regard. Of course, the server 102 also includes other functional servers to provide more comprehensive and diverse services.
Fig. 2 is a flowchart illustrating a method for determining a code rate of a multimedia resource according to an exemplary embodiment, and referring to fig. 2, the method for determining a code rate of a multimedia resource is applied to a server, and includes the steps of:
In step 201, the server obtains a first buffer amount of the multimedia resource and a first sending rate of the multimedia resource, where the first buffer amount is used to indicate a situation that the buffer area of the receiving end caches the multimedia resource at the current time, and the first sending rate is used to indicate a situation that the sending end sends the multimedia resource at the current time.
In the embodiment of the present disclosure, the multimedia resource may be online video, live broadcast, or the like, which is not limited in the embodiment of the present disclosure. The server is the transmitting end of the multimedia resource. The terminal is a receiving end of the multimedia resource. Before a server transmits a multimedia resource to a terminal, the server acquires a first buffer amount of the multimedia resource in a receiving end and a first transmission rate of the multimedia resource in a transmitting end. The first buffer capacity can reflect the number of the cached multimedia resources in the buffer area of the receiving end at the current moment. The buffer refers to a buffer in the terminal. The first transmission rate refers to a rate at which the server will transmit the multimedia resource to the terminal. Since the rate of the multimedia resource transmitted by the server is related to the amount of the multimedia resource cached in the server, the first transmission rate can reflect the amount of the multimedia resource cached in the server.
In step 202, the server determines a buffer change gradient of the buffer of the receiving end based on the first buffer amount and the first transmission rate, where the buffer change gradient is used to represent an increment of the multimedia resource buffered in the buffer of the receiving end in a unit time.
In the embodiment of the disclosure, the buffer change gradient can reflect the change amount of the multimedia resource buffered in the buffer area of the receiving end in unit time. The embodiments of the present disclosure do not limit the magnitude of the buffer change gradient. The server can calculate a buffer change gradient according to the acquired first buffer quantity and the first sending rate. That is, the server can determine the data change amount of the multimedia resource buffered in the buffer of the receiving end according to the conditions of both the terminal and the server.
In step 203, the server determines an objective function based on the buffer change gradient and the first code rate, where the first code rate is a code rate used when the multimedia resource is transmitted last time, the objective function is used to represent a relationship between the code rate at the current time and the first code rate, and a function value of the objective function is used to represent a gap between two adjacent code rates.
In the disclosed embodiments, the multimedia asset is transmitted in the form of a plurality of video clips. That is, the server sequentially transmits a plurality of video clips of the multimedia resource to the terminal in time sequence. The server can construct an objective function. The objective function can reflect the relation between code rates used by the adjacent two-time transmission of the multimedia resource. The server obtains a first code rate used by the video slicing that last transmitted the multimedia resource. The server then brings the buffer gradient and the first code rate into the constructed objective function. In this case, the objective function can reflect a gap between a code rate at the current time and a code rate used when the multimedia resource was last transmitted.
In step 204, in case the function value of the objective function is the smallest, the server determines a second code rate, which is used to represent the code rate of the multimedia resource at the current moment.
In the embodiment of the disclosure, since the function value of the objective function is used to represent the difference between the code rates used by the adjacent two transmitted multimedia resources, the second code rate determined by the server can minimize the difference between the code rate at the current moment and the first code rate. Then, the server transmits the multimedia resource of the second code rate to the terminal. The mode enables the variation of the code rate of the multimedia resource of the receiving end of the terminal adjacent to the terminal twice to be minimum, thereby reducing the picture jitter of the multimedia resource and improving the watching experience of users.
The embodiment of the disclosure provides a method for determining a code rate of a multimedia resource, which is characterized in that by acquiring a first buffer quantity and a first sending rate, how many of the multimedia resource is buffered in a buffer area of a receiving end and a condition that the sending end sends the multimedia resource can be known, then, according to the first buffer quantity and the first sending rate, a buffer change gradient of the buffer area of the receiving end is determined, so that according to the conditions of the receiving end and the sending end, a data change quantity of the multimedia resource buffered in the buffer area of the receiving end can be determined, stability of the data quantity of the multimedia resource buffered in the buffer area of the receiving end is facilitated, definition and smoothness of the multimedia resource are improved, then, according to the buffer change gradient and the first code rate, an objective function is determined, and under the condition that a function value of the objective function is minimum, a function value of the objective function is used for representing a gap between two adjacent times when the multimedia resource is sent last time, the determined code rate and the code rate used when the multimedia resource is transmitted last time is different from the code rate, thus, the jitter of the user experience of the multimedia resource is reduced.
In some embodiments, determining a buffer change gradient of a buffer at a receiving end based on a first buffer amount and a first transmission rate includes:
acquiring a first proportional control factor, a first integral control factor, a second proportional control factor and a second integral control factor, wherein the first proportional control factor is used for controlling the influence of a first buffer quantity on a buffer change gradient, the first integral control factor is used for controlling the influence of a buffer quantity of a receiving end on the buffer change gradient at least one moment before the current moment, the second proportional control factor is used for controlling the influence of a first sending rate on the buffer change gradient, and the second integral control factor is used for controlling the influence of the sending rate of the sending end on the buffer change gradient at least one moment before the current moment;
a buffer change gradient of a buffer of the receiving end is determined based on the first buffer amount, the first transmission rate, the first proportional control factor, the first integral control factor, the second proportional control factor, and the second integral control factor.
According to the scheme provided by the embodiment of the disclosure, the influence of the first buffer quantity on the buffer change gradient is controlled through the first proportional control factor, the influence of the buffer quantity of the receiving end on the buffer change gradient at least at one moment before the current moment is controlled through the first integral control factor, the influence of the first sending rate on the buffer change gradient is controlled through the second proportional control factor, the influence of the sending rate of the sending end on the buffer change gradient at least at one moment before the current moment is controlled through the second integral control factor, the mode of calculating the code rate of the multimedia resource through the proportional integral control mode is realized, the error of the code rate calculation is reduced, and the user can adjust the sizes of the factors according to the requirement, so that the influence of multiple aspects on the buffer change gradient can be adjusted according to the requirement, and the intention of the user is met.
In some embodiments, determining the buffer change gradient of the buffer at the receiving end based on the first buffer amount, the first transmission rate, the first proportional control factor, the first integral control factor, the second proportional control factor, and the second integral control factor comprises:
acquiring a target buffer quantity, at least one second buffer quantity, a target sending rate and at least one second sending rate, wherein the target buffer quantity is used for representing the data quantity of the multimedia resource which can be buffered by the receiving end, the at least one second buffer quantity is used for representing the data quantity of the multimedia resource which is buffered by the receiving end at least one moment before the current moment, the target sending rate is used for representing the maximum rate of the multimedia resource sent by the sending end, and the at least one second sending rate is used for representing the rate of the multimedia resource sent by the sending end at least one moment before the current moment;
taking the difference between the target buffer quantity and the first buffer quantity as a first difference, taking the total difference between the target buffer quantity and at least one second buffer quantity as a second difference, taking the difference between the target sending rate and the first sending rate as a third difference, and taking the total difference between the target sending rate and at least one second sending rate as a fourth difference;
And summing the product between the first proportional control factor and the first difference value, the product between the first integral control factor and the second difference value, the product between the second proportional control factor and the third difference value and the product between the second integral control factor and the fourth difference value to obtain the buffer change gradient.
According to the scheme provided by the embodiment of the disclosure, the difference between the buffer capacity of the multimedia resource in the receiving end at the current moment and the maximum data capacity of the multimedia resource which can be buffered is obtained by taking the difference between the target buffer capacity and the first buffer capacity as the first difference; taking the total difference between the target buffer capacity and at least one second buffer capacity as a second difference to obtain a difference between the buffer capacity of the multimedia resource in the receiving end before the current moment and the maximum data capacity of the multimedia resource which can be buffered; taking the difference between the target sending rate and the first sending rate as a third difference to obtain the difference between the rate of sending the multimedia resource by the sending end and the maximum rate of sending the multimedia resource at the current moment; taking the total difference between the target sending rate and at least one second sending rate as a fourth difference to obtain a gap between the rate of sending the multimedia resource by the sending end and the maximum rate of sending the multimedia resource before the current moment; then, the first proportional control factor, the first integral control factor, the second proportional control factor and the second integral control factor are used for multiplying the gaps respectively, so that the gaps can be controlled by the control factors, the buffer change gradient is determined according to the previous and current gaps, the buffer change gradient can be more accurate, and the current situation is met.
In some embodiments, the method further comprises:
subtracting the product between the first integral control factor and the second difference value and the product between the second integral control factor and the fourth difference value on the basis of the buffer change gradient under the condition that the buffer change gradient is smaller than the target value to obtain a first numerical value;
correcting the buffer change gradient to be the maximum value of a first value and a second value, wherein the second value is larger than the target value;
wherein, under the condition that the buffer change gradient is larger than the target value, the larger the buffer change gradient is, the lower the code rate of the determined multimedia resource is; in the case that the buffer change gradient is smaller than the target value, the larger the buffer change gradient is, the higher the determined code rate of the multimedia resource is.
According to the scheme provided by the embodiment of the disclosure, under the condition that the buffer change gradient is smaller than the target value, the higher the buffer change gradient is, the higher the determined code rate of the multimedia resource is, the product between the first integral control factor and the second difference value and the product between the second integral control factor and the fourth difference value are smaller than zero when the buffer change gradient is smaller than zero, and as the buffer change gradient is increased, the determined code rate of the multimedia resource is increased, when the rate of the buffered multimedia resource is lower, the higher the code rate of the multimedia resource is still sent, the slower the rate of the buffered multimedia resource is, the caton is caused, therefore, under the condition that the buffer change gradient is smaller than the target value, the product between the first integral control factor and the second difference value and the product between the second integral control factor and the fourth difference value are subtracted, the buffer change gradient is corrected, and as the second value is larger than the target value, the corrected buffer change gradient is the maximum value of the first value and the second value, the buffer change gradient is always larger than the target value, the determined rate of the buffered multimedia resource is still sent, the higher the rate of the buffer change gradient is slower than the target value, the determined multimedia resource is further improved, and the user experience is further reduced.
In some embodiments, the method further comprises:
obtaining an extremum of the objective function to obtain a first extremum and a second extremum, wherein the first extremum is smaller than the second extremum;
the second level value is taken as the target value.
According to the scheme provided by the embodiment of the disclosure, the target value is determined by solving the extremum of the objective function, so that the relation between the buffer change gradient and the code rate of the multimedia resource can be obtained, the determined target value accords with the condition that the buffer change gradient is larger than the target value, and the determined code rate of the multimedia resource is lower when the buffer change gradient is larger than the target value, so that the buffer change gradient is corrected, the determined code rate accords with the current conditions of the receiving end and the transmitting end, the problem of blocking of the multimedia resource is reduced, and user experience is improved.
In some embodiments, the process of obtaining the target buffer volume includes:
selecting the buffer quantity with the largest value from the first buffer quantity and at least one second buffer quantity as a third buffer quantity, wherein the third buffer quantity is used for representing the current moment and the maximum buffer quantity reached by a receiving end before the current moment;
determining that the target buffer size is equal to the preset buffer size under the condition that the third buffer size is smaller than the preset buffer size;
And taking an average value between the third buffer quantity and the preset buffer quantity as a target buffer quantity in the case that the third buffer quantity is not smaller than the preset buffer quantity.
According to the scheme provided by the embodiment of the disclosure, the maximum buffer volume achieved by the receiving end before the previous moment is compared with the preset buffer volume, the target buffer volume is determined to be equal to the preset buffer volume under the condition that the third buffer volume is smaller than the preset buffer volume, and the average value between the third buffer volume and the preset buffer volume is taken as the target buffer volume under the condition that the third buffer volume is not smaller than the preset buffer volume, so that the change based on the target buffer volume tends to be stable, the change of the code rate of the multimedia resource which is determined later tends to be stable, the code rate is prevented from being greatly adjusted, the picture jitter of the multimedia resource is further reduced, and the user viewing experience is improved.
In some embodiments, the first transmission rate is used to represent a content duration of the multimedia asset transmitted per unit time;
a process for obtaining a first transmission rate, comprising:
acquiring a fourth buffer quantity and a buffer quantity threshold value, wherein the fourth buffer quantity is used for representing the buffer quantity of a buffer zone of a transmitting end at the current moment, and the buffer quantity threshold value is used for representing the maximum buffer quantity of the buffer zone of the transmitting end;
Determining that the first transmission rate is 1 in the case that the fourth buffer size is smaller than the buffer size threshold;
and under the condition that the fourth buffer quantity is not smaller than the buffer quantity threshold value, determining a first transmission rate based on the content duration and the transmission duration of the multimedia resource, wherein the transmission duration is the duration spent by the multimedia resource from the transmitting end to the receiving end.
According to the scheme provided by the embodiment of the disclosure, since the sending rate of the server is related to the amount of the multimedia resources buffered in the server, sometimes, not only the sending rate is reduced due to the bad downstream link, but also the server does not have the multimedia resources, the first sending rate is determined to be 1 by comparing the buffer amount of the buffer area of the sending end at the current moment with the maximum buffer amount, and the first sending rate is used for representing the content duration of the multimedia resources sent in unit time, and the determined first sending rate equal to 1 is equivalent to the maximum sending rate, namely, when the buffer amount of the buffer area of the sending end at the current moment is smaller than the maximum buffer amount, the sending rate is confirmed to reach the maximum sending rate; under the condition that the buffer volume of the buffer zone of the transmitting end at the current moment is not smaller than the maximum buffer volume, the actual transmitting rate is calculated according to the content duration and the transmitting duration of the multimedia resource, so that the first transmitting rate is corrected, the accuracy of the first transmitting rate is improved, and the code rate which is more in line with the current situation can be obtained later.
In some embodiments, determining the objective function based on the buffer change gradient and the first code rate includes:
determining a first function based on the buffer change gradient and the transmission bandwidth of the multimedia resource, wherein the function value of the first function is used for representing the occupation condition of the transmission bandwidth when the multimedia resource is transmitted at the current moment;
determining a second function based on the first code rate, wherein the function value of the second function is used for representing the difference between the code rates of the adjacent two-time transmitted multimedia resources;
an objective function is determined based on a minimization of a sum of the first function and the second function.
According to the scheme provided by the embodiment of the disclosure, the first function is determined through the buffer change gradient and the transmission bandwidth of the multimedia resource, the second function is determined through the first code rate, and the function value of the first function is used for representing the occupation condition of the transmission bandwidth when the multimedia resource is transmitted at the current moment, and the function value of the second function is used for representing the difference between the code rates of the adjacent two transmitted multimedia resources, so that the target function determined based on the minimization of the sum of the first function and the second function not only considers the occupation rate of the transmission bandwidth, but also considers the condition that the switching of the code rates is as small as possible, thereby being beneficial to maintaining the stability of the buffer area of the receiving end, improving the definition and fluency of the multimedia resource, reducing the picture jitter of the multimedia resource, and improving the viewing experience of users.
In some embodiments, the method further comprises:
when the frame loss condition of the multimedia resource occurs at the transmitting end, the code rate of the multimedia resource is switched to the code rate lower than the current time.
According to the scheme provided by the embodiment of the disclosure, under the condition that the frame loss of the multimedia resource occurs at the sending end, the code rate of the multimedia resource is switched to be lower than the code rate at the current moment, so that the multimedia resource of a plurality of frames can be transmitted to the receiving end, the frame loss quantity is reduced, and the fluency of the multimedia resource in the receiving end can be improved.
The foregoing fig. 2 illustrates a basic flow of the present disclosure, and the scheme provided in the present disclosure is further described below based on a specific implementation, and fig. 3 is a flowchart illustrating another method for determining a code rate of a multimedia resource according to an exemplary embodiment. Taking the example that the electronic device is provided as a server, see fig. 3, the method comprises:
in step 301, the server obtains a first buffer amount of the multimedia resource and a first sending rate of the multimedia resource, where the first buffer amount is used to indicate a situation that the buffer area of the receiving end caches the multimedia resource at the current time, and the first sending rate is used to indicate a situation that the sending end sends the multimedia resource at the current time.
In the embodiment of the present disclosure, the first buffer size can reflect how many multimedia resources are buffered in the buffer area of the receiving end at the current time. The amount of buffering may also be referred to as the buffer length. The embodiment of the present disclosure does not limit the manner of acquiring the first buffer amount. The first transmission rate refers to a rate at which the server will transmit the multimedia resource to the terminal. The first transmission rate may be the number of bytes of the multimedia resource transmitted in a unit time, or may be the content duration of the multimedia resource transmitted in a unit time, which is not limited by the embodiment of the present disclosure.
In some embodiments, the first transmission rate is used to represent a content duration of a multimedia asset transmitted per unit time. Accordingly, the process of obtaining the first sending rate by the server includes: the server obtains a fourth buffer amount and a buffer amount threshold. The fourth buffer amount is used for representing the buffer amount of the buffer area of the transmitting end at the current moment, and the buffer amount threshold is used for representing the maximum buffer amount of the buffer area of the transmitting end. Then, in the case where the fourth buffer amount is smaller than the buffer amount threshold value, the server determines that the first transmission rate is 1. And under the condition that the fourth buffer quantity is not smaller than the buffer quantity threshold value, the server determines the first sending rate based on the content duration and the sending duration of the multimedia resource, wherein the sending duration is the duration spent by the multimedia resource from the sending end to the receiving end. According to the scheme provided by the embodiment of the disclosure, since the sending rate of the server is related to the amount of the multimedia resources buffered in the server, sometimes, not only the sending rate is reduced due to the bad downstream link, but also the server does not have the multimedia resources, the first sending rate is determined to be 1 by comparing the buffer amount of the buffer area of the sending end at the current moment with the maximum buffer amount, and the first sending rate is used for representing the content duration of the multimedia resources sent in unit time, and the determined first sending rate equal to 1 is equivalent to the maximum sending rate, namely, when the buffer amount of the buffer area of the sending end at the current moment is smaller than the maximum buffer amount, the sending rate is confirmed to reach the maximum sending rate; under the condition that the buffer volume of the buffer zone of the transmitting end at the current moment is not smaller than the maximum buffer volume, the actual transmitting rate is calculated according to the content duration and the transmitting duration of the multimedia resource, so that the first transmitting rate is corrected, the accuracy of the first transmitting rate is improved, and the code rate which is more in line with the current situation can be obtained later.
In some embodiments, the server may determine the first transmission rate by the following equation one.
Equation one:
Figure BDA0004090598820000131
wherein r is t For representing a first transmission rate;
Figure BDA0004090598820000132
for representing a fourth buffer size; />
Figure BDA0004090598820000133
For representing the maximum buffer size; t (T) send A content duration for representing the multimedia asset; t is used to represent the transmission duration of the multimedia resource.
In step 302, the server obtains a first proportional control factor, a first integral control factor, a second proportional control factor, and a second integral control factor, where the first proportional control factor is used to control an effect of the first buffer volume on the buffer change gradient, the first integral control factor is used to control an effect of the buffer volume of the receiving end on the buffer change gradient at least one time before the current time, the second proportional control factor is used to control an effect of the first sending rate on the buffer change gradient, and the second integral control factor is used to control an effect of the sending rate of the sending end on the buffer change gradient at least one time before the current time.
In the embodiment of the disclosure, the server may obtain the first proportional control factor, the first integral control factor, the second proportional control factor, and the second integral control factor from the terminal. The server may also store a plurality of control factors as described above. That is, the server may also directly obtain the plurality of control factors from its own storage, and the method for obtaining the plurality of control factors is not limited in the embodiments of the present disclosure. The magnitude of the plurality of control factors is not limited in the embodiments of the present disclosure. The first proportional control factor, the first integral control factor, the second proportional control factor, and the second integral control factor may be user-defined.
In step 303, the server determines a buffer change gradient of the buffer at the receiving end based on the first buffer amount, the first transmission rate, the first proportional control factor, the first integral control factor, the second proportional control factor, and the second integral control factor.
In the embodiment of the disclosure, the buffer change gradient can represent an increment of the multimedia resource buffered in the buffer area of the receiving end in unit time. The server determines a buffer change gradient by a first buffer amount, a first transmission rate, a first proportional control factor, a first integral control factor, a second proportional control factor, and a second integral control factor. According to the scheme provided by the embodiment of the disclosure, the influence of the first buffer quantity on the buffer change gradient is controlled through the first proportional control factor, the influence of the buffer quantity of the receiving end on the buffer change gradient at least at one moment before the current moment is controlled through the first integral control factor, the influence of the first sending rate on the buffer change gradient is controlled through the second proportional control factor, the influence of the sending rate of the sending end on the buffer change gradient at least at one moment before the current moment is controlled through the second integral control factor, the mode of calculating the code rate of the multimedia resource through the proportional integral control mode is realized, the error of the code rate calculation is reduced, and the user can adjust the sizes of the factors according to the requirement, so that the influence of multiple aspects on the buffer change gradient can be adjusted according to the requirement, and the intention of the user is met.
In some embodiments, the server can obtain the data amount of the multimedia resource buffered by the receiving end at least one time before the current time and the rate at which the sending end sends the multimedia resource at least one time before the current time, so as to determine the buffer change gradient. Accordingly, step 303 includes steps 3031 to 3033 described below. Referring to fig. 4, fig. 4 is a flowchart illustrating another code rate determination method of multimedia resources according to an exemplary embodiment.
3031. The server obtains a target buffer amount, at least one second buffer amount, a target sending rate and at least one second sending rate, wherein the target buffer amount is used for indicating the data amount of the multimedia resource which can be buffered by the receiving end, the at least one second buffer amount is used for indicating the data amount of the multimedia resource which is buffered by the receiving end at least one moment before the current moment, the target sending rate is used for indicating the maximum rate of the multimedia resource sent by the sending end, and the at least one second sending rate is used for indicating the rate of the multimedia resource sent by the sending end at least one moment before the current moment.
The target buffer size can represent the maximum data size of the receiving end capable of buffering the multimedia resource. In case the transmission bandwidth of the multimedia resource is sufficient, the amount of buffering in the receiving end is substantially positively correlated with the delay. In other words, once the multimedia resource at the receiving end is blocked, the playing progress will stop, and after the network is restored, the receiving end will receive the multimedia resource exceeding the target buffer capacity. Under the condition, if the code rate is determined only according to the original target buffer quantity, the multimedia resource is quickly cut up to a high code rate, so that the buffer quantity of the receiving end is reduced, and then the buffer quantity of the receiving end is continuously increased and circularly reciprocated due to the fact that the buffer quantity of the receiving end is cut down to a low code rate, so that a user observes that a picture of the multimedia resource has stronger quality jitter. To reduce this jitter, a dynamic target buffer size is set.
In some embodiments, the target buffer size may be related to a maximum buffer size reached by the receiving end before the current time. Accordingly, the process of the server obtaining the target buffer volume includes: the server selects the buffer volume with the largest value from the first buffer volume and at least one second buffer volume as a third buffer volume. The third buffer amount is used to represent the current time and the maximum buffer amount reached by the receiving end before the current time. In the case that the third buffer size is smaller than the preset buffer size, the server determines that the target buffer size is equal to the preset buffer size. In the case that the third buffer size is not smaller than the preset buffer size, the server takes an average value between the third buffer size and the preset buffer size as a target buffer size. The embodiment of the present disclosure does not limit the size of the preset buffer amount. According to the scheme provided by the embodiment of the disclosure, the maximum buffer volume achieved by the receiving end before the previous moment is compared with the preset buffer volume, the target buffer volume is determined to be equal to the preset buffer volume under the condition that the third buffer volume is smaller than the preset buffer volume, and the average value between the third buffer volume and the preset buffer volume is taken as the target buffer volume under the condition that the third buffer volume is not smaller than the preset buffer volume, so that the change based on the target buffer volume tends to be stable, the change of the code rate of the multimedia resource which is determined later tends to be stable, the code rate is prevented from being greatly adjusted, the picture jitter of the multimedia resource is further reduced, and the user viewing experience is improved.
Alternatively, the server may determine the target buffer amount by the following equation two.
Formula II:
Figure BDA0004090598820000151
Figure BDA0004090598820000152
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure BDA0004090598820000153
for indicating the target buffer quantity, q init For representing a preset buffer amount; />
Figure BDA0004090598820000154
For representing a third buffer quantity; q t ,q t-1 ,…,q t-N+1 A plurality of buffers for respectively representing the current time and the previous time; q t For representing a first buffer quantity; q t-1 ,…,q t-N+1 For representing at least one second buffer quantity; n is used to represent the number of second buffers.
In step 3031, embodiments of the present disclosure do not limit the number of second buffers and the number of second transmission rates. The number of second buffers and the number of second transmission rates may be user-defined. The target sending rate is used to represent the maximum rate at which the sending end sends the multimedia resource. Optionally, the transmission rate is used to represent a content duration of the multimedia resource transmitted per unit time. Accordingly, the target transmission rate is equal to 1.
3032. The server takes the difference between the target buffer quantity and the first buffer quantity as a first difference, takes the total difference between the target buffer quantity and at least one second buffer quantity as a second difference, takes the difference between the target sending rate and the first sending rate as a third difference, and takes the total difference between the target sending rate and at least one second sending rate as a fourth difference.
The server subtracts the first buffer amount from the target buffer amount to obtain a first difference value. The server respectively makes differences between the target buffer quantity and at least one second buffer quantity and sums the differences to obtain a second difference value. The server subtracts the first transmission rate from the target transmission rate to obtain a third difference. The server respectively makes differences between the target sending rate and at least one second sending rate and sums the differences to obtain a fourth difference value.
3033. The server sums the product between the first proportional control factor and the first difference value, the product between the first integral control factor and the second difference value, the product between the second proportional control factor and the third difference value, and the product between the second integral control factor and the fourth difference value to obtain a buffer change gradient.
Wherein the server multiplies the first proportional control factor by the first difference value; multiplying the first integral control factor by the second difference; multiplying the second scale control factor by the third difference; the second integral control factor is multiplied by the fourth difference. Then, the server sums up the four products obtained by multiplying the above to obtain the buffer change gradient. According to the scheme provided by the embodiment of the disclosure, the difference between the buffer capacity of the multimedia resource in the receiving end at the current moment and the maximum data capacity of the multimedia resource which can be buffered is obtained by taking the difference between the target buffer capacity and the first buffer capacity as the first difference; taking the total difference between the target buffer capacity and at least one second buffer capacity as a second difference to obtain a difference between the buffer capacity of the multimedia resource in the receiving end before the current moment and the maximum data capacity of the multimedia resource which can be buffered; taking the difference between the target sending rate and the first sending rate as a third difference to obtain the difference between the rate of sending the multimedia resource by the sending end and the maximum rate of sending the multimedia resource at the current moment; taking the total difference between the target sending rate and at least one second sending rate as a fourth difference to obtain a gap between the rate of sending the multimedia resource by the sending end and the maximum rate of sending the multimedia resource before the current moment; then, the first proportional control factor, the first integral control factor, the second proportional control factor and the second integral control factor are used for multiplying the gaps respectively, so that the gaps can be controlled by the control factors, the buffer change gradient is determined according to the previous and current gaps, the buffer change gradient can be more accurate, and the current situation is met.
In some embodiments, the server may determine the buffer change gradient through equation three below.
And (3) a formula III:
Figure BDA0004090598820000161
wherein d t For representing a buffer change gradient;
Figure BDA0004090598820000162
for representing a first proportional control factor; />
Figure BDA0004090598820000163
For representing a first integral control factor; />
Figure BDA0004090598820000164
For representing a second scale control factor; />
Figure BDA0004090598820000165
For representing a second integral control factor; />
Figure BDA0004090598820000166
For representing a target buffer size; q t For representing a first buffer quantity; q i For representing a second buffer quantity; r is (r) target For representing a target transmission rate; r is (r) t For representing a first transmission rate; r is (r) i For representing a second transmission rate; and 1 is used for indicating a steady-state error of playing the multimedia resource by the receiving end, namely, the receiving end is guaranteed to buffer the multimedia resource for 1 second every second, so that the receiving end is guaranteed to play the continuous multimedia resource.
In some embodiments, in the case of good network conditions, no matter what code rate is selected, the buffer size of the buffer at the receiving end will not change, and may be continuously higher than the target buffer size. In this case, the portion of the buffer change gradient controlled by the integral control factor is always smaller than 0, so that the buffer change gradient is always negative and cannot be recovered, and the code rate may be selected to be a low gear when the buffer change gradient is selected, so that when the rate of the buffered multimedia resource is low, the multimedia resource with a higher code rate is still transmitted, and further, less multimedia resource is received, and further, the buffer change gradient is blocked, so that the buffer change gradient needs to be corrected. Correspondingly, the process of correcting the buffer change gradient by the server is as follows: and under the condition that the buffer change gradient is smaller than the target value, subtracting the product between the first integral control factor and the second difference value and the product between the second integral control factor and the fourth difference value by the server on the basis of the buffer change gradient to obtain a first numerical value. Then, the server corrects the buffer change gradient to a maximum value of the first value and the second value, the second value being larger than the target value. Wherein, under the condition that the buffer change gradient is larger than the target value, the larger the buffer change gradient is, the lower the code rate of the determined multimedia resource is; in the case that the buffer change gradient is smaller than the target value, the larger the buffer change gradient is, the higher the determined code rate of the multimedia resource is. According to the scheme provided by the embodiment of the disclosure, under the condition that the buffer change gradient is smaller than the target value, the higher the buffer change gradient is, the higher the determined code rate of the multimedia resource is, the product between the first integral control factor and the second difference value and the product between the second integral control factor and the fourth difference value are smaller than zero when the buffer change gradient is smaller than zero, and as the buffer change gradient is increased, the determined code rate of the multimedia resource is increased, when the rate of the buffered multimedia resource is lower, the higher the code rate of the multimedia resource is still sent, so that the received multimedia resource is less, and then the clamping is caused, therefore, under the condition that the buffer change gradient is smaller than the target value, the product between the first integral control factor and the second difference value and the product between the second integral control factor and the fourth difference value are subtracted, the buffer change gradient is corrected, and as the second value is larger than the target value, the modified buffer change gradient is the maximum value of the first value and the second value, the buffer change gradient is always larger than the target value, the determined multimedia resource with the higher code rate is still sent, and therefore the media experience of the lower the clamping rate of the multimedia resource is improved, and the user experience is further improved.
Wherein, the server can determine the relation between the code rate of the multimedia resource and the buffer change gradient based on the objective function for determining the code rate, thereby correcting the buffer change gradient.
Alternatively, the objective function for determining the code rate may be the following equation four.
Equation four:
Figure BDA0004090598820000171
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure BDA0004090598820000172
for representing the finally determined code rate; d, d t For representing a buffer change gradient; r is R t The code rate used for representing the multimedia resource at the current moment is a variable in the formula; c (C) t A transmission bandwidth for representing the multimedia resource; r is R t-1 A code rate used for representing the last time the multimedia resource was transmitted; μ is used to represent a weight parameter, which may be fixed or dynamic, and the embodiments of the present disclosure are not limited thereto.
From the mathematical point of view, after modeling of the objective function, the target value determined by the user is actually an extremum solving problem, so that the relation between the code rate of the multimedia resource and the buffer change gradient is obtained according to the target value. Accordingly, the process of determining the target value by the server is: the server calculates an extremum of the objective function to obtain a first extremum and a second extremum, wherein the first extremum is smaller than the second extremum. Then, the server takes the second level value as the target value. According to the scheme provided by the embodiment of the disclosure, the target value is determined by solving the extremum of the objective function, so that the relation between the buffer change gradient and the code rate of the multimedia resource can be obtained, the determined target value accords with the condition that the buffer change gradient is larger than the target value, the determined code rate of the multimedia resource is lower when the buffer change gradient is larger than the target value, the buffer change gradient is corrected, the determined code rate accords with the condition that the buffer change gradient is larger, the determined code rate of the multimedia resource is lower, the problem of blocking of the multimedia resource is reduced, and therefore user experience is improved.
The server may derive the objective function to obtain the following equation five.
Formula five:
Figure BDA0004090598820000173
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure BDA0004090598820000174
for representing the finally determined code rate; d, d t For representing a buffer change gradient; r is R t The code rate used for representing the multimedia resource at the current moment is a variable in the formula; c (C) t A transmission bandwidth for representing the multimedia resource; r is R t-1 A code rate used for representing the last time the multimedia resource was transmitted; μ is used to represent the weight parameter. For R t-1 In other words, the closer R is t-1 Rate R of (2) t The more optimal the bit rate is, the stability of the bit rate is ensured. For C t In other words, the closer R is to it t The more optimal the bandwidth utilization is, the more bandwidth utilization is guaranteed. But for d t In other words, this is not a monotonic function, see fig. 5, which shows a code rate of a multimedia resource according to an exemplary embodimentSchematic of the relationship with buffer change gradient. At d t >d 2 When the buffer change gradient is larger, the selected code rate should be lower. At d t <d 2 The larger the buffer gradient, the higher the selected code rate should be and the target is reversed, a phenomenon known as integral saturation.
The extreme point of the objective function obtained according to the above formula five can be expressed by the following formula six.
Formula six:
Figure BDA0004090598820000181
Wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure BDA0004090598820000182
for representing the finally determined code rate; d, d t For representing a buffer change gradient; r is R t The code rate used for representing the multimedia resource at the current moment is a variable in the formula; c (C) t A transmission bandwidth for representing the multimedia resource; r is R t-1 A code rate used for representing the last time the multimedia resource was transmitted; μ is used to represent the weight parameter.
In order to avoid the above-described integral saturation phenomenon, it is necessary to correct the buffer change gradient. The correction method can be a clamp integral anti-saturation method to ensure the calculated d t >d 2 . The embodiments of the present disclosure are not limited to the correction method.
d 2 The formula of (c) can be found in the following formula seven.
Formula seven:
Figure BDA0004090598820000183
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure BDA0004090598820000184
for representing the finally determined code rate; d, d t For representing a buffer change gradient; r is R t The code rate used for representing the multimedia resource at the current moment is a variable in the formula; c (C) t A transmission bandwidth for representing the multimedia resource; r is R t-1 A code rate used for representing the last time the multimedia resource was transmitted; μ is used to represent the weight parameter.
In other words, let us let
Figure BDA0004090598820000185
It is ensured that the integrated saturation state is not trapped. In order to prevent the code rate selected from being too high when the buffer capacity of the receiving end is high, we let +. >
Figure BDA0004090598820000186
And, at calculated d t <Epsilon and d t Part of the term of integration is removed and d t And simultaneously closing the integrator to avoid entering an integral saturation state. Accordingly, the buffer change gradient can be found in equation eight below.
Formula eight:
Figure BDA0004090598820000187
wherein d t For representing a buffer change gradient;
Figure BDA0004090598820000188
for representing a first integral control factor; />
Figure BDA0004090598820000189
For representing a second integral control factor; />
Figure BDA00040905988200001810
For representing a target buffer size; q i For representing a second buffer quantity; r is (r) target For representing a target transmission rate; r is (r) i For representing the second transmission rate and epsilon for representing the super-parameter.
In step 304, the server determines an objective function based on the buffer change gradient and the first code rate, where the first code rate is a code rate used when the multimedia resource is transmitted last time, the objective function is used to represent a relationship between the code rate at the current time and the first code rate, and a function value of the objective function is used to represent a gap between two adjacent code rates.
In the embodiment of the disclosure, the server obtains a first code rate used when the multimedia resource is transmitted last time. Then, the server can bring the buffer change gradient and the first code rate into the formula IV to obtain an objective function at the current moment. The first code rate is R in the formula four t-1 . The objective function can reflect the relation between code rates used by the adjacent two-time transmission of the multimedia resource. Accordingly, the process of determining the objective function by the server is as follows: the server determines a first function based on the buffer variation gradient and the transmission bandwidth of the multimedia resource. The function value of the first function is used for representing the occupation condition of the transmission bandwidth when the multimedia resource is transmitted at the current moment. The server determines a second function based on the first code rate. The function value of the second function is used to represent the gap between the code rates of the multimedia resources of the adjacent two transmissions. The server then determines an objective function based on the minimization of the sum of the first function and the second function. Wherein the first function refers to (d t ·R t -C t ) 2 The method comprises the steps of carrying out a first treatment on the surface of the The second function refers to μ (R t -R t-1 ) 2 . According to the scheme provided by the embodiment of the disclosure, the first function is determined by buffering the change gradient and the transmission bandwidth of the multimedia resource, the second function is determined by the first code rate, and the function value of the first function is used for representing the occupation condition of the transmission bandwidth when the multimedia resource is transmitted at the current moment, and the function value of the second function is used for representing the difference between the code rates of the multimedia resource transmitted at the adjacent two times, so that the target function determined based on the minimization of the sum of the first function and the second function is used for considering not only the occupation rate of the transmission bandwidth, but also the switching amplitude of the code rate is considered to be as small as possible, thereby not only being beneficial to maintaining the stability of the buffer area of the receiving end, improving the definition and fluency of the multimedia resource, but also reducing the picture jitter of the multimedia resource and improving the use The viewing experience of the user.
In step 305, in case the function value of the objective function is the smallest, the server determines a second code rate, which is used to represent the code rate of the multimedia resource at the current time.
In the embodiment of the disclosure, the server determines a second code rate of the multimedia resource at the current moment in the case that the function value of the objective function is the smallest. Then, the server transmits the multimedia resource of the second code rate to the terminal.
In some embodiments, the above method for determining the code rate of the multimedia resource may be used in combination with other algorithms in the server. The algorithm may be a frame loss algorithm, which is not limited by the embodiments of the present disclosure. That is, when the network is unstable, the code rate determining method of the multimedia resource and the frame loss algorithm can be matched together to strive for providing seamless viewing experience for the user. Correspondingly, when the frame loss condition of the multimedia resource occurs at the transmitting end, the server switches the code rate of the multimedia resource to be lower than the code rate of the current moment. The server can realize the process of switching to the code rate lower than the current moment according to the code rate determining method of the multimedia resource. According to the scheme provided by the embodiment of the disclosure, under the condition that the frame loss of the multimedia resource occurs at the sending end, the code rate of the multimedia resource is switched to be lower than the code rate at the current moment, so that the multimedia resource of a plurality of frames can be transmitted to the receiving end, the frame loss quantity is reduced, and the fluency of the multimedia resource in the receiving end can be improved.
In order to describe the method for determining the code rate of the multimedia resource more clearly, the method for determining the code rate of the multimedia resource is described again below in conjunction with the appendices. Fig. 6 is a block diagram illustrating a code rate determining method of a multimedia resource according to an exemplary embodiment. Referring to fig. 6, a server acquires information such as a transmission bandwidth, a first buffer length, and a first transmission rate of a multimedia resource. Since the first sending rate is related to the amount of the multimedia resource buffered in the buffer of the sending end, the server can obtain the situation of the buffer of the receiving end and the situation of the buffer of the sending end. Then, the server determines a buffer change gradient according to the transmission bandwidth, the buffer condition of the receiving end and the buffer condition of the transmitting end. Then, the server determines the code rate of the multimedia resource according to the buffer change gradient. The code rate determining method of the multimedia resource provided by the scheme is adopted for testing, and a good effect is obtained. That is, compared with the prior art, the scheme enables the failure rate of the multimedia resource to be forward reduced by 7.735%, the hundred second blocking time of the multimedia resource to be forward reduced by 7.462%, the hundred second blocking times of the multimedia resource to be forward reduced by 6.876%, and the blocking rate of the multimedia resource to be forward reduced by 6.758%.
The embodiment of the disclosure provides a method for determining a code rate of a multimedia resource, which is characterized in that by acquiring a first buffer quantity and a first sending rate, how many of the multimedia resource is buffered in a buffer area of a receiving end and a condition that the sending end sends the multimedia resource can be known, then, according to the first buffer quantity and the first sending rate, a buffer change gradient of the buffer area of the receiving end is determined, so that according to the conditions of the receiving end and the sending end, a data change quantity of the multimedia resource buffered in the buffer area of the receiving end can be determined, stability of the data quantity of the multimedia resource buffered in the buffer area of the receiving end is facilitated, definition and smoothness of the multimedia resource are improved, then, according to the buffer change gradient and the first code rate, an objective function is determined, and under the condition that a function value of the objective function is minimum, a function value of the objective function is used for representing a gap between two adjacent times when the multimedia resource is sent last time, the determined code rate and the code rate used when the multimedia resource is transmitted last time is different from the code rate, thus, the jitter of the user experience of the multimedia resource is reduced.
Any combination of the above-mentioned optional solutions may be adopted to form an optional embodiment of the present disclosure, which is not described herein in detail.
Fig. 7 is a block diagram illustrating a code rate determining apparatus of a multimedia resource according to an exemplary embodiment. Referring to fig. 7, the apparatus includes: a first acquisition unit 701, a first determination unit 702, a second determination unit 703, and a third determination unit 704.
A first obtaining unit 701, configured to perform obtaining a first buffer amount of the multimedia resource and a first sending rate of the multimedia resource, where the first buffer amount is used to represent a case where the buffer area of the receiving end caches the multimedia resource at the current time, and the first sending rate is used to represent a case where the sending end sends the multimedia resource at the current time;
a first determining unit 702 configured to determine a buffer change gradient of the buffer of the receiving end based on the first buffer amount and the first transmission rate, the buffer change gradient being used to represent an increment of the multimedia resource buffered by the buffer of the receiving end per unit time;
a second determining unit 703 configured to perform determining an objective function based on the buffer change gradient and the first code rate, the first code rate being a code rate used when the multimedia resource was last transmitted, the objective function being used to represent a relationship between the code rate at the current time and the first code rate, a function value of the objective function being used to represent a gap between adjacent two code rates;
The third determining unit 704 is configured to determine a second code rate, where the function value of the objective function is the smallest, and the second code rate is used to represent the code rate of the multimedia resource at the current time.
The embodiment of the disclosure provides a code rate determining device for a multimedia resource, which obtains a first buffer quantity and a first sending rate, so that the quantity of the buffered multimedia resource in a buffer area of a receiving end and the condition that the sending end sends the multimedia resource can be known, then, according to the first buffer quantity and the first sending rate, a buffer change gradient of the buffer area of the receiving end is determined, so that the data change quantity of the buffered multimedia resource in the buffer area of the receiving end can be determined according to the conditions of the receiving end and the sending end, thereby facilitating the stability of the data quantity of the buffered multimedia resource in the buffer area of the receiving end, improving the definition and smoothness of the multimedia resource, then, determining an objective function according to the buffer change gradient and the first code rate, and determining the current time under the condition that the function value of the objective function is minimum, and the function value of the objective function is used for representing the gap between two adjacent times because the first code rate is the code rate used when the multimedia resource is sent last time, so that the determined current time and the code rate used when the multimedia resource is transmitted last time have a smaller difference between the code rate and the code rate used when the multimedia resource is transmitted last time, improving the user experience of the picture.
In some embodiments, fig. 8 is a block diagram illustrating another code rate determination apparatus of multimedia resources according to an exemplary embodiment. Referring to fig. 8, the first determining unit 702 includes:
an obtaining subunit 7021 configured to perform obtaining a first proportional control factor for controlling an influence of the first buffer quantity on the buffer change gradient, a first integral control factor for controlling an influence of the buffer quantity of the receiving end on the buffer change gradient at least one time before the current time, a second proportional control factor for controlling an influence of the first transmission rate on the buffer change gradient, and a second integral control factor for controlling an influence of the transmission rate of the transmitting end on the buffer change gradient at least one time before the current time;
the determining subunit 7022 is configured to perform determining a buffer change gradient of the buffer area of the receiving end based on the first buffer amount, the first transmission rate, the first scale control factor, the first integral control factor, the second scale control factor, and the second integral control factor.
In some embodiments, with continued reference to fig. 8, the determining subunit 7022 is configured to perform obtaining a target buffer amount, at least one second buffer amount, a target sending rate, and at least one second sending rate, where the target buffer amount is used to represent an amount of data of the multimedia resource that the receiving end is capable of buffering, the at least one second buffer amount is used to represent an amount of data of the multimedia resource that the receiving end is buffering at least one time before the current time, the target sending rate is used to represent a maximum rate at which the sending end sends the multimedia resource, and the at least one second sending rate is used to represent a rate at which the sending end sends the multimedia resource at least one time before the current time; taking the difference between the target buffer quantity and the first buffer quantity as a first difference, taking the total difference between the target buffer quantity and at least one second buffer quantity as a second difference, taking the difference between the target sending rate and the first sending rate as a third difference, and taking the total difference between the target sending rate and at least one second sending rate as a fourth difference; and summing the product between the first proportional control factor and the first difference value, the product between the first integral control factor and the second difference value, the product between the second proportional control factor and the third difference value and the product between the second integral control factor and the fourth difference value to obtain the buffer change gradient.
In some embodiments, with continued reference to fig. 8, the apparatus further comprises:
a first processing unit 705 configured to perform subtracting a product between the first integral control factor and the second difference value and a product between the second integral control factor and the fourth difference value on the basis of the buffer change gradient in a case where the buffer change gradient is smaller than the target value, to obtain a first numerical value;
a correction unit 706 configured to perform a buffer change gradient correction to a maximum value of a first value and a second value, the second value being larger than the target value;
wherein, under the condition that the buffer change gradient is larger than the target value, the larger the buffer change gradient is, the lower the code rate of the determined multimedia resource is; in the case that the buffer change gradient is smaller than the target value, the larger the buffer change gradient is, the higher the determined code rate of the multimedia resource is.
In some embodiments, with continued reference to fig. 8, the apparatus further comprises:
a second processing unit 707 configured to perform extremum of the objective function, resulting in a first extremum and a second extremum, the first extremum being smaller than the second extremum; the second level value is taken as the target value.
In some embodiments, with continued reference to fig. 8, the apparatus further comprises: a second obtaining unit 708 configured to perform selecting, as a third buffer amount, a buffer amount having the largest value from the first buffer amount and at least one second buffer amount, the third buffer amount being used to represent the current time and the maximum buffer amount reached by the receiving end before the current time; determining that the target buffer size is equal to the preset buffer size under the condition that the third buffer size is smaller than the preset buffer size; and taking an average value between the third buffer quantity and the preset buffer quantity as a target buffer quantity in the case that the third buffer quantity is not smaller than the preset buffer quantity.
In some embodiments, the first transmission rate is used to represent a content duration of the multimedia asset transmitted per unit time;
with continued reference to fig. 8, the apparatus further includes: a third obtaining unit 709 configured to perform obtaining a fourth buffer amount for representing the buffer amount of the buffer area of the transmitting end at the current time and a buffer amount threshold for representing the maximum buffer amount of the buffer area of the transmitting end; determining that the first transmission rate is 1 in the case that the fourth buffer size is smaller than the buffer size threshold; and under the condition that the fourth buffer quantity is not smaller than the buffer quantity threshold value, determining a first transmission rate based on the content duration and the transmission duration of the multimedia resource, wherein the transmission duration is the duration spent by the multimedia resource from the transmitting end to the receiving end.
In some embodiments, with continued reference to fig. 8, the second determining unit 703 is configured to perform determining a first function based on the buffer change gradient and the transmission bandwidth of the multimedia resource, where a function value of the first function is used to represent an occupancy of the transmission bandwidth when the multimedia resource is transmitted at the current time; determining a second function based on the first code rate, wherein the function value of the second function is used for representing the difference between the code rates of the adjacent two-time transmitted multimedia resources; an objective function is determined based on a minimization of a sum of the first function and the second function.
In some embodiments, with continued reference to fig. 8, the apparatus further comprises: and a switching unit 710 configured to perform switching of the code rate of the multimedia resource to a code rate lower than the current time when the frame loss condition of the multimedia resource occurs at the transmitting end.
It should be noted that, when determining the code rate of the multimedia resource, the code rate determining device for a multimedia resource provided in the foregoing embodiment only performs an illustration by using the division of the foregoing functional units, in practical application, the foregoing functional allocation may be completed by different functional units according to needs, that is, the internal structure of the electronic device is divided into different functional units, so as to complete all or part of the functions described above. In addition, the device for determining the code rate of the multimedia resource provided in the foregoing embodiment belongs to the same concept as the embodiment of the method for determining the code rate of the multimedia resource, and the detailed implementation process of the device is referred to in the method embodiment, which is not described herein.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 9 is a block diagram of a terminal 900, shown in accordance with an exemplary embodiment, when the electronic device is provided as a terminal. The terminal 900 may be: smart phones, tablet computers, MP3 players, MP4 players, notebook computers or desktop computers. Terminal 900 may also be referred to by other names of user devices, portable terminals, laptop terminals, desktop terminals, etc.
In general, the terminal 900 includes: a processor 901 and a memory 902.
Processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 901 may also include a main processor and a coprocessor, the main processor being a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit ); a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 901 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 901 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 902 is used to store at least one program code for execution by processor 901 to implement the method for code rate determination of multimedia resources provided by the method embodiments in the present disclosure.
In some embodiments, the terminal 900 may further optionally include: a peripheral interface 903, and at least one peripheral. The processor 901, memory 902, and peripheral interface 903 may be connected by a bus or signal line. The individual peripheral devices may be connected to the peripheral device interface 903 via buses, signal lines, or circuit boards. Specifically, the peripheral device includes: at least one of radio frequency circuitry 904, a display 905, a camera assembly 906, audio circuitry 907, a positioning assembly 908, and a power source 909.
The peripheral interface 903 may be used to connect at least one peripheral device associated with an I/O (Input/Output) to the processor 901 and the memory 902. In some embodiments, the processor 901, memory 902, and peripheral interface 903 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 901, the memory 902, and the peripheral interface 903 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 904 is configured to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 904 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 904 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 904 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuit 904 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuitry 904 may also include NFC (Near Field Communication, short range wireless communication) related circuitry, which is not limited by the present disclosure.
The display 905 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 905 is a touch display, the display 905 also has the ability to capture touch signals at or above the surface of the display 905. The touch signal may be input as a control signal to the processor 901 for processing. At this time, the display 905 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 905 may be one, providing a front panel of the terminal 900; in other embodiments, the display 905 may be at least two, respectively disposed on different surfaces of the terminal 900 or in a folded design; in still other embodiments, the display 905 may be a flexible display disposed on a curved surface or a folded surface of the terminal 900. Even more, the display 905 may be arranged in an irregular pattern other than rectangular, i.e., a shaped screen. The display 905 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 906 is used to capture images or video. Optionally, the camera assembly 906 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 906 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 907 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 901 for processing, or inputting the electric signals to the radio frequency circuit 904 for voice communication. For purposes of stereo acquisition or noise reduction, the microphone may be plural and disposed at different portions of the terminal 900. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuit 907 may also include a headphone jack.
The location component 908 is used to locate the current geographic location of the terminal 900 to enable navigation or LBS (Location Based Service, location-based services). The positioning component 908 may be a positioning component based on the United states GPS (Global Positioning System ), the Beidou system of China, the Granati system of Russia, or the Galileo system of the European Union.
The power supply 909 is used to supply power to the various components in the terminal 900. The power supply 909 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 909 includes a rechargeable battery, the rechargeable battery can support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 900 can further include one or more sensors 910. The one or more sensors 910 include, but are not limited to: acceleration sensor 911, gyroscope sensor 912, pressure sensor 913, fingerprint sensor 914, optical sensor 915, and proximity sensor 916.
The acceleration sensor 911 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the terminal 900. For example, the acceleration sensor 911 may be used to detect components of gravitational acceleration in three coordinate axes. The processor 901 may control the display 905 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 911. The acceleration sensor 911 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 912 may detect a body direction and a rotation angle of the terminal 900, and the gyro sensor 912 may collect a 3D motion of the user on the terminal 900 in cooperation with the acceleration sensor 911. The processor 901 may implement the following functions according to the data collected by the gyro sensor 912: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 913 may be provided at a side frame of the terminal 900 and/or at a lower layer of the display 905. When the pressure sensor 913 is provided at a side frame of the terminal 900, a grip signal of the user to the terminal 900 may be detected, and the processor 901 performs left-right hand recognition or shortcut operation according to the grip signal collected by the pressure sensor 913. When the pressure sensor 913 is provided at the lower layer of the display 905, the processor 901 performs control of the operability control on the UI interface according to the pressure operation of the user on the display 905. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 914 is used for collecting the fingerprint of the user, and the processor 901 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 914, or the fingerprint sensor 914 identifies the identity of the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the processor 901 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 914 may be provided on the front, back or side of the terminal 900. When a physical key or a vendor Logo is provided on the terminal 900, the fingerprint sensor 914 may be integrated with the physical key or the vendor Logo.
The optical sensor 915 is used to collect the intensity of ambient light. In one embodiment, the processor 901 may control the display brightness of the display panel 905 based on the intensity of ambient light collected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display luminance of the display screen 905 is turned up; when the ambient light intensity is low, the display luminance of the display panel 905 is turned down. In another embodiment, the processor 901 may also dynamically adjust the shooting parameters of the camera assembly 906 based on the ambient light intensity collected by the optical sensor 915.
A proximity sensor 916, also referred to as a distance sensor, is typically provided on the front panel of the terminal 900. Proximity sensor 916 is used to collect the distance between the user and the front of terminal 900. In one embodiment, when the proximity sensor 916 detects that the distance between the user and the front face of the terminal 900 gradually decreases, the processor 901 controls the display 905 to switch from the bright screen state to the off screen state; when the proximity sensor 916 detects that the distance between the user and the front surface of the terminal 900 gradually increases, the processor 901 controls the display 905 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 9 is not limiting and that more or fewer components than shown may be included or certain components may be combined or a different arrangement of components may be employed.
When the electronic device is provided as a server, fig. 10 is a block diagram of a server 1000 according to an exemplary embodiment, where the server 1000 may have a relatively large difference due to configuration or performance, and may include one or more processors (Central Processing Units, CPU) 1001 and one or more memories 1002, where at least one program code is stored in the memories 1002 and is loaded and executed by the processor 1001 to implement the method for determining a code rate of a multimedia resource provided in the above-described respective method embodiments. Of course, the server may also have a wired or wireless network interface, a keyboard, an input/output interface, etc. to perform input/output, and the server 1000 may also include other components for implementing the functions of the device, which are not described herein.
In an exemplary embodiment, a computer readable storage medium is also provided, such as a memory 902 or a memory 1002, comprising instructions executable by the processor 901 of the terminal 900 or the processor 1001 of the server 1000 to perform the above method. Alternatively, the computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
A computer program product comprising computer programs/instructions which when executed by a processor implement the above-described method of code rate determination for a multimedia resource.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (12)

1. A method for determining a code rate of a multimedia resource, the method comprising:
acquiring a first buffer quantity of a multimedia resource and a first sending rate of the multimedia resource, wherein the first buffer quantity is used for representing the condition that a buffer area of a receiving end at the current moment buffers the multimedia resource, and the first sending rate is used for representing the condition that a sending end at the current moment sends the multimedia resource;
Determining a buffer change gradient of a buffer zone of the receiving end based on the first buffer quantity and the first sending rate, wherein the buffer change gradient is used for representing the increment of the multimedia resource cached in the buffer zone of the receiving end in unit time;
determining an objective function based on the buffer change gradient and a first code rate, wherein the first code rate is the code rate used when the multimedia resource is transmitted last time, the objective function is used for representing the relation between the code rate at the current moment and the first code rate, and the function value of the objective function is used for representing the difference between two adjacent code rates;
and under the condition that the function value of the objective function is minimum, determining a second code rate, wherein the second code rate is used for representing the code rate of the multimedia resource at the current moment.
2. The method according to claim 1, wherein determining the buffer change gradient of the buffer of the receiving end based on the first buffer amount and the first transmission rate comprises:
acquiring a first proportional control factor, a first integral control factor, a second proportional control factor and a second integral control factor, wherein the first proportional control factor is used for controlling the influence of the first buffer quantity on the buffer change gradient, the first integral control factor is used for controlling the influence of the buffer quantity of the receiving end on the buffer change gradient at least one time before the current moment, the second proportional control factor is used for controlling the influence of the first sending rate on the buffer change gradient, and the second integral control factor is used for controlling the influence of the sending rate of the sending end on the buffer change gradient at least one time before the current moment;
And determining a buffer change gradient of a buffer area of the receiving end based on the first buffer quantity, the first sending rate, the first proportional control factor, the first integral control factor, the second proportional control factor and the second integral control factor.
3. The method according to claim 2, wherein the determining the buffer change gradient of the buffer of the receiving end based on the first buffer amount, the first transmission rate, the first proportional control factor, the first integral control factor, the second proportional control factor, and the second integral control factor comprises:
obtaining a target buffer quantity, at least one second buffer quantity, a target sending rate and at least one second sending rate, wherein the target buffer quantity is used for indicating the data quantity of the multimedia resource which can be buffered by the receiving end, the at least one second buffer quantity is used for indicating the data quantity of the multimedia resource which is buffered by the receiving end at least one time before the current moment, the target sending rate is used for indicating the maximum rate of the sending end for sending the multimedia resource, and the at least one second sending rate is used for indicating the rate of the sending end for sending the multimedia resource at least one time before the current moment;
Taking the difference between the target buffer quantity and the first buffer quantity as a first difference, taking the total difference between the target buffer quantity and the at least one second buffer quantity as a second difference, taking the difference between the target transmission rate and the first transmission rate as a third difference, and taking the total difference between the target transmission rate and the at least one second transmission rate as a fourth difference;
and summing the product between the first proportional control factor and the first difference value, the product between the first integral control factor and the second difference value, the product between the second proportional control factor and the third difference value and the product between the second integral control factor and the fourth difference value to obtain the buffer change gradient.
4. A method for determining a code rate of a multimedia resource according to claim 3, further comprising:
subtracting a product between the first integral control factor and the second difference value and a product between the second integral control factor and the fourth difference value on the basis of the buffer change gradient under the condition that the buffer change gradient is smaller than a target value to obtain a first numerical value;
Correcting the buffer change gradient to be the maximum value of the first value and the second value, wherein the second value is larger than the target value;
wherein, in the case that the buffer change gradient is greater than the target value, the greater the buffer change gradient, the lower the determined code rate of the multimedia resource; and under the condition that the buffer change gradient is smaller than the target value, the larger the buffer change gradient is, the higher the determined code rate of the multimedia resource is.
5. The method for determining the code rate of the multimedia resource according to claim 4, further comprising:
obtaining an extremum of the objective function to obtain a first extremum and a second extremum, wherein the first extremum is smaller than the second extremum;
and taking the second value as the target value.
6. The method of determining a code rate of a multimedia resource according to claim 2, wherein the process of obtaining the target buffer size comprises:
selecting a buffer quantity with the largest value from the first buffer quantity and the at least one second buffer quantity as a third buffer quantity, wherein the third buffer quantity is used for representing the current moment and the largest buffer quantity reached by the receiving end before the current moment;
Determining that the target buffer size is equal to a preset buffer size when the third buffer size is smaller than the preset buffer size;
and taking an average value between the third buffer quantity and the preset buffer quantity as the target buffer quantity under the condition that the third buffer quantity is not smaller than the preset buffer quantity.
7. The method according to claim 1, wherein the first transmission rate is used to represent a content duration of the multimedia resource transmitted in a unit time;
the process of obtaining the first sending rate includes:
acquiring a fourth buffer quantity and a buffer quantity threshold value, wherein the fourth buffer quantity is used for representing the buffer quantity of the buffer zone of the sending end at the current moment, and the buffer quantity threshold value is used for representing the maximum buffer quantity of the buffer zone of the sending end;
determining that the first transmission rate is 1 if the fourth buffer size is less than the buffer size threshold;
and under the condition that the fourth buffer quantity is not smaller than the buffer quantity threshold value, determining the first transmission rate based on the content duration and the transmission duration of the multimedia resource, wherein the transmission duration is the duration spent by the multimedia resource from the transmitting end to the receiving end.
8. The method for determining a code rate of a multimedia resource according to claim 1, wherein the determining an objective function based on the buffer change gradient and the first code rate comprises:
determining a first function based on the buffer change gradient and the transmission bandwidth of the multimedia resource, wherein the function value of the first function is used for representing the occupation condition of the transmission bandwidth when the multimedia resource is transmitted at the current moment;
determining a second function based on the first code rate, wherein the function value of the second function is used for representing the difference between the code rates of the multimedia resources transmitted in two adjacent times;
the objective function is determined based on a minimization of a sum of the first function and the second function.
9. The method for determining the code rate of the multimedia resource according to claim 1, wherein the method further comprises:
when the frame loss condition of the multimedia resource occurs at the transmitting end, the code rate of the multimedia resource is switched to be lower than the code rate of the current moment.
10. A code rate determining apparatus for a multimedia resource, the apparatus comprising:
a first obtaining unit, configured to perform obtaining a first buffer amount of a multimedia resource and a first sending rate of the multimedia resource, where the first buffer amount is used to represent a situation that a buffer area of a receiving end caches the multimedia resource at a current time, and the first sending rate is used to represent a situation that a sending end sends the multimedia resource at the current time;
A first determining unit configured to perform determining a buffer change gradient of a buffer of the receiving end based on the first buffer amount and the first transmission rate, the buffer change gradient being used to represent an increment of the multimedia resource buffered by the buffer of the receiving end per unit time;
a second determining unit configured to perform determining an objective function based on the buffer change gradient and a first code rate, the first code rate being a code rate used when the multimedia resource is transmitted last time, the objective function being used to represent a relationship between the code rate at the current time and the first code rate, a function value of the objective function being used to represent a gap between adjacent two code rates;
and a third determining unit configured to determine a second code rate, which is used for representing the code rate of the multimedia resource at the current moment, when the function value of the objective function is minimum.
11. An electronic device, the electronic device comprising:
one or more processors;
a memory for storing the processor-executable program code;
wherein the processor is configured to execute the program code to implement the code rate determination method of a multimedia resource as claimed in any of claims 1 to 9.
12. A computer readable storage medium, characterized in that instructions in the computer readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of code rate determination of a multimedia resource according to any of claims 1 to 9.
CN202310147629.8A 2023-02-20 2023-02-20 Code rate determining method and device for multimedia resources, electronic equipment and storage medium Pending CN116366885A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310147629.8A CN116366885A (en) 2023-02-20 2023-02-20 Code rate determining method and device for multimedia resources, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310147629.8A CN116366885A (en) 2023-02-20 2023-02-20 Code rate determining method and device for multimedia resources, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116366885A true CN116366885A (en) 2023-06-30

Family

ID=86931194

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310147629.8A Pending CN116366885A (en) 2023-02-20 2023-02-20 Code rate determining method and device for multimedia resources, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116366885A (en)

Similar Documents

Publication Publication Date Title
US11388403B2 (en) Video encoding method and apparatus, storage medium, and device
CN110769271B (en) Method and device for adjusting code rate of multi-path code stream
CN109558837B (en) Face key point detection method, device and storage medium
CN109951398B (en) Data sending method and device and computer equipment
CN110856019B (en) Code rate allocation method, device, terminal and storage medium
EP4000700A1 (en) Camera shot movement control method, device, apparatus, and storage medium
CN111586431B (en) Method, device and equipment for live broadcast processing and storage medium
CN110933334B (en) Video noise reduction method, device, terminal and storage medium
CN114095437B (en) Method, device, electronic equipment and storage medium for transmitting data packet
CN111586413B (en) Video adjusting method and device, computer equipment and storage medium
CN110572710B (en) Video generation method, device, equipment and storage medium
CN109688064B (en) Data transmission method and device, electronic equipment and storage medium
CN110971840A (en) Video mapping method and device, computer equipment and storage medium
US20220174356A1 (en) Method for determining bandwidth, terminal, and storage medium
CN113192519B (en) Audio encoding method and apparatus, and audio decoding method and apparatus
CN111586433B (en) Code rate adjusting method, device, equipment and storage medium
CN112312186B (en) Message display method, device, terminal and storage medium
CN111083162B (en) Multimedia stream pause detection method and device
CN116366885A (en) Code rate determining method and device for multimedia resources, electronic equipment and storage medium
CN108310767B (en) Information display method, device, equipment and computer readable storage medium
CN114071224A (en) Video data processing method and device, computer equipment and storage medium
CN115086235B (en) Network congestion detection method, device, electronic equipment and storage medium
CN111526221B (en) Domain name quality determining method, device and storage medium
CN110660031B (en) Image sharpening method and device and storage medium
CN111246147B (en) Video caching method, device, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination