CN113691526A - Pushing method, device, system, equipment and medium based on WebRTC - Google Patents

Pushing method, device, system, equipment and medium based on WebRTC Download PDF

Info

Publication number
CN113691526A
CN113691526A CN202110968266.5A CN202110968266A CN113691526A CN 113691526 A CN113691526 A CN 113691526A CN 202110968266 A CN202110968266 A CN 202110968266A CN 113691526 A CN113691526 A CN 113691526A
Authority
CN
China
Prior art keywords
webrtc
streaming
task
node
browser
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110968266.5A
Other languages
Chinese (zh)
Inventor
李鉴鸿
刘洋
陈思悦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Sensetime Technology Co Ltd
Original Assignee
Shenzhen Sensetime Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Sensetime Technology Co Ltd filed Critical Shenzhen Sensetime Technology Co Ltd
Priority to CN202110968266.5A priority Critical patent/CN113691526A/en
Publication of CN113691526A publication Critical patent/CN113691526A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/65Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure relates to a WebRTC-based stream pushing method, apparatus, system, device, and medium. The method comprises the following steps: responding to a WebRTC streaming request of web page real-time communication from a browser, and determining a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request; distributing the WebRTC plug flow task to the target plug flow task execution node; and responding to the target streaming task execution node to execute and complete the WebRTC streaming task, and sending a message of completing execution of the WebRTC streaming task to the browser.

Description

