A method, apparatus, device, and medium for multiplexing a single port of a media stream

By acquiring and grouping RTP and RTCP packets of media streams, the problems of port resource waste and operation and maintenance pressure are solved, and single-port multiplexing and security improvement of data packets are achieved.

CN115665444BActive Publication Date: 2025-05-30CETC CYBERSPACE SECURITY TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211329054.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-27
Publication Date
2025-05-30
Estimated Expiration
2042-10-27

AI Technical Summary

Technical Problem

In the current network environment, opening a large number of ports has brought great workload to operation and maintenance, causing great inconvenience, and has caused waste of port resources, bringing security risks.

Method used

By obtaining the RTP packets and RTCP packets of the media stream, determining their media stream type and target user, and grouping and multiplexing the packets of all target users based on this information, multiplexing the packets of all target users on a target port for forwarding.

Benefits of technology

The single-port multiplexing of RTP packets and RTCP packets is realized, reducing the waste of port resources, reducing operation and maintenance pressure, and improving system security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115665444B_ABST
    Figure CN115665444B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, device and medium for media stream single-port multiplexing, which relates to the field of instant voice communication technology and includes: obtaining RTP data packets and RTCP data packets of a media stream; determining the media stream types of the RTP data packets and the RTCP data packets, and obtaining corresponding first data packet groups based on the media stream types; wherein each first data packet group includes RTP data packets and RTCP data packets corresponding to each media stream type; determining target users corresponding to each first data packet group, and grouping the first data packet groups based on the target users to obtain corresponding second data packet groups; wherein each second data packet group carries a corresponding target user identifier; multiplexing the second data packet groups of all target users to a target port for forwarding through the target port. Through the technical solution of the present application, media stream single-port multiplexing can be achieved to forward media stream data packets through one port.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of instant voice communication, and particularly relates to a method, device, equipment and medium for multiplexing a single port of a media stream. Background Art

[0002] With the popularization of mobile terminals, there are more and more mobile Internet users. In order to support massive users to make concurrent calls, the server needs to expose a very large number of ports externally. In the current network environment, opening a large number of ports brings a great deal of workload to operation and maintenance, causing great inconvenience. At the same time, many UDP (User Datagram Protocol) ports need to be opened in the user's usage place, which not only causes a great waste of port resources, but also brings great security risks.

[0003] In summary, how to reduce the waste of port resources and relieve the operation and maintenance pressure is an issue to be solved currently. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for multiplexing a single port of a media stream, which can reduce the waste of port resources and relieve the operation and maintenance pressure. The specific solutions are as follows:

[0005] In the first aspect, the present application discloses a method for multiplexing a single port of a media stream, including:

[0006] Obtain the RTP data packet and RTCP data packet of the media stream;

[0007] Determine the media stream types of the RTP data packet and the RTCP data packet, and obtain the corresponding first data packet group based on the media stream types; wherein, each first data packet group includes the RTP data packet and RTCP data packet corresponding to each media stream type;

[0008] Determine the target users corresponding to each first data packet group, and group the first data packet groups based on the target users to obtain the corresponding second data packet groups; wherein, each second data packet group carries the corresponding target user identifier;

[0009] Multiplex the second data packet groups of all the target users to the target port for forwarding through the target port.

[0010] Optionally, the obtaining the corresponding first data packet group based on the media stream types includes:

[0011] Group the RTP data packets and the RTCP data packets with the same media stream type by using the rtcp-mux attribute to obtain corresponding first data packet groups, so as to forward the RTP data packets and the RTCP data packets through a single port; wherein, the media stream type includes audio stream and video stream.

[0012] Optionally, the grouping the first data packet groups according to the target users to obtain corresponding second data packet groups includes:

[0013] Group all the first data packet groups corresponding to each target user by using the BUNDLE attribute to obtain corresponding second data packet groups, so as to forward the second data packet groups through a single port.

[0014] Optionally, the multiplexing the second data packet groups of all the target users to a target port for forwarding through the target port includes:

[0015] Multiplex the second data packet groups of all the target users to a target port by using the ice-ufrag attribute for forwarding through the target port.

[0016] Optionally, in the process of grouping the first data packet groups according to the target users to obtain corresponding second data packet groups, it further includes:

[0017] Add ICE data packets carrying the target user identifier to the second data packet groups; wherein, the username attribute of the ICE data packets includes the ice-ufrag attribute.

[0018] In a second aspect, the present application discloses a method for demultiplexing media streams through a single port, including:

[0019] Obtain media stream data packets, and extract target user identifiers from the media stream data packets;

[0020] Demultiplex the media stream data packets according to the target user identifiers to obtain third data packet groups corresponding to different target users;

[0021] Demultiplex all the data packets in the third data packet groups to obtain fourth data packet groups corresponding to different media stream types; wherein, each fourth data packet group includes RTP data packets and RTCP data packets corresponding to each media stream type;

[0022] Demultiplex the fourth data packet groups to obtain RTP data packets and RTCP data packets of the media stream.

[0023] Optionally, demultiplexing all the data packets in the third data packet group to obtain a fourth data packet group corresponding to different media stream types includes:

[0024] Demultiplexing all the data packets in the third data packet group based on the mid header extension in the RTP data packet to obtain a fourth data packet group corresponding to an audio stream and a video stream respectively.

[0025] In a third aspect, the present application discloses a media stream single-port multiplexing device, including:

[0026] A data packet acquisition module, configured to acquire RTP data packets and RTCP data packets of a media stream;

[0027] A first multiplexing module, configured to determine the media stream types of the RTP data packets and the RTCP data packets, and obtain corresponding first data packet groups based on the media stream types; wherein each first data packet group includes RTP data packets and RTCP data packets corresponding to each media stream type;

[0028] A second multiplexing module, configured to determine target users corresponding to each first data packet group, and group the first data packet groups based on the target users to obtain corresponding second data packet groups; wherein each second data packet group carries a corresponding target user identifier;

[0029] A third multiplexing module, configured to multiplex the second data packet groups of all the target users to a target port for forwarding through the target port.

[0030] In a fourth aspect, the present application discloses an electronic device, including:

[0031] A memory, configured to store a computer program;

[0032] A processor, configured to execute the computer program to implement the steps of the media stream single-port multiplexing method disclosed above.

[0033] In a fifth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program; wherein the computer program, when executed by a processor, implements the steps of the media stream single-port multiplexing method disclosed above.

[0034] It can be seen that in this application, the RTP data packets and RTCP data packets of the media stream are obtained; the media stream types of the RTP data packets and the RTCP data packets are determined, and corresponding first data packet groups are obtained based on the media stream types; wherein, each of the first data packet groups includes the RTP data packets and RTCP data packets corresponding to each of the media stream types; the target users corresponding to each of the first data packet groups are determined, and the first data packet groups are grouped based on the target users to obtain corresponding second data packet groups; wherein, each of the second data packet groups carries a corresponding target user identifier; all the second data packet groups of the target users are multiplexed to a target port for forwarding through the target port. Thus, in this application, first data packet groups including RTP data packets and RTCP data packets corresponding to each media stream type are obtained according to the media stream types, then second data packet groups corresponding to each target user are obtained according to the target users, and then all the second data packet groups of the target users are multiplexed to the target port. That is, single-port multiplexing of RTP data packets and RTCP data packets is achieved; single-port multiplexing of multiple media stream data packets of the same target user is achieved; single-port multiplexing of media stream data packets of different target users is achieved. In this way, all media stream data packets can be forwarded using one target port, reducing the waste of port resources and alleviating the operation and maintenance pressure. Description of the Drawings

[0035] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0036] Figure 1 It is a flowchart of a media stream single-port multiplexing method disclosed in the present application;

[0037] Figure 2 It is a flowchart of a specific media stream single-port multiplexing method disclosed in the present application;

[0038] Figure 3 It is a schematic diagram of a media stream single-port multiplexing disclosed in the present application;

[0039] Figure 4 It is a flowchart of a media stream single-port demultiplexing method disclosed in the present application;

