A media stream transmission method, a media server, and a communication system

By selecting the target media server in the media server cluster and directly sending channel parameter information, the problem of excessive delay in establishing media streaming channel in the prior art is solved, and the effect of reducing the delay in the first frame is achieved.

CN116233481BActive Publication Date: 2025-06-24SHENZHEN HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310002154.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-03
Publication Date
2025-06-24
Estimated Expiration
2043-01-03

AI Technical Summary

Technical Problem

The existing media streaming method has too much time overhead when establishing a media transmission channel, resulting in an increase in the delay of the first frame and cannot meet the delay threshold of some real-time communication services.

Method used

Before the load balancing server sends the SDP reply message, the target media server is selected from the media server cluster and directly includes the channel parameter information in the SDP reply message to the terminal, reducing the step of forwarding the message by the load balancing server.

Benefits of technology

The delay in establishing a media transmission channel is reduced, the delay in receiving the first frame of the terminal is reduced, and the performance of real-time communication services is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116233481B_ABST
    Figure CN116233481B_ABST
Patent Text Reader

Abstract

A media stream transmission method includes: a first media server obtaining cluster load information according to an SDP offer message sent by a load balancing server; selecting a target media server from a media server cluster according to the cluster load information and a media stream identifier carried in the SDP offer message; when the target media server is the first media server, the first media server determining channel parameter information of a first channel according to a server identifier of the first media server and the media stream identifier, and sending a first SDP response message including the channel parameter information of the first channel to a terminal; establishing the first channel according to the channel parameter information of the first channel; and sending a media stream to the terminal through the first channel. This method does not require the load balancing server to forward the first SDP response message, can reduce the time overhead for establishing a media transmission channel, and reduce the first-frame delay. The present application also provides a media server and a communication system capable of implementing the above method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and in particular, to a media stream transmission method, a media server, and a communication system. Background Art

[0002] Real-time communication technology refers to a method of using a network to transmit text messages, files, voice, and video in real time.

[0003] Currently, a media stream transmission method is generally as follows: The terminal sends a session description protocol (SDP) offer message to the load balancing server. The load balancing server negotiates a channel with the media server. The load balancing server generates an SDP response message according to the negotiation result of the channel parameters, and sends the SDP response message to the terminal. The terminal establishes a media transmission channel with the media server, and then transmits the media stream through the media transmission channel.

[0004] In practical applications, the time overhead of the above method will exceed the delay threshold of some real-time communication services. Summary of the Invention

[0005] In view of this, this application provides a media stream transmission method, which can reduce the delay of establishing a media transmission channel, thereby reducing the first-frame delay. This application also provides a media server, a communication system, a computer-readable storage medium, and a computer program product that can implement the above media stream transmission method.

[0006] The first aspect provides a media stream transmission method, including: after the load balancing server sends the SDP offer message from the terminal to the first media server, obtaining cluster load information according to the SDP offer message, and then selecting a target media server from the media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message; when the target media server is the first media server, the first media server determines the channel parameter information of the first channel according to the server identifier and the media stream identifier of the first media server, generates a first SDP response message including the channel parameter information of the first channel, and then sends the first SDP response message to the terminal; establishing a first channel according to the channel parameter information of the first channel; and then sending the media stream corresponding to the media stream identifier to the terminal through the first channel. Wherein, the first channel is the media transmission channel between the first media server and the terminal.

[0007] Implemented in this way, the first media server can directly send the first SDP response message carrying the channel parameter information of the first channel to the terminal. Compared with the existing media stream transmission method, the media stream transmission method of this application does not require the load balancing server to forward the first SDP response message, so the time overhead of establishing a media transmission channel can be reduced, thereby reducing the delay of the terminal receiving the first frame.

[0008] In a possible implementation, the media stream transmission method of the present application further includes: when the target media server is the second media server, the first media server determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier, generates a second SDP response message including the channel parameter information of the second channel; sends the second SDP response message to the terminal, and sends a media negotiation request including the media stream identifier to the second media server. The second media server can obtain the channel parameter information of the second channel according to the media negotiation request, and establish the second channel according to the channel parameter information of the second channel. The second channel is the media transmission channel between the second media server and the terminal. The first media server can select other media servers to provide media streams according to the cluster load information, so that the load of the media server cluster is more balanced.

[0009] In another possible implementation, the media stream transmission method of the present application further includes: when the target media server is the second media server, the first media server determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier; generates a second SDP response message including the channel parameter information of the second channel; sends the second SDP response message to the terminal; sends a media negotiation request to the second media server, and the media negotiation request includes the media stream identifier and the channel parameter information of the second channel.

[0010] In another possible implementation, the first media server selects a target media server from the media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message, including: the first media server performs a hash calculation on the media stream identifier carried in the SDP offer message to obtain a first hash value; performs a modulo operation on the first hash value and the number of cluster devices, and selects a candidate media server from the media server cluster according to the modulo operation result; when the load data volume of the candidate media server is less than the preset load threshold, the first media server determines that the target media server is the candidate media server; when the load data volume of the candidate media server is greater than or equal to the preset load threshold, the first media server determines that the target media server is the media server with a load data volume less than the preset load threshold among the remaining media servers. The hash values calculated based on different media stream identifiers have the characteristic of uniform distribution, which can reduce conflicts. In this way, a method for evenly distributing different media streams to each media server is provided.

[0011] In another possible implementation, the first media server determines the channel parameter information of the first channel according to the server identifier and media stream identifier of the first media server, including: the first media server performs a hashing operation on the server identifier and media stream identifier of the first media server to obtain a second hash value; selects a target UDP IP address from the UDP IP address resource pool of the first media server according to the second hash value; selects a target port number from the port resource pool of the first media server according to the second hash value; selects a target synchronization source identifier from the synchronization source range of the first media server according to the second hash value; generates the channel parameter information of the first channel including the target UDP IP address, the target port number, and the target synchronization source identifier. In this way, a specific method for calculating the channel parameter information is provided. It should be noted that the method for calculating the channel parameter information of each media server in the media server cluster is the same, so that the first media server can obtain the channel parameter information of other media servers.

[0012] In a second aspect, a media stream transmission method is provided. The communication system to which this method is applied includes a terminal, a load balancing server, and a media server cluster. The method includes: after receiving a media negotiation request sent by the first media server, the second media server obtains the server identifier and media stream identifier of the second media server according to the media negotiation request, then determines the channel parameter information of the second channel according to the server identifier and media stream identifier of the second media server, establishes the second channel according to the channel parameter information of the second channel included in the media negotiation request, and then sends the media stream corresponding to the media stream identifier to the terminal through the second channel. Among them, the media negotiation request includes the media stream identifier, and this method can instruct the media server receiving the media negotiation request to provide the media stream.

[0013] In a third aspect, a media stream transmission method is provided. The communication system to which this method is applied includes a terminal, a load balancing server, and a media server cluster. The method includes: the second media server receives a media negotiation request sent by the first media server, and the media negotiation request includes the media stream identifier and the channel parameter information of the second channel. Then, the second media server establishes the second channel according to the channel parameter information of the second channel included in the media negotiation request, and sends the media stream corresponding to the media stream identifier to the terminal through the second channel. Among them, this method can instruct the media server receiving the media negotiation request to provide the media stream. Moreover, the media negotiation request includes the media stream identifier and the channel parameter information of the second channel, and the second media server can obtain the channel parameter information of the second channel from the media negotiation request, without calculating the channel parameter information of the second channel according to the server identifier and media stream identifier of the second media server. Therefore, the time overhead and calculation overhead for obtaining the channel parameter information of the second channel can be reduced.

