Method and apparatus for adjusting stream delay
By acquiring the transmission and reception times of streaming data in real time, calculating the round-trip delay and bit rate, and dynamically adjusting the buffering parameters of the buffer module, the problem of increased latency caused by software function parsing in the SRT protocol is solved, improving the efficiency of streaming data transmission and ensuring continuous data streaming.
Patent Information
- Application Number
- CN202310265433.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-17
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2043-03-17
AI Technical Summary
In existing technologies, the SRT protocol suffers from increased latency due to software function parsing during streaming data transmission, leading to network congestion and streaming interruptions, thus reducing transmission efficiency.
By acquiring the transmission and reception times of the streaming data in real time, calculating the round-trip delay and bit rate, and dynamically adjusting the buffer parameters of the buffer module, the buffer size is optimized, latency is reduced, and transmission efficiency is improved.
It implements dynamic updating of buffered data, solves the problem of low efficiency in streaming data transmission, ensures continuous data streaming, and avoids network congestion and interruption.
Smart Images

Figure CN116320532B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the computer field, and in particular, to a method and device for adjusting stream delay. BACKGROUND
[0002] With the development of network video streaming, the stream protocol is very important in the streaming application, and SRT (Secure Reliable Transport) is particularly prominent among many stream protocols.
[0003] Currently, many software development on the market uses SRT technology, and SRT can provide functions such as packet loss recovery and encryption security, but the analysis of these functions will increase the delay of stream data, causing network congestion and stream interruption, and thus reducing the transmission efficiency of stream data.
[0004] At present, there is no effective solution to the above problems. SUMMARY
[0005] Embodiments of the present application provide a method and device for adjusting stream delay to at least solve the problem of low stream data transmission efficiency in related technologies.
[0006] According to one embodiment of the present application, a method for adjusting stream delay is provided, comprising: in response to transmitting stream data between the pull stream end and the cloud network, obtaining the transmission parameters of the stream data, wherein the transmission parameters at least include: the sending time of the pull stream end sending stream output, the receiving time of the pull stream end receiving stream data and the bit rate; based on the sending time and the receiving time, determining the round-trip delay of the stream data, wherein the round-trip delay is used to represent the time delay between the pull stream end sending stream data and the pull stream end receiving stream data; based on the round-trip delay and the bit rate, adjusting the buffer parameters of the buffer module, wherein the buffer module is located between the pull stream end and the cloud network, and the buffer module is used to buffer the stream data based on the buffer parameters.
[0007] In one exemplary embodiment, based on the round-trip delay and the bit rate, the buffer parameters of the buffer module are adjusted, and the method comprises: based on the round-trip delay and the bit rate, obtaining the required buffer size; based on the buffer size, adjusting the buffer parameters of the buffer module.
[0008] In one example embodiment, in the process of pushing the stream data from the pull stream end to the buffer module, the stream data passes through the serial interface, the encoder, the transmission processing module and the buffer module in turn, and the method further comprises: pushing the stream data from the pull stream end to the encoder by using the serial interface; encoding the stream data by using the encoder to obtain a first encoding corresponding to the stream data, wherein the first encoding is used to represent that the encoder encodes the stream data to obtain the corresponding encoding in the process of pushing the stream data to the cloud network; slicing and packaging the first encoding by using the transmission processing module to obtain a stream package corresponding to the stream data, wherein the stream package is used to represent that the stream data is sliced and packaged to obtain a slice data package corresponding to the stream data in the process of pushing; and pushing the stream package to the buffer module.
[0009] In one example embodiment, in the process of pushing the stream data from the buffer module to the cloud network, the stream data passes through the secure transmission module and the cloud network in turn, and after the buffer parameter of the buffer module is adjusted, the method further comprises: adjusting and outputting the stream data based on the buffer parameter to obtain adjusted stream data; and pushing the stream data to the cloud network by using the secure transmission module.
[0010] In one example embodiment, in the process of pulling the stream data from the cloud network to the buffer module, the method further comprises: pulling the stream data returned by the cloud network to the buffer module by using the secure transmission module.
[0011] In one example embodiment, in the process of pulling the stream data from the buffer module to the pull stream end, the stream data passes through the buffer module, the transmission processing module, the decoder and the serial interface in turn, and after the buffer parameter of the buffer module is adjusted, the method further comprises: disassembling the stream data by using the transmission processing module to obtain a second encoding corresponding to the stream data, wherein the second encoding is used to represent the stream data that has not been decoded in the process of pulling; decoding the second encoding by using the decoder to obtain the stream data corresponding to the second encoding; and pulling the stream data to the pull stream end by using the serial interface.
[0012] In one example embodiment, the stream data is pushed from the pull stream end to the cloud network and immediately pulled from the cloud network to the pull stream end.
[0013] According to another embodiment of the present application, an adjusting stream delay device is provided, comprising: a first obtaining module, configured to obtain transmission parameters of stream data in response to transmission of the stream data between a pull stream end and a cloud network, wherein the transmission parameters at least include sending time of the stream data sent by the pull stream end, receiving time of the stream data received by the pull stream end and bit rate; a determining module, configured to determine round-trip delay of the stream data based on the sending time and the receiving time, wherein the round-trip delay is used to represent time delay between sending of the stream data from the pull stream end and receiving of the stream data by the pull stream end; and an adjusting module, configured to adjust buffer parameters of a buffer module based on the round-trip delay and the bit rate, wherein the buffer module is located between the pull stream end and the cloud network, and the buffer module is configured to buffer the stream data based on the buffer parameters.
[0014] According to still another embodiment of the present application, a computer readable storage medium is further provided, and the computer readable storage medium stores a computer program, wherein the computer program is set to execute steps in any of the above adjusting stream delay method embodiments when running.
[0015] According to still another embodiment of the present application, an electronic device is further provided, comprising a memory and a processor, the memory stores a computer program, and the processor is set to run the computer program to execute steps in any of the above adjusting stream delay method embodiments.
[0016] It needs to be noted that, according to the present application, since analysis of software function will increase delay of stream, cause network congestion and slow down network transmission speed, by obtaining sending time and receiving time of stream data in real time, obtaining round-trip delay of the stream data based on the sending time and the receiving time, and adjusting buffer parameters of a buffer module based on the round-trip delay and the bit rate, the buffer size of the buffer module can be dynamically changed, thus, the problem of low stream data transmission efficiency can be solved, and the effect of dynamically updating buffer data and continuously streaming data can be achieved. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 is a hardware structure block diagram of a network architecture of an adjusting stream delay method according to an embodiment of the present application;
[0018] Figure 2 is a flow chart of an adjusting stream delay method according to an embodiment of the present application;
[0019] Figure 3 is a structure schematic diagram of an optional stream data push stream architecture according to an embodiment of the present application;
[0020] Figure 4 is a structure schematic diagram of an optional stream data pull stream architecture according to an embodiment of the present application;
[0021] Figure 5 is a flowchart of adjusting delay of streaming data according to an embodiment of the present application;
[0022] Figure 6 is a structural block diagram of an adjusting delay of streaming device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] Hereinafter, the embodiments of the present application will be described in detail with reference to the accompanying drawings and in conjunction with embodiments.
[0024] It should be noted that the terms "first", "second", and the like in the description and claims of the present application and the above-described accompanying drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence.
[0025] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the case of running on a mobile terminal, Figure 1 is a hardware structural block diagram of a mobile terminal of a traffic data detection method according to an embodiment of the present application. As shown in Figure 1 , the mobile terminal can include one or more (only one is shown in Figure 1 ) processor 102 (the processor 102 can include but not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned mobile terminal can further include a transmission device 106 for communication function and an input and output device 108. Those skilled in the art can understand that Figure 1 the structure shown is only schematic, which does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal can further include more or less components than those shown in Figure 1 , or have a different configuration from Figure 1 .
[0026] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the traffic data detection method in the embodiments of the present application, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above-mentioned method. The memory 104 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, which can be connected to the mobile terminal through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0027] The transmission device 106 is configured to receive or send data via a network. The network can include a wireless network provided by a communication provider of the mobile terminal. In one embodiment, the transmission device 106 includes a network interface controller (NIC) configured to connect to other network devices via a base station to communicate with the Internet. In one embodiment, the transmission device 106 can be a radio frequency (RF) module configured to communicate with the Internet via a wireless network.
[0028] In the present embodiment, a method for adjusting stream delay is provided, Figure 2 is a flow chart of a method for adjusting stream delay according to an embodiment of the present application, as shown in the figure, the flow includes the following steps: Figure 2
[0029] In step S202, in response to transmitting stream data between the stream-pulling terminal and the cloud network, the transmission parameters of the stream data are obtained, wherein the transmission parameters at least include: the sending time of the stream data sent by the stream-pulling terminal, the receiving time of the stream data received by the stream-pulling terminal and the bit rate.
[0030] The stream-pulling terminal can be a client or a server. The stream-pulling terminal can refer to a source station and a content delivery network (CDN), which can send audio and video data to the stream-pushing terminal, receive audio and video data from the stream-pushing terminal, and then distribute the data to each playback terminal (including different device access, different storage device access, flow control, transcoding, encapsulation, different protocol gateway, etc.).
[0031] The stream-pushing terminal can be a cloud network. The cloud network can be a network that can collect and manage data in the cloud, which is configured to receive audio and video data sent by the stream-pulling terminal and return the audio and video data to the stream-pulling terminal.
[0032] The stream data can be audio and video data transmitted in the network. The audio and video data can refer to video stream, audio stream and other data. The stream data sent by the stream-pulling terminal can be represented by ACK (Acknowledge character), and the stream data received by the stream-pulling terminal can be represented by ACK-ACK. ACK and ACK-ACK represent the same round-trip stream data.
[0033] The transmission parameter can be transmission data generated in the transmission of the stream data on the network, including but not limited to: sending time of the stream data sent by the pull end, receiving time of the stream data received by the pull end, and bit rate. The sending time can be the time when the stream data is sent from the pull end; the receiving time can be the time when the stream data is sent from the cloud network to the pull end and received by the pull end; and the bit rate can be the number of bits transmitted per second, which is the number of bits transmitted or processed per unit time in the field of telecommunications and computing.
[0034] The bit rate is often used as a synonym for connection speed, transmission speed, information transmission rate, and digital bandwidth capacity in the field of telecommunications. The higher the bit rate, the more data is transmitted per second, and the clearer the image quality. The bit rate in sound refers to the amount of binary data per unit time after converting an analog sound signal into a digital sound signal, which is an indirect measure of audio quality. The bit rate (code rate) in video works the same way as in sound, which refers to the amount of binary data per unit time after converting an analog signal into a digital signal.
[0035] In an alternative embodiment, since the receiving time of the stream data received by the pull end cannot be obtained during the transmission of the stream data, the round-trip delay can be calculated according to the sending time and receiving time of the previous stream data. Therefore, when the previous stream data is pushed from the pull end to the cloud network and pulled from the cloud network to the pull end, the sending time when the previous stream data is sent from the pull end and the receiving time when the stream data is pulled from the cloud network to the pull end are obtained, and the bit rate is obtained in real time.
[0036] In another alternative embodiment, the system monitors the changes of each data. When the previous stream data ACK is pushed from the pull end to the cloud network, the sending time of the stream data ACK sent from the pull end is obtained in real time. When the previous stream data ACK-ACK is pulled from the cloud network to the pull end, the receiving time of the stream data ACK-ACK received by the pull end is obtained in real time. The system obtains the bit rate of the stream data in real time according to the detection data.
[0037] It should be noted that when a certain stream data or multiple stream data fails during the process of reaching the destination through the network, that is, the pull end sends the stream data, but the cloud network does not receive the data, it is found that the stream data is lost, and a request can be sent to the sending end according to the queue number to retransmit the stream data. The sending time and receiving time of the stream data are mainly based on the retransmitted stream data.
[0038] When a stream data or multiple stream data reaches the cloud network, the cloud network will pull the stream data to the pull end, but the pull end does not receive the data returned by the cloud data, so the stream data is found to be lost, the system will send a request to the sending end according to the queue number, and the stream data is retransmitted, and the sending time and receiving time of the stream data are mainly the retransmitted stream data.
[0039] In addition, the pull end sends a stream data ACK stream package to the cloud network, and when the cloud network receives the ACK stream package, an ACK-ACK package is returned to the pull end immediately, so that the pull end knows that the communication is not disconnected, and the pull end can calculate the network transmission speed, that is, the round-trip delay, by sending the sending time of the stream data and receiving the receiving time of the stream data. Further, the network propagation speed can also be displayed on the user interface, so that the user can adjust the buffer parameters of the buffer module according to the network propagation speed. The above-mentioned user can be a customer or an administrator. If the network propagation speed is abnormal, the system can automatically send the abnormal information to the user interface. When the network propagation speed is less than the preset threshold, the system will automatically alarm and send the alarm information to the user. The user adjusts the buffer parameters in the buffer module according to the alarm information.
[0040] Step S204, determining the round-trip delay of the stream data based on the sending time and the receiving time, wherein the round-trip delay is used to represent the time delay between sending the stream data from the pull end to receiving the stream data from the pull end;
[0041] The above-mentioned round-trip delay can be the duration required for a network request in milliseconds from the starting point to the destination and returning to the starting point again. It can also be the round-trip time (RTT) between the stream data sent from the pull end to the cloud network and returned from the cloud network to the pull end. It is an important indicator for determining the connection health status on the local network or larger network. Network administrators usually use it to diagnose the speed and reliability of network connection.
[0042] The above-mentioned time delay can be the delay between the sending of the stream data from the pull end and the receiving thereof.
[0043] In an optional embodiment, when the sending time and the receiving time of the stream data are obtained, the round-trip delay is obtained according to the formula: RTT= receiving time- sending time, according to the sending time and the receiving time of the stream data.
[0044] In an optional embodiment, the sending time of the ACK of the acquired stream data is acquired, and the return ACK-ACK of the received stream data is sent. After the sending time and the receiving time of the stream data are acquired, the round-trip delay is obtained according to the sending time and the receiving time of the stream data according to the formula: RTT = receiving time - sending time.
[0045] It should be noted that in the SRT protocol, one of the characteristics of SRT is low delay, and the setting method of low delay is to test the network RTT speed in advance. Periodic transmission of stream data, and then according to the sending time and the receiving time of the stream data, the round-trip delay of the link can be calculated through the one-to-one correspondence of the stream data and the stream data packet. The delay amount (Latency) is an important parameter in the SRT protocol, and the settable range is 80ms-8000ms. The greater the delay amount, the higher the error control capability of the SRT link, but the total delay of the link will increase. Selecting a suitable delay amount can reduce the delay. As shown in Table 1 below, if the RTT is less than 20ms, it is calculated according to 20ms. The delay amount Latency can be calculated according to the following formula: Latency = RTT*RTT multiplier. Wherein, RTT is determined by three parts: link propagation time, end system processing time, and data cache queuing and processing time in the buffer module. The link propagation time and the end system processing time are relatively fixed, and the data cache queuing and processing time in the buffer module will change with the change of the congestion degree of the entire network. Therefore, the sending time and the receiving time of the stream data are acquired in real time, and the round-trip delay is calculated. According to the round-trip delay and the bit rate of the stream data, the buffer parameters of the buffer module are adjusted, which can solve the problems of network congestion and low stream data transmission efficiency. And according to the demand, the period is set, and the buffer parameters of the buffer module are adjusted according to the preset period, so as to dynamically change the buffer size and the delay, continuously stream, and improve the stream data transmission efficiency.
[0046] Table 1
[0047]
[0048] In addition, the stream data is transmitted between the pull stream end and the cloud network, and the path may change over time, and other factors (such as network congestion) may affect the transmission of the stream data, thereby affecting the round-trip delay.
[0049] Step S206, based on the round-trip delay and the bit rate, adjusting the buffer parameters of the buffer module, wherein the buffer module is located between the pull stream end and the cloud network, and the buffer module is used to buffer the stream data based on the buffer parameters.
[0050] The buffering module can be a module for buffering streaming data. The buffering parameter can be a parameter in the data buffering process. By adjusting the buffering parameter, the buffering size can be changed in time, the delay can be adjusted, and the continuous streaming can be maintained.
[0051] In an optional embodiment, after the buffering module obtains the round-trip delay and the bit rate, the delay data is obtained according to the formula: delay = RTT*N, and then the buffering size is calculated according to the formula: buffering space = delay*bit rate. Further, according to the buffering size, the buffering parameter of the buffering module is adjusted in real time by DFX (Dynamic Function eXchange), so that the streaming data can be continuously streamed during the transmission between the streaming pulling end and the cloud network, and the transmission efficiency of the streaming data is accelerated.
[0052] In another optional embodiment, after the buffering module obtains the round-trip delay and the bit rate, the delay data is obtained according to the formula: delay = RTT*N, and then the buffering size is calculated according to the formula: buffering space = delay*bit rate. Further, according to the buffering size, the buffering parameter of the buffering module is adjusted in real time by DFX. When the buffering size cannot meet the size of the streaming data, the system sends an alarm information to the user, and the user can adjust the buffering module according to the demand.
[0053] It should be noted that the buffering module will periodically replace the buffering parameter according to the actual RTT data and the bit rate of the streaming, so as to dynamically change the buffering size and the delay, so that the streaming data can be continuously streamed, and problems such as streaming interruption and network congestion can be avoided.
[0054] Through the above steps, the sending time and the receiving time of the streaming data are obtained in real time. Based on the sending time and the receiving time of the streaming data, the round-trip delay of the streaming data is obtained in real time. Further, the buffering parameter of the buffering module is adjusted according to the round-trip delay and the bit rate, so that the buffering size of the buffering module can be dynamically changed. Therefore, the problem of low transmission efficiency of the streaming data can be solved, and the effect of dynamically updating the buffering data and continuously streaming the data can be achieved.
[0055] In an example embodiment, the buffering parameter of the buffering module is adjusted based on the round-trip delay and the bit rate. The method comprises: obtaining the required buffering size based on the round-trip delay and the bit rate; and adjusting the buffering parameter of the buffering module based on the buffering size.
[0056] The buffering size can be the buffering space size of the buffering module. The buffering parameter is dynamically adjusted according to the required buffering size, so as to change the buffering size of the buffering module.
[0057] In an alternative embodiment, when the round-trip delay is obtained, the delay data is calculated according to the round-trip delay, and then the required buffer space is calculated using the delay data, and the buffer module adjusts the buffer parameters of the buffer module according to the size of the required buffer space.
[0058] In an example embodiment, during the process of pushing the stream data from the pull stream end to the buffer module, the stream data sequentially passes through the serial interface, the encoder, the transmission processing module, and the buffer module, and the process further comprises: pushing the stream data from the pull stream end to the encoder using the serial interface; encoding the stream data using the encoder to obtain the first encoding corresponding to the stream data, wherein the first encoding is used to represent the corresponding encoding obtained by encoding the stream data using the encoder during the process of pushing the stream data to the cloud network; slicing and packaging the first encoding using the transmission processing module to obtain the stream package corresponding to the stream data, wherein the stream package is used to represent the slicing and packaging of the stream data to obtain the slice data package corresponding to the stream data during the process of pushing; and pushing the stream package to the buffer module.
[0059] The serial interface described above can be an expansion interface using a serial communication mode, or it can mean that data is transmitted sequentially one bit at a time, including but not limited to: PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard), HDMI (High Definition Multmedia Interface, a fully digital video and sound transmission interface that can transmit uncompressed audio and video signals), and SDI (Serial digital interface, digital component serial interface).
[0060] The encoder described above can be a tool for encoding stream data, or it can be a tool for encoding image data into H.264 (a highly compressed digital video codec standard) or HEVC (High Efficiency Video Coding, a video compression standard). The transmission processing module can be a module for slicing and packaging data, and can be but not limited to: a TS (Transport Stream, transport stream) packaging module.
[0061] The first encoding described above can be the encoding of the stream data by the encoder during the transmission of the stream data from the pull stream end to the cloud network, to obtain the encoding data corresponding to the stream data. The stream package can be a package obtained by packaging the slice of the stream data, and can be but not limited to: a TS (Transport Stream, transport stream) stream package. The slice data package can be a data package obtained by slicing the stream data.
[0062] In an alternative embodiment, the stream data is pushed from the pull stream end to the encoder for encoding through a serial interface, the encoder encodes the transmitted stream data according to a preset encoding standard, and the encoded data is further sliced and packaged by a transmission processing module and pushed to a buffer module.
[0063] In another alternative embodiment, the stream data is pushed from the pull stream end to the encoder for encoding through a PCIe / HDMI / SDI interface, the encoder encodes the transmitted stream data according to a preset encoding standard, and the encoded data is further sliced and packaged by a TS packaging module and pushed to a buffer module.
[0064] Figure 3 is a structure diagram of an alternative stream data push architecture according to an embodiment of the present application, as Figure 3 shown, the audio and video are transmitted to the encoder through a PCIe / HDMI / SDI interface, the image data is encoded into H.264 or HEVC, etc. by the encoder, and then the audio and video data are sliced and packaged into TS stream packets by the TS processing module, and the stream packets are further buffered to the dynamic data buffer.
[0065] In an exemplary embodiment, during the process of pushing the stream data from the buffer module to the cloud network, the stream data sequentially passes through a secure transmission module, a cloud network, and the buffer module adjusts the buffer parameters of the buffer module, and the method further comprises: based on the buffer parameters, adjusting and outputting the stream packets to obtain adjusted stream data; and pushing the stream data to the cloud network by using the secure transmission module.
[0066] The above-mentioned secure transmission module can be a module for transmitting video stream, and can also be an open source Internet transmission protocol based on UNT (UDP-based Data Transfer Protocol, Internet Data Transmission Protocol), which can be but is not limited to: an SRT module.
[0067] In an alternative embodiment, the buffer module buffers the stream packets, and further pushes the data to the secure transmission module, so as to push the stream data to the cloud network by using the secure transmission module.
[0068] In another alternative embodiment, the buffer module buffers the stream packets, and the buffer module pushes the stream packets to the hardware SRT, and then the hardware SRT pushes the stream packets to the cloud network, Figure 3 is a structure diagram of an alternative stream data push architecture according to an embodiment of the present application, as Figure 3As shown, when the stream package is pushed from the buffer module to the cloud network, the buffer module further pushes the stream package to the hardware SRT, and the hardware SRT further pushes the stream package to the cloud network.
[0069] In an example embodiment, during the process of pulling the stream data from the cloud network to the buffer module, the method further comprises: using the secure transmission module to pull the stream data returned by the cloud network to the buffer module, wherein the stream data is pushed from the pulling end to the cloud network, and immediately pulled from the cloud network to the pulling end.
[0070] In an alternative embodiment, after the stream data reaches the cloud network, it is immediately pulled to the secure transmission module, and the stream data passes through the secure transmission module, and the secure transmission module is used to pull the data to the buffer module.
[0071] In an alternative embodiment, after the stream data ACK reaches the cloud network, the cloud network immediately pulls the ACK-ACK stream data corresponding to the stream data ACK to the secure transmission module, and the stream data ACK-ACK passes through the secure transmission module, and the secure transmission module is used to pull the ACK-ACK data to the buffer module.
[0072] In another alternative embodiment, after the stream package reaches the cloud network, it is immediately pulled to the hardware SRT, and the hardware SRT pulls the stream package to the dynamic adjustment buffer module. Figure 4 is a structural schematic diagram of an alternative stream data pulling architecture according to an embodiment of the present application, as Figure 4 As shown, after the secure transmission module obtains the stream package from the cloud network, it pulls the stream package to the dynamic adjustment buffer module for adjustment.
[0073] In an example embodiment, during the process of pulling the stream data from the buffer module to the pulling end, the stream data passes through the buffer module, the transmission processing module, the decoder, and the serial interface in turn, and after adjusting the buffer parameters of the buffer module, the method further comprises: using the transmission processing module to disassemble the stream data to obtain a second code corresponding to the stream data, wherein the second code is used to represent the stream data that has not been decoded during the pulling process; using the decoder to decode the second code to obtain stream data corresponding to the second code; and using the serial interface to pull the stream data to the pulling end.
[0074] The above-mentioned decoder can be a tool for decoding the encoded stream data, and can be a hardware / software device for decoding digital audio data stream into analog audio signals. The process mainly converts the data encoding file into analog audio signals.
[0075] The second encoding mentioned above can be undecoded stream data. In the process of pulling the stream data to the pull terminal in the cloud network, the decoder has not decoded the stream data.
[0076] In an alternative embodiment, in the process of pulling the stream data to the pull terminal in the buffer module, after the buffer module adjusts the stream data, the transmission processing module pulls the stream data to the transmission processing module, and packetizes and disassembles the stream data to obtain encoded stream data, further pulls the stream data to the decoder, decodes the encoded stream data by the decoder to obtain readable stream data, and then uses the serial interface to pull the stream data to the pull terminal for playing through the pull terminal.
[0077] In another alternative embodiment, after the dynamic adjustment buffer module adjusts the stream packet, the TS packet disassembly module pulls the stream data to the TS packet disassembly module, packetizes and disassembles the stream packet to obtain encoded stream data, further pulls the stream data to the decoder, decodes the encoded stream data by the decoder to obtain readable stream data, and then uses the serial interface to pull the stream data to the pull terminal for playing through the pull terminal.
[0078] Figure 4 is a structure diagram of an alternative stream data pulling architecture according to an embodiment of the present application, as shown in Figure 4 The dynamic adjustment buffer module pulls the adjusted stream packet to the TS packet disassembly, disassembles the stream packet by the TS packet disassembly to obtain encoded stream data, further pulls the encoded stream data to the decoder, decodes the encoded stream data by the decoder to obtain readable stream data, and then uses the PCIe / HDMI / SDI interface to pull the readable stream data to the pull terminal for playing through the pull terminal.
[0079] Figure 5 is a flow chart of an alternative adjustment of stream data delay according to an embodiment of the present application, as shown in Figure 5As shown, the pull stream end sends ACK control through the SRT module, and the pull stream end waits to receive the ACK-ACK data packet, the system calculates the round-trip delay according to the operation of the data of the stream data transmission in the period, calculates the round-trip delay according to the sending time of the ACK stream data and the receiving time of the received ACK-ACK stream data, calculates the required delay data according to the round-trip delay, the system detects the data to obtain the bit rate of the stream data, and further calculates the required buffer size of the buffer module according to the formula, and then the buffer module adjusts the buffer parameter according to the required buffer size obtained, so as to change the buffer and delay, maintain the continuous streaming of the stream data, and improve the transmission efficiency of the stream data. Dynamic update of the buffer space size and dynamic adjustment of the delay can make the connection continuous, can resist the instability of the network, network congestion and other problems, when the stream resolution changes, for example, 2K changes to 8K, the bit rate will increase greatly, and the dynamic update of the buffer can meet the application of the change of the bit rate.
[0080] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal device (which can be a mobile phone, computer, server, or network device) execute the methods described in the various embodiments of the present application.
[0081] In the present embodiment, an adjusting stream delay device is also provided, which is used to realize the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably realized in software, hardware, or a combination of software and hardware is also possible and is contemplated.
[0082] Figure 6 The structure block diagram of an adjusting stream delay device according to an embodiment of the present application is as follows: Figure 6As shown, the apparatus comprises: a first obtaining module 62, configured to obtain transmission parameters of the streaming data in response to transmission of the streaming data between the streaming-pulling end and the cloud network, wherein the transmission parameters at least comprise: sending time of the streaming-pulling end sending the streaming data, receiving time of the streaming-pulling end receiving the streaming data, and bit rate; a determining module 64, configured to determine round-trip delay of the streaming data based on the sending time and the receiving time, wherein the round-trip delay is used to represent time delay between sending of the streaming data from the streaming-pulling end and receiving of the streaming data by the streaming-pulling end; and an adjusting module 66, configured to adjust buffer parameters of a buffer module based on the round-trip delay and the bit rate, wherein the buffer module is located between the streaming-pulling end and the cloud network, and the buffer module is configured to buffer the streaming data based on the buffer parameters.
[0083] In an example embodiment, the adjusting module comprises: a first obtaining unit, configured to obtain required buffer size based on the round-trip delay and the bit rate; and a first adjusting unit, configured to adjust the buffer parameters of the buffer module based on the buffer size.
[0084] In an example embodiment, during pushing of the streaming data from the streaming-pulling end to the buffer module, the apparatus further comprises: a first pushing module, configured to push the streaming data from the streaming-pulling end to an encoder using a serial interface; an encoding module, configured to encode the streaming data using the encoder to obtain first encoding corresponding to the streaming data, wherein the first encoding is used to represent encoding of the streaming data by the encoder during pushing of the streaming data to the cloud network; a packaging module, configured to slice and package the first encoding using a transmission processing module to obtain streaming package corresponding to the streaming data, wherein the streaming package is used to represent slicing and packaging of the streaming data to obtain slice data package corresponding to the streaming data during pushing; and a second pushing module, configured to push the streaming package to the buffer module.
[0085] In an example embodiment, after the buffer module adjusts the buffer parameters of the buffer module, the apparatus further comprises: a second obtaining module, configured to obtain adjusted streaming data by adjusting the streaming package based on the buffer parameters and outputting the streaming data; and a third pushing module, configured to push the streaming data to the cloud network using a secure transmission module, wherein the streaming data is pushed from the streaming-pulling end to the cloud network and immediately pulled from the cloud network to the streaming-pulling end.
[0086] In an example embodiment, during pulling of the streaming data from the cloud network to the buffer module, the apparatus further comprises: a first pulling module, configured to pull the streaming data returned by the cloud network to the buffer module using a secure transmission module, wherein the streaming data is pushed from the streaming-pulling end to the cloud network and immediately pulled from the cloud network to the streaming-pulling end.
[0087] In one example embodiment, during the process of pulling the stream data from the buffer module to the pulling end, the stream data passes through the buffer module, the transmission processing module, the decoder and the serial interface in sequence. After adjusting the buffer parameter of the buffer module, the process further includes: a disassembling module configured to disassemble the stream data by using the transmission processing module to obtain a second code corresponding to the stream data, wherein the second code is used to represent the stream data that is not decoded during the pulling process; a decoding module configured to decode the second code by using the decoder to obtain the stream data corresponding to the second code; and a second pulling module configured to pull the stream data to the pulling end by using the serial interface.
[0088] It should be noted that the above modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: the above modules are located in the same processor; or the above modules are located in different processors in any combination.
[0089] Embodiments of the present application also provide a computer readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0090] In one example embodiment, the above computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0091] Embodiments of the present application also provide an electronic device, which includes a memory storing a computer program and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
[0092] In one example embodiment, the above electronic device can further include a transmission device connected to the processor and an input and output device connected to the processor.
[0093] The specific examples in the present embodiment can refer to the examples described in the above embodiments and example embodiments, which will not be described herein again.
[0094] It should be apparent to those skilled in the art that the modules or steps of the application described above can be implemented with general computing devices, which can be centralized on a single computing device or distributed on a network of multiple computing devices, and which can be implemented with program codes executable by the computing devices, so that they can be stored in storage devices and executed by the computing devices, and in some cases, the steps shown or described can be executed in different orders than shown, or made into individual integrated circuit modules, or made into a single integrated circuit module. Thus, the present application is not limited to any particular combination of hardware and software.
[0095] The preferred embodiments of the present application described above are only used to explain the principles of the present application and not limit the present application. Any modification, equivalent replacement, improvement, etc. within the principles of the present application should be included in the protection scope of the present application.
Claims
1. A method of adjusting stream delay, the method comprising: The method comprises: obtaining transmission parameters of the stream data in response to transmission of the stream data between the pull stream end and the cloud network, wherein the transmission parameters at least include sending time of the pull stream end sending the stream data, receiving time of the pull stream end receiving the stream data, and bit rate; determining round-trip delay of the stream data based on the sending time and the receiving time, wherein the round-trip delay is used to represent time delay between sending the stream data from the pull stream end to receiving the stream data at the pull stream end; adjusting buffer parameters of a buffer module based on the round-trip delay and the bit rate, wherein the buffer module is located between the pull stream end and the cloud network, and the buffer module is used to buffer the stream data based on the buffer parameters; wherein the adjusting the buffer parameters of the buffer module based on the round-trip delay and the bit rate comprises: obtaining required buffer size based on the round-trip delay and the bit rate; and adjusting the buffer parameters of the buffer module based on the buffer size.
2. The method of claim 1, wherein, In the process of pushing the stream data from the pull stream end to the buffer module, the stream data passes through a serial interface, an encoder, a transmission processing module, and the buffer module in sequence, and the method further comprises: pushing the stream data from the pull stream end to the encoder by using the serial interface; encoding the stream data by using the encoder to obtain a first encoding corresponding to the stream data, wherein the first encoding is used to represent that the encoder encodes the stream data to obtain a corresponding encoding in the process of pushing the stream data to the cloud network; performing slice packaging on the first encoding by using the transmission processing module to obtain a stream package corresponding to the stream data, wherein the stream package is used to represent that slice data packets are obtained by performing slice packaging on the stream data in the process of pushing the stream data; pushing the stream package to the buffer module.
3. The method of claim 1, wherein, In the process of pushing the stream data from the buffer module to the cloud network, the stream data passes through a security transmission module and the cloud network in sequence, and after the buffer module adjusts the buffer parameters of the buffer module, the method further comprises: adjusting the stream package based on the buffer parameters and outputting the stream data to obtain adjusted stream data; pushing the stream data to the cloud network by using the security transmission module.
4. The method of claim 1, wherein, In the process of pulling the stream data from the cloud network to the buffer module, the method further comprises: pulling the stream data returned by the cloud network to the buffer module by using the security transmission module.
5. The method of claim 4, wherein, In the process of pulling the stream data from the buffer module to the pull stream end, the stream data passes through the buffer module, a transmission processing module, a decoder, and a serial interface in sequence, and after the buffer parameters of the buffer module are adjusted, the method further comprises: The transmission processing module is used to disassemble the stream data to obtain a second code corresponding to the stream data, wherein the second code is used to represent the stream data that is not decoded in the pull stream process. The decoder is used to decode the second code to obtain the stream data corresponding to the second code. The stream data is pulled to the pull stream end through a serial interface.
6. The method according to any one of claims 1 to 5, characterized in that, The stream data is pushed from the pull stream end to the cloud network, and immediately pulled from the cloud network to the pull stream end.
7. A device for adjusting stream delay, characterized in that, The method comprises the following steps: The first obtaining module is used to obtain transmission parameters of the stream data in response to transmission of the stream data between the pull stream end and the cloud network, wherein the transmission parameters at least include sending time of the pull stream end for sending the stream data, receiving time of the pull stream end for receiving the stream data and bit rate; The determining module is used to determine round-trip delay of the stream data based on the sending time and the receiving time, wherein the round-trip delay is used to represent time delay between sending the stream data from the pull stream end and receiving the stream data from the pull stream end; The adjusting module is used to adjust buffer parameters of a buffer module based on the round-trip delay and the bit rate, wherein the buffer module is located between the pull stream end and the cloud network, and the buffer module is used to buffer the stream data based on the buffer parameters. The adjusting module comprises a first obtaining unit and a first adjusting unit.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is executed by the processor to realize the steps of the adjusting stream delay method in any one of claims 1 to 6.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the steps of the adjusting stream delay method in any one of claims 1 to 6.
Citation Information
Patent Citations
Play delay time regulating method for network point-to-point streaming system and device thereof
CN101729375A
Method of splicing encoded multimedia data streams
CN101911698A