Incoming code stream rate acquisition method, incoming code stream processing method, electronic device, and medium

By adaptively evaluating the incoming stream bitrate and dynamically adjusting the incoming stream processing method, the quality issues caused by bitrate changes in live broadcast services are resolved, thereby improving the quality of live broadcast services.

CN116132717BActive Publication Date: 2025-10-03ZTE CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111337644.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-12
Publication Date
2025-10-03
Estimated Expiration
2041-11-12

AI Technical Summary

Technical Problem

In live streaming scenarios, changes in the incoming bitrate of the streaming media server cause the bitrate entered by the operation and maintenance personnel to not match the actual bitrate, affecting the quality of the live streaming service.

Method used

By calculating the average bit rate and weight coefficient, the incoming stream bit rate is adaptively evaluated, and the incoming stream processing method is dynamically adjusted to reduce the impact of bit rate fluctuations.

Benefits of technology

The quality of live broadcast services is improved by adaptively evaluating the matching degree between the incoming stream bit rate and the actual bit rate, thus reducing the packet error rate in live broadcast services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116132717B_ABST
    Figure CN116132717B_ABST
Patent Text Reader

Abstract

The present application provides a method for obtaining an inbound bitrate, a method for processing a received stream, an electronic device, and a computer-readable storage medium. The method for obtaining an inbound bitrate includes: calculating an average bitrate corresponding to a current time interval; calculating a weight coefficient for a current bitrate fluctuation based on a previous inbound bitrate and the average bitrate corresponding to the current time interval; determining the current inbound bitrate and a next time interval based on the weight coefficient for the current bitrate fluctuation, and continuing to calculate the average bitrate corresponding to the next time interval after a preset time interval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of Internet technology, and in particular to a method for obtaining an input stream rate, a method for processing an incoming stream, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the rapid development of Internet Protocol Television (IPTV), especially the growing number of users, mechanisms for packet loss recovery and buffer overflow prevention have been introduced between streaming servers and terminals to provide a better user experience. For example, the mechanism for multicast packet loss recovery is Forward Error Correction (FEC), the mechanism for unicast packet loss recovery is Automatic Repeat ReQuest (ARQ), and the mechanism for unicast buffer overflow prevention is flow control. However, these mechanisms do not take into account the problem of packet errors caused by the streaming server receiving and processing due to changes in the bitrate in live broadcast scenarios.

[0003] For live streaming scenarios, the server's operators currently need to input the incoming bitrate into the server. The server then constructs incoming stream information based on the incoming bitrate and then processes the incoming packets based on the incoming bitrate information. In this approach, the incoming bitrate used by the server to construct the incoming stream information generally remains constant. However, operators may enter an incorrect bitrate, or the actual incoming bitrate may change. This can lead to a significant mismatch between the inputted bitrate and the actual bitrate, resulting in reduced live streaming quality. Summary of the Invention

[0004] Embodiments of the present application provide a method for obtaining an input stream bit rate, a method for processing a received stream, an electronic device, and a computer-readable storage medium.

[0005] In a first aspect, an embodiment of the present application provides a method for obtaining an inbound bitrate, including: calculating an average bitrate corresponding to a current time interval; calculating a weight coefficient for a current bitrate fluctuation based on a previous inbound bitrate and the average bitrate corresponding to the current time interval; determining the current inbound bitrate and a next time interval based on the weight coefficient for the current bitrate fluctuation, and continuing to calculate the average bitrate corresponding to the next time interval after a preset time interval.

[0006] In a second aspect, an embodiment of the present application provides a method for stream collection and processing, comprising: calculating a maximum number of received packets corresponding to a current task based on the current inbound stream bit rate; wherein the current inbound stream bit rate is the current inbound stream bit rate determined using any of the foregoing inbound stream bit rate acquisition methods; and processing packets in the inbound stream belonging to the current task based on the maximum number of received packets corresponding to the current task, and sending the packets after the stream collection and processing.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor; a memory, wherein at least one program is stored in the memory, and when the at least one program is executed by the at least one processor, any one of the above-mentioned methods for obtaining the bit rate of an incoming stream is implemented, or any one of the above-mentioned methods for processing a received stream is implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements any of the above-mentioned methods for obtaining the bit rate of an incoming stream, or implements any of the above-mentioned methods for processing incoming streams.

