Data dynamic coding method and device, electronic equipment and storage medium

CN122661484APending Publication Date: 2026-08-28BEIJING ZITIAO NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510228110.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

[0004]本公开实施例提供一种数据动态编码方法、装置、电子设备及存储介质,以克服数据传输拥塞、延迟过高的问题

Benefits of technology

[0016] The data dynamic encoding method, apparatus, electronic device, and storage medium provided in this embodiment obtain the available link bandwidth of the live stream data push link and obtain a first encoding bitrate matching the available link bandwidth; obtain the storage load of the push link's send buffer and obtain a second encoding bitrate based on the storage load, wherein the send buffer is used to store the live encoded data to be sent, and the storage load is used to characterize the amount of live encoded data stored in the send buffer; determine a target encoding bitrate based on the first encoding bitrate and the second encoding bitrate, and encode the live stream data based on the target encoding bitrate to generate corresponding live encoded data. The first encoding bitrate is determined based on the available link bandwidth, and the second encoding bitrate is determined based on the storage load of the send buffer. Then, the first and second encoding bitrates are combined to determine the target encoding bitrate, and the live stream data is encoded using this target encoding bitrate. Since the determination process of the target encoding bitrate takes into account both the available link bandwidth and the storage load of the send buffer, data transmission congestion caused by excessively low available link bandwidth or excessively high storage load of the send buffer is avoided, thus reducing data transmission latency and improving the smoothness of live video streaming and the user viewing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122661484A_ABST
    Figure CN122661484A_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a data dynamic encoding method and device, electronic equipment and storage medium. The method comprises: obtaining an available link bandwidth of a push link of live streaming data; obtaining a first encoding code rate matching the available link bandwidth according to the available link bandwidth; obtaining a storage load of a sending buffer of the push link, and obtaining a second encoding code rate according to the storage load, wherein the sending buffer is used to store live encoding data to be sent, and the storage load is used to represent the storage amount of the live encoding data; determining a target encoding code rate according to the first encoding code rate and the second encoding code rate; and encoding the live streaming data based on the target encoding code rate to generate corresponding live encoding data. Since the determination process of the target encoding code rate comprehensively considers the available link bandwidth and the storage load, data transmission congestion caused by too low available link bandwidth or too high storage load of the sending buffer is avoided, and the smoothness of video live streaming is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of video coding technology, and in particular to a data dynamic coding method, apparatus, electronic device, and storage medium. Background Technology

[0002] In video live streaming applications, the broadcaster's client encodes the video data and sends it to the server. This process is called video streaming. Afterward, the server distributes the encoded video data to the viewer's client for playback.

[0003] In existing technologies, the video streaming process typically involves setting the encoding bitrate based on the available bandwidth of the streaming link, and then encoding and sending the video data using this bitrate. However, this approach can lead to problems such as data transmission congestion and high latency, affecting the smoothness of live video streaming and the user's viewing experience. Summary of the Invention

[0004] This disclosure provides a data dynamic encoding method, apparatus, electronic device, and storage medium to overcome the problems of data transmission congestion and excessive latency.

[0005] In a first aspect, embodiments of this disclosure provide a method for dynamic data encoding, including:

[0006] The available link bandwidth of the live stream data push link is obtained, and a first encoding bitrate matching the available link bandwidth is obtained based on the available link bandwidth; the storage load of the push link's send buffer is obtained, and a second encoding bitrate is obtained based on the storage load, wherein the send buffer is used to store the live encoded data to be sent, and the storage load is used to characterize the amount of live encoded data stored in the send buffer; a target encoding bitrate is determined based on the first encoding bitrate and the second encoding bitrate, and the live stream data is encoded based on the target encoding bitrate to generate corresponding live encoded data.

[0007] Secondly, embodiments of this disclosure provide a data dynamic encoding apparatus, comprising:

[0008] The acquisition module is used to acquire the available link bandwidth of the live stream data push link, and obtain a first encoding bitrate matching the available link bandwidth based on the available link bandwidth.

[0009] The processing module is used to obtain the storage load of the sending buffer of the streaming link and obtain the second encoding bitrate according to the storage load, wherein the sending buffer is used to store the live encoded data to be sent, and the storage load is used to characterize the amount of live encoded data stored in the sending buffer;

[0010] The encoding module is used to determine a target encoding bitrate based on the first encoding bitrate and the second encoding bitrate, and to encode the live stream data based on the target encoding bitrate to generate corresponding live encoded data.

[0011] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor and a memory;

[0012] The memory stores computer-executed instructions;

[0013] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the data dynamic encoding method as described in the first aspect and various possible designs of the first aspect.

[0014] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the data dynamic encoding method described in the first aspect and various possible designs of the first aspect.

[0015] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the data dynamic encoding method described in the first aspect and various possible designs of the first aspect.

[0016] The data dynamic encoding method, apparatus, electronic device, and storage medium provided in this embodiment obtain the available link bandwidth of the live stream data push link and obtain a first encoding bitrate matching the available link bandwidth; obtain the storage load of the push link's send buffer and obtain a second encoding bitrate based on the storage load, wherein the send buffer is used to store the live encoded data to be sent, and the storage load is used to characterize the amount of live encoded data stored in the send buffer; determine a target encoding bitrate based on the first encoding bitrate and the second encoding bitrate, and encode the live stream data based on the target encoding bitrate to generate corresponding live encoded data. The first encoding bitrate is determined based on the available link bandwidth, and the second encoding bitrate is determined based on the storage load of the send buffer. Then, the first and second encoding bitrates are combined to determine the target encoding bitrate, and the live stream data is encoded using this target encoding bitrate. Since the determination process of the target encoding bitrate takes into account both the available link bandwidth and the storage load of the send buffer, data transmission congestion caused by excessively low available link bandwidth or excessively high storage load of the send buffer is avoided, thus reducing data transmission latency and improving the smoothness of live video streaming and the user viewing experience. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram illustrating an application scenario of the data dynamic encoding method provided in this embodiment of the disclosure;

[0019] Figure 2 Flowchart of the data dynamic encoding method provided in the embodiments of this disclosure Figure 1 ;

[0020] Figure 3 for Figure 2 A flowchart illustrating the specific implementation of step S103 in the illustrated embodiment;

[0021] Figure 4 This is a schematic diagram illustrating a process for generating live broadcast encoded data, provided in an embodiment of the present disclosure.

[0022] Figure 5 Flowchart of the data dynamic encoding method provided in the embodiments of this disclosure Figure 2 ;

