A media streaming method, electronic device, storage medium and program product

By using the QUIC protocol and SIP message control at the transport layer, the problem of data packet loss in TCP and UDP under weak network conditions is solved, achieving efficient and stable media stream transmission, and improving user experience and resource utilization efficiency.

CN119728651BActive Publication Date: 2026-01-23HUBEI TIANRONGXIN NETWORK SECURITY TECH CO LTD +3
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411891941.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2026-01-23
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

Existing transport layer protocols TCP and UDP suffer from data packet loss in weak network environments, affecting the transmission quality of media streams and user experience. TCP has high reliability but low efficiency, while UDP is efficient but unreliable.

Method used

The QUIC protocol is used as the transport layer, combining the reliability of TCP and the low latency of UDP. Media stream sessions are established through the SIP protocol, and SIP messages are sent via the QUIC connection for acknowledgment and control, ensuring the reliability and efficiency of data transmission.

Benefits of technology

It achieves efficient and stable transmission of real-time media streams, avoids packet loss, improves the transmission quality and user experience of media streams, and optimizes resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728651B_ABST
    Figure CN119728651B_ABST
Patent Text Reader

Abstract

The application provides a media stream transmission method, an electronic device, a readable storage medium and a computer program product. The method comprises the following steps: establishing a QUIC connection with a media stream sending end; when it is necessary to transmit a real-time media stream, sending a SIP invitation message to the media stream sending end based on the QUIC connection; after receiving a request success SIP response message sent by the media stream sending end according to the SIP invitation message, sending a SIP confirmation request to the media stream sending end; receiving real-time audio and video data sent by the media stream sending end after receiving the SIP confirmation request; and sending a SIP termination message to the media stream sending end, so that the media stream sending end stops data transmission operation after receiving the SIP termination message. The method can transmit media stream data such as audio data and video data by taking QUIC as a transmission layer, avoids the packet loss phenomenon, improves the media stream transmission performance, and improves the transmission quality of the media stream and the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, in particular to a media stream transmission method, an electronic device, a readable storage medium and a computer program product. BACKGROUND

[0002] In the current Internet technology, real-time transmission of media streams such as audio and video has become a core requirement in various application scenarios such as live streaming, audio and video conferencing, online education, etc. Under the current technical framework, these media stream data are mainly transmitted through traditional transport layer protocols, namely Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). However, UDP has unreliability in transmitting data. Once the data packet is lost, additional processing at the application layer is required, which undoubtedly increases the complexity of the system. In contrast, although TCP can provide relatively reliable transmission services, its data transmission efficiency is greatly reduced in weak network environments, and packet loss phenomenon also occurs, thereby seriously affecting the transmission quality of media streams and user experience. SUMMARY

[0003] The purpose of the embodiments of the present application is to provide a media stream transmission method, an electronic device, a readable storage medium and a computer program product, which can transmit media stream data such as audio data and video data using QUIC as the transport layer, avoid packet loss phenomenon, improve media stream transmission performance, and improve the transmission quality of media streams and user experience.

[0004] The first aspect of the present application provides a media stream transmission method, which is applied to a media stream receiving end and includes the following steps:

[0005] establishing a QUIC connection with a media stream sending end;

[0006] when it is necessary to transmit real-time media streams, sending a first invite SIP message to the media stream sending end based on the QUIC connection;

[0007] after receiving a first 200OK SIP response message sent by the media stream sending end according to the first invite SIP message, sending a first SIP ACK request to the media stream sending end;

[0008] receiving real-time audio and video data sent by the media stream sending end after receiving the first SIP ACK request;

[0009] sending a first SIP BYE message to the media stream sending end, so that the media stream sending end stops data transmission operation after receiving the first SIP BYE message.

[0010] In the implementation process, the method can establish a connection through a QUIC (Quick UDP Internet Connections) protocol. Compared with traditional TCP or UDP protocols, QUIC can combine the reliability of TCP and the low-delay characteristics of UDP to provide more efficient and stable network connections for real-time media stream transmission, thereby helping to reduce delay, improve data transmission efficiency, and thus enhance the robustness of the connection. The step of initiating an invitation using a SIP (Session Initiation Protocol) protocol to establish a media session enables the receiving end to actively request and start real-time media stream transmission. At the same time, sending SIP messages through a QUIC connection can further enhance the reliability and efficiency of session establishment. Then, the step of sending a SIP ACK request to confirm the reception of the response message can ensure the confirmation of session establishment and the consensus of both parties on the session status, providing a basis for subsequent media stream transmission. After that, the step of starting to receive real-time audio and video data sent by the sending end after successfully establishing the session and confirming it can achieve efficient transmission of real-time media streams and meet the needs of real-time audio and video communication. Finally, the step of ending the media session by sending a SIP BYE message and notifying the sending end to stop data transmission can ensure the normal end of the session and the orderly stop of data transmission, thereby helping to avoid ineffective occupation and waste of resources.

[0011] Further, the method further comprises:

[0012] When a historical media stream needs to be transmitted, a second invite SIP message is sent to the media stream sending end based on the QUIC connection;

[0013] When a second 200OK SIP response message sent by the media stream sending end according to the second invite SIP message is received, a second SIP ACK request is sent to the media stream sending end;

[0014] A custom SIP MESSAGE message sent by the media stream sending end after receiving the second SIP ACK request is received;

[0015] The amount of data to be received is determined according to the custom SIP MESSAGE message;

[0016] A third 200OK SIP response message is sent to the media stream sending end, so that the media stream sending end sends historical audio and video slice data according to the second invite SIP message after receiving the third 200OK SIP response message;

[0017] The historical audio and video slice data is received;

[0018] after judging that the data receiving is completed according to the amount of data to be received, a second SIP BYE message is sent to the media stream sending end, so that the media stream sending end stops the data transmission operation after receiving the second SIP BYE message;

[0019] The historical audio and video slice data is reorganized according to the second invite SIP message to obtain a complete historical audio and video file.

[0020] In the implementation process, the method can realize efficient request, reception and reorganization of historical media streams by extending the SIP protocol application on the QUIC connection, thereby ensuring the integrity and accuracy of data transmission. Meanwhile, the method can also accurately control the data amount by using the custom SIP MESSAGE message, thereby realizing optimization of resource utilization; and can effectively end the session by the SIP BYE message after the data transmission is completed, thereby improving the flexibility and efficiency of the overall media stream processing.

[0021] Further, when real-time media stream needs to be transmitted, the first invite SIP message includes a first QUIC data channel attribute;