[0014] The fourth aspect provides a media stream transmission method, which includes: after the terminal sends an SDP offer message to the load balancing server, the load balancing server sends the SDP offer message to the first media server, and then the first media server obtains cluster load information according to the SDP offer message, and selects a target media server from the media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message; when the target media server is the first media server, the first media server determines the channel parameter information of the first channel according to the server identifier of the first media server and the media stream identifier, generates a first SDP response message including the channel parameter information of the first channel, and sends the first SDP response message to the terminal; establishes the first channel according to the channel parameter information of the first channel; and sends the media stream corresponding to the media stream identifier to the terminal through the first channel.

[0015] Implemented in this way, the first media server can directly send the first SDP response message carrying the channel parameter information of the first channel to the terminal. Compared with the existing media stream transmission method, the media stream transmission method of this application does not require the load balancing server to forward the first SDP response message, so the time overhead for establishing a media transmission channel can be reduced, thereby reducing the delay of the terminal receiving the first frame.

[0016] In a possible implementation manner, the media stream transmission method of this application further includes: when the server identifier of the target media server is the server identifier of the second media server, when the target media server is the second media server, the first media server determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier; generates a second SDP response message including the channel parameter information of the second channel; sends the second SDP response message to the terminal; the first media server sends a media negotiation request including the media stream identifier to the second media server; the second media server obtains the server identifier of the second media server and the media stream identifier according to the media negotiation request; determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier; establishes the second channel according to the channel parameter information of the second channel; and sends the media stream corresponding to the media stream identifier to the terminal through the second channel. The first media server can select other media servers to provide media streams according to the cluster load information, so that the load of the media server cluster is more balanced.

[0017] In another possible implementation, the media stream transmission method of the present application further includes: when the target media server is the second media server, the first media server determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier, generates a second SDP response message including the channel parameter information of the second channel, and then sends the second SDP response message to the terminal. Moreover, the first media server sends a media negotiation request to the second media server, and the media negotiation request includes the media stream identifier and the channel parameter information of the second channel; the second media server establishes the second channel according to the channel parameter information of the second channel carried in the media negotiation request; and sends the media stream corresponding to the media stream identifier to the terminal through the second channel.

[0018] The first media server can select other media servers to provide media streams according to the cluster load information, so that the load of the media server cluster is more balanced. Moreover, the second media server can obtain the channel parameter information of the second channel from the media negotiation request, so that it does not need to calculate the channel parameter information of the second channel according to the server identifier and media stream identifier of the second media server, and thus the time overhead and calculation overhead for obtaining the channel parameter information of the second channel can be reduced.

[0019] A fifth aspect provides a media server, which includes a receiving module, a processing module, and a sending module; the receiving module is used to receive the SDP offer message sent by the load balancing server, and the processing module is used to obtain the cluster load information according to the SDP offer message; select a target media server from the media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message; when the target media server is the first media server, determine the channel parameter information of the first channel according to the server identifier of the first media server and the media stream identifier; generate a first SDP response message including the channel parameter information of the first channel; the sending module is used to send the first SDP response message to the terminal; the processing module is further used to establish the first channel according to the channel parameter information of the first channel; the sending module is further used to send the media stream to the terminal through the first channel. This media server can be used as the first media server.

[0020] In a possible implementation, the processing module is further used to, when the target media server is the second media server, determine the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier, and generate a second SDP response message including the channel parameter information of the second channel; the sending module is further used to send the second SDP response message to the terminal, and send a media negotiation request including the media stream identifier to the second media server.

[0021] In another possible implementation, the processing module is further configured to, when the target media server is the second media server, determine the channel parameter information of the second channel according to the server identifier and media stream identifier of the second media server; generate a second SDP response message including the channel parameter information of the second channel; the sending module is further configured to send the second SDP response message to the terminal; and send a media negotiation request to the second media server, where the media negotiation request includes the media stream identifier and the channel parameter information of the second channel.

[0022] In another possible implementation, specifically, when the cluster load information includes the load amount and the number of cluster devices, the processing module is configured to perform a hash calculation on the media stream identifier carried in the SDP offer message to obtain a first hash value; perform a modulo operation on the first hash value and the number of cluster devices; select a candidate media server from the media server cluster according to the modulo operation result; when the load data volume of the candidate media server is less than a preset load threshold, determine the target media server as the candidate media server; when the load data volume of the candidate media server is greater than or equal to the preset load threshold, determine the target media server as the media server with a load data volume less than the preset load threshold among the remaining media servers.

[0023] In another possible implementation, specifically, the processing module is configured to perform a hash operation on the server identifier and media stream identifier of the first media server to obtain a second hash value; select a target UDP IP address from the UDP IP address resource pool of the first media server according to the second hash value; select a target port number from the port resource pool of the first media server according to the second hash value; select a target synchronization source identifier from the synchronization source range of the first media server according to the second hash value; and generate the channel parameter information of the first channel including the target UDP IP address, the target port number, and the target synchronization source identifier.

[0024] For the steps, glossary, and beneficial effects executed by each module in the fifth aspect, reference may be made to the corresponding descriptions in the first aspect.

[0025] A sixth aspect provides a media server, which includes a receiving module, a processing module, and a sending module; the receiving module is configured to receive a media negotiation request sent by a first media server, where the media negotiation request includes a media stream identifier; the processing module is configured to obtain the server identifier and media stream identifier of a second media server according to the media negotiation request; determine the channel parameter information of a second channel according to the server identifier and media stream identifier of the second media server; establish a second channel according to the channel parameter information of the second channel; the sending module is configured to send a media stream to a terminal through the second channel. For the steps, glossary, and beneficial effects executed by each module in the sixth aspect, reference may be made to the corresponding descriptions in the second aspect.

[0026] The seventh aspect provides a media server, which includes a receiving module, a processing module, and a sending module; the receiving module is configured to receive a media negotiation request sent by a first media server, and the media negotiation request includes a media stream identifier and channel parameter information of a second channel; the processing module is configured to establish the second channel according to the channel parameter information of the second channel; the sending module is configured to send a media stream to a terminal through the second channel. For the steps, glossary, and beneficial effects performed by each module in the seventh aspect, reference may be made to the corresponding descriptions in the third aspect.

[0027] The eighth aspect provides a communication system, which includes a terminal, a load balancing server, and a first media server; the terminal is configured to send an SDP offer message to the load balancing server; the load balancing server is configured to send the SDP offer message to the first media server; the first media server is configured to obtain cluster load information according to the SDP offer message; select a target media server from a media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message; when the target media server is the first media server, determine channel parameter information of a first channel according to the server identifier of the first media server and the media stream identifier; generate a first SDP answer message including the channel parameter information of the first channel; send the first SDP answer message to the terminal; establish the first channel according to the channel parameter information of the first channel; and send a media stream to the terminal through the first channel.

[0028] In a possible implementation manner, when the target media server is a second media server, the first media server is further configured to determine channel parameter information of a second channel according to the server identifier of the second media server and the media stream identifier; generate a second SDP answer message including the channel parameter information of the second channel; send the second SDP answer message to the terminal; the first media server is further configured to send a media negotiation request including the media stream identifier to the second media server; the second media server is configured to obtain the server identifier of the second media server and the media stream identifier according to the media negotiation request; determine the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier; establish the second channel according to the channel parameter information of the second channel; and send a media stream to the terminal through the second channel.