[0023] Figure 6 for Figure 5 A flowchart illustrating the specific implementation of step S202 in the illustrated embodiment;

[0024] Figure 7 A flowchart illustrating an implementation of steps S203-S204 provided in this embodiment of the disclosure;

[0025] Figure 8 for Figure 7 A flowchart illustrating the specific implementation of step S2042 in the illustrated embodiment;

[0026] Figure 9 A schematic diagram illustrating the rate of change of a coefficient corresponding to a load range, provided in an embodiment of this disclosure;

[0027] Figure 10 This is a structural block diagram of the data dynamic encoding device provided in the embodiments of this disclosure;

[0028] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;

[0029] Figure 12 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0031] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0032] The application scenarios of the embodiments of this disclosure are explained below:

[0033] The data dynamic encoding method provided in this disclosure can be applied to applications (APPs) with audio and video live streaming capabilities. More specifically, it can be applied to live video streaming scenarios. The execution subject of this embodiment can be a terminal device running the aforementioned application with audio and video live streaming capabilities, a server deploying the server corresponding to the aforementioned application, or other electronic devices that perform similar functions. Specifically, when the execution subject is a terminal device, the terminal device executes the method provided in this embodiment by running the aforementioned application; when the execution subject is a server, the server of the aforementioned application with audio and video live streaming capabilities can run partially or entirely on the server, and the method provided in this embodiment is executed on the server side, while the terminal device runs the client of the application. Communication between the server and the terminal device is based on server-client communication, thereby enabling the terminal device to obtain the execution result of the method provided in this embodiment and display it as needed.

[0034] In some embodiments, the terminal device or server can implement the data dynamic encoding method provided in this disclosure by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be program-level commands, machine instructions, or software instructions. Computer programs can be native programs or software modules in an operating system; they can be local applications, i.e., programs that need to be installed in the operating system to run, or mini-programs embedded in any app, i.e., programs that run in a browser environment. In summary, the aforementioned computer-executable instructions can be any form of instruction, and the aforementioned computer programs can be any form of application, module, or plugin; the specific implementation can be configured as needed. Furthermore, in implementing the data dynamic encoding method provided in this disclosure, the terminal device can execute the method by running computer-executable instructions or computer programs set locally, or by calling computer-executable instructions or computer programs set in an external server. In some embodiments, the server may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud storage, cloud communication, cloud database, cloud computing, cloud functions, network services, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms. Among these, cloud services may be interactive processing services that can be invoked by terminal devices.

[0035] Figure 1 This is a schematic diagram illustrating an application scenario of the data dynamic encoding method provided in this disclosure embodiment, with reference to... Figure 1 As shown in the diagram, taking a terminal device as an example, the terminal device runs a target client (application) with audio and video live streaming capabilities, such as the client of a live streaming program for broadcasters. The broadcaster user triggers the live streaming process by operating the interactive interface of the target client. Specifically, the target client continuously captures audio and video images through the image acquisition unit (e.g., camera) of the terminal device to generate live stream data. Then, the live stream data is encoded to generate live encoded data, and the live encoded data is sent to the server through a sending buffer to complete the live streaming process. After that, the server distributes the live encoded data to other viewing clients for playback, thereby enabling viewers to watch the live video.

[0036] In existing technologies, for video streaming, besides traditional fixed-bitrate video encoding strategies, the encoding bitrate is usually set based on the available bandwidth of the streaming link. Higher available bandwidth results in a higher bitrate and clearer video images, while lower available bandwidth leads to a lower bitrate and smoother playback. The codec sets encoding parameters based on the bitrate and generates encoded audio and video data, thus avoiding data congestion, queuing, or bandwidth waste caused by inconsistencies between the generation and transmission speeds of encoded data. However, in practical applications, due to the difference between the estimated link bandwidth and the actual data rate generated by the codec, bitrate control based on the estimated available bandwidth can lead to a mismatch between the amount of encoded live data and the actual link bandwidth in some scenarios, resulting in problems such as live data transmission congestion and high latency.

[0037] This disclosure provides a dynamic data encoding method to solve the above-mentioned problems.

[0038] refer to Figure 2 , Figure 2 Flowchart of the data dynamic encoding method provided in the embodiments of this disclosure Figure 1 The method of this embodiment can be applied in terminal devices. This dynamic data encoding method includes:

[0039] Step S101: Obtain the available link bandwidth of the live stream data push link, and obtain the first encoding bitrate matching the available link bandwidth based on the available link bandwidth.

[0040] refer to Figure 1The illustrated application scenario diagram illustrates the data dynamic encoding method provided, using a terminal device as the execution subject in this embodiment. For example, the terminal device runs a live streaming client with live streaming functionality. After activating the live streaming function, the terminal device first obtains the available link bandwidth of the live streaming data stream's push link, where the available link bandwidth is the amount of data that the push link can transmit per unit time. In one possible implementation, for example, the live streaming transmission system (software system, implemented by an application program) within the terminal device typically consists of a transmission unit and a codec. Specifically, the transmission unit is responsible for sending the encoded and compressed live stream data (audio and video data) and estimating the available link bandwidth of the current push link based on feedback signals. Then, based on the amount of data corresponding to the available link bandwidth, a matching encoding bitrate, i.e., the first encoding bitrate, is determined. The two satisfy a positive proportional relationship in their changing trends; that is, the larger the available link bandwidth, the larger the corresponding first encoding bitrate. The mapping relationship between the available link bandwidth and the first encoding bitrate can be determined based on prior knowledge and pre-configured within the terminal device; its specific implementation is not limited here.

[0041] Step S102: Obtain the storage load of the sending buffer of the streaming link, and obtain the second encoding bitrate based on the storage load. The sending buffer is used to store the live encoded data to be sent, and the storage load is used to characterize the amount of live encoded data stored in the sending buffer.