[0022] The first QUIC data channel attribute includes a first media stream identifier corresponding to the transmission of video data and a second media stream identifier corresponding to the transmission of audio data;

[0023] When historical media stream needs to be transmitted, the second invite SIP message includes a second QUIC data channel attribute and a QUIC slice data channel attribute;

[0024] The transmission channel corresponding to the second QUIC data channel attribute is used to transmit the custom SIP MESSAGE message;

[0025] The custom SIP MESSAGE message includes an SDP message body;

[0026] The SDP message body includes a QUIC slice size attribute.

[0027] In the implementation process, the method can flexibly set the QUIC data channel attribute by the SIP invitation message, thereby realizing fine control of real-time and historical media stream transmission.

[0028] Further, after receiving a first 200OK SIP response message sent by the media stream sending end according to the first invite SIP message, the method further includes:

[0029] obtaining a target SDP message body carried by the first 200OK SIP response message;

[0030] determining that the media stream sending end accepts the transmission request of the media stream receiving end when the target SDP message body matches the first QUIC data channel attribute in the first invite SIP message, and performing the sending of the first SIP ACK request to the media stream sending end.

[0031] In the implementation process, the method can ensure that the media stream sending end correctly understands the transmission request of the receiving end and agrees to establish a corresponding data transmission channel, thereby enhancing the accuracy and reliability of media stream transmission and laying a foundation for subsequent real-time audio and video data transmission.

[0032] The second aspect of the application provides a media stream transmission method, which is applied to a media stream sending end and includes:

[0033] establishing a QUIC connection with a media stream receiving end;

[0034] when real-time media stream transmission is needed, receiving a first invite SIP message sent by the media stream receiving end based on the QUIC connection;

[0035] sending a first 200OK SIP response message to the media stream receiving end in response to the first invite SIP message;

[0036] receiving a first SIP ACK request sent by the media stream receiving end;

[0037] sending real-time audio and video data to the media stream receiving end;

[0038] stopping data transmission operation after receiving a first SIP BYE message sent by the media stream receiving end.

[0039] In the implementation process, the method can utilize the low delay, high reliability and multiplexing characteristics of the QUIC connection to provide efficient network support for real-time media stream transmission, thereby helping to reduce transmission delay and improve the stability and efficiency of data transmission. Meanwhile, the method can also provide explicit instructions and parameters for subsequent data transmission on the basis of the agreement reached by the receiving and sending parties on the session control of media stream transmission. Then, the method can also ensure the consensus of the parties on the session state through confirmation, thereby providing a guarantee for subsequent data transmission. After the session is successfully established and confirmed, the sending end starts sending real-time audio and video data to the receiving end through the QUIC connection, which can realize efficient transmission of real-time media stream, thereby meeting the needs of real-time audio and video communication. Finally, the SIP BYE message can also stop the data transmission operation, thereby ensuring the normal end of the session and avoiding the invalid occupation and waste of resources, and providing better resource utilization for subsequent sessions.

[0040] Further, the sending real-time audio and video data to the media stream receiving end comprises:

[0041] determining real-time audio and video data to be transmitted; wherein the real-time audio and video data comprises real-time video data and real-time audio data;

[0042] obtaining first QUIC data channel attributes according to the first invite SIP message; wherein the first QUIC data channel attributes comprise a first media stream identifier corresponding to the transmission of video data and a second media stream identifier corresponding to the transmission of audio data;

[0043] determining a first transmission channel according to the first media stream identifier, and determining a second transmission channel according to the second media stream identifier;

[0044] sending the real-time video data to the media stream receiving end through the first transmission channel, and sending the real-time audio data to the media stream receiving end through the second transmission channel.

[0045] In the above implementation process, the method can realize efficient and orderly transmission of real-time audio and video data, while ensuring the synchronization and integrity of the audio and video data.

[0046] Further, the method further comprises:

[0047] when it is necessary to transmit historical media stream, receiving a second invite SIP message sent by the media stream receiving end based on the QUIC connection;

[0048] performing slicing processing on a complete historical audio and video file according to the second invite SIP message to obtain historical audio and video slice data to be sent;

[0049] sending a second 200OK SIP response message to the second invite SIP message to the media stream receiving end;

[0050] receiving a second SIP ACK request sent by the media stream receiving end;

[0051] sending a custom SIP MESSAGE message to the media stream receiving end according to the second SIP ACK request;

[0052] after receiving a third 200OK SIP response message sent by the media stream receiving end, sending the historical audio and video slice data to the media stream receiving end according to the second invite SIP message;

[0053] stop the data transmission operation after receiving the second SIP BYE message sent by the media stream receiving end.

[0054] In the implementation process, the method can slice historical audio and video files on demand, and realize the ordered transmission of the sliced data through the SIP protocol and the QUIC connection. Meanwhile, after confirming that the receiving end is ready, the sending end starts sending the sliced data, and terminates the transmission in time when the receiving end requests to stop, so as to realize the efficient and reliable transmission of the historical media stream.

[0055] The third aspect of the present application provides a media stream transmission device, which is applied to a media stream receiving end, and includes:

[0056] A first establishing unit is configured to establish a QUIC connection with a media stream sending end.

[0057] A first sending unit is configured to send a first invite SIP message to the media stream sending end based on the QUIC connection when a real-time media stream needs to be transmitted.

[0058] The first sending unit is further configured to send a first SIP ACK request to the media stream sending end after receiving a first 200OK SIP response message sent by the media stream sending end according to the first invite SIP message.

[0059] A first receiving unit is configured to receive real-time audio and video data sent by the media stream sending end after receiving the first SIP ACK request.

[0060] The first sending unit is further configured to send a first SIP BYE message to the media stream sending end, so that the media stream sending end stops the data transmission operation after receiving the first SIP BYE message.

[0061] Further, the media stream transmission device further includes:

[0062] A second sending unit is configured to send a second invite SIP message to the media stream sending end based on the QUIC connection when a historical media stream needs to be transmitted.

[0063] The second sending unit is further configured to send a second SIP ACK request to the media stream sending end after receiving a second 200OK SIP response message sent by the media stream sending end according to the second invite SIP message.

[0064] a second receiving unit, configured to receive a custom SIP MESSAGE packet sent by the media stream sending end after the second SIP ACK request is received;

[0065] a determining unit, configured to determine an amount of data to be received according to the custom SIP MESSAGE packet;

