Data distribution method, server and electronic device
By deploying SFU, PDC and MCU on the server side and adopting the publish-subscribe model to process media streams, the delay and resource occupation problems of the existing streaming media service architecture in large-scale real-time audio and video communications are solved, and efficient media stream transmission and high availability are achieved.
Patent Information
- Application Number
- CN202110676455.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-18
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2041-06-18
AI Technical Summary
The existing streaming media service architecture has problems such as high latency, high resource utilization, and high architectural complexity in large-scale real-time audio and video communication scenarios, and is particularly unable to guarantee high availability in the event of a single point of failure.
The streaming media service architecture is redesigned using the publish-subscribe model, and SFU services, PDC services, and MCUs are deployed. Media streams are forwarded and controlled through SFU and PDC services, and signaling is scheduled using MCU, enabling separate processing of media streams and signaling, reducing bandwidth and port resource usage.
It improves the real-time performance of media streaming, reduces server resource usage, reduces audio and video delays, simplifies architectural complexity, and ensures high availability.
Smart Images

Figure CN115499417B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data distribution method, a server, and an electronic device. Background Art
[0002] The advancement of the Internet and the popularization of 5G (5th Generation Mobile Communication Technology) technology have promoted the vigorous development of online real-time interaction. The demand for many real-time interactive scenarios such as online education, video conferencing, and e-commerce live streaming has surged. While rapidly promoting the development of real-time audio and video, it has also put higher demands on real-time audio and video technology.
[0003] Ensuring a positive user experience in large-scale real-time audio and video scenarios not only tests the client's audio and video processing capabilities but also poses a significant challenge to the server's architectural design. Designing a highly available real-time audio and video streaming service requires a core consideration: choosing between single-node and clustered media distribution solutions. There are two main types of streaming service architectures currently available on the market.
[0004] The first streaming media service architecture:
[0005] Single media service architecture is a relatively simple design. Figure 1 As shown, multiple clients establish connections with the MediaServer and join the same room. The client sends a media stream to the MediaServer, which then forwards the received media stream to other clients, enabling audio and video calls. This solution has at least the following drawbacks:
[0006] Different clients must connect to the same media service to communicate. If the clients are geographically far apart, significant delays and lags may occur. In addition, the streaming service architecture does not conform to the design concept of elastic and high-availability architecture. When a service has a problem, all data services on this service, such as all audio and video calls, will be unable to continue. The client needs to exit the call and reconnect to another server.
[0007] The second streaming service architecture:
[0008] The cascaded media service architecture controls the forwarding of media streams between multiple media services through the signaling scheduling service (hereinafter referred to as MCU), so that a client on one media service can subscribe to the media streams of other clients from another media service. Figure 2As shown, the MCU controls the establishment of media links between two MediaServers through signaling, and transmits audio and video streams between the MediaServers through the media links. For example, if Client1 and Client2 are connected to two MediaServers respectively, if Client1 joins MediaServer1 first and Client2 joins MediaServer2 later, the MCU needs to notify MediaServer2 to forward Client2's media stream to MediaServer1. MediaServer1 then forwards the received media stream to Client1, thus enabling audio and video calls between two MediaServers and different clients. This solution has at least the following drawbacks:
[0009] In cluster mode, the media transmission links between services are long, resulting in increased audio and video delays. In addition, multiple media services are connected to each other, forming a mesh structure. The overall architecture is complex and difficult to maintain. In addition, the transmission of audio and video between servers occupies a lot of bandwidth resources. Summary of the Invention
[0010] The purpose of this application is to solve at least one of the above-mentioned technical defects. The following technical solution is proposed to rebuild the streaming media service architecture based on the publish-subscribe model, improve the real-time performance of media streaming transmission in real-time communication scenarios, and reduce the occupancy rate of server resources.
[0011] The embodiments of this application adopt the following technical solutions:
[0012] In one aspect of the present application, a data distribution method is provided, which is executed by a server, where an SFU service, a PDC service and an MCU are deployed on the server, and a PipeTopic is set in the PDC service. The method includes: using the SFU service to obtain client information, and using the SFU service to obtain a media stream from the client; using the SFU service to determine other client information that the client can subscribe to from the MCU, subscribing to the PipeTopic from the PDC service based on the other client information that can be subscribed, and forwarding the media stream obtained from the subscribed PipeTopic to the client.
[0013] In another aspect of the present application, a data distribution server is provided, on which an SFU service, a PDC service and an MCU are deployed, and a PipeTopic is set in the PDC service; the data distribution server is used to implement a data distribution method.
[0014] According to another aspect of the present application, an electronic device is provided, comprising a processor; and a memory arranged to store computer-executable instructions, where the executable instructions, when executed, enable the processor to perform a data distribution method.
[0015] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:
[0016] This application redesigns the service architecture by deploying SFU services, PDC services, and MCU services on the server side. The SFU and PDC services are used to forward and control media streams, and the MCU is used to control signaling during media stream distribution. This separates media streams from signaling, improving data distribution processing efficiency.
[0017] During the data distribution process, the publish-subscribe model between the SFU service and the PDC service is used to achieve the intercommunication of media data between different SFU services, significantly reducing the bandwidth resources and port resources occupied by transmitting media data. When transmitting media data, the MCU is used to determine other client information that the SFU service can subscribe to, so that the SFU service has the right to choose the downlink media data, thereby saving downlink bandwidth resources on the server and client, reducing the decoding pressure on the client, and improving the timeliness of data distribution. This makes the transmission of media streams in large-scale real-time communication scenarios more real-time, laying the foundation for the real-time performance of audio and video calls. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 This is a schematic diagram of a single media service architecture;
[0020] Figure 2 This is a schematic diagram of the cascaded media service architecture;
[0021] Figure 3 A flow chart of a data distribution method shown in an embodiment of the present application;
[0022] Figure 4 This is a schematic diagram of a streaming media service architecture based on a publish-subscribe model according to an embodiment of the present application;
[0023] Figure 5 This is a schematic diagram of data publishing shown in an embodiment of the present application;
[0024] Figure 6 This is a schematic diagram of data distribution shown in an embodiment of the present application;
[0025] Figure 7 This is a schematic diagram of data subscription shown in an embodiment of the present application;
[0026] Figure 8 This is a structural block diagram of the data distribution server shown in an embodiment of the present application;
[0027] Figure 9 This is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0029] In response to the problems of real-time audio and video transmission and server resource usage in the streaming media service architecture in the existing technology in large-scale real-time communication scenarios, the embodiment of the present application redesigns the streaming media service architecture using a publish-subscribe model, that is, an SFU (Stream Forwarding Unit) service, a PDC (Pipeline Distribution Center) service and an MCU (Message-signalling unit Control Unit) are deployed on the server side. A PipeTopic is set in the PDC service. The SFU service is responsible for media stream forwarding, the PDC service is responsible for the distribution and control of media data, and the MCU is responsible for signaling scheduling. The data distribution is completed through the mutual cooperation between the SFU service, the PDC service and the MCU, so that audio and video calls with high timeliness are achieved in large-scale real-time communication scenarios.
[0030] The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0031] Figure 3 This is a flow chart of the data distribution method shown in an embodiment of the present application. This embodiment takes the data distribution method executed by the server as an example, where the server can be, for example, a central processing unit in a server or electronic device in terms of hardware, and can be, for example, a related background service in a server or electronic device in terms of software.
[0032] In the streaming media service architecture redesigned in the embodiments of the present application, an SFU service, a PDC service, and an MCU are deployed on the server. The SFU service, PDC service, and MCU can be deployed on the same server or on different servers, and this embodiment of the present application does not limit this. Generally, a streaming media service architecture involves multiple SFU services, which can be deployed on the same server or on different servers.
[0033] like Figure 3 As shown, the method of this embodiment includes the following steps:
[0034] Step S310: Obtain client information using the SFU service, and obtain a media stream from the client using the SFU service.
[0035] Generally, when a client joins a room, the client will send client information to the SFU service through the room it joins. When the client receives the media stream to be sent to the room, the client will send the media stream to the SFU service. As a result, the SFU service will obtain the client information and the media stream from the client.
[0036] Step S320: Use the SFU service to publish the media stream to the PipeTopic corresponding to the client information.
[0037] The client information here can be understood as the client identifier and the room information of the room the client joins. The PipeTopic and PipePartition for publishing the media stream are determined based on the room information, and the Pipe for caching the media stream is determined based on the client identifier.
[0038] Step S330: Use the SFU service to determine other client information that the client can subscribe to from the MCU, subscribe to the PipeTopic from the PDC service based on the other client information that can be subscribed to, and forward the media stream obtained from the subscribed PipeTopic to the client.
[0039] Depend on Figure 3As shown, this embodiment redesigns the service architecture by deploying SFU service, PDC service and MCU service on the server side, forwards and controls media streams through SFU service and PDC service, and controls signaling during media stream distribution through MCU, processes media streams and signaling separately, and improves the processing efficiency of data distribution; in the data distribution process, the publish-subscribe model between SFU service and PDC service is utilized to realize the intercommunication of media data between different SFU services, significantly reducing the bandwidth resources and port resources occupied by transmitting media data, and when transmitting media data, the MCU is used to determine other client information that the SFU service can subscribe to, so that the SFU service has the right to choose the downlink media data, thereby saving downlink bandwidth resources of the server and client, reducing the decoding pressure of the client, and improving the timeliness of data distribution, so that the transmission of media streams in large-scale real-time communication scenarios has high real-time performance, laying the foundation for the real-time performance of audio and video calls.
[0040] The server in this embodiment mainly adopts the publish-subscribe model to distribute data. After the client joins the room, it triggers the media stream publishing process and the media stream subscription process. Figure 4 ,The media stream publishing process includes:
[0041] After the client joins the room, the client will send the client information to the corresponding SFU service. The client information includes the client identifier and the room information of the room the client joins. The room information includes the room type and room ID.
[0042] The room joined by the client may be connected to one or more SFU services. The client information is sent to the corresponding SFU service through the client's selection. If the user wants to send audio or video to the room he joins, the user will send the media stream formed by audio and / or video to the SFU service through the client.
[0043] After the SFU service obtains the client information and media stream, it creates a Producer and publishes the media stream sent by the client to the PipeTopic corresponding to the room type. The PDC service partitions the media stream published by the SFU service according to the PipePartition corresponding to the room ID. That is, the PDC service establishes a Pipe in the PipePartition and inputs the media data published by the client into the Pipe corresponding to the client ID. Furthermore, the SFU service also sends the obtained client information to the MCU, which manages the client based on the client information.
[0044] Continue to refer Figure 4 , the media stream subscription process includes:
[0045] After the SFU service sends the client information to the MCU, the MCU confirms the other client information that the client can subscribe to based on the room information of the room the client joins and sends it to the SFU service. After obtaining the other client information that the client can subscribe to, the SFU service generates a Consumer object to pull the media data from one or more Pipes under the PipePartition from the PipeTopic for consumption. Through consumption, the media streams published by other clients are sent to the client through the SFU service to realize the subscription of the media stream.
[0046] In the above embodiment, Pipe represents a data transmission pipeline, which is the smallest transmission unit in the PDC service. It can transmit media data in real time and cache media data of a specified length; PipeTopic represents a pipeline mode or pipeline topic. For example, in a real-time communication scenario, it is generally divided into call mode, live broadcast mode, and monitoring mode. PipeTopic can be used to more conveniently identify different types of media stream requirements; PipePartition represents a pipeline partition, which is used to separate media data under PipeTopic. There can be multiple PipePartitions in one pipeline mode, and there can be multiple Pipes under one PipePartition; Producer represents a producer, which is mainly used to produce media data to PipeTopic; Consumer pulls media data from the subscribed PipeTopic for consumption. The consumption is to process the data so that the media data format is compatible with the requirements of the pulling end or the receiving end, including data format conversion processing.
[0047] The following combination Figures 5 to 7 , detailing the upstream publishing process of media streams, the control process of the media distribution center, and the downstream subscription process of media streams.
[0048] In some embodiments, when deploying an SFU service that forwards load media streams, a PDC service that is responsible for the distribution and control of media data, and an MCU that is responsible for signaling scheduling on the server side, a first connection channel between the SFU service and the client is also deployed. The first connection channel includes a first link based on the TCP protocol and a second link based on the UDP protocol. The first link is used for signaling interaction between the client and the server, and the second link is used to transmit media streams between the client and the server; and a second connection channel between the SFU service and the PDC service is deployed. The second connection channel includes a third link based on the UDP protocol. The third link is used to transmit all published media data; and a third connection channel between the SFU service and the MCU is deployed. The third connection channel communicates based on the Http protocol.
[0049] like Figure 5As shown in the figure, after the server is deployed, the upstream publishing process of the media stream includes:
[0050] After Client1 joins Room A via TCP signaling, it sends its client information to the SFU1 service via the first link and its media stream via the second link. The order in which Client1 sends the client information and media stream to the SFU1 service is irrelevant and can be sent on demand. For example, when Client1 joins Room A, it sends its client information to the SFU1 service. When Client1 receives audio or video data, it sends the data to the SFU1 service as a media stream.
[0051] After the SFU1 service obtains the client information of client Client1, the SFU1 service generates a Producer object based on PipeTopic, PipePartition, Pipe and media stream, where PipeTopic corresponds to the room type, PipePartition corresponds to the room ID, and Pipe corresponds to the client identifier. The Producer produces media data and publishes it to the PipeTopic corresponding to the room type. The PDC service partitions the media data according to the PipePartition corresponding to the room ID and inputs the media data into the Pipe corresponding to the client identifier.
[0052] In addition, when the SFU1 service receives the client information of client Client1, it also sends the client information of client Client1 to the MCU through the third connection channel. The MCU manages the client based on the received client information, for example, writing the room type, room ID, and identifier of the room joined by client Client1 into the client information table.
[0053] refer to Figure 5 During the data distribution process, the MCU in this embodiment manages the client based on the client information table. For example, when the client joins the room, when the client publishes the media stream, or when the client publishes an abnormal media stream, the client information table will be updated. In addition, the MCU in this embodiment is also responsible for room management and SFU management, which includes but is not limited to room creation management, room deletion management, room broadcast management, etc.; SFU management includes but is not limited to service registration, service discovery and other management.
[0054] like Figure 6As shown in the figure, after the media data is published to the PDC service, it enters the control process of the media distribution center:
[0055] The PDC service in this embodiment is designed based on the publish-subscribe model. The PDC service internally classifies media data according to PipeTopic. The Producer object only needs to publish media data to PipeTopic, and the Consumer consumes media data from the subscribed PipeTopic.
[0056] PipeTopic partitions media data based on PipePartition. Each PipeTopic can contain one or more PipePartitions. Pipes for transmitting media data are created in PipePartition and each Pipe is identified with a unique ID. The unique ID of a Pipe can be a client identifier, such as a client ID. One Pipe corresponds to a media stream published by the client.
[0057] refer to Figure 6 After receiving media data published by the SFU1 service to the specified PipeTopic, the PDC service first partitions the media data based on the PipePartition and then inputs the media data into the Pipes under the PipePartition. That is, all published media data is input into the Pipes of the specified PipePartition under the specified PipeTopic. When an SFU subscribes to the PipeTopic, it can choose to consume media data from the specified Pipe or all Pipes under the PipePartition.
[0058] like Figure 7 As shown, after the media data exists in the PDC service, the downlink subscription process of the media stream begins:
[0059] In an application example of this embodiment, take the example of client Client1 joining room A through TCP signaling. At this time, client Client1 is connected to SFU1 service through room A. Figure 5 In the embodiment shown, SFU1 obtains the client information of client Client1 through the first link, and the client information includes the room information and client identifier of the room joined by client Client1. At this time, the SFU1 service determines other client information that client Client1 can subscribe to in the PDC service from the MCU based on the room information of the room joined by client Client1.
[0060] Here, the process of determining other client information that can be subscribed to includes:
[0061] First, the SFU1 service receives other client information from the MCU. The other client information here is the information of other clients with the same room type and room ID as the room joined by client Client1 after the MCU receives the room information of the room joined by client Client1, and filters it out according to the client information table it manages.
[0062] At this time, the other clients screened out can be understood as other clients in the same room as the client Client1.
[0063] After obtaining other clients, other client information can be obtained from the client information table, where the other client information includes: the situation of each other client publishing media streams, such as whether the media stream has been published, the status of the published media stream, including the publishing status, paused publishing status, abnormal publishing status, etc.
[0064] Other client information also includes: PipeTopic, PipePartition, and Pipe corresponding to the media stream published by each other client.
[0065] This embodiment generates a corresponding PipeTopic based on the room type of the room joined by the client, generates a corresponding PipePartition based on the room ID of the room joined by the client, and generates a corresponding Pipe based on the client identifier. That is, the PipeTopic has a corresponding relationship with the room type, the PipePartition has a corresponding relationship with the room ID, and the client identifier has a corresponding relationship with the Pipe. In this way, media data can be subscribed to from the PDU service based on the room type, room ID and client identifier.
[0066] Secondly, the SFU1 service determines other subscribing client information based on the received other client information.
[0067] Because the other client information filtered by the MCU includes the media stream publishing status of each other client, as well as the PipeTopic, PipePartition, and Pipe corresponding to each other client, the SFU1 service can determine from the received other client information that the other client information that has successfully published media streams is the subscribing other client information. That is, the SFU1 service determines the other clients that can be subscribed based on the media stream publishing status of each other client, and subscribes to media data from the PDC service based on the PipeTopic, PipePartition, and Pipe corresponding to the other clients that can be subscribed.
[0068] In an example, the SFU service creates a Consumer object, and uses the Consumer to pull media data from the target Pipe under the target PipePartition from the target PipeTopic for consumption, where the target PipeTopic is the PipeTopic corresponding to other subscribing clients, the target PipePartition is the PipePartition corresponding to other subscribing clients, and the target Pipe is the Pipe corresponding to other subscribing clients.
[0069] This application example illustrates a specific implementation method for determining subscribing information of other clients based on the room information of the room joined by client Client1. It should be understood that determining subscribing information of other clients based on the room information of the room joined by client Client1 may also be implemented in other ways, and this embodiment of the application does not limit this. For example, after the MCU filters out other clients based on the room information of the room joined by client Client1 to obtain a preliminary screening result, it may further filter the preliminary screening result based on information such as whether the client has successfully published a media stream, the client priority, and the client's geographic location, and use the secondary filtered information of other clients as subscribing information of other clients.
[0070] After consuming media data from the PDC service through the Consumer object, the media data obtained through consumption is sent to the client Client1 using the SFU1 service.
[0071] It should be understood that in the data distribution process, there is no order restriction on the uplink publishing process of the media stream and the downlink subscription process of the media stream. When the SFU1 service receives the media stream sent by the client, it executes the uplink publishing process of the media stream. When the SFU1 service receives the room information that the client can subscribe to sent by the MCU, it executes the downlink subscription process of the media stream.
[0072] In another example of this application example, taking the client Client2 joining room A through TCP signaling as an example, at this time, the client Client2 is connected to the SFU2 service through room A, and the SFU2 service obtains the client information of the client Client2 based on the TCP protocol. At this time, the SFU2 service determines the other client information that the client Client2 can subscribe to in the PDC service from the MCU based on the room information of the room joined by the client Client2. It is assumed that the other client information that can be subscribed at this time includes the client information of the client Client1.
[0073] The SFU2 service creates a Consumer, and uses the Consumer to pull the media data in the target Pipe under the target PipePartition from the target PipeTopic for consumption. Taking pulling the media stream published by client Client1 as an example, the Consumer pulls the media data in the Pipe corresponding to the client Client1 identifier under the PipePartition corresponding to the room ID of the room joined by client Client1 from the PipeTopic corresponding to the room type of the room joined by client Client1 for consumption. The SFU2 service sends the media data of client Client1 obtained through consumption to client Client2, thereby realizing the media call between client Client1 and client Client2.
[0074] Comparing the above two examples, different SFU services can indirectly realize the circulation of media streams with the help of PDC services. Figure 2 The method shown in this embodiment further simplifies the service architecture redesigned.
[0075] Based on the description of the above embodiments, the data distribution method proposed in this application has at least the following advantages:
[0076] First, the publish-subscribe model is introduced to set up the PDC service, so that the SFU service has the right to choose the downstream media stream. The clients in the room can choose whether to subscribe to the media streams of all remote users according to the actual situation, and rationally utilize the downstream bandwidth resources between the server and the client.
[0077] Second, in order to realize the intercommunication of media streams between different SFU services, this embodiment requires the PDC service to establish N connections with N SFU services respectively, while the existing solution requires (N(N-1) / 2) connections to be established between each SFU. In comparison, the service architecture of this embodiment is simpler, and the bandwidth resources and port resources occupied by the transmission of media data between SFU services will also be less.
[0078] Third, under the requirements of large-scale audio and video scenarios, the data distribution method of the publish-subscribe model can realize media calls between multiple clients by simply passing the service forwarding process of SFU—>PDC—>SFU. In the existing solution, if you want multiple clients connected to different SFU services to conduct media calls, it may be necessary to forward a large number of media streams of multiple clients to each other between multiple SFU services. In contrast, the method of this embodiment has higher transmission efficiency and can reduce the audio and video delay caused by multiple forwarding.
[0079] Based on the same idea as the above method, the embodiment of the present application provides a data distribution server, on which an SFU service for forwarding load media streams, a PDC service responsible for the distribution and control of media data, and an MCU responsible for signaling scheduling are deployed, wherein the PDC service is provided with a PipeTopic; Figure 8 As shown, the data distribution server of this embodiment includes:
[0080] The SFU service 810 is configured to obtain client information and media streams from the client, publish the media streams to the PipeTopic corresponding to the client information, determine other client information that the client can subscribe to from the MCU, subscribe to the PipeTopic from the PDC service based on the other client information that can be subscribed to, and forward the media streams obtained from the subscribed PipeTopic to the client.
[0081] The PDC service 820 is used to classify the media streams published by the SFU through the PipeTopic; when an SFU subscribes to the PipeTopic, it consumes the media data under the subscribed PipeTopic;
[0082] The MCU 830 is used to determine other client information that the client can subscribe to.
[0083] In some embodiments, the client information includes a client identifier and room information of a room joined by the client, and the room information includes a room type and a room ID.
[0084] In some embodiments, the SFU service 810 is configured to generate a Producer based on the PipeTopic, PipePartition, Pipe, and the media stream, wherein the PipeTopic corresponds to the room type, the PipePartition corresponds to the room ID, and the Pipe corresponds to the client identifier; the Producer produces media data and publishes it to the PipeTopic corresponding to the room type;
[0085] The PDC service 820 is configured to partition the media data according to the PipePartition corresponding to the room ID, and input the media data into the Pipe corresponding to the client identifier.
[0086] In some embodiments, the SFU service 810 is further configured to send the client information to the MCU after obtaining the client information;
[0087] Accordingly, the MCU 830 is configured to manage the client according to the received client information.
[0088] In some embodiments, the SFU service 810 is further configured to use the SFU service to determine, from the MCU, other client information that the client can subscribe to in the PDC service based on the room information of the room the client joins.
[0089] In some embodiments, the MCU 830 is configured to, after receiving the room information of the room joined by the client, filter out information of other clients having the same room type and room ID as the room joined by the client according to the client information table managed by it and send the information to the SFU service;
[0090] The SFU service 810 is used to receive other client information from the MCU, and determine other client information that can be subscribed based on the received other client information.
[0091] In some embodiments, the other client information screened by the MCU includes: the situation of each other client publishing a media stream, and the PipeTopic, PipePartition, and Pipe corresponding to each other client; accordingly,
[0092] The SFU service 810 is further configured to determine, from the received other client information, other client information that has successfully published a media stream as subscribing other client information.
[0093] In some embodiments, the SFU service 810 is also used to create a Consumer, and use the Consumer to pull the media data in the target Pipe under the target PipePartition from the target PipeTopic for consumption. The target PipeTopic is the PipeTopic corresponding to other subscribable clients, the target PipePartition is the PipePartition corresponding to other subscribable clients, and the target Pipe is the Pipe corresponding to other subscribable clients; the SFU service is used to send the media data obtained through consumption to the client.
[0094] It can be understood that the above-mentioned data distribution server can implement each step of the data distribution method provided in the aforementioned embodiment. The relevant explanations about the data distribution method are applicable to the data distribution server and will not be repeated here.
[0095] Figure 9 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 9At the hardware level, the electronic device includes a processor and memory, and optionally an internal bus and a network interface. The memory may include internal memory, such as high-speed random-access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device. Of course, the electronic device may also include other hardware required for its services.
[0096] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0097] The memory is used to store programs. Specifically, the program may include program code, which includes computer operating instructions. The memory may include internal memory and non-volatile memory, and provides instructions and data to the processor.
[0098] The processor reads the corresponding computer program from the non-volatile memory into the internal memory and then runs it, forming a data distribution server at the logical level. The processor executes the program stored in the memory and is specifically used to implement the data distribution method described above.
[0099] The above application Figure 3The method executed by the data distribution server disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor or software instructions. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of this application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0100] The electronic device may also perform Figure 3 The method executed by the data distribution server in Figure 3 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.
[0101] The embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, can enable the electronic device to execute Figure 3 The method executed by the data distribution server in the illustrated embodiment.
[0102] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0103] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0104] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0105] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0106] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0107] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0108] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0109] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0110] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0111] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A data distribution method, executed by a server, characterized in that: The server is deployed with an SFU service, a PDC service, and an MCU, and the PDC service is provided with a PipeTopic. The method includes: Use SFU service to obtain client information, and use SFU service to obtain media stream from the client; Utilize the SFU service to publish the media stream to the PipeTopic corresponding to the client information; Use the SFU service to determine the other client information that the client can subscribe to from the MCU, subscribe to the PipeTopic from the PDC service based on the other client information that can be subscribed to, and forward the media stream obtained from the subscribed PipeTopic to the client; The server is provided with a first connection channel between the SFU service and the client, the first connection channel including a first link and a second link, the first link being used for signaling interaction between the client and the server, and the second link being used for transmitting media streams between the client and the server; A second connection channel between the SFU service and the PDC service is deployed on the server, wherein the second connection channel includes a third link, and the third link is used to transmit all published media data; The server is provided with a third connection channel between the SFU service and the MCU, and the third connection channel is communicated based on the Http protocol.
2. The method according to claim 1, wherein The client information includes a client identifier and room information of a room that the client joins, and the room information includes a room type and a room ID.
3. The method according to claim 2, wherein Utilizing the SFU service to publish the media stream to the PipeTopic corresponding to the client information includes: The SFU service generates a Producer according to the PipeTopic, PipePartition, Pipe, and the media stream, wherein the PipeTopic corresponds to the room type, the PipePartition corresponds to the room ID, and the Pipe corresponds to the client identifier; The Producer produces media data and publishes it to the PipeTopic corresponding to the room type. The PDC service partitions the media data according to the PipePartition corresponding to the room ID and inputs the media data into the Pipe corresponding to the client identifier.
4. The method according to claim 1, wherein After using the SFU service to obtain client information, it also includes: The SFU service is used to send the client information to the MCU, and the MCU manages the client based on the received client information.
5. The method according to claim 2, wherein Use the SFU service to determine from the MCU other client information that the client can subscribe to, including: The SFU service is used to determine other client information that the client can subscribe to in the PDC service from the MCU based on the room information of the room the client joins.
6. The method according to claim 5, wherein The SFU service uses the room information of the room the client joins to determine other client information that the client can subscribe to in the PDC service from the MCU, including: The SFU service receives other client information from the MCU. The other client information is the information of other clients with the same room type and room ID as the room joined by the client, filtered out by the MCU according to the client information table managed by the MCU after receiving the room information of the room joined by the client; The SFU service determines other client information that can be subscribed based on the received other client information.
7. The method according to claim 6, wherein The other client information filtered by the MCU includes: the media stream publishing status of each other client, as well as the PipeTopic, PipePartition, and Pipe corresponding to each other client; the SFU service determines the subscribing client information based on the received other client information, including: The SFU service determines, from the received other client information, other client information that has successfully published a media stream as other client information that can be subscribed.
8. The method according to claim 7, wherein Subscribe to the PipeTopic from the PDC service based on other subscribing client information, and forward the media stream obtained from the subscribed PipeTopic to the client, including: Create a Consumer using the SFU service; Use Consumer to pull media data from the target Pipe under the target PipePartition from the target PipeTopic for consumption. The target PipeTopic is the PipeTopic corresponding to other subscribing clients, the target PipePartition is the PipePartition corresponding to other subscribing clients, and the target Pipe is the Pipe corresponding to other subscribing clients. The SFU service is used to send the media data obtained through consumption to the client.
9. A data distribution server, characterized in that: The server is deployed with an SFU service, a PDC service and an MCU, and the PDC service is provided with a PipeTopic; the data distribution server is used to implement any one of the methods of claims 1 to 8.
10. An electronic device, characterized in that: include: processor; as well as A memory arranged to store computer executable instructions, which when executed cause the processor to perform the method of any one of claims 1 to 8.
Citation Information
Patent Citations
Real-time data distribution system with distributed network architecture and working method thereof
CN101848236A
Multi-people network video session method and system
CN105338288A