Pushing method, device, system, equipment and medium based on WebRTC
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a streaming method, an apparatus, a system, a device, and a medium based on WebRTC.
Background
With the continuous development of internet technology, audio and video media are increasingly popular with people, and more people listen to audio or watch video through a network to acquire information. WebRTC (Web Real-Time Communication ) can support a multi-platform browser to perform audio and video Communication, and is widely used in the service scenarios.
Disclosure of Invention
The disclosure provides a push flow technical scheme based on WebRTC.
According to an aspect of the present disclosure, there is provided a WebRTC-based stream pushing method, including:
the method is applied to the push flow task scheduling node, and comprises the following steps:
responding to a WebRTC streaming request of web page real-time communication from a browser, and determining a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request;
distributing the WebRTC plug flow task to the target plug flow task execution node;
and responding to the target streaming task execution node to execute and complete the WebRTC streaming task, and sending a message of completing execution of the WebRTC streaming task to the browser.
In the embodiment of the disclosure, the push streaming system based on the WebRTC adopts a distributed architecture, and includes a push streaming task scheduling node and a push streaming task executing node. By adopting the push flow system based on the WebRTC provided by the embodiment of the disclosure, the browser can not sense the change of push flow task execution nodes (such as increase and decrease of the number of the push flow task execution nodes, service upgrade, change of service types and the like) in the push flow system based on the WebRTC. When the flow is increased, one or more machines can be adopted to expand the push flow task execution nodes on the premise of not influencing the existing WebRTC-based push flow service, namely, one or more push flow task execution nodes can be added; when the flow is reduced, the number of nodes for executing the push flow task can be reduced on the premise of not influencing the existing WebRTC-based push flow service. Therefore, the flexible expansion of the push streaming system based on the WebRTC can be realized, the usability of the push streaming service based on the WebRTC is improved, the dynamic scheduling of resources is facilitated, and the utilization efficiency of the resources can be improved.
In one possible implementation manner, the determining, in response to a WebRTC streaming request from a browser for web page real-time communication, a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request includes:
responding to a WebRTC streaming request from a browser, and acquiring load information of at least one streaming task execution node;
and determining a target push flow task execution node for executing the WebRTC push flow task corresponding to the WebRTC push flow request according to the load information of the at least one push flow task execution node.
In the implementation manner, the streaming task scheduling node acquires load information of at least one streaming task execution node by responding to the WebRTC streaming request from the browser, and determines a target streaming task execution node for executing the WebRTC streaming task corresponding to the WebRTC streaming request according to the load information of the at least one streaming task execution node, thereby facilitating implementation of load balancing in a cluster of the streaming task execution nodes.
In one possible implementation manner, the acquiring load information of at least one streaming task execution node in response to a WebRTC streaming request from a browser includes:
and responding to a WebRTC streaming request from a browser, and acquiring load information of at least one streaming task execution node matched with a streaming type corresponding to the WebRTC streaming request.
According to the implementation mode, each plug flow task execution node does not need to support various plug flow types, so that the construction cost of the plug flow task execution node cluster is reduced, and more effective resource utilization is realized.
In one possible implementation manner, the acquiring load information of at least one streaming task execution node in response to a WebRTC streaming request from a browser includes:
and acquiring load information of at least one plug flow task execution node from the key value storage system in response to the WebRTC plug flow request from the browser.
In the implementation mode, by adopting the key value storage system, the push flow task scheduling node acquires the load information of at least one push flow task execution node through the key value storage system, so that the consistency and the availability of the push flow system based on the WebRTC are improved, and the performance of the push flow system based on the WebRTC is improved.
In one possible implementation manner, the allocating the WebRTC push flow task to the target push flow task execution node includes:
and writing the WebRTC plug-flow task into a directory corresponding to the target plug-flow task execution node in a key value storage system.
In the implementation mode, the push flow task scheduling node and the push flow task executing node communicate through the key value storage system, so that the consistency and the usability of the push flow system based on the WebRTC are improved, and the performance of the push flow system based on the WebRTC is improved.
In one possible implementation manner, the sending, to the browser, a message that execution of the WebRTC push streaming task is completed in response to the target push streaming task execution node executing to complete the WebRTC push streaming task includes:
and responding to the fact that the target streaming task execution node completes the WebRTC streaming task after being monitored by the key value storage system, and sending a message of completing the execution of the WebRTC streaming task to the browser.
In the implementation mode, the streaming task scheduling node responds to that the target streaming task execution node is monitored to execute and complete the WebRTC streaming task through the key value storage system, and sends a message of completing the execution of the WebRTC streaming task to the browser, so that the browser can conveniently establish WebRTC connection with the target streaming task execution node in time.
According to an aspect of the present disclosure, there is provided a WebRTC-based stream pushing method applied to a stream pushing task execution node, the method including:
responding to the acquired WebRTC streaming task distributed by the streaming task scheduling node, executing the WebRTC streaming task, and acquiring a data stream corresponding to the WebRTC streaming task;
responding to the completion of the execution of the WebRTC streaming task, and sending a message of the completion of the execution of the WebRTC streaming task to the streaming task scheduling node;
responding to a WebRTC connection establishment request from a browser, and establishing a WebRTC connection with the browser;
sending the data stream to the browser over the WebRTC connection.
In the embodiment of the disclosure, for any streaming task execution node in a WebRTC-based streaming system, the WebRTC streaming task is executed by responding to the WebRTC streaming task allocated by the streaming task scheduling node, a data stream corresponding to the WebRTC streaming task is obtained, a message that the WebRTC streaming task is executed is sent to the streaming task scheduling node in response to the completion of the execution of the WebRTC streaming task, a WebRTC connection is established with a browser in response to a WebRTC connection establishment request from the browser, and the data stream is sent to the browser through the WebRTC connection, so that the WebRTC-based distributed streaming is realized. According to the streaming method based on the WebRTC, provided by the embodiment of the disclosure, the browser can be unaware of changes of the streaming task execution nodes (such as increase and decrease of the number of the streaming task execution nodes, service upgrade, service type change and the like). When the flow is increased, one or more machines can be adopted to expand the push flow task execution nodes on the premise of not influencing the existing WebRTC-based push flow service, namely, one or more push flow task execution nodes can be added; when the flow is reduced, the number of nodes for executing the push flow task can be reduced on the premise of not influencing the existing WebRTC-based push flow service. Therefore, the flexible expansion of the push streaming system based on the WebRTC can be realized, the usability of the push streaming service based on the WebRTC is improved, the dynamic scheduling of resources is facilitated, and the utilization efficiency of the resources can be improved.
In a possible implementation manner, the executing, in response to obtaining the WebRTC streaming task allocated by the streaming task scheduling node, the WebRTC streaming task to obtain a data stream corresponding to the WebRTC streaming task includes:
responding to the acquired WebRTC streaming task distributed by the streaming task scheduling node, and sending a rendering request corresponding to the WebRTC streaming task to a target rendering node, so that the target rendering node responds to the rendering request and renders to obtain a data stream corresponding to the WebRTC streaming task;
the data stream is obtained from the target rendering node.
In the implementation mode, the streaming task execution node responds to the WebRTC streaming task distributed by the streaming task scheduling node, sends a rendering request corresponding to the WebRTC streaming task to the target rendering node, so that the target rendering node responds to the rendering request, obtains a data stream corresponding to the WebRTC streaming task through rendering, and obtains the data stream from the target rendering node, thereby realizing distributed rendering. When the amount of rendering tasks is increased, one or more machines can be adopted to expand rendering nodes on the premise of not influencing the existing WebRTC-based stream pushing service, namely, one or more rendering nodes can be added; when the amount of rendering tasks is reduced, rendering nodes can be reduced on the premise of not influencing the existing WebRTC-based stream pushing service. Therefore, the dynamic scheduling of the resources is facilitated, and the utilization efficiency of the resources can be improved.
In a possible implementation manner, the sending, to a target rendering node, a rendering request corresponding to a WebRTC streaming task in response to acquiring the WebRTC streaming task allocated by a streaming task scheduling node includes:
responding to the acquired WebRTC push flow task distributed by the push flow task scheduling node, and determining a target rendering node matched with the push flow type corresponding to the WebRTC push flow task;
and sending a rendering request corresponding to the WebRTC stream pushing task to the target rendering node.
According to the implementation mode, each rendering node does not need to support various plug flow types, so that the construction cost of the rendering node cluster is reduced, and more effective resource utilization is realized.
In one possible implementation, the push flow task execution node communicates with the target rendering node through a remote procedure call.
According to the implementation mode, the convenience of communication between the plug flow task execution node and the rendering node is improved.
In one possible implementation, the method further includes:
and monitoring a directory corresponding to the push flow task execution node in the key value storage system, wherein the push flow task scheduling node is allocated to the WebRTC push flow task of the push flow task execution node.
In the implementation mode, the push flow task scheduling node and the push flow task executing node communicate through the key value storage system, so that the consistency and the usability of the push flow system based on the WebRTC are improved, and the performance of the push flow system based on the WebRTC is improved.
In one possible implementation manner, the sending, to the streaming task scheduling node, a message that execution of the WebRTC streaming task is completed in response to completion of execution of the WebRTC streaming task includes:
and in response to the completion of the execution of the WebRTC streaming task, writing a message of the completion of the execution of the WebRTC streaming task into a directory corresponding to a streaming task execution node in a key value storage system.
In this implementation manner, the streaming task execution node responds to completion of execution of the WebRTC streaming task, and writes a message of completion of execution of the WebRTC streaming task into a directory corresponding to the streaming task execution node in the key value storage system, so that the message of completion of execution of the WebRTC streaming task is sent to the streaming task scheduling node through the key value storage system, which is helpful for improving performance of the WebRTC-based streaming system.
In one possible implementation, the method further includes:
and responding to the update of the load information of the push flow task execution node, and sending the updated load information of the push flow task execution node to a key value storage system.
In the implementation mode, the push flow task execution node sends the updated load information of the push flow task execution node to the key value storage system by responding to the update of the load information of the push flow task execution node, so that the push flow task scheduling node can conveniently distribute the WebRTC push flow tasks according to the load information of each push flow task execution node, and the realization of load balance in a cluster of the push flow task execution node is facilitated.
According to an aspect of the present disclosure, there is provided a WebRTC-based stream pushing method applied to a browser, the method including:
sending a WebRTC streaming request to a streaming task scheduling node;
responding to a message of completion of execution of a WebRTC streaming task corresponding to the WebRTC streaming request from the streaming task scheduling node, and sending a WebRTC connection establishment request to a target streaming task execution node in the message of completion of execution of the WebRTC streaming task so that the target streaming task execution node establishes WebRTC connection with the browser;
and acquiring a data stream corresponding to the WebRTC plug flow task from the target plug flow task execution node through the WebRTC connection.
In the embodiment of the disclosure, the browser sends a WebRTC streaming request to the streaming task scheduling node, responds to a message that execution of a WebRTC streaming task corresponding to the WebRTC streaming request from the streaming task scheduling node is completed, and sends a WebRTC connection establishment request to a target streaming task execution node in the message that execution of the WebRTC streaming task is completed, so that the target streaming task execution node establishes a WebRTC connection with the browser, and acquires a data stream corresponding to the WebRTC streaming task from the target streaming task execution node through the WebRTC connection, thereby implementing the WebRTC-based distributed streaming. According to the streaming method based on the WebRTC, provided by the embodiment of the disclosure, the browser can be unaware of changes of the streaming task execution nodes (such as increase and decrease of the number of the streaming task execution nodes, service upgrade, service type change and the like). When the flow is increased, one or more machines can be adopted to expand the push flow task execution nodes on the premise of not influencing the existing WebRTC-based push flow service, namely, one or more push flow task execution nodes can be added; when the flow is reduced, the number of nodes for executing the push flow task can be reduced on the premise of not influencing the existing WebRTC-based push flow service. Therefore, the flexible expansion of the push streaming system based on the WebRTC can be realized, the usability of the push streaming service based on the WebRTC is improved, the dynamic scheduling of resources is facilitated, and the utilization efficiency of the resources can be improved.
According to an aspect of the present disclosure, there is provided a streaming apparatus based on WebRTC, applied to a streaming task scheduling node, the apparatus including:
the determining module is used for responding to a WebRTC streaming request from a browser for real-time communication, and determining a target streaming task executing node for executing the WebRTC streaming task corresponding to the WebRTC streaming request;
the distribution module is used for distributing the WebRTC plug flow task to the target plug flow task execution node;
and the first sending module is used for responding to the target streaming task execution node to execute and complete the WebRTC streaming task and sending a message of the completion of the execution of the WebRTC streaming task to the browser.
In one possible implementation, the determining module is configured to:
responding to a WebRTC streaming request from a browser, and acquiring load information of at least one streaming task execution node;
and determining a target push flow task execution node for executing the WebRTC push flow task corresponding to the WebRTC push flow request according to the load information of the at least one push flow task execution node.
In one possible implementation, the determining module is configured to:
and responding to a WebRTC streaming request from a browser, and acquiring load information of at least one streaming task execution node matched with a streaming type corresponding to the WebRTC streaming request.
In one possible implementation, the determining module is configured to:
and acquiring load information of at least one plug flow task execution node from the key value storage system in response to the WebRTC plug flow request from the browser.
In one possible implementation, the allocation module is configured to:
and writing the WebRTC plug-flow task into a directory corresponding to the target plug-flow task execution node in a key value storage system.
In one possible implementation, the first sending module is configured to:
and responding to the fact that the target streaming task execution node completes the WebRTC streaming task after being monitored by the key value storage system, and sending a message of completing the execution of the WebRTC streaming task to the browser.
According to an aspect of the present disclosure, there is provided a WebRTC-based stream pushing apparatus applied to a stream pushing task execution node, the apparatus including:
the execution module is used for responding to the acquired WebRTC streaming task distributed by the streaming task scheduling node, executing the WebRTC streaming task and acquiring a data stream corresponding to the WebRTC streaming task;
the second sending module is used for responding to the completion of the execution of the WebRTC streaming task and sending a message of the completion of the execution of the WebRTC streaming task to the streaming task scheduling node;
the connection establishing module is used for responding to a WebRTC connection establishing request from a browser and establishing a WebRTC connection with the browser;
and the third sending module is used for sending the data stream to the browser through the WebRTC connection.
In one possible implementation manner, the execution module is configured to:
responding to the acquired WebRTC streaming task distributed by the streaming task scheduling node, and sending a rendering request corresponding to the WebRTC streaming task to a target rendering node, so that the target rendering node responds to the rendering request and renders to obtain a data stream corresponding to the WebRTC streaming task;
the data stream is obtained from the target rendering node.
In one possible implementation manner, the execution module is configured to:
responding to the acquired WebRTC push flow task distributed by the push flow task scheduling node, and determining a target rendering node matched with the push flow type corresponding to the WebRTC push flow task;
and sending a rendering request corresponding to the WebRTC stream pushing task to the target rendering node.
In one possible implementation, the push flow task execution node communicates with the target rendering node through a remote procedure call.
In one possible implementation, the apparatus further includes:
and the monitoring module is used for monitoring the WebRTC streaming task which is distributed to the streaming task execution node by the streaming task scheduling node under the directory corresponding to the streaming task execution node in the key value storage system.
In a possible implementation manner, the second sending module is configured to:
and in response to the completion of the execution of the WebRTC streaming task, writing a message of the completion of the execution of the WebRTC streaming task into a directory corresponding to a streaming task execution node in a key value storage system.
In one possible implementation, the apparatus further includes:
and the sixth sending module is used for responding to the update of the load information of the push flow task execution node and sending the updated load information of the push flow task execution node to the key value storage system.
According to an aspect of the present disclosure, there is provided a WebRTC-based stream pushing apparatus applied to a browser, the apparatus including:
the fourth sending module is used for sending the WebRTC streaming request to the streaming task scheduling node;
a fifth sending module, configured to send, in response to a WebRTC streaming task execution completion message corresponding to the WebRTC streaming request from the streaming task scheduling node, a WebRTC connection establishment request to a target streaming task execution node in the WebRTC streaming task execution completion message, so that the target streaming task execution node establishes a WebRTC connection with the browser;
and the acquisition module is used for acquiring the data stream corresponding to the WebRTC streaming task from the target streaming task execution node through the WebRTC connection.
According to an aspect of the present disclosure, a streaming system based on WebRTC is provided, including a streaming task scheduling node and at least one streaming task executing node;
the streaming task scheduling node is used for responding to a WebRTC streaming request from a browser, determining a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request, distributing the WebRTC streaming task to the target streaming task execution node, responding to the target streaming task execution node to execute and complete the WebRTC streaming task, and sending a message of completion of execution of the WebRTC streaming task to the browser;
the streaming task execution node is used for responding to the WebRTC streaming task distributed by the streaming task scheduling node, executing the WebRTC streaming task to obtain a data stream corresponding to the WebRTC streaming task, responding to the completion of the execution of the WebRTC streaming task, sending a message of the completion of the execution of the WebRTC streaming task to the streaming task scheduling node, responding to a WebRTC connection establishment request from a browser, establishing a WebRTC connection with the browser, and sending the data stream to the browser through the WebRTC connection.
According to an aspect of the present disclosure, there is provided an electronic device including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to invoke the memory-stored executable instructions to perform the above-described method.
According to an aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method.
In the embodiment of the disclosure, the push streaming system based on the WebRTC adopts a distributed architecture, and includes a push streaming task scheduling node and a push streaming task executing node. By adopting the push flow system based on the WebRTC provided by the embodiment of the disclosure, the browser can not sense the change of push flow task execution nodes (such as increase and decrease of the number of the push flow task execution nodes, service upgrade, change of service types and the like) in the push flow system based on the WebRTC. When the flow is increased, one or more machines can be adopted to expand the push flow task execution nodes on the premise of not influencing the existing WebRTC-based push flow service, namely, one or more push flow task execution nodes can be added; when the flow is reduced, the number of nodes for executing the push flow task can be reduced on the premise of not influencing the existing WebRTC-based push flow service. Therefore, the flexible expansion of the push streaming system based on the WebRTC can be realized, the usability of the push streaming service based on the WebRTC is improved, the dynamic scheduling of resources is facilitated, and the utilization efficiency of the resources can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 shows a flowchart of a WebRTC-based stream pushing method provided by an embodiment of the present disclosure.
Fig. 2 shows another flowchart of a WebRTC-based stream pushing method provided by an embodiment of the present disclosure.
Fig. 3 shows another flowchart of a WebRTC-based stream pushing method provided by an embodiment of the present disclosure.
Fig. 4 shows a schematic diagram of a WebRTC-based stream pushing method provided by an embodiment of the present disclosure.
Fig. 5 shows a block diagram of a WebRTC-based stream pushing apparatus provided by an embodiment of the present disclosure.
Fig. 6 illustrates another block diagram of a WebRTC-based stream pushing apparatus provided by an embodiment of the present disclosure.
Fig. 7 illustrates another block diagram of a WebRTC-based stream pushing apparatus provided by an embodiment of the present disclosure.
Fig. 8 illustrates a block diagram of an electronic device 800 provided by an embodiment of the disclosure.
Fig. 9 shows a block diagram of an electronic device 1900 provided by an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
WebRTC has advantages such as high scalability, high availability, low latency. In the related technology, when audio and video push streaming is performed through WebRTC, a push streaming server is deeply coupled with a browser. When the push streaming server needs to update, all current push streaming services need to be stopped, which affects user experience.
In the embodiment of the disclosure, the push streaming system based on the WebRTC adopts a distributed architecture, and includes a push streaming task scheduling node and a push streaming task executing node. By adopting the push flow system based on the WebRTC provided by the embodiment of the disclosure, the browser can not sense the change of push flow task execution nodes (such as increase and decrease of the number of the push flow task execution nodes, service upgrade, change of service types and the like) in the push flow system based on the WebRTC. When the flow is increased, one or more machines can be adopted to expand the push flow task execution nodes on the premise of not influencing the existing WebRTC-based push flow service, namely, one or more push flow task execution nodes can be added; when the flow is reduced, the number of nodes for executing the push flow task can be reduced on the premise of not influencing the existing WebRTC-based push flow service. Therefore, the flexible expansion of the push streaming system based on the WebRTC can be realized, the usability of the push streaming service based on the WebRTC is improved, the dynamic scheduling of resources is facilitated, and the utilization efficiency of the resources can be improved.
The WebRTC-based stream pushing method provided by the embodiments of the present disclosure is described in detail below with reference to the accompanying drawings.
Fig. 1 shows a flowchart of a WebRTC-based stream pushing method provided by an embodiment of the present disclosure. The push flow method based on the WebRTC is applied to the push flow task scheduling node. The push flow task scheduling node may be a server or other processing device. In some possible implementations, the WebRTC-based push flow method can be implemented by a processor calling computer-readable instructions stored in a memory. As shown in fig. 1, the WebRTC-based plug flow method includes steps S11 to S13.
In step S11, in response to the WebRTC streaming request from the browser, a target streaming task execution node for executing the WebRTC streaming task corresponding to the WebRTC streaming request is determined.
In step S12, the WebRTC push flow task is assigned to the target push flow task execution node.
In step S13, in response to the target streaming task execution node completing the WebRTC streaming task, sending a message that the WebRTC streaming task is completed to the browser.
In the embodiment of the present disclosure, the streaming task scheduling node may represent a node for scheduling the WebRTC streaming task, and the streaming task executing node may represent a node for executing the WebRTC streaming task. The number of the push flow task execution nodes can be flexibly increased or decreased according to the traffic size (for example, the number of WebRTC push flow requests received in unit time). The push flow task scheduling node can be used for distributing the WebRTC push flow tasks to the push flow task execution nodes. The WebRTC streaming task may represent a task of pushing a data stream to a browser based on WebRTC. Wherein the data stream may comprise at least one of a video stream, an audio stream, an image stream, a text stream, and the like.
In the embodiment of the present disclosure, the browser may use a communication Protocol such as HTTP (HyperText Transfer Protocol) to communicate with the push flow task scheduling node. The browser can send a WebRTC streaming request to the streaming task scheduling node, wherein the WebRTC streaming request can be used for requesting the streaming task scheduling node to push streaming to the browser based on the WebRTC. When the number of the streaming task execution nodes is more than two, the streaming task scheduling node may determine, in response to the WebRTC streaming request from the browser, a target streaming task execution node for executing the WebRTC streaming task corresponding to the WebRTC streaming request from among the two or more streaming task execution nodes, and allocate the WebRTC streaming task to the target streaming task execution node. In the case that the number of the current push flow task execution nodes is only one, the push flow task scheduling node may respond to the WebRTC push flow request from the browser and take the push flow task execution node as a target push flow task execution node. The target push flow task execution node may represent a push flow task execution node determined by the push flow task scheduling node and used for executing the WebRTC push flow task corresponding to the WebRTC push flow request.
After the target streaming task execution node acquires the WebRTC streaming task distributed by the streaming task scheduling node, the target streaming task execution node can execute the WebRTC streaming task to acquire a data stream corresponding to the WebRTC streaming task, and can respond to the completion of the execution of the WebRTC streaming task and send a message of the completion of the execution of the WebRTC streaming task to the streaming task scheduling node. The streaming task scheduling node can respond to the message that the execution of the WebRTC streaming task is completed, judge that the execution of the WebRTC streaming task is completed by the target streaming task executing node, and send the message that the execution of the WebRTC streaming task is completed to the browser, so that the browser is informed of establishing WebRTC connection with the target streaming task executing node to acquire the data stream.
In the embodiment of the disclosure, the streaming task scheduling node determines, by responding to a WebRTC streaming request from a browser, a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request, allocates the WebRTC streaming task to the target streaming task execution node, completes the WebRTC streaming task by responding to the target streaming task execution node, and sends a message of completion of execution of the WebRTC streaming task to the browser, thereby implementing WebRTC-based distributed streaming. According to the streaming method based on the WebRTC, provided by the embodiment of the disclosure, the browser can be unaware of changes of the streaming task execution nodes (such as increase and decrease of the number of the streaming task execution nodes, service upgrade, service type change and the like). When the flow is increased, one or more machines can be adopted to expand the push flow task execution nodes on the premise of not influencing the existing WebRTC-based push flow service, namely, one or more push flow task execution nodes can be added; when the flow is reduced, the number of nodes for executing the push flow task can be reduced on the premise of not influencing the existing WebRTC-based push flow service. Therefore, the flexible expansion of the push streaming system based on the WebRTC can be realized, the usability of the push streaming service based on the WebRTC is improved, the dynamic scheduling of resources is facilitated, and the utilization efficiency of the resources can be improved.
In one possible implementation manner, the determining, in response to a WebRTC streaming request from a browser for web page real-time communication, a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request includes: responding to a WebRTC streaming request from a browser, and acquiring load information of at least one streaming task execution node; and determining a target push flow task execution node for executing the WebRTC push flow task corresponding to the WebRTC push flow request according to the load information of the at least one push flow task execution node. In the implementation manner, the streaming task scheduling node acquires load information of at least one streaming task execution node by responding to the WebRTC streaming request from the browser, and determines a target streaming task execution node for executing the WebRTC streaming task corresponding to the WebRTC streaming request according to the load information of the at least one streaming task execution node, thereby facilitating implementation of load balancing in a cluster of the streaming task execution nodes.
As an example of this implementation manner, the push flow task scheduling node may select, according to the load information of the at least one push flow task execution node, a push flow task execution node with the smallest load from the at least one push flow task execution node as a target push flow task execution node, thereby facilitating implementation of load balancing in a cluster of push flow task execution nodes.
As another example of this implementation manner, the push flow task scheduling node may select, according to the load information of the at least one push flow task execution node, a push flow task execution node whose load information meets a preset condition from the at least one push flow task execution node as a target push flow task execution node. The preset condition may represent a preset condition for determining whether the push flow task execution node has the capability of processing a new WebRTC push flow task. If the load information of any plug flow task execution node in the at least one plug flow task execution node meets the preset condition, determining that the plug flow task execution node currently has the capability of processing the WebRTC plug flow task corresponding to the WebRTC plug flow request; if the load information of any one of the at least one push flow task execution node does not satisfy the preset condition, it may be determined that the push flow task execution node does not currently have the capability of processing the WebRTC push flow task corresponding to the WebRTC push flow request.
As an example of this implementation manner, the obtaining load information of at least one streaming task execution node in response to the WebRTC streaming request from the browser includes: and responding to a WebRTC streaming request from a browser, and acquiring load information of at least one streaming task execution node matched with a streaming type corresponding to the WebRTC streaming request.
The push stream type corresponding to the WebRTC push stream request may indicate a type of a data stream requested to be pushed by the WebRTC push stream request. For example, in a case that the data stream requested to be pushed by the WebRTC plug flow request is a video stream, the type of the plug flow corresponding to the WebRTC plug flow request may be a 2D (2Dimensions, two-dimensional) plug flow, a 3D (3Dimensions, three-dimensional) plug flow, a super-realistic 3D plug flow, and the like, which is not limited herein. The type of the push stream corresponding to the WebRTC push stream request is a 2D push stream, which may indicate that the video stream requested to be pushed by the WebRTC push stream request is a 2D video stream, for example, the 2D video stream may include a 2D real person video stream, a 2D cartoon video stream, and the like. The type of the push stream corresponding to the WebRTC push stream request is a 3D push stream, which may indicate that the video stream requested to be pushed by the WebRTC push stream request is a 3D video stream, for example, the 3D video stream may include a 3D real person video stream, a 3D card through video stream, and the like. The plug flow type corresponding to the WebRTC plug flow request is a super-realistic 3D plug flow, and may indicate that the video stream requested to be pushed by the WebRTC plug flow request is a super-realistic 3D video stream, for example, the super-realistic 3D video stream may include a super-realistic 3D real person video stream, a super-realistic 3D cartoon video stream, and the like.
In this example, the correspondence between each of the push flow task execution nodes and the push flow type may be established in advance. Any of the push flow task execution nodes may correspond to one or more than two push flow types, that is, any of the push flow task execution nodes may support one or more than two push flow types. According to the example, each plug flow task execution node does not need to support various plug flow types, so that the construction cost of the plug flow task execution node cluster is reduced, and more effective resource utilization is realized.
As another example of this implementation, each of the push task execution nodes supports various push flow types. The streaming task scheduling node can respond to the WebRTC streaming request from the browser, acquire load information of each streaming task execution node, and determine a target streaming task execution node for executing the WebRTC streaming task corresponding to the WebRTC streaming request according to the load information of each streaming task execution node.
As an example of this implementation manner, the obtaining load information of at least one streaming task execution node in response to the WebRTC streaming request from the browser includes: and acquiring load information of at least one plug flow task execution node from the key value storage system in response to the WebRTC plug flow request from the browser. The Key-Value (KV) storage system may adopt Etcd, Zookeeper, and the like, which is not limited herein. Among other things, Etcd is a highly consistent distributed key value storage system that provides a reliable way to store data that needs to be accessed by a distributed system or cluster of machines. It can efficiently handle leader elections during network partitioning, and can also tolerate disaster even in the leader node. In addition, Etcd may store data under a hierarchically leased directory and provide an interface to observe changes to a particular key or directory, enabling a user to react to changes in value. The notification of the Etcd has sustainability, and the listening events do not need to be registered continuously after the listening events are registered once.
In this example, the push flow task scheduling node may communicate with the key-value storage system by way of a Remote Procedure Call (RPC) or the like. For example, the push flow task scheduling node may communicate with the key-value storage system through the gRPC. For example, the push flow task scheduling node may obtain load information of at least one push flow task execution node from the key value storage system through the gRPC in response to a WebRTC push flow request from the browser.
In one example, the push flow task scheduling node may register a monitoring event with the key value storage system in response to completion of the start, so as to obtain information of each push flow task execution node in real time, thereby implementing a service discovery function. The information of any plug flow task execution node may include information of whether the plug flow task execution node is started or not, and load information of the plug flow task execution node. That is, the push flow task scheduling node may obtain a list of currently started push flow task execution nodes and/or a list of currently un-started push flow task execution nodes from the key value storage system, and may obtain load information of the currently started push flow task execution nodes from the key value storage system.
In the above example, by using the key value storage system, the push flow task scheduling node obtains load information of at least one push flow task execution node through the key value storage system, which helps to improve consistency and availability of the push flow system based on WebRTC, and helps to improve performance of the push flow system based on WebRTC.
As another example of this implementation, the push flow task scheduling node may directly communicate with each push flow task execution node to directly obtain load information of each push flow task execution node from each push flow task execution node.
In another possible implementation manner, the determining, in response to a WebRTC streaming request from a browser for web page real-time communication, a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request includes: responding to a WebRTC streaming request from a browser, and acquiring state information of at least one streaming task execution node; and determining a target push flow task execution node for executing the WebRTC push flow task corresponding to the WebRTC push flow request according to the state information of the at least one push flow task execution node. In this implementation, the state information of any of the at least one push flow task execution node may be used to indicate whether the push flow task execution node currently has the capability of processing a new WebRTC push flow task. For example, if the state information of the plug flow task execution node is available, it may be determined that the plug flow task execution node currently has the capability of processing a new WebRTC plug flow task; if the state information of the push flow task execution node is unavailable, it can be determined that the push flow task execution node does not currently have the capability of processing a new WebRTC push flow task. In this implementation, any of the plug flow task execution nodes whose state information is available may be used as the target plug flow task execution node.
In one possible implementation manner, the allocating the WebRTC push flow task to the target push flow task execution node includes: and writing the WebRTC plug-flow task into a directory corresponding to the target plug-flow task execution node in a key value storage system. In this implementation manner, after the streaming task scheduling node writes the WebRTC streaming task into the directory corresponding to the target streaming task execution node in the key value storage system, the target streaming task execution node may obtain the WebRTC streaming task by monitoring the directory of the target streaming task execution node. In the implementation mode, the push flow task scheduling node and the push flow task executing node communicate through the key value storage system, so that the consistency and the usability of the push flow system based on the WebRTC are improved, and the performance of the push flow system based on the WebRTC is improved.
In another possible implementation manner, the push flow task scheduling node may directly send the WebRTC push flow task to the target push flow task execution node.
In one possible implementation manner, the sending, to the browser, a message that execution of the WebRTC push streaming task is completed in response to the target push streaming task execution node executing to complete the WebRTC push streaming task includes: and responding to the fact that the target streaming task execution node completes the WebRTC streaming task after being monitored by the key value storage system, and sending a message of completing the execution of the WebRTC streaming task to the browser. In this implementation manner, the target push flow task execution node may respond to completion of execution of the WebRTC push flow task, and write a message of completion of execution of the WebRTC push flow task into a directory corresponding to the target push flow task execution node in the key value storage system. The stream pushing task scheduling node can monitor a directory corresponding to the target stream pushing task execution node in the key value storage system in real time, and can respond to a message that the execution of the WebRTC stream pushing task is completed under the monitoring of the directory corresponding to the target stream pushing task execution node, and send the message that the execution of the WebRTC stream pushing task is completed to the browser. The message that the execution of the WebRTC push flow task is completed, which is sent by the push flow task scheduling node to the browser, may carry identification information of the target push flow task execution node, so that the browser sends a WebRTC connection establishment request to the target push flow task execution node according to the identification information. In the implementation mode, the streaming task scheduling node responds to that the target streaming task execution node is monitored to execute and complete the WebRTC streaming task through the key value storage system, and sends a message of completing the execution of the WebRTC streaming task to the browser, so that the browser can conveniently establish WebRTC connection with the target streaming task execution node in time.
In another possible implementation manner, the target push flow task execution node may directly send a message that the WebRTC push flow task is completed to the push flow task scheduling node. The streaming task scheduling node may forward, to the browser, a message that execution of the WebRTC streaming task is completed in response to the message that execution of the WebRTC streaming task is completed from the target streaming task executing node.
Fig. 2 shows another flowchart of a WebRTC-based stream pushing method provided by an embodiment of the present disclosure. The push flow method based on the WebRTC is applied to the push flow task execution node. Wherein, the push flow task execution node can be a server or other processing equipment. In some possible implementations, the WebRTC-based push flow method can be implemented by a processor calling computer-readable instructions stored in a memory. As shown in fig. 2, the WebRTC-based plug flow method includes steps S21 to S24.
In step S21, in response to acquiring the WebRTC streaming task allocated by the streaming task scheduling node, the WebRTC streaming task is executed to obtain a data stream corresponding to the WebRTC streaming task.
In step S22, in response to the completion of the execution of the WebRTC streaming task, a message that the execution of the WebRTC streaming task is completed is sent to the streaming task scheduling node.
In step S23, in response to a WebRTC connection establishment request from a browser, a WebRTC connection is established with the browser.
In step S24, the data stream is sent to the browser over the WebRTC connection.
In the embodiment of the present disclosure, the streaming task scheduling node may write the WebRTC streaming task into a directory corresponding to the streaming task execution node in the key value storage system, so as to allocate the WebRTC streaming task to the streaming task execution node. Or, the push flow task scheduling node may directly send the WebRTC push flow task to the push flow task execution node, that is, the push flow task execution node may directly obtain the WebRTC push flow task from the push flow task scheduling node.
In one possible implementation, the method further includes: and monitoring a directory corresponding to the push flow task execution node in the key value storage system, wherein the push flow task scheduling node is allocated to the WebRTC push flow task of the push flow task execution node. In this implementation manner, the push flow task scheduling node may write the WebRTC push flow task into a directory corresponding to the push flow task execution node in the key value storage system. After the push flow task scheduling node writes the WebRTC push flow task into a directory corresponding to the push flow task execution node in the key value storage system, the push flow task execution node may obtain the WebRTC push flow task by monitoring the directory of the push flow task execution node. In the implementation mode, the push flow task scheduling node and the push flow task executing node communicate through the key value storage system, so that the consistency and the usability of the push flow system based on the WebRTC are improved, and the performance of the push flow system based on the WebRTC is improved.
In this implementation, the push flow task execution node may communicate with the key value storage system by means of remote procedure call or the like. For example, the push flow task execution node may communicate with the key-value storage system through the gRPC.
In one possible implementation, the method further includes: and responding to the update of the load information of the push flow task execution node, and sending the updated load information of the push flow task execution node to a key value storage system. In this implementation manner, the push flow task execution node may register, in response to completion of the start, an event for monitoring a directory of the push flow task execution node with a key value storage system, and may update load information of the push flow task execution node in real time. The push flow task execution node sends the updated load information of the push flow task execution node to the key value storage system by responding to the update of the load information of the push flow task execution node, so that the push flow task scheduling node can conveniently distribute the WebRTC push flow tasks according to the load information of each push flow task execution node, and the load balance in the cluster of the push flow task execution node can be realized. In addition, by adopting the key value storage system, the push flow task execution node sends the updated load information of the push flow task execution node to the key value storage system, so that the consistency and the availability of the push flow system based on the WebRTC are improved, and the performance of the push flow system based on the WebRTC is improved.
In another possible implementation manner, the push flow task execution node may directly send the updated load information of the push flow task execution node to the push flow task scheduling node without using a key value storage system.
In the embodiment of the disclosure, the streaming task execution node may obtain the data stream corresponding to the WebRTC streaming task by executing the WebRTC streaming task. Wherein, the data stream corresponding to the WebRTC plug flow task may include at least one of a video stream, an audio stream, an image stream, a text stream, and the like.
In a possible implementation manner, the executing, in response to obtaining the WebRTC streaming task allocated by the streaming task scheduling node, the WebRTC streaming task to obtain a data stream corresponding to the WebRTC streaming task includes: responding to the acquired WebRTC streaming task distributed by the streaming task scheduling node, and sending a rendering request corresponding to the WebRTC streaming task to a target rendering node, so that the target rendering node responds to the rendering request and renders to obtain a data stream corresponding to the WebRTC streaming task; the data stream is obtained from the target rendering node. In this implementation, the push flow task execution node may communicate with the rendering node by means of remote procedure call or the like. For example, the rendering node is a video rendering node, and the stream pushing task execution node may communicate with the video rendering node through the gRPC. In this implementation manner, when the number of the rendering nodes is more than two, the streaming task execution node may determine, in response to acquiring the WebRTC streaming task allocated by the streaming task scheduling node, a target rendering node for executing the rendering task corresponding to the WebRTC streaming task from the more than two rendering nodes, and send a rendering request corresponding to the WebRTC streaming task to the target rendering node. When the number of the rendering nodes is only one, the push flow task execution node may take the rendering node as a target rendering node in response to acquiring the WebRTC push flow task allocated by the push flow task scheduling node. The target rendering node may represent a rendering node determined by the push flow task execution node and used for executing the rendering task corresponding to the WebRTC push flow task. The target rendering node can respond to a rendering request corresponding to the WebRTC streaming task and process the rendering task corresponding to the WebRTC streaming task to obtain a data stream corresponding to the WebRTC streaming task. In the implementation mode, the streaming task execution node responds to the WebRTC streaming task distributed by the streaming task scheduling node, sends a rendering request corresponding to the WebRTC streaming task to the target rendering node, so that the target rendering node responds to the rendering request, obtains a data stream corresponding to the WebRTC streaming task through rendering, and obtains the data stream from the target rendering node, thereby realizing distributed rendering. When the amount of rendering tasks is increased, one or more machines can be adopted to expand rendering nodes on the premise of not influencing the existing WebRTC-based stream pushing service, namely, one or more rendering nodes can be added; when the amount of rendering tasks is reduced, rendering nodes can be reduced on the premise of not influencing the existing WebRTC-based stream pushing service. Therefore, the dynamic scheduling of the resources is facilitated, and the utilization efficiency of the resources can be improved.
As an example of the implementation manner, the sending, to a target rendering node, a rendering request corresponding to a WebRTC streaming task in response to acquiring the WebRTC streaming task allocated by a streaming task scheduling node includes: responding to the acquired WebRTC push flow task distributed by the push flow task scheduling node, and determining a target rendering node matched with the push flow type corresponding to the WebRTC push flow task; and sending a rendering request corresponding to the WebRTC stream pushing task to the target rendering node. The push stream type corresponding to the WebRTC push stream request may indicate a type of a data stream requested to be pushed by the WebRTC push stream request. For example, when the data stream requested to be pushed by the WebRTC push stream request is a video stream, the push stream type corresponding to the WebRTC push stream request may be a 2D push stream, a 3D push stream, a super-writable 3D push stream, and the like, which is not limited herein. In this example, the correspondence between each rendering node and the types of the push streams may be established in advance. Any rendering node may correspond to one or more types of stream pushing, that is, any rendering node may support one or more types of stream pushing. According to the example, each rendering node does not need to support various plug flow types, so that the construction cost of the rendering node cluster is reduced, and more effective resource utilization is realized.
As another example of this implementation, each rendering node supports various types of push streams. The stream pushing task execution node can respond to the WebRTC stream pushing task distributed by the obtained stream pushing task scheduling node, take any rendering node as a target rendering node, and send a rendering request corresponding to the WebRTC stream pushing task to the target rendering node.
As an example of this implementation, the push flow task execution node communicates with the target rendering node through a remote procedure call. For example, the push flow task execution node may communicate with a target rendering node through the gRPC. According to the example, convenience of communication between the plug flow task execution node and the rendering node is improved. Of course, the push flow task execution node may also communicate with each rendering node through other communication manners, which is not limited herein.
In another possible implementation manner, under the condition that the WebRTC push flow task does not need rendering processing, the push flow task execution node may directly acquire the data stream corresponding to the WebRTC push flow task in response to acquiring the WebRTC push flow task allocated by the push flow task scheduling node, for example, the data stream corresponding to the WebRTC push flow task may be a data stream that does not need rendering, such as a text stream.
In another possible implementation manner, the push flow task execution node may have a rendering function, and the push flow task execution node may perform rendering processing in response to acquiring the WebRTC push flow task allocated by the push flow task scheduling node, so as to obtain a data stream corresponding to the WebRTC push flow task.
In this disclosure, after the WebRTC streaming task is executed, the streaming task execution node may generate a message that the WebRTC streaming task is executed, and send the message that the WebRTC streaming task is executed to the streaming task scheduling node.
In one possible implementation manner, the sending, to the streaming task scheduling node, a message that execution of the WebRTC streaming task is completed in response to completion of execution of the WebRTC streaming task includes: and in response to the completion of the execution of the WebRTC streaming task, writing a message of the completion of the execution of the WebRTC streaming task into a directory corresponding to a streaming task execution node in a key value storage system. In this implementation manner, the streaming task execution node may generate a message that the execution of the WebRTC streaming task is completed, and write the message that the execution of the WebRTC streaming task is completed into a directory corresponding to the streaming task execution node in the key value storage system. The push flow task scheduling node can monitor a directory corresponding to the push flow task execution node in the key value storage system in real time, and can respond to a message that execution of the WebRTC push flow task is completed under the directory corresponding to the push flow task execution node, and send the message that execution of the WebRTC push flow task is completed to the browser. The message that the execution of the WebRTC push flow task is completed, which is sent by the push flow task scheduling node to the browser, may carry identification information of the push flow task execution node, so that the browser sends a WebRTC connection establishment request to the push flow task execution node according to the identification information. In this implementation manner, the streaming task execution node responds to completion of execution of the WebRTC streaming task, and writes a message of completion of execution of the WebRTC streaming task into a directory corresponding to the streaming task execution node in the key value storage system, so that the message of completion of execution of the WebRTC streaming task is sent to the streaming task scheduling node through the key value storage system, which is helpful for improving performance of the WebRTC-based streaming system.
In another possible implementation manner, the push flow task execution node may directly send a message that the WebRTC push flow task is completed to the push flow task scheduling node.
In this embodiment of the present disclosure, after receiving the message that the execution of the WebRTC plug flow task is completed, the browser may send a WebRTC connection establishment request to the plug flow task execution node. The streaming task execution node may establish a WebRTC connection with the browser in response to the WebRTC connection establishment request from the browser to send the data stream to the browser over the WebRTC connection.
In the embodiment of the disclosure, for any streaming task execution node in a WebRTC-based streaming system, the WebRTC streaming task is executed by responding to the WebRTC streaming task allocated by the streaming task scheduling node, a data stream corresponding to the WebRTC streaming task is obtained, a message that the WebRTC streaming task is executed is sent to the streaming task scheduling node in response to the completion of the execution of the WebRTC streaming task, a WebRTC connection is established with a browser in response to a WebRTC connection establishment request from the browser, and the data stream is sent to the browser through the WebRTC connection, so that the WebRTC-based distributed streaming is realized. According to the streaming method based on the WebRTC, provided by the embodiment of the disclosure, the browser can be unaware of changes of the streaming task execution nodes (such as increase and decrease of the number of the streaming task execution nodes, service upgrade, service type change and the like). When the flow is increased, one or more machines can be adopted to expand the push flow task execution nodes on the premise of not influencing the existing WebRTC-based push flow service, namely, one or more push flow task execution nodes can be added; when the flow is reduced, the number of nodes for executing the push flow task can be reduced on the premise of not influencing the existing WebRTC-based push flow service. Therefore, the flexible expansion of the push streaming system based on the WebRTC can be realized, the usability of the push streaming service based on the WebRTC is improved, the dynamic scheduling of resources is facilitated, and the utilization efficiency of the resources can be improved.
Fig. 3 shows another flowchart of a WebRTC-based stream pushing method provided by an embodiment of the present disclosure. The WebRTC-based push streaming method is applied to a browser. Wherein, the WebRTC-based stream pushing method can be executed by a terminal device or other processing devices. The terminal device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, or a wearable device. In some possible implementations, the WebRTC-based push flow method can be implemented by a processor calling computer-readable instructions stored in a memory. As shown in fig. 3, the WebRTC-based plug flow method includes steps S31 to S33.
In step S31, a WebRTC push flow request is sent to the push flow task scheduling node.
In step S32, in response to the message that execution of the WebRTC streaming task corresponding to the WebRTC streaming request from the streaming task scheduling node is completed, a WebRTC connection establishment request is sent to the target streaming task execution node in the message that execution of the WebRTC streaming task is completed, so that the target streaming task execution node establishes a WebRTC connection with the browser.
In step S33, a data stream corresponding to the WebRTC streaming task is acquired from the target streaming task execution node through the WebRTC connection.
In the embodiment of the present disclosure, the browser may use a communication protocol such as HTTP to communicate with the push flow task scheduling node. For example, the browser can send a WebRTC plug flow request to the plug flow task scheduling node based on HTTP. The streaming task scheduling node may determine, in response to a WebRTC streaming request from the browser, a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request, allocate the WebRTC streaming task to the target streaming task execution node, and send, in response to the target streaming task execution node executing the WebRTC streaming task and completing the WebRTC streaming task, a message that the WebRTC streaming task is completed to the browser. The message that the execution of the WebRTC push flow task is completed, which is sent by the push flow task scheduling node to the browser, may carry identification information of the target push flow task execution node, so that the browser sends a WebRTC connection establishment request to the target push flow task execution node according to the identification information.
The browser can respond to a message of completion of execution of the WebRTC streaming task corresponding to the WebRTC streaming request from the streaming task scheduling node, and send a WebRTC connection establishment request to a target streaming task execution node in the message of completion of execution of the WebRTC streaming task. The target push streaming task execution node may establish a WebRTC connection with the browser in response to a WebRTC connection establishment request from the browser. The browser can acquire the data stream corresponding to the WebRTC streaming task from the target streaming task execution node through the WebRTC connection. For example, in the case that the data stream is a video stream, the browser may play the video stream through a player.
In the embodiment of the disclosure, the browser sends a WebRTC streaming request to the streaming task scheduling node, responds to a message that execution of a WebRTC streaming task corresponding to the WebRTC streaming request from the streaming task scheduling node is completed, and sends a WebRTC connection establishment request to a target streaming task execution node in the message that execution of the WebRTC streaming task is completed, so that the target streaming task execution node establishes a WebRTC connection with the browser, and acquires a data stream corresponding to the WebRTC streaming task from the target streaming task execution node through the WebRTC connection, thereby implementing the WebRTC-based distributed streaming. According to the streaming method based on the WebRTC, provided by the embodiment of the disclosure, the browser can be unaware of changes of the streaming task execution nodes (such as increase and decrease of the number of the streaming task execution nodes, service upgrade, service type change and the like). When the flow is increased, one or more machines can be adopted to expand the push flow task execution nodes on the premise of not influencing the existing WebRTC-based push flow service, namely, one or more push flow task execution nodes can be added; when the flow is reduced, the number of nodes for executing the push flow task can be reduced on the premise of not influencing the existing WebRTC-based push flow service. Therefore, the flexible expansion of the push streaming system based on the WebRTC can be realized, the usability of the push streaming service based on the WebRTC is improved, the dynamic scheduling of resources is facilitated, and the utilization efficiency of the resources can be improved.
Fig. 4 shows a schematic diagram of a WebRTC-based stream pushing method provided by an embodiment of the present disclosure. In the example shown in fig. 4, the browser 44 may communicate with the push flow task scheduling node 41 based on HTTP, the push flow task scheduling node 41 may communicate with Etcd42 through gRPC, the push flow task execution node 43 may communicate with Etcd42 through gRPC, the push flow task execution node 43 may communicate with the rendering node 45 through gRPC, and the push flow task execution node 43 may communicate with the browser 44 based on WebRTC.
In response to the completion of the start, the push flow task scheduling node 41 may register a monitoring event with the Etcd42, so as to obtain information of each push flow task execution node 43 in real time, and implement a function of service discovery. The information of any of the plug flow task execution nodes 43 may include information of whether the plug flow task execution node 43 is started or not, and load information of the plug flow task execution node 43. Any of the push flow task execution nodes 43 may register, in response to completion of the initiation, with the Etcd42, an event that listens to the directory of the push flow task execution node 43, and may update the load information of the push flow task execution node 43 in real time.
The browser 44 may send a WebRTC push request to the push task scheduling node 41. The streaming task scheduling node 41 may respond to the WebRTC streaming request from the browser 44, acquire load information of each streaming task execution node 43 that is matched with a streaming type corresponding to the WebRTC streaming request, and determine a target streaming task execution node for executing the WebRTC streaming task corresponding to the WebRTC streaming request according to the load information of each streaming task execution node 43. The push streaming task scheduling node 41 may write the WebRTC push streaming task into the directory corresponding to the target push streaming task execution node in the Etcd 42. The target push streaming task execution node may monitor a directory corresponding to the target push streaming task execution node in the Etcd42, and the push streaming task scheduling node 41 allocates a WebRTC push streaming task to the target push streaming task execution node. The target streaming task executing node may determine, from the plurality of rendering nodes 45, a target rendering node that matches the streaming type corresponding to the WebRTC streaming task in response to monitoring that the WebRTC streaming task is allocated to the target streaming task executing node by the streaming task scheduling node 41, and send a rendering request corresponding to the WebRTC streaming task to the target rendering node. The target rendering node can respond to the rendering request, render to obtain a data stream corresponding to the WebRTC streaming task, and return the data stream to the target streaming task execution node. The target streaming task execution node may respond to completion of execution of the WebRTC streaming task, and write a message of completion of execution of the WebRTC streaming task into an entry corresponding to the target streaming task execution node in the Etcd 42. The push streaming task scheduling node 41 may send a message that the WebRTC push streaming task is completed to the browser 44 in response to monitoring, through the Etcd42, that the target push streaming task execution node completes the WebRTC push streaming task. The browser 44 may send a WebRTC connection establishment request to a target streaming task execution node in the WebRTC streaming task execution completion message in response to the WebRTC streaming task execution completion message corresponding to the WebRTC streaming request from the streaming task scheduling node 41. The target push streaming task execution node may establish a WebRTC connection with the browser 44 in response to a WebRTC connection establishment request from the browser 44, and may send the data stream to the browser 44 through the WebRTC connection.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted. Those skilled in the art will appreciate that in the above methods of the specific embodiments, the specific order of execution of the steps should be determined by their function and possibly their inherent logic.
In addition, the present disclosure also provides a streaming apparatus, a system, an electronic device, a computer-readable storage medium, and a program based on WebRTC, which can all be used to implement any streaming method based on WebRTC provided by the present disclosure, and corresponding technical solutions and technical effects can be referred to in corresponding descriptions of the method section and are not described again.
Fig. 5 shows a block diagram of a WebRTC-based stream pushing apparatus provided by an embodiment of the present disclosure. The WebRTC-based stream pushing apparatus is applied to a stream pushing task scheduling node, as shown in fig. 5, the WebRTC-based stream pushing apparatus includes:
the determining module 51 is configured to determine, in response to a WebRTC streaming request from a browser for web page real-time communication, a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request;
the allocating module 52 is configured to allocate the WebRTC push flow task to the target push flow task execution node;
and a first sending module 53, configured to respond to the target streaming task execution node executing the WebRTC streaming task, and send a message that the WebRTC streaming task is executed to the browser.
In one possible implementation, the determining module 51 is configured to:
responding to a WebRTC streaming request from a browser, and acquiring load information of at least one streaming task execution node;
and determining a target push flow task execution node for executing the WebRTC push flow task corresponding to the WebRTC push flow request according to the load information of the at least one push flow task execution node.
In one possible implementation, the determining module 51 is configured to:
and responding to a WebRTC streaming request from a browser, and acquiring load information of at least one streaming task execution node matched with a streaming type corresponding to the WebRTC streaming request.
In one possible implementation, the determining module 51 is configured to:
and acquiring load information of at least one plug flow task execution node from the key value storage system in response to the WebRTC plug flow request from the browser.
In one possible implementation, the allocating module 52 is configured to:
and writing the WebRTC plug-flow task into a directory corresponding to the target plug-flow task execution node in a key value storage system.
In a possible implementation manner, the first sending module 53 is configured to:
and responding to the fact that the target streaming task execution node completes the WebRTC streaming task after being monitored by the key value storage system, and sending a message of completing the execution of the WebRTC streaming task to the browser.
Fig. 6 illustrates another block diagram of a WebRTC-based stream pushing apparatus provided by an embodiment of the present disclosure. The WebRTC-based stream pushing apparatus is applied to a stream pushing task execution node, as shown in fig. 6, and includes:
the execution module 61 is configured to execute the WebRTC streaming task in response to acquiring the WebRTC streaming task allocated by the streaming task scheduling node, so as to obtain a data stream corresponding to the WebRTC streaming task;
a second sending module 62, configured to send, to the streaming task scheduling node, a message that execution of the WebRTC streaming task is completed in response to completion of execution of the WebRTC streaming task;
a connection establishing module 63, configured to establish a WebRTC connection with a browser in response to a WebRTC connection establishment request from the browser;
a third sending module 64, configured to send the data stream to the browser through the WebRTC connection.
In one possible implementation manner, the execution module 61 is configured to:
responding to the acquired WebRTC streaming task distributed by the streaming task scheduling node, and sending a rendering request corresponding to the WebRTC streaming task to a target rendering node, so that the target rendering node responds to the rendering request and renders to obtain a data stream corresponding to the WebRTC streaming task;
the data stream is obtained from the target rendering node.
In one possible implementation manner, the execution module 61 is configured to:
responding to the acquired WebRTC push flow task distributed by the push flow task scheduling node, and determining a target rendering node matched with the push flow type corresponding to the WebRTC push flow task;
and sending a rendering request corresponding to the WebRTC stream pushing task to the target rendering node.
In one possible implementation, the push flow task execution node communicates with the target rendering node through a remote procedure call.
In one possible implementation, the apparatus further includes:
and the monitoring module is used for monitoring the WebRTC streaming task which is distributed to the streaming task execution node by the streaming task scheduling node under the directory corresponding to the streaming task execution node in the key value storage system.
In a possible implementation manner, the second sending module 62 is configured to:
and in response to the completion of the execution of the WebRTC streaming task, writing a message of the completion of the execution of the WebRTC streaming task into a directory corresponding to a streaming task execution node in a key value storage system.
In one possible implementation, the apparatus further includes:
and the sixth sending module is used for responding to the update of the load information of the push flow task execution node and sending the updated load information of the push flow task execution node to the key value storage system.
Fig. 7 illustrates another block diagram of a WebRTC-based stream pushing apparatus provided by an embodiment of the present disclosure. The WebRTC-based push streaming apparatus is applied to a browser, and as shown in fig. 7, the apparatus includes:
a fourth sending module 71, configured to send a WebRTC streaming request to the streaming task scheduling node;
a fifth sending module 72, configured to send, in response to a WebRTC streaming task execution completion message corresponding to the WebRTC streaming request from the streaming task scheduling node, a WebRTC connection establishment request to a target streaming task execution node in the WebRTC streaming task execution completion message, so that the target streaming task execution node establishes a WebRTC connection with the browser;
and the obtaining module 73 is configured to obtain, through the WebRTC connection, a data stream corresponding to the WebRTC streaming task from the target streaming task execution node.
In some embodiments, functions or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementations and technical effects thereof may refer to the description of the above method embodiments, which are not described herein again for brevity.
The embodiment of the disclosure also provides a push flow system based on the WebRTC. The push flow system based on the WebRTC comprises a push flow task scheduling node and at least one push flow task execution node; the streaming task scheduling node is used for responding to a WebRTC streaming request from a browser, determining a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request, distributing the WebRTC streaming task to the target streaming task execution node, responding to the target streaming task execution node to execute and complete the WebRTC streaming task, and sending a message of completion of execution of the WebRTC streaming task to the browser; the streaming task execution node is used for responding to the WebRTC streaming task distributed by the streaming task scheduling node, executing the WebRTC streaming task to obtain a data stream corresponding to the WebRTC streaming task, responding to the completion of the execution of the WebRTC streaming task, sending a message of the completion of the execution of the WebRTC streaming task to the streaming task scheduling node, responding to a WebRTC connection establishment request from a browser, establishing a WebRTC connection with the browser, and sending the data stream to the browser through the WebRTC connection.
The streaming pushing method, device, system, equipment and medium based on the WebRTC can be applied to video platforms with large flow fluctuation, video products needing front-end imperceptibility when back-end service changes and other application scenes. The following is illustrated by three specific application scenarios.
The application scene one:
the user traffic of a certain video website is greatly different between working days and non-working days, and between day and night, so that the problems of slow response, resource exhaustion and the like in traffic peak periods such as non-working days, night and the like are solved, and the user experience is improved.
By adopting the WebRTC-based push streaming system with high availability and capability of elastic expansion provided by the embodiment of the disclosure, the video website can dynamically configure service resources (for example, increase and decrease the number of push streaming task execution nodes) according to user traffic, so that a large amount of operation cost can be saved while user experience is not influenced.
Application scenario two:
the number of the inrush watching users is far larger than the number of people using the television station website at ordinary times, so that the rear end of the television station website runs in an overload mode, and finally downtime is caused.
By adopting the WebRTC-based stream pushing system with high availability and capability of elastic expansion, technicians of a television station website can rent a plurality of servers as stream pushing task execution nodes to perform service expansion before live broadcasting starts, so that the live broadcasting can be smoothly performed at night.
Application scenario three:
a certain merchant introduces 24-hour AI (Artificial Intelligence) customer service, and the AI customer service image gradually develops various types such as 2D true persons, 2D cartoons, 3D true persons and the like from the original 3D cartoons in consideration of different user groups. Due to the deep coupling of the push streaming service end and the front end, the original service needs to be stopped every time of updating, which is very inconvenient.
By adopting the WebRTC-based push flow system with high availability and capability of elastic expansion provided by the embodiment of the disclosure, the merchant only needs to start a newly added push flow task execution node every time of updating, the original service is not influenced, and the user does not feel.
Embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the above-described method. The computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium.
The embodiment of the present disclosure also provides a computer program, which includes computer readable code, and when the computer readable code runs in an electronic device, a processor in the electronic device executes the computer program to implement the method described above.
Embodiments of the present disclosure also provide a computer program product for storing computer readable instructions, where the instructions, when executed, cause a computer to perform the operations of the WebRTC-based stream pushing method provided in any of the above embodiments.
An embodiment of the present disclosure further provides an electronic device, including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to invoke the memory-stored executable instructions to perform the above-described method.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 8 illustrates a block diagram of an electronic device 800 provided by an embodiment of the disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
Referring to fig. 8, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a Complementary Metal Oxide Semiconductor (CMOS) or Charge Coupled Device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as a wireless network (Wi-Fi), a second generation mobile communication technology (2G), a third generation mobile communication technology (3G), a fourth generation mobile communication technology (4G), a long term evolution of universal mobile communication technology (LTE), a fifth generation mobile communication technology (5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
Fig. 9 shows a block diagram of an electronic device 1900 provided by an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server. Referring to fig. 9, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system, such as the Microsoft Server operating system (Windows Server), stored in the memory 1932TM) Apple Inc. of the present application based on the graphic user interface operating System (Mac OS X)TM) Multi-user, multi-process computer operating system (Unix)TM) Free and open native code Unix-like operating System (Linux)TM) Open native code Unix-like operating System (FreeBSD)TM) Or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (20)