[0029] In another possible implementation, when the target media server is the second media server, the first media server is further configured to determine the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier; generate a second SDP response message including the channel parameter information of the second channel, and then send the second SDP response message to the terminal, and send a media negotiation request to the second media server, where the media negotiation request includes the media stream identifier and the channel parameter information of the second channel; the second media server is configured to establish the second channel according to the channel parameter information of the second channel carried in the media negotiation request; and send the media stream corresponding to the media stream identifier to the terminal through the second channel.

[0030] For the steps executed by each device in the eighth aspect, the glossary and the beneficial effects can refer to the corresponding descriptions in the fourth aspect.

[0031] The ninth aspect provides a computing device cluster, which includes at least one computing device, and each computing device includes a processor and a memory; the processor of the at least one computing device is configured to execute the instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method described in the first aspect, the second aspect or the third aspect.

[0032] The tenth aspect provides a computing device cluster, which includes at least one computing device, and each computing device includes a processor and a memory; the processor of the at least one computing device is configured to execute the instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method described in the fourth aspect.

[0033] The eleventh aspect provides a computer-readable storage medium, which includes computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method described in the first aspect, the second aspect, the third aspect or the fourth aspect.

[0034] The twelfth aspect provides a computer program product including instructions. When the instructions are run by a computing device cluster, the computing device cluster is caused to execute the method described in the first aspect, the second aspect, the third aspect or the fourth aspect.

[0035] The thirteenth aspect provides a chip system, which includes at least one processor, the processor is coupled to a memory, the memory is configured to store a computer program or instructions, and the processor is configured to execute the computer program or instructions to implement the method described in the first aspect, the second aspect, the third aspect or the fourth aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic diagram of an application scenario in an embodiment of the present application;

[0037] Figure 2 It is a signaling diagram of an existing media stream transmission method;

[0038] Figure 3 It is a flowchart of the media stream transmission method in an embodiment of the present application;

[0039] Figure 4 It is a signaling diagram of the media stream transmission method in an embodiment of the present application;

[0040] Figure 5 It is a structural diagram of a media server in an embodiment of the present application;

[0041] Figure 6 It is a schematic diagram of a communication system in an embodiment of the present application;

[0042] Figure 7 It is a structural diagram of a computing device in an embodiment of the present application;

[0043] Figure 8 It is a schematic diagram of a computing device cluster in an embodiment of the present application;

[0044] Figure 9 It is another schematic diagram of a computing device cluster in an embodiment of the present application. Detailed implementation manners

[0045] The media stream transmission method of the present application can be applied to real-time communication scenarios, such as low latency live (LLL) scenarios like online education, e-commerce live streaming, sports event live streaming, or exhibition live streaming. For large-scale low latency services such as e-commerce live streaming and sports event live streaming, the end-to-end latency should be less than 1000 milliseconds. In some scenarios, the first frame latency requirement for low latency live services is less than 400 milliseconds.

[0046] The following introduces the communication system applied to the real-time communication scenario. Refer to Figure 1 , in one example, the communication system of the present application includes a terminal 110, the Internet 120, a load balancing server 130, and a media server cluster 140. The terminal 110 is connected to the load balancing server 130 through the Internet 120. The media server cluster 140 includes multiple media servers, such as media server 141, media server 142, and media server 143, etc. The load balancing server 130 establishes communication connections with each media server in the media server cluster 140.

[0047] The terminal 110 can be a terminal device such as a mobile phone, a personal computer, a tablet computer, a wearable device, or an in-vehicle computer. The load balancing server 130 can be a signaling server with load balancing capabilities. The load balancing server 130 negotiates channel parameters with a certain media server and acts as a signaling relay. The media server is used to provide various media streams, such as e-commerce live video, sports live video, etc. It should be understood that the number of terminals, the number of load balancing servers, and the number of media servers in the media server cluster in the communication system are not limited to the above examples.

[0048] The following details the existing media stream transmission process based on this communication system. Refer to Figure 2 In one example, the existing media stream transmission process includes:

[0049] Step 201: The terminal 110 sends an SDP offer message (i.e., SDP OFFER) to the load balancing server 130.

[0050] After receiving the SDP offer message, the load balancing server 130 selects an idle media server 141 from the media server cluster 140 according to the SDP offer message.

[0051] Step 202: The load balancing server 130 sends a channel parameter negotiation request to the media server 141.

[0052] Step 203: The media server 141 sends a channel parameter negotiation result to the load balancing server 130.

[0053] Step 204: The load balancing server 130 sends an SDP answer message (i.e., SDP ANSWER) to the terminal 110.

[0054] Step 205: The terminal 110 establishes a media transmission channel with the media server 141 according to the SDP answer message.

[0055] Step 206: The media server 141 sends a media stream to the terminal 110 through the media transmission channel.

[0056] Step 207: The terminal 110 renders the video according to the media stream.

[0057] In the existing media stream transmission process, the time overheads of steps 201, 202, 203, and 204 are respectively denoted as T1, T2, T3, and T4. Then the time overhead for negotiating the media transmission channel is equal to T1 + T2 + T3 + T4.

[0058] In the media stream transmission method of this application, the media server can directly send the result of channel parameter negotiation to the terminal without forwarding by the load balancing server, which can reduce the time overhead. The media stream transmission method of this application will be introduced in detail based on the above communication system. Refer to Figure 3 In one embodiment, the media stream transmission method of this application includes:

[0059] Step 301, the first media server receives the SDP offer message sent by the load balancing server.

[0060] Specifically, after the terminal sends the SDP offer message to the load balancing server, the load balancing server sends the SDP offer message to the first media server. The first media server can be any media server in the media server cluster.

[0061] Step 302, the first media server obtains the cluster load information according to the SDP offer message. The cluster load information includes the load amount and the number of cluster devices. Optionally, the cluster load information further includes the weight of the media server.

[0062] The media server cluster can be configured with shared data, and the shared data includes one or more of the server identifier of each media server, the load amount of each media server, the weight of each media server, the user datagram protocol (UDP) internet protocol (IP) address resource of each media server, the port resource of each media server, and the synchronization source range of each media server. Each media server can obtain data from the shared data according to requirements.

[0063] Step 303, the first media server selects a target media server from the media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message.

[0064] Step 304, when the target media server is the first media server, the first media server determines the channel parameter information of the first channel according to the server identifier of the first media server and the media stream identifier.

[0065] The media stream identifier can be but is not limited to the media stream name. The first channel of this application is the media transmission channel between the first media server and the terminal. The channel parameter information of this application includes but is not limited to the UDP IP address of the media server, the port number of the media server, and the synchronization source identifier.

[0066] Step 305, the first media server generates a first SDP response message including the channel parameter information of the first channel.

[0067] Step 306: The first media server sends the first SDP response message to the terminal.

[0068] Step 307: The first media server establishes the first channel according to the channel parameter information of the first channel.

[0069] Specifically, after the terminal obtains the channel parameter information of the first channel, the first media server and the terminal establish the first channel according to the channel parameter information of the first channel.