[0009] The method for obtaining the bit rate of an incoming bit stream provided in the embodiment of the present application performs an adaptive evaluation of the bit rate of the incoming bit stream, laying a foundation for subsequent receiving and processing of the stream.

[0010] The stream receiving processing method provided in the embodiment of the present application performs stream receiving processing based on the adaptively evaluated incoming stream bit rate, without requiring the operation and maintenance personnel to input the incoming stream bit rate. The stream receiving processing is then constructed based on the incoming stream bit rate input by the operation and maintenance personnel. As a result, the matching degree between the adaptively evaluated incoming stream bit rate and the actual incoming stream bit rate is relatively small, thereby improving the quality of the live broadcast service. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 This is a schematic diagram of the architecture corresponding to the live broadcast service scenario 1 provided in an embodiment of the present application;

[0012] Figure 2 This is a schematic diagram of the architecture corresponding to the live broadcast service scenario 2 provided in an embodiment of the present application;

[0013] Figure 3 This is a schematic diagram of the architecture corresponding to the live broadcast service scenario 3 provided in an embodiment of the present application;

[0014] Figure 4 A flowchart of a method for obtaining an input stream bit rate according to an embodiment of the present application;

[0015] Figure 5 A flow chart of a method for processing incoming traffic provided in another embodiment of the present application;

[0016] Figure 6 A block diagram of the composition of a streaming media server provided in another embodiment of the present application. DETAILED DESCRIPTION

[0017] To enable those skilled in the art to better understand the technical solution of the present application, the following detailed description is made of the input stream rate acquisition method, the received stream processing method, the electronic device, and the computer-readable storage medium provided in the present application in conjunction with the accompanying drawings.

[0018] Example embodiments will be described more fully hereinafter with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete and will fully convey the scope of this application to those skilled in the art.

[0019] In the absence of conflict, the various embodiments of the present application and the various features therein may be combined with each other.

[0020] As used herein, the term "and / or" includes any and all combinations of at least one of the associated listed items.

[0021] The terms used herein are used only to describe specific embodiments and are not intended to limit this application. As used herein, the singular forms "a," "an," and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements, and / or components is specified, but the presence or addition of at least one other feature, whole, step, operation, element, component, and / or group thereof is not excluded.

[0022] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this application, and will not be interpreted as having an idealized or overly formal meaning unless expressly defined as such herein.

[0023] Before introducing the inbound stream rate acquisition method and the received stream processing method according to the embodiment of the present application, several live broadcast business scenarios to which the inbound stream rate acquisition method and the received stream processing method according to the embodiment of the present application are applicable are first introduced.

[0024] Figure 1 This is a schematic diagram of the architecture corresponding to the live broadcast service scenario 1 provided in the embodiment of this application. Figure 1In the live broadcast service scenario shown, the incoming code stream is an incoming multicast code stream, and the outgoing code stream is an outgoing multicast code stream. Two or more terminal 1s send the incoming multicast code stream to the multicast switch, and the multicast switch sends the incoming multicast code stream to the streaming media server. The streaming media server receives the incoming multicast code stream, processes the incoming multicast code stream to obtain the outgoing multicast code stream, and sends the outgoing multicast code stream to the multicast switch. The multicast switch sends the outgoing multicast code stream to two or more terminal 2s.

[0025] Figure 2 This is a schematic diagram of the architecture corresponding to the live broadcast service scenario 2 provided in the embodiment of this application. Figure 2 In the live broadcast service scenario shown, the incoming code stream is an incoming unicast code stream, and the outgoing code stream is an outgoing multicast code stream. Terminal three sends the incoming unicast code stream to the streaming media server. The streaming media server receives the incoming unicast code stream, processes the incoming unicast code stream to obtain an outgoing multicast code stream, and sends the outgoing multicast code stream to the multicast switch. The multicast switch sends the outgoing multicast code stream to two or more terminals four.

