WO2023040413A1 - 视频流的处理方法、装置、服务器和存储介质 - Google Patents
视频流的处理方法、装置、服务器和存储介质 Download PDFInfo
- Publication number
- WO2023040413A1 WO2023040413A1 PCT/CN2022/102559 CN2022102559W WO2023040413A1 WO 2023040413 A1 WO2023040413 A1 WO 2023040413A1 CN 2022102559 W CN2022102559 W CN 2022102559W WO 2023040413 A1 WO2023040413 A1 WO 2023040413A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- video stream
- video
- sampling
- rate
- user terminal
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 21
- 238000003860 storage Methods 0.000 title claims abstract description 15
- 238000000034 method Methods 0.000 claims abstract description 44
- 230000004044 response Effects 0.000 claims abstract description 11
- 238000005070 sampling Methods 0.000 claims description 105
- 238000012545 processing Methods 0.000 claims description 36
- 238000004590 computer program Methods 0.000 claims description 17
- 238000010586 diagram Methods 0.000 description 15
- 230000008569 process Effects 0.000 description 12
- 230000005540 biological transmission Effects 0.000 description 10
- 230000006870 function Effects 0.000 description 5
- 230000009471 action Effects 0.000 description 4
- 238000005457 optimization Methods 0.000 description 4
- 239000000523 sample Substances 0.000 description 3
- 230000003044 adaptive effect Effects 0.000 description 2
- 230000032683 aging Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/215—Flow control; Congestion control using token-bucket
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/80—Responding to QoS
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/238—Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
Definitions
- the present application relates to the technical field of video streams, and in particular to a video stream processing method, device, server and storage medium.
- TCP Transmission Control Protocol
- TCP Transmission Control Protocol
- QUIC transport protocol has emerged to replace TCP.
- the QUIC protocol is replacing TCP faster and faster.
- Mainstream video websites have started to use the QUIC protocol to carry video streams.
- the proportion of QUIC video streams in live network traffic is growing rapidly.
- QUIC video streams occupy a large amount of core network bandwidth and server resources, which will reduce the service quality of high-priority services.
- the transmission of QUIC video streams during peak traffic hours occupies a large amount of network bandwidth, which may affect high-priority and delay-sensitive services, including IP voice services and web browsing provided by operators.
- An embodiment of the present application provides a video stream processing method, including: in response to a video acquisition request sent by a user terminal, receiving a first video stream corresponding to the video acquisition request sent by a video server; and a pre-configured rate limit percentage, determine an output rate for sending the first video stream; and send the first video stream to the user terminal according to the output rate.
- the embodiment of the present application also provides a video stream processing device, including: an acquisition module, configured to receive the first video stream corresponding to the video acquisition request sent by the video server in response to the video acquisition request sent by the user terminal; A rate module, configured to determine an output rate for sending the first video stream according to the first video stream and a pre-configured rate limit percentage; a sending module, configured to send the second video stream to the user terminal according to the output rate A video stream.
- An embodiment of the present application also provides a server, including: at least one processor and a memory; the memory stores a computer program; and the at least one processor executes the computer program stored in the memory, so as to implement the above video stream processing method.
- An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed, the foregoing video stream processing method is implemented.
- FIG. 1 is a flow chart of the steps of an embodiment of a method for processing a video stream according to an embodiment of the present application
- FIG. 2 is a flow chart of the steps of another video stream processing method embodiment of the embodiment of the present application.
- Fig. 3 is a schematic diagram of the system structure of the embodiment of the present application.
- Fig. 4 is a schematic diagram of the internal main components of the QUICO module of the embodiment of the present application.
- Fig. 5 is a flow chart of the steps of the TC module processing the video stream in the embodiment of the present application.
- Fig. 6 is a flow chart of the steps of the QUICO module processing the video stream in the embodiment of the present application.
- FIG. 7 is a flow chart of the steps of another video stream processing method embodiment of the present application.
- FIG. 8 is a structural block diagram of an embodiment of a video stream processing device of the present application.
- Fig. 9 is a schematic structural diagram of a server embodiment of the present application.
- Embodiments of the present application provide a method, device, server, and storage medium for processing video streams, so as to avoid or reduce the above-mentioned impact of QUIC video streams on other services during peak periods of communication traffic.
- the video stream processing method, device, server, and storage medium provided in the embodiments of the present application receive the first video stream corresponding to the video acquisition request sent by the video server in response to the video acquisition request sent by the user terminal, and according to the The first video stream and the pre-configured speed limit percentage determine the output rate for sending the first video stream; send the first video stream to the user terminal according to the output rate, and according to the embodiment of the present application, according to the network bandwidth of the user terminal, Limit the speed of the transmitted QUIC video stream, triggering the user terminal to actively reduce the resolution, so as to reduce the bandwidth occupied by the transmission of the QUIC video stream, and ensure the service quality of high-priority services such as IP voice during peak traffic periods.
- An embodiment of the present application provides a method for processing a video stream, which is used to perform speed limit processing on the video stream.
- the execution subject of this embodiment is a video stream processing device, which is set on a core network server.
- FIG. 1 shows a flow chart of the steps of an embodiment of a video stream processing method of the present application, which may specifically include the following steps:
- the user terminal sends a video acquisition request to the video server, and the video server returns the first video stream to the user terminal.
- the video server needs to first send the first video stream to the core network server.
- the core network server needs to perform rate limiting processing on the first video stream.
- the core network server determines the sampling result according to the first video stream, and determines the incoming rate of receiving the first video stream according to the sampling result; determines the outgoing rate of sending the first video stream according to the incoming rate and the pre-configured speed limit percentage;
- the core network server samples the first video stream, obtains a sampling result, the sampling result includes the sampling time and the length of the data packet, and determines the incoming rate of receiving the first video stream according to the sampling time and the length of the data packet.
- the core network server receives the first video stream sent by the video server at the input rate, and sends it to the user terminal at the output rate after limiting the rate of the first video stream. During this process, according to the calculated input rate and The pre-configured rate limit percentage is used to calculate the output rate for sending the first video stream.
- the core network server caches the first video stream in the cache queue, and after determining the rate, extracts the first video stream data packet from the cache queue, and uses The output rate is used to send the first video stream to the user terminal. In this way, after limiting the rate of the first video stream, the bandwidth occupied by transmitting the video rate is reduced.
- the video stream processing method provided by the embodiment of the present application is to receive the first video stream corresponding to the video acquisition request sent by the video server by responding to the video acquisition request sent by the user terminal, and according to the first video stream and the pre-configured Speed limit percentage, determine the output rate of sending the first video stream; send the first video stream to the user terminal according to the output rate, through the embodiment of this application, according to the network bandwidth of the user terminal, limit the speed of the transmitted video stream , to reduce the bandwidth occupied by transmitting video streams, and guarantee the service quality of high-priority services such as IP voice during peak traffic periods.
- FIG. 2 shows a flow chart of steps of another embodiment of a method for processing a video stream of the present application.
- the method for processing a video stream includes:
- Step A1 judging the video data packets in the first video stream
- the core network server analyzes the first video stream to determine whether the video data packets in the first video stream are UDP (User Datagram Protocol, User Datagram Protocol) )data pack.
- UDP User Datagram Protocol, User Datagram Protocol
- Step A2 if the video data packet in the first video stream is a UDP packet, then analyze the video data packet, and record the five-tuple information of the video data packet, wherein the five-tuple information includes the IP address of the user terminal, the user terminal's Port number, IP address of the video server, port number and transport layer protocol of the video server.
- the core network server judges that the video data packet is a UDP data packet, then parse the video data packet, and record the quintuple information of the video data packet, the quintuple information includes the IP address of the user terminal, the user terminal's Port number, IP address of the video server, port number and transport layer protocol of the video server. If it is judged that the video data packet is not a UDP data packet, then the video data packet is directly sent without any processing.
- S202 Sampling the first video stream, and obtaining a sampling result, where the sampling result at least includes a sampling current timestamp, an initial timestamp of receiving the first video stream, a sampling interval, and a sampling packet length.
- the core network server samples the UDP data packet, for example, 10 times, and obtains the current timestamp of each sampling, the initial timestamp of receiving the first video stream, the sampling interval and the length of the sampling packet.
- the core network server determines that if the sampling sequence number is greater than the preset sampling times, the sampling is stopped. For example, 10 samples are preset, and if the sample exceeds 10 times, no more samples will be taken. In this embodiment of the application, the inbound rate is calculated based on the sampling results.
- the number of sampling times is not limited to 10 and can be increased or decreased, for example, a value within the range of the number of sampling times [1,100].
- the sampling interval may also take a value within the range of [50, 10000], which is not specifically limited in this embodiment of the present application.
- Sampling sequence number (current timestamp-active session entry establishment timestamp)/sampling interval
- the initial time stamp of receiving the first video stream is the establishment time stamp of the active session entry.
- the core network server calculates the incoming rate in a weighted manner according to the packet lengths in the plurality of sampling periods and the sampling interval;
- the core network server deletes the maximum value and the minimum value of the packet lengths in the plurality of sampling periods, and according to the median value of the packet lengths in the plurality of sampling periods and the The sampling interval is calculated by using a weighted average method to calculate the input rate;
- the core network server calculates the peak rate corresponding to the maximum value according to the maximum value of the packet lengths in the plurality of sampling periods, and determines the peak rate as the inbound rate .
- the user terminal will also adjust the video resolution accordingly, because the bandwidth ratio of two adjacent resolutions is about 2: 1, so the output rate is 50% of the input rate by default.
- the video stream data packets are cyclically fetched from the head of the cache queue, and the video stream data packets are sent to the user terminal.
- Step B1 comparing the number of tokens available in the token bucket and the message length of the first video stream data packet
- Step B2 if the number of available tokens is greater than or equal to the message length of the first video stream data packet, then use the token corresponding to the message length to send the first video stream data packet to the user terminal;
- Step B3 if the number of available tokens is less than the message length of the first video stream data packet, then wait for a preset duration until the number of available tokens in the token bucket is greater than or equal to the message length of the first video stream data packet, Then use the available token to send the first video stream data packet to the user terminal.
- the number of available tokens is greater than the packet length, that is, the packet length of the first video stream data packet, for example, 1500 bytes
- the number of tokens is reduced by the token number of the packet length, for example, the order of reducing the packet length by 1500 bytes card
- use 1500 tokens to send the current packet and then take a first video stream data packet from the head of the cache queue, and judge the first video stream data packet and the remaining token number, if If the number of remaining tokens is less than the message length of the first video stream data packet, the packet sending operation cannot be performed, and the first video stream data packet needs to be stored with quintuple information, that is, a new entry is added in the hash table, After waiting the timer for 4ms, if the number of tokens is greater than the message length of the first video stream data packet at this time, the packet can be sent.
- Fig. 3 is a schematic diagram of the system structure of the present application.
- the embodiment of the present application is applied to the scene 100 of video stream speed limit, and a TC module 131 (Traffic Controller, flow control) is added on the core network server module), XDPI module 132 (extended depth packet analysis module) and QUICO module 133 (video optimization module).
- the TC module manages the next hop of the traffic according to the policy configuration.
- the TC module calls the XDPI module to identify the QUIC video stream, and the QUICO module functions to track and manage the QUIC video stream.
- the QUICO module can track and manage the video stream, not limited to the QUIC video stream.
- the QUICO module builds streams according to five elements for the identified video streams, and builds a cache queue for the streams to cache the downlink traffic transmitted from the server to the user terminal. Then start to sample the downlink inbound rate 10 times (each test cycle can last for 200ms-1000ms). In the sampling stage, the outbound rate of downlink traffic is limited. The rate can be set to 10Mbps-40Mbps. The part of the intercepted video stream that does not exceed the initial rate limit is allowed to pass, and the part that exceeds the initial rate limit needs to be cached.
- the TC module After completing the input rate sampling, set the downlink output rate according to 50% of the input rate, and start to limit the transmission rate of the intercepted encrypted video stream.
- the TC module directly sends the message to the BGW160 (border gateway) to access the public network transparent transmission operation.
- the user terminal UE110 detects the change of the network rate, triggers the ABR technology (Adaptive Bit Rate, adaptive bit stream) to select low-resolution video files, and sends the video to the AGW120 (Access Gate Way, access gateway) request, the AGW sends the video request to the core network server, and the core network server obtains video data from the video server INTERNET170 according to the video request, limits the speed of the received video data, and then sends it to the user terminal.
- ABR technology Adaptive Bit Rate, adaptive bit stream
- AGW120 Access Gate Way, access gateway
- the embodiment of the present application is deployed in the core network, and the core network connects the Internet users, that is, the user terminal and the public network server.
- the TC module calls the XDPI module to identify the QUIC video stream.
- the ClientHello packet is sent to the XDPI module.
- XDPI identifies the SNI field. If the SNI is a video website that supports QUIC, use the quintuple information to create a flow table for the current video stream. . After the flow table is established, the downlink video stream is intercepted and buffered. First, multiple samplings are performed on the inflow rate of the video. After the inflow rate sampling is completed, the outflow rate of the video is limited according to the value of the inflow rate and the pre-configured rate limit percentage. Trigger the client ABR technology to take effect and reduce the video resolution.
- FIG. 4 is a schematic diagram of the internal main components of the QUICO module of the present application.
- the internal components of the QUICO module 133 include an active session table 210 for recording session control information and caching session messages ;
- the input rate sampling module 220 is used for the input rate sampling of the session. After completing the input rate sampling, the video outflow rate is limited according to the value of the input rate and the pre-configured speed limit percentage; and the output rate limit result;
- Hash table 230 for storing information of insufficient token active sessions
- the user history information table 240 is used to store the user's speed limit information, which can be used as a reference for future session speed limit.
- the scan timer 250 is used to complete functions such as sending packets at regular intervals and aging entries. For example, the entries in the hash table 230 with insufficient tokens are scanned by the scan timer 250, and if the entries in the hash table 230 have enough tokens, the packet sending operation can be performed.
- the scan timer 250 also drives the aging of the active session table 210 entry. If the session entry 20s in the active session table 210 does not have any packet sending and receiving operations, it is considered that the session has ended transmission and the session table is released.
- FIG. 5 is a flow chart of the steps of the TC module of the present application for processing video streams, as shown in Figure 3 and Figure 5, 100 corresponds to the working scene of video stream speed limit, 110 corresponds to the mobile client accessing the QUIC video server, 120 is The Access Gate Way access gateway connects wireless traffic to the core network.
- Traffic enters the intermediate system 130 for optimization.
- the Traffic Controller (TC, traffic controller) of the TC module 131 is required to identify and distribute traffic.
- the TC module 131 sends the UDP packet to the XDPI (Extended Depth Message Analysis Module) 132 to identify the video stream of the QUIC video optimization module through policy configuration.
- the policy configuration specifically includes analyzing the message and judging the message type, such as mail Still video, download optimization, and return a digital identifier corresponding to the message type to the TC module 131 according to different message types.
- the identification process of the QUIC video stream is shown in Figure 5.
- the identification process includes:
- Step 320 After the TC module receives the message, it judges whether it is a UDP packet, if it is not a UDP packet, then execute step 370, if it is a UDP packet, then the TC module parses the quintuple of the message, wherein the quintuple includes the source IP address , destination IP address, source port number, destination port number and protocol type, and execute step 330;
- Step 330 The TC module queries the local flow table; for the first packet, a new flow table needs to be created for storage. If it is a subsequent packet, it needs to be matched with the quintuple information corresponding to the first packet. If it hits the flow table, that is to say, the subsequent If the quintuple information of the packet is the same as the quintuple information of the first packet, step 340 is performed, and if there is no match, then step 350 is performed;
- Step 340 The TC module judges whether to continue to send packets to the XDPI module. If it continues to send packets, it forwards the current packet to the XDPI module and executes step 350; module, execute step 360;
- Step 350 XDPI module performs processing; after XDPI processing, three results will be returned, if it is identified as a QUIC video stream, execute step 352; if it identifies a non-QUIC video stream, execute step 370; if the identification is not completed, it is necessary to continue parsing the packet, and execute step 351 , and then the current packet is sent to the QUICO module, and step 370 is executed.
- Step 360 QUICO module processing
- Step 351 Create a new flow entry and set the flag for continuing to send packets
- Step 352 create a new flow entry; execute step 360;
- Step 370 Do not process the QUICO module
- FIG. 6 is a flow chart of steps for the QUICO module of the present application to process video streams. As shown in FIG. 6 , it shows the QUIC video message, that is, the optimized processing flow after the first video stream data packet enters the QUICO module, Specifically include:
- Step 420 query the active session table, if the quintuple information of the subsequent packet is identical to the quintuple information of the first packet when hitting, then perform step 421; if there is no hit, then perform step 424;
- Step 421 input rate sampling processing;
- the active session table includes the five-tuple information of the message and the type of action performed, and the active session table is the same table as the flow table in the previous embodiment, but in different modules Different names are used to distinguish them.
- Step 422 cache the message, that is, the first video stream, into the AST cache queue of the session table;
- Step 423 cyclically fetching packets from the head of the buffer queue in the session table and sending them.
- Step 424 adding an active session entry
- Step 425 initialize the control information of the newly added session entry, the control information includes the incoming rate, outgoing rate and session duration;
- Step 426 Query the user history information table 240 according to the IP address of the user terminal, and obtain the historical CIR and CBS as a reference factor to initially limit the speed of the first video stream.
- Step 430 comparing available token number and packet length in the token bucket, i.e. the length of the data packet of the first video stream;
- Step 431 if the number of tokens is less than the packet length, use the quintuple as the Key value, add an entry in the hash table GTS, and wait for the 4ms timer to periodically scan and send packets.
- Step 432 if the number of tokens is greater than the packet length (for example, 1500 bytes), the number of tokens is reduced by tokens of the packet length, and step 433 is performed;
- step 433 the current packet is sent out, and then step 423 (taking another packet from the head of the cache queue) is executed to determine the sending of the packet.
- Fig. 7 is a flow chart of the steps of another video stream processing method embodiment of the present application, as shown in Fig. 7, including:
- Step 520 judging whether rate sampling is required
- Step 521 calculate the rate sampling index index, that is, the sampling sequence number
- Sampling sequence number (current timestamp-active session entry establishment timestamp)/sampling interval
- Step 530 if it is determined that 10 samples have been taken, then determine whether the sampling sequence number is greater than 10. If the sampling sequence number is ⁇ 10, continue the sampling process.
- Step 531 if the sampling number > 10, no more sampling is performed, and the sampling end flag is set;
- Step 540 judging whether the index sampling sequence number is the previous sampling sequence number
- Step 541 Accumulate the current packet length into the input rate array.
- the current packet is the start of a new sampling interval
- Step 542 add the message length (number of packets+packet length) into the cache queue.
- Step 532 calculate the input rate, adopting a weighted average method.
- Step 533 Calculate the rate. After knowing the in-rate of the session, assume that the in-rate is the bandwidth actually required to play the video. If the bandwidth is scaled down, the client will also adjust the video resolution accordingly. Due to the two The bandwidth ratio of adjacent resolutions is about 2:1, so the default output rate is 50% of the input rate.
- step 533 (calculate the rate)
- a token bucket is set for the current session, and the CIR and CBS are calculated using the output rate.
- the working process of the token bucket on the speed limit is as shown in step 423, step 430, step 431, step 432, and step 433.
- the video stream processing method provided by the embodiment of the present application is to receive the first video stream corresponding to the video acquisition request sent by the video server by responding to the video acquisition request sent by the user terminal, and according to the first video stream and the pre-configured Speed limit percentage, determine the output rate of sending the first video stream; send the first video stream to the user terminal according to the output rate, through the embodiment of this application, according to the network bandwidth of the user terminal, limit the speed of the transmitted video stream , to reduce the bandwidth occupied by transmitting video streams, and guarantee the service quality of high-priority services such as IP voice during peak traffic periods.
- Another embodiment of the present application provides an apparatus for processing a video stream, configured to execute the video stream processing method provided in the foregoing embodiments.
- FIG. 8 it shows a structural block diagram of an embodiment of a device for processing video streams of the present application.
- the device may specifically include the following modules: an acquisition module 801, a speed limit module 802, and a sending module 803, wherein:
- the acquisition module 801 is configured to receive the first video stream corresponding to the video acquisition request sent by the video server in response to the video acquisition request sent by the user terminal;
- the rate limiting module 802 is configured to determine the output rate for sending the first video stream according to the first video stream and a pre-configured rate limit percentage;
- the sending module 803 is configured to send the first video stream to the user terminal according to the output rate.
- the video stream processing device receives the first video stream corresponding to the video acquisition request sent by the video server in response to the video acquisition request sent by the user terminal, and according to the first video stream and the pre-configured Speed limit percentage, determine the output rate of sending the first video stream; send the first video stream to the user terminal according to the output rate, through the embodiment of this application, according to the network bandwidth of the user terminal, limit the speed of the transmitted video stream , to reduce the bandwidth occupied by transmitting video streams, so that other services on the terminal can also run normally at the same time.
- Yet another embodiment of the present application makes further supplementary descriptions of the apparatus for processing video streams provided in the foregoing embodiments.
- the speed limiting module is used for:
- the rate limiting module is used to:
- Sampling the first video stream, and obtaining a sampling result the sampling result at least includes sampling the current timestamp, the initial timestamp of receiving the first video stream, and a sampling interval;
- sampling sequence number is greater than the preset sampling times, the sampling is stopped.
- the sampling result also includes the length of the sampled message, and the rate limiting module is specifically used for:
- the sending module is used to:
- the video stream data packets are cyclically fetched from the head of the cache queue, and the video stream data packets are sent to the user terminal.
- the sending module is also used for:
- the first video stream data packet is sent to the user terminal using a token corresponding to the message length;
- the card sends the first video stream data packet to the user terminal.
- the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
- the video stream processing device receives the first video stream corresponding to the video acquisition request sent by the video server in response to the video acquisition request sent by the user terminal, and according to the first video stream and the pre-configured Speed limit percentage, determine the output rate of sending the first video stream; send the first video stream to the user terminal according to the output rate, through the embodiment of this application, according to the network bandwidth of the user terminal, limit the speed of the transmitted video stream , to reduce the bandwidth occupied by transmitting video streams, so that other services on the terminal can also run normally at the same time.
- An embodiment of the present application provides a server, configured to execute the video stream processing method provided in the foregoing embodiments.
- FIG. 9 is a schematic structural diagram of a server according to an embodiment of the present application. As shown in FIG. 9, the server includes: at least one processor 901 and a memory 902;
- the memory stores a computer program; and at least one processor executes the computer program stored in the memory, so as to implement the video stream processing method provided in the foregoing embodiments.
- the terminal device receives the first video stream corresponding to the video acquisition request sent by the video server in response to the video acquisition request sent by the user terminal, and according to the first video stream and the pre-configured speed limit percentage, Determine the output rate for sending the first video stream; send the first video stream to the user terminal according to the output rate, through the embodiment of the application, according to the network bandwidth of the user terminal, limit the speed of the transmitted video stream to reduce transmission
- the bandwidth occupied by the video stream enables other services on the terminal to run normally at the same time.
- Another embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed, the method for processing a video stream provided by any of the above-mentioned embodiments is implemented.
- the computer-readable storage medium of this embodiment by responding to the video acquisition request sent by the user terminal, receiving the first video stream corresponding to the video acquisition request sent by the video server, according to the first video stream and the pre-configured limit Speed percentage, determine the output rate of sending the first video stream; send the first video stream to the user terminal according to the output rate, through the embodiment of the application, according to the network bandwidth of the user terminal, limit the speed of the transmitted video stream, In order to reduce the bandwidth occupied by transmitting video streams, other services on the terminal can also run normally at the same time.
- embodiments of the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiment of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, electronic devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general-purpose computer, special purpose computer, embedded processor, or processor of other programmable data-processing electronics to produce a machine such that instructions executed by the processor of the computer or other programmable data-processing electronics Produce means for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
- These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing electronic device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the The instruction means implements the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Multimedia (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请实施例涉及视频流技术领域,提供了一种视频流的处理方法、装置、服务器和存储介质,所述方法包括:响应于用户终端发送的视频获取请求,接收视频服务器发送的与视频获取请求对应的第一视频流;根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;根据出速率向用户终端发送第一视频流。
Description
交叉引用
本申请基于申请号为“202111076410.0”、申请日为2021年9月14日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以引入方式并入本申请。
本申请涉及视频流技术领域,特别涉及一种视频流的处理方法、装置、服务器和存储介质。
传统的视频流大部分采用TCP(Transmission Control Protocol,传输控制协议)协议传输,但是采用TCP协议进行视频流传输存在固有缺陷例如队头阻塞等问题,传输效率降低。基于此,出现了QUIC传输协议来替代TCP,随着QUIC协议的标准化,QUIC协议取代TCP的进程越来越快。主流视频网站已经开始使用QUIC协议承载视频流。
QUIC视频流在现网流量中所占的比重快速增长,在通讯流量高峰期,QUIC视频流抢占了大量的核心网带宽和服务器资源,这样,就会降低高优先级业务的服务质量,例如,流量高峰期传输QUIC视频流又占用了大量的网络带宽,可能影响高优先级且对延时敏感的业务,包括运营商提供的IP语音服务、网页浏览等。
发明内容
本申请实施例提供一种视频流的处理方法,包括:响应于用户终端发送的视频获取请求,接收视频服务器发送的与所述视频获取请求对应的第一视频流;根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出 速率;根据所述出速率向所述用户终端发送所述第一视频流。
本申请实施例还提供一种视频流的处理装置,包括:获取模块,用于响应于用户终端发送的视频获取请求,接收视频服务器发送的与所述视频获取请求对应的第一视频流;限速模块,用于根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;发送模块用于根据所述出速率向所述用户终端发送所述第一视频流。
本申请实施例还提供一种服务器,包括:至少一个处理器和存储器;所述存储器存储计算机程序;所述至少一个处理器执行所述存储器存储的计算机程序,以实现上述视频流的处理方法。
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,所述计算机程序被执行时实现上述视频流的处理方法。
图1是本申请实施例的一种视频流的处理方法实施例的步骤流程图;
图2是本申请实施例的另一种视频流的处理方法实施例的步骤流程图;
图3是本申请实施例的系统结构的示意图;
图4是本申请实施例的QUICO模块内部主要组成部分示意图;
图5是本申请实施例的TC模块处理视频流的步骤流程图;
图6是本申请实施例的QUICO模块处理视频流的步骤流程图;
图7是本申请的又一种视频流的处理方法实施例的步骤流程图;
图8是本申请的一种视频流的处理装置实施例的结构框图;
图9是本申请的一种服务器实施例的结构示意图。
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。
本申请实施例提供了一种视频流的处理方法、装置、服务器和存储介质,以避免或减少上述在通讯流量高峰期QUIC视频流对其他业务的影响。
本申请实施例提供的视频流的处理方法、装置、服务器和存储介质,通过响应于用户终端发送的视频获取请求,接收视频服务器发送的与视频获取请求对应的第一视频流,并根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;根据出速率向用户终端发送第一视频流,通过本申请实施例,根据用户终端的网络带宽情况,对传输的QUIC视频流进行限速,触发用户终端主动降低分辨率,以减少传输QUIC视频流占用的带宽,在流量高峰期保障IP语音等高优先级业务的服务质量。
本申请实施例提供一种视频流的处理方法,用于对视频流进行限速处理。本实施例的执行主体为视频流的处理装置,设置在核心网服务器上。
参照图1,示出了本申请的一种视频流的处理方法实施例的步骤流程图,具体可以包括如下步骤:
S101、响应于用户终端发送的视频获取请求,接收视频服务器发送的与视频获取请求对应的第一视频流。
具体地,用户终端向视频服务器发送视频获取请求,视频服务器向用户终端返回第一视频流,在此过程中,需要视频服务器先将第一视频流发送至核心网服务器,若在流量高峰期,核心网服务器需要对第一视频流进行限速处理。
S102、根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;
具体地,核心网服务器根据第一视频流确定采样结果,并根据采样结果确定接收第一视频流的入速率;根据入速率和预先配置的限速百分比,确定发送第一视频流的出速率;
核心网服务器对第一视频流进行采样,获取采样结果,该采样结果包括采样时间和数据包的长度,并根据采样时间和数据包的长度,确定接收第一视频流的入速率。
也就是说,核心网服务器以入速率接收视频服务器发送的第一视频流,在对第一视频流限速后,以出速率发送至用户终端,在此过程中,根据计算得到的入速率和预先配置的限速百分比,计算发送第一视频流的出速率。
S103、根据出速率向用户终端发送第一视频流。
具体地,核心网服务器在接收到视频服务器发送的第一视频流,将该第一 视频流缓存在缓存队列中,在确定出速率后,从缓存队列中提取第一视频流数据包,并以出速率向用户终端发送第一视频流,这样,通过对第一视频流限速后,减少了传输视频率占用的带宽。
本申请实施例提供的视频流的处理方法,通过响应于用户终端发送的视频获取请求,接收视频服务器发送的与视频获取请求对应的第一视频流,根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;根据出速率向用户终端发送第一视频流,通过本申请实施例,根据用户终端的网络带宽情况,对传输的视频流进行限速,以减少传输视频流占用的带宽,在流量高峰期保障IP语音等高优先级业务的服务质量。
在一个实施例中,如图2所示,示出了本申请的另一种视频流的处理方法实施例的步骤流程图,该视频流的处理方法包括:
S201、响应于用户终端发送的视频获取请求,接收视频服务器发送的与视频获取请求对应的第一视频流;
具体包括:
步骤A1、对第一视频流中的视频数据包进行判断;
具体地,核心网服务器在接收到视频服务器发送的第一视频流后,对第一视频流中进行解析,判断第一视频流中的视频数据包是否为UDP(User Datagram Protocol,用户数据报协议)数据包。
步骤A2、若第一视频流中的视频数据包为UDP包,则解析视频数据包,并记录视频数据包的五元组信息,其中,五元组信息包括用户终端的IP地址,用户终端的端口号,视频服务器的IP地址,视频服务器的端口号和传输层协议。
具体地,核心网服务器若判断视频数据包为UDP数据包,则解析该视频数据包,并记录该视频数据包的五元组信息,该五元组信息包括用户终端的IP地址,用户终端的端口号,视频服务器的IP地址,视频服务器的端口号和传输层协议。若判断视频数据包不是UDP数据包,则将该视频数据包直接发送,不做任何处理。
S202、对第一视频流进行采样,获取采样结果,采样结果至少包括采样当前时间戳、接收第一视频流的初始时间戳、采样间隔和采样报文长度。
具体地,核心网服务器对UDP数据包进行采样,例如,可以采样10次, 并获取每次采样的当前时间戳、接收第一视频流的初始时间戳,采样间隔和采样报文长度。
根据采样当前时间戳、初始时间戳和采样间隔,确定采样序号。
具体地,核心网服务器判断若采样序号大于预设采样次数,则停止采样。例如,预先设定采样10次,若采样超过10次则不再采样。本申请实施例中通过采样结果来计算入速率。
采样次数不限于10次可以增加或减少,例如采样次数[1,100]的范围内取值。采样间隔也可以在[50,10000]范围内取值,在本申请实施例中不做具体限定。
具体计算采样序号的方式为:
采样序号=(当前时间戳-活动会话表项建立时间戳)/采样间隔;
其中,接收第一视频流的初始时间戳即为活动会话表项建立时间戳。
根据采样序号来判断,是否结束采样。
S203、根据采样结果确定接收第一视频流的入速率;
具体地,作为一种可选的实施方式,核心网服务器根据所述多个采样周期内的报文长度和所述采样间隔,采用加权方式计算得到所述入速率;
作为另一种可选的实施方式,核心网服务器删除所述多个采样周期内的报文长度中的最大值和最小值,根据所述多个采样周期内的报文长度的中间值和所述采样间隔,采用加权平均的方式计算所述入速率;
作为再一种可选地实施方式,核心网服务器根据所述多个采样周期内的报文长度中的最大值,计算最大值对应的峰值速率,并将所述峰值速率确定为所述入速率。
S204、根据预先配置的限速百分比和入速率,确定发送第一视频流的出速率。
示例性地,假设入速率是播放视频实际需要的带宽,如果对带宽按比例的缩小,那么用户终端也会对视频分辨率进行相应调整,由于两个相邻分辨率的带宽比约为2:1,所以出速率默认采用入速率的50%。
S205、将接收到的第一视频流预先保存在缓存队列中;
S206、根据出速率,确定生成令牌的速度和令牌桶的大小;
S207、根据生成令牌的速度和令牌桶的大小,从缓存队列的头部开始循环 取视频流数据包,将视频流数据包发送至用户终端。
具体包括:
步骤B1、比较令牌桶中可用令牌数和第一视频流数据包的报文长度;
步骤B2、若可用令牌数大于或等于第一视频流数据包的报文长度,则采用与报文长度对应的令牌将第一视频流数据包发送至用户终端;
步骤B3、若可用令牌数小于第一视频流数据包的报文长度,则等待预设时长,直到令牌桶中的可用令牌数大于或等于第一视频流数据包的报文长度,再采用可用令牌向用户终端发送第一视频流数据包。
示例性地,如果可用令牌数大于包长度即第一视频流数据包的报文长度,例如1500个字节,令牌数减少报文长度的令牌数,例如减少1500个字节的令牌,然后采用1500个令牌将当前包发送出去,然后再从缓存队列的头部取下一个第一视频流数据包,并对第一视频流数据包和剩余的令牌数进行判断,如果剩余令牌数小于第一视频流数据包的报文长度,则无法进行发包操作,需要将该第一视频流数据包以五元组信息进行保存,即在哈希表中新增表项,等待定时器4ms后,若此时令牌数的数量大于第一视频流数据包的报文长度后,则可以进行发包。
在一个实施例中,图3本申请的系统结构的示意图,如图3所示,本申请实施例应用于视频流限速场景100,在核心网服务器上增加TC模块131(Traffic Controller,流量控制模块)、XDPI模块132(扩展深度报文解析模块)和QUICO模块133(视频优化模块)。TC模块依据策略配置对流量的下一跳进行管理,TC模块调用XDPI模块识别QUIC视频流,QUICO模块起到跟踪和管理QUIC视频流的功能。如果设置XDPI模块为识别视频流,那么QUICO模块可以对视频流进行跟踪和管理,不仅限于QUIC视频流。QUICO模块为已识别的视频流按照五元组建流,并为该流建立缓存队列,缓存从服务器传输到用户终端的下行流量。然后开始对下行入速率进行10次入速率采样(每个测试周期可以持续200ms-1000ms)。采样阶段对下行流量的出速率进行基础限速,限速速率可以设置为10Mbps-40Mbps,截获视频流不超过初始限速速率部分允许通过,超出初始限速速率的部分需要缓存。完成入速率采样后按入速率的50%设置下行出速率,开始对截获的加密视频流传输速率限速。TC模块将报文直接发送给 BGW160(边界网关)访问公网透传操作。
经过QUICO的限速后,用户终端UE110检测到网络速率的变化,触发ABR技术(Adaptive Bit Rate,自适应比特流)选择低分辨率视频文件,向AGW120(Access Gate Way,接入网关)发送视频请求,AGW再将该视频请求发送至核心网服务器,核心网服务器根据该视频请求从视频服务器INTERNET170上获取视频数据,对接收到的视频数据进行限速,然后发送至用户终端。
本申请实施例部署于核心网中,核心网对接着上网用户即用户终端和公网服务器。TC模块调用XDPI模块识别QUIC视频流,在视频流初始化阶段,将ClientHello包发送给XDPI模块,XDPI识别SNI字段,如果SNI是支持QUIC的视频网站,使用五元组信息为当前视频流建立流表。建立流表后截获并缓存下行视频流。首先针对视频流入速率进行多次采样,完成入速率采样后依据入速率的值和预先配置的限速百分比对视频流出速率进行限速。触发客户端ABR技术生效,降低视频分辨率。
在一个实施例中,图4是本申请的QUICO模块内部主要组成部分示意图,如图4所示,该QUICO模块133的内部组件包括活动会话表210,用于记录会话控制信息和缓存会话报文;
入速率采样模块220,用于会话的入速率采样,完成入速率采样后依据入速率的值和预先配置的限速百分比对视频流出速率进行限速;并输出限速结果;
哈希表230,用于存储令牌不足活动会话的信息;
用户历史信息表240,用于存储用户的限速信息,可以作为未来会话限速的参考。
扫描定时器250用于完成定时发包,表项老化等功能。例如哈希表230中令牌不足的表项被扫描定时器250驱动扫描,哈希表230中的项如果有足够的令牌可以进行发包操作。扫描定时器250同样驱动活动会话表210表项的老化,如果活动会话表210中的会话表项20s没有任何收发包的操作,则认为该会话已结束传输,释放会话表。
会话表删除表项时调用更新用户历史信息表240的流程,如果用户历史信息表240有该UEIP(用户终端IP)对应的表项,则更新用户历史信息表240中表项的结果,主要是本次限速令牌产生的速率CIR(Committed Information Rate,令牌产生的速率)、CBS(Committed Burst Size,令牌桶的大小):和历史CIR、CBS进行加权平均。
图5是本申请的TC模块处理视频流的步骤流程图,结合图3和图5所示,100对应的是视频流限速的工作场景,110对应的手机客户端访问QUIC视频服务器,120是Access Gate Way接入网关将无线流量接入核心网。
流量进入中间系统130进行优化,首先需要TC模块131的Traffic Controller(TC,流量控制器)进行流量识别和分发。TC模块131通过策略配置将UDP包发往XDPI(扩展深度报文解析模块)132进行QUIC视频优化模块视频流的识别,该策略配置具体包括对报文进行解析,判断报文类型,例如是邮件还是视频,下载优化,根据不同的报文类型,向TC模块131返回一个与报文类型对应的数字标识。
QUIC视频流的识别过程如图5所示,该识别过程包括:
步骤320:TC模块收到报文后,判断是否UDP包,若不是UDP包,则执行步骤370,若是UDP包,则TC模块解析报文的五元组,其中,五元组包括源IP地址、目的IP地址、源端口号、目的端口号和协议类型,并执行步骤330;
步骤330:TC模块查询本地的流表;对首包则需要新建流表进行存储,若是后续包,则需要与首包对应的五元组信息进行匹配,如果命中流表,也即是说后续包的五元组信息和首包的五元组信息相同,则执行步骤340,若未命中,则执行步骤350;
步骤340:TC模块判断是否继续发包给XDPI模块,若继续发包,则转发当前包给XDPI模块,执行步骤350;若某个业务的数据包发送完成,即不需要继续发包,当前包直接给QUICO模块,则执行步骤360;
步骤350:XDPI模块进行处理;XDPI处理后会返回3种结果,识别出是QUIC视频流执行步骤352;识别出非QUIC视频流,执行步骤370;未完成识别则需要继续解析包,执行步骤351,然后当前包发送给QUICO模块,执行步骤370。
步骤360:QUICO模块处理;
步骤351:新建流表项同时设置继续发包标志;
步骤352:新建流表项;执行步骤360;
步骤370:不进行QUICO模块处理;
在一个实施例中,图6是本申请的QUICO模块处理视频流的步骤流程图,如图6所示,显示了QUIC视频报文即第一视频流数据包进入QUICO模块后的优化处理流程,具体包括:
步骤420、查询活动会话表,若命中时即后续包的五元组信息和首包的五元组信息相同,则执行步骤421;若没有命中,则执行步骤424;
步骤421、入速率采样处理;该活动会话表中包括报文的五元组信息和执行的动作类型,该活动会话表和上个实施例中的流表是相同的表,只是在不同的模块中采用不同名称来区分。
步骤422、将报文即第一视频流缓存进会话表的AST缓存队列中;
步骤423、从会话表的缓存队列头部循环取包进行发送。
步骤424、新增活动会话表项;
步骤425、初始化新增会话表项的控制信息,该控制信息包括入速率、出速率和会话持续时间;
步骤426、根据用户终端的IP地址查询查询用户历史信息表240,获取历史CIR和CBS作为一个参考因素对第一视频流进行初始限速。
步骤430、比较令牌桶中可用令牌数和包长度,即第一视频流的数据包的长度;
步骤431、若令牌数小于包长度,以五元组为Key值,在哈希表GTS中新增表项,等待4ms定时器进行定时扫描发包。
步骤432、如果令牌数大于包长度(例如,1500个字节),令牌数减少包长度个令牌,执行步骤433;
步骤433、当前包发送出去,然后执行步骤423(从缓存队列头部再取一个包),进行发包判断。
图7是本申请的又一种视频流的处理方法实施例的步骤流程图,如图7所示,包括:
步骤520、判断是否需要进行速率采样;
步骤521、计算速率采样索引index即采样序号;
采样序号=(当前时间戳-活动会话表项建立时间戳)/采样间隔;
计算当前是第几次采样。每个流允许进行10次速率采样,采样满10次后,不再对该流进行采样。
步骤530、若判断已采样10次,则判断采样序号是否大于10。若采样序号<10继续采样处理。
步骤531、若采样序号>10不再进行采样,并设置采样结束标志;
步骤540、判断索引采样序号是否为上一次采样序号;
步骤541、将当前报文长度累加到入速率数组。
如果一个采样间隔结束了,当前包是新采样间隔的开始;
步骤542、将报文长度(包数+包长度)加入到缓存队列中。
步骤532、计算入速率,采用加权平均的方式。
步骤533、计算出速率,知道了会话的入速率后,假设入速率是播放视频实际需要的带宽,如果对带宽按比例的缩小,那么客户端也会对视频分辨率进行相应调整,由于两个相邻分辨率的带宽比约为2:1,所以出速率默认采用入速率的50%。
步骤533(计算出速率)后,为当前会话设置一个令牌桶,利用出速率计算CIR和CBS。令牌桶在限速上的工作过程如步骤423,步骤430,步骤431,步骤432,步骤433所示的步骤。
采用本申请实施例,在访问某个QUIC的视频网站,观察Connection Speed,发现播放10s后,带宽减半。观察Network Activity发现播放的前10s流量波形是一个一个的尖刺,10s后流量波形被明显平滑和限速。观察Current Res发现视频播放10s后开始降低视频分辨率。还可以使用用户终端接入网络访问QUIC视频网站,并在用户终端使用wireshark抓包,分析视频流的I/O图,看是否存在先测速再限速触发降低分辨率的表现。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优 选实施例,所涉及的动作并不一定是本申请实施例所必须的。
本申请实施例提供的视频流的处理方法,通过响应于用户终端发送的视频获取请求,接收视频服务器发送的与视频获取请求对应的第一视频流,根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;根据出速率向用户终端发送第一视频流,通过本申请实施例,根据用户终端的网络带宽情况,对传输的视频流进行限速,以减少传输视频流占用的带宽,在流量高峰期保障IP语音等高优先级业务的服务质量。
本申请另一实施例提供一种视频流的处理装置,用于执行上述实施例提供的视频流的处理方法。
参照图8,示出了本申请的一种视频流的处理装置实施例的结构框图,该装置具体可以包括如下模块:获取模块801、限速模块802和发送模块803,其中:
获取模块801用于响应于用户终端发送的视频获取请求,接收视频服务器发送的与视频获取请求对应的第一视频流;
限速模块802用于根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;
发送模块803用于根据出速率向用户终端发送第一视频流。
本申请实施例提供的视频流的处理装置,通过响应于用户终端发送的视频获取请求,接收视频服务器发送的与视频获取请求对应的第一视频流,根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;根据出速率向用户终端发送第一视频流,通过本申请实施例,根据用户终端的网络带宽情况,对传输的视频流进行限速,以减少传输视频流占用的带宽,使终端上的其他业务也可以同时正常运行。
本申请又一实施例对上述实施例提供的视频流的处理装置做进一步补充说明。
在上述实施例的基础上,可选地,所述限速模块用于:
根据所述第一视频流确定采样结果,并根据所述采样结果确定接收所述第一视频流的入速率;
根据所述预先配置的限速百分比和所述入速率,确定发送所述第一视频流 的出速率
可选地,限速模块用于:
对第一视频流进行采样,获取采样结果,采样结果至少包括采样当前时间戳、接收第一视频流的初始时间戳和采样间隔;
根据采样当前时间戳、初始时间戳和采样间隔,确定采样序号;
若采样序号大于预设采样次数,则停止采样。
可选地,所述采样结果中还包括采样报文长度,限速模块具体用于:
根据所述多个采样周期内的报文长度和所述采样间隔,采用加权方式计算得到所述入速率;
或者,
删除所述多个采样周期内的报文长度中的最大值和最小值,根据所述多个采样周期内的报文长度的中间值和所述采样间隔,采用加权平均的方式计算所述入速率;
或者,
根据所述多个采样周期内的报文长度中的最大值,计算最大值对应的峰值速率,并将所述峰值速率确定为所述入速率。
可选地,发送模块用于:
将接收到的第一视频流预先保存在缓存队列中;
根据出速率,确定生成令牌的速度和令牌桶的大小;
根据生成令牌的速度和令牌桶的大小,从缓存队列的头部开始循环取视频流数据包,将视频流数据包发送至用户终端。
可选地,发送模块还用于:
比较令牌桶中可用令牌数和第一视频流数据包的报文长度;
若可用令牌数大于或等于第一视频流数据包的报文长度,则采用与报文长度的对应的令牌将第一视频流数据包发送至用户终端;
若可用令牌数小于第一视频流数据包的报文长度,则等待预设时间,直到令牌桶中的可用令牌数大于等于第一视频流数据包的报文长度,再采用可用令牌向用户终端发送第一视频流数据包。
需要说明的是,本实施例中各可实施的方式可以单独实施,也可以在不冲 突的情况下以任意组合方式结合实施本申请不做限定。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本申请实施例提供的视频流的处理装置,通过响应于用户终端发送的视频获取请求,接收视频服务器发送的与视频获取请求对应的第一视频流,根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;根据出速率向用户终端发送第一视频流,通过本申请实施例,根据用户终端的网络带宽情况,对传输的视频流进行限速,以减少传输视频流占用的带宽,使终端上的其他业务也可以同时正常运行。
本申请一实施例提供一种服务器,用于执行上述实施例提供的视频流的处理方法。
图9是本申请实施例的一种服务器的结构示意图,如图9所示,该服务器包括:至少一个处理器901和存储器902;
存储器存储计算机程序;至少一个处理器执行存储器存储的计算机程序,以实现上述实施例提供的视频流的处理方法。
本实施例提供的终端设备,通过响应于用户终端发送的视频获取请求,接收视频服务器发送的与视频获取请求对应的第一视频流,根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;根据出速率向用户终端发送第一视频流,通过本申请实施例,根据用户终端的网络带宽情况,对传输的视频流进行限速,以减少传输视频流占用的带宽,使终端上的其他业务也可以同时正常运行。
本申请又一实施例提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,计算机程序被执行时实现上述任一实施例提供的视频流的处理方法。
根据本实施例的计算机可读存储介质,通过响应于用户终端发送的视频获取请求,接收视频服务器发送的与视频获取请求对应的第一视频流,根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;根据出速率向用户终端发送第一视频流,通过本申请实施例,根据用户终端的网络带宽情况,对传输的视频流进行限速,以减少传输视频流占用的带宽,使终 端上的其他业务也可以同时正常运行。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请实施例是参照根据本申请实施例的方法、电子设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理电子设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理电子设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理电子设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理电子设备上,使得在计算机或其他可编程电子设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程电子设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者电子设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者电子设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者电子设备中还存在另外的相同要素。
以上对本申请所提供的一种视频流的处理方法和一种视频流的处理装置,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本申请的限制。
Claims (10)
- 一种视频流的处理方法,所述方法包括:响应于用户终端发送的视频获取请求,接收视频服务器发送的与所述视频获取请求对应的第一视频流;根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;根据所述出速率向所述用户终端发送所述第一视频流。
- 根据权利要求1所述的视频流的处理方法,其中,所述根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率,包括:根据所述第一视频流确定采样结果,并根据所述采样结果确定接收所述第一视频流的入速率;根据所述预先配置的限速百分比和所述入速率,确定发送所述第一视频流的出速率。
- 根据权利要求2所述的视频流的处理方法,其中,所述根据所述第一视频流确定采样结果,包括:对所述第一视频流进行采样,获取采样结果,所述采样结果至少包括采样当前时间戳、接收所述第一视频流的初始时间戳和采样间隔;根据所述采样当前时间戳、所述初始时间戳和所述采样间隔,确定采样序号;若所述采样序号大于预设采样次数,则停止采样。
- 根据权利要求3所述的视频流的处理方法,其中,所述采样结果中还包括采样报文长度,所述根据采样结果确定接收所述第一视频流的入速率,包括:根据所述多个采样周期内的报文长度和所述采样间隔,采用加权方式计算得到所述入速率;或者,删除所述多个采样周期内的报文长度中的最大值和最小值,根据所述多个采样周期内的报文长度的中间值和所述采样间隔,采用加权平均的方式计算所述入速率;或者,根据所述多个采样周期内的报文长度中的最大值,计算最大值对应的峰值速率,并将所述峰值速率确定为所述入速率。
- 根据权利要求1至4中任意一项所述的视频流的处理方法,其中,所述根据所述出速率向所述用户终端发送所述第一视频流,包括:将接收到的所述第一视频流预先保存在缓存队列中;根据所述出速率,确定生成令牌的速度和令牌桶的大小;根据所述生成令牌的速度和所述令牌桶的大小,从所述缓存队列的头部开始循环取视频流数据包,将所述视频流数据包发送至所述用户终端。
- 根据权利要求5所述的视频流的处理方法,其中,所述根据所述生成令牌的速度和所述令牌桶的大小,从所述缓存队列的头部开始循环取视频流数据包,将所述视频流数据包发送至所述用户终端,包括:比较所述令牌桶中可用令牌数和所述第一视频流数据包的报文长度;若所述可用令牌数大于或等于所述第一视频流数据包的报文长度,则采用与所述报文长度对应的令牌将所述第一视频流数据包发送至用户终端;若所述可用令牌数小于所述第一视频流数据包的报文长度,则等待预设时长,直到所述令牌桶中的可用令牌数大于或等于所述第一视频流数据包的报文长度,再采用所述可用令牌向所述用户终端发送所述第一视频流数据包。
- 根据权利要求1至6中任意一项所述的视频流的处理方法,其中,在所述根据所述第一视频流确定采样结果之前,所述方法还包括:若所述第一视频流中的视频数据包为UDP包,则解析所述视频数据包,并记录所述视频数据包的五元组信息;其中,所述五元组信息包括用户终端的IP地址,用户终端的端口号,视频服务器的IP地址,视频服务器的端口号和传输层协议。
- 一种视频流的处理装置,所述装置包括:获取模块,用于响应于用户终端发送的视频获取请求,接收视频服务器发送的与所述视频获取请求对应的第一视频流;限速模块,用于根据所述第一视频流和预先配置的限速百分比,确定发送所述第一视频流的出速率;发送模块,用于根据所述出速率向所述用户终端发送所述第一视频流。
- 一种服务器,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至7中任一项所述的视频流的处理方法。
- 一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的视频流的处理方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111076410.0A CN115834482A (zh) | 2021-09-14 | 2021-09-14 | 视频流的处理方法、装置、服务器和存储介质 |
CN202111076410.0 | 2021-09-14 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023040413A1 true WO2023040413A1 (zh) | 2023-03-23 |
Family
ID=85514929
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/102559 WO2023040413A1 (zh) | 2021-09-14 | 2022-06-29 | 视频流的处理方法、装置、服务器和存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115834482A (zh) |
WO (1) | WO2023040413A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117596211A (zh) * | 2024-01-18 | 2024-02-23 | 湖北省楚天云有限公司 | Ip分片多核负载均衡装置及方法 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101385070A (zh) * | 2005-09-20 | 2009-03-11 | Nxp股份有限公司 | 保持视频流的重采样或重格式化的关于帧速率的装置和方法 |
US20130332620A1 (en) * | 2012-06-06 | 2013-12-12 | Cisco Technology, Inc. | Stabilization of adaptive streaming video clients through rate limiting |
CN104301248A (zh) * | 2014-10-31 | 2015-01-21 | 杭州华三通信技术有限公司 | 报文限速方法和装置 |
CN105531968A (zh) * | 2013-09-11 | 2016-04-27 | 思科技术公司 | 基于网络的自适应速率限制 |
US20170134987A1 (en) * | 2015-11-05 | 2017-05-11 | At&T Intellectual Property I, L.P. | Wireless video download rate optimization |
-
2021
- 2021-09-14 CN CN202111076410.0A patent/CN115834482A/zh active Pending
-
2022
- 2022-06-29 WO PCT/CN2022/102559 patent/WO2023040413A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101385070A (zh) * | 2005-09-20 | 2009-03-11 | Nxp股份有限公司 | 保持视频流的重采样或重格式化的关于帧速率的装置和方法 |
US20130332620A1 (en) * | 2012-06-06 | 2013-12-12 | Cisco Technology, Inc. | Stabilization of adaptive streaming video clients through rate limiting |
CN105531968A (zh) * | 2013-09-11 | 2016-04-27 | 思科技术公司 | 基于网络的自适应速率限制 |
CN104301248A (zh) * | 2014-10-31 | 2015-01-21 | 杭州华三通信技术有限公司 | 报文限速方法和装置 |
US20170134987A1 (en) * | 2015-11-05 | 2017-05-11 | At&T Intellectual Property I, L.P. | Wireless video download rate optimization |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117596211A (zh) * | 2024-01-18 | 2024-02-23 | 湖北省楚天云有限公司 | Ip分片多核负载均衡装置及方法 |
CN117596211B (zh) * | 2024-01-18 | 2024-04-05 | 湖北省楚天云有限公司 | Ip分片多核负载均衡装置及方法 |
Also Published As
Publication number | Publication date |
---|---|
CN115834482A (zh) | 2023-03-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8307030B1 (en) | Large-scale timer management | |
US9071576B1 (en) | Application rate limiting without overhead | |
JP4392294B2 (ja) | 通信統計収集装置 | |
US8074275B2 (en) | Preventing network denial of service attacks by early discard of out-of-order segments | |
JP2020113924A (ja) | モニタリングプログラム,プログラマブルデバイス及びモニタリング方法 | |
US10043137B1 (en) | Dynamically optimized transport system | |
CN109873768B (zh) | 更新转发表的方法、硬件加速器、ovs和服务器 | |
JP2010534042A (ja) | 暗号化広域ネットワークトラフィック最適化方法 | |
WO2024060408A1 (zh) | 网络攻击检测方法和装置、设备及存储介质 | |
WO2023040413A1 (zh) | 视频流的处理方法、装置、服务器和存储介质 | |
CN110445723B (zh) | 一种网络数据调度方法及边缘节点 | |
US10523536B2 (en) | Length control for packet header sampling | |
WO2011140910A1 (zh) | 业务处理单元和方法以及业务控制网关和负载均衡方法 | |
CN104113599B (zh) | 一种缓存方法、装置及代理服务器 | |
CN107483604B (zh) | Nginx-RTMP动态更新DNS缓存的方法和装置 | |
EP1950917A1 (en) | Methods for peer-to-peer application message identifying and operating realization and their corresponding devices | |
CN101127690A (zh) | 一种下一代网络业务流量识别方法 | |
Jain et al. | Evolving to 6G: Improving the Cellular Core to lower control and data plane latency | |
JP2015164295A (ja) | 情報伝送システム、情報通信装置、情報伝送装置、及びプログラム | |
Peuhkuri | Internet traffic measurements–aims, methodology, and discoveries | |
CN101102277B (zh) | 业务数据识别控制方法、系统及识别控制装置 | |
Lübben et al. | On characteristic features of the application level delay distribution of TCP congestion avoidance | |
KR20190130766A (ko) | 네트워크 보안 방법 및 이를 수행하는 시스템 | |
KR102120795B1 (ko) | 적응적으로 패킷 저장을 수행하는 네트워크 검사 방법 및 이를 수행하는 시스템 | |
KR20140125508A (ko) | 트래픽 최적화 기능을 갖는 통신 노드 및 통신 노드에서 트래픽 최적화를 위한 방법 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22868790 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 22868790 Country of ref document: EP Kind code of ref document: A1 |