CN112532719A - Information flow pushing method, device, equipment and computer readable storage medium - Google Patents

Information flow pushing method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN112532719A
CN112532719A CN202011356004.5A CN202011356004A CN112532719A CN 112532719 A CN112532719 A CN 112532719A CN 202011356004 A CN202011356004 A CN 202011356004A CN 112532719 A CN112532719 A CN 112532719A
Authority
CN
China
Prior art keywords
stream
server
transfer protocol
hypertext transfer
pushing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011356004.5A
Other languages
Chinese (zh)
Other versions
CN112532719B (en
Inventor
张鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011356004.5A priority Critical patent/CN112532719B/en
Publication of CN112532719A publication Critical patent/CN112532719A/en
Application granted granted Critical
Publication of CN112532719B publication Critical patent/CN112532719B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

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

Abstract

The application provides a method, a device, equipment and a computer-readable storage medium for pushing information flow; the method comprises the following steps: responding to the push flow triggering operation, and sending a request of a hypertext transfer protocol carrying a first head identification to a server; the first header identification is used for prompting the server to continuously receive the pushed video information stream; continuously acquiring a video information stream, and continuously pushing the video information stream to a server through a request of a hypertext transfer protocol; in response to the plug flow ending operation, stopping collecting the video information stream, and determining a plug flow ending prompt mode corresponding to the first head identification based on the first head identification; and prompting the server to finish the stream pushing through a stream pushing finish prompting mode corresponding to the first head identification. By means of the method and device for pushing the video information stream, the scene limitation of pushing the video information stream can be reduced by means of the cloud technology.

Description

Information flow pushing method, device, equipment and computer readable storage medium
Technical Field
The present application relates to cloud technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for pushing an information stream.
Background
Live broadcasting is a new online social contact mode, and live multimedia contents such as audio and video of a live broadcasting end can be shared to different online users for watching in real time through a cloud technology. When the live broadcast is carried out, the live broadcast end needs to uninterruptedly push the live broadcast content, namely the video information stream to the live broadcast server, and the live broadcast server distributes the received video information stream to the terminals of audiences, so that the live broadcast is realized. In the related art, a protocol for pushing a video information stream during live broadcasting has a small range of a stream pushing scene, so that the scene pushed by the video information stream has high limitation.
Disclosure of Invention
The embodiment of the application provides a method, a device and equipment for pushing an information stream and a computer-readable storage medium, which can reduce the scene limitation of video information stream pushing.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a method for pushing an information stream, which comprises the following steps:
responding to the push flow triggering operation, and sending a request of a hypertext transfer protocol carrying a first head identification to a server; the first header identification is used for prompting the server to continuously receive the pushed video information stream;
continuously collecting the video information stream, and continuously pushing the video information stream to the server through a request of the hypertext transfer protocol;
in response to a plug flow ending operation, stopping collecting the video information stream, and determining a plug flow ending prompt mode corresponding to the first head identification based on the first head identification;
and prompting the server to finish the plug flow through a plug flow finish prompting mode corresponding to the first head identification.
In some embodiments of the present application, after sending the request of the hypertext transfer protocol carrying the first header identifier to the server, before the continuously acquiring the video information stream and continuously pushing the video information stream to the server through the request of the hypertext transfer protocol, the method further includes:
receiving a connection success message returned by the server aiming at the request of the hypertext transfer protocol;
and responding to the connection success message, continuously acquiring the video information stream, and continuously pushing the video information stream to the server through a request of the hypertext transfer protocol.
In some embodiments of the present application, after the request for carrying the encoded data block of the preset size on the hypertext transfer protocol is sent to the server, and the server is prompted to terminate the stream pushing, the method further includes:
and sending any request message to the server by using the request of the hypertext transfer protocol.
The embodiment of the application provides a method for pushing an information stream, which comprises the following steps:
receiving a request of a hypertext transfer protocol carrying a first header identifier sent by stream pushing equipment;
continuously reading out a video information stream from the hypertext transfer protocol request in response to the hypertext transfer protocol request;
and when the stream pushing equipment is detected to utilize a stream pushing ending prompting mode corresponding to the first header identification to prompt the end of the stream pushing, stopping reading the video information stream from the request of the hypertext transfer protocol.
In some embodiments of the application, after said stopping reading said stream of video information from said request of hypertext transfer protocol, said method further comprises:
determining a pull stream ending prompt mode corresponding to the second head identification of the pull stream equipment based on the second head identification;
and prompting the pull stream ending prompt mode corresponding to the second head mark to end the pull stream of the pull stream equipment.
The embodiment of the application provides a method for pushing an information stream, which comprises the following steps:
when the stream pulling operation is detected, sending a stream pulling message to a server, and displaying a video presentation interface;
receiving a response of the server to the hypertext transfer protocol sent by the pull stream message;
continuously analyzing video stream information from the response of the hypertext transfer protocol; the video information stream is transmitted to the server by a stream pushing device through a request carrying a hypertext transfer protocol prompting the server to continuously receive a first header identifier of the pushed video information stream;
and displaying the video information stream on the live broadcast presentation interface.
In some embodiments of the present application, after continuously parsing out video stream information from the response of the hypertext transfer protocol, the method further comprises:
when detecting that the response of the hypertext transfer protocol carries a coded data block with a preset size, stopping analyzing the video information stream from the response of the hypertext transfer protocol, and displaying an end prompt message on the video presentation interface; alternatively, the first and second electrodes may be,
and when detecting that the response of the hypertext transfer protocol is closed, stopping analyzing the video information stream from the response of the hypertext transfer protocol, and displaying the finishing prompt information on the video presentation interface.
The embodiment of the application provides a class device pushes away, its characterized in that includes:
the first sending module is used for responding to the plug flow triggering operation and sending a request of a hypertext transfer protocol carrying a first head identification to the server; the first header identification is used for prompting the server to continuously receive the pushed video information stream; continuously pushing the video information stream to the server through a request of the hypertext transfer protocol;
the video recording module is used for continuously acquiring the video information stream; stopping collecting the video information stream in response to a plug flow ending operation;
the prompt determining module is used for determining a plug flow ending prompt mode corresponding to the first head identification based on the first head identification;
and the prompt execution module is used for prompting the server to finish the plug flow through the plug flow finish prompt mode corresponding to the first head identification.
In some embodiments of the present application, the first head identification comprises: and transmitting a head mark by block coding, wherein a stream pushing end prompting mode corresponding to the first head mark comprises the following steps: prompting that the stream pushing is finished based on the coded data block with the preset size carried in the request of the hypertext transfer protocol;
and the prompt execution module is further configured to carry the encoded data block with the preset size on the request of the hypertext transfer protocol, and send the request to the server to prompt the server to terminate the stream pushing.
In some embodiments of the present application, the first head identification comprises: unilaterally closing the connection head identification, wherein the plug flow end prompting mode corresponding to the first head identification comprises the following steps: prompting an end of a push flow based on a request to close the hypertext transfer protocol;
the prompt execution module is further configured to close the request of the hypertext transfer protocol, and prompt the server to terminate the stream pushing.
In some embodiments of the present application, the flow impelling apparatus further comprises: a first receiving module;
the first receiving module is configured to receive a connection success message returned by the server in response to the request of the hypertext transfer protocol;
the video recording module is further used for responding to the connection success message and continuously acquiring the video information stream;
the first sending module is further configured to continuously push the video information stream to the server according to a request of the hypertext transfer protocol.
In some embodiments of the present application, the first sending module is further configured to send any request message to the server by using the request of the hypertext transfer protocol.
An embodiment of the present application provides an information distribution apparatus, including:
the second receiving module is used for receiving a request of the hypertext transfer protocol carrying the first head identifier, which is sent by the stream pushing equipment;
the information reading module is used for responding to the request of the hypertext transfer protocol and continuously reading a video information stream from the request of the hypertext transfer protocol; and when the stream pushing equipment is detected to utilize a stream pushing ending prompting mode corresponding to the first header identification to prompt the end of the stream pushing, stopping reading the video information stream from the request of the hypertext transfer protocol.
In some embodiments of the present application, the first head identification comprises: and transmitting a head mark by block coding, wherein a stream pushing end prompting mode corresponding to the first head mark comprises the following steps: prompting that the stream pushing is finished based on the coded data block with the preset size carried in the request of the hypertext transfer protocol;
the information reading module is further configured to stop reading the video information stream from the request of the hypertext transfer protocol when it is detected that the request of the hypertext transfer protocol carries the encoded data block of the preset size.
In some embodiments of the present application, the first head identification comprises: unilaterally closing the connection head identification, wherein the plug flow end prompting mode corresponding to the first head identification comprises the following steps: prompting an end of a push flow based on a request to close the hypertext transfer protocol;
the information reading module is further configured to stop reading the video information stream from the request of the hypertext transfer protocol when detecting that the request of the hypertext transfer protocol is turned off.
In some embodiments of the present application, the information distribution apparatus further includes: a second sending module;
the second receiving module is further configured to receive a pull stream message sent by a pull stream device; the stream pulling message is used for pulling a video information stream;
the second sending module is configured to send, to the pull stream device, a response of the hypertext transfer protocol carrying the second header identifier in response to the pull stream message; the second header identification is used for prompting the pull streaming device to continuously receive the video information stream; and continuously sending the video information stream to the pull streaming device through the response of the hypertext transfer protocol.
In some embodiments of the present application, the second sending module is further configured to send a connection success message for the request of the hypertext transfer protocol to a stream pushing device.
In some embodiments of the present application, the information distribution apparatus further includes: a pull flow end prompt module;
the pull stream ending prompt module is used for determining a pull stream ending prompt mode corresponding to the second head identifier of the pull stream equipment based on the second head identifier; and prompting the pull stream ending prompt mode corresponding to the second head mark to end the pull stream of the pull stream equipment.
In some embodiments of the present application, the pull stream end prompting module is further configured to carry the encoded data block with the preset size on a response of the hypertext transfer protocol, and send the response to the pull stream device, so as to prompt the pull stream device to end a pull stream; or closing the response of the hypertext transfer protocol and prompting the pull stream equipment to finish the pull stream.
The embodiment of the application provides a draw and flow device, includes:
the third sending module is used for sending the pull flow message to the server when the pull flow operation is detected;
the information display module is used for displaying a live broadcast presentation interface;
a third receiving module, configured to receive a response of the server to a hypertext transfer protocol sent by the pull message;
the information flow analysis module is used for continuously analyzing the video flow information from the response of the hypertext transfer protocol; the video information stream is transmitted to the server by a stream pushing device through a request carrying a hypertext transfer protocol prompting the server to continuously receive a first header identifier of the pushed video information stream;
the information display module is further used for displaying the video information stream on the live broadcast presentation interface.
In some embodiments of the present application, the information flow parsing module is further configured to, when it is detected that a response of the hypertext transfer protocol carries a coded data block of a preset size, stop parsing the video information flow from the response of the hypertext transfer protocol, and display an end prompt information on the video presentation interface; or when detecting that the response of the hypertext transfer protocol is closed, stopping analyzing the video information stream from the response of the hypertext transfer protocol, and displaying the end prompt information on the video presentation interface.
The embodiment of the application provides a plug flow equipment, includes:
a first memory for storing executable information stream push instructions;
the first processor is configured to, when executing the executable information stream pushing instruction stored in the first memory, implement the information stream pushing method provided by the stream pushing device side in the embodiment of the present application.
An embodiment of the present application provides a server, including:
a second memory for storing executable information stream push instructions;
and the second processor is configured to implement the information stream pushing method provided by the server side in the embodiment of the present application when executing the executable information stream pushing instruction stored in the second memory.
The embodiment of the application provides a equipment of drawing a class, includes:
a third memory for storing executable information stream push instructions;
and the third processor is configured to, when executing the executable information stream pushing instruction stored in the third memory, implement the information stream pushing method provided by the stream pulling device side in the embodiment of the present application.
The embodiment of the present application provides a computer-readable storage medium, which stores an executable information stream pushing instruction, and is used for causing a first processor to execute, so as to implement a method for pushing an information stream provided by a stream pushing device side in the embodiment of the present application; or the second processor is configured to implement the push method for the information stream provided by the server side in the embodiment of the present application when the second processor is caused to execute; and the pushing method is used for causing the third processor to execute so as to realize the information flow provided by the pull flow device side in the embodiment of the application.
The embodiment of the application has the following beneficial effects: because the stream pushing equipment pushes the live information stream through the request of the hypertext transfer protocol, the video information stream can be continuously pushed to the server by means of the wide use of the hypertext transfer protocol, no matter an application program, a browser and the like in the stream pushing equipment, namely, only one transmission protocol is utilized, the comprehensive coverage of the stream pushing scene on the internet is realized, the stream pushing scene is richer, and the scene limitation of video information stream pushing is reduced.
Drawings
Fig. 1 is a schematic diagram of an alternative architecture of an information flow pushing system 100 provided in an embodiment of the present application;
FIG. 2 is a schematic structural diagram of the plug flow device in FIG. 1 according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of the server in FIG. 1 according to an embodiment of the present disclosure;
FIG. 4 is a schematic structural diagram of the flow pulling apparatus in FIG. 1 according to an embodiment of the present disclosure;
fig. 5 is a first alternative flow chart of a method for pushing an information stream according to an embodiment of the present application;
fig. 6 is a schematic flow chart diagram of an alternative information flow pushing method according to an embodiment of the present application;
fig. 7 is a schematic flowchart of a process of pushing a live stream and pulling a live stream based on an HTTP protocol according to an embodiment of the present application;
fig. 8 is a schematic diagram of a process of reading a live stream by a media server according to an embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, references to the terms "first \ second \ third" are only to distinguish similar objects and do not denote a particular order, but rather the terms "first \ second \ third" are used to interchange specific orders or sequences, where appropriate, so as to enable the embodiments of the application described herein to be practiced in other than the order shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
1) Cloud Technology refers to a hosting Technology for unifying resources of hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data.
The cloud technology is based on the general names of network technology, information technology, integration technology, management platform technology, application technology and the like applied in the cloud computing business model, can form a resource pool, is used as required, and is flexible and convenient. Cloud computing technology will become an important support. Background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture-like websites and more web portals. With the high development and application of the internet industry, each article may have its own identification mark and needs to be transmitted to the subsequent embodiment for logic processing, data of different levels are processed separately, and various industry data need strong system support and can only be realized through cloud computing.
2) Live broadcasting can be realized, so that audiences can watch far-end live scenes through a network, and a party initiating the live broadcasting shares multimedia contents such as live audio, video and the like to the audiences in real time. Live broadcast is an emerging social approach with more and more users on the network.
3) The video information stream pushing refers to pushing live content, namely live information stream composed of multimedia content to a server uninterruptedly, so that the server distributes the information stream to terminals of audiences watching live broadcast, and the live broadcast process is realized.
4) A stream pushing device, a terminal generating a multimedia information stream, that is, a terminal used by a main broadcast during live broadcasting, that is, a live broadcast terminal.
5) The stream pulling device is a terminal for receiving the multimedia information stream, namely a terminal used by the audience when watching the live broadcast, namely a playing terminal. In one live broadcast, the number of playing devices may be 0 to N.
6) And the server is a bridge between the live broadcast end and the playing end. In a live broadcast, the stream pushing equipment sends the generated multimedia information stream to the server, and the server sends the multimedia information stream to the audience.
7) The hypertext Transfer Protocol (HTTP) is a Protocol of an application layer, and is the most widely used network Protocol on the internet.
Live broadcasting is used as a novel online social mode, and live multimedia contents such as audio and video of a live broadcasting end can be shared by different online users in real time to be watched, so that the online social mode is richer. When the live broadcast is carried out, the live broadcast end is responsible for generating live broadcast content, namely, generating a multimedia live broadcast information stream, and then continuously pushing the live broadcast information stream to a live broadcast server. The live broadcast server distributes the received information stream to the terminals of the audiences, namely to the playing end, and the playing end plays the received multimedia live broadcast information stream, thereby realizing the real-time playing of the live broadcast.
In the live broadcast field, there are a few protocols that can be used for live broadcast information stream push, including: Real-Time Messaging Protocol (RTMP) and its variants, Real-Time Streaming Protocol (RTSP) based on Real-Time Transport Protocol (RTP) or Real-Time Transport Control Protocol (RTCP), Streaming media network Protocol (HTTP Live Streaming, HLS) based on hypertext Transport Protocol (HTTP), full duplex Communication Protocol (WebSocket) based on TCP, and Web Real-Time Communication (WebRTC).
RTMP is a protocol developed for audio, video and data transfer between Flash players and servers. There are three variants of RTMP, respectively: a clear text protocol operating over TCP uses port 1935, RTMPT (transparent firewall) resulting from encapsulating RTMP in an HTTP request, and RTMPs resulting from encapsulating RTMP in HTTPs. The RTMP and its variants use real-time streaming, which has its own handshaking means and its own user control commands, e.g. credit, Publish, Play, Unpublish, etc., by which the RTMP is very suitable for pushing information streams during live broadcast, even when pushing live broadcast information streams, not so many control commands are used. The RTMP has the advantages of being simple to implement, simple to access, capable of meeting requirements of live broadcast information stream pushing, and capable of directly pushing live broadcast information streams as long as Flash plug-ins are loaded in a browser.
However, RTMP has not been updated for a long time and RTMP itself is not compatible with video encoded in h.265 format and does not support audio beyond 44.1k up-sampling rate. Moreover, Flash is no longer popular and is rarely used, so that the RTMP cannot be directly watched in a browser or can not pass through a firewall, so that the RTMP cannot cover most of live information stream pushing scenes of the Internet, and the live information stream can be pushed only by using a webpage supporting Flash. Meanwhile, the RTMPT, a variation of RTMP, is implemented based on the HTTP protocol, so that live information streams can be pushed using the HTTP protocol, and firewalls can be punctured. However, the implementation of the RTMPT is complicated, and depends on the support of the live server Keep-Alive, obtains a unique ID through one HTTP request, and then transmits data by initiating a new POST request every time there is data. In addition, the control instruction in the RTMPT protocol is supported only by a specific streaming server, and any other server does not support the control instruction, so that the use of the RTMPT is limited, that is, the RTMPT can only cover a live information stream push scene with a specific streaming server, for example, only can push a live information stream on a webpage supporting Flash.
RTP is a transmission protocol for live information stream on the internet, and RTP is composed of two closely connected parts, which are: RTP-the transmission of data with real-time attributes, RCTP-the monitoring of server quality and the transmission of information of the ongoing session participants. The RTP Protocol is built on the User Datagram Protocol (UDP), which specifies the standard packet format for transmitting audio and video over the internet. The RTP protocol is used in conjunction with the RTCP protocol in streaming media systems, video conferencing, and video telephony systems. The RTP protocol does not provide an on-time delivery mechanism or other Quality of Service (QoS) guarantees, and thus RTP does not guarantee delivery or prevent out-of-order delivery, nor does it determine the reliability of the underlying network. RTP implements ordered delivery, allowing the receiver to reassemble the sender's packet sequence based on the sequence numbers, while the sequence numbers can also be used to determine the appropriate packet position, e.g., in video decoding, without requiring sequential decoding. RTCP is a sister protocol of RTP. RTCP provides off-channel control of the RTP information flow, and RTCP regularly transmits control data between multimedia session participants, so that the main function of RCTP is to provide feedback on the quality of service provided by RTP. RTCP collects statistics about the media connections, e.g. collects the number of bytes transmitted, the number of packets lost, the delay jitter, the one-way and two-way network delays, etc. The application may use the information provided by RTCP to improve the quality of service, for example, to limit the traffic or instead compress a less compressed codec. RTCP itself does not provide data encryption or authentication, and its companion Protocol Secure-time Transport Control Protocol (SRTCP) can be used for such purposes.
The RSTP protocol is architecturally located on top of the RTP protocol and the RTCP protocol, which define how a pair of applications efficiently transport multimedia data over an IP network, i.e. define the stream format, the stream data being transported via RTP. The RTSP can transmit data based on RTP, and also can select channels such as TCP, UDP, and multicast UDP to transmit data, so that the RTSP has good expansibility, and is a network application protocol similar to the HTTP protocol. Compared with the HTTP, the RTSP has the advantages that webpage data sent by the HTTP and multimedia data transmitted by the RTSP are obtained; HTTP is a request from the terminal and the server responds, RTSP can be bi-directional, i.e. both the terminal and the server can make requests. Although RTSP has a good real-time effect and is suitable for the video chat and video monitoring directions, RTSP is complex to implement, and only the quality of service can be improved according to the information collected by RTCP, rather than the final means of improving the quality of service. Most importantly, although the RTSP protocol is similar to the HTTP protocol, the HTTP protocol is not actually used, and thus, the RTSP cannot push the live stream directly in the browser and may not be able to pass through the firewall.
The HLS directly generates a video slice file at a terminal, then uploads the slice file of the live broadcast information stream to a server in an HTTP uploading mode, and then the server updates a playlist to achieve the live broadcast function. The HLS directly uses the HTTP protocol, which facilitates access cost under the internet, however, the delay of the HLS is affected by the size of the slice file, and the transmission process is discontinuous. For example, the bit rate of the original live broadcast information stream is relatively uniform, but each time a slice file is requested, the bandwidth is suddenly increased by a small spike, so that the method is not suitable for low-delay live broadcast and is suitable for video on demand. As can be seen, HLS does not cover well the push scenario of live information stream.
The WebSocket is an upgrading version of an HTTP protocol, and can upgrade TCP connection used by the HTTP protocol into a bidirectional intercommunication mode, so that a terminal can push live broadcast information streams during live broadcast through the WebSocket, and then a server reads data from the TCP connection. WebRTC is a standard real-time communication protocol in HTML5, which exists for the purpose of implementing real-time communication of audio and video between two parties. However, WebSocket and WebRTC are not well supported on the mobile side and are implemented more heavily, and thus are rarely used by the mobile side. Therefore, WebSocket and WebRTC are difficult to cover the terminal, so that the WebSocket and WebRTC are difficult to cover a scene of pushing a live broadcast information stream in the terminal.
As can be seen from the above description, protocols used in the related art for pushing the live broadcast information stream all have a pushing scene of the live broadcast information stream that is difficult to cover, in other words, the protocols used in the related art for pushing the live broadcast information stream all can only respectively cover one smaller live broadcast information stream pushing scene, that is, the range of the live broadcast information stream pushing scene that can be covered by the protocols is smaller, so that the limitation on the scene for pushing the live broadcast information stream is higher.
Moreover, because the data formats supported by a part of protocols are limited, only live information streams in specific formats can be pushed, and live information streams in some formats can not be pushed in live broadcasting, so that the scene limitation of live information stream pushing is further promoted. Meanwhile, when a part of protocols push information streams, the information streams need to be sliced, so that the transmission speed of the information streams is unstable. When information flow pushing is carried out based on a part of protocols, the pushing address only comprises a target address, an issuing point and a flow ID, so that the flexibility of the pushing address is low.
Based on the above problems, the application provides a new live broadcast information stream pushing mode, so that live broadcast information stream pushing can cover any corner of the internet, the range of the covered live broadcast information stream pushing scene is enlarged as much as possible, and the limitation of the live broadcast information stream pushing scene is reduced.
Since the HTTP protocol is the most widely used protocol on the internet, it can be used to pull a live stream of information, but cannot push it. Pulling live stream information is essentially equivalent to downloading a "infinitely large" large file (since the live is not known when to end and the size of the pulled video is unknown). However, the HTTP protocol implements a download scheme for large files of unknown size in two ways: the server uses a special header identifier in a Response message (Response message of HTTP) to inform that the size of the live broadcast information stream is unknown, so that the terminal only needs to continuously receive the live broadcast information stream. For example, the server informs the terminal that the size of the live broadcast information stream to be sent currently is unknown length through a Transfer-Encoding (chunked) header identifier in response, and sends a data packet to the terminal until the live broadcast is finished, and sends a last data packet with the size of 0 to indicate that the live broadcast is finished; or the server closes the header of the connection (close) unilaterally when responding, and simultaneously informs the terminal that the size of the live broadcast information stream to be sent is unknown Length by using the header without the size (Content-Length) of the response body, when the live broadcast is finished, the server directly disconnects the connection of the response, such as the TCP connection of the response, and the terminal senses that the connection of the response generates errors, thereby finishing the live broadcast.
The above is the process of pulling the live information stream using the HTTP protocol, however, in the live information stream pushing process, the terminal cannot notify the server to pull the live information stream from the terminal by one request, because: pulling the live information stream means that the server initiates a request to the terminal, but due to the existence of the firewall, the terminal cannot monitor the request initiated by the server, so that the HTTP request for the server to pull the live information stream from the terminal cannot be initiated, and the server cannot pull the live information stream from the terminal.
In the HTTP protocol, a terminal transmits data to a server by using a Request message of HTTP (Request message of HTTP). However, in the HTTP protocol, there is no provision for requesting methods to be unable to use special header identifications, such as Transfer-Encoding: a chunked header or a short link (carrying a Connection: close header) of Content-Length to continue the process of transmitting the request.
Based on the above idea, in the embodiment of the present application, a request carrying the same specific header identifier as that in the HTTP response method may be used to continuously push a live information stream to the server, and the server is responsible for continuously reading data from the request sent by the terminal.
The embodiment of the application provides a method, a device and equipment for pushing an information stream and a computer-readable storage medium, which can reduce the scene limitation of video information stream pushing. The following describes exemplary applications of the stream pushing device, the server, and the playing device provided in the embodiments of the present application, and the stream pushing device and the playing device provided in the embodiments of the present application may be implemented as various types of user terminals, and may also be implemented as a server. The server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and can also be a cloud server providing basic cloud computing services such as a cloud server, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, a big data and artificial intelligence platform, and the like. The user terminal may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, and the like. The user terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein. Exemplary applications of the push streaming device, the playback device, and the server will be described below.
Referring to fig. 1, fig. 1 is an alternative architecture diagram of an information flow pushing system 100 provided in this embodiment of the present application, in order to implement supporting an information flow pushing application, a flow pushing device 200, a server 400, and a flow pulling device 500 are connected via a network 300, where the network 300 may be a wide area network or a local area network, or a combination of the two.
When the stream pushing device 200 detects a push trigger operation on a "start live" virtual key of the graphical interface 200-1, it will send a request of a hypertext transfer protocol carrying a first header identifier to the server 400 in response to the push trigger operation, where the first header identifier is used to prompt the server to continuously receive a pushed video information stream. The server 400 receives a hypertext transfer protocol request carrying a first header identifier sent by the stream pushing device 200.
Thereafter, the stream pushing device 200 continuously collects the video information stream and continuously transmits the video information stream to the server 400 by a request of the hypertext transfer protocol. The server 400 continues to read the video stream from the http request in response to the http request. Meanwhile, when the pull stream device 500 detects a pull stream operation of the user, a pull stream message is sent to the server 400, and a live presentation interface is displayed on the graphical interface 500-1. After receiving the pull stream message sent by the pull stream device 500, the server 400 sends a response of the hypertext transfer protocol carrying a second header identifier to the pull stream device 500 in response to the pull stream message, where the second header identifier is used to prompt the pull stream device to continuously receive the video information stream, and continuously sends the video information stream to the pull stream device 500 through the response of the hypertext transfer protocol. After receiving the response of the server 400 to the hypertext transfer protocol sent by the pull message, the pull device 500 continuously parses the video information stream from the response of the hypertext transfer protocol, and displays the video information stream on the live presentation interface.
When the plug flow device 200 detects a plug flow ending operation, in response to the plug flow ending operation, the collection of the video information stream is stopped, a plug flow ending prompt mode corresponding to the first head identifier is determined based on the first head identifier, and the server 400 is prompted to end the plug flow by the plug flow ending prompt mode corresponding to the first head identifier. When the server 400 detects that the stream pushing equipment 200 prompts the stream pushing to be ended by using the stream pushing ending prompting mode corresponding to the first header identification, the server stops reading the video information stream from the hypertext transfer protocol request. Meanwhile, the server 400 also uses the pull stream termination prompting manner corresponding to the second header identifier to prompt the pull stream device 500 that the pull stream has been terminated.
Referring to fig. 2, fig. 2 is a schematic structural diagram of the flow pushing device in fig. 1 according to an embodiment of the present disclosure, and the flow pushing device 200 shown in fig. 2 includes: at least one first processor 210, a first memory 250, at least one first network interface 220, and a first user interface 230. The various components in the plug flow device 200 are coupled together by a first bus system 240. It is understood that the first bus system 240 is used to enable communications for connections between these components. The first bus system 240 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as a first bus system 240 in fig. 2.
The first Processor 210 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc., wherein the general purpose Processor may be a microprocessor or any conventional Processor, etc.
The first user interface 230 includes one or more first output devices 231, including one or more speakers and/or one or more visual display screens, that enable presentation of media content. The first user interface 230 also includes one or more first input devices 232, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The first memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. The first memory 250 optionally includes one or more storage devices physically located remotely from the first processor 210.
The first memory 250 includes volatile memory or nonvolatile memory and may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The first memory 250 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, the first memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.
A first operating system 251 including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
a first network communication module 252 for communicating to other computing devices via one or more (wired or wireless) first network interfaces 220, an exemplary first network interface 220 comprising: bluetooth, wireless-compatibility authentication (Wi-Fi), and Universal Serial Bus (USB), etc.;
a first presentation module 253 to enable presentation of information (e.g., a user interface for operating peripherals and displaying content and information) via one or more first output devices 231 (e.g., a display screen, speakers, etc.) associated with the first user interface 230;
a first input processing module 254 for detecting one or more user inputs or interactions from one of the one or more first input devices 232 and translating the detected inputs or interactions.
In some embodiments, the plug flow device provided by the embodiments of the present application may be implemented in software, and fig. 2 illustrates a plug flow device 255 stored in the first memory 250, which may be software in the form of programs and plug-ins, and includes the following software modules: first sending module 2551, video recording module 2552, cue determining module 2553, cue executing module 2554, and first receiving module 2555, which are logical and thus can be arbitrarily combined or further divided according to the functions implemented. The functions of the respective modules will be explained below.
In other embodiments, the stream pushing Device provided in this embodiment of the present application may be implemented in hardware, and for example, the stream pushing Device provided in this embodiment of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the pushing method of the information stream provided in this embodiment of the present application, for example, the processor in the form of the hardware decoding processor may employ one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), or other electronic components.
Illustratively, an embodiment of the present application provides a flow pushing device, including:
a first memory for storing executable information stream push instructions;
the first processor is configured to, when executing the executable information stream pushing instruction stored in the first memory, implement the information stream pushing method provided by the stream pushing device side in the embodiment of the present application.
Referring to fig. 3, fig. 3 is a schematic structural diagram of the server in fig. 1 according to an embodiment of the present disclosure, where the server 400 shown in fig. 3 includes: at least one second processor 410, a second memory 450, at least one second network interface 420, and a second user interface 430. The various components in the server 400 are coupled together by a second bus system 440. It is understood that the second bus system 440 is used to enable connection communication between these components. The second bus system 440 includes a power bus, a control bus, and a status signal bus in addition to the data bus. For clarity of illustration, however, the various buses are labeled as the second bus system 440 in fig. 3.
The second Processor 410 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The second user interface 430 comprises one or more first output devices 431, including one or more speakers and/or one or more visual displays, that enable the presentation of media content. The second user interface 430 also includes one or more second input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The second memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. The second memory 450 optionally includes one or more storage devices physically located remote from the second processor 410.
The second memory 450 includes either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The second memory 450 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, the second memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.
A second operating system 451 including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
a second network communication module 452 for communicating to other computing devices via one or more (wired or wireless) second network interfaces 420, the example second network interfaces 420 including: bluetooth, wireless-compatibility authentication (Wi-Fi), and Universal Serial Bus (USB), etc.;
a second rendering module 453 for enabling the rendering of information (e.g., user interfaces for operating peripherals and displaying content and information) via one or more second output devices 431 (e.g., display screens, speakers, etc.) associated with the second user interface 430;
a second input processing module 454 for detecting one or more user inputs or interactions from one of the one or more second input devices 432 and translating the detected inputs or interactions.
In some embodiments, the information distribution apparatus provided in the embodiments of the present application may be implemented in software, and fig. 3 illustrates the information distribution apparatus 455 stored in the second memory 450, which may be software in the form of programs and plug-ins, and includes the following software modules: a second receiving module 4551, an information reading module 4552, a second sending module 4553 and a pull stream end prompting module 4554, which are logical and thus can be arbitrarily combined or further split according to the implemented functions. The functions of the respective modules will be explained below.
In other embodiments, the information distribution apparatus provided in the embodiments of the present Application may be implemented in hardware, and for example, the information distribution apparatus provided in the embodiments of the present Application may be a processor in the form of a hardware decoding processor, which is programmed to execute the pushing method of the information stream provided in the embodiments of the present Application, for example, the processor in the form of the hardware decoding processor may employ one or more Application Specific Integrated circuits (AS ICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), or other electronic components.
Illustratively, an embodiment of the present application provides a server, including:
a second memory for storing executable information stream push instructions;
and the second processor is configured to implement the information stream pushing method provided by the server side in the embodiment of the present application when executing the executable information stream pushing instruction stored in the second memory.
Referring to fig. 4, fig. 4 is a schematic structural diagram of the flow pulling apparatus in fig. 1 according to an embodiment of the present disclosure, where the flow pulling apparatus 500 shown in fig. 4 includes: at least one third processor 510, a third memory 550, at least one third network interface 520, and a third user interface 530. The various components in the stream pulling apparatus 500 are coupled together by a third bus system 540. It will be appreciated that the third bus system 540 is used to enable connection communications between these components. The third bus system 540 comprises a power bus, a control bus and a status signal bus in addition to a data bus. But for clarity of illustration the various buses are labeled as the third bus system 540 in figure 4.
The third Processor 510 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc., wherein the general purpose Processor may be a microprocessor or any conventional Processor, etc.
The third user interface 530 comprises one or more third output devices 531 enabling presentation of the media content, comprising one or more speakers and/or one or more visual display screens. The third user interface 530 also includes one or more third input devices 532 including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The third memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. The third memory 550 optionally includes one or more storage devices physically located remote from the third processor 510.
The third memory 550 may comprise either volatile memory or nonvolatile memory, and may also comprise both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The third memory 550 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, the third memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.
A third operating system 551 including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
a third network communication module 552 for communicating to other computing devices via one or more (wired or wireless) third network interfaces 520, the exemplary third network interface 520 comprising: bluetooth, wireless-compatibility authentication (Wi-Fi), and Universal Serial Bus (USB), etc.;
a third rendering module 553 for enabling the rendering of information (e.g., user interfaces for operating peripherals and displaying content and information) via one or more third output devices 531 (e.g., display screens, speakers, etc.) associated with the third user interface 530;
a third input processing module 554 for detecting one or more user inputs or interactions from one of the one or more third input devices 532 and translating the detected inputs or interactions.
In some embodiments, the stream pulling apparatus provided in this embodiment of the present application may be implemented in software, and fig. 4 illustrates a stream pulling apparatus 555 stored in the third memory 550, which may be software in the form of programs and plug-ins, and includes the following software modules: the third sending module 5551, the information presenting module 5552, the third receiving module 5553, and the information flow parsing module 5554 are logical, and thus may be arbitrarily combined or further split according to the implemented functions. The functions of the respective modules will be explained below.
In other embodiments, the stream pulling apparatus provided in this embodiment may be implemented in hardware, and for example, the stream pulling apparatus provided in this embodiment may be a processor in the form of a hardware decoding processor, which is programmed to execute the method for pushing information streams provided in this embodiment, for example, the processor in the form of the hardware decoding processor may be one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), or other electronic components.
Illustratively, an embodiment of the present application provides a stream pulling apparatus, including:
a third memory for storing executable information stream push instructions;
and the third processor is configured to, when executing the executable information stream pushing instruction stored in the third memory, implement the information stream pushing method provided by the stream pulling device side in the embodiment of the present application.
The information flow pushing method provided by the embodiment of the present application will be described below with reference to exemplary applications and implementations of a stream pushing device, a server, and a stream pulling device provided by the embodiment of the present application. It should be noted that the information stream pushing method provided by the present application may be implemented by means of a cloud technology.
Referring to fig. 5, fig. 5 is a first alternative flowchart of a pushing method of an information flow provided by an embodiment of the present application, which will be described with reference to the steps shown in fig. 5.
S101, the stream pushing equipment responds to stream pushing triggering operation and sends a request of a hypertext transfer protocol carrying a first head identification to a server; the first header identification is used to prompt the server to continue receiving the pushed video information stream.
The method and the device are realized in the scene that the user transmits live broadcast content to the server end through the stream pushing device, for example, the user uploads the live broadcast of the user to the server in real time through a live broadcast application program of a smart phone, or the user uploads the live broadcast of the user to the server in real time through a webpage of a personal computer. The method comprises the steps that a stream pushing device detects whether a user carries out stream pushing triggering operation or not in an operating state, when the stream pushing device detects the stream pushing triggering operation triggered by the user, the stream pushing device definitely starts live broadcasting at the current user, so that the stream pushing device responds to the stream pushing triggering operation triggered by the user to generate a request of a hypertext transfer protocol, the generated first head identification is carried in the request of the hypertext transfer protocol, and then the request of the hypertext transfer protocol carrying the first head identification is sent to a server through a network, so that the server definitely starts to push video information streams at the current time. And the server receives a request of the hypertext transfer protocol carrying the first header identification, which is sent by the stream pushing equipment.
It should be noted that, since the stream pushing device does not determine when the user will end the live broadcast, that is, the video information stream to be sent is unknown and infinite for the stream pushing device, in order to ensure that there is no pause or delay in the live broadcast as much as possible, the stream pushing device may continuously push the video information stream by using a long connection during stream pushing, so as to ensure that the server can continuously receive the video information stream without disconnecting the connection. Therefore, when the stream pushing device starts to push the video information stream, the first header identifier prompting the server to continuously receive the video information stream is generated, and the first header identifier is carried in the hypertext transfer protocol and sent to the server, so that the server is informed that the size of the video information stream to be transmitted is unknown, and the stream pushing device and the server are always in a connected state in the live broadcasting process.
It will be appreciated that in some embodiments of the present application, the push stream trigger operation may be a triggered operation event by a user on a display interface of the push stream device, for example, the user clicks a "start live" virtual button on a live web page, or clicks a "live give" virtual button on a main interface of a live application. The operation event triggered by the user on the display interface of the stream pushing device may be a click, a double click, or a long press, and the application is not limited herein.
In other embodiments of the present application, the push stream trigger operation may also be a voice instruction of the user, for example, a statement "start live now" spoken by the user, or a sound with a specific rhythm uttered by the user may be the push stream trigger operation. Further, before the live broadcast starts, a user may record a sound for starting the live broadcast on the stream pushing device, so that when the stream pushing device detects a sound similar to the recorded sound, it is determined that the stream pushing trigger operation of the user is currently detected.
It should be noted that the first header identifier is a header identifier selected from all available header identifiers of the hypertext transfer protocol, which can indicate that the size of the transfer data is unknown. In some embodiments, the stream pushing device may identify the block coded transmission header as the first header identification. In other embodiments, the stream pushing device may use the one-way close connection header as the first header without indicating the size of the video stream to inform that the size of the video stream is unknown.
Illustratively, the streaming device may use a Transfer-encoding: chunk header (chunk encoding transport header identification) in a Request of HTTP (hypertext Transfer protocol) to inform the server that the size of the stream of video information to be transmitted is unknown; the stream push device may use a Connect: close header (unilaterally closed connection header id) in the HTTP Request without specifying Content-length (size of video stream) to inform the server that the size of the video stream to be transmitted is unknown.
S102, continuously acquiring the video information stream by the stream pushing equipment, and continuously pushing the video information stream to the server through a request of a hypertext transfer protocol.
The stream pushing equipment continuously collects the live images and live sounds of the current scene after sending the hypertext transfer protocol request to the server and successfully establishing connection with the server, and integrates the collected live images and live sounds on a time axis, so that continuous collection of video information streams is realized. And then, the stream pushing equipment continuously sends the video information stream to the server by carrying the request body in the request of the hypertext transfer protocol. The server continues to read the video stream from the hypertext transfer protocol request in response to the hypertext transfer protocol request. Therefore, the server can obtain the video information stream continuously received by the push streaming device, so that the server can store the video information stream or distribute the video information stream to the pull streaming device of the audience. Wherein, the request body is specially used for storing the transmitted data in the request of the hypertext transfer protocol.
It should be noted that, because the request of the hypertext transfer protocol is a long connection, and the long connection is not disconnected before the end of the transmission, the stream pushing device can continuously send the generated video information stream to the server through the long connection, so that the transmission of the video information stream is completed by using only one long connection.
S103, the stream pushing equipment responds to the stream pushing ending operation, stops collecting the video information stream, and determines a stream pushing ending prompt mode corresponding to the first head identification based on the first head identification.
In practice, whether live broadcasting is finished or not is controlled by a user, so that the stream pushing equipment judges whether the user finishes the stream pushing according to whether the user triggers a stream pushing finishing operation or not. When the stream pushing equipment detects a stream pushing ending operation triggered by a user, it is clear that the live broadcast of the user is ended currently, so that the stream pushing equipment can respond to the stream pushing ending operation, stop collecting live images and live sounds of a current scene, stop generating video information streams and stop pushing streams. Meanwhile, the plug flow device may further select a plug flow end prompting mode corresponding to the first head identifier from the candidate prompting modes by using the first head identifier, so as to prompt the server to stop the plug flow device by using the determined plug flow end prompting mode in the subsequent process.
It is understood that the candidate cue modes refer to all cue modes that can be used to cue the server that the live broadcast is over. The candidate prompting modes can include prompting the server to finish the live broadcast through a coded data block with a preset size and prompting the live broadcast to finish directly by utilizing a request for closing the hypertext transfer protocol. Of course, the candidate prompting method may also include other prompting methods, and the present application is not limited in particular herein.
In the embodiment of the present application, the first header identifier is used to determine the corresponding push flow end prompting manner, so that the server can accurately determine the end of the push flow. This is because: because the hypertext transfer protocol is used to specify what the messages and responses are when data is transmitted, based on this, when the first header identifier does not correspond to the stream-pushing end prompting mode, for example, the first header identifier is a block-coded transmission header identifier, and the stream-pushing end prompting mode is a request for directly closing the hypertext transfer protocol, the server cannot clearly determine whether the current network is disconnected due to an error or disconnected due to the end of stream pushing; when the first header identifier indicates that the connection header identifier is closed unilaterally and the stream pushing end prompting manner indicates that the stream pushing is ended based on the encoded data block with the preset size, the server cannot clearly determine whether the data is lost due to a network error or the stream pushing is ended really. Therefore, in the embodiment of the present application, a stream pushing end prompting manner corresponding to the first header identifier should be selected to prompt the server that the stream pushing is ended.
It will be appreciated that the push stream end operation may be a triggered operational event by the user on the display interface of the push stream device, such as the user clicking a "end live" virtual button on a live web page, or a "close current live" virtual button on the host interface of an application providing live functionality. The operation event triggered by the user on the display interface of the stream pushing device may be a click, a double click, or a long press, and the application is not limited herein.
In other embodiments of the present application, the push stream ending operation may be a voice instruction of the user, for example, a "end live" statement spoken by the user, or a "thank you for watching, we see later" statement spoken by the user, and these statements may be regarded as push stream ending operations. Furthermore, a user can record a statement for triggering the end of live broadcast recording on the stream pushing equipment, so that when the stream pushing equipment detects the statement which is the same as or similar to the recorded statement for triggering the end of live broadcast to a certain degree, the stream pushing equipment confirms that the stream pushing end operation of the user is detected currently.
And S104, the stream pushing equipment prompts the server that the stream pushing is finished through a stream pushing finishing prompting mode corresponding to the first head identification.
After determining the push stream ending prompting mode corresponding to the first head identification, the push stream device executes an action specified by the push stream ending prompting mode to prompt that a server user ends the live broadcast, so as to prompt that the server needs to end the push stream. The process of pushing the video information stream to the server is completed by the stream pushing device.
It should be noted that, because the first header identifier may be a block coding transmission header identifier or may be a unilateral closing connection header identifier, the two different header identifiers can determine a push flow end prompting manner. And the live broadcast ending prompt mode determines whether the push streaming device and the server can still keep connection when the live broadcast ends, so that the first head mark can determine the connection condition between the push streaming device and the live broadcast server when the push streaming ends, and the push streaming device can conveniently determine in which mode to continue to communicate with the server subsequently.
And S105, when the server detects that the stream pushing equipment prompts the stream pushing to be ended by using the stream pushing ending prompting mode corresponding to the first header identification, stopping reading the video information stream from the request of the hypertext transfer protocol.
When the server detects that the stream pushing equipment utilizes the stream pushing ending prompt mode corresponding to the first head identification to prompt the user to end the live broadcast, the server can definitely end the current stream pushing, and therefore the process of reading the video information stream from a request body in the request of the hypertext transfer protocol is stopped in response to the stream pushing ending prompt mode.
In the embodiment of the application, the live information stream is pushed by the stream pushing equipment through the request of the hypertext transfer protocol, and the video information stream can be continuously pushed to the server by means of the wide application of the hypertext transfer protocol, so that the application program, the browser and the like in the stream pushing equipment can both realize the continuous pushing of the video information stream to the server, namely, only one transmission protocol is utilized, the comprehensive coverage of the stream pushing scene on the internet is realized, the stream pushing scene is richer, and the scene limitation of the video information stream pushing is reduced.
In addition, because the stream pushing equipment only utilizes the long connection of the request of the hypertext transfer protocol to realize the pushing of the video information stream, compared with the video information stream pushing mode of the related technology, the method and the device do not need to transmit the video information stream in a split mode, and the stability of the pushing of the video information stream is improved. Moreover, the hypertext transfer protocol supports more video information stream formats, for example, the video information streams in the FLV and FMP4 formats can be transmitted, so that the present application does not depend on the format of the video information stream when pushing the video information stream. Meanwhile, the hypertext transfer protocol has the advantages of being flexible in Uniform Resource Locator (URL), authentication, 302 hopping, session maintaining, load balancing scheduling capability and the like, so that the hypertext transfer protocol-based video streaming server also has the advantages of being flexible in URL, authentication, 302 hopping, session maintaining, load balancing scheduling capability and the like when a request based on the hypertext transfer protocol pushes a video information stream.
In some embodiments of the present application, the first head identification comprises: the method comprises the following steps of transmitting a head mark by block coding, wherein a stream pushing end prompting mode corresponding to a first head mark comprises the following steps: based on that the request of the hypertext transfer protocol carries the encoded data block with the preset size to prompt that the stream pushing is finished, in this case, the stream pushing device prompts the server to finish live broadcasting through a stream pushing finishing prompting mode corresponding to the first header identifier, that is, the specific implementation process of S104 may include: s1041, as follows:
s1041, the stream pushing equipment carries the coded data block with the preset size on the request of the hypertext transfer protocol, and sends the coded data block to the server to prompt the server to push the stream to be finished.
When the first header identification is the block coding transmission header identification, the stream pushing device transmits the live broadcast information stream to the server through the coding data block, so that the stream pushing device can prompt the server to push the stream to be ended through the coding data block with the preset size. When the stream pushing equipment detects the stream pushing ending operation of a user, the stream pushing equipment generates an encoded data block with a preset size, then carries the encoded data block with the preset size in a request body of a hypertext transfer protocol request, and sends the encoded data block with the preset size to the server, so that the server is prompted to finish the stream pushing by using the mode.
It is understood that the preset size may be set to 0 byte, may also be set to 10 bytes, and may also be set to other sizes according to actual requirements, which is not limited herein.
For example, when the stream pushing device detects that the user triggers a stream pushing ending operation, an encoded data packet with a size of 0 byte may be generated, and then the data table is carried in a Request of HTTP and sent to the server.
It should be noted that, in the embodiment of the present application, when the stream pushing device prompts the server to end stream pushing, the request for closing the hypertext transfer protocol is not made, so that the request for the hypertext transfer protocol can be continuously used for carrying data pushing from the stream pushing device to the server in the subsequent process according to the old active connection between the stream pushing device and the server.
That is, in some embodiments of the present application, after the streaming device sends a request for carrying an encoded data block of a preset size on the hypertext transfer protocol to the server and prompts the server to end the streaming, that is, after S1041, the method may further include: s1042, as follows:
s1042, the stream pushing device sends any request message to the server by using the request of the hypertext transfer protocol.
After prompting the server to finish the stream pushing, when the stream pushing equipment needs to interact with the server, a new connection does not need to be established with the server any more, and any generated request message can be directly sent to the server through a request of a hypertext transfer protocol.
For example, after the stream pushing device prompts the server to end, when the stream pushing device needs to send a request message for deleting an already stored video information stream to the server, or send a request message for pushing a new video information stream again to the server, the request message for deleting the already stored video information stream, or the request message for pushing the new video information stream again, may be carried in the request of the hypertext transfer protocol and sent to the server.
In the embodiment of the application, the stream pushing equipment can prompt the server to push the stream to finish by carrying the coded data block with the preset size on the request of the hypertext transfer protocol, so that the server can be prompted to push the stream to finish under the condition that the connection with the server is not disconnected.
In some embodiments of the present application, the first head identification comprises: unilateral closing of the connection head identification, the push flow end prompting mode corresponding to the first head identification comprises the following steps: based on the request for closing the hypertext transfer protocol, prompting, by the stream pushing device, that the stream pushing device prompts the server to end the stream pushing through a stream pushing end prompting manner corresponding to the first header identifier, that is, a specific implementation process of S104 may include: s1043, as follows:
s1043, the stream pushing equipment closes the request of the hypertext transfer protocol and prompts the server to finish the stream pushing.
When the first header identification contains the unilateral closing connection header identification, the push streaming device directly disconnects the request of the hypertext transfer protocol when the user finishes the live broadcasting, so that the transmission of any data or message to the server is stopped, and the server is prompted that the push streaming is finished.
It should be noted that, in the embodiment, since the stream pushing device directly closes the request of the hypertext transfer protocol, after the stream pushing is finished, the long connection between the stream pushing device and the server is already disconnected, and at this time, if the stream pushing device needs to send a message or data to the server, the connection with the server needs to be established again. That is, in the embodiment of the present application, once the stream push is finished, the requests of the hypertext transfer protocol used in the stream push cannot be reused.
It is understood that in the embodiment of the present application, the stream pushing device may not perform any encapsulation processing on the video information stream when transmitting the video information stream, that is, the stream pushing device may transmit pure audio and video data by a request of the hypertext transfer protocol.
In the embodiment of the application, the stream pushing equipment can prompt the server to push the stream to be ended by directly disconnecting the request of the hypertext transfer protocol with the server, so that the prompt of the stream pushing to be ended can be finished without generating auxiliary data packets or information except for video information stream.
In some embodiments of the present application, identifying at the first head comprises: the method comprises the following steps of transmitting a head mark by block coding, wherein a stream pushing end prompting mode corresponding to a first head mark comprises the following steps: based on the condition that the encoded data block with the preset size is carried in the hypertext transfer protocol request to prompt the end of the stream pushing, when the server detects that the stream pushing equipment utilizes the stream pushing end prompting mode corresponding to the first header identifier to prompt the end of the stream pushing, the specific implementation process of S105, which stops reading the video information stream from the hypertext transfer protocol request, may include: s1051, as follows:
s1051, when the server detects that the hypertext transfer protocol request carries the coded data block with the preset size, the server stops reading the video information stream from the hypertext transfer protocol request.
When the server reads the video information stream from the request of the hypertext transfer protocol, the server firstly analyzes the request of the hypertext transfer protocol, extracts a request body in the request of the hypertext transfer protocol, and then reads the coded data blocks from the request body so as to form the video information stream by utilizing the read coded data blocks. When the coded data block read out from the request body by the server is in the preset size, it is clear that the user has finished live broadcasting, that is, the stream pushing equipment has finished stream pushing, and the previously received coded data block already contains all video and audio data generated by the user during live broadcasting, at this time, the server does not read the video information stream from the request of the hypertext transfer protocol any more, and the reading process of the video information stream is also finished.
It should be noted that, in the embodiment of the present application, although the server has stopped reading the video information stream from the hypertext transfer protocol request, the hypertext transfer protocol request is not disconnected, that is, the server and the stream pushing device still maintain connection through the hypertext transfer protocol request, so that the server may also read other messages or data sent by the stream pushing device in the subsequent hypertext transfer protocol request.
In the embodiment of the application, when the server detects the coded data block with the preset size sent by the stream pushing device through the request of the hypertext transfer protocol, it is determined that the user has finished the live broadcast, so that the video information stream is stopped from being received under the condition that the connection with the stream pushing device is not disconnected.
In some embodiments of the present application, the first head identification comprises: unilateral closing of the connection head identifier, wherein the first live broadcast ending prompt mode comprises the following steps: the end of the push stream is prompted based on a request to close the hypertext transfer protocol. In this case, when the server detects that the stream pushing device indicates a corresponding stream pushing ending prompting manner by using the first header to prompt the end of the stream pushing, stopping reading the video information stream from the request of the hypertext transfer protocol, that is, a specific implementation manner of S105 may include: s1052, the following steps:
and S1052, when the server detects that the request of the hypertext transfer protocol is closed, stopping reading the video information stream from the request of the hypertext transfer protocol.
When the server detects that the stream pushing device has closed the hypertext transfer protocol request, it is clear that the stream pushing device has stopped the stream pushing, and it is clear that the user has finished the live broadcast, so that the server does not continue to read the video information stream from the hypertext transfer protocol request.
It will be appreciated that since the hypertext transfer protocol request has been closed, which corresponds to the server and the streaming device having been disconnected from each other, and the server request has no access to the streaming device, the communication link between the streaming device and the server is re-established only when the streaming device sends a new connection to the server.
In the embodiment of the application, when the server detects that the stream pushing device closes the request of the hypertext transfer protocol, the stream pushing device definitely ends, so that the video information stream is not read from the request of the hypertext transfer protocol any more, that is, the receiving process of the video information stream is ended.
In some embodiments of the present application, after sending, by the stream pushing device, a request of a hypertext transfer protocol carrying the first header identifier to the server, the method may further include continuously acquiring a video information stream, and before continuously pushing, by the request of the hypertext transfer protocol, the video information stream to the server, that is, after S101 and before S102, the method may further include: S106-S107, as follows:
s106, the server sends a connection success message aiming at the request of the hypertext transfer protocol to the stream pushing equipment.
After receiving the hypertext transfer protocol request sent by the stream pushing equipment, the server generates a connection success message which is successfully connected with the stream pushing equipment, and then sends the generated connection success message to the stream pushing equipment through the network. And the stream pushing equipment receives a connection success message returned by the server aiming at the request of the hypertext transfer protocol, and confirms that the connection with the server is successfully established through the connection success message.
And S107, responding to the connection success message, the stream pushing equipment continuously collects the video information stream and continuously sends the video information stream to the server through a request of a hypertext transfer protocol.
To avoid push invalidation of the video stream, the push streaming device will not start pushing the video stream to the server until it is clear that it has successfully established a connection with the server. That is, the stream pushing device starts to collect the video information stream in response to the connection success message sent by the server, and continuously sends the video information stream to the server through the request of the hypertext transfer protocol.
In the embodiment of the application, the stream pushing device starts to push the video information stream to the server after receiving the connection success message returned by the server aiming at the request of the hypertext transfer protocol, so that the success rate of pushing the video information stream is improved.
In some embodiments of the present application, the server may also receive the video stream pushed by the stream pushing device and continuously send the video stream to the stream pulling device of the viewer. Based on fig. 5, referring to fig. 6, fig. 6 is an optional flowchart illustrating a second method for pushing an information stream according to an embodiment of the present application. In some embodiments of the present application, after the server continues to read the video information stream from the hypertext transfer protocol request in response to the hypertext transfer protocol request, before the stream pushing device detects a stream pushing ending operation, that is, after S102 and before S103, the method may further include:
s201, when the stream pulling equipment detects the stream pulling operation, sending a stream pulling message to a server, and displaying a live broadcast presentation interface.
A pull streaming device is a device used by a viewer to watch a live broadcast. When the pull stream device detects the pull stream operation of the audience, the pull stream device can confirm that the audience needs to watch the live broadcast, and therefore, the pull stream device sends a pull stream message to the server to pull the video information stream from the server in response to the pull stream operation. Meanwhile, the stream pulling equipment can also generate a video presentation interface and jump from the current display interface to the video presentation interface, so that the display of the video presentation interface is realized. And the server receives a pull stream message sent by the pull stream equipment, wherein the pull stream message is used for pulling the video information stream.
It is understood that the pull stream operation may be an operation event triggered by the viewer on the display interface of the pull stream device, for example, the viewer clicks a virtual button "play live" or clicks into a live room for playing live, etc. The pull stream operation may also be a voice command of the viewer, such as "play the firest live broadcast" spoken by the viewer, or "play a live broadcast of a tape blogger" or the like. The specific pulling operation can be set according to actual requirements, and the application is not limited herein.
S202, the server responds to the pull flow message and sends a response of the hypertext transfer protocol carrying the second head identification to the pull flow equipment.
Wherein the second header identification is used to prompt the pull streaming device to continue receiving the stream of video information.
After receiving the pull stream message, the server generates a response of the hypertext transfer protocol, then generates a second header identifier which can represent that the size of the video information stream to be transmitted is unknown, carries the second header identifier in the response of the hypertext transfer protocol, and sends the response to the pull stream device. The pull flow device receives the response of the server to the hypertext transfer protocol sent by the pull flow message.
It should be noted that the second header identifier may be a block coding transmission header identifier, and may also be a unilateral closing connection header identifier, which is not limited herein. That is to say, in the embodiment of the present application, the first header identifier and the second header identifier may be selected from a block coding transmission header identifier and a unilateral closing connection header identifier, and the first header identifier and the second header identifier may be the same header identifier or different header identifiers.
S203, the server continuously sends the video information stream to the stream pulling equipment through the response of the hypertext transfer protocol.
And S204, displaying the video information stream on a live broadcast presentation interface by the stream pulling equipment.
The server continuously sends the video information stream continuously received from the stream pushing equipment to the stream pulling equipment, and the video information stream is carried in a response body of the hypertext transfer protocol. The stream pulling equipment continuously analyzes the video information stream from the response of the hypertext transfer protocol. Thus, the stream pulling device obtains the video information stream pushed by the stream pushing device. And the video information stream is transmitted to the server by the stream pushing equipment through a request of a hypertext transfer protocol carrying a second header identifier which represents that the size of the video information stream is unknown. The stream pulling equipment displays the video information stream in the video presentation interface, so that the live scene recorded by the stream pushing equipment is played in the stream pulling equipment of the audience.
In the embodiment of the application, the server can continuously transmit the video information stream to the streaming device of the audience through the response of the hypertext transfer protocol carrying the second head identification, so that the process of playing live broadcast on the streaming device of the audience can be realized, the bidirectional communication characteristic is realized, and one-to-one two-way real-time video communication is realized.
The server not only can send the video information stream to the stream pulling device, but also needs to prompt the stream pulling device to finish the stream pulling when the user finishes the live broadcasting. In some embodiments of the present application, after the server stops reading the pull stream information stream from the request of the hypertext transfer protocol, that is, after S105, the method may further include: S205-S206, as follows:
s205, the server determines a pull stream ending prompt mode corresponding to the second head identification of the pull stream equipment based on the second head identification.
And S206, the server prompts the pull stream equipment to pull stream end by using the pull stream end prompting mode corresponding to the second head identification.
After detecting that the push streaming equipment prompts the end of live broadcasting, the server firstly stops reading the video information stream from the request of the hypertext transfer protocol, simultaneously selects a pull stream end prompting mode corresponding to the second head identification from all pull stream end prompting modes, and then prompts that the live broadcasting of the pull streaming equipment is ended by using the pull stream end prompting mode corresponding to the second head identification.
It can be understood that, when the second header identifier is the block coded transmission header identifier, the pull stream ending prompting manner corresponding to the second header identifier is based on that the coded data block with the preset size is carried in the response of the hypertext transfer protocol to prompt the pull stream ending; when the second head identification is the unilateral closing connection head identification, the pull flow ending prompting mode corresponding to the second head identification is to prompt the pull flow ending of the pull flow equipment based on the disconnection response.
In the embodiment of the application, when the live broadcast is finished, the server can stop reading the video information stream from the request of the hypertext transfer protocol, and can prompt the live broadcast of the stream pulling equipment to be finished through a stream pulling finishing prompt mode corresponding to the second head identification, so that the stream pulling equipment can respond in time.
In some embodiments of the present application, after the pull streaming device continuously parses the video information stream from the response of the hypertext transfer protocol, that is, after the execution step at the pull streaming device side corresponding to S105, the method further includes: s207 or 208, as follows:
s207, when the stream pulling equipment detects that the response of the hypertext transfer protocol carries the coded data block with the preset size, the video information stream is stopped being analyzed from the response of the hypertext transfer protocol, and the display of the end prompt information on the video presentation interface is stopped.
S208, when the stream pulling equipment detects that the response of the hypertext protocol is disconnected, the video information stream is stopped being analyzed from the response of the hypertext transfer protocol, and the display of the end prompt information on the video presentation interface is stopped.
When the pull stream equipment detects the coded data block with the preset size from the response of the hypertext transfer protocol or detects that the response of the hypertext transfer protocol is closed, the server definitely prompts that the pull stream is finished, and then the user definitely finishes the live broadcast, so that the pull stream equipment stops analyzing the video information stream from the response of the hypertext transfer protocol, and generates and displays finishing prompt information on a live broadcast presentation interface instead of continuously displaying the video information stream, thereby prompting the audience that the live broadcast is finished.
It can be understood that the ending prompt message may be a text prompt message that "live broadcast has ended", or may be a previous interface that directly jumps back to the live broadcast presentation interface, that is, an interface that is displayed when the live broadcast is not started by the jump-back streaming device.
In the embodiment of the application, the server can prompt the stream pulling equipment to pull the stream to be finished through the coded data blocks with the preset size or directly closing the response of the hypertext transfer protocol, and the stream pulling equipment can generate and display finishing prompt information when the live broadcast is finished, so that the process of pulling the video information stream from the server is finished.
In some embodiments of the present application, after the stream pulling device displays the video information stream on the video presentation interface, the stream pulling device may further receive playback, fast-rewind, and fast-forward operation information of the viewer, so that the hypertext transfer protocol segments a header of data used in transmitting data to implement playback, fast-rewind, fast-forward, and the like of the video information stream.
Next, an exemplary application of the embodiment of the present application in a practical application scenario will be described.
The embodiment of the application is realized in the scene of pushing the live stream and pulling the live stream by utilizing the HTTP. The live stream pushing refers to pushing a live stream (video information stream) generated by recording of a main broadcasting end (stream pushing equipment) to a media server (server), and the live stream pulling refers to a process of distributing the live stream to a viewer end (stream pulling equipment) by the media server.
Fig. 7 is a schematic flowchart of pushing a live stream and pulling the live stream based on an HTTP protocol according to an embodiment of the present application. Referring to fig. 7, pushing a live stream and pulling a live stream includes the steps of:
s301, the anchor terminal sends a message carrying Transfer-Encoding: chunked head or Co ntent: HTTP Request connection of close header.
When pushing a live stream, the Request connection (Request of hypertext Transfer protocol) of HTTP may be POST/live/cctv.flv.http1.1 Content-Type:. video/x-flv, at which time Transfer-Enc oding is used: chunked header (block coded transport header) tells the media server that the live stream is of unknown length. The Request connection for HTTP may also be put./live/lpl.flvtoken ═ x.http/1.1 Content-Type. A close header (unilaterally closes the connection header identification) while indicating that the size of the live stream is unknown by not setting the Content-Length header.
S302, the media server returns HTTP/1.1200 OK information (connection success information).
And S303, the anchor end continuously transmits the acquired live broadcast stream through the Request.
When Transfer-Encoding is used: when the chunk header is received, the anchor side can send a standard HTTP chunk data packet to the media server side, each chunk packet has a specified data size, and data content is analyzed by the media server side to read a live stream, so that the acquired live stream is continuously transmitted through a Request. When Content is used: when the close head is in use, the media server only needs to receive live broadcast stream continuously.
S304, when the viewer end needs to play the live broadcast, the viewer end sends a request for pulling the live broadcast stream to the media server end.
When the viewer needs to play the live broadcast, the viewer may send get./live/lpl.flvtoken ═ key.http/1.1 (pull stream message) to the media server, so as to pull the live broadcast stream.
S305, the media server returns a file carrying Transfer-Encoding: chunked header or C ontent: HTTP Response connection (Response of hypertext transfer protocol) of close header.
The Response of HTTP can be HTTP/1.1/200.OK Content-type. video/x-flv, using T ransfer-Encoding: chunked (the block-encoded transport header identifier is the second header identifier).
S306, the media server continuously transmits the content of the Request data body to the audience.
S307, the anchor side sends a chunk data packet with the size of 0 to the media server side, or directly closes the Request connection.
When the live broadcast is finished, the anchor side sends a chunk data packet (a coded data block with a preset size) with the size of 0 to the media server side, which marks the end of the live broadcast. Or, when the live broadcast is finished, the anchor end directly closes the Request connection (the Request for closing the hypertext transfer protocol), and the media server senses the connection error so as to know that the live broadcast is finished. In this way, after the live broadcast is over, this request t connection can no longer be multiplexed.
And S308, when the audience monitors that the media server sends a chunk with the size of 0, or the media server closes the connection, the audience perceives that the live broadcast is finished.
It should be noted that the media server in this embodiment is a standard HTTP server, and receiving a live stream pushed by a Request is equivalent to receiving a Request for uploading a huge unknown file, but a common HTTP server can only receive an uploading function of a file with a limited length, and after receiving the file, the file is temporarily stored in an internal memory or an external memory, and then triggers a Request for processing an uploaded file to a network manager. The media server in this embodiment cannot select a common HTTP server, but must select a standard HTTP server, which must read the stream data from the Request body in the obtained Request connection until the live stream is finished.
Fig. 8 is a schematic diagram of a process of reading a live stream by a media server according to an embodiment of the present disclosure, referring to fig. 8, a main broadcast end 8-1 puts the live stream in a Request body8-2 and uploads the live stream to a media server 8-3, and the media server 8-3 stops reading the content 8-4 from the Request body continuously until it senses that a Request b ody has an identifier indicating the end of the live stream, so as to read live stream data.
Further, the embodiments of the present application may also rely on a chunktext header and a multiprort header in the HTTP protocol to implement a playback, fast forward, and fast rewind scheme of the RTSP, so that the streaming based on the HTTP protocol has more flexibility.
Through the mode, by means of the wide application of the HTTP protocol, the corners of any Internet, such as APP and browsers, can easily push live streams, and the live streams can be pushed without depending on the format of the live streams, regardless of whether FLV is the live stream in the FMP4 format, fragments are not needed, the method is only suitable for one connection, and the transmission speed is stable. Moreover, since the URL of the HTTP is very flexible, the URL pushed by the live stream can also be very flexible, unlike the RTMP which has only a target address or host, a distribution point and a stream i d, and meanwhile, the present solution can utilize all the facilities possessed by the HTTP, such as authentication, 302 hopping, session maintenance, load balancing, and the like. The scheme also realizes bidirectional behaviors of Requuse and Response, has bidirectional traffic characteristics, and realizes one-to-one bidirectional real-time video communication and the like.
Continuing with the exemplary structure of the plug flow device 255 provided by the embodiments of the present application as a software module, in some embodiments, as shown in fig. 2, the software module stored in the plug flow device 255 of the first memory 250 may include:
a first sending module 2551, configured to send, in response to the stream pushing trigger operation, a request of a hypertext transfer protocol carrying the first header identifier to the server; the first header identification is used for prompting the server to continuously receive the pushed video information stream; continuously pushing the video information stream to the server through a request of the hypertext transfer protocol;
a video recording module 2552, configured to continuously collect the video information stream; stopping collecting the video information stream in response to a plug flow ending operation;
a prompt determining module 2553, configured to determine, based on the first head identifier, a push flow end prompt manner corresponding to the first head identifier;
a prompt execution module 2554, configured to prompt the server to terminate the push flow by using the push flow termination prompt manner corresponding to the first header identifier.
In some embodiments of the present application, the first head identification comprises: and transmitting a head mark by block coding, wherein a stream pushing end prompting mode corresponding to the first head mark comprises the following steps: prompting that the stream pushing is finished based on the coded data block with the preset size carried in the request of the hypertext transfer protocol;
the prompt execution module 2554 is further configured to carry the encoded data block with the preset size on the request of the hypertext transfer protocol, and send the request to the server, so as to prompt the server to terminate the stream pushing.
In some embodiments of the present application, the first head identification comprises: unilaterally closing the connection head identification, wherein the plug flow end prompting mode corresponding to the first head identification comprises the following steps: prompting for an end of the push flow based on a request for the hypertext transfer protocol;
the prompt execution module 2554 is further configured to close the request of the hypertext transfer protocol, and prompt the server to terminate the push flow.
In some embodiments of the present application, the flow pushing device 255 further comprises: a first receiving module 2555;
the first receiving module 2555 is configured to receive a connection success message returned by the server for the request of the hypertext transfer protocol;
the video recording module 2552 is further configured to continuously collect the video information stream in response to the connection success message;
the first sending module 2551 is further configured to continuously push the video information stream to the server by a request of the hypertext transfer protocol.
In some embodiments of the present application, the first sending module 2551 is further configured to send any request message to the server by using the hypertext transfer protocol request.
Continuing with the exemplary structure of the information distribution apparatus 455 provided by the embodiments of the present application implemented as software modules, in some embodiments, as shown in fig. 3, the software modules stored in the information distribution apparatus 455 of the second memory 450 may include:
a second receiving module 4551, configured to receive a request of the hypertext transfer protocol carrying the first header identifier sent by the stream pushing device;
an information reading module 4552, configured to continuously read a video information stream from the hypertext transfer protocol request in response to the hypertext transfer protocol request; and when the stream pushing equipment is detected to utilize a stream pushing ending prompting mode corresponding to the first header identification to prompt the end of the stream pushing, stopping reading the video information stream from the request of the hypertext transfer protocol.
In some embodiments of the present application, the first head identification comprises: and transmitting a head mark by block coding, wherein a stream pushing end prompting mode corresponding to the first head mark comprises the following steps: prompting that the stream pushing is finished based on the coded data block with the preset size carried in the request of the hypertext transfer protocol;
the information reading module 4552 is further configured to stop reading the video information stream from the hypertext transfer protocol request when it is detected that the hypertext transfer protocol request carries the encoded data block with the preset size.
In some embodiments of the present application, the first head identification comprises: unilaterally closing the connection head identification, wherein the plug flow end prompting mode corresponding to the first head identification comprises the following steps: prompting an end of a push flow based on a request to close the hypertext transfer protocol;
the information reading module 4552 is further configured to stop reading the video information stream from the hypertext transfer protocol request when the hypertext transfer protocol request is detected to be turned off.
In some embodiments of the present application, the information distribution apparatus 455 further includes: a second transmitting module 4553;
the second receiving module 4551 is further configured to receive a pull stream message sent by a pull stream device; the stream pulling message is used for pulling a video information stream;
the second sending module 4553 is configured to send, in response to the pull flow message, a response of the hypertext transfer protocol carrying the second header identifier to the pull flow device; the second header identification is used for prompting the pull streaming device to continuously receive the video information stream; and continuously sending the video information stream to the pull streaming device through the response of the hypertext transfer protocol.
In some embodiments of the present application, the second sending module 4553 is further configured to send a connection success message for the request of the hypertext transfer protocol to a stream pushing device.
In some embodiments of the present application, the information distribution apparatus 455 further includes: a pull stream end prompt module 4554;
the pull stream ending prompt module 4554 is configured to determine, based on the second header identifier, a pull stream ending prompt manner corresponding to the second header identifier of the pull stream device; and prompting the pull stream ending prompt mode corresponding to the second head mark to end the pull stream of the pull stream equipment.
In some embodiments of the present application, the pull stream ending prompting module 4554 is further configured to carry the encoded data block with the preset size on a response of the hypertext transfer protocol, send the response to the pull stream device, and prompt the pull stream device to end the pull stream; or closing the response of the hypertext transfer protocol and prompting the pull stream equipment to finish the pull stream.
Continuing with the exemplary structure of the pull flow device 555 implemented as a software module provided by the embodiments of the present application, in some embodiments, as shown in fig. 4, the software module stored in the pull flow device 555 in the third memory 550 may include:
a third sending module 5551, configured to send a pull flow message to the server when a pull flow operation of the user is detected;
the information display module 5552 is used for displaying a live broadcast presentation interface;
a third receiving module 5553, configured to receive a response of the server to the hypertext transfer protocol sent by the pull message; the video information stream is transmitted to the server by a stream pushing device through a request carrying a hypertext transfer protocol prompting the server to continuously receive a first header identifier of the pushed video information stream;
an information stream parsing module 5554, configured to parse the video stream information from the response of the hypertext transfer protocol continuously; the video information stream is transmitted to the server by a stream pushing device through a request carrying a hypertext transfer protocol prompting the server to continuously receive a first header identifier of the pushed video information stream;
the information displaying module 5552 is further configured to display the video information stream on the live presentation interface.
In some embodiments of the present application, the information stream parsing module 5554 is further configured to, when it is detected that a response of the hypertext transfer protocol carries a coded data block with a preset size, stop parsing the video information stream from the response of the hypertext transfer protocol, and display an end prompt message on the video presentation interface; or when detecting that the response of the hypertext transfer protocol is closed, stopping analyzing the video information stream from the response of the hypertext transfer protocol, and displaying the end prompt information on the video presentation interface.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the information stream pushing method described in the embodiment of the present application.
The embodiment of the present application provides a computer-readable storage medium storing executable instructions, where the executable instructions are stored, and when being executed by a first processor, the executable instructions will cause the first processor to execute the method for pushing information streams provided by the streaming device side of the embodiment of the present application, and when being executed by a second processor, the executable instructions will cause the second processor to execute the method for pushing information streams provided by the server side of the embodiment of the present application, and when being executed by a third processor, the executable instructions will cause the third processor to execute the method for pushing information streams provided by the streaming device side of the embodiment of the present application.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, the executable information flow pushing instructions may be in the form of a program, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, the executable information stream push instructions may, but need not, correspond to files in a file system, may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, the executable information stream push instructions may be deployed to be executed on one computing device or on multiple computing devices located at one site or distributed across multiple sites and interconnected by a communication network.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (15)

