Method, apparatus and storage medium for streaming communication connection

By introducing a network proxy module into streaming media communication and establishing a port mapping relationship between the connection identifier field and the media forwarding server, the port convergence problem of TCP and UDP communication connections in the SFU service framework is solved, achieving efficient streaming media forwarding and network security.

CN117478649BActive Publication Date: 2026-11-24SHANGHAI JIUCHI NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311260350.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2026-11-24
Estimated Expiration
2043-09-26

AI Technical Summary

Technical Problem

In existing technologies, the SFU service framework cannot simultaneously achieve port convergence for both TCP and UDP communication connections in the inbound and outbound directions, thus failing to meet network security requirements.

Method used

By setting up a network proxy module, based on standard signaling interaction for real-time web communication, a mapping relationship is established between the connection identifier field and the local service port of the media forwarding server, thereby achieving port convergence of TCP communication connections and supporting efficient streaming media forwarding.

Benefits of technology

It achieves port convergence for TCP communication connections, ensuring network security and improving the efficiency and stability of streaming media forwarding, making it suitable for various application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117478649B_ABST
    Figure CN117478649B_ABST
Patent Text Reader

Abstract

This application provides a streaming media communication connection method, apparatus, device, and storage medium. The method includes: responding to a communication connection request sent by a client, establishing a first TCP communication connection with the client and generating a first socket corresponding to the connection information of the first TCP communication connection; receiving a connection test packet sent by the client based on the first TCP communication connection; determining a target service port corresponding to the client among the local service ports provided by a media forwarding server based on a connection identifier field and a set first port mapping relationship; generating a second socket based on the port information of the target service port and establishing a communication connection with the media forwarding server based on the second socket; and sending the connection information of the first socket to the media forwarding server based on the communication connection, so that the media forwarding server establishes a second TCP communication connection with the client based on the connection information of the first socket. This achieves effective port convergence to support TCP communication connections.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a streaming media communication connection method, apparatus, device, and storage medium. Background Technology

[0002] In existing open-source web real-time communication streaming media forwarding service solutions, the SFU (Selective Forwarding Unit) service framework is basically used to implement media forwarding. For enterprises in private deployments or public cloud integration, due to network security requirements, there are certain restrictions on the range of TCP and UDP ports. Therefore, while applying the SFU service framework, it is necessary to ensure the implementation of port convergence.

[0003] However, existing technologies for port convergence have limitations and cannot simultaneously guarantee port convergence for media transmission in both inbound and outbound directions. For example, compared to the Coturn server, the open-source program Coturn only supports port convergence for inbound media transmission of TCP and UDP; for outbound media transmission, the ports are divergent, failing to achieve port convergence in both directions. Furthermore, other port convergence implementations often only implement UDP port convergence but not TCP port convergence, making them unsuitable for network security requirements in application scenarios that shield the UDP protocol. Summary of the Invention

[0004] This application provides a streaming media communication connection method, apparatus, device, and storage medium, which solves the problem of not being able to guarantee port convergence in the inbound and outbound directions of TCP communication connections when using the SFU service framework. It achieves high stability by setting a network proxy module, based on the special characteristics of standard signaling interaction in real-time web communication, to construct a mapping relationship between the connection identifier field and the local service port of the media forwarding server. The set proxy port can effectively support port convergence of TCP communication connections and ensure efficient streaming media forwarding, making it suitable for the network security requirements of different application scenarios.

[0005] In a first aspect, embodiments of this application provide a streaming media communication connection method, applied to a network proxy module, the streaming media communication connection method comprising:

[0006] In response to a communication connection request sent by a client, a first TCP communication connection is established with the client, and a first socket corresponding to the connection information of the first TCP communication connection is generated;

[0007] Based on the first TCP communication connection, a connection test packet sent by the client is received, the connection test packet including a connection identifier field;

[0008] Based on the connection identifier field and the set first port mapping relationship, determine the target service port corresponding to the client among the local service ports provided by the media forwarding server;

[0009] A second socket is generated based on the port information of the target service port, and a communication connection is established with the media forwarding server based on the second socket;

[0010] Based on the communication connection, the connection information of the first socket is sent to the media forwarding server, so that the media forwarding server can establish a second TCP communication connection with the client based on the connection information of the first socket.

[0011] Optionally, the streaming media communication connection method further includes:

[0012] Upon receiving the first media data packet sent by the first client, based on the connection identifier field in the first media data packet and the first port mapping relationship, the target service port corresponding to the first client in the local service port provided by the media forwarding server is determined, and the first media data packet is sent to the target service port so that the media forwarding server forwards it to the target client port;

[0013] Upon receiving the second media data packet sent by the media forwarding server, the target port of the second client corresponding to the second media data packet is determined based on the connection identifier field in the second media data packet and the set second port mapping relationship, and the second media data packet is sent to the target port.

[0014] Optionally, before establishing the first TCP communication connection with the client, the method further includes:

[0015] The system receives session response description information and a first port mapping relationship sent by the media forwarding server. The session response description information is generated by the media forwarding server in response to the session request description information sent by the client. The first port mapping relationship is the association between the connection identifier field in the session response description information and the local service port provided by the media forwarding server.