[0040] Figure 5 It is a schematic diagram of a media stream single-port demultiplexing disclosed in the present application;

[0041] Figure 6Structural schematic diagram of a media stream single-port multiplexing device disclosed in this application;

[0042] Figure 7 Structural diagram of an electronic device disclosed in this application. Detailed implementation manners

[0043] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0044] With the popularization of mobile terminals, there are more and more mobile Internet users. To support a large number of users in concurrent calls, the server needs to expose a very large number of ports externally. In the current network environment, opening a large number of ports brings a huge workload to operation and maintenance, causing great inconvenience. At the same time, many UDP ports need to be opened in the user's usage place, which not only causes a great waste of port resources, but also brings great security risks. For this reason, the embodiments of this application disclose a media stream single-port multiplexing method, device, equipment and medium, which can reduce the waste of port resources and relieve the operation and maintenance pressure.

[0045] See Figure 1 As shown, the embodiments of this application disclose a media stream single-port multiplexing method, and the method includes:

[0046] Step S11: Obtain RTP data packets and RTCP data packets of the media stream.

[0047] In this embodiment, first, obtain the RTP (Real-time Transport Protocol) data packets and RTCP (Real-time Transport Control Protocol) data packets of the media stream. It should be noted that the RTP protocol is one of the core protocols of VoIP (Voice over Internet Protocol), providing an end-to-end network transmission function for transmitting real-time data (such as audio and video), and is widely used in the transmission of multimedia data packets, such as voice and video calls over the IP network; the RTP protocol is generally used together with the RTCP protocol, and the RTCP protocol is responsible for out-of-band management of the communication and session of RTP (such as flow control, congestion control, session source management, etc.). And VoIP is a technology for making voice calls via the Internet. VoIP Internet phones convert voice signals through digital processing, compression encoding, encryption and packaging, transmit them through the network, then decrypt and decode them, and restore the digital signals into sounds so that the other party of the call can hear.

[0048] Step S12: Determine the media stream types of the RTP data packets and the RTCP data packets, and obtain corresponding first data packet groups based on the media stream types; wherein, each of the first data packet groups includes RTP data packets and RTCP data packets corresponding to each of the media stream types.

[0049] In this embodiment, determine the media stream types of the RTP data packets and the RTCP data packets respectively, and group these RTP data packets and RTCP data packets based on the media stream types to obtain corresponding first data packet groups. It can be understood that for each media stream type, there will be corresponding RTP data packets and RTCP data packets. In the prior art, the RTP data packets and the RTCP data packets are transmitted through different ports respectively. In the embodiment of the present application, the RTP data packets and the RTCP data packets corresponding to each media stream type are divided into one group so as to transmit the RTP data packets and the RTCP data packets through the same port, so as to multiplex the RTP data packets and the RTCP data packets to the same port, that is, to realize the multiplexing of RTCP and RTP.

[0050] Step S13: Determine the target users corresponding to each of the first data packet groups, and group the first data packet groups based on the target users to obtain corresponding second data packet groups; wherein, each of the second data packet groups carries the corresponding target user identifier.

[0051] In this embodiment, the target users corresponding to each first data packet group are determined, and all the first data packet groups of the same target user are grouped together to obtain second data packet groups. It can be understood that for each target user, there are data packets of different media stream types, such as audio type and video type. In the prior art, the data packets of audio type and the data packets of video type are transmitted through different ports respectively. However, in the embodiment of the present application, all the data packets of all media stream types of each target user are grouped together so as to transmit all the data packets of the target user through the same port, that is, to multiplex the multi-channel audio and video media streams of a single target user to one port.

[0052] Step S14: Multiplex the second data packet groups of all the target users to a target port for forwarding through the target port.

[0053] In this embodiment, the second data packet groups of all the target users are multiplexed to a target port for forwarding through the target port. In this way, the data packets of all users are forwarded through one port, realizing the single-port multiplexing of the media streams of different target users.