[0070] Establishing the first channel may include an Interactive Connectivity Establishment (ICE) hole punching process. Optionally, the ICE hole punching process includes: the terminal sends a Session Traversal Utilities for Network Address Translation (STUN) binding request to the first media server according to the first SDP response message, the first media server sends a STUN binding response to the terminal in response to the STUN binding request, and then the first media server and the terminal establish a peer link for transmitting the media stream.

[0071] Step 308: The first media server sends the media stream to the terminal through the first channel. After receiving the media stream, the terminal renders the media stream and then outputs the media stream (such as video). This media stream corresponds to the media stream identifier.

[0072] In this embodiment, the first media server can obtain the channel parameter information of the first channel and directly send the SDP response message carrying the channel parameter information of the first channel to the terminal, saving the communication negotiation steps (i.e., steps 202 and 203) between the load balancing server and the media server in the existing media stream transmission process. The sum of the time overhead of step 202 (i.e., T2) and the time overhead of step 203 (i.e., T3) is about 40 milliseconds. Therefore, the delay for the terminal to receive the first frame can be reduced by about 40 milliseconds.

[0073] In an optional embodiment, the media stream transmission method of the present application further includes: when the target media server is the second media server, the first media server determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier; generates a second SDP response message including the channel parameter information of the second channel; sends the second SDP response message to the terminal, and sends a media negotiation request including the media stream identifier to the second media server. Wherein, the second channel is the media transmission channel between the second media server and the terminal.

[0074] In this embodiment, the first media server may determine the channel parameter information of the second channel, carry it after the second SDP response message, and send it to the terminal. Moreover, the first media server sends a media negotiation request to the second media server, instructing the second media server to determine the channel parameter information of the second channel according to the server identifier and media stream identifier of the second media server. In this way, the terminal obtaining the channel parameters of the second channel and the second media server obtaining the channel parameters of the second channel are parallel. Then, the terminal and the second media server can establish the second channel according to the channel parameters of the second channel. The first media server can directly send the channel parameters of the second channel to the terminal without the need for a load balancing server to forward, nor does the second media server need to send the channel parameters of the second channel to the terminal. Therefore, the time overhead for establishing the second channel can be reduced, that is, the first-frame delay of transmitting the media stream on the second channel can be reduced.

[0075] In another optional embodiment, the media stream transmission method of the present application further includes: when the target media server is the second media server, the first media server determines the channel parameter information of the second channel according to the server identifier and media stream identifier of the second media server; generates a second SDP response message including the channel parameter information of the second channel; sends the second SDP response message to the terminal; and sends a media negotiation request to the second media server, where the media negotiation request includes the media stream identifier and the channel parameter information of the second channel.

[0076] In this embodiment, the first media server may determine the channel parameter information of the second channel, carry it after the second SDP response message, and send it to the terminal. The first media server may also carry the channel parameter information of the second channel in the media negotiation request and send it to the second media server. In this way, the terminal obtaining the channel parameters of the second channel and the second media server obtaining the channel parameters of the second channel are parallel. Then, the terminal and the second media server can establish the second channel according to the channel parameters of the second channel. In this way, there is no need for a load balancing server and the second media server to send the channel parameters of the second channel to the terminal. Therefore, the time overhead for establishing the second channel can be reduced.

[0077] Moreover, the second media server does not need to calculate the channel parameter information of the second channel according to the server identifier and media stream identifier of the second media server, which can reduce the time overhead and calculation overhead for the second media server to obtain the channel parameter information of the second channel.

[0078] The present application can select different media servers to provide media streams according to the cluster load information. In one embodiment, the cluster load information includes the load amount and the number of cluster devices;

[0079] Step 303 includes: the first media server calculates the hash value of the media stream identifier carried in the SDP offer message to obtain the first hash value; performs a modulo operation on the first hash value and the number of cluster devices; selects a candidate media server from the media server cluster according to the modulo operation result; when the load data volume of the candidate media server is less than the preset load threshold, the first media server determines that the target media server is the candidate media server; when the load data volume of the candidate media server is greater than or equal to the preset load threshold, the first media server determines that the target media server is the media server with a load data volume less than the preset load threshold among the remaining media servers.

[0080] Among them, the load threshold is used to measure whether the media server can provide the media stream. When the load of the media server is less than the load threshold, it indicates that the media server can provide the media stream for the terminal, otherwise it cannot. During the modulo operation, the cluster devices are used as the modulus.

[0081] In this embodiment, the result of the modulo operation can be the number of the media server. For example, if the result of the modulo operation is 3, then the 3rd media server is the candidate server. When the load data volume of the candidate media server is greater than or equal to the preset load threshold, the next media server can be selected as the candidate media server according to the number order until the load data volume of the candidate media server is less than the preset load threshold. The first media server can select the media server with less load to provide the media stream, making the load of the media server cluster more balanced.

[0082] This application can also select the target media server from the media server cluster in other ways. For example, when the loads of multiple media servers are less than the load threshold, the media server with the minimum load can be selected as the target media server, or the difference between the load of each media server and the load threshold can be calculated, and the media server corresponding to the largest difference can be selected as the target media server. The load thresholds of different media servers can be set to different values according to the weights of the media servers.

[0083] In another alternative embodiment, step 304 includes: the first media server performs a hashing operation on the server identifier and the media stream identifier of the first media server to obtain a second hash value; the first media server selects a target UDP IP address from the user datagram protocol (UDP) internet protocol (IP) address resource pool of the first media server according to the second hash value; the first media server selects a target port number from the port resource pool of the first media server according to the second hash value; the first media server selects a target synchronization source identifier from the synchronization source range of the first media server according to the second hash value; the first media server generates channel parameter information for the first channel including the target UDP IP address, the target port number, and the target synchronization source identifier.

[0084] In this embodiment, the hash values calculated according to different server identifiers and media stream identifiers have the characteristic of uniform distribution, which can reduce the collision probability of IP addresses, port numbers, or synchronization identifiers. Therefore, different channel parameter information can be configured for different media streams of each media server.

[0085] The process for the first media server to determine the channel parameter information of the second channel is similar to the process for the first media server to determine the channel parameter information of the first channel. Specifically, the first media server determines the channel parameter information of the second channel according to the server identifier and the media stream identifier of the second media server, including: the first media server performs a hashing operation on the server identifier and the media stream identifier of the second media server; selects a UDP IP address from the UDP IP address resource pool of the second media server according to the hash value obtained from the hash calculation; selects a port number from the port resource pool of the second media server according to the hash value; selects a synchronization source identifier from the synchronization source range of the second media server according to the hash value; generates the channel parameter information of the second channel according to the selected UDP IP address, port number, and synchronization source identifier. The process for the second media server to determine the channel parameter information of the second channel is the same as the process for the first media server to determine the channel parameter information of the second channel.

[0086] The process of the second media server executing the media stream transmission method is introduced below. In one embodiment, the media stream transmission method of the present application includes: the second media server receives a media negotiation request sent by the first media server, and the media negotiation request includes a media stream identifier. Obtain the server identifier and media stream identifier of the second media server according to the media negotiation request; determine the channel parameter information of the second channel according to the server identifier and media stream identifier of the second media server; establish the second channel according to the channel parameter information of the second channel; send the media stream corresponding to the media stream identifier to the terminal through the second channel. In this embodiment, for the steps, glossary and beneficial effects executed by the second media server, reference can be made to the corresponding records in the foregoing text.