[0016] The local service port in the session response description information is replaced with the proxy port to obtain new session response description information, and the new session response description information is sent to the client.

[0017] Optionally, after receiving the connection test packet sent by the client based on the first TCP communication connection, the method further includes:

[0018] A second port mapping relationship is established based on the connection identifier field in the connection test packet and the client port of the client.

[0019] Secondly, embodiments of this application also provide a streaming media communication connection method, applied to a streaming media service system, the streaming media service system including a network proxy module and a media forwarding server;

[0020] The streaming media communication connection method includes:

[0021] When the network proxy module receives a communication connection request sent by the client, it establishes a first TCP communication connection with the client and generates a first socket corresponding to the connection information of the first TCP communication connection.

[0022] The network proxy module receives a connection test packet sent by the client based on the first TCP communication connection, and the connection test packet includes a connection identifier field.

[0023] The network proxy module determines the target service port corresponding to the client from the local service ports provided by the media forwarding server based on the connection identifier field and the set first port mapping relationship;

[0024] The network proxy module generates a second socket based on the port information of the target service port, and establishes a communication connection with the media forwarding server based on the second socket;

[0025] The network proxy module sends the connection information of the first socket to the media forwarding server based on the communication connection.

[0026] The media forwarding server establishes a second TCP communication connection with the client based on the connection information of the first socket.

[0027] Optionally, the streaming media communication connection method further includes:

[0028] When the network proxy module receives the first media data packet sent by the first client, it determines the target service port corresponding to the first client in the local service port provided by the media forwarding server based on the connection identifier field in the first media data packet and the first port mapping relationship, and sends the first media data packet to the target service port.

[0029] When the media forwarding server receives the first media data packet through the target service port, it forwards the first media data packet to the target client port;

[0030] When the media forwarding server receives the second media data packet sent by the target client, it sends the second media data packet to the network proxy module;

[0031] When the network proxy module receives the second media data packet, it determines the target port of the second client corresponding to the second media data packet based on the connection identifier field in the second media data packet and the set second port mapping relationship, and sends the second media data packet to the target port.

[0032] Optionally, the streaming media communication connection method further includes:

[0033] When the media forwarding server receives the session request description information sent by the client, it extracts the first identifier field from the session request description information, concatenates the first identifier field with the generated second identifier field to obtain the connection identifier field, establishes a first port mapping relationship between the connection identifier field and the local service port, and sends the session response description information and the first port mapping relationship to the network proxy module. The session response description information includes the connection identifier field.

[0034] When the network proxy module receives the session response description information and the first port mapping relationship, it replaces the local service port in the session response description information with the proxy port to obtain new session response description information, and sends the new session response description information to the client.

[0035] Optionally, after the network proxy module receives the connection test packet sent by the client based on the first TCP communication connection, it further includes:

[0036] The network proxy module establishes a second port mapping relationship based on the connection identifier field in the connection test packet and the client port of the client.

[0037] Optionally, the streaming media communication connection method further includes:

[0038] The media forwarding server receives media data packets sent by the client based on the second TCP communication connection and forwards the media data packets to the target client of the connection.

[0039] Thirdly, embodiments of this application also provide a streaming media communication connection device, applied to a network proxy module, the streaming media communication connection device comprising:

[0040] The TCP communication connection module is configured to respond to a communication connection request sent by the client, establish a first TCP communication connection with the client, and generate a first socket corresponding to the connection information of the first TCP communication connection.

[0041] The connection test packet receiving module is configured to receive a connection test packet sent by the client based on the first TCP communication connection, wherein the connection test packet includes a connection identifier field.

[0042] The service port determination module is configured to determine the target service port corresponding to the client from the local service ports provided by the media forwarding server based on the connection identifier field and the set first port mapping relationship.

[0043] The communication connection module is configured to generate a second socket based on the port information of the target service port, and establish a communication connection with the media forwarding server based on the second socket;

[0044] The socket sending module is configured to send the connection information of the first socket to the media forwarding server based on the communication connection, so that the media forwarding server can establish a second TCP communication connection with the client based on the connection information of the first socket.

[0045] Fourthly, embodiments of this application also provide a streaming media communication connection device, the device comprising:

[0046] One or more processors;

[0047] Storage device, configured to store one or more programs,

[0048] When the one or more programs are executed by the one or more processors, the one or more processors implement the streaming media communication connection method described in the embodiments of this application.

[0049] Fifthly, embodiments of this application also provide a non-volatile storage medium for storing computer-executable instructions, which, when executed by a computer processor, are configured to perform the streaming media communication connection method described in embodiments of this application.

[0050] In this embodiment, a network proxy module responds to a communication connection request sent by a client, establishes a first TCP communication connection with the client, and generates a first socket corresponding to the connection information of the first TCP communication connection. Based on the first TCP communication connection, it receives a connection test packet sent by the client, the connection test packet including a connection identifier field. Based on the connection identifier field and the set first port mapping relationship, it determines the target service port corresponding to the client among the local service ports provided by the media forwarding server. Based on the port information of the target service port, it generates a second socket and establishes a communication connection with the media forwarding server based on the second socket. Based on the communication connection, it sends the connection information of the first socket to the media forwarding server, so that the media forwarding server establishes a second TCP communication connection with the client based on the connection information of the first socket. This achieves high stability by setting a network proxy module, based on the special characteristics of standard signaling interaction in real-time web communication, constructing a mapping relationship between the connection identifier field and the local service port of the media forwarding server. The set proxy port can effectively support TCP communication connection port convergence and ensure efficient streaming media forwarding, making it suitable for the network security requirements of different application scenarios. Attached Figure Description

