WO2023226949A1 - Real-time streaming media data transmission method and device, and storage medium - Google Patents

Real-time streaming media data transmission method and device, and storage medium Download PDF

Info

Publication number
WO2023226949A1
WO2023226949A1 PCT/CN2023/095623 CN2023095623W WO2023226949A1 WO 2023226949 A1 WO2023226949 A1 WO 2023226949A1 CN 2023095623 W CN2023095623 W CN 2023095623W WO 2023226949 A1 WO2023226949 A1 WO 2023226949A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
streaming
information
communication link
link
Prior art date
Application number
PCT/CN2023/095623
Other languages
French (fr)
Chinese (zh)
Inventor
洪小迟
卢日
肖凯
Original Assignee
阿里巴巴(中国)有限公司
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 阿里巴巴(中国)有限公司 filed Critical 阿里巴巴(中国)有限公司
Publication of WO2023226949A1 publication Critical patent/WO2023226949A1/en

Links

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/1066Session management
    • 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/80Responding to QoS

Definitions

  • the present application relates to communication technology, and in particular, to a method, device and storage medium for real-time streaming media data transmission.
  • Video live broadcast especially low-latency live broadcast (Real-time Streaming, RTS), and audio and video conferencing and other real-time audio and video communication (Real-time Communication, RTC) scenarios have higher requirements on delay and transmission quality, and real-time data transmission. Sexual requirements are high.
  • RTS low-latency live broadcast
  • RTC Real-time Communication
  • CDN Content Delivery Network
  • the streaming client i.e., the playback client
  • the streaming node i.e., the streaming node
  • a single link is used for data transmission between the streaming client and the streaming node.
  • communication links jitter and other conditions occur, data transmission will cause phenomena such as stuck delays and packet loss, resulting in poor data transmission quality and making it difficult to meet the real-time requirements of streaming media data transmission in RTS, RTC and other scenarios.
  • This application provides a method, device and storage medium for real-time streaming media data transmission to solve the current problem of poor data transmission quality in CDN and difficulty in meeting the real-time requirements of streaming media data transmission in RTS, RTC and other scenarios.
  • this application provides a real-time streaming media data transmission method, which is applied to the streaming client, including:
  • the candidate nodes select at least one candidate node as an alternative streaming node, and establish a third communication link with each of the candidate streaming nodes;
  • the fourth communication link constitutes an alternative link for pulling streaming media data
  • this application provides a real-time streaming media data transmission method, which is applied to the target streaming node, including:
  • the first streaming request carries media stream information, the access address of the streaming client, and information about whether a backup link is supported, where the media stream information includes streaming media data. domain name;
  • the information of the alternative node After receiving the information of the alternative node sent by the live broadcast center, the information of the alternative node is sent to the streaming client.
  • this application provides a real-time streaming media data transmission method, which is applied to the live broadcast center, including:
  • the target streaming node Receives a first link request and an alternative node request sent by the target streaming node, the first link request carries media stream information, and the alternative node request carries the domain name of the streaming media data and the access address of the streaming client;
  • information on the second communication link between the target streaming node and the streaming node is generated according to the media stream information, and the information is sent to the target streaming node.
  • Information on the second communication link is generated according to the media stream information, and the information is sent to the target streaming node.
  • the present application provides an electronic device, including: a processor, and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, To implement any of the above methods.
  • the present application provides a computer-readable storage medium in which computer-executable instructions are stored, and when executed by a processor, the computer-executable instructions are used to implement the method provided in any of the above aspects.
  • the real-time streaming media data transmission method by establishing communication links between the streaming client and multiple streaming nodes, and establishing communication links between the streaming nodes and the streaming nodes, multiple users are formed.
  • different streaming nodes are used in different links. One link serves as the primary link and the other links serve as backup links.
  • an alternative link is switched to the main link, and streaming media data is pulled through the switched main link.
  • the streaming node used for streaming can be switched in a timely manner, thereby avoiding the communication link between the streaming client and the streaming node. It improves the transmission quality and real-time performance of streaming media data by preventing delays, packet loss, etc. caused by jitter on the road or network congestion.
  • Figure 1 is an example diagram of a communication link provided by this application.
  • Figure 2 is a flow chart of a method for performing real-time streaming media data transmission by a streaming client provided by an embodiment of the present application
  • Figure 3 is a framework diagram of the establishment process of a streaming media data transmission main link provided by this application.
  • Figure 4 is an example diagram of a communication link between a pull node and a push node provided by this application;
  • Figure 5 is an example diagram of a communication link in which a target streaming node is used as a relay node provided by this application;
  • Figure 6 is a flow chart of a method for performing real-time streaming media data transmission by a target streaming node provided by an embodiment of the present application
  • Figure 7 is a flow chart of a method for transmitting real-time streaming media data by a live broadcast center provided by an embodiment of the present application
  • Figure 8 is a flow chart of a real-time streaming media data transmission method provided by an embodiment of the present application.
  • Figure 9 is a schematic structural diagram of a real-time streaming media data transmission device provided by an embodiment of the present application.
  • Figure 10 is a schematic structural diagram of a real-time streaming media data transmission device provided by another embodiment of the present application.
  • Figure 11 is a schematic structural diagram of a real-time streaming media data transmission device provided by another embodiment of the present application.
  • Streaming client Also called playback client, it refers to the client that pulls streams from CDN to obtain streaming media data.
  • Streaming node An edge node in the CDN that establishes a communication link with the streaming client.
  • the streaming client pulls streams from the streaming node.
  • Push client A client that pushes streaming media data to CDN.
  • Push node an edge node in the CDN that establishes a communication link with the push client.
  • the push client pushes streaming media data to the push node.
  • the target streaming node is used to refer to the streaming node designated by the DNS server for the first time for the streaming client
  • the alternative streaming node is used to refer to A streaming node that establishes a communication link with the streaming client after the target streaming node.
  • the first communication link refers to the communication link between the streaming client and the target streaming node.
  • the second communication link refers to the communication link between the target streaming node and the streaming node
  • the third communication link refers to the communication link between the streaming client and the alternative streaming node
  • the fourth communication link Link refers to the communication link between the candidate pull node and the push node.
  • first pull request refers to the pull request sent by the pull client to the target pull node
  • second pull request refers to the pull request sent by the pull client to the alternative pull node
  • the first link request refers to the link request sent by the target streaming node to the live broadcast center
  • the second link request refers to the link request sent by the candidate streaming node to the live broadcast center.
  • CDN mainly includes CDN centers and nodes deployed in various places.
  • the center of CDN includes live broadcast center, scheduling system, etc.
  • the nodes deployed in various places are usually divided into two parts: one part is the edge node, which can usually be used as a pull node or a push node to establish communication connections with the client; the other part of the nodes is only responsible for the communication between the pull node and the push node.
  • Relay node for the relay role.
  • the streaming client establishes a communication connection with a streaming node, and a single link is used for data transmission between the streaming client and the streaming node.
  • a single link is used for data transmission between the streaming client and the streaming node.
  • the communication link between streaming nodes jitters, it will cause phenomena such as stuck delays and packet loss in data transmission.
  • the quality of streaming data transmission is poor and it is difficult to meet the real-time requirements of streaming media data transmission in RTC, RTS and other scenarios. .
  • the real-time streaming data transmission method provided by this application can be applied to RTS, RTC and other scenarios that require high real-time performance, such as live video broadcasts, audio and video conferencing and other scenarios.
  • the method of this application establishes communication links between the streaming client and multiple streaming nodes, and establishes communication links between the streaming nodes and the streaming nodes to form multiple links for streaming. Different links Use different pull nodes in the road. One link serves as the primary link and the other links serve as backup links. When the communication link between the streaming client and the streaming node in the main link does not meet the preset conditions, an alternative link is switched to the main link, and streaming media data is pulled through the switched main link.
  • the streaming node used for streaming can be switched in a timely manner, thereby avoiding the communication link between the streaming client and the streaming node. It improves the transmission quality and real-time performance of streaming media data due to jitter on the road or delays and packet loss caused by network congestion.
  • Figure 1 is an example diagram of a communication link provided by this application.
  • a first communication link between the streaming client 100 and the streaming node 20
  • the streaming node 20 and the pushing node 20 have a first communication link.
  • a second communication link between the streaming nodes 30, and the first communication link and the second communication link together form a link for pulling streams.
  • the third communication link and the fourth communication link together form another communication link.
  • the link used to pull streams is used to pull streams.
  • the streaming node 20 and the streaming node 40 are two different edge nodes in the CDN, and the streaming client 100 establishes communication links with two different edge nodes respectively.
  • one link is used as the main link and the other is used as an alternative link.
  • the streaming client 100 pulls streaming media data through the main link and the alternative link is kept connected. status.
  • the first link in the main link (such as the first communication link or the third communication link) does not meet the preset conditions, the alternative link is switched to the main link, and the streaming client 100 passes the switched
  • the main link pulls the streaming media data, switches the main link before switching to the alternative link, and enters the state of maintaining connection.
  • the second communication link and the fourth communication link in Figure 1 use dotted lines to indicate that in the communication link between the pull node and the push node, the pull node and the push node can be directly connected, or through a or Multiple relay nodes are connected.
  • Figure 1 only takes the establishment of one alternative link as an example for illustration. In other examples, multiple alternative links can also be established.
  • FIG. 2 is a flow chart of a method for transmitting real-time streaming media data by a streaming client provided by an embodiment of the present application. As shown in Figure 2, the specific steps of this method are as follows:
  • Step S201 Receive information about the target streaming node provided by the DNS server, and establish a first communication link with the target streaming node.
  • the streaming client when users want to play streaming media data, they access the domain name of the streaming media data through the streaming client.
  • the streaming client sends a resolution request for the domain name of the streaming media data to the DNS server, and the DNS server resolves the stream.
  • the domain name of the media data selects an edge node in the CDN as the target streaming node corresponding to the streaming client, and returns the information of the target streaming node to the streaming client.
  • the information of the target streaming node provided by the DNS server at least includes the IP of the target streaming node.
  • the streaming client establishes a communication link with the target streaming node based on the IP of the target streaming node.
  • Step S202 Send a first pull request to the target pull node, so that the target pull node establishes a second communication link with the push node.
  • the first communication link and the second communication link constitute a pull request.
  • the streaming client After establishing the first communication link with the target streaming node, the streaming client sends a first streaming request to the target streaming node through the first communication link.
  • the first streaming request carries the media stream information of the streaming media data that the streaming client wants to pull.
  • the target streaming node After receiving the first pull request, the target streaming node will parse out the media stream information and send the first link request carrying the media stream information to the CDN's live broadcast center.
  • the live broadcast center parses the streaming media information, determines the information of the streaming node based on the streaming media information, and generates the information of the second communication link between the target streaming node and the streaming node, Feed back the information of the second communication link to the target streaming node.
  • the target streaming node establishes a second communication link with the streaming node based on the information of the second communication link.
  • the first communication link and the second communication link constitute a link between the pull client and the push node for streaming, and serve as the main link for the pull client to pull streaming media data.
  • the second communication link between the target streaming node and the streaming node may not include a relay node, or may include at least one relay node.
  • the streaming client can pull streaming media data through the main link.
  • the framework of the establishment process of the streaming media data transmission main link is shown in Figure 3.
  • the anchor as the live video publisher, publishes the collected live video data through the push streaming client 200 To a push node 30 in the CDN.
  • a user wants to watch a live video, he can access the domain name of the live video through the streaming client 100.
  • the domain name of the live video is "www.######.com”
  • the streaming client 100 will request DNS
  • the server 11 initiates a resolution request for the live video domain name.
  • the DNS server 11 parses the live video domain name and selects an edge node in the CDN as the target streaming node 20 corresponding to the streaming client 100, and sets the target streaming node 20
  • the IP is returned to the streaming client 100.
  • the streaming client 100 establishes a first communication link with the target streaming node 20 according to the IP of the target streaming node 20 .
  • the streaming client 100 sends a streaming request to the target streaming node 20 .
  • the target streaming node 20 After receiving the streaming request, the target streaming node 20 sends a link request to the live broadcast center 12 .
  • the live broadcast center 12 generates the information of the second communication link between the target streaming node 20 and the streaming node 30 based on the link request, and feeds back the information of the second communication link to the target streaming node 20 .
  • the target streaming node 20 establishes a second communication link with the streaming node 30 according to the information of the second communication link.
  • the target streaming node 20 can pull the live video stream from the streaming node 30 through the second communication link, and send the live video stream to the streaming client 100 .
  • the streaming client 100 plays the live video stream for viewers to watch online.
  • the second communication link between the target streaming node 20 and the streaming node 30 may not include a relay node, or may include one or more relay nodes.
  • the second communication link includes one
  • the relay node 40 is taken as an example for illustrative explanation.
  • Step S203 Receive the information of the candidate nodes sent by the target streaming node.
  • the information of the candidate nodes is determined by the live broadcast center and sent to the target streaming node.
  • the live broadcast center can select one or more edge nodes from the CDN edge nodes as alternative nodes according to the request of the target streaming node, and send the information of the alternative nodes to the target streaming node.
  • the streaming node forwards the information of the alternative nodes to the streaming client.
  • the live broadcast center selects alternative nodes, it can adopt the same selection strategy as the DNS server selects the streaming node for the streaming client, which will not be described again here.
  • Step S204 Select at least one candidate node as a candidate streaming node according to the information of the candidate nodes, and establish a third communication link with each candidate streaming node.
  • the streaming client After receiving the information of the candidate nodes, the streaming client selects one or more candidate nodes as the candidate streaming nodes, and establishes a communication link with each candidate streaming node, so that the streaming client communicates with multiple streaming nodes.
  • a communication link is established with each streaming node to realize a multi-link connection method between the streaming client and multiple streaming nodes.
  • the streaming client only receives information about one candidate node.
  • the streaming client directly uses the candidate node as the candidate streaming node and communicates with the candidate streaming node. Establish a third communication link.
  • Step S205 Send a second streaming request to each candidate streaming node, so that each candidate streaming node establishes a fourth communication link, a third communication link and a fourth communication link with the streaming node.
  • the path constitutes an alternative link for pulling streaming media data.
  • the streaming client After establishing the third communication link with the candidate streaming node, the streaming client sends a second streaming request to the candidate streaming node through the third communication link.
  • the second pull request carries media stream information of the streaming media data that the pull client wants to pull.
  • the alternative streaming node parses out the media stream information and sends a second link request carrying the media stream information to the live broadcast center of the CDN.
  • the live broadcast center After receiving the second link request, parses the streaming media information, determines the information of the streaming node based on the streaming media information, and generates the information of the fourth communication link between the alternative streaming node and the streaming node , feedback the information of the fourth communication link to the candidate streaming node.
  • Alternative pull node root Establish a fourth communication link with the streaming node based on the information of the fourth communication link.
  • an alternative link for pulling streaming media data is established between the streaming client and the streaming node.
  • the fourth communication link between the alternative pull node and the push node may not include a relay node, or may include at least one relay node.
  • the alternative link After the alternative link is established, the alternative link remains connected and is temporarily not used to transmit streaming media data.
  • Step S206 When the first communication link does not meet the preset conditions, select an alternative link to switch to the main link, pull streaming media data through the switched main link, and switch the pre-switched main link. as an alternative link.
  • the preset conditions are used to constrain the quality information of the communication link.
  • the communication link does not meet the preset conditions, it means that the quality of the communication link is poor; when the communication link meets the preset conditions, it means that the quality of the communication link is good.
  • the quality information of the communication link may be a quality detection result of the communication link, or a transmission quality indicator calculated based on the actual situation of the communication link transmitting streaming media data (for example, the transmission quality indicator may include lagging. rate, delay, packet loss rate), or other information that can measure the communication quality of the communication link.
  • the preset conditions can be set according to the requirements of the communication link between the streaming client and the streaming node in the specific application scenario. Different preset conditions can be set in different application scenarios.
  • the preset condition is used to constrain the quality information of the first communication link.
  • the communication quality of the first communication link can be determined. It is poor and does not meet the quality requirements of the communication link in the current application scenario.
  • the streaming client selects an alternative link whose communication link meets the preset conditions and switches the alternative link to the main link. , pulling streaming media data through the switched main link.
  • the streaming client After switching the main link, the streaming client switches the main link before the switch to the alternative link.
  • the link enters the maintained connection state and is not used for the transmission of streaming media data.
  • link switching can continue and a backup The selected link is switched to the main link, and the main link before switching is switched to the alternative link.
  • a main link such as "pushing node ⁇ target streaming node ⁇ streaming client”
  • a “push streaming node” is established based on each candidate streaming node.
  • An alternative link such as "streaming node ⁇ alternative streaming node ⁇ streaming client”, when the communication link between the streaming client in the main link and the target streaming node does not meet the preset conditions, you can add a The alternative link that meets the preset conditions for this communication link is switched to the main link. That is, the communication link between the streaming client and a streaming node meets the preset conditions due to jitter, network congestion, etc.
  • the attribute information of the edge node in the CDN can be configured so that the edge node has Has properties that can serve as relay nodes. In this way, more relay nodes can be selected when establishing communication links, and communication links can be directly established between two edge nodes. The combination of links is more flexible, and communication links with better communication quality can be established.
  • the pull node directly establishes a communication link (excluding relays) with the push node. node), the communication quality may be better than the communication link containing the relay node. At this time, the pull node directly establishes a communication link with the push node.
  • edge node A is the pull node 20
  • edge node B is the push node 30 that the pull node 20 wants to establish a communication link.
  • the solid line (1) represents the connection between edge node A and edge node B.
  • a directly established communication link that does not include relay nodes.
  • the communication link composed of dotted lines (2) and (3) is another communication link based on traditional components between edge node A and edge node B. This communication link includes a relay node C.
  • edge node A and edge node B are very close, the communication link of the solid line (1) is better than the communication link composed of the dotted lines (2) and (3).
  • the communication between the pull node and the push node is established.
  • When linking establish the communication link shown by the solid line (1).
  • the candidate streaming node when the candidate streaming node establishes the fourth communication link with the streaming node, other streaming nodes or streaming nodes in the CDN may be used as relay nodes.
  • the fourth communication link between the candidate streaming node and the streaming node may not include any relay node, so that the established communication link between the candidate streaming node and the streaming node The quality of the fourth communication link is better.
  • At least one fourth communication link may include a relay node, and the relay node may include a relay node in the CDN. Pull streaming node or push streaming node.
  • the link combination method is more flexible, more optional links are available when determining the fourth communication link, and the quality of the established fourth communication link can be improved.
  • the fourth communication link between the candidate streaming node and the streaming node includes a relay node, and the relay node includes the target streaming node.
  • the streaming client can use the alternative
  • the streaming node establishes a communication link with the target streaming node, and still uses the second communication link to pull streaming media data to improve the quality and real-time performance of streaming media data transmission.
  • the dotted line (4) represents the second communication link between the target pull node 20 and the push node 30, and the dotted line (4) and the solid line (5) constitute the candidate pull node 40 and the push node.
  • the fourth communication link between flow nodes 30.
  • the streaming client 100 can pull streaming media data through (4) and the first communication link.
  • the streaming client 100 can pull streaming media data through (4), (5) and the third communication link.
  • the streaming client can obtain the communication quality information of the first communication link and the third communication link in real time, so as to realize the connection between the streaming client and the pulling client in the main link and the alternative link.
  • Real-time quality monitoring of this communication link between flow nodes enables timely switching to an alternative link with better communication link quality when the quality of this communication link in the main link is poor, thereby Improve the quality and real-time performance of streaming media data transmission.
  • the alternative link is in a stay-connected state and has the ability to implement quality detection.
  • the streaming client can To receive the quality detection results of the first communication link and the third communication link in real time, and based on the quality detection results and the preset conditions, the streaming client can determine the communication quality status of the first communication link and the third communication link. .
  • the streaming client can calculate indicator information such as packet loss rate and delay based on the actual data transmission with the target streaming node as the communication quality information of the first communication link.
  • the streaming client can also calculate indicator information such as packet loss rate and delay based on the actual data transmission with the candidate streaming node as the communication quality information of the third communication link.
  • the first streaming request carries media stream information, the access address of the streaming client, and information about whether the streaming client supports backup links.
  • the media stream information carried in the first pull request is used to generate information on the second communication link.
  • the target stream pull node sends a first link request to the live broadcast center based on the media stream information after receiving the first stream pull request.
  • the live broadcast center will generate the information of the second communication link based on the media stream information, and feed back the information of the second communication link to the target streaming node.
  • the target streaming node establishes the second communication link with the streaming node.
  • the access address of the streaming client and information about whether the streaming client supports backup links are the information based on which candidate nodes are selected.
  • the target streaming node can, after receiving the first streaming request, perform a request based on whether the streaming client supports backup.
  • the link information determines whether to request alternative node information from the live broadcast center. If the streaming client supports backup links, the target streaming node sends an alternative node request to the live broadcast center, so that the live broadcast center feeds back information about the alternative nodes to the target streaming node. After the target streaming node receives the information of the alternative node, it sends the information of the alternative node to the streaming client. In addition, if the streaming client does not support backup links, the target streaming node will not send an alternative node request to the live broadcast center.
  • the second pull request carries media stream information and backup link tag information.
  • the media stream information carried in the second pull request is used to generate information on the second communication link.
  • the candidate stream pull node sends a second link request to the live broadcast center based on the media stream information after receiving the second stream pull request.
  • the live broadcast center After receiving the second link request, the live broadcast center will generate the information of the fourth communication link based on the media stream information, and feed back the information of the fourth communication link to the alternative streaming node.
  • the candidate streaming node After receiving the information of the fourth communication link, the candidate streaming node establishes a fourth communication link with the streaming node.
  • the backup link tag information is used to inform the alternative streaming node that the fourth communication link to be established belongs to the alternative link, and there is no need to request information about the alternative node.
  • the target streaming node By carrying different information in the streaming requests sent to the target streaming node and the alternative streaming node, the target streaming node has the ability to obtain the information of the alternative streaming node, and the alternative streaming node can be established and pushed normally. Communication links between nodes without unnecessary processing of requesting alternative node information.
  • the information of the candidate node may include the access address (IP) and selection priority of the candidate node.
  • the alternative node is determined by the live broadcast center based on the IP of the alternative streaming node, combined with at least one of the information such as the location of the edge node in the CDN, its operator, load and health status, to determine the communication quality with the streaming client. better side edge node.
  • the selection priority refers to the priority of the candidate node selected as the candidate streaming node.
  • the streaming client can selectively select at least one alternative node as the alternative streaming node based on the selection priority of the alternative nodes, thereby establishing a third communication link with higher communication quality.
  • the streaming client When establishing a third communication link with each candidate streaming node, the streaming client establishes a third communication link with each candidate streaming node based on the access address of each candidate streaming node.
  • FIG. 6 is a flow chart of a method for performing real-time streaming media data transmission by a target streaming node provided by an embodiment of the present application. As shown in Figure 6, the specific steps of this method are as follows:
  • Step S601 Receive the first streaming request sent by the streaming client.
  • the first streaming request carries media stream information, the access address of the streaming client, and information about whether a backup link is supported, where the media stream information includes the streaming media data. domain name.
  • the media stream information carried in the first pull request is used to generate information on the second communication link.
  • the access address of the streaming client and information about whether the streaming client supports backup links are used to determine information about alternative nodes.
  • the target streaming node After receiving the first streaming request, the target streaming node parses the first streaming request to obtain the media stream information carried therein, the access address of the streaming client, and information about whether backup links are supported.
  • Step S602 Send a first link request carrying media stream information to the live broadcast center.
  • the target streaming node can send the first link request carrying the media stream information to the live broadcast center.
  • the live broadcast center will generate the information of the second communication link based on the media stream information, and feed back the information of the second communication link to the target streaming node.
  • Step S603 When it is determined that the streaming client supports the backup link, an alternative node request is sent to the live broadcast center.
  • the alternative node request carries the domain name of the streaming media data and the access address of the streaming client.
  • the target pull stream The node After parsing the information about whether the streaming client supports backup links, confirming that the streaming client supports backup links, and parsing the access address of the streaming client and the domain name of the streaming media data in the media streaming information, the target pull stream The node sends an alternative node request to the live broadcast center. After receiving the alternative node request, the live broadcast center selects the target streaming node based on the domain name of the streaming media data and the access address of the streaming client, combined with the location, operator, load and health status of the edge node in the CDN. The alternative edge node is used as an alternative node, and the information of the alternative node is fed back to the target streaming node.
  • Step S604 Receive the information of the second communication link sent by the live broadcast center, and establish a second communication link with the streaming node according to the information of the second communication link.
  • the information of the second communication link includes path information of the second communication link, and may specifically include address information of each hop node in the second communication link.
  • the target streaming node After receiving the information of the second communication link, the target streaming node establishes a second communication link with the streaming node based on the information of the second communication link.
  • Step S605 After receiving the information of the alternative node sent by the live broadcast center, send the information of the alternative node to the streaming client.
  • the target streaming node After the target streaming node receives the information of the alternative node, it sends the information of the alternative node to the streaming client, so that The streaming client selects at least one candidate node as a candidate streaming node based on the information of the candidate streaming node, establishes a third communication link with each candidate streaming node, and sends a third communication link to each candidate streaming node.
  • the second pull request is to enable each candidate pull node to establish a fourth communication link with the push node, thus solidifying the establishment of at least one candidate link.
  • the target streaming node can request the information of the alternative nodes from the live broadcast center, and send the received information of the alternative nodes to the streaming client, thereby providing at least one alternative node to the streaming client, causing the streaming client to select at least one candidate node as an alternative streaming node, establish a third communication link, and request the alternative streaming node to establish a fourth communication link with the streaming node, the third communication link
  • the route and the fourth communication link together form an alternative link.
  • the alternative link of the condition is switched to the main link, thereby switching the alternative streaming node used to pull streaming media data in a timely manner, which can avoid jitter or network failure in the communication link between the streaming client and the streaming node. Stuttering delays, packet loss and other conditions caused by congestion improve the transmission quality and real-time performance of streaming media data.
  • the fourth communication link includes a relay node, and the relay node includes a target streaming node.
  • the target streaming node is a relay node directly connected to the alternative streaming node.
  • the fourth communication link can be expressed as "alternative streaming node ⁇ target streaming node Node ⁇ ... ⁇ Push node”, where the direction of the arrow indicates the flow direction of streaming media data when pulling streams.
  • the target pull node and the push node may not include a relay node, or may include at least one other relay node.
  • the target streaming node can receive the streaming link establishment request sent by the alternative streaming node, and establish a communication link with the alternative streaming node; parse the streaming link establishment request to obtain the fourth communication carried by it According to the information of the fourth communication link, a pull link establishment request is sent to the next node in the fourth communication link to establish a communication link with the next node.
  • the target streaming node can determine the information of the next node that needs to establish a connection.
  • a communication link between two adjacent nodes is established sequentially in the order of "alternative streaming node ⁇ target streaming node ⁇ ... ⁇ streaming node".
  • the next node refers to the "backup streaming node”.
  • Select the next node in the link "Pull Node ⁇ Target Pull Node ⁇ ... ⁇ Push Node" to the target pull node in the direction of the arrow, which may be a relay node or a push node.
  • the target streaming node serves as a relay node in the fourth communication link.
  • the communication quality of the communication link between the streaming client and the target streaming node is poor, but the communication quality between the target streaming node and the pushing node is poor.
  • the streaming client can establish a connection with the target streaming node through the alternative streaming node, and still use the second communication link with good communication quality to pull streaming media data.
  • FIG. 7 is a flow chart of a method for transmitting real-time streaming media data by a live broadcast center provided by an embodiment of the present application.
  • the real-time streaming media data transmission method provided in this embodiment can be specifically applied to the live broadcast center in the CDN. As shown in Figure 7, the specific steps of this method are as follows:
  • Step S701 Receive a first link request and an alternative node request sent by the target streaming node.
  • the first link request carries media stream information
  • the alternative node request carries the domain name of the streaming media data and the access address of the streaming client.
  • Step S702 When receiving the first link request, generate the information of the second communication link between the target streaming node and the streaming node according to the media stream information, and send the information of the second communication link to the target streaming node. .
  • the live broadcast center After receiving the first link request carrying media stream information, the live broadcast center generates the information of the second communication link based on the media stream information, and feeds back the information of the second communication link to the target streaming node, so that the target pulls the stream
  • the node establishes a second communication link with the streaming node according to the information of the second communication link.
  • Step S703 When an alternative node request is received, at least one alternative node is selected based on the domain name of the streaming media data and the access address of the streaming client, and information about the alternative node is sent to the target streaming node.
  • the information of the candidate node at least includes the access address of the candidate node, so that the streaming client can establish a communication link with the candidate node based on the access address of the candidate node.
  • the live broadcast center selects at least one edge node from the CDN that can be an alternative to the target streaming node based on the domain name of the streaming media data and the access address of the streaming client as the alternative node, and Send the information of the alternative node to the target streaming node, so that the target streaming node forwards the information of the alternative node to the streaming client.
  • the streaming client After receiving the information of the candidate nodes, the streaming client will select at least one candidate node as the candidate streaming node based on the information of the candidate nodes, establish a third communication link with each candidate streaming node, and send Each candidate streaming node sends a second streaming request, so that each candidate streaming node establishes a fourth communication link with the streaming node, thereby achieving the establishment of at least one candidate link.
  • the live broadcast center has the function of selecting and providing information about alternative nodes, so that the streaming client establishes a third communication link with at least one alternative streaming node among the alternative nodes, and requests the alternative streaming node.
  • the node establishes a fourth communication link with the streaming node, and the second communication link and the fourth communication link constitute an alternative link for pulling streaming media data.
  • the alternative link of the condition is switched to the main link, thereby switching to the alternative streaming node in a timely manner, which can avoid delays caused by jitter in the communication link between the streaming client and the streaming node or network congestion. , packet loss, etc., which improves the transmission quality and real-time performance of streaming media data.
  • At least one candidate node is selected based on the domain name of the streaming media data and the access address of the streaming client. Specifically, it can be implemented in the following manner:
  • At least one edge node is selected as a backup from the edge nodes covered by the scheduling domain of the domain name of the streaming media data. Select node.
  • the scheduling domain of the domain name of the streaming media data can be determined according to the domain name of the streaming media data, and then the edge nodes covered by the scheduling domain in the CDN are determined.
  • the streaming client is determined according to the access address of the streaming client. Based on the location of the client and the operator it belongs to, combined with the location information, operator information, load information and health status information of the edge node in the CDN, the edge node with better communication quality with the streaming client can be selected as an alternative node.
  • the streaming client in the edge node covered by the scheduling domain of the domain name of the streaming media data, can be The access address can determine the location and operator of the streaming client. Combined with the location information and operator information of the edge node in the CDN, the edge node in the same area of the same operator as the streaming client is determined, and then based on The load information and health status information select edge nodes with less load and better health status as alternative nodes.
  • the area where the edge node is located can be divided geographically according to administrative regions, cities, etc., or in other ways, and there is no specific limit here.
  • the live broadcast center can select an edge node with less load and better health status as an alternative node for the streaming client, so that the communication quality can be established between the streaming client and each alternative node. third communication link.
  • the live broadcast center sends alternative node information to the target streaming node, which specifically includes:
  • the node sends the access address and selection priority of the alternative node.
  • the live broadcast center can determine and provide the selection priority of the alternative node, so that the streaming client can selectively select the alternative streaming node according to the selection priority of the alternative node.
  • the live broadcast center may also provide the required fourth communication link information to the candidate streaming node to assist the candidate streaming node and the streaming node in establishing the fourth communication link.
  • the live broadcast center receives the second link request sent by the alternative streaming node, and the second link request carries media stream information and backup link mark information.
  • the live broadcast center parses the second link request and can obtain the backup link tag information, it can determine that the communication link information requested by the link request is used to establish the fourth communication link among the alternative links, without To obtain the information of the alternative node, only the information of the fourth communication link is generated and fed back.
  • the live broadcast center generates information about the fourth communication link between the candidate streaming node and the streaming node according to the media stream information, and sends the information about the fourth communication link to the candidate streaming node.
  • the live broadcast center can be informed that the current link request is a request from the alternative streaming node and the requested communication link information It is used to establish the fourth communication link among the alternative links.
  • the live broadcast center does not need to feed back the information of the alternative nodes, so as to distinguish the link requests of the alternative streaming nodes and the target streaming nodes.
  • the attribute information of the edge node in the CDN can be configured so that the edge node has attributes that can serve as a relay node. In this way, more relay nodes can be selected when establishing communication links, and communication links can be directly established between two edge nodes. The combination of links is more flexible and can improve the quality of the established communication links.
  • the live broadcast center when generating the information of the fourth communication link between the alternative pull node and the push node based on the media flow information, the live broadcast center can, based on the media flow information, use the pull node or the push node in the content distribution network to The node serves as an available relay node and generates information of the fourth communication link.
  • the fourth communication link may not include any relay node, so as to determine the fourth communication link with better communication quality.
  • the fourth communication link may include relay nodes, and these relay nodes include pull nodes or push nodes in the CDN.
  • the combination method of the fourth communication link is more flexible, there are more optional links, and the fourth communication link with better communication quality can be determined.
  • the target streaming node when generating the information of the fourth communication link, can be used as a relay node, and "alternative streaming node ⁇ target streaming node ⁇ ... ⁇ streaming node" can be established like this A fourth communications link.
  • the pull client can use the alternative pull
  • the streaming node establishes a connection with the target streaming node, and still uses the second communication link with good communication quality to pull streaming media data to establish a fourth communication link with better communication quality.
  • FIG 8 is a flow chart of a real-time streaming media data transmission method provided by an embodiment of the present application. As shown in Figure 8, the specific steps of this method are as follows:
  • Step S801 The streaming client receives the information of the target streaming node provided by the DNS server.
  • Step S802 The streaming client establishes a first communication link with the target streaming node.
  • Step S803 The streaming client sends a first streaming request to the target streaming node.
  • the first streaming request carries media stream information, the access address of the streaming client, and information about whether a backup link is supported.
  • the media stream information includes the domain name of the streaming media data.
  • Step S804 The target streaming node sends a first link request carrying media stream information to the live broadcast center.
  • the first link request carries media stream information.
  • Step S805 When the target streaming node determines that the streaming client supports the backup link, it sends an alternative node request to the live broadcast center.
  • the alternative node requests the domain name carrying the streaming media data and the access address of the streaming client.
  • Step S806 When receiving the first link request, the live broadcast center generates information on the second communication link between the target streaming node and the streaming node according to the media stream information.
  • Step S807 The live broadcast center sends the information of the second communication link to the target streaming node.
  • Step S808 The target streaming node establishes a second communication link with the streaming node according to the information of the second communication link.
  • the first communication link and the second communication link constitute the main link for pulling streaming media data.
  • Step S809 When receiving an alternative node request, the live broadcast center selects at least one alternative node based on the domain name of the streaming media data and the access address of the streaming client.
  • Step S810 The live broadcast center sends the information of the candidate node to the target streaming node.
  • Step S811 After receiving the information of the alternative node sent by the live broadcast center, the target streaming node sends the information of the alternative node to the streaming client.
  • Step S812 The streaming client selects at least one candidate node as an alternative streaming node based on the information of the candidate nodes.
  • Step S813 The streaming client establishes a third communication link with the candidate streaming node.
  • Step S814 The streaming client sends a second streaming request to the candidate streaming node.
  • the second pull request carries media stream information and backup link tag information.
  • Step S815 The live broadcast center generates information about the fourth communication link between the candidate streaming node and the streaming node according to the media stream information.
  • Step S816 The live broadcast center sends the information of the fourth communication link to the candidate streaming node.
  • Step S817 The alternative pull node establishes a fourth communication link with the push node based on the information of the fourth communication link.
  • the third communication link and the fourth communication link constitute an alternative link for pulling streaming media data. .
  • Step S818 When the first communication link does not meet the preset conditions, select an alternative link to switch to the main link, pull streaming media data through the switched main link, and switch the pre-switched main link. as an alternative link.
  • FIG 9 is a schematic structural diagram of a real-time streaming media data transmission device provided by an embodiment of the present application.
  • the device provided by this embodiment is applied to a streaming client.
  • the real-time streaming media data transmission device 90 includes: communication Module 91, alternative link establishment module 92 and link switching module 93.
  • the communication module 91 is used to receive the information of the target streaming node provided by the DNS server, establish a first communication link with the target streaming node, and send a first streaming request to the target streaming node, so that the target streaming node is established With the second communication link between the streaming node and the first communication link and the second communication link, the first communication link and the second communication link constitute the main link for pulling streaming media data; receiving the information of the alternative node sent by the target streaming node, and preparing The node selection information is determined by the live broadcast center and sent to the target streaming node.
  • the alternative link establishment module 92 is configured to select at least one candidate node as an alternative streaming node according to the information of the candidate node, and establish a third communication link with each candidate streaming node.
  • the communication module 91 is also configured to send a second streaming request to each candidate streaming node, so that each candidate streaming node establishes a fourth communication link with the streaming node, the third communication link and the third communication link.
  • Four communication links constitute alternative links for pulling streaming media data.
  • the link switching module 93 is used to select an alternative link to switch to the main link when the first communication link does not meet the preset conditions, pull streaming media data through the switched main link, and transfer the pre-switched link to the main link.
  • the primary link is switched to the backup link.
  • At least one fourth communication link includes a relay node, and the relay node includes a pull node or a push node in the content distribution network.
  • the relay node includes a target streaming node.
  • the communication module is also configured to obtain communication quality information of the first communication link and the third communication link in real time.
  • the first streaming request carries media stream information, the access address of the streaming client, and information about whether the streaming client supports backup links; the second streaming request carries media stream information and backup links. Tag information.
  • the information of the candidate node includes the access address and selection priority of the candidate node
  • the alternative link establishment module is also used to: select at least one candidate node as a backup node based on the selection priority of the candidate node. Select the streaming node.
  • the candidate streaming node determination module is also used to: root According to the access address of each candidate streaming node, a third communication link is established with each candidate streaming node.
  • the device provided in this embodiment can be specifically used to execute the solution executed by the streaming client in any of the above method embodiments.
  • the specific functions and technical effects that can be achieved will not be described again here.
  • FIG 10 is a schematic structural diagram of a real-time streaming media data transmission device provided by another embodiment of the present application.
  • the device provided by this embodiment is applied to the target streaming node.
  • the real-time streaming media data transmission device 1000 includes : Communication module 1001, alternative node request module 1002 and link establishment module 1003.
  • the communication module 1001 is configured to receive a first streaming request sent by a streaming client.
  • the first streaming request carries media stream information, the access address of the streaming client, and information about whether a backup link is supported, where the media stream information includes streaming media.
  • the domain name of the data is configured to receive a first streaming request sent by a streaming client.
  • the communication module 1001 is also used to send a first link request carrying media stream information to the live broadcast center.
  • the alternative node request module 1002 is configured to send an alternative node request to the live broadcast center when it is determined that the streaming client supports the backup link.
  • the alternative node request carries the domain name of the streaming media data and the access address of the streaming client.
  • the communication module 1001 is also used to receive the information of the second communication link sent by the live broadcast center.
  • the link establishment module 1003 is configured to establish a second communication link with the streaming node according to the information of the second communication link.
  • the communication module 1001 is also configured to send the information of the alternative node to the streaming client after receiving the information of the alternative node sent by the live broadcast center.
  • the communication module is also configured to receive a pull link establishment request sent by the alternative pull node, where the pull link establishment request carries a fourth communication link between the alternative pull node and the push node.
  • the fourth communication link includes a relay node, and the relay node includes a target streaming node;
  • the link establishment module is also used to establish communication links with alternative streaming nodes.
  • the communication module is also configured to send a pull link establishment request to the next node in the fourth communication link according to the information of the fourth communication link.
  • the link establishment module is also used to establish a communication link with the next node.
  • the device provided in this embodiment can be specifically used to execute the solution executed by the target streaming node in any of the above method embodiments.
  • the specific functions and achievable technical effects will not be described again here.
  • FIG 11 is a schematic structural diagram of a real-time streaming media data transmission device provided by another embodiment of the present application.
  • the device provided by this embodiment is applied to the live broadcast center of a CDN.
  • the real-time streaming media data transmission device 1100 includes : Communication module 1101, link information generation module 1102 and candidate node determination module 1103.
  • the communication module 1101 is used to receive a first link request and an alternative node request sent by the target streaming node.
  • the first link request carries media stream information
  • the alternative node request carries the domain name of the streaming media data and the access address of the streaming client. .
  • the link information generation module 1102 is configured to, when receiving the first link request, generate information on the second communication link between the target pull node and the push node according to the media stream information.
  • the communication module 1101 is also used to send the information of the second communication link to the target streaming node.
  • the alternative node determination module 1103 is configured to, when receiving an alternative node request, select at least one alternative node based on the domain name of the streaming media data and the access address of the streaming client.
  • the communication module 1101 is also used to send information about alternative nodes to the target streaming node.
  • the alternative node determination module when selecting at least one alternative node based on the domain name of the streaming media data and the access address of the streaming client, is also used to:
  • multiple edge nodes are selected from the edge nodes covered by the scheduling domain of the domain name of the streaming media data. as an alternative node.
  • the alternative node determination module 1103 is also used to obtain the access address of the alternative node, and based on the access address of the streaming client, as well as the location information, operator information, load information and Health status information determines the selection priority of alternative nodes.
  • the communication module 1101 is also used to send the access address and selection priority of the alternative node to the target streaming node.
  • the communication module is also configured to receive a second link request sent by the alternative streaming node, where the second link request carries media stream information and backup link tag information.
  • the link information generation module is also configured to generate information on a fourth communication link between the candidate streaming node and the streaming node based on the media stream information, and send the information on the fourth communication link to the candidate streaming node.
  • the link information generation module when generating information about the fourth communication link between the alternative pull node and the push node based on the media stream information, is also used to:
  • the pull node or the push node in the content distribution network is used as an available relay node to generate information of the fourth communication link.
  • the link information generation module when generating information about the fourth communication link between the alternative pull node and the push node based on the media stream information, is also used to:
  • the target streaming node is used as a relay node to generate information of the fourth communication link.
  • the device provided in this embodiment can be specifically used to execute the solution executed by the live broadcast center in any of the above method embodiments.
  • the specific functions and the technical effects that can be achieved will not be described again here.
  • This application also provides electronic equipment for realizing real-time streaming data transmission, including equipment loaded with streaming clients, edge nodes in CDN as target streaming nodes, or CDN live broadcast centers.
  • This application provides a device loaded with a streaming client, including: a processor, and a memory communicatively connected to the processor.
  • the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement any of the above methods.
  • the solution implemented by the streaming client in the example, the specific functions and the technical effects it can achieve will not be described again here.
  • This application provides an edge node, including: a processor, and a memory communicatively connected to the processor.
  • the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to achieve the target flow in any of the above method embodiments.
  • This application provides a live broadcast center, including: a processor, and a memory communicatively connected to the processor.
  • the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement any of the above methods.
  • This application also provides a computer-readable storage medium.
  • Computer-executable instructions are stored in the computer-readable storage medium. When executed by the processor, the computer-executable instructions are used to implement the streaming client and target streaming in any of the above method embodiments.
  • the solutions implemented by nodes or live broadcast centers, the specific functions and the technical effects that can be achieved will not be described again here.
  • the computer program product includes: a computer program.
  • the computer program is stored in a readable storage medium.
  • At least one processor of the electronic device can read the computer program from the readable storage medium.
  • At least one processor The computer program is executed by the computer so that the electronic device executes the solution executed by the streaming client, the target streaming node, or the live broadcast center in any of the above method embodiments.