[0026] Figure 3 This is a schematic diagram of the architecture corresponding to the live broadcast service scenario 3 provided in the embodiment of this application. Figure 3 In the live broadcast business scenario shown, the incoming code stream is an incoming unicast code stream, and the outgoing code stream is an outgoing unicast code stream. Terminal five sends the incoming unicast code stream to the streaming media server. The streaming media server receives the incoming unicast code stream, processes the incoming unicast code stream to obtain the outgoing unicast code stream, and sends the outgoing unicast code stream to terminal six.

[0027] According to the three live broadcast service scenarios described above, the inbound code stream in the embodiment of the present application can be an inbound multicast code stream or an inbound unicast code stream; the outbound code stream can be an outbound multicast code stream or an outbound unicast code stream.

[0028] Figure 4 This is a flowchart of a method for obtaining the bit rate of an input stream provided by one embodiment of the present application.

[0029] First, refer to Figure 4 One embodiment of the present application provides a method for obtaining an inbound bitrate, including:

[0030] Step 400: Calculate the average bit rate corresponding to the current time interval t.

[0031] In some exemplary embodiments, the average code rate cur_b corresponding to the current time interval t is calculated based on the total size recvlen of all packets received in the current time interval t and the current time interval t. For example, the average code rate cur_b corresponding to the current time interval t is the ratio of the total size recvlen of all packets received in the current time interval t to the current time interval t, that is,

[0032] During the first and second calculations, the time interval t may be initialized to t0.

[0033] Step 401: Calculate the weight coefficient of the current bit rate fluctuation based on the last incoming bit rate and the average bit rate corresponding to the current time interval.

[0034] During the first calculation, the bitrate of the last incoming stream may be initialized to the average bitrate corresponding to the first time interval.

[0035] In some exemplary embodiments, calculating the weight coefficient of the current bit rate fluctuation based on the last incoming bit rate and the average bit rate corresponding to the current time interval includes: according to the formula Calculate the weight coefficient for this bitrate fluctuation; where flucoeff is the weight coefficient for this bitrate fluctuation, cur_b is the average bitrate corresponding to this time interval, and last_b is the last incoming bitrate.

[0036] Step 402: Determine the current incoming stream bit rate and the next time interval based on the weight coefficient of the current bit rate fluctuation, and continue to calculate the average bit rate corresponding to the next time interval after a preset time interval.

[0037] In some exemplary embodiments, determining the bit rate of the current incoming bitstream and the next time interval based on the weight coefficient of the current bitrate fluctuation includes at least one of the following: when the weight coefficient of the current bitrate fluctuation is less than a preset threshold, it indicates that the current bitrate fluctuation of the incoming bitstream is not large, the bit rate of the current incoming bitstream is determined to be the same as the bit rate of the previous incoming bitstream, and the next time interval is determined to be the same as the current time interval; when the weight coefficient of the current bitrate fluctuation is greater than or equal to the preset threshold, it indicates that the current bitrate fluctuation of the incoming bitstream is large, the bit rate of the current incoming bitstream is determined to be the average bit rate corresponding to the current time interval, and the next time interval is determined to be less than the current time interval.

[0038] In the case where the weight coefficient of the current bit rate fluctuation is greater than or equal to the preset threshold, the embodiment of the present application does not limit the specific value of the next time interval, as long as the next time interval is less than the current time interval. This can ensure that the detection cycle is reduced when the incoming bit rate fluctuates violently, thereby achieving the purpose of quickly converging the incoming bit rate. For example, determining that the next time interval is less than the current time interval includes: determining the next time interval based on the current time interval and the weight coefficient of the current bit rate fluctuation. More specifically, it can be determined according to the formula Determine the next time interval; where t next is the next time interval, t cur is the current time interval, and flucoeff is the weight coefficient of the current bit rate fluctuation.

[0039] In some exemplary embodiments, the preset threshold may be set according to actual conditions, for example, the preset threshold may be set to 0.1.

[0040] In some exemplary embodiments, the preset time may be 0, i.e., the average bit rate corresponding to the next time interval is calculated directly without delay. It may also be the current time interval or the next time interval. The preset time for each delay may be the same or different.