[0051] Figure 1 A flowchart illustrating a streaming media communication connection method provided in an embodiment of this application;

[0052] Figure 2 A flowchart illustrating a method for streaming media communication based on a first port mapping relationship and a second port mapping relationship, provided in an embodiment of this application;

[0053] Figure 3 A flowchart illustrating a method for a network proxy module to obtain a first port mapping relationship, provided in an embodiment of this application;

[0054] Figure 4 A flowchart illustrating how a network proxy module obtains a second port mapping relationship is provided in an embodiment of this application;

[0055] Figure 5 A schematic diagram illustrating a streaming media communication connection process provided in an embodiment of this application;

[0056] Figure 6 A schematic diagram illustrating another streaming media communication connection process provided in an embodiment of this application;

[0057] Figure 7 A schematic diagram illustrating the process by which a network proxy module obtains a first port mapping relationship, as provided in an embodiment of this application;

[0058] Figure 8 A structural block diagram of a streaming media communication connection device provided in an embodiment of this application;

[0059] Figure 9 This is a schematic diagram of the structure of a streaming media communication connection device provided in an embodiment of this application. Detailed Implementation

[0060] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the scope of the embodiments. Furthermore, it should be noted that, for ease of description, only the parts relevant to the embodiments of this application are shown in the accompanying drawings, not the entire structure.

[0061] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0062] The streaming media communication connection method provided in this application is used to achieve external port convergence based on the SFU service framework in real-time web communication application scenarios. Specific application scenarios may include: web-based voice or video calls, remote control, cloud desktops, and digital twins. Due to network security requirements, enterprises need to achieve port convergence in the inbound and outbound directions of corresponding TCP or UDP connections during private deployments or public cloud integration to ensure data transmission security. The aforementioned application scenarios are merely exemplary and illustrative. In practical applications, this streaming media communication connection method can also be used in other streaming media communication connection scenarios, and this application does not limit this. This application aims to provide a streaming media communication connection method that solves the problem of not being able to simultaneously achieve port convergence in the inbound and outbound directions of TCP and UDP when applying the SFU service framework.

[0063] The streaming media communication connection method provided in this application embodiment can be executed by a computer device. The computer device refers to any electronic device with data computing, processing and storage capabilities, such as mobile phones, PCs (Personal Computers), tablet computers and other terminal devices, or servers and other devices. This application embodiment does not limit the scope of the method.

[0064] Figure 1The flowchart illustrates a streaming media communication connection method provided in this application embodiment. This streaming media communication connection method can be implemented using a network proxy module as the execution subject. The network proxy module can be an independently deployed physical entity or a functional entity set on a server, and this application does not impose any restrictions on it.

[0065] like Figure 1 As shown, the streaming media communication connection method specifically includes the following steps:

[0066] Step S101: In response to the communication connection request sent by the client, establish a first TCP communication connection with the client and generate a first socket corresponding to the connection information of the first TCP communication connection.

[0067] In the process of streaming media communication connection, streaming media data transmission between the client and the media forwarding server is involved. Since direct communication between the client and the media forwarding server can lead to port divergence in both the inbound and outbound directions, this embodiment of the application sets up a network proxy module between the client and the media forwarding server. Therefore, the client no longer faces the multiple ports set by the media forwarding server, but rather the proxy port set by the network proxy module, thereby achieving port convergence in both the inbound and outbound directions of the TCP connection. It can be understood that before the client transmits streaming media data with the media forwarding server, it needs to establish a first TCP communication connection with the network proxy module, and then further establish a communication connection with the media forwarding server based on this first TCP communication connection. Specifically, after receiving the communication connection request sent by the client through the proxy port, the network proxy module completes the communication connection through a three-way handshake with the client. Then, the network proxy module can call the accept() function to generate a first socket based on the connection information of the first TCP communication connection. The first socket can be the logical interface for communication between the client and the network proxy module. The connection information of the first socket can include the client address, the transport protocol used, and the client port. The network proxy module can operate on this first socket to establish the first TCP communication connection with the client.

[0068] Step S102: Receive a connection test packet sent by the client based on the first TCP communication connection. The connection test packet includes a connection identifier field.

[0069] In the specific scenario of real-time web communication, the client and the network proxy module need to perform ICE (Interactive Connectivity Establishment) connectivity testing to determine the port address information. The connection test packet may include a connection identifier field, which uniquely identifies the client; different clients will have different connection identifier fields.

[0070] Step S103: Based on the connection identifier field and the set first port mapping relationship, determine the target service port corresponding to the client in the local service ports provided by the media forwarding server.