Abstract

The present application provides a real-time streaming media data transmission method and device, and a storage medium. According to the method provided by the present application, a communication link is established between a stream pulling client and multiple stream pulling nodes, and a communication link is established between the stream pulling nodes and stream pushing nodes to form multiple links for pulling streams. Different stream pulling nodes are used in different links. One link serves as a main link, and other links serve as candidate links. When the communication link between the stream pulling client and the stream pulling nodes in the main link does not meet a preset condition, one candidate link is switched to become the main link, and the streaming media data is pulled through the switched main link. When a jitter or network congestion happens to the communication link between the stream pulling client and the stream pulling nodes, the stream pulling nodes are switched in time to avoid freezing, delays and packet losses caused by the jitter or network congestion between the stream pulling client and the stream pulling nodes. Therefore, the transmission quality and timeliness of the streaming media data are improved.

Description

实时流媒体数据传输的方法、设备及存储介质Methods, equipment and storage media for real-time streaming data transmission
本申请要求于2022年05月23日提交中国专利局、申请号为202210567651.3、申请名称为“实时流媒体数据传输的方法、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on May 23, 2022, with the application number 202210567651.3 and the application title "Method, equipment and storage medium for real-time streaming data transmission", the entire content of which is incorporated by reference. incorporated in this application.
技术领域Technical field
本申请涉及通信技术,尤其涉及一种实时流媒体数据传输的方法、设备及存储介质。The present application relates to communication technology, and in particular, to a method, device and storage medium for real-time streaming media data transmission.
背景技术Background technique
随着通信技术的发展,越来越多的用户依赖于视频直播、音视频会议等实时流媒体进行交互。视频直播尤其是低延迟直播(Real-time Streaming,RTS),以及音视频会议等实时音视频通信(Real-time Communication,RTC)的场景对延迟和传输质量的要求较高,对数据传输的实时性要求较高。With the development of communication technology, more and more users rely on real-time streaming media such as live video broadcasts and audio and video conferencing for interaction. Video live broadcast, especially low-latency live broadcast (Real-time Streaming, RTS), and audio and video conferencing and other real-time audio and video communication (Real-time Communication, RTC) scenarios have higher requirements on delay and transmission quality, and real-time data transmission. Sexual requirements are high.
内容分发网络(Content Delivery Network,CDN)是一种常用的实现流媒体数据传输的网络。在CDN中,拉流客户端(即播放客户端)与CDN中的一个边缘节点(即拉流节点)建立通信链路,拉流客户端与拉流节点间采用单链路方式进行数据传输,在通信链路发生抖动等状况时,会造成数据传输出现诸如卡顿延迟、丢包等现象,造成数据传输的质量差,难以满足RTS、RTC等场景下流媒体数据传输的实时性要求。Content Delivery Network (CDN) is a commonly used network for streaming media data transmission. In the CDN, the streaming client (i.e., the playback client) establishes a communication link with an edge node (i.e., the streaming node) in the CDN, and a single link is used for data transmission between the streaming client and the streaming node. When communication links jitter and other conditions occur, data transmission will cause phenomena such as stuck delays and packet loss, resulting in poor data transmission quality and making it difficult to meet the real-time requirements of streaming media data transmission in RTS, RTC and other scenarios.
发明内容Contents of the invention
本申请提供一种实时流媒体数据传输的方法、设备及存储介质,用以解决目前CDN中数据传输的质量差,难以满足RTS、RTC等场景下流媒体数据传输的实时性要求的问题。This application provides a method, device and storage medium for real-time streaming media data transmission to solve the current problem of poor data transmission quality in CDN and difficulty in meeting the real-time requirements of streaming media data transmission in RTS, RTC and other scenarios.
第一方面,本申请提供一种实时流媒体数据传输方法,应用于拉流客户端,包括:In the first aspect, this application provides a real-time streaming media data transmission method, which is applied to the streaming client, including:
接收DNS服务器提供的目标拉流节点的信息,与所述目标拉流节点建立第一通信链路;Receive the information of the target streaming node provided by the DNS server, and establish a first communication link with the target streaming node;
向所述目标拉流节点发送第一拉流请求,以使所述目标拉流节点建立与推流节点间的第二通信链路,所述第一通信链路和所述第二通信链路构成用于拉取流媒体数据的主链路;Send a first pull request to the target pull node, so that the target pull node establishes a second communication link with the push node, the first communication link and the second communication link Constitute the main link used to pull streaming media data;
接收所述目标拉流节点发送的备选节点的信息,所述备选节点的信息是由直播中心确定并发送给所述目标拉流节点的;Receive information about alternative nodes sent by the target streaming node, where the information about the alternative nodes is determined by the live broadcast center and sent to the target streaming node;
根据所述备选节点的信息,选择至少一个备选节点作为备选拉流节点,与每一所述备选拉流节点建立第三通信链路; According to the information of the candidate nodes, select at least one candidate node as an alternative streaming node, and establish a third communication link with each of the candidate streaming nodes;
向每一所述备选拉流节点发送第二拉流请求,以使每一所述备选拉流节点建立与推流节点间的第四通信链路,所述第三通信链路和所述第四通信链路构成拉取流媒体数据的备选链路;Send a second streaming request to each of the candidate streaming nodes, so that each of the candidate streaming nodes establishes a fourth communication link with the streaming node, and the third communication link and the streaming node are The fourth communication link constitutes an alternative link for pulling streaming media data;
当所述第一通信链路不符合预设条件时,选择一个备选链路切换为主链路,通过切换后的主链路拉取流媒体数据,并将切换前的主链路切换为备选链路。When the first communication link does not meet the preset conditions, select an alternative link to switch to the main link, pull streaming media data through the switched main link, and switch the pre-switched main link to Alternative link.
第二方面,本申请提供一种实时流媒体数据传输方法,应用于目标拉流节点,包括:In the second aspect, this application provides a real-time streaming media data transmission method, which is applied to the target streaming node, including:
接收拉流客户端发送的第一拉流请求,所述第一拉流请求携带媒体流信息、拉流客户端的访问地址及是否支持备份链路的信息,其中所述媒体流信息包含流媒体数据的域名;Receive the first streaming request sent by the streaming client. The first streaming request carries media stream information, the access address of the streaming client, and information about whether a backup link is supported, where the media stream information includes streaming media data. domain name;
向直播中心发送携带所述媒体流信息的第一链路请求,并在确定所述拉流客户端支持备份链路时向直播中心发送备选节点请求,所述备选节点请求携带流媒体数据的域名和拉流客户端的访问地址;Send a first link request carrying the media stream information to the live broadcast center, and when it is determined that the streaming client supports the backup link, send an alternative node request to the live broadcast center, and the alternative node request carries streaming media data The domain name and the access address of the streaming client;
接收直播中心发送的第二通信链路的信息,并根据所述第二通信链路的信息建立与推流节点的第二通信链路;Receive the information of the second communication link sent by the live broadcast center, and establish a second communication link with the streaming node according to the information of the second communication link;
在接收到直播中心发送的备选节点的信息的情况下,向所述拉流客户端发送所述备选节点的信息。After receiving the information of the alternative node sent by the live broadcast center, the information of the alternative node is sent to the streaming client.
第三方面,本申请提供一种实时流媒体数据传输方法,应用于直播中心,包括:In the third aspect, this application provides a real-time streaming media data transmission method, which is applied to the live broadcast center, including:
接收目标拉流节点发送的第一链路请求和备选节点请求,所述第一链路请求携带媒体流信息,所述备选节点请求携带流媒体数据的域名和拉流客户端的访问地址;Receive a first link request and an alternative node request sent by the target streaming node, the first link request carries media stream information, and the alternative node request carries the domain name of the streaming media data and the access address of the streaming client;
当接收到所述第一链路请求时,根据所述媒体流信息生成所述目标拉流节点与推流节点间的第二通信链路的信息,并向所述目标拉流节点发送所述第二通信链路的信息;When the first link request is received, information on the second communication link between the target streaming node and the streaming node is generated according to the media stream information, and the information is sent to the target streaming node. Information on the second communication link;
当接收到所述备选节点请求时,根据所述流媒体数据的域名和拉流客户端的访问地址,选取至少一个备选节点,并向所述目标拉流节点发送所述备选节点的信息。When receiving the alternative node request, select at least one alternative node based on the domain name of the streaming media data and the access address of the streaming client, and send the information of the alternative node to the target streaming node. .
第四方面,本申请提供一种电子设备,包括:处理器,以及与所述处理器通信连接的存储器;所述存储器存储计算机执行指令;所述处理器执行所述存储器存储的计算机执行指令,以实现上述任一方面提供的方法。In a fourth aspect, the present application provides an electronic device, including: a processor, and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, To implement any of the above methods.
第五方面,本申请提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,所述计算机执行指令被处理器执行时用于实现上述任一方面提供的方法。In a fifth aspect, the present application provides a computer-readable storage medium in which computer-executable instructions are stored, and when executed by a processor, the computer-executable instructions are used to implement the method provided in any of the above aspects.
本申请提供的实时流媒体数据传输的方法中,通过将拉流客户端分别与多个拉流节点建立通信链路,并建立拉流节点与推流节点间的通信链路,形成多条用于拉流的链路,不同链路中使用不同的拉流节点。其中一条链路作为主链路,其他链路作为备选链路。当主链路中拉流客户端与拉流节点间的通信链路不符合预设条件时,通过将一个备选链路切换为主链路,通过切换后的主链路拉取流媒体数据,能够在拉流客户端与拉流节点间的通信链路发生抖动、或网络拥塞时,及时地切换拉流使用的拉流节点,从而能避免因拉流客户端与拉流节点间的通信链路发生抖动、或网络拥塞造成的卡顿延迟、丢包等状况,提高了流媒体数据的传输质量和实时性。 In the real-time streaming media data transmission method provided by this application, by establishing communication links between the streaming client and multiple streaming nodes, and establishing communication links between the streaming nodes and the streaming nodes, multiple users are formed. For streaming links, different streaming nodes are used in different links. One link serves as the primary link and the other links serve as backup links. When the communication link between the streaming client and the streaming node in the main link does not meet the preset conditions, an alternative link is switched to the main link, and streaming media data is pulled through the switched main link. When the communication link between the streaming client and the streaming node jitters or the network is congested, the streaming node used for streaming can be switched in a timely manner, thereby avoiding the communication link between the streaming client and the streaming node. It improves the transmission quality and real-time performance of streaming media data by preventing delays, packet loss, etc. caused by jitter on the road or network congestion.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
图1为本申请提供的一种通信链路的示例图;Figure 1 is an example diagram of a communication link provided by this application;
图2为本申请一实施例提供的拉流客户端执行实时流媒体数据传输方法的流程图;Figure 2 is a flow chart of a method for performing real-time streaming media data transmission by a streaming client provided by an embodiment of the present application;
图3为本申请提供的一种流媒体数据传输主链路的建立流程的框架图;Figure 3 is a framework diagram of the establishment process of a streaming media data transmission main link provided by this application;
图4为本申请提供的一种拉流节点与推流节点间的通信链路的示例图;Figure 4 is an example diagram of a communication link between a pull node and a push node provided by this application;
图5为本申请提供的一种目标拉流节点作为中继节点的通信链路的示例图;Figure 5 is an example diagram of a communication link in which a target streaming node is used as a relay node provided by this application;
图6为本申请一实施例提供的目标拉流节点执行实时流媒体数据传输方法的流程图;Figure 6 is a flow chart of a method for performing real-time streaming media data transmission by a target streaming node provided by an embodiment of the present application;
图7为本申请一实施例提供的直播中心执行实时流媒体数据传输方法的流程图;Figure 7 is a flow chart of a method for transmitting real-time streaming media data by a live broadcast center provided by an embodiment of the present application;
图8为本申请一实施例提供的实时流媒体数据传输方法的流程图;Figure 8 is a flow chart of a real-time streaming media data transmission method provided by an embodiment of the present application;
图9为本申请一实施例提供的一种实时流媒体数据传输装置的结构示意图;Figure 9 is a schematic structural diagram of a real-time streaming media data transmission device provided by an embodiment of the present application;
图10为本申请另一实施例提供的一种实时流媒体数据传输装置的结构示意图;Figure 10 is a schematic structural diagram of a real-time streaming media data transmission device provided by another embodiment of the present application;
图11为本申请另一实施例提供的一种实时流媒体数据传输装置的结构示意图。Figure 11 is a schematic structural diagram of a real-time streaming media data transmission device provided by another embodiment of the present application.
通过上述附图,已示出本申请明确的实施例,后文中将有更详细的描述。这些附图和文字描述并不是为了通过任何方式限制本申请构思的范围,而是通过参考特定实施例为本领域技术人员说明本申请的概念。Through the above-mentioned drawings, clear embodiments of the present application have been shown, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present application's concepts in any way, but are intended to illustrate the application's concepts for those skilled in the art with reference to specific embodiments.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the appended claims.
首先对本申请所涉及的名词进行解释:First, the terms involved in this application will be explained:
拉流客户端:也称为播放客户端,是指从CDN中拉流以获取流媒体数据的客户端。Streaming client: Also called playback client, it refers to the client that pulls streams from CDN to obtain streaming media data.
拉流节点:CDN中与拉流客户端建立通信链路的边缘节点,拉流客户端从拉流节点拉流。Streaming node: An edge node in the CDN that establishes a communication link with the streaming client. The streaming client pulls streams from the streaming node.
推流客户端:向CDN推送流媒体数据的客户端。Push client: A client that pushes streaming media data to CDN.
推流节点:CDN中与推流客户端建立通信链路的边缘节点,推流客户端向推流节点推送流媒体数据。Push node: an edge node in the CDN that establishes a communication link with the push client. The push client pushes streaming media data to the push node.
本申请中,为了区分同一拉流客户端对应的多个拉流节点,用目标拉流节点指代DNS服务器第一次为拉流客户端指定的拉流节点,用备选拉流节点指代在目标拉流节点之后与拉流客户端建立通信链路的拉流节点。In this application, in order to distinguish multiple streaming nodes corresponding to the same streaming client, the target streaming node is used to refer to the streaming node designated by the DNS server for the first time for the streaming client, and the alternative streaming node is used to refer to A streaming node that establishes a communication link with the streaming client after the target streaming node.
为了区分不同的通信链路,第一通信链路指代拉流客户端与目标拉流节点间的通信链 路,第二通信链路指代目标拉流节点与推流节点间的通信链路,第三通信链路指代拉流客户端与备选拉流节点之间的通信链路,第四通信链路指代备选拉流节点与推流节点间的通信链路。In order to distinguish different communication links, the first communication link refers to the communication link between the streaming client and the target streaming node. road, the second communication link refers to the communication link between the target streaming node and the streaming node, the third communication link refers to the communication link between the streaming client and the alternative streaming node, and the fourth communication link Link refers to the communication link between the candidate pull node and the push node.
另外,第一拉流请求指代拉流客户端向目标拉流节点发送的拉流请求,第二拉流请求指代拉流客户端向备选拉流节点发送的拉流请求。第一链路请求指代目标拉流节点向直播中心发送的链路请求,第二链路请求指代备选拉流节点向直播中心发送的链路请求。In addition, the first pull request refers to the pull request sent by the pull client to the target pull node, and the second pull request refers to the pull request sent by the pull client to the alternative pull node. The first link request refers to the link request sent by the target streaming node to the live broadcast center, and the second link request refers to the link request sent by the candidate streaming node to the live broadcast center.
目前,CDN主要包括CDN的中心和部署在各地的节点。其中,CDN的中心包括直播中心、调度系统等。部署在各地的节点通常分为两部分:一部分是边缘节点,通常可以作为拉流节点、推流节点与客户端建立通信连接;另一部分节点包括只承担在拉流节点与推流节点间的通信中继角色的中继节点。At present, CDN mainly includes CDN centers and nodes deployed in various places. Among them, the center of CDN includes live broadcast center, scheduling system, etc. The nodes deployed in various places are usually divided into two parts: one part is the edge node, which can usually be used as a pull node or a push node to establish communication connections with the client; the other part of the nodes is only responsible for the communication between the pull node and the push node. Relay node for the relay role.
传统的基于CDN的流媒体数据传输方法中,拉流客户端与一个拉流节点建立通信连接,拉流客户端与拉流节点间采用单链路方式进行数据传输,在拉流客户端与拉流节点间通信链路发生抖动等状况时,会造成数据传输出现诸如卡顿延迟、丢包等现象,流媒体数据传输的质量差,难以满足RTC、RTS等场景中流媒体数据传输的实时性要求。In the traditional CDN-based streaming media data transmission method, the streaming client establishes a communication connection with a streaming node, and a single link is used for data transmission between the streaming client and the streaming node. When the communication link between streaming nodes jitters, it will cause phenomena such as stuck delays and packet loss in data transmission. The quality of streaming data transmission is poor and it is difficult to meet the real-time requirements of streaming media data transmission in RTC, RTS and other scenarios. .
本申请提供的实时流媒体数据传输方法,可以应用于RTS、RTC等对实时性要求高的场景中,如视频直播、音视频会议等场景。本申请的方法,将拉流客户端分别与多个拉流节点建立通信链路,并建立拉流节点与推流节点间的通信链路,形成多条用于拉流的链路,不同链路中使用不同的拉流节点。其中一条链路作为主链路,其他链路作为备选链路。当主链路中拉流客户端与拉流节点间的通信链路不符合预设条件时,通过将一个备选链路切换为主链路,通过切换后的主链路拉取流媒体数据,能够在拉流客户端与拉流节点间的通信链路发生抖动、或网络拥塞时,及时地切换拉流使用的拉流节点,从而能避免因拉流客户端与拉流节点间的通信链路发生抖动、或网络拥塞造成的卡顿延迟、丢包等,提高了流媒体数据的传输质量和实时性。The real-time streaming data transmission method provided by this application can be applied to RTS, RTC and other scenarios that require high real-time performance, such as live video broadcasts, audio and video conferencing and other scenarios. The method of this application establishes communication links between the streaming client and multiple streaming nodes, and establishes communication links between the streaming nodes and the streaming nodes to form multiple links for streaming. Different links Use different pull nodes in the road. One link serves as the primary link and the other links serve as backup links. When the communication link between the streaming client and the streaming node in the main link does not meet the preset conditions, an alternative link is switched to the main link, and streaming media data is pulled through the switched main link. When the communication link between the streaming client and the streaming node jitters or the network is congested, the streaming node used for streaming can be switched in a timely manner, thereby avoiding the communication link between the streaming client and the streaming node. It improves the transmission quality and real-time performance of streaming media data due to jitter on the road or delays and packet loss caused by network congestion.
示例性地,图1为本申请提供的一种通信链路的示例图,如图1所示,拉流客户端100与拉流节点20间具有第一通信链路,拉流节点20与推流节点30间具有第二通信链路,第一通信链路与第二通信链路一起构成一条用于拉流的链路。拉流客户端100与拉流节点40间具有第三通信链路,拉流节点40与推流节点30间具有第四通信链路,第三通信链路和第四通信链路一起构成另一条用于拉流的链路。其中,拉流节点20和拉流节点40是CDN中两个不同的边缘节点,拉流客户端100分别与两个不同的边缘节点建立通信链路。上述两条用于拉流的链路中,一条链路作为主链路,另一条作为备选链路,拉流客户端100通过主链路拉取流媒体数据,备选链路处于保持连接的状态。当主链路中第一段链路(如第一通信链路或第三通信链路)不符合预设条件时,将备选链路切换为主链路,拉流客户端100通过切换后的主链路拉取流媒体数据,并将切换前的主链路切换为备选链路,进入保持连接的状态。 Exemplarily, Figure 1 is an example diagram of a communication link provided by this application. As shown in Figure 1, there is a first communication link between the streaming client 100 and the streaming node 20, and the streaming node 20 and the pushing node 20 have a first communication link. There is a second communication link between the streaming nodes 30, and the first communication link and the second communication link together form a link for pulling streams. There is a third communication link between the pull client 100 and the pull node 40, and a fourth communication link between the pull node 40 and the push node 30. The third communication link and the fourth communication link together form another communication link. The link used to pull streams. Among them, the streaming node 20 and the streaming node 40 are two different edge nodes in the CDN, and the streaming client 100 establishes communication links with two different edge nodes respectively. Among the above two links used for pulling streams, one link is used as the main link and the other is used as an alternative link. The streaming client 100 pulls streaming media data through the main link and the alternative link is kept connected. status. When the first link in the main link (such as the first communication link or the third communication link) does not meet the preset conditions, the alternative link is switched to the main link, and the streaming client 100 passes the switched The main link pulls the streaming media data, switches the main link before switching to the alternative link, and enters the state of maintaining connection.
另外,图1中的第二通信链路和第四通信链路用使用虚线,表示拉流节点与推流节点间的通信链路中拉流节点与推流节点可以直接连接,或者通过一个或多个中继节点连接。图1中仅以建立一条备选链路作为示例进行说明,在其他实例中还可以建立多条备选链路。In addition, the second communication link and the fourth communication link in Figure 1 use dotted lines to indicate that in the communication link between the pull node and the push node, the pull node and the push node can be directly connected, or through a or Multiple relay nodes are connected. Figure 1 only takes the establishment of one alternative link as an example for illustration. In other examples, multiple alternative links can also be established.
下面以具体地实施例对本申请的技术方案以及本申请的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本申请的实施例进行描述。The technical solution of the present application and how the technical solution of the present application solves the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
图2为本申请一实施例提供的拉流客户端执行实时流媒体数据传输方法的流程图。如图2所示,该方法具体步骤如下:FIG. 2 is a flow chart of a method for transmitting real-time streaming media data by a streaming client provided by an embodiment of the present application. As shown in Figure 2, the specific steps of this method are as follows:
步骤S201、接收DNS服务器提供的目标拉流节点的信息,与目标拉流节点建立第一通信链路。Step S201: Receive information about the target streaming node provided by the DNS server, and establish a first communication link with the target streaming node.
在实际应用中,用户想要播放流媒体数据时,通过拉流客户端访问流媒体数据的域名,拉流客户端向DNS服务器发送对该流媒体数据的域名的解析请求,DNS服务器解析该流媒体数据的域名,并在CDN中选择一个边缘节点作为拉流客户端对应的目标拉流节点,将该目标拉流节点的信息返回给拉流客户端。In practical applications, when users want to play streaming media data, they access the domain name of the streaming media data through the streaming client. The streaming client sends a resolution request for the domain name of the streaming media data to the DNS server, and the DNS server resolves the stream. The domain name of the media data, and selects an edge node in the CDN as the target streaming node corresponding to the streaming client, and returns the information of the target streaming node to the streaming client.
其中,DNS服务器提供的目标拉流节点的信息至少包括目标拉流节点的IP。拉流客户端根据目标拉流节点的IP与目标拉流节点建立通信链路。Among them, the information of the target streaming node provided by the DNS server at least includes the IP of the target streaming node. The streaming client establishes a communication link with the target streaming node based on the IP of the target streaming node.
步骤S202、向目标拉流节点发送第一拉流请求,以使目标拉流节点建立与推流节点间的第二通信链路,第一通信链路和第二通信链路构成用于拉取流媒体数据的主链路。Step S202: Send a first pull request to the target pull node, so that the target pull node establishes a second communication link with the push node. The first communication link and the second communication link constitute a pull request. The main link for streaming data.
在与目标拉流节点建立第一通信链路之后,拉流客户端通过第一通信链路向目标拉流节点发送第一拉流请求。其中,第一拉流请求携带拉流客户端想要拉取的流媒体数据的媒体流信息。目标拉流节点在接收到第一拉流请求后,会解析出媒体流信息,并向CDN的直播中心发送携带该媒体流信息的第一链路请求。直播中心在接收到第一链路请求后,解析出流媒体信息,基于该流媒体信息确定推流节点的信息,并生成目标拉流节点与推流节点间的第二通信链路的信息,将第二通信链路的信息反馈给目标拉流节点。目标拉流节点根据第二通信链路的信息建立与推流节点间的第二通信链路。After establishing the first communication link with the target streaming node, the streaming client sends a first streaming request to the target streaming node through the first communication link. The first streaming request carries the media stream information of the streaming media data that the streaming client wants to pull. After receiving the first pull request, the target streaming node will parse out the media stream information and send the first link request carrying the media stream information to the CDN's live broadcast center. After receiving the first link request, the live broadcast center parses the streaming media information, determines the information of the streaming node based on the streaming media information, and generates the information of the second communication link between the target streaming node and the streaming node, Feed back the information of the second communication link to the target streaming node. The target streaming node establishes a second communication link with the streaming node based on the information of the second communication link.
第一通信链路和第二通信链路构成了拉流客户端与推流节点间的一条用于拉流的链路,作为拉流客户端拉取流媒体数据的主链路。推流客户端与推流节点间的通信链路与该主链路一起,形成了一条“推流客户端→推流节点→目标拉流节点→拉流客户端”这样一条流媒体数据传输的全链路。另外,目标拉流节点与推流节点间的第二通信链路可以不包括中继节点,或者包括至少一个中继节点。The first communication link and the second communication link constitute a link between the pull client and the push node for streaming, and serve as the main link for the pull client to pull streaming media data. The communication link between the push client and the push node, together with the main link, forms a streaming media data transmission path of "push client → push node → target pull node → pull client" Full link. In addition, the second communication link between the target streaming node and the streaming node may not include a relay node, or may include at least one relay node.
在主链路建立之后,拉流客户端即可通过主链路拉取流媒体数据。After the main link is established, the streaming client can pull streaming media data through the main link.
示例性地,以视频直播场景为例,流媒体数据传输主链路的建立流程的框架如图3所示,主播作为直播视频发布者,将所采集的直播视频数据通过推流客户端200发布到CDN中的一个推流节点30上。用户想要观看直播视频时,可以通过拉流客户端100访问直播视频的域名,比如该直播视频的域名为“www.######.com”,拉流客户端100会向DNS 服务器11发起对该直播视频域名的解析请求,DNS服务器11解析该直播视频域名并在CDN中选择一个边缘节点作为拉流客户端100对应的目标拉流节点20,并将该目标拉流节点20的IP返回给拉流客户端100。拉流客户端100根据目标拉流节点20的IP与目标拉流节点20建立第一通信链路。拉流客户端100向目标拉流节点20发送拉流请求。接收到该拉流请求后,目标拉流节点20向直播中心12发送链路请求。直播中心12基于链路请求生成目标拉流节点20与推流节点30间的第二通信链路的信息,将第二通信链路的反馈给目标拉流节点20。目标拉流节点20根据第二通信链路的信息建立与推流节点30间的第二通信链路。目标拉流节点20可以通过第二通信链路从推流节点30拉取直播视频流,并将直播视频流发送给拉流客户端100。拉流客户端100播放直播视频流以供观看者在线观看。Illustratively, taking the video live broadcast scenario as an example, the framework of the establishment process of the streaming media data transmission main link is shown in Figure 3. The anchor, as the live video publisher, publishes the collected live video data through the push streaming client 200 To a push node 30 in the CDN. When a user wants to watch a live video, he can access the domain name of the live video through the streaming client 100. For example, the domain name of the live video is "www.######.com", and the streaming client 100 will request DNS The server 11 initiates a resolution request for the live video domain name. The DNS server 11 parses the live video domain name and selects an edge node in the CDN as the target streaming node 20 corresponding to the streaming client 100, and sets the target streaming node 20 The IP is returned to the streaming client 100. The streaming client 100 establishes a first communication link with the target streaming node 20 according to the IP of the target streaming node 20 . The streaming client 100 sends a streaming request to the target streaming node 20 . After receiving the streaming request, the target streaming node 20 sends a link request to the live broadcast center 12 . The live broadcast center 12 generates the information of the second communication link between the target streaming node 20 and the streaming node 30 based on the link request, and feeds back the information of the second communication link to the target streaming node 20 . The target streaming node 20 establishes a second communication link with the streaming node 30 according to the information of the second communication link. The target streaming node 20 can pull the live video stream from the streaming node 30 through the second communication link, and send the live video stream to the streaming client 100 . The streaming client 100 plays the live video stream for viewers to watch online.
需要说明的是,目标拉流节点20与推流节点30间的第二通信链路可以不包含中继节点、或者包括一个或多个中继节点,图3中以第二通信链路包括一个中继节点40为例进行示例性地说明。It should be noted that the second communication link between the target streaming node 20 and the streaming node 30 may not include a relay node, or may include one or more relay nodes. In FIG. 3 , the second communication link includes one The relay node 40 is taken as an example for illustrative explanation.
步骤S203、接收目标拉流节点发送的备选节点的信息,备选节点的信息是由直播中心确定并发送给目标拉流节点的。Step S203: Receive the information of the candidate nodes sent by the target streaming node. The information of the candidate nodes is determined by the live broadcast center and sent to the target streaming node.
本实施例中,直播中心根据目标拉流节点的请求,可以从CDN的边缘节点中选择一个或多个边缘节点作为备选节点,并将备选节点的信息发送给目标拉流节点,目标拉流节点将备选节点的信息转发给拉流客户端。In this embodiment, the live broadcast center can select one or more edge nodes from the CDN edge nodes as alternative nodes according to the request of the target streaming node, and send the information of the alternative nodes to the target streaming node. The streaming node forwards the information of the alternative nodes to the streaming client.
另外,直播中心选择备选节点时,可以采用与DNS服务器为拉流客户端选择拉流节点的相同的选择策略实现,此处不再赘述。In addition, when the live broadcast center selects alternative nodes, it can adopt the same selection strategy as the DNS server selects the streaming node for the streaming client, which will not be described again here.
步骤S204、根据备选节点的信息,选择至少一个备选节点作为备选拉流节点,与每一备选拉流节点建立第三通信链路。Step S204: Select at least one candidate node as a candidate streaming node according to the information of the candidate nodes, and establish a third communication link with each candidate streaming node.
在接收到备选节点的信息之后,拉流客户端从中选择一个或多个备选节点作为备选拉流节点,与每一备选拉流节点建立通信链路,使得拉流客户端与多个拉流节点建立通信链路,实现拉流客户端与多个拉流节点的多链路的连接方式。After receiving the information of the candidate nodes, the streaming client selects one or more candidate nodes as the candidate streaming nodes, and establishes a communication link with each candidate streaming node, so that the streaming client communicates with multiple streaming nodes. A communication link is established with each streaming node to realize a multi-link connection method between the streaming client and multiple streaming nodes.
一种可能的情况下,拉流客户端只接收到的一个备选节点的信息,该步骤中拉流客户端直接将该备选节点作为备选拉流节点,并与该备选拉流节点建立第三通信链路。In one possible case, the streaming client only receives information about one candidate node. In this step, the streaming client directly uses the candidate node as the candidate streaming node and communicates with the candidate streaming node. Establish a third communication link.
步骤S205、向每一备选拉流节点发送第二拉流请求,以使每一备选拉流节点建立与推流节点间的第四通信链路,第三通信链路和第四通信链路构成拉取流媒体数据的备选链路。Step S205: Send a second streaming request to each candidate streaming node, so that each candidate streaming node establishes a fourth communication link, a third communication link and a fourth communication link with the streaming node. The path constitutes an alternative link for pulling streaming media data.
在与备选拉流节点建立第三通信链路之后,拉流客户端通过第三通信链路向备选拉流节点发送第二拉流请求。其中,第二拉流请求携带拉流客户端想要拉取的流媒体数据的媒体流信息。在接收到第二拉流请求后,备选拉流节点解析出媒体流信息,并向CDN的直播中心发送携带该媒体流信息的第二链路请求。直播中心在接收到第二链路请求后,解析出流媒体信息,基于该流媒体信息确定推流节点的信息,并生成备选拉流节点与推流节点间的第四通信链路的信息,将第四通信链路的信息反馈给备选拉流节点。备选拉流节点根 据第四通信链路的信息建立与推流节点间的第四通信链路。After establishing the third communication link with the candidate streaming node, the streaming client sends a second streaming request to the candidate streaming node through the third communication link. The second pull request carries media stream information of the streaming media data that the pull client wants to pull. After receiving the second streaming request, the alternative streaming node parses out the media stream information and sends a second link request carrying the media stream information to the live broadcast center of the CDN. After receiving the second link request, the live broadcast center parses the streaming media information, determines the information of the streaming node based on the streaming media information, and generates the information of the fourth communication link between the alternative streaming node and the streaming node , feedback the information of the fourth communication link to the candidate streaming node. Alternative pull node root Establish a fourth communication link with the streaming node based on the information of the fourth communication link.
通过第三通信链路和第四通信链路,拉流客户端与推流节点间建立了一条用于拉取流媒体数据的备选链路。推流客户端与推流节点间的通信链路与每一备选链路一起,形成一条“推流客户端→推流节点→备选拉流节点→拉流客户端”这样一条流媒体数据传输的全链路。其中,备选拉流节点与推流节点间的第四通信链路可以不包括中继节点,也可以包括至少一个中继节点。Through the third communication link and the fourth communication link, an alternative link for pulling streaming media data is established between the streaming client and the streaming node. The communication link between the push client and the push node, together with each alternative link, forms a piece of streaming media data such as "push client → push node → alternative pull node → pull client" The entire transmission link. The fourth communication link between the alternative pull node and the push node may not include a relay node, or may include at least one relay node.
在建立备选链路之后,备选链路处于保持连接状态,暂时不用于传输流媒体数据。After the alternative link is established, the alternative link remains connected and is temporarily not used to transmit streaming media data.
步骤S206、当第一通信链路不符合预设条件时,选择一个备选链路切换为主链路,通过切换后的主链路拉取流媒体数据,并将切换前的主链路切换为备选链路。Step S206: When the first communication link does not meet the preset conditions, select an alternative link to switch to the main link, pull streaming media data through the switched main link, and switch the pre-switched main link. as an alternative link.
其中,预设条件用于约束通信链路的质量信息。当通信链路不符合预设条件时,说明该通信链路的质量较差;当通信链路符合预设条件时,说明通信链路的质量较好。Among them, the preset conditions are used to constrain the quality information of the communication link. When the communication link does not meet the preset conditions, it means that the quality of the communication link is poor; when the communication link meets the preset conditions, it means that the quality of the communication link is good.
示例性地,通信链路的质量信息可以是对该通信链路的质量探测结果,或者是基于该通信链路传输流媒体数据的真实情况计算的传输质量指标(如传输质量指标可以包括卡顿率、延迟、丢包率中的至少一项),或者是其他能够衡量通信链路的通信质量的信息。For example, the quality information of the communication link may be a quality detection result of the communication link, or a transmission quality indicator calculated based on the actual situation of the communication link transmitting streaming media data (for example, the transmission quality indicator may include lagging. rate, delay, packet loss rate), or other information that can measure the communication quality of the communication link.
预设条件可以根据具体应用场景中拉流客户端与拉流节点间的通信链路的要求进行设置,不同的应用场景中可以设置不同的预设条件。The preset conditions can be set according to the requirements of the communication link between the streaming client and the streaming node in the specific application scenario. Different preset conditions can be set in different application scenarios.
该步骤中,预设条件用于约束第一通信链路的质量信息。当拉流客户端与目标拉流节点之间的第一通信链路发生抖动、或者网络拥塞等状况,导致第一通信链路不符合预设条件时,可以确定第一通信链路的通信质量较差,不符合当前应用场景对该段通信链路的质量要求,拉流客户端选择一个该段通信链路符合预设条件的备选链路,将该备选链路切换为主链路,通过切换后的主链路拉取流媒体数据。In this step, the preset condition is used to constrain the quality information of the first communication link. When the first communication link between the streaming client and the target streaming node experiences jitter or network congestion, causing the first communication link to fail to meet the preset conditions, the communication quality of the first communication link can be determined. It is poor and does not meet the quality requirements of the communication link in the current application scenario. The streaming client selects an alternative link whose communication link meets the preset conditions and switches the alternative link to the main link. , pulling streaming media data through the switched main link.
在切换主链路之后,拉流客户端将切换前的主链路切换为备选链路,该链路进入保持连接状态,暂不用于流媒体数据的传输。After switching the main link, the streaming client switches the main link before the switch to the alternative link. The link enters the maintained connection state and is not used for the transmission of streaming media data.
需要说明的是,在当前用于拉取流媒体数据的主链路中拉流客户端与拉流节点间的这段链路不符合预设条件时,可以继续进行链路切换,将一个备选链路切换为主链路,将切换前的主链路切换为备选链路。It should be noted that when the link between the streaming client and the streaming node in the main link currently used to pull streaming media data does not meet the preset conditions, link switching can continue and a backup The selected link is switched to the main link, and the main link before switching is switched to the alternative link.
本实施例中,在建立“推流节点→目标拉流节点→拉流客户端”这样一条主链路之后,选择至少一个备选拉流节点,基于每一备选拉流节点建立一条“推流节点→备选拉流节点→拉流客户端”这样的备选链路,当主链路中拉流客户端与目标拉流节点间这段通信链路不符合预设条件时,可以将一条这段通信链路符合预设条件的备选链路切换为主链路,也即,在拉流客户端与一个拉流节点间的通信链路因发生抖动、网络拥塞等状况导致符合预设条件时,可以及时地切换使用另一拉流节点,通过拉流客户端与另一拉流节点间的通信链路进行拉流,能够避免因拉流客户端与拉流节点间的通信链路发生抖动、或网络拥塞造成的卡顿延迟、丢包等,提高了流媒体数据的传输质量和实时性。In this embodiment, after establishing a main link such as "pushing node → target streaming node → streaming client", at least one candidate streaming node is selected, and a "push streaming node" is established based on each candidate streaming node. An alternative link such as "streaming node → alternative streaming node → streaming client", when the communication link between the streaming client in the main link and the target streaming node does not meet the preset conditions, you can add a The alternative link that meets the preset conditions for this communication link is switched to the main link. That is, the communication link between the streaming client and a streaming node meets the preset conditions due to jitter, network congestion, etc. When conditions are met, you can switch to another streaming node in time and pull streams through the communication link between the streaming client and another streaming node, which can avoid the communication link between the streaming client and the streaming node being damaged. The transmission quality and real-time performance of streaming media data are improved due to jitter, delays, packet loss, etc. caused by network congestion.
一种可选实施例中,可以通过配置CDN中的边缘节点的属性信息,使得边缘节点具 有可作为中继节点的属性。这样,在建立通信链路时可选用的中继节点更多,并且两个边缘节点之间可以直接建立通信链路,链路的组合方式更加灵活,能够建立通信质量更好的通信链路。In an optional embodiment, the attribute information of the edge node in the CDN can be configured so that the edge node has Has properties that can serve as relay nodes. In this way, more relay nodes can be selected when establishing communication links, and communication links can be directly established between two edge nodes. The combination of links is more flexible, and communication links with better communication quality can be established.
示例性地,在一种可能的情况下,拉流节点与要建立通信链路的推流节点间的距离很近时,拉流节点直接与推流节点建立的通信链路(不包含中继节点),可能比包含中继节点的通信链路的通信质量更好,此时,拉流节点直接与推流节点建立通信链路。For example, in one possible situation, when the distance between the pull node and the push node to establish a communication link is very close, the pull node directly establishes a communication link (excluding relays) with the push node. node), the communication quality may be better than the communication link containing the relay node. At this time, the pull node directly establishes a communication link with the push node.
例如,如图4所示,边缘节点A为拉流节点20,边缘节点B为拉流节点20要建立通信链路的推流节点30,实线(1)表示边缘节点A与边缘节点B间直接建立的通信链路,该通信链路不包括中继节点。虚线(2)和(3)组成的通信链路为边缘节点A与边缘节点B间的基于传统方式组件的另一通信链路,该通信链路包括中继节点C。当边缘节点A与边缘节点B距离很近时,实线(1)的通信链路优于虚线(2)和(3)组成的通信链路,在拉流节点建立与推流节点间的通信链路时,建立实线(1)所示的通信链路。For example, as shown in Figure 4, edge node A is the pull node 20, and edge node B is the push node 30 that the pull node 20 wants to establish a communication link. The solid line (1) represents the connection between edge node A and edge node B. A directly established communication link that does not include relay nodes. The communication link composed of dotted lines (2) and (3) is another communication link based on traditional components between edge node A and edge node B. This communication link includes a relay node C. When edge node A and edge node B are very close, the communication link of the solid line (1) is better than the communication link composed of the dotted lines (2) and (3). The communication between the pull node and the push node is established. When linking, establish the communication link shown by the solid line (1).
具体地,在备选拉流节点建立与推流节点间的第四通信链路时,可以将CDN中的其他拉流节点或推流节点作为中继节点。Specifically, when the candidate streaming node establishes the fourth communication link with the streaming node, other streaming nodes or streaming nodes in the CDN may be used as relay nodes.
一种可能的情况下,在备选拉流节点与推流节点间的第四通信链路中,可以不包含任何中继节点,以使所建立的备选拉流节点与推流节点间的第四通信链路的质量更好的。In one possible case, the fourth communication link between the candidate streaming node and the streaming node may not include any relay node, so that the established communication link between the candidate streaming node and the streaming node The quality of the fourth communication link is better.
另一种可能的情况下,在各个备选拉流节点与推流节点间的第四通信链路中,可以有至少一个第四通信链路包含中继节点,中继节点中包括CDN中的拉流节点或推流节点。这样,链路的组合方式更加灵活,确定第四通信链路时可选的链路更多,能够提高建立的第四通信链路的质量。In another possible situation, among the fourth communication links between each candidate pull node and the push node, at least one fourth communication link may include a relay node, and the relay node may include a relay node in the CDN. Pull streaming node or push streaming node. In this way, the link combination method is more flexible, more optional links are available when determining the fourth communication link, and the quality of the established fourth communication link can be improved.
再一种可能的情况下,备选拉流节点与推流节点间的第四通信链路包括中继节点,中继节点包括目标拉流节点。这样,在拉流客户端与目标拉流节点间的通信质量较差,但目标拉流节点与推流节点间的第二通信链路的通信质量较好时,拉流客户端可以通过备选拉流节点与目标拉流节点建立通信链路,仍然利用第二通信链路拉取流媒体数据,以提高流媒体数据传输的质量和实时性。In another possible situation, the fourth communication link between the candidate streaming node and the streaming node includes a relay node, and the relay node includes the target streaming node. In this way, when the communication quality between the streaming client and the target streaming node is poor, but the communication quality of the second communication link between the target streaming node and the pushing node is good, the streaming client can use the alternative The streaming node establishes a communication link with the target streaming node, and still uses the second communication link to pull streaming media data to improve the quality and real-time performance of streaming media data transmission.
例如,如图5所示,虚线(4)表示目标拉流节点20与推流节点30间的第二通信链路,虚线(4)和实线(5)构成备选拉流节点40与推流节点30间的第四通信链路。当第一通信链路通信质量较好时,拉流客户端100可以通过(4)和第一通信链路拉取流媒体数据。当第一通信链路通信质量较差时,拉流客户端100可以通过(4)、(5)和第三通信链路拉取流媒体数据。For example, as shown in Figure 5, the dotted line (4) represents the second communication link between the target pull node 20 and the push node 30, and the dotted line (4) and the solid line (5) constitute the candidate pull node 40 and the push node. The fourth communication link between flow nodes 30. When the communication quality of the first communication link is good, the streaming client 100 can pull streaming media data through (4) and the first communication link. When the communication quality of the first communication link is poor, the streaming client 100 can pull streaming media data through (4), (5) and the third communication link.
一种可选实施例中,拉流客户端可以实时地获取第一通信链路和第三通信链路的通信质量信息,以实现对主链路和备选链路中拉流客户端与拉流节点间的这段通信链路的实时质量监测,使得当主链路中这段通信链路的质量较差时,能够及时地切换到这段通信链路质量更好的备选链路,从而提高流媒体数据传输的质量和实时性。In an optional embodiment, the streaming client can obtain the communication quality information of the first communication link and the third communication link in real time, so as to realize the connection between the streaming client and the pulling client in the main link and the alternative link. Real-time quality monitoring of this communication link between flow nodes enables timely switching to an alternative link with better communication link quality when the quality of this communication link in the main link is poor, thereby Improve the quality and real-time performance of streaming media data transmission.
可选地,备选链路处于保持连接状态,并且具有实现质量探测的能力。拉流客户端可 以实时地接收第一通信链路和第三通信链路的质量探测结果,基于质量探测结果和预设条件,拉流客户端可以确定第一通信链路和第三通信链路的通信质量状况。Optionally, the alternative link is in a stay-connected state and has the ability to implement quality detection. The streaming client can To receive the quality detection results of the first communication link and the third communication link in real time, and based on the quality detection results and the preset conditions, the streaming client can determine the communication quality status of the first communication link and the third communication link. .
可选地,拉流客户端可以基于与目标拉流节点间传输数据的真实情况,计算丢包率、延迟等指标信息,作为第一通信链路的通信质量信息。同理,拉流客户端还可以基于与备选拉流节点间传输数据的真实情况,计算丢包率、延迟等指标信息,作为第三通信链路的通信质量信息。Optionally, the streaming client can calculate indicator information such as packet loss rate and delay based on the actual data transmission with the target streaming node as the communication quality information of the first communication link. In the same way, the streaming client can also calculate indicator information such as packet loss rate and delay based on the actual data transmission with the candidate streaming node as the communication quality information of the third communication link.
一种可选地实施例中,第一拉流请求携带媒体流信息、拉流客户端的访问地址及拉流客户端是否支持备份链路的信息。In an optional embodiment, the first streaming request carries media stream information, the access address of the streaming client, and information about whether the streaming client supports backup links.
其中,第一拉流请求携带的媒体流信息用于生成第二通信链路的信息。通过在第一拉流请求中携带媒体流信息,使得目标拉流节点接收到第一拉流请求后,基于媒体流信息向直播中心发送第一链路请求。在接收到第一链路请求后,直播中心会根据媒体流信息生成第二通信链路的信息,并将第二通信链路的信息反馈给目标拉流节点。目标拉流节点接收到第二通信链路的信息后,建立与推流节点的第二通信链路。The media stream information carried in the first pull request is used to generate information on the second communication link. By carrying the media stream information in the first stream pull request, the target stream pull node sends a first link request to the live broadcast center based on the media stream information after receiving the first stream pull request. After receiving the first link request, the live broadcast center will generate the information of the second communication link based on the media stream information, and feed back the information of the second communication link to the target streaming node. After receiving the information of the second communication link, the target streaming node establishes the second communication link with the streaming node.
拉流客户端的访问地址及拉流客户端是否支持备份链路的信息是选择备选节点所依据的信息。通过在第一拉流请求中携带拉流客户端的访问地址及拉流客户端是否支持备份链路的信息,使得目标拉流节点接收到第一拉流请求后,基于拉流客户端是否支持备份链路的信息决定是否向直播中心请求备选节点的信息。若拉流客户端支持备份链路,则目标拉流节点向直播中心发送备选节点请求,使得直播中心向目标拉流节点反馈备选节点的信息。目标拉流节点接收到备选节点的信息后,将备选节点的信发送给拉流客户端。另外,若拉流客户端不支持备份链路,则目标拉流节点不向直播中心发送备选节点请求。The access address of the streaming client and information about whether the streaming client supports backup links are the information based on which candidate nodes are selected. By carrying the access address of the streaming client and information about whether the streaming client supports the backup link in the first streaming request, the target streaming node can, after receiving the first streaming request, perform a request based on whether the streaming client supports backup. The link information determines whether to request alternative node information from the live broadcast center. If the streaming client supports backup links, the target streaming node sends an alternative node request to the live broadcast center, so that the live broadcast center feeds back information about the alternative nodes to the target streaming node. After the target streaming node receives the information of the alternative node, it sends the information of the alternative node to the streaming client. In addition, if the streaming client does not support backup links, the target streaming node will not send an alternative node request to the live broadcast center.
第二拉流请求携带媒体流信息和备份链路标记信息。其中,第二拉流请求携带的媒体流信息用于生成第二通信链路的信息。通过在第二拉流请求中携带媒体流信息,使得备选拉流节点接收到第二拉流请求后,基于媒体流信息向直播中心发送第二链路请求。在接收到第二链路请求后,直播中心会根据媒体流信息生成第四通信链路的信息,并将第四通信链路的信息反馈给备选拉流节点。备选拉流节点接收到第四通信链路的信息后,建立与推流节点的第四通信链路。The second pull request carries media stream information and backup link tag information. The media stream information carried in the second pull request is used to generate information on the second communication link. By carrying the media stream information in the second stream pull request, the candidate stream pull node sends a second link request to the live broadcast center based on the media stream information after receiving the second stream pull request. After receiving the second link request, the live broadcast center will generate the information of the fourth communication link based on the media stream information, and feed back the information of the fourth communication link to the alternative streaming node. After receiving the information of the fourth communication link, the candidate streaming node establishes a fourth communication link with the streaming node.
备份链路标记信息用于告知备选拉流节点即将建立的第四通信链路属于备选链路,无需请求备选节点的信息。The backup link tag information is used to inform the alternative streaming node that the fourth communication link to be established belongs to the alternative link, and there is no need to request information about the alternative node.
通过在向目标拉流节点和备选拉流节点发送的拉流请求中携带不同的信息,使得目标拉流节点具有获取备选节点的信息的能力,备选拉流节点可以正常建立与推流节点间的通信链路,并且不会进行不必要的请求备选节点信息的处理。By carrying different information in the streaming requests sent to the target streaming node and the alternative streaming node, the target streaming node has the ability to obtain the information of the alternative streaming node, and the alternative streaming node can be established and pushed normally. Communication links between nodes without unnecessary processing of requesting alternative node information.
一种可选地实施例中,备选节点的信息可以包括备选节点的访问地址(IP)和选择优先级。In an optional embodiment, the information of the candidate node may include the access address (IP) and selection priority of the candidate node.
其中,备选节点是由直播中心根据备选拉流节点的IP,结合CDN中边缘节点的位置、所属运营商、负载和健康状态等信息中的至少一项,确定与拉流客户端通信质量较好的边 缘节点。选择优先级是指备选节点被选为备选拉流节点的优先级。Among them, the alternative node is determined by the live broadcast center based on the IP of the alternative streaming node, combined with at least one of the information such as the location of the edge node in the CDN, its operator, load and health status, to determine the communication quality with the streaming client. better side edge node. The selection priority refers to the priority of the candidate node selected as the candidate streaming node.
拉流客户端接收到备选节点的信息后,可以基于备选节点的选择优先级,择优选择至少一个备选节点作为备选拉流节点,能够建立更高通信质量的第三通信链路。After receiving the information of the alternative nodes, the streaming client can selectively select at least one alternative node as the alternative streaming node based on the selection priority of the alternative nodes, thereby establishing a third communication link with higher communication quality.
在与每一备选拉流节点建立第三通信链路时,拉流客户端根据每一备选拉流节点的访问地址,与每一备选拉流节点建立第三通信链路。When establishing a third communication link with each candidate streaming node, the streaming client establishes a third communication link with each candidate streaming node based on the access address of each candidate streaming node.
图6为本申请一实施例提供的目标拉流节点执行实时流媒体数据传输方法的流程图。如图6所示,该方法具体步骤如下:Figure 6 is a flow chart of a method for performing real-time streaming media data transmission by a target streaming node provided by an embodiment of the present application. As shown in Figure 6, the specific steps of this method are as follows:
步骤S601、接收拉流客户端发送的第一拉流请求,第一拉流请求携带媒体流信息、拉流客户端的访问地址及是否支持备份链路的信息,其中媒体流信息包含流媒体数据的域名。Step S601: Receive the first streaming request sent by the streaming client. The first streaming request carries media stream information, the access address of the streaming client, and information about whether a backup link is supported, where the media stream information includes the streaming media data. domain name.
其中,第一拉流请求携带的媒体流信息用于生成第二通信链路的信息。The media stream information carried in the first pull request is used to generate information on the second communication link.
拉流客户端的访问地址及拉流客户端是否支持备份链路的信息,用于确定备选节点的信息。The access address of the streaming client and information about whether the streaming client supports backup links are used to determine information about alternative nodes.
接收到第一拉流请求后,目标拉流节点解析第一拉流请求,以获取其中携带的媒体流信息、拉流客户端的访问地址及是否支持备份链路的信息。After receiving the first streaming request, the target streaming node parses the first streaming request to obtain the media stream information carried therein, the access address of the streaming client, and information about whether backup links are supported.
步骤S602、向直播中心发送携带媒体流信息的第一链路请求。Step S602: Send a first link request carrying media stream information to the live broadcast center.
解析到媒体流信息后,目标拉流节点可以向直播中心发送携带媒体流信息的第一链路请求。在接收到第一链路请求后,直播中心会根据媒体流信息生成第二通信链路的信息,并将第二通信链路的信息反馈给目标拉流节点。After parsing the media stream information, the target streaming node can send the first link request carrying the media stream information to the live broadcast center. After receiving the first link request, the live broadcast center will generate the information of the second communication link based on the media stream information, and feed back the information of the second communication link to the target streaming node.
步骤S603、在确定拉流客户端支持备份链路时向直播中心发送备选节点请求,备选节点请求携带流媒体数据的域名和拉流客户端的访问地址。Step S603: When it is determined that the streaming client supports the backup link, an alternative node request is sent to the live broadcast center. The alternative node request carries the domain name of the streaming media data and the access address of the streaming client.
解析到拉流客户端是否支持备份链路的信息后,确定拉流客户端支持备份链路,并解析到拉流客户端的访问地址和媒体流信息中的流媒体数据的域名时,目标拉流节点向直播中心发送备选节点请求。直播中心接收到备选节点请求后,根据流媒体数据的域名和拉流客户端的访问地址,结合CDN中边缘节点的位置、所属运营商、负载和健康状态等信息,选择可以作为目标拉流节点的备选的边缘节点,作为备选节点,并将备选节点的信息反馈给目标拉流节点。After parsing the information about whether the streaming client supports backup links, confirming that the streaming client supports backup links, and parsing the access address of the streaming client and the domain name of the streaming media data in the media streaming information, the target pull stream The node sends an alternative node request to the live broadcast center. After receiving the alternative node request, the live broadcast center selects the target streaming node based on the domain name of the streaming media data and the access address of the streaming client, combined with the location, operator, load and health status of the edge node in the CDN. The alternative edge node is used as an alternative node, and the information of the alternative node is fed back to the target streaming node.
步骤S604、接收直播中心发送的第二通信链路的信息,并根据第二通信链路的信息建立与推流节点的第二通信链路。Step S604: Receive the information of the second communication link sent by the live broadcast center, and establish a second communication link with the streaming node according to the information of the second communication link.
其中,第二通信链路的信息包括第二通信链路的路径信息,具体可以包括第二通信链路中的每一跳节点的地址信息。The information of the second communication link includes path information of the second communication link, and may specifically include address information of each hop node in the second communication link.
目标拉流节点接收到第二通信链路的信息后,根据第二通信链路的信息建立与推流节点的第二通信链路。After receiving the information of the second communication link, the target streaming node establishes a second communication link with the streaming node based on the information of the second communication link.
步骤S605、在接收到直播中心发送的备选节点的信息的情况下,向拉流客户端发送备选节点的信息。Step S605: After receiving the information of the alternative node sent by the live broadcast center, send the information of the alternative node to the streaming client.
目标拉流节点接收到备选节点的信息后,将备选节点的信息发送给拉流客户端,使得 拉流客户端根据备选节点的信息,选择至少一个备选节点作为备选拉流节点,与每一备选拉流节点建立第三通信链路,并向每一备选拉流节点发送第二拉流请求,以使每一备选拉流节点建立与推流节点间的第四通信链路,从而实线至少一条备选链路的建立。After the target streaming node receives the information of the alternative node, it sends the information of the alternative node to the streaming client, so that The streaming client selects at least one candidate node as a candidate streaming node based on the information of the candidate streaming node, establishes a third communication link with each candidate streaming node, and sends a third communication link to each candidate streaming node. The second pull request is to enable each candidate pull node to establish a fourth communication link with the push node, thus solidifying the establishment of at least one candidate link.
本实施例中,目标拉流节点可以向直播中心请求备选节点的信息,并将接收到的备选节点的信息发送给拉流客户端,从而向拉流客户端提供至少一个备选节点,使得拉流客户端从中选与至少一个备选节点作为备选拉流节点,建立第三通信链路,并请求备选拉流节点建立与推流节点的第四通信链路,第三通信链路和第四通信链路一起构成备选链路。当主链路中拉流客户端与目标拉流节点间这段通信链路因发生抖动、网络拥塞等状况导致不符合预设条件时,拉流客户端可以将一条这段通信链路符合预设条件的备选链路切换为主链路,从而及时地切换拉取流媒体数据所用的备选拉流节点,能够避免因拉流客户端与拉流节点间的通信链路发生抖动、或网络拥塞造成的卡顿延迟、丢包等状况,提高了流媒体数据的传输质量和实时性。In this embodiment, the target streaming node can request the information of the alternative nodes from the live broadcast center, and send the received information of the alternative nodes to the streaming client, thereby providing at least one alternative node to the streaming client, causing the streaming client to select at least one candidate node as an alternative streaming node, establish a third communication link, and request the alternative streaming node to establish a fourth communication link with the streaming node, the third communication link The route and the fourth communication link together form an alternative link. When the communication link between the streaming client and the target streaming node in the main link does not meet the preset conditions due to jitter, network congestion, etc., the streaming client can make this communication link meet the preset conditions. The alternative link of the condition is switched to the main link, thereby switching the alternative streaming node used to pull streaming media data in a timely manner, which can avoid jitter or network failure in the communication link between the streaming client and the streaming node. Stuttering delays, packet loss and other conditions caused by congestion improve the transmission quality and real-time performance of streaming media data.
一种可选地实施方式中,第四通信链路包括中继节点,中继节点包括目标拉流节点。In an optional implementation, the fourth communication link includes a relay node, and the relay node includes a target streaming node.
一种可能的情况下,第四通信链路中,目标拉流节点是与备选拉流节点直接连接的中继节点,第四通信链路可以表示为“备选拉流节点←目标拉流节点←…←推流节点”,其中箭头的方向表示拉流时流媒体数据的流向。目标拉流节点与推流节点之间可以不包括中继节点,或者包括至少一个其他中继节点。In a possible situation, in the fourth communication link, the target streaming node is a relay node directly connected to the alternative streaming node. The fourth communication link can be expressed as "alternative streaming node ← target streaming node Node ←…←Push node”, where the direction of the arrow indicates the flow direction of streaming media data when pulling streams. The target pull node and the push node may not include a relay node, or may include at least one other relay node.
作为中继节点,目标拉流节点可以接收备选拉流节点发送的拉流链路建立请求,与备选拉流节点建立通信链路;解析拉流链路建立请求得到其携带的第四通信链路的信息,根据第四通信链路的信息,向第四通信链路中的下一个节点发送拉流链路建立请求,与下一个节点间的通信链路。As a relay node, the target streaming node can receive the streaming link establishment request sent by the alternative streaming node, and establish a communication link with the alternative streaming node; parse the streaming link establishment request to obtain the fourth communication carried by it According to the information of the fourth communication link, a pull link establishment request is sent to the next node in the fourth communication link to establish a communication link with the next node.
具体地,根据第四通信链路信息,目标拉流节点可以确定需要建立连接的下一个节点的信息。在建立第四通信链路时,按照“备选拉流节点→目标拉流节点→…→推流节点”的顺序依次建立相邻两个节点间的通信链路,下一个节点是指“备选拉流节点→目标拉流节点→…→推流节点”链路中按照箭头的方向目标拉流节点的下一个节点,可能是中继节点或者推流节点。Specifically, according to the fourth communication link information, the target streaming node can determine the information of the next node that needs to establish a connection. When establishing the fourth communication link, a communication link between two adjacent nodes is established sequentially in the order of "alternative streaming node → target streaming node → ... → streaming node". The next node refers to the "backup streaming node". Select the next node in the link "Pull Node → Target Pull Node → ... → Push Node" to the target pull node in the direction of the arrow, which may be a relay node or a push node.
这样,目标拉流节点作为了第四通信链路中的中继节点,在拉流客户端与目标拉流节点间的通信链路通信质量较差,但目标拉流节点与推流节点间的第二通信链路的通信质量却很好时,拉流客户端可以通过备选拉流节点与目标拉流节点建立连接,仍然利用通信质量很好的第二通信链路拉取流媒体数据,以建立通信质量更好的第四通信链路。In this way, the target streaming node serves as a relay node in the fourth communication link. The communication quality of the communication link between the streaming client and the target streaming node is poor, but the communication quality between the target streaming node and the pushing node is poor. When the communication quality of the second communication link is very good, the streaming client can establish a connection with the target streaming node through the alternative streaming node, and still use the second communication link with good communication quality to pull streaming media data. To establish a fourth communication link with better communication quality.
图7为本申请一实施例提供的直播中心执行实时流媒体数据传输方法的流程图。本实施例提供的实时流媒体数据传输方法具体可以应用于CDN中的直播中心。如图7所示,该方法具体步骤如下:Figure 7 is a flow chart of a method for transmitting real-time streaming media data by a live broadcast center provided by an embodiment of the present application. The real-time streaming media data transmission method provided in this embodiment can be specifically applied to the live broadcast center in the CDN. As shown in Figure 7, the specific steps of this method are as follows:
步骤S701、接收目标拉流节点发送的第一链路请求和备选节点请求,第一链路请求携带媒体流信息,备选节点请求携带流媒体数据的域名和拉流客户端的访问地址。 Step S701: Receive a first link request and an alternative node request sent by the target streaming node. The first link request carries media stream information, and the alternative node request carries the domain name of the streaming media data and the access address of the streaming client.
步骤S702、当接收到第一链路请求时,根据媒体流信息生成目标拉流节点与推流节点间的第二通信链路的信息,并向目标拉流节点发送第二通信链路的信息。Step S702: When receiving the first link request, generate the information of the second communication link between the target streaming node and the streaming node according to the media stream information, and send the information of the second communication link to the target streaming node. .
在接收到携带媒体流信息的第一链路请求后,直播中心根据媒体流信息生成第二通信链路的信息,并将第二通信链路的信息反馈给目标拉流节点,使得目标拉流节点根据第二通信链路的信息建立与推流节点的第二通信链路。After receiving the first link request carrying media stream information, the live broadcast center generates the information of the second communication link based on the media stream information, and feeds back the information of the second communication link to the target streaming node, so that the target pulls the stream The node establishes a second communication link with the streaming node according to the information of the second communication link.
步骤S703、当接收到备选节点请求时,根据流媒体数据的域名和拉流客户端的访问地址,选取至少一个备选节点,并向目标拉流节点发送备选节点的信息。Step S703: When an alternative node request is received, at least one alternative node is selected based on the domain name of the streaming media data and the access address of the streaming client, and information about the alternative node is sent to the target streaming node.
其中,备选节点的信息至少包括备选节点的访问地址,使得拉流客户端可以根据备选节点的访问地址与备选节点建立通信链路。The information of the candidate node at least includes the access address of the candidate node, so that the streaming client can establish a communication link with the candidate node based on the access address of the candidate node.
在接收到备选节点请求时,直播中心根据流媒体数据的域名和拉流客户端的访问地址,从CDN中选取至少一个可以作为目标拉流节点的备选的边缘节点,作为备选节点,并将备选节点的信息发送给目标拉流节点,以使目标拉流节点将备选节点的信息转发给拉流客户端。拉流客户端接收到备选节点的信息后,会根据备选节点的信息选择至少一个备选节点作为备选拉流节点,与每一备选拉流节点建立第三通信链路,并向每一备选拉流节点发送第二拉流请求,以使每一备选拉流节点建立与推流节点间的第四通信链路,从而实现至少一条备选链路的建立。When receiving the alternative node request, the live broadcast center selects at least one edge node from the CDN that can be an alternative to the target streaming node based on the domain name of the streaming media data and the access address of the streaming client as the alternative node, and Send the information of the alternative node to the target streaming node, so that the target streaming node forwards the information of the alternative node to the streaming client. After receiving the information of the candidate nodes, the streaming client will select at least one candidate node as the candidate streaming node based on the information of the candidate nodes, establish a third communication link with each candidate streaming node, and send Each candidate streaming node sends a second streaming request, so that each candidate streaming node establishes a fourth communication link with the streaming node, thereby achieving the establishment of at least one candidate link.
本实施例中,直播中心具备选择并提供备选节点的信息的功能,使得拉流客户端与备选节点中的至少一个备选拉流节点建立第三通信链路,并请求备选拉流节点建立与推流节点间的第四通信链路,第二通信链路和第四通信链路构成用于拉取流媒体数据的一条备选链路。当主链路中拉流客户端与目标拉流节点间这段通信链路因发生抖动、网络拥塞等状况导致不符合预设条件时,拉流客户端可以将一条这段通信链路符合预设条件的备选链路切换为主链路,从而及时地切换使用备选拉流节点,能够避免因拉流客户端与拉流节点间的通信链路发生抖动、或网络拥塞造成的卡顿延迟、丢包等,提高了流媒体数据的传输质量和实时性。In this embodiment, the live broadcast center has the function of selecting and providing information about alternative nodes, so that the streaming client establishes a third communication link with at least one alternative streaming node among the alternative nodes, and requests the alternative streaming node. The node establishes a fourth communication link with the streaming node, and the second communication link and the fourth communication link constitute an alternative link for pulling streaming media data. When the communication link between the streaming client and the target streaming node in the main link does not meet the preset conditions due to jitter, network congestion, etc., the streaming client can make this communication link meet the preset conditions. The alternative link of the condition is switched to the main link, thereby switching to the alternative streaming node in a timely manner, which can avoid delays caused by jitter in the communication link between the streaming client and the streaming node or network congestion. , packet loss, etc., which improves the transmission quality and real-time performance of streaming media data.
一种可选实施例中,根据流媒体数据的域名和所流客户端的访问地址,选取至少一个备选节点,具体可以采用如下方式实现:In an optional embodiment, at least one candidate node is selected based on the domain name of the streaming media data and the access address of the streaming client. Specifically, it can be implemented in the following manner:
根据拉流客户端的访问地址,以及CDN中边缘节点的位置信息、所属运营商信息、负载信息和健康状态信息,从流媒体数据的域名的调度域覆盖的边缘节点中选择至少一个边缘节点作为备选节点。According to the access address of the streaming client, as well as the location information, operator information, load information and health status information of the edge node in the CDN, at least one edge node is selected as a backup from the edge nodes covered by the scheduling domain of the domain name of the streaming media data. Select node.
具体地,根据流媒体数据的域名可以确定流媒体数据的域名的调度域,进而确定CDN中被该调度域覆盖的边缘节点,在这些边缘节点中,根据拉流客户端的访问地址确定拉流客户端所在的位置和所属运营商,结合CDN中边缘节点的位置信息、所属运营商信息、负载信息和健康状态信息,可以选择与拉流客户端通信质量较好的边缘节点,作为备选节点。Specifically, the scheduling domain of the domain name of the streaming media data can be determined according to the domain name of the streaming media data, and then the edge nodes covered by the scheduling domain in the CDN are determined. Among these edge nodes, the streaming client is determined according to the access address of the streaming client. Based on the location of the client and the operator it belongs to, combined with the location information, operator information, load information and health status information of the edge node in the CDN, the edge node with better communication quality with the streaming client can be selected as an alternative node.
示例性地,在流媒体数据的域名的调度域覆盖的边缘节点中,可以根据拉流客户端的 访问地址可以确定拉流客户端所在的位置和所属运营商,结合CDN中边缘节点的位置信息、所属运营商信息,确定与拉流客户端在同一运营商的同一区域内的边缘节点,再根据负载信息和健康状态信息选择负载较少、健康状态较好的边缘节点,作为备选节点。For example, in the edge node covered by the scheduling domain of the domain name of the streaming media data, the streaming client can be The access address can determine the location and operator of the streaming client. Combined with the location information and operator information of the edge node in the CDN, the edge node in the same area of the same operator as the streaming client is determined, and then based on The load information and health status information select edge nodes with less load and better health status as alternative nodes.
其中,对边缘节点所在区域的划分,可以按照行政区域、城市等进行地域上的划分,或者按照其他方式进行划分,此处不做具体限定。Among them, the area where the edge node is located can be divided geographically according to administrative regions, cities, etc., or in other ways, and there is no specific limit here.
本实施例中,直播中心可以针对拉流客户端就近选择负载较少、健康状态较好的边缘节点作为备选节点,使得拉流客户端与每一备选节点间均可建立通信质量较好的第三通信链路。In this embodiment, the live broadcast center can select an edge node with less load and better health status as an alternative node for the streaming client, so that the communication quality can be established between the streaming client and each alternative node. third communication link.
一种可选实施例中,直播中心向目标拉流节点发送备选节点的信息,具体包括:In an optional embodiment, the live broadcast center sends alternative node information to the target streaming node, which specifically includes:
获取备选节点的访问地址,并根据拉流客户端的访问地址,以及备选节点的位置信息、所属运营商信息、负载信息和健康状态信息,确定备选节点的选择优先级;向目标拉流节点发送备选节点的访问地址和选择优先级。Obtain the access address of the alternative node, and determine the selection priority of the alternative node based on the access address of the streaming client, as well as the location information, operator information, load information and health status information of the alternative node; pull streams to the target The node sends the access address and selection priority of the alternative node.
本实施例中,直播中心可以确定并提供备选节点的选择优先级,使得拉流客户端可以根据备选节点的选择优先级,择优选择备选拉流节点。In this embodiment, the live broadcast center can determine and provide the selection priority of the alternative node, so that the streaming client can selectively select the alternative streaming node according to the selection priority of the alternative node.
一种可选实施例中,直播中心还可以向备选拉流节点提供所需的第四通信链路的信息,以辅助备选拉流节点与推流节点建立第四通信链路。In an optional embodiment, the live broadcast center may also provide the required fourth communication link information to the candidate streaming node to assist the candidate streaming node and the streaming node in establishing the fourth communication link.
具体地,直播中心接收备选拉流节点发送的第二链路请求,第二链路请求携带媒体流信息和备份链路标记信息。直播中心解析第二链路请求可以得到备份链路标记信息时,则可以确定该链路请求所请求的通信链路的信息是用于建立备选链路中的第四通信链路的,无需获取备选节点的信息,只需生成并反馈第四通信链路的信息。Specifically, the live broadcast center receives the second link request sent by the alternative streaming node, and the second link request carries media stream information and backup link mark information. When the live broadcast center parses the second link request and can obtain the backup link tag information, it can determine that the communication link information requested by the link request is used to establish the fourth communication link among the alternative links, without To obtain the information of the alternative node, only the information of the fourth communication link is generated and fed back.
进一步地,直播中心根据媒体流信息生成备选拉流节点与推流节点间的第四通信链路的信息,向备选拉流节点发送第四通信链路的信息。Further, the live broadcast center generates information about the fourth communication link between the candidate streaming node and the streaming node according to the media stream information, and sends the information about the fourth communication link to the candidate streaming node.
通过在备选拉流节点发送的第二链路请求中携带备份链路标记信息,能告知直播中心当前的链路请求是来自于备选拉流节点的请求,所请求的通信链路的信息是用于建立备选链路中的第四通信链路的,直播中心无需反馈备选节点的信息,从而将备选拉流节点与目标拉流节点的链路请求进行区分。By carrying backup link tag information in the second link request sent by the alternative streaming node, the live broadcast center can be informed that the current link request is a request from the alternative streaming node and the requested communication link information It is used to establish the fourth communication link among the alternative links. The live broadcast center does not need to feed back the information of the alternative nodes, so as to distinguish the link requests of the alternative streaming nodes and the target streaming nodes.
一种可选实施例中,可以通过配置CDN中的边缘节点的属性信息,使得边缘节点具有可作为中继节点的属性。这样,在建立通信链路时可选用的中继节点更多,并且两个边缘节点之间可以直接建立通信链路,链路的组合方式更加灵活,能够提高建立的通信链路的质量。In an optional embodiment, the attribute information of the edge node in the CDN can be configured so that the edge node has attributes that can serve as a relay node. In this way, more relay nodes can be selected when establishing communication links, and communication links can be directly established between two edge nodes. The combination of links is more flexible and can improve the quality of the established communication links.
具体地,在根据媒体流信息,生成备选拉流节点与推流节点间的第四通信链路的信息时,直播中心可以根据媒体流信息,将内容分发网络中的拉流节点或推流节点作为可用的中继节点,生成第四通信链路的信息。Specifically, when generating the information of the fourth communication link between the alternative pull node and the push node based on the media flow information, the live broadcast center can, based on the media flow information, use the pull node or the push node in the content distribution network to The node serves as an available relay node and generates information of the fourth communication link.
一种可能的情况下,在生成的第四通信链路的信息中,第四通信链路可以不包含任何中继节点,以确定通信质量更优的第四通信链路。 In one possible case, in the generated information about the fourth communication link, the fourth communication link may not include any relay node, so as to determine the fourth communication link with better communication quality.
另一种可能的情况下,在生成的第四通信链路的信息中,第四通信链路可以包含中继节点,这些中继节点中包括CDN中的拉流节点或推流节点,这样,第四通信链路的组合方式更加灵活,可选的链路更多,能够确定通信质量更优的第四通信链路。In another possible situation, in the generated information of the fourth communication link, the fourth communication link may include relay nodes, and these relay nodes include pull nodes or push nodes in the CDN. In this way, The combination method of the fourth communication link is more flexible, there are more optional links, and the fourth communication link with better communication quality can be determined.
再一种可能的情况下,在生成第四通信链路的信息时,可以将目标拉流节点作为中继节点,建立“备选拉流节点←目标拉流节点←…←推流节点”这样一条第四通信链路。在拉流客户端与目标拉流节点间的通信质量较差,但目标拉流节点与推流节点间的第二通信链路的通信质量却很好时,拉流客户端可以通过备选拉流节点与目标拉流节点建立连接,仍然利用通信质量很好的第二通信链路拉取流媒体数据,以建立通信质量更好的第四通信链路。In another possible situation, when generating the information of the fourth communication link, the target streaming node can be used as a relay node, and "alternative streaming node ← target streaming node ←...← streaming node" can be established like this A fourth communications link. When the communication quality between the pull client and the target pull node is poor, but the communication quality of the second communication link between the target pull node and the push node is good, the pull client can use the alternative pull The streaming node establishes a connection with the target streaming node, and still uses the second communication link with good communication quality to pull streaming media data to establish a fourth communication link with better communication quality.
图8为本申请一实施例提供的实时流媒体数据传输方法的流程图。如图8所示,该方法具体步骤如下:Figure 8 is a flow chart of a real-time streaming media data transmission method provided by an embodiment of the present application. As shown in Figure 8, the specific steps of this method are as follows:
步骤S801、拉流客户端接收DNS服务器提供的目标拉流节点的信息。Step S801: The streaming client receives the information of the target streaming node provided by the DNS server.
步骤S802、拉流客户端与目标拉流节点建立第一通信链路。Step S802: The streaming client establishes a first communication link with the target streaming node.
步骤S803、拉流客户端向目标拉流节点发送第一拉流请求。Step S803: The streaming client sends a first streaming request to the target streaming node.
其中,第一拉流请求携带媒体流信息、拉流客户端的访问地址及是否支持备份链路的信息,媒体流信息包含流媒体数据的域名。The first streaming request carries media stream information, the access address of the streaming client, and information about whether a backup link is supported. The media stream information includes the domain name of the streaming media data.
步骤S804、目标拉流节点向直播中心发送携带媒体流信息的第一链路请求。Step S804: The target streaming node sends a first link request carrying media stream information to the live broadcast center.
其中,第一链路请求携带媒体流信息。Among them, the first link request carries media stream information.
步骤S805、目标拉流节点在确定拉流客户端支持备份链路时向直播中心发送备选节点请求。Step S805: When the target streaming node determines that the streaming client supports the backup link, it sends an alternative node request to the live broadcast center.
其中,备选节点请求携带流媒体数据的域名和拉流客户端的访问地址。Among them, the alternative node requests the domain name carrying the streaming media data and the access address of the streaming client.
步骤S806、当接收到第一链路请求时,直播中心根据媒体流信息生成目标拉流节点与推流节点间的第二通信链路的信息。Step S806: When receiving the first link request, the live broadcast center generates information on the second communication link between the target streaming node and the streaming node according to the media stream information.
步骤S807、直播中心向目标拉流节点发送第二通信链路的信息。Step S807: The live broadcast center sends the information of the second communication link to the target streaming node.
步骤S808、目标拉流节点根据第二通信链路的信息建立与推流节点的第二通信链路,第一通信链路和第二通信链路构成拉取流媒体数据的主链路。Step S808: The target streaming node establishes a second communication link with the streaming node according to the information of the second communication link. The first communication link and the second communication link constitute the main link for pulling streaming media data.
步骤S809、当接收到备选节点请求时,直播中心根据流媒体数据的域名和拉流客户端的访问地址,选取至少一个备选节点。Step S809: When receiving an alternative node request, the live broadcast center selects at least one alternative node based on the domain name of the streaming media data and the access address of the streaming client.
步骤S810、直播中心向目标拉流节点发送备选节点的信息。Step S810: The live broadcast center sends the information of the candidate node to the target streaming node.
步骤S811、目标拉流节点在接收到直播中心发送的备选节点的信息的情况下,向拉流客户端发送备选节点的信息。Step S811: After receiving the information of the alternative node sent by the live broadcast center, the target streaming node sends the information of the alternative node to the streaming client.
步骤S812、拉流客户端根据备选节点的信息,选择至少一个备选节点作为备选拉流节点。Step S812: The streaming client selects at least one candidate node as an alternative streaming node based on the information of the candidate nodes.
步骤S813、拉流客户端与备选拉流节点建立第三通信链路。Step S813: The streaming client establishes a third communication link with the candidate streaming node.
步骤S814、拉流客户端向备选拉流节点发送第二拉流请求。 Step S814: The streaming client sends a second streaming request to the candidate streaming node.
其中,第二拉流请求携带媒体流信息和备份链路标记信息。The second pull request carries media stream information and backup link tag information.
步骤S815、直播中心根据媒体流信息生成备选拉流节点与推流节点间的第四通信链路的信息。Step S815: The live broadcast center generates information about the fourth communication link between the candidate streaming node and the streaming node according to the media stream information.
步骤S816、直播中心向备选拉流节点发送第四通信链路的信息。Step S816: The live broadcast center sends the information of the fourth communication link to the candidate streaming node.
步骤S817、备选拉流节点根据第四通信链路的信息建立与推流节点的第四通信链路,第三通信链路和第四通信链路构成拉取流媒体数据的备选链路。Step S817: The alternative pull node establishes a fourth communication link with the push node based on the information of the fourth communication link. The third communication link and the fourth communication link constitute an alternative link for pulling streaming media data. .
步骤S818、当第一通信链路不符合预设条件时,选择一个备选链路切换为主链路,通过切换后的主链路拉取流媒体数据,并将切换前的主链路切换为备选链路。Step S818: When the first communication link does not meet the preset conditions, select an alternative link to switch to the main link, pull streaming media data through the switched main link, and switch the pre-switched main link. as an alternative link.
本实施例中,各个步骤的具体实现方式参见前述实施例中的内容,此处不再赘述。In this embodiment, the specific implementation of each step can be found in the previous embodiments, and will not be described again here.
图9为本申请实施例提供的一种实时流媒体数据传输装置的结构示意图,本实施例提供的装置应用于拉流客户端,如图9所示,实时流媒体数据传输装置90包括:通信模块91、备选链路建立模块92和链路切换模块93。Figure 9 is a schematic structural diagram of a real-time streaming media data transmission device provided by an embodiment of the present application. The device provided by this embodiment is applied to a streaming client. As shown in Figure 9, the real-time streaming media data transmission device 90 includes: communication Module 91, alternative link establishment module 92 and link switching module 93.
其中,通信模块91用于接收DNS服务器提供的目标拉流节点的信息,与目标拉流节点建立第一通信链路;向目标拉流节点发送第一拉流请求,以使目标拉流节点建立与推流节点间的第二通信链路,第一通信链路和第二通信链路构成用于拉取流媒体数据的主链路;接收目标拉流节点发送的备选节点的信息,备选节点的信息是由直播中心确定并发送给目标拉流节点的。Among them, the communication module 91 is used to receive the information of the target streaming node provided by the DNS server, establish a first communication link with the target streaming node, and send a first streaming request to the target streaming node, so that the target streaming node is established With the second communication link between the streaming node and the first communication link and the second communication link, the first communication link and the second communication link constitute the main link for pulling streaming media data; receiving the information of the alternative node sent by the target streaming node, and preparing The node selection information is determined by the live broadcast center and sent to the target streaming node.
备选链路建立模块92用于根据备选节点的信息,选择至少一个备选节点作为备选拉流节点,与每一备选拉流节点建立第三通信链路。The alternative link establishment module 92 is configured to select at least one candidate node as an alternative streaming node according to the information of the candidate node, and establish a third communication link with each candidate streaming node.
通信模块91还用于向每一备选拉流节点发送第二拉流请求,以使每一备选拉流节点建立与推流节点间的第四通信链路,第三通信链路和第四通信链路构成拉取流媒体数据的备选链路。The communication module 91 is also configured to send a second streaming request to each candidate streaming node, so that each candidate streaming node establishes a fourth communication link with the streaming node, the third communication link and the third communication link. Four communication links constitute alternative links for pulling streaming media data.
链路切换模块93用于当第一通信链路不符合预设条件时,选择一个备选链路切换为主链路,通过切换后的主链路拉取流媒体数据,并将切换前的主链路切换为备选链路。The link switching module 93 is used to select an alternative link to switch to the main link when the first communication link does not meet the preset conditions, pull streaming media data through the switched main link, and transfer the pre-switched link to the main link. The primary link is switched to the backup link.
一种可选实施例中,至少一个第四通信链路包括中继节点,中继节点包括内容分发网络中的拉流节点或推流节点。In an optional embodiment, at least one fourth communication link includes a relay node, and the relay node includes a pull node or a push node in the content distribution network.
一种可选实施例中,中继节点包括目标拉流节点。In an optional embodiment, the relay node includes a target streaming node.
一种可选实施例中,通信模块还用于实时获取第一通信链路和第三通信链路的通信质量信息。In an optional embodiment, the communication module is also configured to obtain communication quality information of the first communication link and the third communication link in real time.
一种可选实施例中,第一拉流请求携带媒体流信息、拉流客户端的访问地址及拉流客户端是否支持备份链路的信息;第二拉流请求携带媒体流信息和备份链路标记信息。In an optional embodiment, the first streaming request carries media stream information, the access address of the streaming client, and information about whether the streaming client supports backup links; the second streaming request carries media stream information and backup links. Tag information.
一种可选实施例中,备选节点的信息包括备选节点的访问地址和选择优先级,In an optional embodiment, the information of the candidate node includes the access address and selection priority of the candidate node,
在实现根据备选节点的信息,选择至少一个备选节点作为备选拉流节点时,备选链路建立模块还用于:根据备选节点的选择优先级,选择至少一个备选节点作为备选拉流节点。When implementing the method of selecting at least one candidate node as an alternative streaming node based on the information of the candidate node, the alternative link establishment module is also used to: select at least one candidate node as a backup node based on the selection priority of the candidate node. Select the streaming node.
在实现与每一备选拉流节点建立第三通信链路时,备选拉流节点确定模块还用于:根 据每一备选拉流节点的访问地址,与每一备选拉流节点建立第三通信链路。When establishing the third communication link with each candidate streaming node, the candidate streaming node determination module is also used to: root According to the access address of each candidate streaming node, a third communication link is established with each candidate streaming node.
本实施例提供的装置具体可以用于执行上述任一方法实施例中拉流客户端所执行的方案,具体功能和所能实现的技术效果此处不再赘述。The device provided in this embodiment can be specifically used to execute the solution executed by the streaming client in any of the above method embodiments. The specific functions and technical effects that can be achieved will not be described again here.
图10为本申请另一实施例提供的一种实时流媒体数据传输装置的结构示意图,本实施例提供的装置应用于目标拉流节点,如图10所示,实时流媒体数据传输装置1000包括:通信模块1001、备选节点请求模块1002和链路建立模块1003。Figure 10 is a schematic structural diagram of a real-time streaming media data transmission device provided by another embodiment of the present application. The device provided by this embodiment is applied to the target streaming node. As shown in Figure 10, the real-time streaming media data transmission device 1000 includes : Communication module 1001, alternative node request module 1002 and link establishment module 1003.
通信模块1001用于接收拉流客户端发送的第一拉流请求,第一拉流请求携带媒体流信息、拉流客户端的访问地址及是否支持备份链路的信息,其中媒体流信息包含流媒体数据的域名。The communication module 1001 is configured to receive a first streaming request sent by a streaming client. The first streaming request carries media stream information, the access address of the streaming client, and information about whether a backup link is supported, where the media stream information includes streaming media. The domain name of the data.
通信模块1001还用于向直播中心发送携带媒体流信息的第一链路请求。The communication module 1001 is also used to send a first link request carrying media stream information to the live broadcast center.
备选节点请求模块1002用于在确定拉流客户端支持备份链路时向直播中心发送备选节点请求,备选节点请求携带流媒体数据的域名和拉流客户端的访问地址。The alternative node request module 1002 is configured to send an alternative node request to the live broadcast center when it is determined that the streaming client supports the backup link. The alternative node request carries the domain name of the streaming media data and the access address of the streaming client.
通信模块1001还用于接收直播中心发送的第二通信链路的信息。The communication module 1001 is also used to receive the information of the second communication link sent by the live broadcast center.
链路建立模块1003用于根据第二通信链路的信息建立与推流节点间的第二通信链路。The link establishment module 1003 is configured to establish a second communication link with the streaming node according to the information of the second communication link.
通信模块1001还用于在接收到直播中心发送的备选节点的信息的情况下,向拉流客户端发送备选节点的信息。The communication module 1001 is also configured to send the information of the alternative node to the streaming client after receiving the information of the alternative node sent by the live broadcast center.
一种可选实施例中,通信模块还用于接收备选拉流节点发送的拉流链路建立请求,拉流链路建立请求携带备选拉流节点与推流节点间的第四通信链路的信息,第四通信链路包括中继节点,中继节点包括目标拉流节点;In an optional embodiment, the communication module is also configured to receive a pull link establishment request sent by the alternative pull node, where the pull link establishment request carries a fourth communication link between the alternative pull node and the push node. The fourth communication link includes a relay node, and the relay node includes a target streaming node;
链路建立模块还用于:与备选拉流节点建立通信链路。The link establishment module is also used to establish communication links with alternative streaming nodes.
通信模块还用于根据第四通信链路的信息,向第四通信链路中的下一个节点发送拉流链路建立请求。The communication module is also configured to send a pull link establishment request to the next node in the fourth communication link according to the information of the fourth communication link.
链路建立模块还用于:与下一个节点建立通信链路。The link establishment module is also used to establish a communication link with the next node.
本实施例提供的装置具体可以用于执行上述任一方法实施例中目标拉流节点所执行的方案,具体功能和所能实现的技术效果此处不再赘述。The device provided in this embodiment can be specifically used to execute the solution executed by the target streaming node in any of the above method embodiments. The specific functions and achievable technical effects will not be described again here.
图11为本申请另一实施例提供的一种实时流媒体数据传输装置的结构示意图,本实施例提供的装置应用于CDN的直播中心,如图11所示,实时流媒体数据传输装置1100包括:通信模块1101、链路信息生成模块1102和备选节点确定模块1103。Figure 11 is a schematic structural diagram of a real-time streaming media data transmission device provided by another embodiment of the present application. The device provided by this embodiment is applied to the live broadcast center of a CDN. As shown in Figure 11, the real-time streaming media data transmission device 1100 includes : Communication module 1101, link information generation module 1102 and candidate node determination module 1103.
通信模块1101用于接收目标拉流节点发送的第一链路请求和备选节点请求,第一链路请求携带媒体流信息,备选节点请求携带流媒体数据的域名和拉流客户端的访问地址。The communication module 1101 is used to receive a first link request and an alternative node request sent by the target streaming node. The first link request carries media stream information, and the alternative node request carries the domain name of the streaming media data and the access address of the streaming client. .
链路信息生成模块1102用于当接收到第一链路请求时,根据媒体流信息生成目标拉流节点与推流节点间的第二通信链路的信息。The link information generation module 1102 is configured to, when receiving the first link request, generate information on the second communication link between the target pull node and the push node according to the media stream information.
通信模块1101还用于向目标拉流节点发送第二通信链路的信息。The communication module 1101 is also used to send the information of the second communication link to the target streaming node.
备选节点确定模块1103用于当接收到备选节点请求时,根据流媒体数据的域名和拉流客户端的访问地址,选取至少一个备选节点。 The alternative node determination module 1103 is configured to, when receiving an alternative node request, select at least one alternative node based on the domain name of the streaming media data and the access address of the streaming client.
通信模块1101还用于向目标拉流节点发送备选节点的信息。The communication module 1101 is also used to send information about alternative nodes to the target streaming node.
一种可选实施例中,在实现根据流媒体数据的域名和所流客户端的访问地址,选取至少一个备选节点时,备选节点确定模块还用于:In an optional embodiment, when selecting at least one alternative node based on the domain name of the streaming media data and the access address of the streaming client, the alternative node determination module is also used to:
根据拉流客户端的访问地址,以及内容分发网络中边缘节点的位置信息、所属运营商信息、负载信息和健康状态信息,从流媒体数据的域名的调度域覆盖的边缘节点中选择多个边缘节点作为备选节点。According to the access address of the streaming client, as well as the location information, operator information, load information and health status information of the edge nodes in the content distribution network, multiple edge nodes are selected from the edge nodes covered by the scheduling domain of the domain name of the streaming media data. as an alternative node.
一种可选实施例中,备选节点确定模块1103还用于获取备选节点的访问地址,并根据拉流客户端的访问地址,以及备选节点的位置信息、所属运营商信息、负载信息和健康状态信息,确定备选节点的选择优先级。In an optional embodiment, the alternative node determination module 1103 is also used to obtain the access address of the alternative node, and based on the access address of the streaming client, as well as the location information, operator information, load information and Health status information determines the selection priority of alternative nodes.
在实现向目标拉流节点发送备选节点的信息时,包括:When implementing information about sending alternative nodes to the target streaming node, it includes:
通信模块1101还用于向目标拉流节点发送备选节点的访问地址和选择优先级。The communication module 1101 is also used to send the access address and selection priority of the alternative node to the target streaming node.
一种可选实施例中,通信模块还用于接收备选拉流节点发送的第二链路请求,第二链路请求携带媒体流信息和备份链路标记信息。In an optional embodiment, the communication module is also configured to receive a second link request sent by the alternative streaming node, where the second link request carries media stream information and backup link tag information.
链路信息生成模块还用于根据媒体流信息,生成备选拉流节点与推流节点间的第四通信链路的信息,向备选拉流节点发送第四通信链路的信息。The link information generation module is also configured to generate information on a fourth communication link between the candidate streaming node and the streaming node based on the media stream information, and send the information on the fourth communication link to the candidate streaming node.
一种可选实施例中,在实现根据媒体流信息,生成备选拉流节点与推流节点间的第四通信链路的信息时,链路信息生成模块还用于:In an optional embodiment, when generating information about the fourth communication link between the alternative pull node and the push node based on the media stream information, the link information generation module is also used to:
根据媒体流信息,将内容分发网络中的拉流节点或推流节点作为可用的中继节点,生成第四通信链路的信息。According to the media stream information, the pull node or the push node in the content distribution network is used as an available relay node to generate information of the fourth communication link.
一种可选实施例中,在实现根据媒体流信息,生成备选拉流节点与推流节点间的第四通信链路的信息时,链路信息生成模块还用于:In an optional embodiment, when generating information about the fourth communication link between the alternative pull node and the push node based on the media stream information, the link information generation module is also used to:
根据媒体流信息,将目标拉流节点作为中继节点,生成第四通信链路的信息。According to the media stream information, the target streaming node is used as a relay node to generate information of the fourth communication link.
本实施例提供的装置具体可以用于执行上述任一方法实施例中直播中心所执行的方案,具体功能和所能实现的技术效果此处不再赘述。The device provided in this embodiment can be specifically used to execute the solution executed by the live broadcast center in any of the above method embodiments. The specific functions and the technical effects that can be achieved will not be described again here.
本申请还提供用于实现实时流媒体数据传输得到电子设备,包括装载有拉流客户端的设备、CDN中作为目标拉流节点的边缘节点、或者CDN的直播中心。This application also provides electronic equipment for realizing real-time streaming data transmission, including equipment loaded with streaming clients, edge nodes in CDN as target streaming nodes, or CDN live broadcast centers.
本申请提供一种装载有拉流客户端的设备,包括:处理器,以及与处理器通信连接的存储器,存储器存储计算机执行指令;处理器执行存储器存储的计算机执行指令,以实现上述任一方法实施例中拉流客户端所执行的方案,具体功能和所能实现的技术效果此处不再赘述。This application provides a device loaded with a streaming client, including: a processor, and a memory communicatively connected to the processor. The memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement any of the above methods. The solution implemented by the streaming client in the example, the specific functions and the technical effects it can achieve will not be described again here.
本申请提供一种边缘节点,包括:处理器,以及与处理器通信连接的存储器,存储器存储计算机执行指令;处理器执行存储器存储的计算机执行指令,以实现上述任一方法实施例中目标拉流节点所执行的方案,具体功能和所能实现的技术效果此处不再赘述。This application provides an edge node, including: a processor, and a memory communicatively connected to the processor. The memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to achieve the target flow in any of the above method embodiments. The solutions implemented by the nodes, the specific functions and the technical effects that can be achieved will not be described again here.
本申请提供一种直播中心,包括:处理器,以及与处理器通信连接的存储器,存储器存储计算机执行指令;处理器执行存储器存储的计算机执行指令,以实现上述任一方法实 施例中直播中心所执行的方案,具体功能和所能实现的技术效果此处不再赘述。This application provides a live broadcast center, including: a processor, and a memory communicatively connected to the processor. The memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement any of the above methods. The solution implemented by the live broadcast center in the embodiment, the specific functions and the technical effects that can be achieved will not be described again here.
本申请还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机执行指令,计算机执行指令被处理器执行时用于实现上述任一方法实施例中拉流客户端、目标拉流节点、或者直播中心所执行的方案,具体功能和所能实现的技术效果此处不再赘述。This application also provides a computer-readable storage medium. Computer-executable instructions are stored in the computer-readable storage medium. When executed by the processor, the computer-executable instructions are used to implement the streaming client and target streaming in any of the above method embodiments. The solutions implemented by nodes or live broadcast centers, the specific functions and the technical effects that can be achieved will not be described again here.
本申请还提供了一种计算机程序产品,计算机程序产品包括:计算机程序,计算机程序存储在可读存储介质中,电子设备的至少一个处理器可以从可读存储介质读取计算机程序,至少一个处理器执行计算机程序使得电子设备执行上述任一方法实施例中拉流客户端、目标拉流节点、或者直播中心所执行的方案,具体功能和所能实现的技术效果此处不再赘述,具体功能和所能实现的技术效果此处不再赘述。This application also provides a computer program product. The computer program product includes: a computer program. The computer program is stored in a readable storage medium. At least one processor of the electronic device can read the computer program from the readable storage medium. At least one processor The computer program is executed by the computer so that the electronic device executes the solution executed by the streaming client, the target streaming node, or the live broadcast center in any of the above method embodiments. The specific functions and the technical effects that can be achieved will not be described in detail here. The specific functions And the technical effects that can be achieved will not be repeated here.
另外,在上述实施例及附图中的描述的一些流程中,包含了按照特定顺序出现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,仅仅是用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。需要说明的是,本文中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。“多个”的含义是两个以上,除非另有明确具体的限定。In addition, some of the processes described in the above embodiments and drawings include multiple operations that appear in a specific order, but it should be clearly understood that these operations may not be performed in the order in which they appear in this document or may be performed in parallel. , is only used to distinguish different operations, and the sequence number itself does not represent any execution order. Additionally, these processes may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent the order, nor do they limit "first" and "second" are different types. "Plural" means more than two, unless otherwise clearly and specifically limited.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求书指出。Other embodiments of the present application will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary technical means in the technical field that are not disclosed in this application. . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求书来限制。 It is to be understood that the present application is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (16)

  1. 一种实时流媒体数据传输方法,其特征在于,应用于拉流客户端,包括:A real-time streaming media data transmission method, which is characterized in that it is applied to the streaming client and includes:
    接收DNS服务器提供的目标拉流节点的信息,与所述目标拉流节点建立第一通信链路;Receive the information of the target streaming node provided by the DNS server, and establish a first communication link with the target streaming node;
    向所述目标拉流节点发送第一拉流请求,以使所述目标拉流节点建立与推流节点间的第二通信链路,所述第一通信链路和所述第二通信链路构成用于拉取流媒体数据的主链路;Send a first pull request to the target pull node, so that the target pull node establishes a second communication link with the push node, the first communication link and the second communication link Constitute the main link used to pull streaming media data;
    接收所述目标拉流节点发送的备选节点的信息,所述备选节点的信息是由直播中心确定并发送给所述目标拉流节点的;Receive information about alternative nodes sent by the target streaming node, where the information about the alternative nodes is determined by the live broadcast center and sent to the target streaming node;
    根据所述备选节点的信息,选择至少一个备选节点作为备选拉流节点,与每一所述备选拉流节点建立第三通信链路;According to the information of the candidate nodes, select at least one candidate node as an alternative streaming node, and establish a third communication link with each of the candidate streaming nodes;
    向每一所述备选拉流节点发送第二拉流请求,以使每一所述备选拉流节点建立与推流节点间的第四通信链路,所述第三通信链路和所述第四通信链路构成拉取流媒体数据的备选链路;Send a second streaming request to each of the candidate streaming nodes, so that each of the candidate streaming nodes establishes a fourth communication link with the streaming node, and the third communication link and the streaming node are The fourth communication link constitutes an alternative link for pulling streaming media data;
    当所述第一通信链路不符合预设条件时,选择一个备选链路切换为主链路,通过切换后的主链路拉取流媒体数据,并将切换前的主链路切换为备选链路。When the first communication link does not meet the preset conditions, select an alternative link to switch to the main link, pull streaming media data through the switched main link, and switch the pre-switched main link to Alternative link.
  2. 根据权利要求1所述的方法,其特征在于,至少一个所述第四通信链路包括中继节点,所述中继节点包括内容分发网络中的拉流节点或推流节点。The method according to claim 1, characterized in that at least one of the fourth communication links includes a relay node, and the relay node includes a pull node or a push node in a content distribution network.
  3. 根据权利要求2所述的方法,其特征在于,所述中继节点包括所述目标拉流节点。The method according to claim 2, characterized in that the relay node includes the target streaming node.
  4. 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:
    实时获取所述第一通信链路和所述第三通信链路的通信质量信息。Communication quality information of the first communication link and the third communication link is obtained in real time.
  5. 根据权利要求1的方法,其特征在于,所述第一拉流请求携带媒体流信息、所述拉流客户端的访问地址及所述拉流客户端是否支持备份链路的信息;The method according to claim 1, characterized in that the first streaming request carries media stream information, the access address of the streaming client, and information about whether the streaming client supports a backup link;
    所述第二拉流请求携带媒体流信息和备份链路标记信息。The second pull request carries media stream information and backup link tag information.
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,所述备选节点的信息包括所述备选节点的访问地址和选择优先级,The method according to any one of claims 1-5, characterized in that the information of the candidate node includes the access address and selection priority of the candidate node,
    所述根据所述备选节点的信息,选择至少一个备选节点作为备选拉流节点,包括:Selecting at least one alternative node as an alternative streaming node based on the information of the alternative node includes:
    根据所述备选节点的选择优先级,选择至少一个备选节点作为备选拉流节点;Select at least one alternative node as an alternative streaming node according to the selection priority of the alternative node;
    所述与每一所述备选拉流节点建立第三通信链路,包括:The establishing a third communication link with each of the candidate streaming nodes includes:
    根据每一所述备选拉流节点的访问地址,与每一所述备选拉流节点建立第三通信链路。Establish a third communication link with each candidate streaming node according to the access address of each candidate streaming node.
  7. 一种实时流媒体数据传输方法,其特征在于,应用于目标拉流节点,包括:A real-time streaming media data transmission method, which is characterized in that it is applied to the target streaming node and includes:
    接收拉流客户端发送的第一拉流请求,所述第一拉流请求携带媒体流信息、拉流客户端的访问地址及是否支持备份链路的信息,其中所述媒体流信息包含流媒体数据的域名;Receive the first streaming request sent by the streaming client. The first streaming request carries media stream information, the access address of the streaming client, and information about whether a backup link is supported, where the media stream information includes streaming media data. domain name;
    向直播中心发送携带所述媒体流信息的第一链路请求,并在确定所述拉流客户端支持备份链路时向直播中心发送备选节点请求,所述备选节点请求携带流媒体数据的域名和拉流客户端的访问地址; Send a first link request carrying the media stream information to the live broadcast center, and when it is determined that the streaming client supports the backup link, send an alternative node request to the live broadcast center, and the alternative node request carries streaming media data The domain name and the access address of the streaming client;
    接收直播中心发送的第二通信链路的信息,并根据所述第二通信链路的信息建立与推流节点间的第二通信链路;Receive the information of the second communication link sent by the live broadcast center, and establish a second communication link with the streaming node based on the information of the second communication link;
    在接收到直播中心发送的备选节点的信息的情况下,向所述拉流客户端发送所述备选节点的信息。After receiving the information of the alternative node sent by the live broadcast center, the information of the alternative node is sent to the streaming client.
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述第二通信链路的信息建立与推流节点的第二通信链路之后,还包括:The method according to claim 7, characterized in that after establishing the second communication link with the streaming node according to the information of the second communication link, it further includes:
    接收备选拉流节点发送的拉流链路建立请求,所述拉流链路建立请求携带所述备选拉流节点与推流节点间的第四通信链路的信息,所述第四通信链路包括中继节点,所述中继节点包括所述目标拉流节点;Receive a streaming link establishment request sent by an alternative streaming node. The streaming link establishment request carries information about a fourth communication link between the alternative streaming node and the streaming node. The fourth communication The link includes a relay node, and the relay node includes the target streaming node;
    与所述备选拉流节点建立通信链路;Establish a communication link with the alternative streaming node;
    根据所述第四通信链路的信息,向所述第四通信链路中的下一个节点发送拉流链路建立请求;According to the information of the fourth communication link, send a pull link establishment request to the next node in the fourth communication link;
    与所述下一个节点建立通信链路。Establish a communication link with the next node.
  9. 一种实时流媒体数据传输方法,其特征在于,应用于直播中心,包括:A real-time streaming media data transmission method, characterized in that it is applied to a live broadcast center and includes:
    接收目标拉流节点发送的第一链路请求和备选节点请求,所述第一链路请求携带媒体流信息,所述备选节点请求携带流媒体数据的域名和拉流客户端的访问地址;Receive a first link request and an alternative node request sent by the target streaming node, the first link request carries media stream information, and the alternative node request carries the domain name of the streaming media data and the access address of the streaming client;
    当接收到所述第一链路请求时,根据所述媒体流信息生成所述目标拉流节点与推流节点间的第二通信链路的信息,并向所述目标拉流节点发送所述第二通信链路的信息;When the first link request is received, information on the second communication link between the target streaming node and the streaming node is generated according to the media stream information, and the information is sent to the target streaming node. Information on the second communication link;
    当接收到所述备选节点请求时,根据所述流媒体数据的域名和拉流客户端的访问地址,选取至少一个备选节点,并向所述目标拉流节点发送所述备选节点的信息。When receiving the alternative node request, select at least one alternative node based on the domain name of the streaming media data and the access address of the streaming client, and send the information of the alternative node to the target streaming node. .
  10. 根据权利要求9所述的方法,其特征在于,所述根据所述流媒体数据的域名和所流客户端的访问地址,选取至少一个备选节点,包括:The method according to claim 9, characterized in that selecting at least one candidate node based on the domain name of the streaming media data and the access address of the streaming client includes:
    根据所述拉流客户端的访问地址,以及内容分发网络中边缘节点的位置信息、所属运营商信息、负载信息和健康状态信息中的至少一项,从所述流媒体数据的域名的调度域覆盖的边缘节点中选择至少一个边缘节点作为备选节点。According to the access address of the streaming client and at least one of the location information of the edge node in the content distribution network, operator information, load information and health status information, the scheduling domain coverage of the domain name of the streaming media data is Select at least one edge node from the edge nodes as a candidate node.
  11. 根据权利要求10所述的方法,其特征在于,所述向所述目标拉流节点发送所述备选节点的信息,包括:The method according to claim 10, characterized in that said sending the information of the candidate node to the target streaming node includes:
    获取所述备选节点的访问地址,并根据所述拉流客户端的访问地址,以及所述备选节点的位置信息、所属运营商信息、负载信息和健康状态信息,确定所述备选节点的选择优先级;Obtain the access address of the alternative node, and determine the access address of the alternative node based on the access address of the streaming client and the location information, operator information, load information and health status information of the alternative node. Select priority;
    向所述目标拉流节点发送所述备选节点的访问地址和选择优先级。Send the access address and selection priority of the candidate node to the target streaming node.
  12. 根据权利要求9-11中任一项所述的方法,其特征在于,还包括:The method according to any one of claims 9-11, further comprising:
    接收备选拉流节点发送的第二链路请求,所述第二链路请求携带媒体流信息和备份链路标记信息;Receive a second link request sent by the alternative streaming node, where the second link request carries media stream information and backup link tag information;
    根据所述媒体流信息,生成所述备选拉流节点与推流节点间的第四通信链路的信息, 向所述备选拉流节点发送所述第四通信链路的信息。Generate information on the fourth communication link between the candidate streaming node and the streaming node according to the media stream information, Send the information of the fourth communication link to the candidate streaming node.
  13. 根据权利要求12所述的方法,其特征在于,所述根据所述媒体流信息,生成所述备选拉流节点与推流节点间的第四通信链路的信息,包括:The method according to claim 12, wherein generating, according to the media stream information, information about the fourth communication link between the candidate streaming node and the streaming node includes:
    根据所述媒体流信息,将内容分发网络中的拉流节点或推流节点作为可用的中继节点,生成所述第四通信链路的信息。According to the media stream information, the pull node or the push node in the content distribution network is used as an available relay node to generate the information of the fourth communication link.
  14. 根据权利要求13所述的方法,其特征在于,所述根据所述媒体流信息,生成所述备选拉流节点与推流节点间的第四通信链路的信息,包括:The method according to claim 13, characterized in that generating information about the fourth communication link between the candidate streaming node and the streaming node according to the media stream information includes:
    根据所述媒体流信息,将所述目标拉流节点作为中继节点,生成所述第四通信链路的信息。According to the media stream information, the target streaming node is used as a relay node to generate information of the fourth communication link.
  15. 一种电子设备,其特征在于,包括:处理器,以及与所述处理器通信连接的存储器;An electronic device, characterized by comprising: a processor, and a memory communicatively connected to the processor;
    所述存储器存储计算机执行指令;The memory stores computer execution instructions;
    所述处理器执行所述存储器存储的计算机执行指令,以实现如权利要求1-14中任一项所述的方法。The processor executes computer-executable instructions stored in the memory to implement the method according to any one of claims 1-14.
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,所述计算机执行指令被处理器执行时用于实现如权利要求1-14中任一项所述的方法。 A computer-readable storage medium, characterized in that computer-executable instructions are stored in the computer-readable storage medium, and when executed by a processor, the computer-executable instructions are used to implement any one of claims 1-14. method described.
PCT/CN2023/095623 2022-05-23 2023-05-22 Real-time streaming media data transmission method and device, and storage medium WO2023226949A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210567651.3 2022-05-23
CN202210567651.3A CN115002083B (en) 2022-05-23 2022-05-23 Method, equipment and storage medium for transmitting real-time streaming media data