[0066] The second sending unit is further configured to send a third 200OK SIP response packet to the media stream sending end, so that the media stream sending end sends historical audio and video slice data according to the second invite SIP packet after the third 200OK SIP response packet is received.

[0067] The second receiving unit is further configured to receive the historical audio and video slice data.

[0068] The second sending unit is further configured to send a second SIP BYE message to the media stream sending end after determining that the data receiving is completed according to the amount of data to be received, so that the media stream sending end stops the data transmission operation after the second SIP BYE message is received.

[0069] a reorganizing unit, configured to perform reorganizing processing on the historical audio and video slice data according to the second invite SIP packet, to obtain a complete historical audio and video file.

[0070] Further, when real-time media stream needs to be transmitted, the first invite SIP packet includes a first QUIC data channel attribute;

[0071] The first QUIC data channel attribute includes a first media stream identifier corresponding to the transmission of video data and a second media stream identifier corresponding to the transmission of audio data.

[0072] When historical media stream needs to be transmitted, the second invite SIP packet includes a second QUIC data channel attribute and a QUIC slice data channel attribute;

[0073] The transmission channel corresponding to the second QUIC data channel attribute is used to transmit the custom SIP MESSAGE packet.

[0074] The custom SIP MESSAGE packet includes an SDP message body.

[0075] The SDP message body includes a QUIC slice size attribute.

[0076] Further, the first sending unit includes:

[0077] The first obtaining subunit is configured to obtain a target SDP message body carried by the first 200 OK SIP response message;

[0078] The first determining subunit is configured to determine that the media stream sending end accepts the transmission request of the media stream receiving end when the target SDP message body matches the first QUIC data channel attribute in the first invite SIP message.

[0079] The first sending subunit is configured to send a first SIP ACK request to the media stream sending end.

[0080] The fourth aspect of the present application provides a media stream transmission device, which is applied to a media stream sending end, and the media stream transmission device comprises:

[0081] The second establishing unit is configured to establish a QUIC connection with a media stream receiving end.

[0082] The third receiving unit is configured to receive a first invite SIP message sent by the media stream receiving end based on the QUIC connection when real-time media stream needs to be transmitted.

[0083] The third sending unit is configured to send a first 200 OK SIP response message to the first invite SIP message to the media stream receiving end.

[0084] The third receiving unit is further configured to receive a first SIP ACK request sent by the media stream receiving end.

[0085] The third sending unit is further configured to send real-time audio and video data to the media stream receiving end.

[0086] The stopping unit is configured to stop data transmission operation after receiving a first SIP BYE message sent by the media stream receiving end.

[0087] Further, the third sending unit comprises:

[0088] The second determining subunit is configured to determine real-time audio and video data to be transmitted; wherein the real-time audio and video data comprises real-time video data and real-time audio data.

[0089] The second obtaining subunit is configured to obtain a first QUIC data channel attribute according to the first invite SIP message; wherein the first QUIC data channel attribute comprises a first media stream identifier corresponding to transmitted video data and a second media stream identifier corresponding to transmitted audio data.

[0090] The second determining sub-unit is further configured to determine a first transmission channel according to the first media stream identifier, and determine a second transmission channel according to the second media stream identifier.

[0091] The second sending sub-unit is configured to send the real-time video data to the media stream receiving end through the first transmission channel, and send the real-time audio data to the media stream receiving end through the second transmission channel.

[0092] Further, the media stream transmission device further comprises:

[0093] The fourth receiving unit is configured to receive a second invite SIP message sent by the media stream receiving end based on the QUIC connection when a historical media stream needs to be transmitted.

[0094] The slicing unit is configured to slice a complete historical audio / video file to obtain historical audio / video slice data to be sent according to the second invite SIP message.

[0095] The fourth sending unit is configured to send a second 200 OK SIP response message to the second invite SIP message to the media stream receiving end.

[0096] The fourth receiving unit is further configured to receive a second SIP ACK request sent by the media stream receiving end.

[0097] The fourth sending unit is further configured to send a custom SIP MESSAGE message to the media stream receiving end according to the second SIP ACK request.

[0098] The fourth sending unit is further configured to send the historical audio / video slice data to the media stream receiving end according to the second invite SIP message after receiving a third 200 OK SIP response message sent by the media stream receiving end.

[0099] The stopping unit is further configured to stop the data transmission operation after receiving a second SIP BYE message sent by the media stream receiving end.

[0100] The fifth aspect of the present application provides an electronic device comprising a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to make the electronic device execute the media stream transmission method in any one of the first aspect of the present application.

[0101] The sixth aspect of the present application provides a computer readable storage medium, which stores computer program instructions, when the computer program instructions are read and run by a processor, the media stream transmission method in any one of the first aspect of the present application is executed.

[0102] The seventh aspect of the present application provides a computer program product, the computer program product comprising a computer program, when the computer program is run by a processor, performing the media streaming method in any one of the first aspect of the present application. BRIEF DESCRIPTION OF DRAWINGS

[0103] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0104] Figure 1 A flowchart of a media streaming method provided by an embodiment of the present application;

[0105] Figure 2 A SIP protocol model schematic diagram using a QUIC protocol as a transport layer provided by an embodiment of the present application;

[0106] Figure 3 A streaming architecture schematic diagram of a QUIC connection provided by an embodiment of the present application;

[0107] Figure 4 A structure schematic diagram of a QUIC message load provided by an embodiment of the present application;

[0108] Figure 5 A flowchart of another media streaming method provided by an embodiment of the present application;

[0109] Figure 6 A flowchart of another media streaming method provided by an embodiment of the present application;

[0110] Figure 7 A flowchart of another media streaming method provided by an embodiment of the present application;

[0111] Figure 8 A structure schematic diagram of a media streaming device provided by an embodiment of the present application;

[0112] Figure 9 A structure schematic diagram of another media streaming device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0113] The technical solutions in the embodiments of the present application will be described below in combination with the drawings in the embodiments of the present application.

[0114] It should be noted that similar reference numerals and letters refer to like items in the accompanying drawings, and once an item is defined in one drawing, it is not necessary to further define and explain it in subsequent drawings. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

[0115] Embodiment 1

[0116] Referring to Figure 1 , Figure 1 A flowchart of a media streaming method is provided for the present embodiment. The media streaming method is applied to a media stream receiving end, and includes:

[0117] S101, establish a QUIC connection with a media stream sending end.

[0118] Referring to Figure 2 , Figure 2 A schematic diagram of a SIP protocol model using QUIC protocol as the transport layer is shown.