[0071] The first port mapping relationship can be the association between the client's connection identifier field and the local service port provided by the media forwarding server. Essentially, in the first port mapping relationship, the connection identifier field can be used to find the corresponding target service port among the local service ports provided by the media forwarding server, thus determining the port correspondence between the client and the media forwarding server. Alternatively, the first port mapping relationship can be obtained by the network proxy module through participation in the multimedia session negotiation process between the client and the media forwarding server. The media forwarding server can obtain the client's connection identifier field during this negotiation process and match it with the corresponding local service port to establish the first port mapping relationship. Thus, the network proxy module can obtain and store this first port mapping relationship from the media forwarding server.

[0072] Step S104: Generate a second socket based on the port information of the target service port, and establish a communication connection with the media forwarding server based on the second socket.

[0073] The network proxy module, after confirming the target service port corresponding to the client, can generate a second socket based on the port information of that target service port. Specifically, if the network proxy module and the media forwarding server are deployed on different servers, the second socket can be set up based on the TCP / IP protocol stack. If the network proxy module and the media forwarding server are deployed on the same server as different functional entities, the second socket can be a Unix domain socket, enabling communication between different processes without involving IP addresses. Furthermore, the second socket serves as the logical interface for communication between the network proxy module and the media forwarding server. The connection information of the second socket includes the media forwarding server address, the transport protocol used, and the target service port. The network proxy module can establish a communication connection with the media forwarding server by operating the second socket.

[0074] Step S105: Send the connection information of the first socket to the media forwarding server based on the communication connection, so that the media forwarding server can establish a second TCP communication connection with the client based on the connection information of the first socket.

[0075] In step S101, the network proxy module generates a first socket corresponding to the connection information of the first TCP communication connection with the client. The first socket may include the client address, the transmission protocol used, and the client port. The media forwarding server can determine the target service port corresponding to the client through the communication connection with the network proxy module, and can determine the address information and port information of the client to be connected by receiving the connection information of the first socket sent by the network proxy module. Thus, the media forwarding server can establish a second TCP communication connection with the client based on the connection information of the first socket. In the TCP connection establishment stage between the client and the media forwarding server, the network proxy module realizes port convergence in the entry and exit directions. The client only needs to face the proxy port of the network proxy module, and the network proxy module will forward the connection to the target service port of the media forwarding server, achieving the port convergence effect of link communication and improving the security of the network. In addition, after the client and the media forwarding server complete the TCP connection through the network proxy module, they can communicate directly based on the TCP connection to ensure the efficient forwarding of streaming media data.

[0076] The above describes a process where a network proxy module responds to a client's communication connection request, establishes a first TCP communication connection with the client, and generates a first socket corresponding to the connection information of the first TCP communication connection. Based on the first TCP communication connection, it receives a connection test packet sent by the client, which includes a connection identifier field. Based on the connection identifier field and the established first port mapping relationship, it determines the target service port corresponding to the client among the local service ports provided by the media forwarding server. Based on the port information of the target service port, it generates a second socket and establishes a communication connection with the media forwarding server based on the second socket. Based on the communication connection, it sends the connection information of the first socket to the media forwarding server, enabling the media forwarding server to establish a second TCP communication connection with the client based on the connection information of the first socket. This method, by setting up a network proxy module, leverages the special characteristics of standard signaling interaction in real-time web communication to construct a mapping relationship between the connection identifier field and the local service port of the media forwarding server. It offers high stability, effectively supports TCP communication connection port convergence through the configured proxy port, and ensures efficient streaming media forwarding, making it suitable for network security requirements in various application scenarios.

[0077] Figure 2 A flowchart illustrating a method for streaming media communication based on a first port mapping relationship and a second port mapping relationship, provided in an embodiment of this application. Figure 1 In the Chinese implementation, a network proxy module can be used to achieve port convergence of the TCP communication connection between the client and the media forwarding server, such as... Figure 2As shown, the network proxy module can also simultaneously achieve port convergence for UDP communication connections between the client and the media forwarding server. Figure 1 Based on the embodiments, the specific process also includes the following steps:

[0078] Step S106: When the first media data packet sent by the first client is received, based on the connection identifier field in the first media data packet and the first port mapping relationship, the target service port corresponding to the first client in the local service port provided by the media forwarding server is determined, and the first media data packet is sent to the target service port so that the media forwarding server forwards it to the target client port.

[0079] Step S107: When the second media data packet sent by the media forwarding server is received, the target port of the second client corresponding to the second media data packet is determined based on the connection identifier field in the second media data packet and the set second port mapping relationship, and the second media data packet is sent to the target port.

[0080] The network proxy module is configured with a first port mapping relationship and a second port mapping relationship. The first port mapping relationship is the association between the client's connection identifier field and the local service port provided by the media forwarding server, as described in the previous embodiments. The second port mapping relationship is the association between the client's connection identifier field and the client's port. Therefore, on the one hand, the client sends a first media data packet to the proxy port of the network proxy module, and the network proxy module can forward the first media data packet to the corresponding target service port in the media forwarding server based on the first port mapping relationship. On the other hand, the media forwarding server sends a second media data packet to the network proxy module, and the network proxy module outputs it to the target client port through the proxy port. Thus, by setting up the network proxy module, port convergence of the UDP communication connection between the client and the media forwarding server can be effectively achieved, ensuring network security.