[0041] The method for obtaining the bit rate of an incoming bit stream provided in the embodiment of the present application performs an adaptive evaluation of the bit rate of the incoming bit stream, laying a foundation for subsequent receiving and processing of the stream.

[0042] Figure 5 A flowchart of a flow collection processing method provided in another embodiment of the present application.

[0043] Secondly, refer to Figure 5 Another embodiment of the present application provides a method for processing incoming traffic, including:

[0044] Step 500: Calculate the maximum number of received packets corresponding to the current task according to the current inbound stream rate; wherein the current inbound stream rate is the current inbound stream rate determined by any of the above-mentioned inbound stream rate acquisition methods.

[0045] In some exemplary embodiments, it is possible to determine whether the incoming code rate fluctuates without using the current incoming code rate, and directly use the formula Calculate the maximum number of received packets corresponding to this task; where recvpktcnt is the maximum number of received packets corresponding to this task, recviter is the fixed receiving interval, b cur is the incoming stream rate, pktlen is the size of each packet, and recvcoeff is the fixed reception coefficient.

[0046] In some exemplary embodiments, in order to reduce computing resources, it is also possible to first determine whether the incoming code rate fluctuates based on the current incoming code rate, and then determine whether it is necessary to recalculate the maximum number of received packets corresponding to the current task. That is, calculating the maximum number of received packets corresponding to the current task based on the current incoming code rate includes at least one of the following: if it is determined that the incoming code rate does not fluctuate based on the current incoming code rate, determining that the maximum number of received packets corresponding to the current task is the same as the maximum number of received packets corresponding to the previous task; if it is determined that the incoming code rate fluctuates based on the current incoming code rate, recalculating the maximum number of received packets corresponding to the current task according to the formula Calculate the maximum number of received packets corresponding to this task; where recvpktcnt is the maximum number of received packets corresponding to this task, recviter is the fixed receiving interval (i.e. the time interval between the start times of two adjacent tasks), b cur is the incoming stream rate, pktlen is the size of each packet, and recvcoeff is the fixed reception coefficient.

[0047] In some exemplary embodiments, determining that the incoming code stream bit rate has not fluctuated according to the current incoming code stream bit rate includes: the current incoming code stream bit rate is the same as the previous incoming code stream bit rate.

[0048] In some exemplary embodiments, determining that the incoming code stream rate fluctuates according to the current incoming code stream rate includes: the current incoming code stream rate is different from the previous incoming code stream rate.

[0049] Step 501: According to the maximum number of received packets corresponding to the task, the packets in the incoming code stream belonging to the task are received and processed.

[0050] In some exemplary embodiments, receiving packets in the incoming code stream that belong to the current task according to the maximum number of received packets corresponding to the current task includes: sequentially reading received packets from the kernel protocol stack for receiving processing until there are no readable packets in the kernel protocol stack, or the number of packets read from the kernel protocol stack is greater than or equal to the maximum number of received packets corresponding to the current task.

[0051] In the embodiment of the present application, after receiving the packets in the incoming code stream, they are first stored in the kernel protocol stack, and then the packets are read from the kernel protocol stack in sequence for receiving stream processing.

[0052] The stream receiving processing method provided in the embodiment of the present application performs stream receiving processing based on the adaptively evaluated incoming stream bit rate, without requiring the operation and maintenance personnel to input the incoming stream bit rate. The stream receiving processing is then constructed based on the incoming stream bit rate input by the operation and maintenance personnel. As a result, the matching degree between the adaptively evaluated incoming stream bit rate and the actual incoming stream bit rate is relatively small, thereby improving the quality of the live broadcast service.

[0053] In order to make the inbound stream rate acquisition method and the inbound stream processing method of the embodiments of the present application more intuitive, the specific implementation process is described in detail below through specific examples. The examples listed are not intended to limit the protection scope of the embodiments of the present application.

[0054] Example

[0055] Initialize the first time interval t1 to t0.

[0056] According to the formula Calculate the average bit rate b1 corresponding to the first time interval; where b1 is the average bit rate corresponding to the first time interval, recvlen1 is the total size of all packets received in the first time interval, and t1 is the first time interval.