Publications (1)

Publication Number Publication Date
WO2023226949A1 true WO2023226949A1 (en) 2023-11-30

Family

ID=83027219

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/095623 WO2023226949A1 (en) 2022-05-23 2023-05-22 Real-time streaming media data transmission method and device, and storage medium

Country Status (2)

Country Link
CN (1) CN115002083B (en)
WO (1) WO2023226949A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002083B (en) * 2022-05-23 2024-04-02 阿里巴巴(中国)有限公司 Method, equipment and storage medium for transmitting real-time streaming media data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331642A (en) * 2016-08-31 2017-01-11 浙江大华技术股份有限公司 Method and device for processing data in video cloud system
CN112218100A (en) * 2019-07-09 2021-01-12 阿里巴巴集团控股有限公司 Content distribution network, data processing method, device, equipment and storage medium
CN112752115A (en) * 2020-12-29 2021-05-04 广州博冠信息科技有限公司 Live broadcast data transmission method, device, equipment and medium
US20210368239A1 (en) * 2018-05-14 2021-11-25 Wangsu Science & Technology Co., Ltd. Distributing method, system, edge node, and central scheduling system for streaming media resource
CN115002083A (en) * 2022-05-23 2022-09-02 阿里巴巴(中国)有限公司 Method, equipment and storage medium for transmitting real-time streaming media data

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8452886B2 (en) * 2008-12-04 2013-05-28 Microsoft Corporation Peer-to-peer packet scheduling algorithm
CA2773342A1 (en) * 2012-03-30 2013-09-30 Disternet Technology, Inc. System and method for managing streaming services
CN106850581B (en) * 2017-01-04 2020-06-23 网宿科技股份有限公司 Distribution backup method, system and server for interactive live broadcast streaming media data
CN109041262B (en) * 2018-08-23 2020-06-16 Oppo广东移动通信有限公司 Data transmission method and related device
CN113364587A (en) * 2021-06-29 2021-09-07 中国电信股份有限公司 System, method, device, medium and equipment for processing streaming media data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331642A (en) * 2016-08-31 2017-01-11 浙江大华技术股份有限公司 Method and device for processing data in video cloud system
US20210368239A1 (en) * 2018-05-14 2021-11-25 Wangsu Science & Technology Co., Ltd. Distributing method, system, edge node, and central scheduling system for streaming media resource
CN112218100A (en) * 2019-07-09 2021-01-12 阿里巴巴集团控股有限公司 Content distribution network, data processing method, device, equipment and storage medium
CN112752115A (en) * 2020-12-29 2021-05-04 广州博冠信息科技有限公司 Live broadcast data transmission method, device, equipment and medium
CN115002083A (en) * 2022-05-23 2022-09-02 阿里巴巴(中国)有限公司 Method, equipment and storage medium for transmitting real-time streaming media data