[0087] In another embodiment, the media stream transmission method of the present application includes: the second media server receives a media negotiation request sent by the first media server, and the media negotiation request includes a media stream identifier and the channel parameter information of the second channel; establish the second channel according to the channel parameter information of the second channel; send the media stream corresponding to the media stream identifier to the terminal through the second channel. In this embodiment, for the steps, glossary and beneficial effects executed by the second media server, reference can be made to the corresponding records in the foregoing text.

[0088] Optionally, the first media server and the second media server of the present application belong to the same media server cluster, and the media server cluster provides the same type of media stream. Existing media server clusters include different types of media servers, and the load balancing server does not recognize the media stream identifier, which may select the wrong media server. For example, when the load balancing server receives an SDP offer message associated with a video live service, the load balancing server negotiates media with a media server providing a conference service, which may cause the media server to be unable to provide the media stream or the service quality of the media stream provided by the media server not to meet the service quality requirements of the video live.

[0089] The process of the communication system executing the media stream transmission method is introduced below. Refer to Figure 4 , in another embodiment, the media stream transmission method of the present application includes:

[0090] Step 401, the terminal sends an SDP offer message to the load balancing server.

[0091] Step 402, the load balancing server sends the SDP offer message to the first media server.

[0092] Step 403, the first media server obtains the cluster load information according to the SDP offer message.

[0093] Step 404, the first media server selects a target media server from the media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message.

[0094] Step 405: When the target media server is the first media server, the first media server determines the channel parameter information of the first channel according to the server identifier and media stream identifier of the first media server.

[0095] Step 406: The first media server generates a first SDP response message including the channel parameter information of the first channel.

[0096] Step 407: The first media server sends the first SDP response message to the terminal.

[0097] Step 408: The first media server establishes the first channel according to the channel parameter information of the first channel.

[0098] After the terminal receives the first SDP response message, the first media server and the terminal establish the first channel according to the channel parameter information of the first channel.

[0099] Step 409: The first media server sends the media stream to the terminal through the first channel.

[0100] Step 410: When the target media server is the second media server, the first media server determines the channel parameter information of the second channel according to the server identifier and media stream identifier of the second media server. The second channel is the media transmission channel between the second media server and the terminal.

[0101] Step 411: The first media server generates a second SDP response message including the channel parameter information of the second channel.

[0102] Step 412: The first media server sends the second SDP response message to the terminal.

[0103] Step 413: The first media server sends a media negotiation request to the second media server. The media negotiation request includes the media stream identifier.

[0104] There is no fixed order between Step 412 and Step 413, and the two steps can be executed simultaneously.

[0105] Step 414: The second media server obtains the server identifier and media stream identifier of the second media server according to the media negotiation request.

[0106] In the media server cluster of the present application, different media servers are configured with the same rule for obtaining channel parameter information. The channel parameter information of the second channel obtained by the first media server and the terminal is the same as that obtained by the second media server.

[0107] Step 415: The second media server determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier.

[0108] Step 416: The second media server establishes the second channel according to the channel parameter information of the second channel.

[0109] After the terminal receives the second SDP response message, the second media server and the terminal establish the second channel according to the channel parameter information of the second channel.

[0110] Step 417: The second media server sends the media stream to the terminal through the second channel.

[0111] In this embodiment, the first media server can determine the media server (i.e., the target media server) for transmitting the media stream. When the target media server is the first media server, the first media server can directly obtain the channel parameters of the first channel, and then send the SDP response message carrying the channel parameter information of the first channel to the terminal. In this way, obtaining the channel parameters of the first channel does not require the load balancing server and the first media server to perform channel negotiation, nor does it require the load balancing server to forward the channel parameters of the first channel. Therefore, the time overhead of step 202 (i.e., T2) and the time overhead of step 203 (i.e., T3) can be reduced, and the delay can be reduced by about 40 milliseconds.

[0112] When the target media server is the second media server, after the first media server obtains the channel parameters of the second channel, it sends the SDP response message carrying the channel parameter information of the second channel to the terminal. The first media server sending the SDP response message to the terminal and the second media server obtaining the channel parameters of the second channel can be parallel, and it does not require the load balancing server to forward the channel parameters of the first channel. Therefore, the time overhead of step 203 (i.e., T3) can be reduced. In this way, the time overhead of SDP communication negotiation is T1 + Max(T2, T4), and the delay can be reduced by about 35 milliseconds.

[0113] When the user watches media streams such as videos or switches media streams, the method of the present application can reduce the delay of each media stream, and thus can effectively improve the user experience.

[0114] In another embodiment, the media stream transmission method of the present application may not execute steps 413 to 417 after step 412, but instead, the first media server sends a media negotiation request to the second media server. The media negotiation request includes a media stream identifier and channel parameter information of the second channel. After receiving the media negotiation request, the second media server establishes the second channel according to the channel parameter information of the second channel carried in the media negotiation request, and sends the media stream corresponding to the media stream identifier to the terminal through the second channel. This embodiment can reduce the time overhead of step 203 (i.e., T3). In this way, the time overhead of SDP communication negotiation is T1 + Max(T2, T4), and the delay can be reduced by about 35 milliseconds.

[0115] The present application provides a media server capable of implementing Figure 3 the steps executed by the first media server in the illustrated embodiment. Refer to Figure 5 In one embodiment, the media server 500 includes a receiving module 501, a processing module 502, and a sending module 503.

[0116] The receiving module 501 is configured to receive an SDP offer message sent by the load balancing server;

[0117] The processing module 502 is configured to obtain cluster load information according to the SDP offer message; select a target media server from the media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message; when the target media server is the first media server, determine the channel parameter information of the first channel according to the server identifier and the media stream identifier of the first media server; generate a first SDP answer message including the channel parameter information of the first channel;

[0118] The sending module 503 is configured to send the first SDP answer message to the terminal;

[0119] The processing module 502 is further configured to establish the first channel according to the channel parameter information of the first channel;

[0120] The sending module 503 is further configured to send the media stream to the terminal through the first channel.

[0121] Among them, the receiving module 501, the processing module 502, and the sending module 503 can all be implemented by software or by hardware. Exemplarily, next, taking the processing module 502 as an example, the implementation manner of the processing module 502 is introduced. Similarly, the implementation manners of the receiving module 501 and the sending module 503 can refer to the implementation manner of the processing module 502.

[0122] As an example of a software functional unit, the processing module 502 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above computing instance may be one or more. For example, the processing module 502 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers for running the code may be distributed in the same region or in different regions. Further, the multiple hosts / virtual machines / containers for running the code may be distributed in the same availability zone (AZ) or in different AZs, and each AZ includes one data center or multiple geographically proximate data centers. Usually, one region may include multiple AZs.

[0123] Similarly, the multiple hosts / virtual machines / containers for running the code may be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, one VPC is set within one region. For cross-region communication between two VPCs within the same region and between VPCs in different regions, a communication gateway needs to be set in each VPC, and the interconnection between VPCs is achieved through the communication gateway.

[0124] As an example of a hardware functional unit, the processing module 502 may include at least one computing device, such as a server, etc. Alternatively, the processing module 502 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). Among them, the above PLD may be implemented by a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0125] The multiple computing devices included in the processing module 502 can be distributed in the same region or in different regions. The multiple computing devices included in the processing module 502 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the processing module 502 can be distributed in the same VPC or in multiple VPCs. Among them, the multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0126] It should be noted that in other embodiments, the processing module 502 can be used to execute Figure 3 the steps shown in the embodiments to Figure 4 any step of the media stream transmission method in the embodiments shown, and the receiving module 501 can be used to execute Figure 3 the steps shown in the embodiments to Figure 4 any step of the media stream transmission method in the embodiments shown. The sending module 503 can be used to execute Figure 3 the steps shown in the embodiments to Figure 4 any step of the media stream transmission method in the embodiments shown. The steps to be implemented by the receiving module 501, the processing module 502, and the sending module 503 can be specified as needed. By implementing different steps of the media stream transmission method through the receiving module 501, the processing module 502, and the sending module 503 respectively, all functions of the first media server or the second media server are realized.