[0042] For example, after obtaining the first encoding bitrate, the storage load of the push stream link's send buffer is further obtained, and another encoding bitrate, namely the second encoding bitrate, is determined based on this storage load. Specifically, firstly, the push stream link's send buffer is a storage area preset on the terminal device side, used to cache encoded but not yet sent live encoded data. The terminal device encodes the live stream data composed of audio and video data using an encoder (provided by an application with audio and video live streaming capabilities), and stores it in the data queue within the send buffer. Then, based on the data queue in the send buffer, it sequentially sends the data to the server to realize the push stream of live data. In this process, the live encoded data generated by the encoder is equivalent to the input of the send buffer, while the live encoded data sent to the server based on the data queue is equivalent to the output of the send buffer. When the input speed of the send buffer is greater than the output speed, data accumulation will occur in the send buffer. Furthermore, when the send buffer experiences severe accumulation or even data overflow, it will lead to problems such as live streaming stuttering and frame dropping, affecting the normal progress of the video live streaming process. The storage load of the send buffer is an indicator representing the degree of data accumulation in the buffer. In one possible implementation, the storage load of the send buffer can be the specific amount of live encoded data stored in the send buffer, such as 100 megabytes (MB) or 1 gigabyte (GB). Alternatively, the storage load of the send buffer can be the percentage of the live encoded data stored in the send buffer relative to the total data volume of the send buffer, such as 10% or 30%. The storage load of the send buffer can be directly obtained by reading the object properties of the send buffer or calling the corresponding methods by the application, which will not be elaborated here.

[0043] Furthermore, after obtaining the storage load of the transmit buffer, the second coding rate corresponding to the current storage load can be determined according to the preset configuration information. The configuration information is used to characterize the mapping relationship between storage load and coding rate, and can be obtained through prior knowledge and pre-configured locally on the terminal device or in the cloud. For example, according to the configuration information, when the storage load of the transmit buffer is a% (meaning that a% of the storage space or computing resources of the transmit buffer has been occupied), the corresponding second coding rate is A; when the storage load of the transmit buffer is b% (meaning that b% of the storage space or computing resources of the transmit buffer has been occupied), the corresponding second coding rate is B, where b is greater than a, and B is less than A, that is, the larger the storage load of the transmit buffer, the smaller the second coding rate.

[0044] Step S103: Determine the target encoding bitrate based on the first encoding bitrate and the second encoding bitrate, and encode the live stream data based on the target encoding bitrate to generate the corresponding live encoded data.

[0045] Furthermore, after determining the first and second encoding bitrates through the aforementioned steps, a target encoding bitrate is derived by combining the first and second encoding bitrates, taking into account both the available bandwidth of the streaming link and the storage load of the sending buffer. Then, the live stream data is encoded based on the target encoding bitrate to generate corresponding live encoded data, which is stored in the sending buffer. The sending buffer then sends this live encoded data to the live streaming server, completing the live streaming process.

[0046] Among them, such as Figure 3 As shown, the specific implementation of step S103 includes:

[0047] Step S1031: Based on the first coding code rate and the second coding code rate, obtain the corresponding average coding code rate and / or the smaller coding code rate.

[0048] Step S1032: Determine the target coding rate based on the average coding rate and / or the smaller coding rate.

[0049] For example, in one possible implementation, the specific method for determining the target encoding bitrate is to calculate the average of the first encoding bitrate and the second encoding bitrate, i.e., the average encoding bitrate, and use this average encoding bitrate as the target encoding bitrate. This target encoding bitrate is essentially a trade-off between the first encoding bitrate that matches the available link bandwidth and the second encoding bitrate that matches the storage load. The target encoding bitrate will be slightly higher than the lower of the first and second encoding bitrates. In some live video scenarios, the video bitrate is subdivided into multiple levels, and the bitrate difference between each level is very small. Moreover, the calculation process of the first and second encoding bitrates itself stores a certain amount of redundancy. Therefore, even if the target encoding bitrate is slightly higher than the lower of the first and second encoding bitrates, it usually will not cause stuttering, while maximizing the video bitrate and giving the live video watched by the user higher clarity.

[0050] In another possible implementation, the target coding bitrate is determined by taking the smaller of the first and second coding bitrates as the target coding bitrate. This ensures that the available link bandwidth and the storage load of the transmission buffer can meet the requirements, preventing overload of the available link bandwidth or storage load, and guaranteeing the smoothness of live video playback.

[0051] In another possible implementation, the average encoding bitrate and a smaller encoding bitrate can be calculated simultaneously and applied sequentially. For example, the larger average encoding bitrate is first applied for video encoding to obtain the corresponding first live encoded data, which is then sent through the transmission buffer. During this process, feedback information such as packet loss rate and latency is obtained through the transmission unit. If the feedback information meets the requirements, the average encoding bitrate is used as the target encoded bitstream for subsequent streaming. If the feedback information does not meet the requirements, such as excessively high packet loss rate or excessively long latency, the smaller encoding bitrate is used as the target encoded bitstream for subsequent streaming. This combines the advantages of the two encoding bitrates, ensuring smooth live audio and video while maximizing the clarity of the live audio and video.

[0052] Figure 4 This is a schematic diagram illustrating a process for generating live broadcast encoded data according to an embodiment of the present disclosure. The following is in conjunction with... Figure 4 To provide a more detailed explanation of the above process, such as... Figure 4 As shown, the terminal device is equipped with a live streaming transmission system (a software system implemented by an application program). This system consists of a transmission unit, a codec, and a bitrate correction unit. The functions of the transmission unit and codec have been described in previous embodiments and will not be repeated here. Specifically, firstly, by detecting and estimating the transmission unit, the available link bandwidth is obtained, and then a first encoding bitrate matching the available link bandwidth is estimated based on this bandwidth. Secondly, by statistically analyzing the data storage volume of the sending buffer, the storage load of the sending buffer is obtained, and then a second encoding bitrate matching this load is estimated based on this load. Then, the first and second encoding bitrates are sent to the bitrate correction unit for processing to generate a target encoding bitrate. This target bitrate is then sent to the codec, which is configured to encode the live data stream using this target bitrate, generating live encoded data. Finally, the live encoded data is sent to the server, completing the dynamic encoding process during live streaming.

[0053] In this embodiment, the available link bandwidth of the live stream data push link is obtained, and a first encoding bitrate matching the available link bandwidth is obtained based on the available link bandwidth; the storage load of the push link's send buffer is obtained, and a second encoding bitrate is obtained based on the storage load, wherein the send buffer is used to store the live encoded data to be sent, and the storage load is used to characterize the amount of live encoded data stored in the send buffer; a target encoding bitrate is determined based on the first encoding bitrate and the second encoding bitrate, and the live stream data is encoded based on the target encoding bitrate to generate the corresponding live encoded data. By determining the first encoding bitrate based on the available link bandwidth and the second encoding bitrate based on the storage load of the send buffer, and then combining the first encoding bitrate and the second encoding bitrate to jointly determine the target encoding bitrate, and encoding the live stream data with the target encoding bitrate, the process of determining the target encoding bitrate comprehensively considers the available link bandwidth and the storage load of the send buffer, thus avoiding data transmission congestion caused by excessively low available link bandwidth or excessively high storage load of the send buffer, reducing data transmission latency, and improving the smoothness of video live streaming and the user viewing experience.