[0054] It should be noted that SDP (Session Description Protocol) negotiation needs to be performed before receiving and sending RTP packets. Usually, the server negotiates a dynamic port through the SDP protocol for forwarding RTP packets to the client. It has good scalability and no port limit for a single server. The Session Description Protocol is one of the core protocols of VoIP, mainly used to describe multimedia sessions, and its uses include session declaration, session invitation, session initialization, etc.

[0055] It can be seen that in this application, the RTP data packets and RTCP data packets of the media stream are obtained; the media stream types of the RTP data packets and the RTCP data packets are determined, and a corresponding first data packet group is obtained based on the media stream types; wherein each first data packet group includes the RTP data packets and RTCP data packets corresponding to each media stream type; the target user corresponding to each first data packet group is determined, and the first data packet groups are grouped based on the target user to obtain corresponding second data packet groups; wherein each second data packet group carries a corresponding target user identifier; all the second data packet groups of the target users are multiplexed to a target port for forwarding through the target port. Thus, in this application, a first data packet group including the RTP data packets and RTCP data packets corresponding to each media stream type is obtained according to the media stream type, then a second data packet group corresponding to each target user is obtained according to the target user, and then all the second data packet groups of the target users are multiplexed to the target port. That is, the single-port multiplexing of RTP data packets and RTCP data packets is realized; the single-port multiplexing of multiple media stream data packets of the same target user is realized; the single-port multiplexing of media stream data packets of different target users is realized. In this way, all media stream data packets can be forwarded using a single target port, reducing the waste of port resources and alleviating the operation and maintenance pressure.

[0056] See Figure 2 and Figure 3 As shown, an embodiment of this application discloses a specific method for single-port multiplexing of media streams. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically, it includes:

[0057] Step S21: Obtain the RTP data packets and RTCP data packets of the media stream.

[0058] Step S22: Determine the media stream types of the RTP data packets and the RTCP data packets, and group the RTP data packets and the RTCP data packets with the same media stream type by using the rtcp-mux attribute to obtain corresponding first data packet groups for forwarding the RTP data packets and the RTCP data packets through a single port; wherein the media stream types include audio streams and video streams.

[0059] In this embodiment, by using the rtcp-mux attribute to multiplex the RTP data packets and RTCP data packets with the same media stream type to a single port for transmission, the media stream types include audio streams and video streams. As Figure 3As shown, for the audio stream and the video stream, the RTP data packets and RTCP data packets of the audio stream are respectively grouped into one group, and the RTP data packets and RTCP data packets of the video stream are grouped into one group, to obtain the corresponding first data packet groups respectively, so as to be forwarded through a single port.

[0060] Step S23: Determine the target user corresponding to each of the first data packet groups, and use the BUNDLE attribute to group all the first data packet groups corresponding to each target user to obtain the corresponding second data packet groups, so as to forward the second data packet groups through a single port; wherein, each of the second data packet groups carries the corresponding target user identifier.

[0061] In this embodiment, by using the BUNDLE attribute, all the first data packet groups corresponding to each target user are multiplexed to a single port for transmission, and the second data packet groups are obtained, wherein each second data packet group also carries the corresponding target user identifier. Specifically, it can be: adding an ICE data packet carrying the target user identifier to the second data packet group; wherein, the username attribute of the ICE data packet includes the ice-ufrag attribute. As Figure 3 shown, the second data packet group not only includes the RTP data packets and RTCP data packets corresponding to the audio stream, the RTP data packets and RTCP data packets corresponding to the video stream, but also includes an ICE data packet, which carries the target user identifier, and the username attribute of the ICE data packet includes the ice-ufrag attribute.

[0062] Step S24: Multiplex the second data packet groups of all the target users to the target port by using the ice-ufrag attribute, so as to forward through the target port.

[0063] In this embodiment, by using the ice-ufrag attribute, the second data packet groups of all target users are multiplexed to the target port, so as to forward through the target port. It should be noted that when establishing a connection for the first time or after a network switch, a STUN Binding Request message of the ICE protocol is sent, and the username attribute contains the ice-ufrag attribute of the SDP. In this way, the server can associate the UDP source address of the received message with the target user and correctly process the subsequent received RTP, RTCP and other data packets.