[0127] In an alternative embodiment, when the target media server is the second media server, the processing module 502 is further configured to determine the channel parameter information of the second channel according to the server identifier and the media stream identifier of the second media server; generate a second SDP response message including the channel parameter information of the second channel;

[0128] The sending module 503 is further configured to send the second SDP response message to the terminal and send a media negotiation request including the media stream identifier to the second media server.

[0129] In another alternative embodiment, when the target media server is the second media server, the processing module 502 is further configured to determine the channel parameter information of the second channel according to the server identifier and the media stream identifier of the second media server; generate a second SDP response message including the channel parameter information of the second channel; the sending module 503 is further configured to send the second SDP response message to the terminal; and send a media negotiation request to the second media server, where the media negotiation request includes the media stream identifier and the channel parameter information of the second channel.

[0130] In another alternative embodiment, the processing module 502 is specifically configured to, when the cluster load information includes the load amount and the number of cluster devices, perform a hash calculation on the media stream identifier carried in the SDP offer message to obtain a first hash value; perform a modulo operation on the first hash value and the number of cluster devices; select a candidate media server from the media server cluster according to the modulo operation result; when the load data volume of the candidate media server is less than a preset load threshold, determine that the target media server is the candidate media server; when the load data volume of the candidate media server is greater than or equal to the preset load threshold, determine that the target media server is the media server with a load data volume less than the preset load threshold among the remaining media servers.

[0131] In another alternative embodiment, the processing module 502 is specifically configured to perform a hash operation on the server identifier and the media stream identifier of the first media server to obtain a second hash value; select a target UDP IP address from the UDP IP address resource pool of the first media server according to the second hash value; select a target port number from the port resource pool of the first media server according to the second hash value; select a target synchronization source identifier from the synchronization source range of the first media server according to the second hash value; generate channel parameter information of the first channel including the target UDP IP address, the target port number, and the target synchronization source identifier.

[0132] Figure 5 The media server shown can implement the steps performed by the second media server in the above embodiments. In another embodiment, the receiving module 501 is configured to receive a media negotiation request sent by the first media server, and the media negotiation request includes a media stream identifier; the processing module 502 is configured to obtain the server identifier and the media stream identifier of the second media server according to the media negotiation request; determine the channel parameter information of the second channel according to the server identifier and the media stream identifier of the second media server; establish the second channel according to the channel parameter information of the second channel; the sending module 503 is configured to send a media stream to the terminal through the second channel.

[0133] In another embodiment, the receiving module 501 is configured to receive a media negotiation request sent by the first media server, and the media negotiation request includes a media stream identifier and the channel parameter information of the second channel; the processing module 502 is configured to establish the second channel according to the channel parameter information of the second channel; the sending module 503 is configured to send a media stream to the terminal through the second channel.

[0134] This application provides a communication system capable of implementing Figure 4 the media stream transmission method of the shown embodiment. Refer to Figure 6 , in one embodiment, the communication system 600 includes a terminal 601, a load balancing server 602, and a media server 603.

[0135] The terminal 601 is used to send an SDP offer message to the load balancing server 602;

[0136] The load balancing server 602 is used to send the SDP offer message to the media server 603;

[0137] The media server 603 is used to obtain cluster load information according to the SDP offer message; select a target media server from the media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message; when the target media server is the media server 603, determine the channel parameter information of the first channel according to the server identifier and the media stream identifier of the media server 603; generate a first SDP response message including the channel parameter information of the first channel; send the first SDP response message to the terminal;

[0138] The media server 603 is further used to establish the first channel according to the channel parameter information of the first channel; send the media stream to the terminal through the first channel.

[0139] The media server 603 may include code running on a computing instance. Among them, the computing instance may be at least one of computing devices such as a physical host (computing device), a virtual machine, a container, etc. Further, the above computing devices may be one or more. For example, the media server 603 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the application may be distributed in the same region or in different regions. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same AZ or in different AZs, and each AZ includes one data center or multiple geographically proximate data centers. Among them, generally one region may include multiple AZs.

[0140] Similarly, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same VPC or in multiple VPCs. Among them, generally one VPC is set within one region. For cross-region communication between two VPCs within the same region and between VPCs in different regions, a communication gateway needs to be set in each VPC, and the interconnection between VPCs is realized through the communication gateway.

[0141] The media server 603 may include at least one computing device, such as a server, etc. Or, the media server 603 may also be a device implemented by ASIC or PLD, etc. Among them, the above PLD may be implemented by CPLD, FPGA, GAL or any combination thereof.

[0142] The multiple computing devices included in media server 603 can be distributed in the same region or in different regions. The multiple computing devices included in media server 603 can be distributed in the same availability zone (AZ) or in different AZs. Similarly, the multiple computing devices included in media server 603 can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Among them, the multiple computing devices can be any combination of computing devices such as servers, application-specific integrated circuits (ASICs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), and generic array logic (GALs).

[0143] In an alternative embodiment, communication system 600 further includes media server 604;

[0144] When the target media server is media server 604, media server 603 is further configured to determine the channel parameter information of the second channel according to the server identifier and media stream identifier of media server 604; generate a second Session Description Protocol (SDP) response message including the channel parameter information of the second channel; and send the second SDP response message to terminal 601;

[0145] Media server 603 sends a media negotiation request to media server 604;

[0146] Media server 604 obtains the server identifier and media stream identifier of media server 604 according to the media negotiation request; determines the channel parameter information of the second channel according to the server identifier and media stream identifier of media server 604; establishes the second channel according to the channel parameter information of the second channel; and sends the media stream to terminal 601 through the second channel.

[0147] In another alternative embodiment, when the target media server is media server 604, media server 603 is further configured to determine the channel parameter information of the second channel according to the server identifier and media stream identifier of media server 604; generate a second SDP response message including the channel parameter information of the second channel; and send the second SDP response message to terminal 601;

[0148] Media server 603 is further configured to send a media negotiation request to media server 604, where the media negotiation request includes the media stream identifier and the channel parameter information of the second channel;

[0149] Media server 604 is configured to establish the second channel according to the channel parameter information of the second channel carried in the media negotiation request; and send the media stream corresponding to the media stream identifier to terminal 601 through the second channel.

[0150] It should be understood that media server 603 can execute the steps executed by the first media server in the embodiment shown in Figure 4 Media server 604 can execute Figure 4Steps performed by the second media server in the illustrated embodiment.

[0151] This application also provides a computing device 700. As Figure 7 shown, the computing device 700 includes: a bus 702, a processor 704, a memory 706, and a communication interface 708. The processor 704, the memory 706, and the communication interface 708 communicate with each other via the bus 702. The computing device 700 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 700.

[0152] The bus 702 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 7 only one line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus. The bus 704 can include a path for transmitting information between various components of the computing device 700 (for example, the memory 706, the processor 704, and the communication interface 708).