[0119] In the present embodiment, QUIC (Quick UDP Internet Connections) is implemented based on UDP (User Datagram Protocol) and has error detection and retransmission mechanisms to ensure data reliability. QUIC has built-in TLS (Transport Layer Security) which can ensure the security and integrity of data transmission. QUIC has an updated congestion control algorithm, which improves performance under various network conditions.

[0120] In the present embodiment, each stream in the QUIC connection is an independent data channel, and multiple data streams can be transmitted simultaneously on a single connection, thereby improving throughput and efficiency. Each stream has its own ID and can send and receive data independently. Stream management allows SIP (Session Initiation Protocol, an application layer signaling control protocol) to send multiple data streams in the same connection without generating multiple connections to transmit data. This feature makes better use of bandwidth and better handles network latency.

[0121] Referring to Figure 3 , Figure 3 A schematic diagram of the stream transmission architecture of the QUIC connection is shown. Since QUIC is implemented based on UDP, the QUIC connection is essentially a UDP connection, and multiple independent data streams are carried on this UDP connection.

[0122] For example, the media stream receiving end establishes a QUIC connection with the media stream sending end, and data in the QUIC connection is encrypted by TLS.

[0123] S102, when a real-time media stream needs to be transmitted, a first invite SIP message is sent to the media stream sending end based on the QUIC connection.

[0124] In this embodiment, the first invite SIP message includes a first QUIC data channel attribute.

[0125] The first QUIC data channel attribute includes a first media stream identifier corresponding to the transmission of video data and a second media stream identifier corresponding to the transmission of audio data.

[0126] Please refer to Figure 4 , Figure 4 A structure diagram of a QUIC message payload is shown. The QUIC message payload can carry a SIP signaling message and an audio / video data RTP message. Among them, the data on the control flow is the SIP signaling message, and the data on the other flow is the RTP message, which encapsulates audio or video data.

[0127] In this embodiment, the party can specify that the flow with a QUIC flow ID of 1000 is a control flow, and the SIP message is carried in the flow, which is used for the establishment, closing and control of the media stream.

[0128] In this embodiment, the media stream is used to transmit audio and video data, carries an RTP message, and the flow ID of the media stream ranges from 2000 to 100000.

[0129] As can be seen, the channel with a flow ID of 1000 is a control channel, and the channel with a flow ID ranging from 2000 to 100000 is a data channel.

[0130] In this embodiment, the method can add a new attribute in the SDP carried by the SIP message, which is called a QUIC data channel attribute, and the format is a=quic:vedio:id:xxxx, xxxx is a number ranging from 2000 to 100000.

[0131] For example, the QUIC data channel attribute a=quic:vedio:id:2000 indicates that the SIP transmits video data using the QUIC flow with a flow ID of 2000, and the new attribute a=quic:audio:id:2001 indicates that the SIP transmits audio data using the QUIC flow with a flow ID of 2001.

[0132] For example, the step can be performed by the media stream receiving end, and the invite SIP message can be sent in a channel with a QUIC flow ID of 1000, and the SDP of the SIP can include a = quic: video: id: 2000 and a = quic: audio: id: 2001, to inform the media stream sending end to send video data in a channel with a QUIC flow ID of 2000 and to send audio data in a channel with a QUIC flow ID of 2001.

[0133] S103, after receiving the first 200 OK SIP response message sent by the media stream sending end according to the first invite SIP message, obtaining the target SDP message body carried in the first 200 OK SIP response message.

[0134] S104, when the target SDP message body matches the first QUIC data channel attribute in the first invite SIP message, determining that the media stream sending end accepts the transmission request of the media stream receiving end.

[0135] S105, sending a first SIP ACK request to the media stream sending end.

[0136] For example, the media stream receiving end can send a SIP ACK request to the media stream sending end in a channel with a QUIC flow ID of 1000 after receiving the returned 200 OK SIP response, and the request does not carry a message body, indicating that the media stream receiving end is ready to receive the audio and video data of the stream media sending end.

[0137] S106, receiving real-time audio and video data sent by the media stream sending end after receiving the first SIP ACK request.

[0138] S107, sending a first SIP BYE message to the media stream sending end, so that the media stream sending end stops the data transmission operation after receiving the first SIP BYE message.

[0139] For example, the media stream receiving end can send a SIP BYE message to the media stream sending end in a channel with a QUIC flow ID of 1000 after the data is received.

[0140] In this embodiment, the execution subject of the method can be a computer, a server, or other computing devices, and the embodiment is not limited in this regard.

[0141] In this embodiment, the execution subject of the method can also be a smart phone, a tablet computer, or other smart devices, and the embodiment is not limited in this regard.

[0142] It can be seen that the media stream transmission method described in the embodiment can transmit audio data, video data and other media stream data by using QUIC as a transport layer, avoid packet loss, improve media stream transmission performance, and improve media stream transmission quality and user experience.

[0143] Embodiment 2

[0144] Please refer to Figure 5 , Figure 5 A flowchart of a media stream transmission method provided by the embodiment is shown. The media stream transmission method is applied to a media stream receiving end and includes the following steps.

[0145] S201, establishing a QUIC connection with a media stream sending end.

[0146] For example, the media stream receiving end establishes a QUIC connection with the media stream sending end, and all data in the QUIC connection is encrypted by TLS.

[0147] S202, when a historical media stream needs to be transmitted, sending a second invite SIP message to the media stream sending end based on the QUIC connection.

[0148] In the embodiment, the second invite SIP message includes a second QUIC data channel attribute and a QUIC slice data channel attribute.

[0149] The transmission channel corresponding to the second QUIC data channel attribute is used to transmit a custom SIP MESSAGE message.

[0150] The custom SIP MESSAGE message includes an SDP message body.

[0151] The SDP message body includes a QUIC slice size attribute.

[0152] In the embodiment, the method can add a new attribute in the SDP carried by the SIP message, which is called a QUIC slice data channel attribute, and the format is a=quic:logic:id:yyyy slice:id:[xxxx,xxxx,xxxx],yyyy and xxxx are numbers, [xxxx,xxxx,xxxx] is an array, which contains at most 80000 numbers, the numbers are separated by commas, and the range of xxxx and yyyy is 2000 to 100000.

[0153] For example, the QUIC slice data channel attribute a=quic:logic:id:2000slice:id:3001 3002 3003 indicates that the SIP uses the data channels with stream IDs 3001 3002 3003 to transmit data in the same media stream file, and the data in the three channels is recombined into a media stream file at the receiving end.

[0154] In the embodiment, the method can also add a new attribute in the SDP carried by the SIP message, which is called the QUIC slice size attribute, and the format is a=quic:slice:id:xxxx:size:yyyy. After slice:id, xxxx is a number ranging from 2000 to 100000, indicating that the slice data is transmitted in the xxxx channel, and the size of the transmitted data is yyyy bytes specified after size. The attribute defines the size of the data that should be transmitted in the data channel in the case of slice transmission. yyyy is a data with a size of 1 to 8388608.

[0155] For example, the QUIC slice size attribute a=quic:slice:id:3001:size:1024 indicates that the SIP uses the channel with stream ID 3001 to transmit 1024 bytes of data.

[0156] For example, the media stream receiving end can send an invite SIP message in the channel with QUIC stream ID 1000, and the SDP of the SIP includes a=quic:vedio:id:2000, a=quic:audio:id:2001, a=quic:logic:id:2000slice:id:3001 3002 3003, a=quic:logic:id:2001slice:id:4001 4002 4003, to inform the media stream sending end that the historical audio and video slices will be saved and sent in the channels 4001 4002 4003.

[0157] S203, when receiving a second 200 OK SIP response message sent by the media stream sending end according to the second invite SIP message, sending a second SIP ACK request to the media stream sending end.

[0158] For example, the media stream receiving end can send a SIP ACK request to the media stream sending end in the channel with QUIC stream ID 1000 after receiving the returned 200 OK SIP response, and the request does not carry a message body. This indicates that the media stream receiving end is ready to receive the audio and video data of the stream media sending end.

[0159] S204, receiving the custom SIP MESSAGE message sent by the media stream sending end after receiving the second SIP ACK request.

[0160] In this embodiment, the method can transmit the custom SIP MESSAGE message (without transmitting data) through the channel specified in the QUIC data channel attribute. The MESSAGE message contains an SDP message, and the SDP contains a QUIC fragment size attribute, which describes the size of the data to be transmitted by the media stream sending end in the fragment data channel.

[0161] S205, determining the amount of data to be received according to the custom SIP MESSAGE message.

[0162] S206, sending a third 200 OK SIP response message to the media stream sending end, so that the media stream sending end transmits historical audio and video slice data according to the second invite SIP message after receiving the third 200 OK SIP response message.

[0163] In this embodiment, the method supports fragment transmission. The method needs to negotiate channels for transmitting fragment data, and then transmits slice data in these channels at the same time, so as to improve the transmission efficiency of the media stream.

[0164] For example, the media stream receiving end can return a 200 OK SIP response in the channels with QUIC flow IDs of 2000 and 2001 after receiving the SIP MESSAGE message. This indicates that the media stream receiving end knows how much data to receive in the data channel, and after all the data in the data channel is received, the data is reorganized according to the data belonging to the channels with 2000 and 2001.

[0165] S207, receiving historical audio and video slice data.

[0166] S208, sending a second SIP BYE message to the media stream sending end after determining that the data reception is complete according to the amount of data to be received, so that the media stream sending end stops the data transmission operation after receiving the second SIP BYE message.

[0167] For example, the media stream receiving end can send a SIP BYE message to the media stream sending end in the channel with a QUIC flow ID of 1000 after the data is received.

[0168] S209, reorganizing the historical audio and video slice data according to the second invite SIP message to obtain a complete historical audio and video file.

[0169] In this embodiment, the method can prioritize the historical media stream file during the process of fragment transmission (fragmenting according to the order of slice id in the QUIC fragment data channel attribute), calculate the data size of each fragment after fragmentation, and send the size information to the media stream receiving end through the channel specified by the logic id.

[0170] In this embodiment, for the media stream receiving end, the data of the fragment data channel belonging to the same logic id is finally reorganized into a file according to the order of slice id in the QUIC fragment size attribute.

[0171] In this embodiment, the execution subject of the method can be a computer, a server, or other computing devices, which are not limited in this embodiment.

[0172] In this embodiment, the execution subject of the method can also be a smart phone, a tablet computer, or other smart devices, which are not limited in this embodiment.

[0173] It can be seen that by implementing the media stream transmission method described in this embodiment, the audio data, video data, and other media stream data can be transmitted using QUIC as the transmission layer, avoiding packet loss and improving the media stream transmission performance, transmission quality of the media stream, and user experience.

[0174] Embodiment 3

[0175] Please refer to Figure 6 , Figure 6 A flowchart of a media stream transmission method provided in this embodiment is shown. The method is applied to a media stream sending end and includes the following steps.

[0176] S301, establishing a QUIC connection with a media stream receiving end.

[0177] S302, when a real-time media stream needs to be transmitted, receiving a first invite SIP message sent by the media stream receiving end based on the QUIC connection.

[0178] S303, sending a first 200OK SIP response message to the media stream receiving end.

[0179] For example, the media stream sending end can receive the Invite SIP request in the channel with QUIC flow ID 1000, reply to the 200OK SIP response in the channel with QUIC flow ID 1000, and the SDP message body carried in the response contains a=quic:vedio:id:2000 and a=quic:audio:id:2001. It indicates that the media stream sending end agrees to the transmission requirements of the media stream receiving end.

[0180] S304, receiving a first SIP ACK request sent by the media stream receiving end.

[0181] S305, determining real-time audio and video data to be transmitted; wherein the real-time audio and video data comprises real-time video data and real-time audio data.

[0182] S306, obtaining first QUIC data channel attributes according to the first invite SIP message; wherein the first QUIC data channel attributes comprise a first media stream identifier corresponding to the transmitted video data and a second media stream identifier corresponding to the transmitted audio data.

[0183] S307, determining a first transmission channel according to the first media stream identifier, and determining a second transmission channel according to the second media stream identifier.

[0184] S308, transmitting the real-time video data to the media stream receiving end through the first transmission channel, and transmitting the real-time audio data to the media stream receiving end through the second transmission channel.

[0185] For example, the media stream sending end can receive a SIP ACK response in a channel with a QUIC flow ID of 1000, and the streaming media channel has been negotiated. The media stream sending end can transmit video data in a channel with a QUIC flow ID of 2000, and transmit audio data in a channel with a QUIC flow ID of 2001.

[0186] S309, stopping data transmission operation after receiving a first SIP BYE message sent by the media stream receiving end.

[0187] For example, the media stream sending end can receive a SIP BYE message in a channel with a QUIC flow ID of 1000, and stop transmitting data in a channel with a QUIC flow ID of 2000 and a channel with a QUIC flow ID of 2001.

[0188] In this embodiment, the execution subject of the method can be a computer, a server, or other computing devices, which are not limited in this embodiment.

[0189] In this embodiment, the execution subject of the method can also be a smart phone, a tablet computer, or other smart devices, which are not limited in this embodiment.

[0190] It can be seen that by implementing the media stream transmission method described in this embodiment, audio data, video data, and other media stream data can be transmitted by using QUIC as a transmission layer, packet loss phenomenon can be avoided, media stream transmission performance is improved, and media stream transmission quality and user experience are improved.

[0191] Embodiment 4

[0192] Please refer toFigure 7 , Figure 7 A flowchart of a media streaming method is provided for the present embodiment. The method is applied to a media stream sending end and includes the following steps:

[0193] S401. Establish a QUIC connection with a media stream receiving end.

[0194] S402. When a historical media stream needs to be transmitted, the media stream receiving end sends a second invite SIP message based on the QUIC connection.

[0195] S403. Slice the complete historical audio and video file according to the second invite SIP message to obtain historical audio and video slice data to be sent.

[0196] S404. Send a second 200 OK SIP response message to the second invite SIP message to the media stream receiving end.

[0197] S405. Receive a second SIP ACK request sent by the media stream receiving end.

[0198] S406. Send a custom SIP MESSAGE message to the media stream receiving end according to the second SIP ACK request.

[0199] For example, the media stream sending end can send a custom SIP MESSAGE message in a channel with a QUIC flow ID of 2000, which carries SDP messages a=quic:slice:id:3001:size:10240, a=quic:slice:id:3001:size:10240, and a=quic:slice:id:3001:size:10240.

[0200] In a channel with a QUIC flow ID of 2001, a custom SIP MESSAGE message is sent, which carries SDP messages a=quic:slice:id:4001:size:10240, a=quic:slice:id:4002:size:10240, and a=quic:slice:id:4003:size:10240. This indicates that the media stream sending end informs the media stream receiving end of how much data to send in the actual data sending channel.

[0201] S407. After receiving a third 200 OK SIP response message sent by the media stream receiving end, send historical audio and video slice data to the media stream receiving end according to the second invite SIP message.

[0202] S408, when receiving the second SIP BYE message sent by the media stream receiving end, stopping the data transmission operation.

[0203] For example, the media stream sending end can stop sending data in the QUIC flow ID 3001 3002 3003 4001 4002 4003 in the channel with the QUIC flow ID 1000 after receiving the SIP BYE message.

[0204] In this embodiment, the execution subject of the method can be a computer, a server, or other computing devices, which are not limited in this embodiment.

[0205] In this embodiment, the execution subject of the method can also be a smart phone, a tablet computer, or other smart devices, which are not limited in this embodiment.

[0206] It can be seen that the media stream transmission method described in this embodiment can transmit audio data, video data, and other media stream data using QUIC as the transmission layer, avoid packet loss, improve media stream transmission performance, and improve media stream transmission quality and user experience.

[0207] Embodiment 5

[0208] This embodiment shows an example process of the media stream transmission method. The method is applied in a camera audio and video transmission, a firewall, a media data storage server, a streaming media player platform, a router, a switch, an application gateway, and other network devices. The camera, the firewall, and the streaming media player platform all support the SIP streaming media transmission method based on QUIC.

[0209] In this example, the audio and video data of the camera is forwarded to the streaming media player platform after being filtered by the firewall. The firewall supports parsing the control flow data of SIP based on QUIC and can filter illegal SIP signaling and streaming media data. The specific process is as follows:

[0210] (1) The streaming media player platform sends a SIP request through the channel with the QUIC flow ID 1000 to negotiate the sending channel of the video and audio.

[0211] (2) The firewall receives the SIP request from the streaming media player platform in the channel with the QUIC flow ID 1000, checks whether it is a legal SIP request, and forwards it to the camera if it is a legal SIP request, or discards the SIP request if it is not a legal SIP request.

[0212] (3) The camera returns OK in the channel with the QUIC flow ID 1000 after receiving the SIP request for negotiating the audio and video channel.

[0213] (4) Firewall, in the channel of QUIC flow ID 1000, receives OK response from the camera, checks if it is a legal OK response, forwards to the streaming media player if it is legal, discards the SIP response if it is not legal, and does not forward.

[0214] (5) Streaming media player, in the channel of QUIC flow ID 1000, receives OK response from the firewall, and then sends an ACK request.

[0215] (6) Firewall, in the channel of QUIC flow ID 1000, receives ACK request from the streaming media player, checks if it is a legal SIP request, forwards to the camera if it is legal, discards the SIP request if it is not legal, and does not forward.

[0216] (7) Streaming media player, in the channel of QUIC flow ID 1000, receives ACK request from the firewall, and then sends audio and video data in the negotiated channel.

[0217] (8) Firewall, records the channel negotiated by the camera and the streaming media player before. After receiving data in a channel other than QUIC flow ID 1000, checks if it is the recorded successfully negotiated channel, forwards to the streaming media player if it is, and discards if it is not.

[0218] As can be seen, implementing the media stream transmission method described in this embodiment can at least have the following benefits:

[0219] (1) SIP signaling and media stream data are encrypted and transmitted in QUIC connection, which can improve data security;

[0220] (2) SIP data transmission based on QUIC can change the original transmission in multiple TCP or UDP connections to transmission in a QUIC connection. Firewalls and gateways in the network may not support SIP, but they must support UDP. Since the QUIC connection is a normal UDP connection, it can avoid data being intercepted by gateways or firewalls and other network devices.

[0221] (3) The SIP streaming media transmission method supporting QUIC reduces the difficulty of connection management in firewalls and other types of network devices, and only needs to manage a single QUIC sub-connection, without using a sub-connection table to manage streaming media transmission connections.

[0222] (4) The SIP streaming media transmission method supporting QUIC improves the transmission performance of media stream data in a weak network environment through stream transmission in a QUIC connection.

[0223] (5) Based on the feature of supporting segmented transmission, the historical streaming media data that has been saved can be segmented and transmitted at the same time, which improves the transmission efficiency of audio and video data.

[0224] Example 6

[0225] Please refer to Figure 8 , Figure 8 This is a schematic diagram of a media streaming device provided in this embodiment. Figure 8 As shown, the media streaming device is used at a media streaming receiver, and the media streaming device includes:

[0226] The first establishment unit 510 is used to establish a QUIC connection with the media stream sending end;