1. A flow pushing method based on WebRTC is characterized in that the flow pushing method is applied to a flow pushing task scheduling node, and the method comprises the following steps:
responding to a WebRTC streaming request of web page real-time communication from a browser, and determining a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request;
distributing the WebRTC plug flow task to the target plug flow task execution node;
and responding to the target streaming task execution node to execute and complete the WebRTC streaming task, and sending a message of completing execution of the WebRTC streaming task to the browser.
2. The method of claim 1, wherein the determining, in response to a WebRTC streaming request from a browser for web page real-time communication, a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request comprises:
responding to a WebRTC streaming request from a browser, and acquiring load information of at least one streaming task execution node;
and determining a target push flow task execution node for executing the WebRTC push flow task corresponding to the WebRTC push flow request according to the load information of the at least one push flow task execution node.
3. The method according to claim 2, wherein the obtaining load information of at least one streaming task execution node in response to the WebRTC streaming request from the browser comprises:
and responding to a WebRTC streaming request from a browser, and acquiring load information of at least one streaming task execution node matched with a streaming type corresponding to the WebRTC streaming request.
4. The method according to claim 2 or 3, wherein the obtaining load information of at least one streaming task execution node in response to the WebRTC streaming request from the browser comprises:
and acquiring load information of at least one plug flow task execution node from the key value storage system in response to the WebRTC plug flow request from the browser.
5. The method of any of claims 1-4, wherein the assigning the WebRTC push flow task to the target push flow task execution node comprises:
and writing the WebRTC plug-flow task into a directory corresponding to the target plug-flow task execution node in a key value storage system.
6. The method of any of claims 1-5, wherein the sending a message to the browser that execution of the WebRTC streaming task is complete in response to execution of the WebRTC streaming task by the target streaming task execution node completing the WebRTC streaming task comprises:
and responding to the fact that the target streaming task execution node completes the WebRTC streaming task after being monitored by the key value storage system, and sending a message of completing the execution of the WebRTC streaming task to the browser.
7. A flow pushing method based on WebRTC is characterized in that the flow pushing method is applied to a flow pushing task execution node, and the method comprises the following steps:
responding to the acquired WebRTC streaming task distributed by the streaming task scheduling node, executing the WebRTC streaming task, and acquiring a data stream corresponding to the WebRTC streaming task;
responding to the completion of the execution of the WebRTC streaming task, and sending a message of the completion of the execution of the WebRTC streaming task to the streaming task scheduling node;
responding to a WebRTC connection establishment request from a browser, and establishing a WebRTC connection with the browser;
sending the data stream to the browser over the WebRTC connection.
8. The method according to claim 7, wherein the executing the WebRTC streaming task to obtain the data stream corresponding to the WebRTC streaming task in response to obtaining the WebRTC streaming task allocated by the streaming task scheduling node comprises:
responding to the acquired WebRTC streaming task distributed by the streaming task scheduling node, and sending a rendering request corresponding to the WebRTC streaming task to a target rendering node, so that the target rendering node responds to the rendering request and renders to obtain a data stream corresponding to the WebRTC streaming task;
the data stream is obtained from the target rendering node.
9. The method according to claim 8, wherein the sending a rendering request corresponding to the WebRTC streaming task to a target rendering node in response to acquiring the WebRTC streaming task allocated by the streaming task scheduling node comprises:
responding to the acquired WebRTC push flow task distributed by the push flow task scheduling node, and determining a target rendering node matched with the push flow type corresponding to the WebRTC push flow task;
and sending a rendering request corresponding to the WebRTC stream pushing task to the target rendering node.
10. The method of claim 8 or 9, wherein the push flow task execution node communicates with the target rendering node through a remote procedure call.
11. The method according to any one of claims 7 to 10, further comprising:
and monitoring a directory corresponding to the push flow task execution node in the key value storage system, wherein the push flow task scheduling node is allocated to the WebRTC push flow task of the push flow task execution node.
12. The method of any of claims 7-11, wherein the sending a message to the streamlet scheduling node that execution of the WebRTC streamlet task is complete in response to completion of execution of the WebRTC streamlet task comprises:
and in response to the completion of the execution of the WebRTC streaming task, writing a message of the completion of the execution of the WebRTC streaming task into a directory corresponding to a streaming task execution node in a key value storage system.
13. The method according to any one of claims 7 to 12, further comprising:
and responding to the update of the load information of the push flow task execution node, and sending the updated load information of the push flow task execution node to a key value storage system.
14. A WebRTC-based push streaming method is applied to a browser, and comprises the following steps:
sending a WebRTC streaming request to a streaming task scheduling node;
responding to a message of completion of execution of a WebRTC streaming task corresponding to the WebRTC streaming request from the streaming task scheduling node, and sending a WebRTC connection establishment request to a target streaming task execution node in the message of completion of execution of the WebRTC streaming task so that the target streaming task execution node establishes WebRTC connection with the browser;
and acquiring a data stream corresponding to the WebRTC plug flow task from the target plug flow task execution node through the WebRTC connection.
15. A streaming apparatus based on WebRTC, applied to a streaming task scheduling node, the apparatus comprising:
the determining module is used for responding to a WebRTC streaming request from a browser for real-time communication, and determining a target streaming task executing node for executing the WebRTC streaming task corresponding to the WebRTC streaming request;
the distribution module is used for distributing the WebRTC plug flow task to the target plug flow task execution node;
and the first sending module is used for responding to the target streaming task execution node to execute and complete the WebRTC streaming task and sending a message of the completion of the execution of the WebRTC streaming task to the browser.
16. A streaming apparatus based on WebRTC, applied to a streaming task execution node, the apparatus comprising:
the execution module is used for responding to the acquired WebRTC streaming task distributed by the streaming task scheduling node, executing the WebRTC streaming task and acquiring a data stream corresponding to the WebRTC streaming task;
the second sending module is used for responding to the completion of the execution of the WebRTC streaming task and sending a message of the completion of the execution of the WebRTC streaming task to the streaming task scheduling node;
the connection establishing module is used for responding to a WebRTC connection establishing request from a browser and establishing a WebRTC connection with the browser;
and the third sending module is used for sending the data stream to the browser through the WebRTC connection.
17. A WebRTC-based push streaming apparatus, applied to a browser, the apparatus comprising:
the fourth sending module is used for sending the WebRTC streaming request to the streaming task scheduling node;
a fifth sending module, configured to send, in response to a WebRTC streaming task execution completion message corresponding to the WebRTC streaming request from the streaming task scheduling node, a WebRTC connection establishment request to a target streaming task execution node in the WebRTC streaming task execution completion message, so that the target streaming task execution node establishes a WebRTC connection with the browser;
and the acquisition module is used for acquiring the data stream corresponding to the WebRTC streaming task from the target streaming task execution node through the WebRTC connection.
18. The push flow system based on the WebRTC is characterized by comprising a push flow task scheduling node and at least one push flow task execution node;
the streaming task scheduling node is used for responding to a WebRTC streaming request from a browser, determining a target streaming task execution node for executing a WebRTC streaming task corresponding to the WebRTC streaming request, distributing the WebRTC streaming task to the target streaming task execution node, responding to the target streaming task execution node to execute and complete the WebRTC streaming task, and sending a message of completion of execution of the WebRTC streaming task to the browser;
the streaming task execution node is used for responding to the WebRTC streaming task distributed by the streaming task scheduling node, executing the WebRTC streaming task to obtain a data stream corresponding to the WebRTC streaming task, responding to the completion of the execution of the WebRTC streaming task, sending a message of the completion of the execution of the WebRTC streaming task to the streaming task scheduling node, responding to a WebRTC connection establishment request from a browser, establishing a WebRTC connection with the browser, and sending the data stream to the browser through the WebRTC connection.
19. An electronic device, comprising:
one or more processors;
a memory for storing executable instructions;
wherein the one or more processors are configured to invoke the memory-stored executable instructions to perform the method of any one of claims 1 to 14.
20. A computer readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1 to 14.
CN202110968266.5A 2021-08-23 2021-08-23 Pushing method, device, system, equipment and medium based on WebRTC Pending CN113691526A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110968266.5A CN113691526A (en) 2021-08-23 2021-08-23 Pushing method, device, system, equipment and medium based on WebRTC

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110968266.5A CN113691526A (en) 2021-08-23 2021-08-23 Pushing method, device, system, equipment and medium based on WebRTC