[0153] The processor 704 can include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), etc.

[0154] The memory 706 can include volatile memory, such as random access memory (RAM). The processor 704 can also include non-volatile memory, such as read-only memory (ROM), flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0155] The memory 706 stores executable program code, and the processor 704 executes the executable program code to respectively implement the functions of the foregoing receiving module, processing module, and sending module, thereby implementing the media stream transmission method. That is, instructions for executing the media stream transmission method are stored on the memory 706.

[0156] Alternatively, executable code is stored in the memory 706, and the processor 704 executes the executable code to implement the functions of the foregoing terminal 601, load balancing server 602, media server 603, and media server 604 respectively, thereby implementing the media stream transmission method. That is, instructions for executing the media stream transmission method are stored on the memory 706.

[0157] The communication interface 703 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 700 and other devices or communication networks.

[0158] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0159] As Figure 8 shown, the computing device cluster includes at least one computing device 700. Instructions for executing the media stream transmission method that are the same may be stored in the memory 706 of one or more of the computing devices 700 in the computing device cluster.

[0160] In some possible implementation manners, partial instructions for executing the media stream transmission method may also be stored separately in the memory 706 of one or more of the computing devices 700 in the computing device cluster. In other words, a combination of one or more of the computing devices 700 may jointly execute the instructions for executing the media stream transmission method.

[0161] It should be noted that different instructions may be stored in the memories 706 of different computing devices 700 in the computing device cluster, which are respectively used to execute partial functions of the media server. That is, the instructions stored in the memories 706 of different computing devices 700 may implement the functions of one or more of the receiving module, the processing module, and the sending module.

[0162] In some possible implementation manners, one or more of the computing devices in the computing device cluster may be connected through a network. Among them, the network may be a wide area network or a local area network, etc. Figure 9 Shows a possible implementation manner. As Figure 9As shown, two computing devices 700A and 700B are connected via a network. Specifically, they are connected to the network through the communication interfaces in each computing device. In this possible implementation, the instructions for implementing the receiving module's function are stored in the memory 706 of the computing device 700A. At the same time, the instructions for implementing the processing module and sending module's functions are stored in the memory 706 of the computing device 700B.

[0163] An embodiment of the present application also provides a computer program product containing instructions. The computer program product can be software or a program product containing instructions that can run on a computing device or be stored in any available medium. When the computer program product runs on at least one computing device, it causes at least one computing device to execute the media stream transmission method.

[0164] An embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc. The computer-readable storage medium includes instructions that direct the computer to execute the media stream transmission method.

[0165] The present application also provides a chip system, which includes a processor and a memory coupled to each other. The memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions stored in the memory, so that the media server executes the steps performed by the receiving module 501, the processing module 502, or the sending module 503 in the above embodiments. Optionally, the memory is an on-chip memory, such as a register, cache, etc. The memory can also be an off-chip memory located outside the chip in the site, such as a read-only memory or other types of static storage devices that can store static information and instructions, a random access memory, etc. The processor mentioned anywhere above can be a general-purpose central processing unit, a microprocessor, an application-specific integrated circuit, or one or more integrated circuits for implementing the above media stream transmission method.

[0166] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A media stream transmission method, characterized in that, The method is applied to a communication system, which includes a terminal, a load balancing server, and a media server cluster. The method includes: A first media server receives a Session Description Protocol (SDP) offer message sent by the load balancing server, and the SDP offer message sent by the load balancing server comes from the terminal; The first media server obtains cluster load information according to the SDP offer message; The first media server selects a target media server from the media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message; When the target media server is the first media server, the first media server determines the channel parameter information of the first channel according to the server identifier of the first media server and the media stream identifier; The first media server generates a first SDP answer message including the channel parameter information of the first channel; The first media server sends the first SDP answer message to the terminal; The first media server establishes the first channel according to the channel parameter information of the first channel; The first media server sends a media stream to the terminal through the first channel.

2. The method according to claim 1, characterized in that The method further includes: When the target media server is a second media server, the first media server determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier; Generates a second SDP answer message including the channel parameter information of the second channel; Sends the second SDP answer message to the terminal; Sends a media negotiation request including the media stream identifier to the second media server.

3. The method according to claim 1, wherein The method further includes: When the target media server is a second media server, the first media server determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier; Generates a second SDP answer message including the channel parameter information of the second channel; Sends the second SDP answer message to the terminal; Sends a media negotiation request to the second media server, and the media negotiation request includes the media stream identifier and the channel parameter information of the second channel.

4. The method according to any one of claims 1 to 3, characterized in that, The cluster load information includes the load volume and the number of cluster devices; The first media server selects a target media server from the media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message, including: The first media server performs a hash calculation on the media stream identifier carried in the SDP offer message to obtain a first hash value; The first media server performs a modulo operation on the first hash value and the number of cluster devices; The first media server selects candidate media servers from the media server cluster according to the modulo operation result; When the load data volume of the candidate media server is less than a preset load threshold, the first media server determines the target media server as the candidate media server; When the load data volume of the candidate media server is greater than or equal to the preset load threshold, the first media server determines the target media server as the media server with a load data volume less than the preset load threshold among the remaining media servers.

5. The method according to any one of claims 1 to 3, characterized in that The first media server determines the channel parameter information of the first channel according to the server identifier of the first media server and the media stream identifier, including: The first media server performs a hash operation on the server identifier of the first media server and the media stream identifier to obtain a second hash value; The first media server selects a target UDP IP address from the User Datagram Protocol (UDP) Internet Protocol (IP) address resource pool of the first media server according to the second hash value; The first media server selects a target port number from the port resource pool of the first media server according to the second hash value; The first media server selects a target synchronization source identifier from the synchronization source range of the first media server according to the second hash value; The first media server generates the channel parameter information of the first channel including the target UDP IP address, the target port number, and the target synchronization source identifier.

6. A media stream transmission method, characterized in that, The method is applied to a communication system, which includes a terminal, a load balancing server, and a media server cluster. The method includes: The second media server receives a media negotiation request sent by the first media server, and the media negotiation request includes a media stream identifier; The second media server obtains the server identifier of the second media server and the media stream identifier according to the media negotiation request; The second media server determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier; The second media server establishes the second channel according to the channel parameter information of the second channel; The second media server sends the media stream corresponding to the media stream identifier to the terminal through the second channel.

7. A media stream transmission method, characterized in that The method is applied to a communication system, which includes a terminal, a load balancing server, and a media server cluster. The method includes: The second media server receives a media negotiation request sent by the first media server, and the media negotiation request includes a media stream identifier and the channel parameter information of the second channel; The second media server establishes the second channel according to the channel parameter information of the second channel; The second media server sends the media stream corresponding to the media stream identifier to the terminal through the second channel.

8. A media stream transmission method, characterized in that, The method is applied to a communication system, which includes a terminal, a load balancing server, and a media server cluster. The method includes: The terminal sends a Session Description Protocol (SDP) offer message to the load balancing server; The load balancing server sends the SDP offer message to the first media server; The first media server obtains cluster load information according to the SDP offer message; The first media server selects a target media server from the media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message. When the target media server is the first media server, the first media server determines the channel parameter information of the first channel according to the server identifier of the first media server and the media stream identifier; The first media server generates a first SDP response message including the channel parameter information of the first channel; The first media server sends the first SDP response message to the terminal; The first media server establishes the first channel according to the channel parameter information of the first channel; The first media server sends a media stream to the terminal through the first channel.