[0054] refer to Figure 5 , Figure 5 Flowchart of the data dynamic encoding method provided in the embodiments of this disclosure Figure 2 This embodiment is in Figure 2 Based on the illustrated embodiment, step S102 is further refined. This dynamic data encoding method includes:

[0055] Step S201: Obtain the available link bandwidth of the live stream data push link, and obtain the first encoding bitrate matching the available link bandwidth based on the available link bandwidth.

[0056] Step S202: Obtain the current load level of the send buffer based on the storage load.

[0057] Step S203: Determine the corresponding reference bitrate based on the current load level.

[0058] Step S204: Obtain the second coding rate based on the storage load and the reference code rate.

[0059] In this embodiment, the specific scheme for determining the second coding rate is refined. Specifically, exemplarily, after obtaining the storage load, the terminal device first determines the corresponding current load level based on the storage load. The storage load, for example, is a specific data volume value or percentage value. According to a preset load mapping relationship, the storage load is mapped to the corresponding level, i.e., the current load level. For example, the load mapping relationship is as follows: when the storage load is below 20%, it is the first load level, indicating a slight backlog in the transmission buffer; when the storage load is between 20% and 60%, it is the second load level, indicating a moderate backlog in the transmission buffer; and when the storage load is above 60%, it is the third load level, indicating a heavy backlog in the transmission buffer. Based on the above exemplary method, the current load level of the transmission buffer can be determined.

[0060] Furthermore, such as Figure 6 As shown, the specific implementation of step S202 includes:

[0061] Step S2021: Obtain N load thresholds and N+1 load intervals based on the N load thresholds. Each load interval corresponds to a load level, and N is an integer greater than 1.

[0062] Step S2022: Determine the current load level of the send buffer based on the target load range where the storage load is located.

[0063] For example, N load thresholds preset in the terminal device (application) are obtained, and N+1 load intervals are determined based on the load thresholds. Each load interval corresponds to a load level. Based on the above example, 20% and 60% are two load thresholds (N=2). Based on the above two load thresholds, three (N+1) load intervals are divided into [0,20%), [20,60%), and [60,100%]. Each interval corresponds to a load level, and the corresponding current load level is determined based on the load interval in which the storage load is located.

[0064] Subsequently, a corresponding reference bitrate is determined based on different load levels. Then, a second coding bitrate is determined based on this reference bitrate and the storage load. The reference bitrate can be the target coding bitrate determined in previous detection periods. Since changes in storage load are continuous and inertial under normal circumstances, determining the reference bitrate by combining it with the target coding bitrate determined in one or more previous detection periods, and then jointly determining the second coding bitrate based on the reference bitrate and the coding bitrate estimated in the current detection period, can improve the accuracy and stability of the determined second coding bitrate and avoid distortion caused by outliers.

[0065] For example, in one possible implementation, step S203 specifically includes:

[0066] Step S2030: Obtain the minimum load level corresponding to the send buffer.

[0067] Step S2031: If the current load level is the minimum load level, then configure the first coding bitrate as the reference bitrate.

[0068] Step S2032: If the current load level is not the minimum load level, then configure the preceding coding bitrate as the reference bitrate, where the preceding coding bitrate is the target coding bitrate determined in the previous detection cycle.

[0069] For example, in determining the corresponding reference bitrate based on the current load level, the current load level is divided into two cases: minimum load level and non-minimum load level. When the current load level is the minimum load level, i.e., the storage load of the send buffer is at a low load level, the impact of the send buffer's storage load on the encoding bitrate does not need to be considered. In this case, the first encoding bitrate determined by the available link bandwidth is directly configured as the reference bitrate, and in subsequent steps, the final target encoding bitrate is determined based on this reference bitrate (i.e., the first encoding bitrate). That is, the available link bandwidth is considered to determine a maximum encoding bitrate, thereby maximizing the target encoding bitrate and improving the clarity of the live video. In another possible case, when the current load level is not the minimum load level, i.e., there is a certain degree of data accumulation in the send buffer, it is necessary to further determine the second encoding bitrate based on the target encoding bitrate determined in the previous detection cycle, i.e., the preceding encoding bitrate is determined as the reference bitrate. The data dynamic encoding method provided in this embodiment can be executed periodically or based on other triggering logic. After each execution, a target encoding bitrate is determined and configured for the codec, enabling the codec to encode based on this target bitrate. Therefore, the target encoding bitrate determined in the previous detection cycle is the encoding bitrate currently configured by the codec. This encoding bitrate can be stored locally on the terminal device as configuration information, and the target encoding bitrate determined in the previous detection cycle can be obtained by directly reading the configuration information.

[0070] Accordingly, the specific implementation of step S204 includes:

[0071] Step S2041: When the reference code rate is the first coding code rate, the reference code rate is determined as the second coding code rate.

[0072] Step S2042: When the reference code rate is the preceding code rate, determine the adjustment coefficient based on the storage load.

[0073] Step S2043: Obtain the second coding rate based on the adjustment coefficient and the preceding coding rate.

[0074] Figure 7 This is a flowchart illustrating the implementation of steps S203-S204 according to an embodiment of this disclosure. The process will be described below with reference to the images. Figure 7 As shown, exemplarily, according to the execution steps of step S203, after determining the reference bitrate, when the reference bitrate is the first coding bitrate (i.e., after executing step S2031), the reference bitrate is directly determined as the second coding bitrate. In this case, since the storage load of the sending buffer is low, it is not necessary to refer to the target coding bitrate determined in the previous detection cycle, and the first coding bitrate can be directly used to determine the final target coding data. In another case, when the reference bitrate is the preceding coding bitrate (i.e., after executing step S2032), an adjustment coefficient is determined based on the storage load. Then, based on the reference bitrate, the reference bitrate is adjusted in combination with the adjustment coefficient to obtain the second coding bitrate. The purpose of the adjustment coefficient is to further reduce the previously configured target coding bitrate (the target coding bitrate determined in the previous detection cycle) by considering the current storage load (in the case of excessive storage load), thereby avoiding the situation where the previously configured target coding bitrate is too large, but the storage load is too large to be cached in time, resulting in video frame dropping. Therefore, when the current load level is not the minimum load level, the adjustment factor is a decimal between 0 and 1. By calculating the product of the reference bitrate and the adjustment factor, a second coding bitrate smaller than the reference bitrate is obtained.