[0057] According to the formula Calculate the weight coefficient of the first bitrate fluctuation; where flucoeff1 is the weight coefficient of the first bitrate fluctuation, b1 is the average bitrate corresponding to the first time interval, and b0 is the zeroth inbound bitrate (initialized to b1).

[0058] Since the weight coefficient flucoeff1 of the first bitrate fluctuation is less than 0.1, it indicates that the current inbound bitrate fluctuation is not large. The first inbound bitrate is determined to be b0, and the second time interval t2 is determined to be t0.

[0059] After delaying t0, follow the formula Calculate the average bit rate b2 corresponding to the second time interval; where b2 is the average bit rate corresponding to the second time interval, recvlen2 is the total size of all packets received in the second time interval, and t2 is the second time interval.

[0060] According to the formula Calculate the weight coefficient of the second bitrate fluctuation; where flucoeff2 is the weight coefficient of the second bitrate fluctuation, b2 is the average bitrate corresponding to the second time interval, and b0 is the 0th input bitrate (initialized to b1).

[0061] When the weight coefficient flucoeff2 of the second bitrate fluctuation is less than 0.1, it indicates that the current inbound bitrate fluctuation is not large, the second inbound bitrate remains b0, and the third time interval t3 remains t0.

[0062] When the weight coefficient flucoeff2 of the second bit rate fluctuation is greater than or equal to 0.1, it means that the current incoming bit rate fluctuates greatly. The second incoming bit rate is b2, and the third time interval t3 is

[0063] The following description is based on the case where the weight coefficient flucoeff2 of the second bit rate fluctuation is greater than or equal to 0.1.

[0064] After delaying t3, follow the formula Calculate the average bit rate b3 corresponding to the third time interval; where b3 is the average bit rate corresponding to the third time interval, recvlen3 is the total size of all packets received in the third time interval, and t3 is the third time interval.

[0065] According to the formula Calculate the weight coefficient for the third bitrate fluctuation; where flucoeff3 is the weight coefficient for the third bitrate fluctuation, b3 is the average bitrate corresponding to the third time interval, and b2 is the second inbound bitrate.

[0066] When the weight coefficient flucoeff3 of the third bitrate fluctuation is less than 0.1, it indicates that the current inbound bitrate does not fluctuate much, the third inbound bitrate remains at b2, and the fourth time interval t4 remains at t3.

[0067] When the weight coefficient flucoeff3 of the third bit rate fluctuation is greater than or equal to 0.1, it means that the current incoming bit rate fluctuates greatly. The third incoming bit rate is b4, and the fourth time interval t4 is

[0068] And so on, the detection continues.

[0069] After obtaining the first incoming stream rate, according to the formula Calculate the maximum number of received packets for this task corresponding to the first incoming stream rate. Where recvpktcnt1 is the maximum number of received packets for this task, recviter is the fixed receiving interval, b1 is the first incoming stream rate, pktlen is the size of each packet, and recvcoeff is the fixed receiving coefficient.

[0070] The received packets are read from the kernel protocol stack in sequence for inbound processing until there are no more packets to be read from the kernel protocol stack, or the number of packets read from the kernel protocol stack is greater than or equal to the maximum number of received packets corresponding to the first inbound stream rate for this task.

[0071] After each packet is read from the kernel protocol stack for stream collection, it is determined whether there are any readable packets in the kernel protocol stack. If there are no readable packets, the task is terminated. If there are readable packets, it is determined whether the number of packets read from the kernel protocol stack is greater than or equal to the maximum number of received packets corresponding to the first inbound stream rate for this task. If so, the task is terminated. If not, the task is continued to read the received packets from the kernel protocol stack for stream collection.

[0072] After obtaining the second incoming code stream rate, determine whether the second incoming code stream rate is the same as the first incoming code stream rate. If they are the same, directly use the maximum number of received packets corresponding to the first incoming code stream rate as the maximum number of received packets corresponding to the second incoming code stream rate. If they are not the same, then use the formula Calculate the maximum number of received packets corresponding to this task; where recvpktcnt2 is the maximum number of received packets corresponding to this task corresponding to the second incoming stream bitrate, recviter is the fixed receiving interval, b2 is the second incoming stream bitrate, pktlen is the size of each packet, and recvcoeff is the fixed receiving coefficient.