[0064] Among them, for a more specific processing procedure of the above step S21, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated herein.

[0065] It can be seen that in the embodiments of the present application, the rtcp-mux attribute is used to implement the single-port multiplexing of RTCP data packets and RTP data packets; the BUNDLE attribute is used to implement the single-port multiplexing of multiple audio and video media streams of a single target user; and the ice-ufrag attribute is used to implement the single-port multiplexing of media streams of different target users. In this way, all media stream data packets can be forwarded using a single target port, reducing the number of open ports from tens of thousands to 1, reducing the waste of port resources, lowering the complexity of operation and maintenance, and having good security. In addition, the technical solution of the present application is implemented based on standard protocols, has good compatibility, can be compatible with common L2 / L3 load balancers such as LVS, and supports the transmission of RTP data packets using either the UDP protocol or the TCP protocol.

[0066] See Figure 4 and Figure 5 As shown, the embodiments of the present application disclose a method for demultiplexing media streams into a single port. The method includes:

[0067] Step S31: Obtain a media stream data packet and extract a target user identifier from the media stream data packet.

[0068] In this embodiment, the media stream data packet is obtained through a single port, and ICE data packets, RTP data packets, and RTCP data packets are distinguished according to the header format of the data packet. Then, the target user identifier is extracted from the ICE data packet. It can be understood that if a STUN Binding Request message of the ICE protocol is received, the username attribute of this message contains the ice-ufrag attribute of the SDP, which can identify the user to whom the media stream belongs.

[0069] Step S32: Demultiplex the media stream data packet according to the target user identifier to obtain a third data packet group corresponding to different target users.

[0070] In this embodiment, all media stream data packets are demultiplexed according to the target user identifier to obtain a third data packet group corresponding to different target users, realizing the demultiplexing of media streams of different target users. As Figure 5 shown, target user 1 and target user 2 respectively correspond to different third data packet groups.

[0071] Step S33: Demultiplex all data packets in the third data packet group to obtain a fourth data packet group corresponding to different media stream types; where each fourth data packet group includes RTP data packets and RTCP data packets corresponding to each media stream type.

[0072] In this embodiment, all the data packets in the third data packet group are demultiplexed to obtain a fourth data packet group corresponding to different media stream types, thereby realizing the demultiplexing of the audio and video streams. As Figure 5 shown, a fourth data packet group corresponding to the audio stream and a fourth data packet group corresponding to the video stream are respectively obtained. Each fourth data packet group includes RTP data packets and RTCP data packets corresponding to each media stream type.

[0073] The above-mentioned demultiplexing of all the data packets in the third data packet group to obtain a fourth data packet group corresponding to different media stream types includes: demultiplexing all the data packets in the third data packet group based on the mid header extension in the RTP data packets to obtain a fourth data packet group corresponding to the audio stream and the video stream respectively. It can be understood that by processing the mid header extension of the RTP data packets, the corresponding audio and video sub-media streams of a single target user can be identified.

[0074] Step S34: Demultiplex the fourth data packet group to obtain the RTP data packets and RTCP data packets of the media stream.

[0075] In this embodiment, the fourth data packet is demultiplexed to obtain the corresponding RTP data packets and RTCP data packets.

[0076] It can be seen that in the embodiment of the present application, by obtaining media stream data packets and extracting the target user identifier from the media stream data packets; demultiplexing the media stream data packets according to the target user identifier to obtain a third data packet group corresponding to different target users; demultiplexing all the data packets in the third data packet group to obtain a fourth data packet group corresponding to different media stream types; wherein each of the fourth data packet groups includes RTP data packets and RTCP data packets corresponding to each of the media stream types; demultiplexing the fourth data packet group to obtain the RTP data packets and RTCP data packets of the media stream. Thus, when the media stream data packets are obtained through a single port, the media stream data packets are demultiplexed respectively based on the target user identifier and the media stream type, and finally the individual RTC data packets and RTCP data packets are obtained for processing the RTC data packets and RTCP data packets.