9. The method according to claim 8, wherein The method further includes: When the target media server is the second media server, the first media server determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier; The first media server generates a second SDP response message including the channel parameter information of the second channel; The first media server sends the second SDP response message to the terminal; The first media server sends a media negotiation request including the media stream identifier to the second media server; The second media server obtains the server identifier of the second media server and the media stream identifier according to the media negotiation request; The second media server determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier; The second media server establishes the second channel according to the channel parameter information of the second channel; The second media server sends the media stream corresponding to the media stream identifier to the terminal through the second channel.

10. The method according to claim 8, characterized in that, The method further includes: When the target media server is the second media server, the first media server determines the channel parameter information of the second channel according to the server identifier of the second media server and the media stream identifier; The first media server generates a second SDP response message including the channel parameter information of the second channel; The first media server sends the second SDP response message to the terminal; The first media server sends a media negotiation request to the second media server, and the media negotiation request includes the media stream identifier and the channel parameter information of the second channel; The second media server establishes the second channel according to the channel parameter information of the second channel carried in the media negotiation request; The second media server sends the media stream corresponding to the media stream identifier to the terminal through the second channel.

11. A media server, characterized in that, The media server acts as the first media server, and the media server includes: A receiving module, configured to receive a Session Description Protocol (SDP) offer message sent by a load balancing server, and the SDP offer message sent by the load balancing server comes from a terminal; A processing module, configured to obtain cluster load information according to an SDP offer message; select a target media server from the media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message; when the target media server is the first media server, determine channel parameter information of a first channel according to the server identifier of the first media server and the media stream identifier; generate a first SDP response message including the channel parameter information of the first channel; A sending module, configured to send the first SDP response message to the terminal; The processing module is further configured to establish the first channel according to the channel parameter information of the first channel; The sending module is further configured to send a media stream to the terminal through the first channel.

12. The media server according to claim 11, wherein The processing module is further configured to, when the target media server is a second media server, determine channel parameter information of a second channel according to the server identifier of the second media server and the media stream identifier; generate a second SDP response message including the channel parameter information of the second channel; The sending module is further configured to send the second SDP response message to the terminal, and send a media negotiation request including the media stream identifier to the second media server.

13. The media server according to claim 11, wherein The processing module is further configured to, when the target media server is a second media server, determine channel parameter information of a second channel according to the server identifier of the second media server and the media stream identifier; generate a second SDP response message including the channel parameter information of the second channel; The sending module is further configured to send the second SDP response message to the terminal; The sending module is further configured to send a media negotiation request to the second media server, where the media negotiation request includes the media stream identifier and the channel parameter information of the second channel.

14. The media server according to any one of claims 11 to 13, wherein The processing module is specifically configured to, when the cluster load information includes a load amount and the number of cluster devices, perform a hash calculation on the media stream identifier carried in the SDP offer message to obtain a first hash value; perform a modulo operation on the first hash value and the number of cluster devices; Select a candidate media server from the media server cluster according to the modulo operation result; when the load data amount of the candidate media server is less than a preset load threshold, determine that the target media server is the candidate media server; when the load data amount of the candidate media server is greater than or equal to the preset load threshold, determine that the target media server is a media server with a load data amount less than the preset load threshold among the remaining media servers.

15. The media server according to any one of claims 11 to 13, wherein The processing module is specifically configured to perform a hashing operation on the server identifier and the media stream identifier of the first media server to obtain a second hash value; select a target UDP IP address from the User Datagram Protocol (UDP) Internet Protocol (IP) address resource pool of the first media server according to the second hash value; select a target port number from the port resource pool of the first media server according to the second hash value; select a target synchronization source identifier from the synchronization source range of the first media server according to the second hash value; generate channel parameter information of a first channel including the target UDP IP address, the target port number, and the target synchronization source identifier.

16. A media server, characterized in that, The media server acts as a second media server, and the media server includes: a receiving module, configured to receive a media negotiation request sent by a first media server, where the media negotiation request includes a media stream identifier; a processing module, configured to obtain the server identifier of the second media server and the media stream identifier according to the media negotiation request; determine channel parameter information of a second channel according to the server identifier of the second media server and the media stream identifier; establish the second channel according to the channel parameter information of the second channel; a sending module, configured to send a media stream to a terminal through the second channel.

17. A media server, characterized in that, The media server acts as a second media server, and the media server includes: a receiving module, configured to receive a media negotiation request sent by a first media server, where the media negotiation request includes a media stream identifier and channel parameter information of a second channel; a processing module, configured to establish the second channel according to the channel parameter information of the second channel; a sending module, configured to send a media stream to a terminal through the second channel.

18. A communication system, characterized in that, including: a terminal, configured to send a Session Description Protocol (SDP) offer message to a load balancing server; the load balancing server, configured to send the SDP offer message to a first media server; the first media server, configured to obtain cluster load information according to the SDP offer message; select a target media server from a media server cluster according to the cluster load information and the media stream identifier carried in the SDP offer message; when the target media server is the first media server, determine channel parameter information of a first channel according to the server identifier of the first media server and the media stream identifier; generate a first SDP answer message including the channel parameter information of the first channel; send the first SDP answer message to the terminal; the first media server is further configured to establish the first channel according to the channel parameter information of the first channel; send a media stream to the terminal through the first channel.

19. The communication system according to claim 18, wherein When the target media server is the second media server, the first media server is further configured to determine channel parameter information of a second channel according to the server identifier of the second media server and the media stream identifier; generate a second SDP response message including the channel parameter information of the second channel; and send the second SDP response message to the terminal. The first media server is further configured to send a media negotiation request including the media stream identifier to the second media server. The second media server is configured to obtain the server identifier of the second media server and the media stream identifier according to the media negotiation request. Determine channel parameter information of a second channel according to the server identifier of the second media server and the media stream identifier. Establish the second channel according to the channel parameter information of the second channel. Send a media stream to the terminal through the second channel.

20. The communication system according to claim 18, characterized in that, When the target media server is the second media server, the first media server is further configured to determine channel parameter information of a second channel according to the server identifier of the second media server and the media stream identifier; generate a second SDP response message including the channel parameter information of the second channel; and send the second SDP response message to the terminal. The first media server is further configured to send a media negotiation request to the second media server, where the media negotiation request includes the media stream identifier and the channel parameter information of the second channel. The second media server is configured to establish the second channel according to the channel parameter information of the second channel carried in the media negotiation request. Send the media stream corresponding to the media stream identifier to the terminal through the second channel.

21. A cluster of computing devices, characterized in that, Including at least one computing device, each computing device includes a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 7.

22. A cluster of computing devices, characterized in that, Including at least one computing device, each computing device includes a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 8 to 10.

23. A computer-readable storage medium, characterized in that, Including computer program instructions, when the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 7.

24. A computer-readable storage medium, characterized in that, Including computer program instructions, when the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 8 to 10.

25. A computer program product comprising instructions, characterized in that, When the instructions are run by a computing device cluster, the computing device cluster is caused to execute the method according to any one of claims 1 to 7.

26. A computer program product comprising instructions, characterized in that, When the instructions are run by a computing device cluster, the computing device cluster is caused to execute the method according to any one of claims 8 to 10.

Citation Information

Patent Citations

  • Streaming media cluster control system and method thereof

    CN111641845A

  • Streaming media transmission method and device

    CN114979086A