[0075] Furthermore, such as Figure 8 As shown, exemplarily, the specific implementation of step S2042 includes:

[0076] Step S2042-1: Obtain the target load range corresponding to the storage load;

[0077] Step S2042-2: Based on the position of the storage load in the target load range and the coefficient change rate corresponding to the target load range, obtain the adjustment coefficient, wherein the coefficient change rate corresponding to the target load range is the ratio of the change in the adjustment coefficient corresponding to the target load range to the load change.

[0078] For example, when the reference code rate is the preorder coding code rate, the implementation method for determining the adjustment coefficient based on the storage load is as follows: First, obtain the target load range corresponding to the storage load. The target load range has an upper limit and a lower limit. Taking the percentage as the implementation method of storage load as an example, the target load range is [20%, 60%], then the corresponding lower limit is 0.2 (i.e., 20%), and the upper limit is 0.6 (i.e., 60%). The load change of the target load range is the difference between the upper limit and the lower limit, i.e., 0.4. Then, the adjustment coefficient is obtained based on the position of the storage load in the target load range and the coefficient change rate corresponding to the target load range. The position of the storage load in the target load range refers to the difference between the upper limit and the storage load of the target load range. The coefficient change rate corresponding to the target load range is the ratio of the change in the adjustment coefficient corresponding to the target load range to the change in the load. The change in the adjustment coefficient refers to the difference between the adjustment coefficient corresponding to the lower limit and the adjustment coefficient corresponding to the upper limit of the target load range. Based on the above concepts, the adjustment coefficient can be determined according to the following formula (1):

[0079]

[0080] Where `adjust_ratio` is the adjustment coefficient, `cur_buffer` is the storage load, `ratio_low` is the lower limit of the adjustment coefficient range corresponding to the target load range, `ratio_high` is the upper limit of the adjustment coefficient range corresponding to the target load range, `buffer_low_thresh` is the lower limit of the target load range, and `buffer_high_thresh` is the upper limit of the target load range. Generally, since the adjustment coefficient is larger when the storage load is lower and smaller when the storage load is higher (the two are inversely proportional), the lower limit of the adjustment coefficient range corresponds to the upper limit of the target load range, and vice versa. In the above formula:

[0081] (cur_buffer-buffer_low_thresh) represents the position of the storage load within the target load range.

[0082] (ratio_high-ratio_low) / (buffer_high_thresh-buffer_low_thresh) is the rate of change of the coefficient.

[0083] The adjustment coefficient change is obtained by multiplying the storage load's position in the target load range by the coefficient change rate. Then, the sum of the adjustment coefficient change and the lower limit of the adjustment coefficient range corresponding to the target load range is calculated, and the sum is used to obtain the final adjustment coefficient.

[0084] Furthermore, when the coefficient change rate corresponding to the target load interval is 0, the adjustment coefficient corresponding to each storage load point within the target load interval is equal. That is, when the storage load is within the target load interval, its corresponding adjustment coefficient is a fixed value, such as 1. In this case, the target load interval is a fixed ratio interval. Conversely, when the coefficient change rate corresponding to the target load interval is not 0, the adjustment coefficient corresponding to each storage load point within the target load interval is different. In this case, the target load interval is a non-fixed ratio interval. For the above two cases, the specific implementation of step S2042-2 includes:

[0085] When the target load range is a fixed ratio range, the corresponding adjustment coefficient is obtained based on the load level corresponding to the target load range; when the target load range is a non-fixed ratio range, the corresponding coefficient change rate is obtained based on the load level corresponding to the target load range, and the adjustment coefficient is obtained based on the position of the storage load in the target load range and the coefficient change rate.

[0086] For example, when the target load range is a fixed ratio range, the corresponding adjustment coefficient can be obtained directly based on the load level corresponding to the target load range. For instance, if the load level corresponding to the target load range is the first load level, then the corresponding adjustment coefficient is 1. When the target load range is a non-fixed ratio range, the corresponding coefficient change rate is obtained based on the load level corresponding to the target load range, or the upper and lower limits of the range corresponding to the target load range, and the upper and lower limits of the adjustment coefficient range are obtained, thereby calculating the coefficient change rate based on the previous steps.

[0087] Furthermore, if the load level corresponding to the target load range is the maximum load level, the adjustment coefficient is the minimum adjustment coefficient. The product of the minimum adjustment coefficient and the preceding encoding bitrate is greater than or equal to the base encoding bitrate, which is the minimum encoding bitrate required for the live streaming service corresponding to the live streaming data.

[0088] Figure 9 This is a schematic diagram illustrating the rate of change of a coefficient corresponding to a load range, as provided in an embodiment of this disclosure. Figure 9As shown, the load range includes a first load range, a second load range, and a third load range. The first load range is a light load range, where the corresponding coefficient change rate ratio_1 = 0, meaning it's a fixed ratio range with an adjustment coefficient of 1. The second load range is a medium load range. For example, if the second load range is taken as the target load range, then the corresponding coefficient change rate within the second load range is not 0 (shown in the figure as ratio_2 = T). Specifically, ratio_2 = (1 - ratio_low) / (buffer_high_thresh - buffer_low_thresh), where 1 is the upper limit of the adjustment coefficient range for the second load range, ratio_low is the lower limit, buffer_high_thresh is the upper limit, and buffer_low_thresh is the lower limit. This first load range is a non-fixed ratio range, and its corresponding adjustment coefficient varies with the storage load. The third load interval is the heavy load interval. Within this interval, the corresponding coefficient change rate ratio_3 = 0, meaning it's a fixed ratio interval. The corresponding adjustment coefficient is ratio_low, which is the lower limit of the adjustment coefficient range for the third load interval, also known as the minimum adjustment coefficient. When the storage load is within this third load interval, a minimum adjustment coefficient is maintained. Based on this coefficient, the target encoding bitrate is gradually reduced until the storage load drops to a reasonable level. This prevents sudden and rapid drops in the target encoding bitrate from causing sudden and repeated changes in live stream quality, affecting the viewing experience. The product of the minimum adjustment coefficient and the preceding encoding bitrate is greater than or equal to the base encoding bitrate. The base encoding bitrate is the minimum encoding bitrate required for the live stream service. This means that the target encoding rate generated after one adjustment using the minimum adjustment coefficient still meets the minimum encoding bitrate required for the current live stream service, avoiding excessively low bitrates that could negatively impact the live audio and video streaming experience.

