Media stream transmission method, device, electronic device and storage medium
By determining the number of connections and total transmission delay in the media streaming network and discarding the backup processing when the threshold value is reached, the problem of difficult media streaming quality in the prior art is solved, and more efficient media streaming is achieved.
Patent Information
- Application Number
- CN202111447606.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2041-11-29
Smart Images

Figure CN114157827B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of network transmission technology, and more specifically, to a method, device, electronic device and storage medium for transmitting a media stream. Background Art
[0002] Media streaming is a technology that uses streaming transmission to play streaming media on the Internet. Audio, video or multimedia files transmitted over the network do not need to be downloaded completely before playing, but are transmitted and played at any time. Streaming media technology can provide various services such as video on demand, audio on demand, MTV playback, concert playback, music appreciation, multimedia advertising, multi-person conferences, etc.
[0003] Generally speaking, the construction of the transmission network of media streams (such as audio and video) includes two modes: peer-to-peer (P2P) mode and client-server (C / S) mode. The P2P mode has the following limitations: 1. The client's upstream and downstream are not equal; 2. The client's processing capacity is limited. Therefore, the network topology of large-scale media stream transmission systems (such as conference systems) usually adopts the C / S mode, which puts the computing pressure on the server.
[0004] However, in the current C / S model, the transmission quality of streaming media is difficult to control. Summary of the invention
[0005] The embodiments of the present invention provide a method, a device, an electronic device and a storage medium for transmitting a media stream.
[0006] The technical solution of the embodiment of the present invention is as follows:
[0007] A method for transmitting a media stream, comprising:
[0008] Determine the number of connections for the media stream;
[0009] When the number of connections of the media stream is greater than a predetermined multiple of the maximum number of media connections of a single media server, determining a total transmission delay of the media stream in a transmission network including the media server;
[0010] When the total transmission delay is greater than a predetermined threshold value, a media server in the transmission network that participates in transmitting the media stream is enabled to abandon backup processing for the media stream.
[0011] In an exemplary embodiment, the method further includes:
[0012] When the number of connections of the media stream is less than a predetermined multiple of the maximum number of media connections of the single media server, enabling the media server in the transmission network that participates in transmitting the media stream to retain backup processing for the media stream;
[0013] When the total transmission delay is less than the threshold value, a media server in the transmission network that participates in transmitting the media stream is enabled to reserve backup processing for the media stream.
[0014] In an exemplary embodiment, determining the total transmission delay of the media stream in the transmission network including the media server includes: determining the total transmission delay Tmax, wherein Where D is the depth of the tree structure of the transmission network, and D is log n m / (nx) is rounded down to an integer; Ti is the sum of the transmission delays of all media servers within the i-th depth; Pi is the sum of the internal processing delays of all media servers within the i-th depth; m is the number of media stream connections; n is the maximum number of media connections for a single media server; x is the current number of media connections of the media server as the root node.
[0015] In an exemplary embodiment, the transmission network includes a single tree structure, and the tree structure includes a media server with a signaling control function and a media transmission function and a media server with a media transmission function, wherein the media server with the media transmission function is a leaf node or a non-leaf node in the tree structure, and the media server with a signaling control function and a media transmission function is a root node in the tree structure.
[0016] In an exemplary embodiment, the transmission network includes multiple tree structures, each tree structure includes a media server with a signaling control function and a media transmission function and a media server with a media transmission function, the media server with the media transmission function is a leaf node or a non-leaf node in the tree structure to which it belongs, and the media server with the signaling control function and the media transmission function is a root node in the tree structure to which it belongs, wherein the multiple media servers with the signaling control function and the media transmission function in the multiple tree structures are interconnected via a convergence point, and the convergence point is at least one of the multiple media servers.
[0017] A media stream transmission device, comprising:
[0018] A first determining module, used to determine the number of connections of the media stream;
[0019] a second determining module, configured to determine a total transmission delay of the media stream in a transmission network including the media server when the number of connections of the media stream is greater than a predetermined multiple of a maximum number of media connections of a single media server;
[0020] The third determining module is configured to enable a media server in the transmission network that participates in transmitting the media stream to abandon backup processing for the media stream when the total transmission delay is greater than a predetermined threshold value.
[0021] In an exemplary embodiment, the third determination module is further used to enable the media servers in the transmission network that participate in transmitting the media stream to retain backup processing for the media stream when the number of connections of the media stream is less than a predetermined multiple of the maximum number of media connections of the single media server; and to enable the media servers in the transmission network that participate in transmitting the media stream to retain backup processing for the media stream when the total transmission delay is less than the threshold value.
[0022] In an exemplary embodiment, the second determination module is used to determine the total transmission delay Tmax, wherein Where D is the depth of the tree structure of the transmission network, and D is log n m / (nx) is rounded down to an integer; Ti is the sum of the transmission delays of all media servers within the i-th depth; Pi is the sum of the internal processing delays of all media servers within the i-th depth; m is the number of media stream connections; n is the maximum number of media connections for a single media server; x is the current number of media connections of the media server as the root node.
[0023] In an exemplary embodiment, the transmission network includes a single tree structure, and the tree structure includes a media server with a signaling control function and a media transmission function and a media server with a media transmission function, wherein the media server with the media transmission function is a leaf node or a non-leaf node in the tree structure, and the media server with a signaling control function and a media transmission function is a root node in the tree structure.
[0024] In an exemplary embodiment, the transmission network includes multiple tree structures, each tree structure includes a media server with a signaling control function and a media transmission function and a media server with a media transmission function, the media server with the media transmission function is a leaf node or a non-leaf node in the tree structure to which it belongs, and the media server with the signaling control function and the media transmission function is a root node in the tree structure to which it belongs, wherein the multiple media servers with the signaling control function and the media transmission function in the multiple tree structures are interconnected via a convergence point, and the convergence point is at least one of the multiple media servers.
[0025] A computer-readable storage medium stores computer instructions, which, when executed by a processor, can implement the steps of any of the above-mentioned methods for transmitting a media stream.
[0026] An electronic device, comprising:
[0027] processor;
[0028] a memory for storing instructions executable by the processor;
[0029] The processor is configured to read the executable instructions from the memory, and execute the instructions to implement the media stream transmission method as described in any one of the above items.
[0030] A computer program product comprises computer instructions, wherein when the computer instructions are executed by a processor, the method for transmitting a media stream as described above is implemented.
[0031] It can be seen from the above technical solution that in the implementation mode of the present invention, the number of connections of the media stream is determined; when the number of connections of the media stream is greater than a predetermined multiple of the maximum number of media connections of a single media server, the total transmission delay of the media stream in the transmission network including the media server is determined; when the total transmission delay is greater than a predetermined threshold value, the media server in the transmission network that participates in the transmission of the media stream is enabled to abandon the backup processing for the media stream. It can be seen that when the total transmission delay is determined to be large based on the comparison process of the total transmission delay and the threshold value, the backup processing of the media stream in the media server that participates in the transmission of the media stream is abandoned, which ensures the real-time performance of the media stream and improves the transmission quality.
[0032] Furthermore, the embodiments of the present invention also propose a scalable transmission network topology structure that can be flexibly deployed for different business scenarios, thereby achieving a compromise between the real-time performance and reliability of the media stream. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0034] Figure 1 It is a structural diagram of a media stream transmission network using a tree network topology in the prior art.
[0035] Figure 2 It is a flowchart of a method for transmitting a media stream according to an embodiment of the present invention.
[0036] Figure 3It is a schematic diagram of delay in the media stream transmission process according to an embodiment of the present invention.
[0037] Figure 4 It is a schematic diagram of transmission delay of a tree network topology according to an embodiment of the present invention.
[0038] Figure 5 It is an exemplary flow chart of a method for transmitting conference media streams according to an embodiment of the present invention.
[0039] Figure 6 It is a first exemplary structural diagram of a media stream transmission network according to an embodiment of the present invention.
[0040] Figure 7 It is a second exemplary structural diagram of a media stream transmission network according to an embodiment of the present invention.
[0041] Figure 8 It is an exemplary structural diagram of a media stream transmission device according to an embodiment of the present invention.
[0042] Fig. 9 is an exemplary structural diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings.
[0044] For the sake of brevity and intuitiveness in description, the scheme of the present invention is explained below by describing several representative implementations. A large number of details in the implementations are only used to help understand the scheme of the present invention. However, it is obvious that the technical scheme of the present invention may not be limited to these details when implemented. In order to avoid unnecessarily obscuring the scheme of the present invention, some implementations are not described in detail, but only a framework is given. Hereinafter, "including" means "including but not limited to", and "according to..." means "at least according to..., but not limited to only according to...". Due to the language habits of Chinese, when the number of a component is not specifically specified below, it means that the component can be one or more, or can be understood as at least one.
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of the embodiments of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can, for example, be implemented in an order other than those illustrated or described herein.
[0047] The applicant found that in order to improve the reliability of media stream transmission, the media server in the prior art usually strictly implements the media backup process. However, the strict implementation of media backup may in turn affect the real-time performance of media stream transmission, resulting in difficulty in controlling the transmission quality of streaming media. In addition, the applicant also found that in the prior art, the topological structure of the transmission network is not scalable, and lacks a compromise solution that takes into account both the real-time performance and reliability of media stream transmission. Therefore, the topological structure of the prior art is difficult to expand to large-scale media stream transmission applications.
[0048] Figure 1 It is a structural diagram of a media stream transmission network using a tree network topology in the prior art. Figure 1 In the tree network topology, a media server (which may be referred to as a media control server) as a root node having a signaling control function and a media transmission function, and multiple media servers (such as media server 1, media server 1-1 to media server 1-m, media server m, media server m-1 to media server mm) as leaf nodes or non-leaf nodes in the middle layer having a media transmission function but not having a signaling control function. The media control server is used to determine the media servers participating in the data transmission and participate in the data transmission work of the media stream; the multiple media servers at the middle layer specifically perform the data transmission work of the media stream respectively.
[0049] However, the scalability of this network topology depends only on the top-level media control server, which has the following defects:
[0050] (1) The scalability of the server scale cannot be too large;
[0051] (2) The depth of the tree structure is proportional to the transmission delay (because the delay mainly comes from the internal media stream transmission between media servers).
[0052] In the implementation mode of the present invention, a quality-controlled media streaming transmission strategy is proposed to balance reliability and low latency. In addition, in the implementation mode of the present invention, a new topology of the media streaming transmission network is proposed to ensure the scalability of the media server. In addition, the topology proposed in the implementation mode of the present invention can be flexibly deployed for different application scenarios by dynamically adjusting the threshold value.
[0053] Figure 2 It is a flowchart of a method for transmitting a media stream according to an embodiment of the present invention.
[0054] like Figure 2 As shown, the method includes:
[0055] Step 201: Determine the number of media stream connections.
[0056] Here, the number of connections of the media stream is the maximum number of connections required to transmit the media stream. For example, when the media stream is a conference scene in which audio and video are transmitted between multiple people, the number of connections can be the maximum number of concurrent connections for the conference scene.
[0057] Step 202: When the number of connections of the media stream is greater than a predetermined multiple of the maximum number of media connections of a single media server, determine a total transmission delay of the media stream in a transmission network including the media server.
[0058] Here, the maximum number of media connections of a single media server is the maximum number of media connections that can be provided by each media server in the transmission network, assuming that each media server in the transmission network has the same processing capacity. The predetermined multiple is usually a positive integer greater than 1, for example, preferably 2.
[0059] In high-volume media streaming scenarios (such as video conferencing), media transmission is usually required to be both reliable and real-time. For the user experience quality, transmission delay is undoubtedly a key consideration.
[0060] Table 1 is a correspondence table between transmission delay and user satisfaction.
[0061] Delay (milliseconds) Customer satisfaction 0~200 Very satisfied 200~280 satisfy 280~390 Some users are satisfied 390~520 Many users are dissatisfied Greater than 520 Almost all users are dissatisfied
[0062] Table 1
[0063] As shown in Table 1, a delay of less than 200ms provides a very good user experience quality, while a delay of more than 520ms provides a very poor user experience quality, and such media transmission quality is difficult to be satisfactory. For media transmission, it is necessary to ensure the minimum end-to-end delay while ensuring media quality. Therefore, for the transmission mechanism of key conference scenarios such as online verification and signing, it is necessary to make a trade-off between real-time performance and reliability.
[0064] The delay in the media stream transmission process is described below. Figure 3 It is a schematic diagram of delay in the media stream transmission process according to an embodiment of the present invention.
[0065] Take a media stream conference as an example. Due to the particularity of the transmission network topology, participants in the same conference often maintain connections with different media servers, which means that the media stream sent by a user needs to be routed between media servers before it can be finally transmitted to the destination. Figure 3 In the example, the audio and video data packets sent by user A pass through media server K1->media server K2->media server K5 to reach user B; the audio and video data packets sent by user A pass through media server K1->media server K4 to reach user C. The delay of the media stream conference initiated by user A is the sum of the delays of media servers K1, K2, K4 and K5 in the transmission link.
[0066] For the entire conference process, assume that the starting time point when the audio and video data packet is sent from user A is Tbegin, the time point when the media server receives the media stream is Tmreceive, the backup time point after the media server receives the media stream is Tbackup, the time point when the media server starts processing the media stream is recorded as Tprocess, the time point when the media stream is sent from the media server closest to the user to the user is recorded as Tdispatch, and the time point when the participant (user B or user C) receives the media stream is Tend.
[0067] Then, the transmission delay of the media part of the entire conference process mainly includes the following parts:
[0068] (1) Part 1: [Tbegin, Tmreceive];
[0069] (2) The second part: [Tmreceive, Tprocess]:
[0070] (3) Part 3: [Tprocess, Tmdispatch];
[0071] (4) Part 4: [Tdispatch,Tend].
[0072] The first part of the delay is T1, T1 represents the network delay, T1 = Tmreceive-Tbegin. T1 is usually related to the transmission rate of the user terminal and the specific network transmission delay (this part of the delay can be reduced by the optimization technology of the application layer), and has nothing to do with the network topology of the media server. For the implementation of the present invention, T1 can be regarded as a constant.
[0073] The delay of the second part is T2, which represents the media processing delay of the server, which is related to the processing rate of the media server to the media stream (where decoding, denoising, mixing, encoding and recording are all counted in the processing delay). The quality of the media processing algorithm determines the delay of this part. For the implementation mode of the present invention, T2 can be regarded as a constant. In addition, for the fault tolerance of the system, each media server often needs to perform backup processing on the current media stream before forwarding it to other media servers.
[0074] The third part of the delay is denoted as T3, which represents the delay caused by the media server topology and is the optimization object of the implementation method of the present invention. The transmission delay of this part mainly comes from the media stream forwarding between media servers, which is usually related to the network topology of the media server.
[0075] The delay of the fourth part is recorded as T4. For the embodiment of the present invention, T4 can be regarded as a constant value.
[0076] In one embodiment, determining the total transmission delay of the media stream in the transmission network including the media server in step 202 includes:
[0077] Determine the total transmission delay Tmax, where Where D is the depth of the tree structure of the transmission network, and D is log n m / (nx) is rounded down to an integer; Ti is the sum of the transmission delays of all media servers within the i-th depth; Pi is the sum of the internal processing delays of all media servers within the i-th depth; m is the number of media stream connections; n is the maximum number of media connections for a single media server; x is the current number of media connections of the media server as the root node.
[0078] In the embodiment of the present invention, log n m / (nx), and then log n The depth D is determined by rounding down m / (nx), and then the total transmission delay Tmax is calculated based on the transmission delay and internal processing delay of each media server within the depth D. The total transmission delay Tmax is a theoretical value assuming that each media server performs media backup processing. It can be seen that the depth D can be quickly determined based on logarithmic operations, and the total transmission delay can also be conveniently calculated.
[0079] Figure 4 It is a schematic diagram of transmission delay of a tree network topology according to an embodiment of the present invention.
[0080] exist Figure 4A tree network topology is described in , in which a single media server T0 with signaling control function and media transmission function is deployed in depth 0, and media servers T1 connected to depth 0 are deployed in depth 1, and the number of T1 can be multiple. Each media server T1 in depth 1 is respectively connected to the media server T2 in the lower layer to form depth 2, and the number of T2 can be multiple; and so on, until it is connected to depth P. The total internal processing delay of the tree network topology is the sum of the internal processing delays of all media servers in each depth. The total internal processing delay of the tree network topology plus the sum of the transmission delays of all media servers in each depth is the total transmission delay of the tree network topology.
[0081] Step 203: When the total transmission delay is greater than a predetermined threshold value, the media server in the transmission network that participates in transmitting the media stream abandons the backup processing for the media stream. Here, the total transmission delay is a calculated theoretical value, assuming that the media server does not abandon the backup processing for the media stream.
[0082] In the above process, the processing logic is described when the number of connections of the media stream is greater than the predetermined multiple of the maximum number of media connections of a single media server. In fact, when the number of connections of the media stream is equal to the predetermined multiple, the same processing logic or other processing logic can be followed, and the embodiment of the present invention is not limited to this. Similarly, in the above process, the processing logic is described when the total transmission delay is greater than the predetermined threshold value. In fact, when the total transmission delay is equal to the predetermined threshold value, the same processing logic or other processing logic can be followed, and the embodiment of the present invention is not limited to this. In one embodiment, when the number of connections of the media stream is less than the maximum number of media connections of a single media server, the media server participating in the transmission of the media stream in the transmission network is enabled to retain backup processing for the media stream. Here, when the number of connections of the media stream is less than the maximum number of media connections of a single media server, it can be determined that a single media server is sufficient to bear the transmission load of the media stream. At this time, the single media server is directly used to bear the transmission load of the media stream, and the single media server retains backup processing for the media stream.
[0083] In one embodiment, when the total transmission delay is less than a threshold value, a media server in the transmission network that participates in transmitting the media stream is enabled to retain backup processing for the media stream. It can be seen that when the total transmission delay is determined to be small, the backup processing for the media stream is retained, thereby ensuring the reliability of transmission.
[0084] In one embodiment, when the number of connections of a media stream is greater than the maximum number of media connections and less than a predetermined multiple of the maximum number of media connections, it is determined that a transmission network with a tree-like structure in the prior art can bear the transmission load of the media stream. Figure 1 The transmission network shown in FIG. 1 bears the transmission load of the media stream, and each media server in the tree structure retains backup processing for the media stream. It can be seen that at this time, the number of connections of the media stream is determined to be small, so the backup processing for the media stream is retained, thereby ensuring the reliability of transmission.
[0085] The embodiments of the present invention also propose a scalable transmission network topology structure that can be flexibly deployed for different business scenarios, thereby achieving a compromise between the real-time performance and reliability of the media stream.
[0086] In one embodiment, the transmission network includes a single tree structure, the tree structure includes a media server with a signaling control function and a media transmission function and a media server with a media transmission function, wherein the media server with a media transmission function is a leaf node or a non-leaf node in the tree structure, and the media server with a signaling control function and a media transmission function is a root node in the tree structure. It can be seen that the transmission of media streams can be achieved based on a transmission network with a single tree structure. A transmission network with a single tree structure has a relatively simple network structure and has the advantage of being easy to implement.
[0087] In one embodiment, the transmission network includes multiple tree structures, each tree structure includes a media server with a signaling control function and a media transmission function and a media server with a media transmission function, the media server with a media transmission function is a leaf node or a non-leaf node in the tree structure to which it belongs, and the media server with a signaling control function and a media transmission function is a root node in the tree structure to which it belongs, wherein the multiple media servers with a signaling control function and a media transmission function in the multiple tree structures are interconnected via a convergence point, and the convergence point is at least one of the multiple media servers. It can be seen that the transmission of media streams can be realized based on a transmission network with multiple tree structures. The transmission network with multiple tree structures is scalable and suitable for flexible deployment for different business scenarios.
[0088] Figure 6 FIG. 1 is a first exemplary structural diagram of a media stream transmission network according to an embodiment of the present invention. Figure 6 In the example, a transmission network including five tree structures is used for explanation.
[0089] The tree structure 11 includes a media server 111 having a signaling control function and a media transmission function and a plurality of media servers having a media transmission function, wherein the plurality of media servers having a media transmission function are leaf nodes or non-leaf nodes in the tree structure 11, and the media server 111 having a signaling control function and a media transmission function is a root node in the tree structure 11. The tree structure 12 includes a media server 121 having a signaling control function and a media transmission function and a plurality of media servers having a media transmission function, wherein the plurality of media servers having a media transmission function are leaf nodes or non-leaf nodes in the tree structure 12, and the media server 121 having a signaling control function and a media transmission function is a root node in the tree structure 12. The tree structure 13 includes a media server 131 having a signaling control function and a media transmission function and a plurality of media servers having a media transmission function, wherein the plurality of media servers having a media transmission function are leaf nodes or non-leaf nodes in the tree structure 13, and the media server 131 having a signaling control function and a media transmission function is a root node in the tree structure 13. The tree structure 14 includes a media server 141 having a signaling control function and a media transmission function and a plurality of media servers having a media transmission function, wherein the plurality of media servers having a media transmission function are leaf nodes or non-leaf nodes in the tree structure 14, and the media server 141 having a signaling control function and a media transmission function is a root node in the tree structure 14. The tree structure 15 includes a media server 151 having a signaling control function and a media transmission function and a plurality of media servers having a media transmission function ( Figure 6 (not shown), wherein the multiple media servers with media transmission functions are leaf nodes or non-leaf nodes in the tree structure 15, and the media server 151 with signaling control function and media transmission function is the root node in the tree structure 11.
[0090] The media server 111, the media server 121, the media server 131, and the media server 141 are connected to the media server 151 respectively. The media server 111, the media server 121, the media server 131, the media server 141, and the media server 151 jointly determine the media servers participating in the data transmission in the topology structure 20 (for example, based on the load sharing principle or the closest distance distribution principle, etc.). Therefore, the scalability of the network topology is no longer determined by a single media control server, but is shared by the media server 111, the media server 121, the media server 131, the media server 141, and the media server 151, thereby improving the scalability of the server scale. The topology structure 20 composed of five tree structures can be simplified as follows: Figure 6 The logo graphic with the arrow pointing in the middle.
[0091] Figure 7is a second exemplary structural diagram of a media stream transmission network according to an embodiment of the present invention. Figure 7 In, similar to Figure 6 In an expansion manner, the five new topology structures 20 are further connected to form a new expansion topology.
[0092] like Figure 6 As shown in the figure, the network topology is viewed locally: the topology of the embodiment of the present invention is composed of many small trees combined into a graphical structure. Compared with the traditional waterfall tree structure, the control part does not only rely on a single control node, but is shared among multiple media servers to increase scalability. As long as the media resources are sufficient, the scale of a single conference can be expanded arbitrarily. Figure 7 As shown, from a global perspective, the network topology can be Figure 6 The combined graph is considered as a grid point in the overall topology, thus forming a larger mesh structure. This allows expansion to any scale not only for a single meeting, but for any number of meetings.
[0093] The transmission network topology structure of the embodiment of the present invention is described above by taking five tree structures as an example. Those skilled in the art can appreciate that such description is only exemplary and is not intended to limit the protection scope of the embodiment of the present invention.
[0094] Figure 5 is an exemplary flow chart of a method for transmitting conference media streams according to an embodiment of the present invention. Figure 5 The method shown is applied to Figure 1 , Figure 6 or Figure 7 In the topology shown.
[0095] like Figure 5 As shown, the method includes:
[0096] Step 501: The conference initiator initiates a conference, wherein the number of media stream connections representing the conference scale is m.
[0097] Step 502: Determine the maximum number of media connections n of a single media server.
[0098] Step 503: Determine whether the number of connections m is greater than the maximum number of media connections n. If so, execute step 504 and its subsequent steps; otherwise, execute step 508 and its subsequent steps.
[0099] Step 504: Determine whether the number of connections m is much larger than the maximum number of media connections n (for example, determine whether the number of connections m is larger than a predetermined multiple T of the maximum number of media connections n). If so, execute step 505 and its subsequent steps; otherwise, execute step 510 and its subsequent steps.
[0100] Step 505: Construct Figure 1 , Figure 6 or Figure 7 The tree structure shown in FIG. 1 is a tree structure in which the depth D of the tree structure is determined based on the number of connections m, the maximum number of media connections n, and the current number of media connections x of the media server as the root node, that is, the media server at the D layer is used to carry the conference transmission resources. For example, D is equal to log n m / (nx) is rounded down to an integer. The total transmission delay Tmax of the conference is determined, where Tmax is the sum of the internal processing delay and the transmission delay of each media server in each depth in the conference transmission link. It is determined whether the total transmission delay Tmax of the conference is greater than a predetermined threshold value s (s can be predetermined by the user, and s is preferably adjustable). If so, step 506 and subsequent steps are executed, otherwise step 507 and subsequent steps are executed.
[0101] Step 506 : Each media server in the conference transmission link abandons its own media stream backup operation and executes step 512 .
[0102] Step 507 : Each media server in the conference transmission link retains its own media stream backup operation and executes step 512 .
[0103] Step 508: Determine that a single media server is sufficient to carry the conference transmission resources. In this case, the total transmission delay of the conference is equal to the sum of the internal processing delay and the transmission delay of the single media server.
[0104] Step 509: retain the media stream backup operation of the single media server, and execute step 512.
[0105] Step 510: When it is determined in step 504 that the number of connections m is not much greater than the maximum number of media connections n, for example, when the number of connections m is not greater than T times the maximum number of media connections n, the number of media servers sufficient to carry the conference transmission resources is determined to be T. For example, when it is determined in step 504 that the number of connections m is not greater than twice the maximum number of media connections n, it is determined in step 510 that two media servers are sufficient to carry the conference transmission resources. Similarly, when it is determined in step 503 that the number of connections m is not greater than three times the maximum number of media connections n, it is determined in step 510 that three media servers are sufficient to carry the conference transmission resources. The following can be constructed based on all the determined media servers: Figure 1 The total transmission delay of the conference is equal to the sum of the internal processing delay and the transmission delay of each media server in the tree structure.
[0106] Step 511: retain the media stream backup operation of each media server in each layer depth, and execute step 512.
[0107] Step 512: Each media server in each depth layer pushes the media stream.
[0108] based on Figure 5 When the conference initiator creates a conference, he can set the number of media stream connections that represent the conference scale to m and the delay threshold to s. Each media server in the transmission network has the same processing capacity. Assume that the maximum number of media connections that a single media server can provide for the current conference is n. Compare the relationship between the number of media stream connections m and the maximum number of media connections n, and divide it into two cases: m is less than n and m is greater than n.
[0109] In the first case: when m is less than n, it indicates that the current single media server can provide support for the current conference.
[0110] In the second case: when m is greater than n, it indicates that the current single media server alone cannot support the current conference and a tree topology structure needs to be constructed.
[0111] The second case includes the first sub-case and the second sub-case as shown below.
[0112] The first sub-case: when m is greater than n but not much greater than n (for example, the basis for determining whether m is not much greater than n is: m is not greater than T times of n, where T is a predetermined positive integer), it indicates that the depth of the tree topology structure is not large enough to satisfy a conference with m connections, so the media stream backup operation of each media server is retained.
[0113] Second sub-case: When m is much greater than n (for example, the basis for determining whether m is much greater than n is: m is greater than T times of n, where T is a predetermined positive integer), it indicates that the depth of the tree topology is large. In order to minimize the delay caused by the tree topology with a large depth, it is necessary to make adjustments between fault tolerance and real-time performance. Among them, when the calculated total delay is greater than s, in order to meet the real-time performance, fault tolerance can be appropriately sacrificed, and the media backup process of each media server can be abandoned, so that the final actual total delay is less than s. When the calculated total delay is less than s, since the total delay meets the preset threshold value, in order to achieve better media service quality and reduce the number of packet losses in media transmission, data packet backup is still performed on each media server of the transmission. It can be seen that this transmission strategy is mainly a compromise between real-time performance and reliability. It is a quality-controllable media transmission strategy that balances data packets and delays. In actual application, it can be flexibly deployed for different business scenarios by adjusting the threshold s or limiting media backup operations.
[0114] Figure 8 It is an exemplary structural diagram of a media stream transmission device according to an embodiment of the present invention.
[0115] like Figure 8As shown, the media stream transmission device 800 includes:
[0116] A first determining module 801 is used to determine the number of connections of the media stream;
[0117] A second determining module 802 is used to determine a total transmission delay of the media stream in a transmission network including the media server when the number of connections of the media stream is greater than a predetermined multiple of the maximum number of media connections of a single media server;
[0118] The third determining module 803 is configured to enable a media server in the transmission network that participates in transmitting the media stream to abandon backup processing for the media stream when the total transmission delay is greater than a predetermined threshold value.
[0119] In one embodiment, the third determination module 803 is also used to enable the media servers in the transmission network that participate in transmitting the media stream to retain backup processing for the media stream when the number of connections of the media stream is less than a predetermined multiple of the maximum number of media connections of a single media server; and to enable the media servers in the transmission network that participate in transmitting the media stream to retain backup processing for the media stream when the total transmission delay is less than a threshold value.
[0120] In one embodiment, the second determining module 802 is used to determine the total transmission delay Tmax, where Where D is the depth of the tree structure of the transmission network, and D is log n m / (nx) is rounded down to an integer; Ti is the sum of the transmission delays of all media servers within the i-th depth; Pi is the sum of the internal processing delays of all media servers within the i-th depth; n is the maximum number of media connections of a single media server; x is the current number of media connections of the media server as the root node.
[0121] In one embodiment, the transmission network includes a single tree structure, the tree structure includes a media control server and a media server, wherein the media server is a leaf node or a non-leaf node in the tree structure, and the media control server is a root node in the tree structure.
[0122] In one embodiment, the transmission network includes multiple tree structures, each tree structure includes a media control server and a media server, the media server is a leaf node or a non-leaf node in the tree structure to which it belongs, and the media control server is a root node in the tree structure to which it belongs, wherein multiple media control servers in the multiple tree structures are interconnected via a convergence point, which is at least one of the multiple media control servers.
[0123] In summary, in the implementation of the present invention, the number of connections of the media stream is determined; when the number of connections of the media stream is greater than a predetermined multiple of the maximum number of media connections of a single media server, the total transmission delay of the media stream in the transmission network including the media server is determined; when the total transmission delay is greater than a predetermined threshold value, the media servers in the transmission network that participate in the transmission of the media stream are enabled to abandon the backup processing for the media stream. It can be seen that when the total transmission delay is determined to be large based on the comparison process of the total transmission delay and the threshold value, the backup processing of the media stream in the media server participating in the transmission of the media stream is abandoned, which ensures the real-time performance of the media stream and improves the transmission quality.
[0124] Furthermore, the embodiments of the present invention also propose a scalable transmission network topology structure that can be flexibly deployed for different business scenarios, thereby achieving a compromise between the real-time performance and reliability of the media stream.
[0125] The embodiment of the present invention also provides a computer-readable medium, the computer-readable storage medium stores instructions, and the instructions can execute the steps in the above-mentioned media stream transmission method when executed by the processor. In practical applications, the computer-readable medium may be included in the device / apparatus / system described in the above-mentioned embodiment, or it may exist alone without being assembled into the device / apparatus / system. The above-mentioned computer-readable storage medium carries one or more programs, and when the above-mentioned one or more programs are executed, the media stream transmission method described in the above-mentioned embodiments can be implemented. According to the embodiment disclosed in the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above, but it is not used to limit the scope of protection of the present invention. In the embodiment disclosed in the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, an apparatus or a device or used in combination with it.
[0126] like Fig. 9 As shown, the embodiment of the present invention further provides an electronic device, in which the device for implementing the method of the embodiment of the present invention can be integrated. Fig. 9 As shown, it shows an exemplary structural diagram of an electronic device involved in an embodiment of the present invention,
[0127] Specifically, the electronic device may include a processor 901 with one or more processing cores, a memory 902 with one or more computer-readable storage media, and a computer program stored in the memory and executable on the processor. When executing the program in the memory 902, the above-mentioned media stream transmission method may be implemented.
[0128] In practical applications, the electronic device may further include components such as a power supply 903, an input unit 904, and an output unit 905. Those skilled in the art may understand that Fig. 9 The structure of the electronic device shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange components differently. Wherein: the processor 901 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the server and processes data by running or executing software programs and / or modules stored in the memory 902, and calling data stored in the memory 902, so as to monitor the electronic device as a whole. The memory 902 can be used to store software programs and modules, that is, the above-mentioned computer-readable storage medium. The processor 901 executes various functional applications and data processing by running software programs and modules stored in the memory 902. The memory 902 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the server, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 902 may also include a memory controller to provide the processor 901 with access to the memory 902 .
[0129] The electronic device also includes a power supply 903 for supplying power to each component, which can be logically connected to the processor 901 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 903 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device can also include an input unit 904, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. The electronic device can also include an output unit 905, which can be used to display information input by the user or information provided to the user and various graphical user interfaces, which can be composed of graphics, text, icons, videos and any combination thereof.
[0130] An embodiment of the present invention further provides a computer program product, which includes computer instructions. When the computer instructions are executed by a processor, the method described in any of the above embodiments is implemented.
[0131] The flow chart and block diagram in the accompanying drawings of the present invention show the possible architecture, function and operation of the system, method and computer program product according to the various embodiments disclosed in the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in the order of the standards in different drawings. For example, the boxes represented by two connections can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0132] The principles and implementation methods of the present invention are described herein using specific implementation methods. The description of the above implementation methods is only used to help understand the method and core ideas of the present invention, and is not used to limit the present invention. For those skilled in the art, changes can be made in the specific implementation methods and application scopes according to the ideas, spirits and principles of the present invention, and any modifications, equivalent substitutions, improvements, etc. made therein should be included in the scope of protection of the present invention.
Claims
1. A method for transmitting a media stream, characterized in that: include: Determine the number of connections for the media stream; When the number of connections of the media stream is greater than a predetermined multiple of the maximum number of media connections of a single media server, determining a total transmission delay of the media stream in a transmission network including the media server; When the total transmission delay is greater than a predetermined threshold value, enabling a media server in the transmission network that participates in transmitting the media stream to abandon backup processing for the media stream; Determining the total transmission delay of the media stream in the transmission network including the media server comprises: Determine the total transmission delay Tmax, where Where D is the depth of the tree structure of the transmission network, and D is log n m / (nx) is rounded down to an integer; Ti is the sum of the transmission delays of all media servers within the i-th depth; Pi is the sum of the internal processing delays of all media servers within the i-th depth; m is the number of media stream connections; n is the maximum number of media connections for a single media server; x is the current number of media connections of the media server as the root node.
2. The method for transmitting a media stream according to claim 1, characterized in that: Also includes: When the number of connections of the media stream is less than a predetermined multiple of the maximum number of media connections of the single media server, enabling the media server in the transmission network that participates in transmitting the media stream to retain backup processing for the media stream; When the total transmission delay is less than the threshold value, a media server in the transmission network that participates in transmitting the media stream is enabled to reserve backup processing for the media stream.
3. The method for transmitting a media stream according to claim 1 or 2, characterized in that: The transmission network includes a single tree structure, and the tree structure includes a media server with a signaling control function and a media transmission function and a media server with a media transmission function, wherein the media server with the media transmission function is a leaf node or a non-leaf node in the tree structure, and the media server with a signaling control function and a media transmission function is a root node in the tree structure.
4. The method for transmitting a media stream according to claim 1 or 2, characterized in that: The transmission network includes multiple tree structures, each tree structure includes a media server with a signaling control function and a media transmission function and a media server with a media transmission function, the media server with a media transmission function is a leaf node or a non-leaf node in the tree structure to which it belongs, and the media server with a signaling control function and a media transmission function is a root node in the tree structure to which it belongs, wherein the multiple media servers with a signaling control function and a media transmission function in the multiple tree structures are connected to each other via a convergence point, and the convergence point is at least one of the multiple media servers.
5. A media stream transmission device, characterized in that: include: A first determining module, used to determine the number of connections of the media stream; a second determining module, configured to determine a total transmission delay of the media stream in a transmission network including the media server when the number of connections of the media stream is greater than a predetermined multiple of a maximum number of media connections of a single media server; A third determining module, configured to enable a media server in the transmission network that participates in transmitting the media stream to abandon backup processing for the media stream when the total transmission delay is greater than a predetermined threshold value; The second determining module is used to determine the total transmission delay Tmax, wherein Where D is the depth of the tree structure of the transmission network, and D is log n m / (nx) is rounded down to an integer; Ti is the sum of the transmission delays of all media servers within the i-th depth; Pi is the sum of the internal processing delays of all media servers within the i-th depth; m is the number of media stream connections; n is the maximum number of media connections for a single media server; x is the current number of media connections of the media server as the root node.
6. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instructions are executed by a processor, the steps of the media stream transmission method according to any one of claims 1 to 4 are implemented.
7. An electronic device, characterized in that: The electronic device includes: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the media stream transmission method according to any one of claims 1 to 4.
8. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the method for transmitting a media stream according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for streaming media forwarding as well as routing method and device
CN106792261A
Stream media data transmission system, stream media data transmission method and data distribution servers
CN106850706A
Load balancing method, terminal and gateway servers
CN113489803A
Network backup device
JP1997006664A