Publications (1)

Publication Number Publication Date
CN113691526A true CN113691526A (en) 2021-11-23

Family

ID=78581466

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110968266.5A Pending CN113691526A (en) 2021-08-23 2021-08-23 Pushing method, device, system, equipment and medium based on WebRTC

Country Status (1)

Country Link
CN (1) CN113691526A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116980555A (en) * 2023-06-12 2023-10-31 北京医百科技有限公司 Input signal source acquisition method and system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253814A (en) * 2014-09-12 2014-12-31 清华大学 Streaming media processing method, server and browser
US20160337410A1 (en) * 2015-05-14 2016-11-17 Cable Television Laboratories, Inc. Network to network interface between service providers for web real time communication
US20180198830A1 (en) * 2017-01-10 2018-07-12 Mavenir Systems, Inc. Systems and Methods for Interworking with over the Top Applications in Communications Network
CN110633442A (en) * 2019-08-19 2019-12-31 阿里巴巴集团控股有限公司 Pushing method and device and electronic equipment
CN111450528A (en) * 2020-03-31 2020-07-28 网易(杭州)网络有限公司 Cloud game rendering service system, method and device
CN112073423A (en) * 2020-09-15 2020-12-11 杭州二更网络科技有限公司 Browser plug-flow method and system based on WebRTC
CN112714186A (en) * 2020-12-30 2021-04-27 北京大米科技有限公司 Distribution method of push streaming server, push method and device of media stream, storage medium and electronic equipment
CN112738140A (en) * 2021-04-01 2021-04-30 浙江华创视讯科技有限公司 Video stream transmission method, device, storage medium and equipment based on WebRTC
CN112765520A (en) * 2021-01-20 2021-05-07 三六零视觉(北京)科技有限公司 Message pushing method, device, equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253814A (en) * 2014-09-12 2014-12-31 清华大学 Streaming media processing method, server and browser
US20160337410A1 (en) * 2015-05-14 2016-11-17 Cable Television Laboratories, Inc. Network to network interface between service providers for web real time communication
US20180198830A1 (en) * 2017-01-10 2018-07-12 Mavenir Systems, Inc. Systems and Methods for Interworking with over the Top Applications in Communications Network
CN110633442A (en) * 2019-08-19 2019-12-31 阿里巴巴集团控股有限公司 Pushing method and device and electronic equipment
CN111450528A (en) * 2020-03-31 2020-07-28 网易(杭州)网络有限公司 Cloud game rendering service system, method and device
CN112073423A (en) * 2020-09-15 2020-12-11 杭州二更网络科技有限公司 Browser plug-flow method and system based on WebRTC
CN112714186A (en) * 2020-12-30 2021-04-27 北京大米科技有限公司 Distribution method of push streaming server, push method and device of media stream, storage medium and electronic equipment
CN112765520A (en) * 2021-01-20 2021-05-07 三六零视觉(北京)科技有限公司 Message pushing method, device, equipment and storage medium
CN112738140A (en) * 2021-04-01 2021-04-30 浙江华创视讯科技有限公司 Video stream transmission method, device, storage medium and equipment based on WebRTC

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
LUIS LÓPEZ FERNÁNDEZ; MIGUEL PARÍS DÍAZ; RAÚL BENÍTEZ MEJÍAS; FRANCISCO JAVIER LÓPEZ;: "Catalysing the success of WebRTC for the provision of advanced multimedia real-time communication services", 《 2013 17TH INTERNATIONAL CONFERENCE ON INTELLIGENCE IN NEXT GENERATION NETWORKS》, pages 23 - 30 *
包立鸣、王晶、王建军: "基于webrtc的海事应急视频指挥系统的实现", 《工业控制计算机》, pages 77 - 79 *
张宝明、钮丹倩: "WebRTC流媒体文件远程推送与即时播放研究", 《软件导刊》, pages 182 - 184 *
张宝明;钮丹倩;: "WebRTC下流媒体文件远程推送与即时播放研究", no. 10, pages 186 - 188 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116980555A (en) * 2023-06-12 2023-10-31 北京医百科技有限公司 Input signal source acquisition method and system
CN116980555B (en) * 2023-06-12 2024-03-26 北京医百科技有限公司 Input signal source acquisition method and system