[0089] Step S205: Determine the target encoding bitrate based on the first encoding bitrate and the second encoding bitrate, and encode the live stream data based on the target encoding bitrate to generate the corresponding live encoded data.

[0090] In this embodiment, the implementation methods of steps S201 and S205 are the same as those of this disclosure. Figure 2 The implementation methods of steps S101 and S103 in the illustrated embodiment are the same, and will not be described in detail here.

[0091] Corresponding to the data dynamic encoding method in the above embodiments, Figure 10This is a structural block diagram of the data dynamic encoding device provided in the embodiments of this disclosure. The method described in the above embodiments can be executed by this data dynamic encoding device, which can be implemented by software and / or hardware, and can be integrated into an electronic device with certain data processing capabilities. The electronic device may include, but is not limited to, mobile terminals with big data processing capabilities, as well as fixed terminals with big data processing capabilities such as desktop computers and supercomputers.

[0092] For ease of explanation, only the parts relevant to embodiments of this disclosure are shown. (Refer to...) Figure 10 The data dynamic encoding device 3 includes:

[0093] The acquisition module 31 is used to acquire the available link bandwidth of the live stream data push link, and obtain the first encoding bitrate matching the available link bandwidth based on the available link bandwidth.

[0094] Processing module 32 is used to obtain the storage load of the sending buffer of the streaming link and obtain the second encoding bitrate based on the storage load. The sending buffer is used to store the live encoded data to be sent, and the storage load is used to characterize the amount of live encoded data stored in the sending buffer.

[0095] The encoding module 33 is used to determine the target encoding bitrate based on the first encoding bitrate and the second encoding bitrate, and to encode the live stream data based on the target encoding bitrate to generate the corresponding live encoded data.

[0096] According to one or more embodiments of this disclosure, the processing module 32 is specifically configured to: obtain the current load level of the transmission buffer based on the storage load; determine the corresponding reference code rate based on the current load level; and obtain the second coding code rate based on the storage load and the reference code rate.

[0097] According to one or more embodiments of this disclosure, when the processing module 32 obtains the current load level of the transmission buffer based on the storage load, it is specifically used to: obtain N load thresholds and obtain N+1 load intervals based on the N load thresholds, wherein each load interval corresponds to a load level, and N is an integer greater than 1; and determine the current load level of the transmission buffer based on the target load interval where the storage load is located.

[0098] According to one or more embodiments of this disclosure, when the processing module 32 determines the corresponding reference code rate based on the current load level, it is specifically configured as follows: if the current load level is the minimum load level, the first coding code rate is configured as the reference code rate; if the current load level is not the minimum load level, the preceding coding code rate is configured as the reference code rate, wherein the preceding coding code rate is the target coding code rate determined in the previous detection cycle.

[0099] According to one or more embodiments of this disclosure, when the processing module 32 obtains the second coding code rate based on the storage load and the reference code rate, it is specifically used to: determine the reference code rate as the second coding code rate when the reference code rate is the first coding code rate; and determine an adjustment coefficient based on the storage load when the reference code rate is the preceding coding code rate, and obtain the second coding code rate based on the adjustment coefficient and the preceding coding code rate.

[0100] According to one or more embodiments of this disclosure, when determining the adjustment coefficient based on the storage load, the processing module 32 is specifically configured to: obtain the target load range corresponding to the storage load; obtain the adjustment coefficient based on the position of the storage load in the target load range and the coefficient change rate corresponding to the target load range, wherein the coefficient change rate corresponding to the target load range is the ratio of the change in the adjustment coefficient corresponding to the target load range to the change in the load.

[0101] According to one or more embodiments of this disclosure, the target load range includes a fixed ratio range or a non-fixed ratio range, where the coefficient change rate corresponding to the fixed ratio range is 1, and the coefficient change rate corresponding to the non-fixed ratio range is not 1. When the processing module 32 obtains the adjustment coefficient based on the position of the storage load in the target load range and the coefficient change rate corresponding to the target load range, it specifically performs the following: when the target load range is a fixed ratio range, it obtains the corresponding adjustment coefficient based on the load level corresponding to the target load range; when the target load range is a non-fixed ratio range, it obtains the corresponding coefficient change rate based on the load level corresponding to the target load range, and obtains the adjustment coefficient based on the position of the storage load in the target load range and the coefficient change rate.

[0102] According to one or more embodiments of this disclosure, if the load level corresponding to the target load range is the maximum load level, the adjustment factor is the minimum adjustment factor, and the product of the minimum adjustment factor and the preceding coding bitrate is greater than or equal to the base coding bitrate, which is the minimum coding bitrate required for the live streaming service corresponding to the live streaming data.

[0103] According to one or more embodiments of this disclosure, the encoding module 33 is specifically configured to: obtain a corresponding average encoding code rate and / or a smaller encoding code rate based on a first encoding code rate and a second encoding code rate; and determine a target encoding code rate based on the average encoding code rate and / or the smaller encoding code rate.

[0104] The acquisition module 31, processing module 32, and encoding module 33 are connected sequentially. The data dynamic encoding device 3 provided in this embodiment can execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.

[0105] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, such as... Figure 11 As shown, the electronic device 4 includes:

[0106] Processor 41, and memory 42 communicatively connected to processor 41;

[0107] Memory 42 stores instructions executed by the computer;

[0108] The processor 41 executes computer execution instructions stored in the memory 42 to achieve, for example, Figures 2-9 The data dynamic encoding method in the illustrated embodiment.

[0109] Optionally, the processor 41 and the memory 42 are connected via a bus 43.

[0110] For relevant instructions, please refer to the corresponding text. Figures 2-9 The relevant descriptions and effects of the steps in the corresponding embodiments are understood, and will not be elaborated on here.

[0111] This disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement this disclosure. Figures 2-9 The data dynamic encoding method provided in any of the corresponding embodiments.

[0112] This disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements this disclosure. Figures 2-9 The data dynamic encoding method provided in any of the corresponding embodiments.

[0113] To implement the above embodiments, this disclosure also provides an electronic device.

[0114] refer to Figure 12 The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of the present disclosure. The electronic device 900 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), tablet computers, portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 12 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0115] like Figure 12As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0116] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 12 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0117] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.

[0118] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0119] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0120] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.