[0077] See Figure 6 shown, the embodiment of the present application discloses a media stream single-port multiplexing device, which includes:

[0078] A data packet acquisition module 11, configured to acquire RTP data packets and RTCP data packets of a media stream;

[0079] The first multiplexing module 12 is configured to determine the media stream types of the RTP data packets and the RTCP data packets, and obtain corresponding first data packet groups based on the media stream types; wherein, each of the first data packet groups includes RTP data packets and RTCP data packets corresponding to each of the media stream types.

[0080] The second multiplexing module 13 is configured to determine the target users corresponding to each of the first data packet groups, and group the first data packet groups based on the target users to obtain corresponding second data packet groups; wherein, each of the second data packet groups carries a corresponding target user identifier.

[0081] The third multiplexing module 14 is configured to multiplex the second data packet groups of all the target users to a target port for forwarding through the target port.

[0082] It can be seen that in this application, the RTP data packets and the RTCP data packets of the media stream are obtained; the media stream types of the RTP data packets and the RTCP data packets are determined, and corresponding first data packet groups are obtained based on the media stream types; wherein, each of the first data packet groups includes RTP data packets and RTCP data packets corresponding to each of the media stream types; the target users corresponding to each of the first data packet groups are determined, and the first data packet groups are grouped based on the target users to obtain corresponding second data packet groups; wherein, each of the second data packet groups carries a corresponding target user identifier; the second data packet groups of all the target users are multiplexed to a target port for forwarding through the target port. Thus, in this application, first data packet groups including RTP data packets and RTCP data packets corresponding to each media stream type are obtained according to the media stream types, then second data packet groups corresponding to each target user are obtained according to the target users, and then the second data packet groups of all the target users are multiplexed to the target port. That is to say, single-port multiplexing of RTP data packets and RTCP data packets is achieved; single-port multiplexing of multiple media stream data packets of the same target user is achieved; single-port multiplexing of media stream data packets of different target users is achieved. In this way, all media stream data packets can be forwarded using one target port, reducing the waste of port resources and alleviating the operation and maintenance pressure.

[0083] Figure 7 It is a schematic structural diagram of an electronic device provided by an embodiment of this application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Wherein, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the media stream single-port multiplexing method executed by the electronic device disclosed in any of the foregoing embodiments.

[0084] In this embodiment, the power supply 23 is used to provide operating voltages for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and specific limitations are not imposed thereon herein; the input / output interface 25 is used to obtain external input data or output data to the outside, and the specific interface type thereof can be selected according to specific application requirements, and no specific limitations are made herein.

[0085] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one of the hardware forms of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0086] In addition, the memory 22, as a carrier for resource storage, may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc. The resources stored thereon include an operating system 221, a computer program 222, data 223, etc., and the storage method may be transient storage or permanent storage.

[0087] Among them, the operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the massive data 223 in the memory 22 by the processor 21. It can be Windows, Unix, Linux, etc. In addition to the computer program that can be used to complete the media stream single-port multiplexing method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks. The data 223 may include not only the data transmitted by external devices received by the electronic device, but also the data collected by its own input / output interface 25, etc.

[0088] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium. When the computer program stored in the storage medium is loaded and executed by a processor, the method steps executed during the media stream single-port multiplexing process disclosed in any of the foregoing embodiments are implemented.

[0089] In this specification, the various embodiments are described in a progressive manner. The focus of each embodiment is on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0090] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this document can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the examples have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0091] The steps of the method or algorithm described in combination with the embodiments disclosed in this document can be directly implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0092] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0093] The above has introduced in detail a media stream single-port multiplexing method, apparatus, device and storage medium provided by the present invention. Specific examples are used in this text to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A method for multiplexing a single port of a media stream, characterized in that, it includes: Obtain the RTP data packets and RTCP data packets of the media stream; Determine the media stream types of the RTP data packets and the RTCP data packets, and obtain corresponding first data packet groups based on the media stream types; wherein, each of the first data packet groups includes RTP data packets and RTCP data packets corresponding to each of the media stream types; Determine the target users corresponding to each of the first data packet groups, and group the first data packet groups based on the target users to obtain corresponding second data packet groups; wherein, each of the second data packet groups carries a corresponding target user identifier; Multiplex the second data packet groups of all the target users to a target port for forwarding through the target port; wherein, the grouping the first data packet groups based on the target users to obtain corresponding second data packet groups includes: Using the BUNDLE attribute to group all the first data packet groups corresponding to each target user to obtain corresponding second data packet groups for forwarding the second data packet groups through a single port.