Similar Documents

Publication Publication Date Title
CN113259161B (en) Application management method and device, electronic equipment and storage medium
CN104602112A (en) Configuration method and device
CN112468833A (en) Live broadcast interactive information processing method, device, terminal, server and storage medium
EP3051772A1 (en) Method and apparatus for accessing network
CN114138439A (en) Task scheduling method and device, electronic equipment and storage medium
CN111385349B (en) Communication processing method, communication processing device, terminal, server and storage medium
CN111030897A (en) Wired network distribution method and device, electronic equipment and storage medium
CN109417802B (en) Method and device for transmitting flight information
CN112616053B (en) Transcoding method and device for live video and electronic equipment
CN110489244A (en) Information processing method, system, device and computer readable storage medium
CN113691526A (en) Pushing method, device, system, equipment and medium based on WebRTC
CN106330569A (en) Method and apparatus for configuring wireless router
CN113312103A (en) Software definition method and device for intelligent camera, electronic equipment and storage medium
CN116089099A (en) Communication method, device, electronic equipment and storage medium
CN112262606B (en) Time gap request method and device, and time gap configuration method and device
CN113905083A (en) User code operation method and device, electronic equipment and storage medium
CN112153083B (en) Anchor point sharing method, device, system, electronic equipment and storage medium
CN113238887A (en) Data processing method, device and storage medium
CN109194639B (en) Message receiving and processing method, device, terminal and readable storage medium
CN109032583B (en) Data interaction method and device
CN112769677A (en) Data synchronization method, data synchronization device, electronic equipment, storage medium and program product
CN112437090A (en) Resource loading method and device, electronic equipment and storage medium
CN112181453A (en) Firmware upgrading method and device and storage medium
CN115733919B (en) Information processing method, device and storage medium
CN112104990A (en) Resource downloading method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned
AD01 Patent right deemed abandoned

Effective date of abandoning: 20240419