[0121] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0122] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0123] The units or modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units or modules do not necessarily limit the specific unit itself.

[0124] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0125] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0126] In a first aspect, according to one or more embodiments of this disclosure, a dynamic data encoding method is provided, comprising: acquiring the available link bandwidth of a live stream data push link, and obtaining a first encoding bitrate matching the available link bandwidth based on the available link bandwidth; acquiring the storage load of a send buffer of the push link, and obtaining a second encoding bitrate based on the storage load, wherein the send buffer is used to store live encoded data to be sent, and the storage load is used to characterize the amount of live encoded data stored in the send buffer; determining a target encoding bitrate based on the first encoding bitrate and the second encoding bitrate, and encoding the live stream data based on the target encoding bitrate to generate corresponding live encoded data.

[0127] According to one or more embodiments of this disclosure, obtaining the second coding rate based on the storage load includes: obtaining the current load level of the transmit buffer based on the storage load; determining the corresponding reference code rate based on the current load level; and obtaining the second coding rate based on the storage load and the reference code rate.

[0128] According to one or more embodiments of this disclosure, obtaining the current load level of the transmission buffer based on the storage load includes: acquiring N load thresholds and obtaining N+1 load intervals based on the N load thresholds, wherein each load interval corresponds to a load level, and N is an integer greater than 1; and determining the current load level of the transmission buffer based on the target load interval where the storage load is located.

[0129] According to one or more embodiments of this disclosure, determining the corresponding reference code rate based on the current load level includes: if the current load level is the minimum load level, then configuring the first coding code rate as the reference code rate; if the current load level is not the minimum load level, then configuring the preceding coding code rate as the reference code rate, wherein the preceding coding code rate is the target coding code rate determined in the previous detection cycle.

[0130] According to one or more embodiments of this disclosure, obtaining the second coding code rate based on the storage load and the reference code rate includes: when the reference code rate is the first coding code rate, determining the reference code rate as the second coding code rate; when the reference code rate is the preceding coding code rate, determining an adjustment coefficient based on the storage load, and obtaining the second coding code rate based on the adjustment coefficient and the preceding coding code rate.

[0131] According to one or more embodiments of this disclosure, determining the adjustment coefficient based on the storage load includes: obtaining a target load range corresponding to the storage load; obtaining the adjustment coefficient based on the position of the storage load in the target load range and the coefficient change rate corresponding to the target load range, wherein the coefficient change rate corresponding to the target load range is the ratio of the change in the adjustment coefficient corresponding to the target load range to the change in load.

[0132] According to one or more embodiments of this disclosure, the target load range includes a fixed ratio range or a non-fixed ratio range, wherein the coefficient change rate corresponding to the fixed ratio range is 1, and the coefficient change rate corresponding to the non-fixed ratio range is not 1; obtaining the adjustment coefficient based on the position of the storage load in the target load range and the coefficient change rate corresponding to the target load range includes: when the target load range is a fixed ratio range, obtaining the corresponding adjustment coefficient based on the load level corresponding to the target load range; when the target load range is a non-fixed ratio range, obtaining the corresponding coefficient change rate based on the load level corresponding to the target load range, and obtaining the adjustment coefficient based on the position of the storage load in the target load range and the coefficient change rate.

[0133] According to one or more embodiments of this disclosure, if the load level corresponding to the target load range is the maximum load level, the adjustment coefficient is the minimum adjustment coefficient, and the product of the minimum adjustment coefficient and the preceding coding bitrate is greater than or equal to the base coding bitrate, wherein the base coding bitrate is the minimum coding bitrate required to play the live streaming service corresponding to the live streaming data.

[0134] According to one or more embodiments of this disclosure, determining the target coding bitrate based on the first coding bitrate and the second coding bitrate includes: obtaining a corresponding average coding bitrate and / or a smaller coding bitrate based on the first coding bitrate and the second coding bitrate; and determining the target coding bitrate based on the average coding bitrate and / or the smaller coding bitrate.

[0135] Secondly, according to one or more embodiments of this disclosure, a data dynamic encoding apparatus is provided, comprising:

[0136] The acquisition module is used to acquire the available link bandwidth of the live stream data push link, and obtain a first encoding bitrate matching the available link bandwidth based on the available link bandwidth.

[0137] The processing module is used to obtain the storage load of the sending buffer of the streaming link and obtain the second encoding bitrate according to the storage load, wherein the sending buffer is used to store the live encoded data to be sent, and the storage load is used to characterize the amount of live encoded data stored in the sending buffer;

[0138] The encoding module is used to determine a target encoding bitrate based on the first encoding bitrate and the second encoding bitrate, and to encode the live stream data based on the target encoding bitrate to generate corresponding live encoded data.

[0139] According to one or more embodiments of this disclosure, the processing module is specifically configured to: obtain the current load level of the transmit buffer based on the storage load; determine the corresponding reference code rate based on the current load level; and obtain the second coding code rate based on the storage load and the reference code rate.

[0140] According to one or more embodiments of this disclosure, when the processing module obtains the current load level of the sending buffer based on the storage load, it is specifically configured to: obtain N load thresholds and obtain N+1 load intervals based on the N load thresholds, wherein each load interval corresponds to a load level, and N is an integer greater than 1; determine the current load level of the sending buffer based on the target load interval where the storage load is located.

[0141] According to one or more embodiments of this disclosure, when the processing module determines the corresponding reference code rate based on the current load level, it is specifically configured as follows: if the current load level is the minimum load level, the first coding code rate is configured as the reference code rate; if the current load level is not the minimum load level, the preceding coding code rate is configured as the reference code rate, wherein the preceding coding code rate is the target coding code rate determined in the previous detection cycle.

[0142] According to one or more embodiments of this disclosure, when the processing module obtains the second coding code rate based on the storage load and the reference code rate, it is specifically configured to: determine the reference code rate as the second coding code rate when the reference code rate is the first coding code rate; and determine an adjustment coefficient based on the storage load when the reference code rate is the preceding coding code rate, and obtain the second coding code rate based on the adjustment coefficient and the preceding coding code rate.

[0143] According to one or more embodiments of this disclosure, when the processing module determines the adjustment coefficient based on the storage load, it is specifically configured to: obtain a target load range corresponding to the storage load; obtain the adjustment coefficient based on the position of the storage load in the target load range and the coefficient change rate corresponding to the target load range, wherein the coefficient change rate corresponding to the target load range is the ratio of the change in the adjustment coefficient corresponding to the target load range to the change in load.