[0073] The received packets are read from the kernel protocol stack in sequence for inbound processing until there are no more packets to be read from the kernel protocol stack, or the number of packets read from the kernel protocol stack is greater than or equal to the maximum number of received packets corresponding to the second incoming stream rate for this task.

[0074] After each packet is read from the kernel protocol stack for stream collection, it is determined whether there are any readable packets in the kernel protocol stack. If there are no readable packets, the task is terminated. If there are readable packets, it is determined whether the number of packets read from the kernel protocol stack is greater than or equal to the maximum number of received packets corresponding to the first inbound stream rate for this task. If so, the task is terminated. If not, the task is continued to read the received packets from the kernel protocol stack for stream collection.

[0075] And so on and so forth.

[0076] In a third aspect, another embodiment of the present application provides an electronic device, comprising: at least one processor; a memory, wherein at least one program is stored in the memory, and when the at least one program is executed by the at least one processor, any one of the above-mentioned methods for obtaining the bit rate of an incoming stream is implemented, or any one of the above-mentioned methods for processing a received stream is implemented.

[0077] Among them, the processor is a device with data processing capabilities, including but not limited to the central processing unit (CPU); the memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH).

[0078] In some embodiments, the processor and memory are connected to each other through a bus, and further connected to other components of the computing device.

[0079] In a fourth aspect, another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements any of the above-mentioned methods for obtaining the bit rate of an incoming stream, or implements any of the above-mentioned methods for processing incoming streams.

[0080] Figure 6 A block diagram of the composition of a streaming media server provided in another embodiment of the present application.

[0081] Fifth, refer to Figure 6 Another embodiment of the present application provides a streaming media server, including: an incoming stream rate detection module 601, a stream receiving module 602, and a stream sending module 603.

[0082] The incoming stream rate detection module 601 is used to implement any of the above-mentioned incoming stream rate acquisition methods, the stream receiving module 602 is used to implement any of the above-mentioned stream receiving processing methods, and the stream sending module 603 is used to send packets after the stream receiving processing.

[0083] In a specific implementation, the incoming stream rate detection module 601 may update the incoming stream rate every time, or may first determine whether the current incoming stream rate fluctuates greatly. If the fluctuation is not large, the incoming stream rate does not need to be updated; if the fluctuation is large, the incoming stream rate needs to be updated.

[0084] In a specific implementation, the inbound bitrate detection module 601 may send the currently obtained inbound bitrate to the stream receiving module 602 each time it obtains the inbound bitrate. Alternatively, the module may first determine whether the currently obtained inbound bitrate is the same as the previously obtained inbound bitrate. If so, there is no need to send the currently obtained inbound bitrate to the stream receiving module 602. If not, the currently obtained inbound bitrate is sent to the stream receiving module 602.

[0085] In a specific implementation, if the stream receiving module 602 does not receive a new incoming stream bit rate, it calculates the maximum number of received packets corresponding to the current task based on the last received incoming stream bit rate, and performs stream receiving processing based on the maximum number of received packets corresponding to the current task. If the stream receiving module 602 receives a new incoming stream bit rate, it calculates the maximum number of received packets corresponding to the current task based on the new incoming stream bit rate, and performs stream receiving processing based on the maximum number of received packets corresponding to the current task.

[0086] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those skilled in the art, communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0087] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly indicated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the present application as set forth in the appended claims.

Claims

1. A method for obtaining an inbound bitrate, comprising: Calculate the average bit rate corresponding to this time interval; Calculate the weight coefficient of the current bit rate fluctuation according to the last incoming bit rate and the average bit rate corresponding to the current time interval; The current incoming code rate and the next time interval are determined according to the weight coefficient of the current code rate fluctuation, and the step of calculating the average code rate corresponding to the next time interval is continued after a preset time interval.

2. The method for obtaining the bit rate of an inbound stream according to claim 1, wherein: The average bit rate corresponding to the current time interval is the ratio of the total size of all packets received in the current time interval to the current time interval.