[0081] Figure 3 A flowchart illustrating a method for a network proxy module to obtain a first port mapping relationship, as provided in this application embodiment, is shown below. Figure 3 As shown, in Figure 1 Based on the previous embodiment, before the network proxy module establishes the first TCP communication connection with the client, the following steps are also included:

[0082] Step S1001: Receive the session response description information and the first port mapping relationship sent by the media forwarding server. The session response description information is generated by the media forwarding server in response to the session request description information sent by the client. The first port mapping relationship is the association between the connection identifier field in the session response description information and the local service port provided by the media forwarding server.

[0083] Step S1002: Replace the local service port in the session response description information with the proxy port to obtain new session response description information, and send the new session response description information to the client.

[0084] It's worth noting that the client sends a session request description to the media forwarding server. This description describes the initialization parameters of the streaming media. Specifically, the session request description can include session information and media information. The session information can include the session name and purpose, session duration, bandwidth used by the session, and user information. The media information can include media type, transport protocol, media format, multicast address, and media transmission port. The media forwarding server can establish a first port mapping relationship with its local service port based on the connection identifier character in the session request description. The network proxy module receives and stores this first port mapping relationship. Simultaneously, the media forwarding server generates a corresponding session response description, and the network proxy module replaces the local service port in this response description with the proxy port. Thus, the multiple ports originally intended for the media forwarding server by the client can be converged to the proxy port intended for the network proxy module, achieving port convergence.

[0085] Figure 4 A flowchart illustrating how a network proxy module obtains a second port mapping relationship is provided in this application embodiment. Optionally, in... Figure 2 Based on the previous embodiment, the process of adding a network proxy module to obtain the second port mapping relationship specifically includes the following steps:

[0086] Step S201: In response to the communication connection request sent by the client, establish a first TCP communication connection with the client and generate a first socket corresponding to the connection information of the first TCP communication connection.

[0087] Step S202: Receive a connection test packet sent by the client based on the first TCP communication connection. The connection test packet includes a connection identifier field.

[0088] Step S203: Establish a second port mapping relationship based on the connection identifier field in the connection test packet and the client's client port.

[0089] Step S204: Based on the connection identifier field and the set first port mapping relationship, determine the target service port corresponding to the client in the local service ports provided by the media forwarding server.

[0090] Step S205: Generate a second socket based on the port information of the target service port, and establish a communication connection with the media forwarding server based on the second socket.

[0091] Step S206: Send the connection information of the first socket to the media forwarding server based on the communication connection, so that the media forwarding server can establish a second TCP communication connection with the client based on the connection information of the first socket.

[0092] Step S207: When the first media data packet sent by the first client is received, based on the connection identifier field in the first media data packet and the first port mapping relationship, the target service port corresponding to the first client in the local service port provided by the media forwarding server is determined, and the first media data packet is sent to the target service port so that the media forwarding server forwards it to the target client port.

[0093] Step S208: When the second media data packet sent by the media forwarding server is received, the target port of the second client corresponding to the second media data packet is determined based on the connection identifier field in the second media data packet and the set second port mapping relationship, and the second media data packet is sent to the target port.

[0094] Specifically, the client sends a connection test packet to the network proxy module. The network proxy module can learn the client port from which the connection test packet originates and the connection identifier field in the connection test packet. Then, it establishes a second port mapping relationship between the connection identifier field and the client's client port, thereby achieving the purpose of port convergence for UDP communication connections between the client and the media forwarding server.

[0095] Figure 5 This is a schematic diagram illustrating a streaming media communication connection process provided in an embodiment of this application. The streaming media communication connection method is applied to a streaming media service system, which includes a network proxy module and a media forwarding server. The media forwarding server can be configured based on libraries such as Libjingle and Libnice. Figure 5 As shown, the specific implementation process includes the following steps:

[0096] Step S301: When the network proxy module receives a communication connection request sent by the client, it establishes a first TCP communication connection with the client and generates a first socket corresponding to the connection information of the first TCP communication connection.

[0097] Step S302: The network proxy module receives a connection test packet sent by the client based on the first TCP communication connection. The connection test packet includes a connection identifier field.

[0098] Step S303: Based on the connection identifier field and the set first port mapping relationship, the network proxy module determines the target service port corresponding to the client in the local service ports provided by the media forwarding server;

[0099] Step S304: The network proxy module generates a second socket based on the port information of the target service port, and establishes a communication connection with the media forwarding server based on the second socket;

[0100] Step S305: The network proxy module sends the connection information of the first socket to the media forwarding server based on the communication connection;

[0101] Step S306: The media forwarding server establishes a second TCP communication connection with the client based on the connection information of the first socket.

[0102] Therefore, the streaming media service system composed of the network proxy module and the media forwarding server can effectively support the port convergence of TCP communication connections, providing clients with stable and secure media forwarding services. By setting up the network proxy module, based on the special characteristics of standard signaling interaction in real-time web communication, a mapping relationship between the connection identifier field and the local service port of the media forwarding server is constructed, ensuring efficient streaming media forwarding and suitable for the networking security requirements of different application scenarios.