2. The method for multiplexing a single port of a media stream according to claim 1, characterized in that, the obtaining corresponding first data packet groups based on the media stream types includes: Using the rtcp-mux attribute to group the RTP data packets and the RTCP data packets with the same media stream type to obtain corresponding first data packet groups for forwarding the RTP data packets and the RTCP data packets through a single port; wherein, the media stream types include audio streams and video streams.

3. The method for multiplexing a single port of a media stream according to claim 1, characterized in that, the multiplexing the second data packet groups of all the target users to a target port for forwarding through the target port includes: Using the ice-ufrag attribute to multiplex the second data packet groups of all the target users to a target port for forwarding through the target port.

4. The method for multiplexing a single port of a media stream according to claim 3, characterized in that, during the process of grouping the first data packet groups based on the target users to obtain corresponding second data packet groups, it further includes: Adding ICE data packets carrying the target user identifier to the second data packet groups; wherein, the username attribute of the ICE data packets includes the ice-ufrag attribute.

5. A method for demultiplexing a single port of a media stream, characterized in that, it includes: Obtain media stream data packets, and extract target user identifiers from the media stream data packets; Demultiplex the media stream data packets according to the target user identifiers to obtain third data packet groups corresponding to different target users; Demultiplex all the data packets in the third data packet groups to obtain fourth data packet groups corresponding to different media stream types; wherein, each of the fourth data packet groups includes RTP data packets and RTCP data packets corresponding to each of the media stream types; Demultiplex the fourth data packet group to obtain RTP data packets and RTCP data packets of the media stream; Among them, the third data packet group is a data packet obtained by grouping all fourth data packet groups corresponding to each target user by using the BUNDLE attribute.

6. The media stream single-port demultiplexing method according to claim 5, characterized in that The demultiplexing of all data packets in the third data packet group to obtain fourth data packet groups corresponding to different media stream types includes: Demultiplexing all data packets in the third data packet group based on the mid header extension in the RTP data packets to obtain fourth data packet groups corresponding to the audio stream and the video stream respectively.

7. A media stream single-port multiplexing device, characterized in that comprises: A data packet acquisition module for acquiring RTP data packets and RTCP data packets of the media stream; A first multiplexing module for determining the media stream types of the RTP data packets and the RTCP data packets, and obtaining corresponding first data packet groups based on the media stream types; wherein, each of the first data packet groups includes RTP data packets and RTCP data packets corresponding to each of the media stream types; A second multiplexing module for determining the target users corresponding to each of the first data packet groups, and grouping the first data packet groups based on the target users to obtain corresponding second data packet groups; wherein, each of the second data packet groups carries a corresponding target user identifier; A third multiplexing module for multiplexing the second data packet groups of all the target users to a target port for forwarding through the target port; Among them, the second multiplexing module is specifically configured to group all the first data packet groups corresponding to each target user by using the BUNDLE attribute to obtain corresponding second data packet groups for forwarding the second data packet groups through a single port.

8. An electronic device, characterized in that comprises: A memory for storing a computer program; A processor for executing the computer program to implement the steps of the media stream single-port multiplexing method according to any one of claims 1 to 4.

9. A computer-readable storage medium, characterized in that for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the media stream single-port multiplexing method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • User datagram protocol multiplexing and multiplexing negotiation method and apparatus

    CN101183924A

  • Data transmission and receiving method, wireless access point equipment, gateway and communication system

    CN101374266A

  • Method and device for negotiating media multiplexing

    CN104683312A