3. The method for obtaining the bit rate of an inbound stream according to claim 1, wherein: The weight coefficient of the current bit rate fluctuation is calculated based on the last incoming bit rate and the average bit rate corresponding to the current time interval, including: According to the formula Calculating the weight coefficient of the current bit rate fluctuation; Wherein, flucoeff is the weight coefficient of the current bit rate fluctuation, cur_b is the average bit rate corresponding to the current time interval, and last_b is the last inbound bit rate.

4. The method for obtaining the bit rate of an inbound stream according to claim 1, wherein: The determining of the current incoming stream bit rate and the next time interval according to the weight coefficient of the current bit rate fluctuation includes at least one of the following: If the weight coefficient of the current bitrate fluctuation is less than a preset threshold, determining that the current inbound bitrate is the same as the previous inbound bitrate, and determining that the next time interval is the same as the current time interval; When the weight coefficient of the current bitrate fluctuation is greater than or equal to a preset threshold, the current inbound bitrate is determined to be the average bitrate corresponding to the current time interval, and the next time interval is determined to be less than the current time interval.

5. The method for obtaining the bit rate of an inbound stream according to claim 4, wherein: Determining that the next time interval is smaller than the current time interval includes: According to the formula determining the next time interval; Among them, t next is the next time interval, t cur is the current time interval, and flucoeff is the weight coefficient of the current bit rate fluctuation.

6. A flow collection processing method, comprising: Calculating the maximum number of received packets corresponding to the current task based on the current incoming code stream rate; wherein the process of obtaining the current incoming code stream rate comprises the following steps: calculating the average code rate corresponding to the current time interval; calculating a weight coefficient of the current code rate fluctuation based on the previous incoming code stream rate and the average code rate corresponding to the current time interval; and determining the current incoming code stream rate based on the weight coefficient of the current code rate fluctuation; According to the maximum number of received packets corresponding to the task, packets in the incoming code stream belonging to the task are received and processed.

7. The flow collection processing method according to claim 6, wherein: Calculating the maximum number of received packets corresponding to the current task based on the current incoming stream bit rate includes at least one of the following: If it is determined that the incoming code rate does not fluctuate according to the incoming code rate of this time, determining that the maximum number of received packets corresponding to the current task is the same as the maximum number of received packets corresponding to the previous task; When the incoming code rate is determined to fluctuate according to the current incoming code rate, according to the formula Calculate the maximum number of received packets corresponding to this task; where recvpktcnt is the maximum number of received packets corresponding to this task, recviter is the fixed receiving interval, b cur is the bit rate of the incoming code stream, pktlen is the size of each packet, and recvcoeff is the fixed reception coefficient.

8. The flow collection processing method according to claim 7, wherein: The determining that the incoming code stream bit rate has no fluctuation according to the current incoming code stream bit rate includes: the current incoming code stream bit rate is the same as the previous incoming code stream bit rate.

9. The flow collection processing method according to claim 7, wherein: The determining that the incoming code stream rate fluctuates according to the current incoming code stream rate includes: the current incoming code stream rate is different from the previous incoming code stream rate.

10. The flow collection processing method according to claim 6, wherein: The receiving of packets belonging to the task in the incoming stream according to the maximum number of received packets corresponding to the task includes: The received packets are read from the kernel protocol stack in sequence for stream processing until there are no more packets to be read in the kernel protocol stack, or the number of packets read from the kernel protocol stack is greater than or equal to the maximum number of received packets corresponding to the current task.

11. An electronic device comprising: at least one processor; A memory having at least one program stored thereon, wherein when the at least one program is executed by the at least one processor, the method for obtaining the bit rate of an incoming stream according to any one of claims 1 to 5 is implemented, or the method for processing incoming stream according to any one of claims 6 to 10 is implemented.

12. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements the method for obtaining the bit rate of an incoming bitstream according to any one of claims 1 to 5, or implements the method for processing incoming bitstream according to any one of claims 6 to 10.

Citation Information

Patent Citations

  • Optimization method and optimization system of network plug flow quality

    CN107026856A

  • Code rate determination method and device, storage medium and electronic equipment

    CN111416986A