1. A method for pushing information flow is characterized by comprising the following steps:
responding to the push flow triggering operation, and sending a request of a hypertext transfer protocol carrying a first head identification to a server; the first header identification is used for prompting the server to continuously receive the pushed video information stream;
continuously collecting the video information stream, and continuously pushing the video information stream to the server through a request of the hypertext transfer protocol;
in response to a plug flow ending operation, stopping collecting the video information stream, and determining a plug flow ending prompt mode corresponding to the first head identification based on the first head identification;
and prompting the server to finish the plug flow through a plug flow finish prompting mode corresponding to the first head identification.
2. The method of claim 1, wherein the first head identification comprises: and transmitting a head mark by block coding, wherein a stream pushing end prompting mode corresponding to the first head mark comprises the following steps: prompting that the stream pushing is finished based on the coded data block with the preset size carried in the request of the hypertext transfer protocol;
the prompting the server to terminate the plug flow by the plug flow termination prompting mode corresponding to the first head identification comprises the following steps:
and carrying the coded data block with the preset size on the request of the hypertext transfer protocol, and sending the coded data block to the server to prompt the server to push the stream to be finished.
3. The method of claim 1, wherein the first head identification comprises: unilaterally closing the connection head identification, wherein the plug flow end prompting mode corresponding to the first head identification comprises the following steps: prompting an end of a push flow based on a request to close the hypertext transfer protocol;
the prompting the server to terminate the plug flow by the plug flow termination prompting mode corresponding to the first head identification comprises the following steps:
and closing the request of the hypertext transfer protocol and prompting the server to finish the stream pushing.
4. A method for pushing information flow is characterized by comprising the following steps:
receiving a request of a hypertext transfer protocol carrying a first header identifier sent by stream pushing equipment;
continuously reading out a video information stream from the hypertext transfer protocol request in response to the hypertext transfer protocol request;
and when the stream pushing equipment is detected to utilize a stream pushing ending prompting mode corresponding to the first header identification to prompt the end of the stream pushing, stopping reading the video information stream from the request of the hypertext transfer protocol.
5. The method of claim 4, wherein the first head identification comprises: and transmitting a head mark by block coding, wherein a stream pushing end prompting mode corresponding to the first head mark comprises the following steps: prompting that the stream pushing is finished based on the coded data block with the preset size carried in the request of the hypertext transfer protocol;
when it is detected that the stream pushing equipment prompts the stream pushing to end by using the stream pushing ending prompting mode corresponding to the first header identifier, stopping reading the video information stream from the hypertext transfer protocol request, including:
and when detecting that the coded data block with the preset size is carried in the request of the hypertext transfer protocol, stopping reading the video information stream from the request of the hypertext transfer protocol.
6. The method of claim 4, wherein the first head identification comprises: unilaterally closing the connection head identification, wherein the plug flow end prompting mode corresponding to the first head identification comprises the following steps: prompting an end of a push flow based on a request to close the hypertext transfer protocol;
when it is detected that the stream pushing equipment prompts the stream pushing to end by using the stream pushing ending prompting mode corresponding to the first header identifier, stopping reading the video information stream from the hypertext transfer protocol request, including:
and when detecting that the request of the hypertext transfer protocol is closed, stopping reading the video information stream from the request of the hypertext transfer protocol.
7. The method according to any of claims 4 to 6, wherein after said continuously reading out the video information stream from the hypertext transfer protocol request in response to the hypertext transfer protocol request, before stopping reading out the video information stream from the hypertext transfer protocol request when detecting that the stream pushing device prompts the end of stream pushing by using the first header to identify the corresponding stream pushing end prompting manner:
receiving a pull stream message sent by a pull stream device; the stream pulling message is used for pulling a video information stream;
responding to the pull flow message, and sending a response of a hypertext transfer protocol carrying a second head identification to the pull flow equipment; the second header identification is used for prompting the pull streaming device to continuously receive the video information stream;
and continuously sending the video information stream to the pull streaming device through the response of the hypertext transfer protocol.
8. A method for pushing information flow is characterized by comprising the following steps:
when the stream pulling operation is detected, sending a stream pulling message to a server, and displaying a video presentation interface;
receiving a response of the server to the hypertext transfer protocol sent by the pull stream message;
continuously analyzing video stream information from the response of the hypertext transfer protocol; the video information stream is transmitted to the server by a stream pushing device through a request carrying a hypertext transfer protocol prompting the server to continuously receive a first header identifier of the pushed video information stream;
and displaying the video information stream on the live broadcast presentation interface.
9. A flow pushing device, comprising:
the first sending module is used for responding to the plug flow triggering operation and sending a request of a hypertext transfer protocol carrying a first head identification to the server; the first header identification is used for prompting the server to continuously receive the pushed video information stream; continuously pushing the video information stream to the server through a request of the hypertext transfer protocol;
the video recording module is used for continuously acquiring the video information stream; stopping collecting the video information stream in response to a plug flow ending operation;
the prompt determining module is used for determining a plug flow ending prompt mode corresponding to the first head identification based on the first head identification;
and the prompt execution module is used for prompting the server to finish the plug flow through the plug flow finish prompt mode corresponding to the first head identification.
10. An information distribution apparatus characterized by comprising:
the second receiving module is used for receiving a request of the hypertext transfer protocol carrying the first head identifier, which is sent by the stream pushing equipment;
the information reading module is used for responding to the request of the hypertext transfer protocol and continuously reading a video information stream from the request of the hypertext transfer protocol; and when the stream pushing equipment is detected to utilize a stream pushing ending prompting mode corresponding to the first header identification to prompt the end of the stream pushing, stopping reading the video information stream from the request of the hypertext transfer protocol.
11. A flow pulling apparatus, comprising:
a third sending module, configured to send a pull flow message to the server when a pull flow operation is detected,
the information display module is used for displaying a video presentation interface;
a third receiving module, configured to receive a response of the server to a hypertext transfer protocol sent by the pull message;
the information flow analysis module is used for continuously analyzing the video flow information from the response of the hypertext transfer protocol; the video information stream is transmitted to the server by a stream pushing device through a request carrying a hypertext transfer protocol prompting the server to continuously receive a first header identifier of the pushed video information stream;
the information display module is further used for displaying the video information stream on the live broadcast presentation interface.
12. A flow pushing device, comprising:
a first memory for storing executable information stream push instructions;
a first processor, configured to implement the method according to any one of claims 1 to 3 when executing the executable information stream pushing instruction stored in the first memory.
13. A server, comprising:
a second memory for storing executable information stream push instructions;
a second processor, configured to implement the method according to any one of claims 4 to 7 when executing the executable information stream pushing instruction stored in the second memory.
14. A flow pulling apparatus, comprising:
a third memory for storing executable information stream push instructions;
a third processor, configured to implement the method of claim 8 when executing the executable information stream pushing instruction stored in the third memory.
15. A computer-readable storage medium storing executable information pushing instructions for implementing the method of any one of claims 1 to 3 when executed by a first processor; or for implementing the method of any of claims 4 to 7 when executed by a second processor; for implementing the method of claim 8 when executed by a third processor.
CN202011356004.5A 2020-11-26 2020-11-26 Information stream pushing method, device, equipment and computer readable storage medium Active CN112532719B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011356004.5A CN112532719B (en) 2020-11-26 2020-11-26 Information stream pushing method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011356004.5A CN112532719B (en) 2020-11-26 2020-11-26 Information stream pushing method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112532719A true CN112532719A (en) 2021-03-19
CN112532719B CN112532719B (en) 2024-04-02