[0227] The first sending unit 520 is used to send a first inviteSIP message to the media stream sending end based on the QUIC connection when a real-time media stream needs to be transmitted.

[0228] The first sending unit 520 is further configured to send a first SIP ACK request to the media stream sender after receiving a first 200 OK SIP response message sent by the media stream sender according to the first invite SIP message;

[0229] The first receiving unit 530 is used to receive real-time audio and video data sent by the media stream sender after receiving the first SIP ACK request;

[0230] The first sending unit 520 is also configured to send a first SIP BYE message to the media stream sending end, so that the media stream sending end stops data transmission operation after receiving the first SIP BYE message.

[0231] As an optional implementation, the media streaming device further includes:

[0232] The second sending unit 540 is used to send a second inviteSIP message to the media stream sending end based on the QUIC connection when it is necessary to transmit the historical media stream.

[0233] The second sending unit 540 is further configured to send a second SIP ACK request to the media stream sender when it receives a second 200 OK SIP response message sent by the media stream sender according to the second invite SIP message;

[0234] The second receiving unit 550 is used to receive a custom SIP MESAGE message sent by the media stream sender after receiving the second SIP ACK request;

[0235] The determining unit 560 is configured to determine the amount of data to be received according to the custom SIP MESSAGE message.

[0236] The second sending unit 540 is further configured to send a third 200 OK SIP response message to the media stream sending end, so that the media stream sending end sends historical audio and video slice data according to the second invite SIP message after receiving the third 200 OK SIP response message.

[0237] The second receiving unit 550 is further configured to receive the historical audio and video slice data.

[0238] The second sending unit 540 is further configured to send a second SIP BYE message to the media stream sending end after determining that the data receiving is completed according to the amount of data to be received, so that the media stream sending end stops the data transmission operation after receiving the second SIP BYE message.

[0239] The reorganizing unit 570 is configured to reorganize the historical audio and video slice data according to the second invite SIP message to obtain a complete historical audio and video file.

[0240] In the embodiment, when the real-time media stream needs to be transmitted, the first invite SIP message includes a first QUIC data channel attribute;

[0241] The first QUIC data channel attribute includes a first media stream identifier corresponding to the transmitted video data and a second media stream identifier corresponding to the transmitted audio data.

[0242] When the historical media stream needs to be transmitted, the second invite SIP message includes a second QUIC data channel attribute and a QUIC slice data channel attribute;

[0243] The transmission channel corresponding to the second QUIC data channel attribute is used to transmit the custom SIP MESSAGE message.

[0244] The custom SIP MESSAGE message includes an SDP message body.

[0245] The SDP message body includes a QUIC slice size attribute.

[0246] As an optional implementation, the first sending unit 520 includes:

[0247] The first obtaining sub-unit 521 is configured to obtain a target SDP message body carried by the first 200 OK SIP response message.

[0248] The first determining sub-unit 522 is configured to determine that the media stream sending end accepts the transmission request of the media stream receiving end when the target SDP message body matches the first QUIC data channel attribute in the first invite SIP message.

[0249] The first sending sub-unit 523 is configured to send a first SIP ACK request to the media stream sending end.

[0250] In this embodiment, the description of the media stream transmission device can refer to the description in Embodiment 1 or Embodiment 2, and the description of this embodiment will not be repeated.

[0251] It can be seen that the media stream transmission device described in this embodiment can transmit media stream data such as audio data and video data by using QUIC as a transmission layer, avoids the packet loss phenomenon, improves the media stream transmission performance, and improves the transmission quality of the media stream and the user experience.

[0252] Embodiment 7

[0253] Please refer to Figure 9 , Figure 9 A structure diagram of a media stream transmission device provided in this embodiment. As shown in Figure 9 , the media stream transmission device is applied to a media stream receiving end, and the media stream transmission device comprises:

[0254] The second establishing unit 610 is configured to establish a QUIC connection with the media stream receiving end.

[0255] The third receiving unit 620 is configured to receive a first invite SIP message sent by the media stream receiving end based on the QUIC connection when real-time media stream needs to be transmitted.

[0256] The third sending unit 630 is configured to send a first 200OK SIP response message to the media stream receiving end in response to the first invite SIP message.

[0257] The third receiving unit 620 is further configured to receive a first SIP ACK request sent by the media stream receiving end.

[0258] The third sending unit 630 is further configured to send real-time audio and video data to the media stream receiving end.

[0259] The stopping unit 640 is configured to stop the data transmission operation after receiving the first SIP BYE message sent by the media stream receiving end.

[0260] As an optional implementation, the third sending unit 630 comprises:

[0261] The second determining sub-unit 631 is configured to determine real-time audio and video data to be transmitted; wherein the real-time audio and video data comprises real-time video data and real-time audio data.

[0262] The second obtaining sub-unit 632 is configured to obtain first QUIC data channel attributes according to the first invite SIP message; wherein the first QUIC data channel attributes comprise a first media stream identifier corresponding to the video data to be transmitted and a second media stream identifier corresponding to the audio data to be transmitted.

[0263] The second determining sub-unit 631 is further configured to determine a first transmission channel according to the first media stream identifier, and determine a second transmission channel according to the second media stream identifier.

[0264] The second sending sub-unit 633 is configured to send the real-time video data to the media stream receiving end through the first transmission channel, and send the real-time audio data to the media stream receiving end through the second transmission channel.

[0265] As an optional implementation, the media stream transmission device further comprises:

[0266] The fourth receiving unit 650 is configured to receive a second invite SIP message sent by the media stream receiving end based on a QUIC connection when a historical media stream needs to be transmitted.

[0267] The slicing unit 660 is configured to slice a complete historical audio and video file to obtain historical audio and video slice data to be sent according to the second invite SIP message.

[0268] The fourth sending unit 670 is configured to send a second 200OK SIP response message to the media stream receiving end in response to the second invite SIP message.

[0269] The fourth receiving unit 650 is further configured to receive a second SIP ACK request sent by the media stream receiving end.

[0270] The fourth sending unit 670 is further configured to send a custom SIP MESSAGE message to the media stream receiving end according to the second SIP ACK request.

[0271] The fourth sending unit 670 is further configured to send the historical audio and video slice data to the media stream receiving end according to the second invite SIP message after receiving a third 200OK SIP response message sent by the media stream receiving end.

[0272] The stopping unit 640 is further configured to stop the data transmission operation after receiving a second SIP BYE message sent by the media stream receiving end.