[0103] Figure 6 A schematic diagram of another streaming media communication connection process provided in an embodiment of this application, as shown below. Figure 6 As shown, the specific implementation process includes the following steps:

[0104] Step S401: When the network proxy module receives the first media data packet sent by the first client, it determines the target service port corresponding to the first client in the local service port provided by the media forwarding server based on the connection identifier field in the first media data packet and the first port mapping relationship.

[0105] Step S402: The network proxy module sends the first media data packet to the target service port;

[0106] Step S403: When the media forwarding server receives the first media data packet through the target service port, it forwards the first media data packet to the target client port;

[0107] Step S404: When the media forwarding server receives the second media data packet sent by the target client, it sends the second media data packet to the network proxy module.

[0108] Step S405: When the network proxy module receives the second media data packet, it determines the target port of the second client corresponding to the second media data packet based on the connection identifier field in the second media data packet and the set second port mapping relationship.

[0109] Step S406: The network proxy module sends the second media data packet to the target port.

[0110] Specifically, when multiple clients send the first media data packet to the media forwarding server, they are actually targeting the proxy port of the network proxy module, rather than the multiple local service ports of the media forwarding server. This achieves port convergence for streaming media data at the ingress direction. Similarly, when the media forwarding server sends the second media data packet to a client, the proxy port of the network proxy module outputs externally, rather than each local service port of the media forwarding server being able to output externally. Therefore, by setting up a network proxy module, port convergence of the UDP communication connection between the client and the media forwarding server can be effectively achieved, ensuring network security.

[0111] Figure 7 A schematic diagram illustrating the process by which a network proxy module obtains a first port mapping relationship, as provided in an embodiment of this application, is shown below. Figure 7 As shown, the specific implementation process includes the following steps:

[0112] Step S501: When the media forwarding server receives the session request description information sent by the client, it extracts the first identifier field from the session request description information, concatenates the first identifier field with the generated second identifier field to obtain the connection identifier field, and establishes a first port mapping relationship between the connection identifier field and the local service port.

[0113] Step S502: The media forwarding server sends session response description information and the first port mapping relationship to the network proxy module. The session response description information includes a connection identifier field.

[0114] Step S503: When the network proxy module receives the session response description information and the first port mapping relationship, it replaces the local service port in the session response description information with the proxy port to obtain new session response description information.

[0115] Step S504: The network proxy module sends the new session response description information to the client.

[0116] Specifically, the connection identifier field consists of two parts: a first identifier field extracted by the media forwarding server from the session request description information sent by the client, and a second identifier field randomly generated by the media forwarding server. This connection identifier field serves as a valid identity identifier for the current client. By establishing a first port mapping relationship between the connection identifier field and the local service port, it is equivalent to pre-constructing a communication connection channel between the current client and the media forwarding server. Furthermore, the network proxy module replaces the local service port assigned in the session response description information corresponding to each client with a proxy port, achieving the convergence of multiple local service ports into a proxy port. Each client can obtain the connection identifier field uniquely associated with its corresponding local service port by receiving the session response description information fed back by the network proxy module. Thus, the association between the client and the media forwarding server is successfully established through the first port mapping relationship, effectively achieving port convergence while ensuring normal communication between the client and the media forwarding server.

[0117] Optionally, after the network proxy module receives the connection test packet sent by the client based on the first TCP communication connection, it also includes:

[0118] The network proxy module establishes a second port mapping relationship based on the connection identifier field in the connection test packet and the client's client port.

[0119] Therefore, the network proxy module can obtain the client's port by the source of the connection test packet, and establish a second port mapping relationship by combining the connection identifier field in the connection test packet, thereby achieving the purpose of port convergence for UDP communication connections between the client and the media forwarding server.

[0120] In one embodiment, in Figures 5 to 7 Based on the illustrated embodiment, the media forwarding server receives media data packets sent by the client via a second TCP communication connection and forwards the media data packets to the target client of the connection. This enables the forwarding of streaming media data between clients, meeting the data transmission requirements of real-time web communication.

[0121] Figure 8 This is a structural block diagram of a streaming media communication connection device provided in an embodiment of this application. The device is configured to execute the streaming media communication connection method provided in the above embodiment, and has corresponding functional modules and beneficial effects for executing the method. This streaming media communication connection device is applied to a network proxy module. For example... Figure 8 As shown, the device specifically includes:

[0122] TCP communication connection module 101 is configured to respond to a communication connection request sent by a client, establish a first TCP communication connection with the client, and generate a first socket corresponding to the connection information of the first TCP communication connection;

[0123] The connection test packet receiving module 102 is configured to receive a connection test packet sent by the client based on the first TCP communication connection, wherein the connection test packet includes a connection identifier field.

[0124] The service port determination module 103 is configured to determine the target service port corresponding to the client from the local service ports provided by the media forwarding server based on the connection identifier field and the set first port mapping relationship.

[0125] The communication connection module 104 is configured to generate a second socket based on the port information of the target service port, and establish a communication connection with the media forwarding server based on the second socket;