Family

ID=74994035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011356004.5A Active CN112532719B (en) 2020-11-26 2020-11-26 Information stream pushing method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112532719B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113438506A (en) * 2021-06-02 2021-09-24 曙光网络科技有限公司 Video file restoration method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297452A (en) * 2012-02-24 2013-09-11 北京对角巷科技发展有限公司 Method and system for publishing and broadcasting streaming media on Internet in live mode
CN110785978A (en) * 2017-06-20 2020-02-11 瑞典爱立信有限公司 Apparatus and method for live uplink adaptive streaming
US20200077161A1 (en) * 2017-05-16 2020-03-05 Telefonaktiebolaget Lm Ericsson (Publ) Low latency media ingestion system, devices and methods
CN111935443A (en) * 2020-10-12 2020-11-13 融智通科技(北京)股份有限公司 Method and device for sharing instant messaging tool in real-time live broadcast of video conference

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297452A (en) * 2012-02-24 2013-09-11 北京对角巷科技发展有限公司 Method and system for publishing and broadcasting streaming media on Internet in live mode
US20200077161A1 (en) * 2017-05-16 2020-03-05 Telefonaktiebolaget Lm Ericsson (Publ) Low latency media ingestion system, devices and methods
CN110785978A (en) * 2017-06-20 2020-02-11 瑞典爱立信有限公司 Apparatus and method for live uplink adaptive streaming
CN111935443A (en) * 2020-10-12 2020-11-13 融智通科技(北京)股份有限公司 Method and device for sharing instant messaging tool in real-time live broadcast of video conference

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
瞎猫: "http推流原理", 《知乎》, pages 1 - 4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113438506A (en) * 2021-06-02 2021-09-24 曙光网络科技有限公司 Video file restoration method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112532719B (en) 2024-04-02