Also Published As

Publication number Publication date
CN115002083A (en) 2022-09-02
CN115002083B (en) 2024-04-02

Similar Documents

Publication Publication Date Title
CN104137505B (en) The method and apparatus for realizing the control initiated the network of segmented content stream transmission
EP2171600B1 (en) Assisted peer-to-peer media streaming
JP4820447B2 (en) Multicast transmission system and method
US6888828B1 (en) System and method for providing at least one service obtained from a service network for a user in a packet switched communication network
CN102075338B (en) Distributed network-based live broadcasting method and device
JP2010521875A5 (en)
US20060233154A1 (en) Server to network signaling method for rapid switching between anycast multicast sources
Mastorakis et al. Real-time data retrieval in named data networking
MXPA06000670A (en) Method and system for providing a transmission link for streaming traffic.
WO2023226949A1 (en) Real-time streaming media data transmission method and device, and storage medium
JP2008160196A (en) Ip broadcasting reception method, and reception terminal
US20100198977A1 (en) Automatic live stream trees
EP1806870A1 (en) Method for providing data and data transmission system
CN103166959A (en) Control system and control method of multipath real-time transmission
CN104518908A (en) Providing network management related methods, systems
JPWO2006075559A1 (en) Communication method and receiving terminal
US8068515B2 (en) Faster multimedia synchronization of broadcast streams using router caching of RTCP packets
US20120023239A1 (en) Creation Method of Multimedia Service and System Thereof
JP3755527B2 (en) Multicast transfer route calculation method, multicast transfer route calculation device, and program
US9026610B2 (en) Method of collecting real time data
JP2004274622A (en) Method and apparatus for transmission
CN113382453B (en) Cross-domain graph transmission method and system based on enhanced static routing calculation and source return
JP2011182061A (en) Communication terminal and data delivery system switching program
JP2007183714A (en) Content distribution system, relay server and relay management server
JP2010148092A (en) Iptv service method and apparatus for channel change

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23811020

Country of ref document: EP

Kind code of ref document: A1