[0126] The socket sending module 105 is configured to send the connection information of the first socket to the media forwarding server based on the communication connection, so that the media forwarding server can establish a second TCP communication connection with the client based on the connection information of the first socket.

[0127] As described above, this streaming media communication connection device achieves a high degree of stability by setting up a network proxy module. Based on the special characteristics of standard signaling interaction in real-time web communication, it constructs a mapping relationship between the connection identifier field and the local service port of the media forwarding server. The proxy port can effectively support port convergence of TCP communication connections and ensure efficient streaming media forwarding. It is suitable for the networking security requirements of different application scenarios.

[0128] In one possible embodiment, the streaming media communication connection device further includes:

[0129] The first data packet forwarding module is configured to, upon receiving a first media data packet sent by a first client, determine the target service port corresponding to the first client among the local service ports provided by the media forwarding server based on the connection identifier field in the first media data packet and the first port mapping relationship, and send the first media data packet to the target service port so that the media forwarding server forwards it to the target client port;

[0130] The second data packet forwarding module is configured to, upon receiving a second media data packet sent by the media forwarding server, determine the target port of the second client corresponding to the second media data packet based on the connection identifier field in the second media data packet and the set second port mapping relationship, and send the second media data packet to the target port.

[0131] In one possible embodiment, the streaming media communication connection device further includes:

[0132] The response information receiving module is configured to receive session response description information and a first port mapping relationship sent by the media forwarding server. The session response description information is generated by the media forwarding server in response to the session request description information sent by the client. The first port mapping relationship is the association between the connection identifier field in the session response description information and the local service port provided by the media forwarding server.

[0133] The response information sending module is configured to replace the local service port in the session response description information with a proxy port to obtain new session response description information, and send the new session response description information to the client.

[0134] In one possible embodiment, the streaming media communication connection device further includes:

[0135] The port mapping relationship determination module is configured to establish a second port mapping relationship based on the connection identifier field in the connection test packet and the client port of the client.

[0136] Figure 9 This is a schematic diagram of the structure of a streaming media communication connection device provided in an embodiment of this application, such as... Figure 9 As shown, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of processors 201 in the device can be one or more. Figure 9 Taking a processor 201 as an example; the processor 201, memory 202, input device 203, and output device 204 in the device can be connected via a bus or other means. Figure 9Taking a bus connection as an example, the memory 202, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the streaming media communication connection method in this embodiment. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 202, thereby implementing the aforementioned streaming media communication connection method. The input device 203 can be configured to receive input digital or character information and generate key signal inputs related to user settings and function control of the device. The output device 204 may include a display screen or other display device.

[0137] The streaming media communication connection device provided above can be used to execute the streaming media communication connection method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0138] It should be noted that in all the above embodiments, the network proxy module and the media forwarding server can be independent devices or servers, or they can be combined. For example, the network proxy module can be a module of the media server, and the media forwarding server can also be a module of the media server. These solutions are all within the protection scope of this invention, and this invention does not make any specific limitations.

[0139] This application also provides a non-volatile storage medium containing computer-executable instructions, which, when executed by a computer processor, are configured to perform a streaming media communication connection method described in any of the above embodiments.

[0140] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROM, floppy disk, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media, and optical storage; registers or other similar types of memory elements, etc. Storage medium may also include other types of memory or combinations thereof. Furthermore, storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). Storage medium may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.

[0141] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the streaming media communication connection method described above, but can also perform related operations in the streaming media communication connection method provided in any embodiment of this application.

[0142] It is worth noting that in the above embodiments of the streaming media communication connection system, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not configured to limit the protection scope of the embodiments of this application.

[0143] It should be noted that the numbering of each step in this solution is only used to describe the overall design framework of this solution and does not indicate a necessary sequential relationship between the steps. As long as the overall implementation process conforms to the overall design framework of this solution, it falls within the protection scope of this solution. The literal order in the description is not an exclusive limitation on the specific implementation process of this solution. Those skilled in the art should understand that the embodiments of this application can be provided as methods, systems, or computer program products. In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-persistent memory in computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0144] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0145] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. A streaming media communication connection method, characterized in that, The streaming media communication connection method, applied to a network proxy module, includes: In response to a communication connection request sent by a client, a first TCP communication connection is established with the client, and a first socket corresponding to the connection information of the first TCP communication connection is generated; Based on the first TCP communication connection, a connection test packet sent by the client is received, the connection test packet including a connection identifier field; Based on the connection identifier field and the set first port mapping relationship, determine the target service port corresponding to the client among the local service ports provided by the media forwarding server; A second socket is generated based on the port information of the target service port, and a communication connection is established with the media forwarding server based on the second socket; Based on the communication connection, the connection information of the first socket is sent to the media forwarding server, so that the media forwarding server can establish a second TCP communication connection with the client based on the connection information of the first socket.

2. The streaming media communication connection method according to claim 1, characterized in that, The streaming media communication connection method further includes: Upon receiving the first media data packet sent by the first client, based on the connection identifier field in the first media data packet and the first port mapping relationship, the target service port corresponding to the first client in the local service port provided by the media forwarding server is determined, and the first media data packet is sent to the target service port so that the media forwarding server forwards it to the target client port; Upon receiving the second media data packet sent by the media forwarding server, the target port of the second client corresponding to the second media data packet is determined based on the connection identifier field in the second media data packet and the set second port mapping relationship, and the second media data packet is sent to the target port.