[0144] According to one or more embodiments of this disclosure, the target load range includes a fixed ratio range or a non-fixed ratio range, wherein the coefficient change rate corresponding to the fixed ratio range is 1, and the coefficient change rate corresponding to the non-fixed ratio range is not 1; when the processing module obtains the adjustment coefficient based on the position of the storage load in the target load range and the coefficient change rate corresponding to the target load range, it is specifically configured to: when the target load range is a fixed ratio range, obtain the corresponding adjustment coefficient based on the load level corresponding to the target load range; when the target load range is a non-fixed ratio range, obtain the corresponding coefficient change rate based on the load level corresponding to the target load range, and obtain the adjustment coefficient based on the position of the storage load in the target load range and the coefficient change rate.

[0145] According to one or more embodiments of this disclosure, if the load level corresponding to the target load range is the maximum load level, the adjustment coefficient is the minimum adjustment coefficient, and the product of the minimum adjustment coefficient and the preceding coding bitrate is greater than or equal to the base coding bitrate, wherein the base coding bitrate is the minimum coding bitrate required to play the live streaming service corresponding to the live streaming data.

[0146] According to one or more embodiments of this disclosure, the encoding module is specifically configured to: obtain a corresponding average encoding code rate and / or a smaller encoding code rate based on the first encoding code rate and the second encoding code rate; and determine a target encoding code rate based on the average encoding code rate and / or the smaller encoding code rate.

[0147] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;

[0148] The memory stores computer-executed instructions;

[0149] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the data dynamic encoding method as described in the first aspect and various possible designs of the first aspect.

[0150] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, and when a processor executes the computer-executable instructions, the data dynamic encoding method described in the first aspect and various possible designs of the first aspect is implemented.

[0151] Fifthly, according to one or more embodiments of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the data dynamic encoding method described in the first aspect and various possible designs of the first aspect.

[0152] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0153] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0154] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A dynamic data encoding method, characterized in that, include: Obtain the available link bandwidth of the live stream data push link, and obtain the first encoding bitrate matching the available link bandwidth based on the available link bandwidth; The storage load of the sending buffer of the streaming link is obtained, and the second encoding bitrate is obtained based on the storage load, wherein the sending buffer is used to store the live encoded data to be sent, and the storage load is used to characterize the amount of live encoded data stored in the sending buffer; Based on the first encoding bitrate and the second encoding bitrate, a target encoding bitrate is determined, and the live stream data is encoded based on the target encoding bitrate to generate corresponding live encoded data.

2. The method according to claim 1, characterized in that, The step of obtaining the second coding rate based on the storage load includes: Based on the storage load, the current load level of the send buffer is obtained; Determine the corresponding reference bitrate based on the current load level; The second coding rate is obtained based on the storage load and the reference code rate.

3. The method according to claim 2, characterized in that, The step of obtaining the current load level of the send buffer based on the storage load includes: Obtain N load thresholds and then obtain N+1 load intervals based on the N load thresholds. Each load interval corresponds to a load level, and N is an integer greater than 1. The current load level of the send buffer is determined based on the target load range in which the storage load is located.

4. The method according to claim 2, characterized in that, Determining the corresponding reference bitrate based on the current load level includes: If the current load level is the minimum load level, then the first coding bitrate is configured as the reference bitrate; If the current load level is not the minimum load level, then the preceding coding bitrate is configured as the reference bitrate, wherein the preceding coding bitrate is the target coding bitrate determined in the previous detection cycle.

5. The method according to claim 4, characterized in that, The step of obtaining the second coding code rate based on the storage load and the reference code rate includes: When the reference code rate is the first coding code rate, the reference code rate is determined as the second coding code rate; When the reference code rate is the preceding code rate, an adjustment coefficient is determined based on the storage load, and a second code rate is obtained based on the adjustment coefficient and the preceding code rate.

6. The method according to claim 5, characterized in that, The step of determining the adjustment coefficient based on the storage load includes: Obtain the target load range corresponding to the storage load; The adjustment coefficient is obtained based on the position of the storage load in the target load range and the coefficient change rate corresponding to the target load range, wherein the coefficient change rate corresponding to the target load range is the ratio of the change in the adjustment coefficient corresponding to the target load range to the change in load.

7. The method according to claim 6, characterized in that, The target load range includes a fixed ratio range or a non-fixed ratio range. The coefficient change rate corresponding to the fixed ratio range is 1, and the coefficient change rate corresponding to the non-fixed ratio range is not 1. The step of obtaining the adjustment coefficient based on the position of the storage load in the target load range and the rate of change of the coefficient corresponding to the target load range includes: When the target load range is a fixed ratio range, the corresponding adjustment coefficient is obtained according to the load level corresponding to the target load range; When the target load range is a non-fixed ratio range, the corresponding coefficient change rate is obtained according to the load level corresponding to the target load range, and the adjustment coefficient is obtained according to the position of the storage load in the target load range and the coefficient change rate.

8. The method according to claim 7, characterized in that, If the load level corresponding to the target load range is the maximum load level, the adjustment coefficient is the minimum adjustment coefficient. The product of the minimum adjustment coefficient and the preceding encoding bitrate is greater than or equal to the base encoding bitrate, which is the minimum encoding bitrate required for playing the live stream data corresponding to the live service.

9. The method according to claim 1, characterized in that, The step of determining the target coding rate based on the first coding rate and the second coding rate includes: Based on the first coding code rate and the second coding code rate, the corresponding average coding code rate and / or smaller coding code rate are obtained; The target coding rate is determined based on the average coding rate and / or the smaller coding rate.

10. A data dynamic encoding device, characterized in that, include: The acquisition module is used to acquire the available link bandwidth of the live stream data push link, and obtain a first encoding bitrate matching the available link bandwidth based on the available link bandwidth. The processing module is used to obtain the storage load of the sending buffer of the streaming link and obtain the second encoding bitrate according to the storage load, wherein the sending buffer is used to store the live encoded data to be sent, and the storage load is used to characterize the amount of live encoded data stored in the sending buffer; The encoding module is used to determine a target encoding bitrate based on the first encoding bitrate and the second encoding bitrate, and to encode the live stream data based on the target encoding bitrate to generate corresponding live encoded data.

11. An electronic device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the data dynamic encoding method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by the processor, implement the data dynamic encoding method as described in any one of claims 1 to 9.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the data dynamic encoding method as described in any one of claims 1 to 9.