[0273] In this embodiment, the media stream transmission device can be explained and described with reference to the description in Embodiment 3 or Embodiment 4, and the description in this embodiment will not be repeated.

[0274] It can be seen that the media stream transmission device described in this embodiment can transmit media stream data such as audio data and video data by using QUIC as a transmission layer, avoid packet loss, improve media stream transmission performance, and improve media stream transmission quality and user experience.

[0275] The electronic device provided in the embodiments of the present application includes a memory and a processor, the memory is configured to store a computer program, and the processor is configured to run the computer program to enable the electronic device to perform the media stream transmission method in Embodiments 1, 2, 3 or 4.

[0276] The computer readable storage medium provided in the embodiments of the present application stores computer program instructions, and the computer program instructions are read and run by a processor to perform the media stream transmission method in Embodiments 1, 2, 3 or 4.

[0277] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are only schematic, for example, the flowcharts and block diagrams in the drawings show the possible implementation architectures, functions and operations of the devices, methods and computer program products according to the embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders from those described in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and the combination of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system for implementing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0278] In addition, each functional module in the embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0279] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts of the prior art that make contributions or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0280] The above merely provides an example of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that similar reference numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0281] The above merely provides an example of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that similar reference numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0282] It should be noted that, in this document, the terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.

Claims

1. A media stream transmission method, characterized in that, The method is applied to a media stream receiver and includes: Establish a QUIC connection with the media stream sender; When a real-time media stream needs to be transmitted, a first invite SIP message is sent to the media stream sender based on the QUIC connection. After receiving the first 200 OK SIP response message sent by the media stream sender based on the first invite SIP message, send the first SIP ACK request to the media stream sender. Receive real-time audio and video data sent by the media stream sender after receiving the first SIP ACK request; Send a first SIP BYE message to the media stream sender so that the media stream sender stops data transmission operation upon receiving the first SIP BYE message; The method further includes, after receiving the first 200 OKSIP response message sent by the media stream sender based on the first invite SIP message: Obtain the target SDP message body carried in the first 200 OK SIP response message; When the target SDP message body matches the first QUIC data channel attribute in the first invite SIP message, it is determined that the media stream sender accepts the transmission request from the media stream receiver and executes the sending of the first SIP ACK request to the media stream sender.

2. The media stream transmission method according to claim 1, characterized in that, The method further includes: When it is necessary to transmit historical media streams, a second invite SIP message is sent to the media stream sender based on the QUIC connection; Upon receiving the second 200 OK SIP response message sent by the media stream sender based on the second invite SIP message, a second SIP ACK request is sent to the media stream sender. Receive the custom SIP MESAGE message sent by the media stream sender after receiving the second SIP ACK request; The amount of data to be received is determined based on the custom SIP MESAGE message; Send a third 200 OK SIP response message to the media stream sender, so that after receiving the third 200 OK SIP response message, the media stream sender sends historical audio and video slice data according to the second invite SIP message; Receive the historical audio and video slice data; After determining that the data reception is complete based on the amount of data to be received, a second SIP BYE message is sent to the media stream sending end so that the media stream sending end stops the data transmission operation after receiving the second SIP BYE message. The historical audio and video slice data is reconstructed based on the second invite SIP message to obtain a complete historical audio and video file.

3. The media stream transmission method according to claim 2, characterized in that, When a real-time media stream needs to be transmitted, the first invite SIP message includes the first QUIC data channel attribute; The first QUIC data channel attributes include a first media stream identifier corresponding to the transmission of video data and a second media stream identifier corresponding to the transmission of audio data; When it is necessary to transmit historical media streams, the second invite SIP message includes the second QUIC data channel attribute and the QUIC fragmented data channel attribute; The transmission channel corresponding to the second QUIC data channel attribute is used to transmit the custom SIP MESSAGE message; The custom SIP message includes an SDP message body; The SDP message body includes the QUIC fragment size attribute.

4. A media stream transmission method, characterized in that, The method is applied to the media stream sending end, including: Establish a QUIC connection with the media stream receiver; When a real-time media stream needs to be transmitted, the first invite SIP message sent by the media stream receiving end based on the QUIC connection is received. Send a first 200 OK SIP response message to the media stream receiver for the first invite SIP message; so that the media stream receiver can obtain the target SDP message body carried in the first 200 OK SIP response message; and when the target SDP message body matches the first QUIC data channel attribute in the first invite SIP message, determine that the media stream sender accepts the transmission request of the media stream receiver and sends a first SIP ACK request to the media stream sender; Receive the first SIP ACK request sent by the media stream receiver; Send real-time audio and video data to the media stream receiving end; After receiving the first SIP BYE message from the media stream receiver, the data transmission operation is stopped.

5. The media stream transmission method according to claim 4, characterized in that, Sending real-time audio and video data to the media stream receiver includes: Determine the real-time audio and video data to be transmitted; wherein, the real-time audio and video data includes real-time video data and real-time audio data; The first QUIC data channel attribute is obtained based on the first invite SIP message; wherein, the first QUIC data channel attribute includes a first media stream identifier corresponding to the transmission of video data and a second media stream identifier corresponding to the transmission of audio data; A first transmission channel is determined based on the first media stream identifier, and a second transmission channel is determined based on the second media stream identifier; The real-time video data is sent to the media stream receiving end through the first transmission channel, and the real-time audio data is sent to the media stream receiving end through the second transmission channel.

6. The media stream transmission method according to claim 4, characterized in that, The method further includes: When it is necessary to transmit historical media streams, the media stream receiving end sends a second inviteSIP message based on the QUIC connection; The complete historical audio and video file is sliced ​​according to the second invite SIP message to obtain the historical audio and video slice data to be sent. Send a second 200 OK SIP response message in response to the second invite SIP message to the media stream receiver; Receive the second SIP ACK request sent by the media stream receiver; A custom SIP MESAGE message is sent to the media stream receiver according to the second SIP ACK request; After receiving the third 200 OK SIP response message sent by the media stream receiver, the historical audio and video slice data is sent to the media stream receiver according to the second inviteSIP message; Upon receiving the second SIP BYE message from the media stream receiver, the data transmission operation is stopped.

7. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program and the processor running the computer program to cause the electronic device to perform the media streaming method according to any one of claims 1 to 6.

8. A readable storage medium, characterized in that, The readable storage medium stores computer program instructions, which, when read and executed by a processor, perform the media streaming method according to any one of claims 1 to 6.

9. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, performs the media streaming transmission method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for interacting medium server in SIP communication network

    CN1859394A