3. The streaming media communication connection method according to claim 1, characterized in that, Before establishing the first TCP communication connection with the client, the process also includes: The system receives session response description information and a first port mapping relationship sent by the media forwarding server. The session response description information is generated by the media forwarding server in response to the session request description information sent by the client. The first port mapping relationship is the association between the connection identifier field in the session response description information and the local service port provided by the media forwarding server. The local service port in the session response description information is replaced with the proxy port to obtain new session response description information, and the new session response description information is sent to the client.

4. The streaming media communication connection method according to claim 1, characterized in that, After receiving the connection test packet sent by the client based on the first TCP communication connection, the method further includes: A second port mapping relationship is established based on the connection identifier field in the connection test packet and the client port of the client.

5. A streaming media communication connection method, characterized in that, This is applied to a streaming media service system, which includes a network proxy module and a media forwarding server. The streaming media communication connection method includes: When the network proxy module receives a communication connection request sent by the client, it establishes a first TCP communication connection with the client and generates a first socket corresponding to the connection information of the first TCP communication connection. The network proxy module receives a connection test packet sent by the client based on the first TCP communication connection, and the connection test packet includes a connection identifier field. The network proxy module determines the target service port corresponding to the client from the local service ports provided by the media forwarding server based on the connection identifier field and the set first port mapping relationship; The network proxy module generates a second socket based on the port information of the target service port, and establishes a communication connection with the media forwarding server based on the second socket; The network proxy module sends the connection information of the first socket to the media forwarding server based on the communication connection. The media forwarding server establishes a second TCP communication connection with the client based on the connection information of the first socket.

6. The streaming media communication connection method according to claim 5, characterized in that, The streaming media communication connection method further includes: When the network proxy module receives the first media data packet sent by the first client, it determines the target service port corresponding to the first client in the local service port provided by the media forwarding server based on the connection identifier field in the first media data packet and the first port mapping relationship, and sends the first media data packet to the target service port. When the media forwarding server receives the first media data packet through the target service port, it forwards the first media data packet to the target client port; When the media forwarding server receives the second media data packet sent by the target client, it sends the second media data packet to the network proxy module; When the network proxy module receives the second media data packet, it determines the target port of the second client corresponding to the second media data packet based on the connection identifier field in the second media data packet and the set second port mapping relationship, and sends the second media data packet to the target port.

7. The streaming media communication connection method according to claim 5, characterized in that, The streaming media communication connection method further includes: When the media forwarding server receives the session request description information sent by the client, it extracts the first identifier field from the session request description information, concatenates the first identifier field with the generated second identifier field to obtain the connection identifier field, establishes a first port mapping relationship between the connection identifier field and the local service port, and sends the session response description information and the first port mapping relationship to the network proxy module. The session response description information includes the connection identifier field. When the network proxy module receives the session response description information and the first port mapping relationship, it replaces the local service port in the session response description information with the proxy port to obtain new session response description information, and sends the new session response description information to the client.

8. The streaming media communication connection method according to claim 5, characterized in that, After the network proxy module receives the connection test packet sent by the client based on the first TCP communication connection, it further includes: The network proxy module establishes a second port mapping relationship based on the connection identifier field in the connection test packet and the client port of the client.

9. The streaming media communication connection method according to claim 5, characterized in that, The streaming media communication connection method further includes: The media forwarding server receives media data packets sent by the client based on the second TCP communication connection and forwards the media data packets to the target client of the connection.

10. A streaming media communication connection device, characterized in that, The streaming media communication connection device, applied to the network proxy module, includes: The TCP communication connection module is configured to respond to a communication connection request sent by the client, establish a first TCP communication connection with the client, and generate a first socket corresponding to the connection information of the first TCP communication connection. The connection test packet receiving module is configured to receive a connection test packet sent by the client based on the first TCP communication connection, wherein the connection test packet includes a connection identifier field. The service port determination module is configured to determine the target service port corresponding to the client from the local service ports provided by the media forwarding server based on the connection identifier field and the set first port mapping relationship. The communication connection module is configured to generate a second socket based on the port information of the target service port, and establish a communication connection with the media forwarding server based on the second socket; The socket sending module is configured to send the connection information of the first socket to the media forwarding server based on the communication connection, so that the media forwarding server can establish a second TCP communication connection with the client based on the connection information of the first socket.

11. A streaming media communication connection device, the device comprising: One or more processors; A storage device configured to store one or more programs that, when executed by one or more processors, cause the one or more processors to implement the streaming media communication connection method according to any one of claims 1-9.

12. A non-volatile storage medium storing computer-executable instructions, which, when executed by a computer processor, are configured to perform the streaming media communication connection method of any one of claims 1-9.

Citation Information

Patent Citations

  • Method and device for realizing concurrent service on basis of TCP (transmission control protocol) connection

    CN102916953A

  • Multicast data forwarding method, apparatus and device, and readable storage medium

    CN112468886A