Similar Documents

Publication Publication Date Title
US11653036B2 (en) Live streaming method and system, server, and storage medium
CN110535871B (en) WebRTC-based classroom real-time video projection method and system
CN102571979B (en) Multi-screen interactive equipment and its binding method
CN111064972A (en) Live video control method based on IPV9
CN111064973A (en) Live broadcast system based on IPV9
US9979690B2 (en) Method and apparatus for social network communication over a media network
CN105451071B (en) Video stream processing method, device and system
CN105100954A (en) Interactive response system and method based on Internet communication and streaming media live broadcast
JP2007006444A (en) Multimedia production control system
CN106464933B (en) Apparatus and method for remotely controlling rendering of multimedia content
US11410199B2 (en) Reception apparatus, transmission apparatus, and data processing method
US20090037596A1 (en) Media persistent rtsp streaming
CN110740386B (en) Live broadcast switching method and device and storage medium
KR20170141677A (en) Receiving device, transmitting device and data processing method
WO2015180446A1 (en) System and method for maintaining connection channel in multi-device interworking service
CN111092898A (en) Message transmission method and related equipment
CN115665474A (en) Live broadcast method and device, electronic equipment and storage medium
CN107547517B (en) Audio and video program recording method, network equipment and computer device
CN112584194A (en) Video code stream pushing method and device, computer equipment and storage medium
CN114040232A (en) Screen projection system, method, electronic device and storage medium
CN112532719B (en) Information stream pushing method, device, equipment and computer readable storage medium
CN113132194A (en) Information transfer method, device, equipment, server and storage medium
CN1972447A (en) Multi-image player based on stream media technology and its playing method
CN112714131A (en) Cross-platform microphone connecting method and device, storage medium and electronic equipment
CN110719435A (en) Method and system for carrying out terminal conference

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40040479

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant