Video push streaming method and device, live streaming system, computer device and storage medium
By creating two live streams in the live room and encrypting the expiration time of the playback address, the problems of poor interactivity and insufficient security for non-paying users are solved, achieving a good user experience and security.
Patent Information
- Application Number
- CN202311069750.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-23
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-08-23
AI Technical Summary
Under the existing paid live streaming model, non-paying users have poor interactivity, a bad user experience, and insufficient security, making it easy for unauthorized users to forge playback addresses to watch.
Create at least two live streams in the live streaming room: one is a private live stream (visible to paid users), and the other is a public live stream (visible to non-paid users). Use a signature algorithm to encrypt the expiration time of the playback address to improve security.
It provides a good interactive experience for non-paying users, while improving the security of live streaming content and preventing the playback address from being forged.
Smart Images

Figure CN117119230B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video technology, and in particular to a video streaming method, apparatus, live streaming system, computer equipment, and storage medium. Background Technology
[0002] In order to promote consumption, many existing live streaming platforms have launched non-public live streaming modes, such as paid live streaming. This means that only paying users can see the normal live stream content; non-paying users will only see a pop-up notification that the live stream is a paid event. This method of live streaming offers poor interactivity and a bad user experience for non-paying users. Summary of the Invention
[0003] In view of this, a video streaming method, apparatus, computer device, and computer-readable storage medium are provided to solve the above problems.
[0004] This application provides a video streaming method applied to a backend server, the method comprising:
[0005] Receive a request from a streamer to start a live broadcast in the live broadcast room. The request includes the room number of the live broadcast room and the live broadcast mode selected by the streamer. The live broadcast mode includes public live broadcast and private live broadcast.
[0006] When the live streaming mode selected by the broadcaster is non-public live streaming, at least two live streaming streams are created under the room number according to the broadcast request, one of which is a non-public live streaming stream and the others are public live streaming streams.
[0007] After creating at least two live streams, the first push address of the non-public live stream is returned to the live streaming room, and the second push address of the public live stream and the download address of the public materials are sent to the preset public live stream push server. After obtaining the first push address, the live streaming room will push the live video of the anchor according to the first push address. After obtaining the download address, the push server will download the public materials according to the download address. After the download of the public materials is completed, the push server will push the public materials according to the second push address.
[0008] Optionally, the non-public live stream is a live stream corresponding to a paying user.
[0009] Optionally, the method further includes:
[0010] Upon receiving a request to obtain the playback address of the live stream, determine whether the user entering the live stream is a paying user;
[0011] If the user entering the live stream is a paying user, the playback address corresponding to the non-public live stream will be returned to the live stream.
[0012] If the user entering the live stream is a non-paying user, the playback address corresponding to the public live stream will be returned to the live stream.
[0013] Optionally, the step of returning the playback address corresponding to the public live stream to the live stream room if the user entering the live stream room is a non-paying user includes:
[0014] If the user entering the live stream is a non-paying user, a preset prompt pop-up will be returned to the live stream so that the prompt pop-up will be displayed on the live stream page.
[0015] Upon receiving a cancellation command triggered by the user based on the pop-up prompt, the playback address corresponding to the public live stream is returned to the live stream room.
[0016] Optionally, the playback address corresponding to the non-public live stream includes the domain name of the content delivery network, the stream name of the non-public live stream, the expiration time of the playback address, and signature information. The signature information is obtained by signing at least one parameter in the playback address using a preset signature algorithm, and the at least one parameter includes the expiration time.
[0017] Optionally, the method further includes:
[0018] The system receives a request to stop broadcasting from the live stream room and invokes the streaming server according to the request, so that the streaming server stops streaming the public material according to the second streaming address.
[0019] Optionally, the method further includes:
[0020] The aforementioned public live stream has been deleted.
[0021] This application also provides a video streaming device, the video streaming device comprising:
[0022] The receiving module is used to receive the broadcaster's request to start broadcasting in the live broadcast room. The broadcasting request includes the room number of the live broadcast room and the live broadcast mode selected by the broadcaster. The live broadcast mode includes public live broadcasting and private live broadcasting.
[0023] The creation module is used to create at least two live streams under the room number according to the broadcast request when the broadcast mode selected by the broadcaster is non-public live stream. One of the live streams is a non-public live stream, and the other live streams are public live streams.
[0024] The return module is used to, after completing the creation of at least two live streams, return the first push address of the non-public live stream to the live room, and return the second push address of the public live stream and the download address of the public materials to the preset public live stream push server. The live room, after obtaining the first push address, will push the streamer's live video according to the first push address. The push server, after obtaining the download address, will download the public materials according to the download address, and after downloading the public materials, the push server will push the public materials according to the second push address.
[0025] This application also provides a video live streaming system, the video live streaming system comprising:
[0026] The broadcasting terminal is used by broadcasters to conduct live broadcasts in the live broadcast room;
[0027] The backend server receives live streaming requests from the live streaming room. The request includes the room number and the live streaming mode selected by the streamer, which can be either public or private. When the streamer selects a private live streaming mode, at least two live streams are created under the room number according to the request. One live stream is designated as a private stream, and the others are designated as public streams. After creating the at least two live streams, the server returns the first push address of the private live stream to the live streaming room and sends the second push address of the public live stream and the download address of the public materials to a pre-defined public live stream push server. Upon receiving the first push address, the live streaming room pushes the streamer's live video according to that address.
[0028] The streaming server is used to download the publicly available material according to the download address after obtaining the download address, and to stream the publicly available material according to the second streaming address after the download is completed;
[0029] Viewer terminal, used to allow users to enter the live broadcast room to watch videos;
[0030] The backend server is also used to push the live video of the broadcaster to the content delivery network;
[0031] The content delivery network is used to verify the connection request when it receives a connection request sent by a viewer's terminal.
[0032] Optionally, the connection request includes a playback address corresponding to the non-public live stream. The playback address includes the domain name of the content delivery network, the stream name of the non-public live stream, the expiration time of the playback address, and signature information. The signature information is obtained by signing at least one parameter in the playback address using a preset signature algorithm, and the at least one parameter includes the expiration time. The content delivery network is further configured to:
[0033] Upon receiving a connection request from a viewer's terminal, the signature algorithm is used to sign at least one parameter in the playback address to obtain target signature information;
[0034] Compare whether the target signature information is the same as the signature information in the playback address;
[0035] If the target signature information is the same as the signature information in the playback address, then determine whether the sending time of the connection request exceeds the expiration time;
[0036] If the connection request is sent after the expiration time, the connection request is determined to be an illegal request.
[0037] This application also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0038] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0039] This application embodiment describes a video streaming method that receives a broadcaster's request to start a broadcast in a live streaming room. The broadcaster's request includes the room number of the live streaming room and the broadcast mode selected by the broadcaster. The broadcast mode includes public broadcast and non-public broadcast. When the broadcaster selects a non-public broadcast mode, at least two live streams are created under the room number according to the broadcaster's request. One of the live streams is a non-public live stream, and the others are public live streams. After creating the at least two live streams, the first streaming address of the non-public live stream is returned to the live streaming room, and the second streaming address of the public live stream and the download address of the public materials are sent to a preset public live stream streaming server. After obtaining the first streaming address, the live streaming room will stream the broadcaster's live video according to the first streaming address. After obtaining the download address, the streaming server will download the public materials according to the download address. After downloading the public materials, the streaming server will stream the public materials according to the second streaming address. By using the above video streaming method, a live room can correspond to at least two live streams, so that paying users can see one live stream content (paid content) and non-paying live stream users can see another live stream content (free content), thereby enabling non-paying users to also have better interactivity and improving user experience. Attached Figure Description
[0040] Figure 1 This is a schematic diagram illustrating the application environment of one embodiment of the video streaming method of this application;
[0041] Figure 2 This is a flowchart of one embodiment of the video streaming method described in this application;
[0042] Figure 3 This is a schematic diagram of the live streaming backend page described in this application;
[0043] Figure 4 A flowchart illustrating another embodiment of the video streaming method described in this application;
[0044] Figure 5 A detailed schematic diagram illustrating the step of returning the playback address corresponding to the public live stream to the live stream room if the user entering the live stream room is a non-paying user, in one embodiment of the application.
[0045] Figure 6 This is a schematic diagram of the pop-up notification box described in this application;
[0046] Figure 7 This is a schematic diagram of the playback address described in this application;
[0047] Figure 8This is a program block diagram of one embodiment of the video streaming device described in this application;
[0048] Figure 9 This is a schematic diagram of the architecture of the video live streaming platform described in this application;
[0049] Figure 10 A schematic diagram of the hardware structure of a computer device for executing a video streaming method provided in an embodiment of this application. Detailed Implementation
[0050] The advantages of this application are further illustrated below with reference to the accompanying drawings and specific embodiments.
[0051] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0052] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0053] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0054] In the description of this application, it should be understood that the numerical labels before the steps do not indicate the order of the steps, but are only used to facilitate the description of this application and to distinguish each step, and therefore should not be construed as a limitation of this application.
[0055] The following is a definition of the terminology used in this application:
[0056] Live stream: The transmission of live audio and video data, which can be transmitted to viewers over a network as a stable and continuous stream.
[0057] A CDN (Content Delivery Network) is a distributed network built on top of an existing network to speed up network access.
[0058] FFmpeg: FFmpeg is an open-source software used to generate various libraries and programs for processing multimedia data. FFmpeg can transcode and process videos and images (adjusting video and image sizes, denoising, etc.), package, transmit, and play videos.
[0059] Figure 1 This illustration shows an application scenario provided by an embodiment of this application, which includes a server 100, a broadcaster terminal 200, and a viewer terminal 300. The server 100, broadcaster terminal 200, and viewer terminal 300 are located in a wireless network or a wired network, and the server 100 can interact with the broadcaster terminal 200 and the viewer terminal 300. In some embodiments, the number of broadcaster terminals 200 (…) Figure 1 Only one is shown in the image) and the number of 300 viewer terminals ( Figure 1 (Only one is shown in the image) It is not limited. The viewer terminal 300 and the broadcaster terminal 200 can use the server 100 and CDN (Content Delivery Network) as transmission intermediaries and realize data interaction between them through the Internet.
[0060] In this embodiment, server 100 can be a standalone server or a server cluster; it can be a local server or a cloud server. The specific server type is not limited in this embodiment. The broadcast terminal 200 and the viewer terminal 300 can be mobile phones, smartphones, laptops, desktop computers, tablets, personal digital assistants (PDAs), media players, smart TVs, wearable electronic devices, etc. The specific terminal device type is not limited in this embodiment.
[0061] In this embodiment, a live streaming client may be installed in the broadcaster terminal 200, which is used to enable the broadcaster to conduct live video streaming. The live streaming client may be a computer application (APP) installed on the broadcaster terminal 200, or it may be a web client, which may refer to an application developed based on the web architecture.
[0062] In this embodiment, a viewer client may be installed in the viewer terminal 300. This viewer client is used to enable viewers to receive and display live content. The viewer client may be a computer application (APP) installed on the viewer terminal 300, or it may be a web client, which may refer to an application developed based on a web architecture.
[0063] In related technologies, when implementing a paid live streaming model, once a user enters the live stream room, the room requests verification from the backend server to confirm whether the user has purchased the live stream session. If the user has purchased the session, the backend server will return the playback address of the live stream room. After obtaining this playback address, the player on the viewer's terminal will establish a connection with the CDN and, upon successful connection establishment, can retrieve the live stream content from the CDN for viewing. If the backend server verifies that the user has not purchased the live stream session, it will return a notification message indicating that the user has not purchased the session. Upon receiving this notification message, the viewer's terminal can display a pop-up window.
[0064] However, the inventors discovered the following problems with the above-mentioned live streaming mode:
[0065] 1. It's not user-friendly for non-paying users. Non-paying users can only see a black screen or pop-ups, resulting in poor interactivity.
[0066] 2. Weak Confidentiality. If a paid user obtains the playback address, someone with technical expertise can copy the parameters returned from the network interface and send it to others. Although most CDNs perform authentication operations on the playback address, such as verifying the HTTP header and User Agent, these parameters are actually easy to forge. CDNs and live streaming platforms are not the same service. CDN service providers are independent of the live streaming platform and do not care about the business (whether it's paid or not). As long as they can obtain a legitimate playback address and pass authentication, playback is possible. Therefore, anyone who obtains the playback address can use forged HTTP headers and a player to play the video normally, bypassing our paid live stream.
[0067] To address the aforementioned issues, this application receives a broadcast request from a streamer in a live streaming room. The broadcast request includes the room number of the live streaming room and the live streaming mode selected by the streamer, which includes public and private live streaming modes. When the selected live streaming mode is private, at least two live streams are created under the room number according to the broadcast request. One live stream is designated as a private live stream, and the others are designated as public live streams. After creating the at least two live streams, the first push address of the private live stream is returned to the live streaming room, and the second push address of the public live stream and the download address of the public materials are sent to a preset public live stream push server. Upon receiving the first push address, the live streaming room pushes the streamer's live video according to the first push address. Upon receiving the download address, the push server downloads the public materials according to the download address, and after downloading the public materials, the push server pushes the public materials according to the second push address. By employing the aforementioned video streaming method, a single live stream room can correspond to at least two live streams. This allows paying users to see one live stream (paid content), while non-paying users see another (free content), thus providing better interactivity for non-paying users and improving user experience. Furthermore, this application enhances security by shortening the playback address expiration time and incorporating it as a parameter in the signature algorithm. This restricts the playback address from being forged or its parameters from being arbitrarily altered.
[0068] The following will provide several embodiments in the above exemplary application environment to illustrate the video streaming solution in this application. See also... Figure 2 This is a flowchart illustrating a video streaming method according to an embodiment of this application. The video streaming method in this application is applied to a backend server. The backend server can be a single server or a server cluster, a local server or a cloud server, and the specific server type is not limited in this embodiment.
[0069] It should be noted that the flowchart in this method embodiment is not intended to limit the order of execution steps. As can be seen from the diagram, the video streaming method provided in this embodiment includes:
[0070] Step S20: Receive the broadcaster's request to start broadcasting in the live broadcast room. The broadcast request includes the room number of the live broadcast room and the live broadcast mode selected by the broadcaster. The live broadcast mode includes public live broadcasting and private live broadcasting.
[0071] Specifically, when a streamer wants to start a live stream, they can open the live streaming application installed on their device, which will take them to the live streaming backend page. Once on the backend page, the streamer can select the live streaming mode, method, and other settings. From this backend page, the streamer can also initiate a live stream request.
[0072] The live streaming modes include public live streaming and private live streaming. Public live streaming refers to a live streaming method where there are no restrictions on the users entering the streamer's live streaming room; that is, all users can enter the streamer's live streaming room. Private live streaming refers to a live streaming method where there are restrictions on the users entering the streamer's live streaming room; that is, only users who meet certain conditions can enter the streamer's live streaming room. In one embodiment, the conditions can be invited users, paying users, or the streamer's fans, etc.
[0073] The live streaming methods include push streaming and rebroadcasting. Push streaming refers to broadcasting the current streamer's video feed live, while rebroadcasting refers to streaming video feeds retrieved from a third-party platform. It should be noted that push streaming typically requires an encoder and streaming software.
[0074] In a specific scenario, the live streaming backend page is as follows: Figure 3 As shown. When a streamer wants to enable a private live stream mode, they will select... Figure 3 The live streaming shown is the current live streaming method, and the selected... Figure 3 The example shown is a live stream of the "Great Voyage" series, representing the current live stream mode. Once the streamer selects "Great Voyage" as the current mode, to ensure that non-paying users can also view the live stream, the streamer can upload publicly available materials to the backend server. These publicly available materials can be images or videos, and the specific content of the images or videos is not limited. In another embodiment, after the streamer selects "Great Voyage" as the current mode, to ensure that non-paying users can also view the live stream, the backend server can directly select stored images or videos for non-paying users to view, without the streamer actively uploading them. In this scenario, after the user selects the live stream method, live stream mode, and uploads the content for non-"Great Voyage" users to view, the streamer can click... Figure 3 The "Start Live Stream" button shown triggers a live stream request in the live stream room. After detecting the live stream request, the live stream application installed on the broadcaster's terminal will send the request to the backend server so that the backend server can receive the broadcaster's request to start live stream in the live stream room.
[0075] Step S21: When the live streaming mode selected by the broadcaster is non-public live streaming, at least two live streaming streams are created under the room number according to the broadcast request, one of which is a non-public live streaming stream and the other is a public live streaming stream.
[0076] Specifically, after receiving a broadcast request, the backend server checks the broadcast mode selected by the broadcaster in the request to determine whether it is a public or private broadcast mode. If the selected mode is determined to be private, the backend server retrieves the room number from the broadcast request and creates at least two live streams under that room number. One live stream is designated as a private stream, and the others are designated as public streams. The "other" live streams refer to all live streams other than the private one.
[0077] In one embodiment, when it is determined that the live streaming mode selected by the streamer is the public live streaming mode, the normal live streaming process will be followed. This normal live streaming process is existing technology and will not be described in detail in this embodiment.
[0078] In a specific scenario, if the room number is 1, at least two live streams will be created under room 1.
[0079] In one implementation, after at least two live streams are created, corresponding descriptive information is generated to describe these live streams in order to facilitate the differentiation between them.
[0080] In a specific scenario, a live stream can be described in the following way:
[0081] Name property explain a Normal flow The original flow in room 1 b Paid stream New stream name added to room 1
[0082] In one exemplary implementation, the non-public live stream is a live stream corresponding to paid users, meaning that only users who have purchased this live stream session can watch it.
[0083] Step S22: After creating the at least two live streams, the first push address of the non-public live stream is returned to the live streaming room, and the second push address of the public live stream and the download address of the public materials are sent to the preset public live stream push server. The live streaming room, upon obtaining the first push address, will push the streamer's live video according to the first push address. The push server, upon obtaining the download address, will download the public materials according to the download address, and after downloading the public materials, the push server will push the public materials according to the second push address.
[0084] Specifically, after creating the at least two live streams, the backend server returns the first push address of the non-public live stream to the live streaming room. Upon receiving the first push address, the live streaming room will push the streamer's live video to the first address. Simultaneously, after creating the at least two live streams, the backend server also sends the second push address of the public live stream and the download address of the public materials to the preset public live stream push server. Upon receiving the download address, the push server will download the public materials and, after downloading, continue to push the public materials to the second address.
[0085] It should be noted that if the live stream has not ended but the public material has already been streamed, the streaming server will continue to stream the public material to the second address repeatedly during the process of pushing the public material to the second address.
[0086] Understandably, when multiple public live streams exist, the backend server will send the corresponding streaming addresses and download addresses for the public materials to the streaming server. For each public live stream, the streaming server will download the public materials according to the download address of the corresponding public materials, and after completing the download, it will stream the public materials to the second address corresponding to the public live stream.
[0087] In one implementation, the streaming server can use ffmpeg commands to implement the streaming function, thereby reducing resource consumption.
[0088] In this embodiment, a live broadcast request is received from a broadcaster in a live broadcast room. The request includes the room number of the live broadcast room and the live broadcast mode selected by the broadcaster, which includes public live broadcast and private live broadcast. When the broadcaster selects a private live broadcast mode, at least two live broadcast streams are created under the room number according to the broadcast request. One of the live broadcast streams is a private live broadcast stream, and the others are public live broadcast streams. After the creation of the at least two live broadcast streams is completed, the first push address of the private live broadcast stream is returned to the live broadcast room, and the second push address of the public live broadcast stream and the download address of the public materials are sent to a preset public live broadcast stream push server. After obtaining the first push address, the live broadcast room will push the broadcaster's live video according to the first push address. After obtaining the download address, the push server will download the public materials according to the download address. After the download of the public materials is completed, the push server will push the public materials according to the second push address. By using the above video streaming method, a live room can correspond to at least two live streams, so that paying users can see one live stream content (paid content) and non-paying live stream users can see another live stream content (free content), thereby enabling non-paying users to also have better interactivity and improving user experience.
[0089] In one exemplary implementation, see [reference] Figure 4 The method further includes:
[0090] Step S40: Upon receiving the request to obtain the playback address of the live room, determine whether the user entering the live room is a paying user.
[0091] Specifically, when a user wants to watch the streamer's live video, the user enters the streamer's live room through the live streaming application installed on the viewer's terminal. After the user enters the streamer's live room, the live room requests the playback address of the live room from the backend server. After receiving the request for the playback address of the live room, the backend server will determine whether the user entering the live room is a paying user, that is, whether the user entering the live room has purchased the live session.
[0092] Step S41: If the user entering the live stream is a paying user, then the playback address corresponding to the non-public live stream is returned to the live stream.
[0093] Specifically, if the user entering the live stream is a paying user, the backend server will return the playback address corresponding to the non-public live stream to the live stream, so that the live stream can obtain the non-public live stream based on the playback address and play the non-public live stream in the live stream.
[0094] Step S42: If the user entering the live stream is a non-paying user, then the playback address corresponding to the public live stream is returned to the live stream.
[0095] Specifically, if the user entering the live stream is a non-paying user, the backend server will return the playback address corresponding to the public live stream to the live stream, so that the live stream can obtain the public live stream based on the playback address and play the public live stream in the live stream.
[0096] It should be noted that, in one embodiment, when multiple public live streams exist, the playback addresses corresponding to the public live streams can be returned to the live streaming room simultaneously. The user then selects a playback address from these multiple addresses within the live streaming room. The live streaming room then retrieves the public live stream corresponding to the selected playback address and plays it within the live streaming room. In another embodiment, when multiple public live streams exist, the playback addresses corresponding to the public live streams can be randomly selected from the multiple public live streams and returned to the live streaming room. This allows the live streaming room to retrieve the public live stream based on the selected playback address and play it within the live streaming room.
[0097] In one exemplary implementation, since the streaming server needs time to download the publicly available materials, if the streaming server has not yet finished downloading the publicly available materials when a user enters the live stream room, the backend server will directly return the playback address corresponding to the publicly available live stream to the live stream room. At this time, the user will see a black screen in the live stream room.
[0098] In one implementation, the black screen phenomenon can be optimized. When a user enters the live stream, if the streaming server has not yet finished downloading the public materials, the backend server will not return the playback address corresponding to the public live stream to the live stream. Instead, it will return a default image or video to the live stream so that the default image or video can be played in the live stream first. After the streaming server finishes downloading the public materials, it will return the playback address corresponding to the public live stream to the live stream so that the live stream can be played according to the playback address.
[0099] In one exemplary implementation, see [reference] Figure 5 If the user entering the live stream is a non-paying user, then returning the playback address corresponding to the public live stream to the live stream includes:
[0100] Step S50: If the user entering the live stream is a non-paying user, a preset prompt pop-up is returned to the live stream so that the prompt pop-up is displayed on the live stream page.
[0101] Specifically, the pop-up notification is used to prompt the user to become a paying user. In a specific scenario, the pop-up notification is as follows: Figure 6 As shown.
[0102] In this embodiment, when the backend server determines that the user entering the live stream is a non-paying user, in order to guide the user to watch the non-public live stream, it will return a preset prompt pop-up to the live stream so that the prompt pop-up can be displayed on the live stream page, so that the user can understand how to watch the non-public live stream after seeing the prompt pop-up.
[0103] Step S51: After receiving the cancellation command triggered by the user based on the prompt pop-up, return the playback address corresponding to the public live stream to the live room.
[0104] Specifically, after receiving the cancellation command triggered by the user based on the prompt pop-up, the backend server will return the playback address corresponding to the public live stream to the live stream room. That is, the backend server will only return the playback address corresponding to the public live stream to the live stream room after the user closes the prompt pop-up.
[0105] In one exemplary embodiment, the playback address corresponding to the non-public live stream includes the domain name of the content delivery network, the stream name of the non-public live stream, the expiration time of the playback address, and signature information. The signature information is obtained by signing at least one parameter in the playback address using a preset signature algorithm, and the at least one parameter includes the expiration time.
[0106] Specifically, the signature algorithm can be MD5, SHA-1, SHA-256, or other similar algorithms. The parameters refer to the domain name of the content delivery network included in the playback address, the stream name of the non-public live stream, and the expiration time of the playback address, etc.
[0107] It should be noted that the above parameters cannot be the signature information, and the parameters must include at least the expiration time.
[0108] The expiration time should be set relatively short, such as 1-3 seconds. This way, even if a user forges a playback address, when establishing a connection with the CDN based on that address, the time required for the forged address to reach the CDN will have exceeded the expiration time; that is, the forged playback address will have expired. Therefore, the non-public live stream cannot be obtained based on the forged playback address.
[0109] In a specific scenario, the playback address corresponding to the non-public live stream is as follows: Figure 7 As shown, Figure 7 The first box in the image is the domain name of the content delivery network, the second box is the stream name of the non-public live stream, the third box is the expiration time of the playback address, and the fourth box is the signature information.
[0110] In this embodiment, by shortening the expiration time of the playback address and using the expiration time as a parameter in the signature algorithm, the playback address is restricted from being forged and its parameters cannot be arbitrarily changed, thereby improving security.
[0111] In one exemplary embodiment, the method further includes:
[0112] The system receives a request to stop broadcasting from the live stream room and invokes the streaming server according to the request, so that the streaming server stops streaming the public material according to the second streaming address.
[0113] Specifically, after the streamer ends the live broadcast, the streamer will click the "End Broadcast" button on the live broadcast backend page to trigger the generation of a streamer-to-stream end request. After receiving the end request, the backend server will call the streaming server to tell the streaming server to stop streaming the public material according to the second streaming address, thereby ending the live broadcast.
[0114] In one exemplary embodiment, the method further includes:
[0115] The aforementioned public live stream has been deleted.
[0116] Specifically, after the streamer ends the live broadcast, the backend server will delete the public live stream in order to save storage resources.
[0117] See Figure 8 The diagram shown is a program block diagram of an embodiment of the video streaming device 80 of this application.
[0118] In this embodiment, the video streaming device 80 includes a series of computer program instructions stored in a memory. When these computer program instructions are executed by a processor, the video streaming functions of the various embodiments of this application can be implemented. In some embodiments, based on the specific operations implemented by each part of the computer program instructions, the video streaming device 80 can be divided into one or more modules. Specifically, the modules that can be divided are as follows:
[0119] The receiving module 81 is used to receive the broadcaster's request to start broadcasting in the live broadcast room. The broadcasting request includes the room number of the live broadcast room and the live broadcast mode selected by the broadcaster. The live broadcast mode includes public live broadcasting and private live broadcasting.
[0120] The creation module 82 is used to create at least two live streams under the room number according to the broadcast request when the broadcast mode selected by the broadcaster is non-public live stream. One of the live streams is a non-public live stream, and the other live streams are public live streams.
[0121] The return module 83 is used to, after completing the creation of the at least two live streams, return the first push address of the non-public live stream to the live room, and return the second push address of the public live stream and the download address of the public materials to the preset public live stream push server. The live room, after obtaining the first push address, will push the streamer's live video according to the first push address. The push server, after obtaining the download address, will download the public materials according to the download address, and after downloading the public materials, the push server will push the public materials according to the second push address.
[0122] In one exemplary implementation, the non-public live stream is the live stream corresponding to a paying user.
[0123] In one exemplary embodiment, the video streaming device 80 further includes a judgment module.
[0124] The judgment module is used to determine whether a user entering the live stream is a paying user when it receives a request to obtain the playback address of the live stream.
[0125] The return module 83 is further configured to return the playback address corresponding to the non-public live stream to the live stream if the user entering the live stream is a paying user; and to return the playback address corresponding to the public live stream to the live stream if the user entering the live stream is a non-paying user.
[0126] In one exemplary embodiment, the return module 83 is further configured to, if the user entering the live stream is a non-paying user, return a preset prompt pop-up to the live stream so that the prompt pop-up is displayed on the page of the live stream; and after receiving a cancellation instruction triggered by the user based on the prompt pop-up, return the playback address corresponding to the public live stream to the live stream.
[0127] In one exemplary embodiment, the playback address corresponding to the non-public live stream includes the domain name of the content delivery network, the stream name of the non-public live stream, the expiration time of the playback address, and signature information. The signature information is obtained by signing at least one parameter in the playback address using a preset signature algorithm, and the at least one parameter includes the expiration time.
[0128] In one exemplary embodiment, the video streaming device 80 further includes a calling module.
[0129] The calling module is used to receive a live broadcast shutdown request from the live broadcast room, and call the streaming server according to the shutdown request so that the streaming server stops streaming the public material according to the second streaming address.
[0130] In one exemplary embodiment, the video streaming device 80 further includes a deletion module.
[0131] The deletion module is used to delete the public live stream.
[0132] In this embodiment, the video streaming scheme receives a broadcast request from a streamer in a live room. The broadcast request includes the room number of the live room and the live mode selected by the streamer, which includes public live streaming and private live streaming. When the selected live streaming mode is private, at least two live streams are created under the room number according to the broadcast request. One of the live streams is a private live stream, and the others are public live streams. After creating the at least two live streams, the first streaming address of the private live stream is returned to the live room, and the second streaming address of the public live stream and the download address of the public materials are sent to a preset public live stream streaming server. After obtaining the first streaming address, the live room will stream the streamer's live video according to the first streaming address. After obtaining the download address, the streaming server will download the public materials according to the download address. After downloading the public materials, the streaming server will stream the public materials according to the second streaming address. By using the above video streaming method, a live room can correspond to at least two live streams, so that paying users can see one live stream content (paid content) and non-paying live stream users can see another live stream content (free content), thereby enabling non-paying users to also have better interactivity and improving user experience.
[0133] See Figure 9 The diagram shown is an architectural schematic of an embodiment of the video live streaming system of this application.
[0134] The video live streaming system includes: a broadcaster terminal 90, a backend server 91, a streaming server 92, a viewer terminal 93, and a content distribution network 94, wherein:
[0135] The broadcast terminal 90 is used by broadcasters to conduct live broadcasts in the live broadcast room.
[0136] The backend server 91 is used to receive the live broadcast request from the live broadcast room. The live broadcast request includes the room number of the live broadcast room and the live broadcast mode selected by the broadcaster. The live broadcast mode includes public live broadcast and private live broadcast. When the broadcaster selects a private live broadcast mode, at least two live broadcast streams are created under the room number according to the live broadcast request. One of the live broadcast streams is a private live broadcast stream, and the others are public live broadcast streams. After the creation of the at least two live broadcast streams is completed, the first push address of the private live broadcast stream is returned to the live broadcast room, and the second push address of the public live broadcast stream and the download address of the public materials are sent to the preset public live broadcast push server 92. After obtaining the first push address, the live broadcast room will push the broadcaster's live video according to the first push address.
[0137] The streaming server 92 is used to download the publicly available material according to the download address after obtaining the download address, and to stream the publicly available material according to the second streaming address after the download is completed;
[0138] Viewer terminal 93 is used to allow users to enter the live broadcast room to watch videos;
[0139] The backend server 91 is also used to push the live video of the broadcaster to the content delivery network 94;
[0140] Content delivery network 94 is used to verify the connection request when it receives a connection request sent by a viewer terminal.
[0141] In one exemplary embodiment, the connection request includes a playback address corresponding to the non-public live stream. The playback address includes the domain name of the content delivery network, the stream name of the non-public live stream, the expiration time of the playback address, and signature information. The signature information is obtained by signing at least one parameter in the playback address using a preset signature algorithm. The at least one parameter includes the expiration time. The content delivery network 94 is further configured to: upon receiving a connection request from a viewer's terminal, use the signature algorithm to sign the at least one parameter in the playback address to obtain target signature information; compare the target signature information with the signature information in the playback address; if the target signature information is the same as the signature information in the playback address, determine whether the sending time of the connection request exceeds the expiration time; if the sending time of the connection request exceeds the expiration time, determine that the connection request is an illegal request.
[0142] Specifically, when a viewer's terminal establishes a connection with a CDN (Content Delivery Network), the CDN calculates a target signature using the same signature algorithm. It then checks if this target signature matches the signature in the playback address. If the target signature matches, the CDN verifies the sending time of the connection request. If the CDN receives the connection request after the expiration time has passed, it considers the connection request invalid and rejects the connection.
[0143] In this embodiment, since expires (the expiration time) is also included as part of the signature calculation, modifying the expiration time alone will cause the calculated signature information to change, thereby making the playback address impossible to forge and the parameters impossible to change arbitrarily, thus improving security.
[0144] Figure 10 This illustration schematically shows a hardware architecture diagram of a computer device 10 suitable for implementing a video streaming method according to an embodiment of this application. In this embodiment, the computer device 10 is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Figure 10 As shown, the computer device 10 includes, but is not limited to, at least: a memory 120, a processor 121, and a network interface 122 that can communicate with each other via a system bus. Wherein:
[0145] The memory 120 includes at least one type of computer-readable storage medium, which can be volatile or non-volatile. Specifically, the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 120 may be an internal storage module of the computer device 10, such as the hard disk or memory of the computer device 10. In other embodiments, the memory 120 may also be an external storage device of the computer device 10, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device 10. Of course, the memory 120 may also include both the internal storage module and the external storage device of the computer device 10. In this embodiment, the memory 120 is typically used to store the operating system and various application software installed on the computer device 10, such as the program code for video streaming methods. In addition, the memory 120 can also be used to temporarily store various types of data that have been output or will be output.
[0146] In some embodiments, processor 121 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other video streaming chip. Processor 121 is typically used to control the overall operation of computer device 10, such as performing control and processing related to data interaction or communication with computer device 10. In this embodiment, processor 121 is used to run program code stored in memory 120 or process data.
[0147] Network interface 122 may include a wireless network interface or a wired network interface, which is typically used to establish a communication link between computer device 10 and other computer devices. For example, network interface 122 is used to connect computer device 10 to an external terminal via a network, establishing a data transmission channel and communication link between computer device 10 and the external terminal. The network may be an intranet, the Internet, Global System for Mobile Communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, or other wireless or wired networks.
[0148] It should be pointed out that, Figure 10 Only computer devices with components 120 to 122 are shown; however, it should be understood that it is not required to implement all of the shown components, and more or fewer components may be implemented instead.
[0149] In this embodiment, the video streaming method stored in memory 120 can be divided into one or more program modules and executed by one or more processors (processor 121 in this embodiment) to complete this application.
[0150] This application provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the steps of the video streaming method in the embodiment.
[0151] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device. Of course, the computer-readable storage medium may include both the internal storage unit and the external storage device of the computer device. In this embodiment, the computer-readable storage medium is typically used to store the operating system and various application software installed on the computer device, such as the program code of the video streaming method in the embodiment. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or will be output.
[0152] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across at least two network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of this application. Those skilled in the art can understand and implement this without any creative effort.
[0153] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software and a general-purpose hardware platform, or of course, using hardware. Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0154] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A video streaming method, applied to a backend server, characterized in that, The method includes: Receive a request from a streamer to start a live broadcast in the live broadcast room. The request includes the room number of the live broadcast room and the live broadcast mode selected by the streamer. The live broadcast mode includes public live broadcast and private live broadcast. When the live streaming mode selected by the broadcaster is non-public live streaming, at least two live streaming streams are created under the room number according to the broadcast request, one of which is a non-public live streaming stream and the others are public live streaming streams. After creating at least two live streams, the first push address of the non-public live stream is returned to the live streaming room, and the second push address of the public live stream and the download address of the public materials are sent to the preset public live stream push server. After obtaining the first push address, the live streaming room will push the live video of the anchor according to the first push address. After obtaining the download address, the push server will download the public materials according to the download address. After the download of the public materials is completed, the push server will push the public materials according to the second push address. The method further includes: If, during the process of pushing the public material to the second push address, the live stream has not ended but the public material has already been pushed, the push of the public material to the second push address will continue repeatedly.
2. The video streaming method according to claim 1, characterized in that, The non-public live stream refers to the live stream for paid users.
3. The video streaming method according to claim 2, characterized in that, The method further includes: Upon receiving a request to obtain the playback address of the live stream, determine whether the user entering the live stream is a paying user; If the user entering the live stream is a paying user, the playback address corresponding to the non-public live stream will be returned to the live stream. If the user entering the live stream is a non-paying user, the playback address corresponding to the public live stream will be returned to the live stream.
4. The video streaming method according to claim 3, characterized in that, If the user entering the live stream is a non-paying user, then returning the playback address corresponding to the public live stream to the live stream includes: If the user entering the live stream is a non-paying user, a preset prompt pop-up will be returned to the live stream so that the prompt pop-up will be displayed on the live stream page. Upon receiving a cancellation command triggered by the user based on the pop-up prompt, the playback address corresponding to the public live stream is returned to the live stream room.
5. The video streaming method according to claim 3 or 4, characterized in that, The playback address corresponding to the non-public live stream includes the domain name of the content delivery network, the stream name of the non-public live stream, the expiration time of the playback address, and signature information. The signature information is obtained by signing at least one parameter in the playback address using a preset signature algorithm, and the at least one parameter includes the expiration time.
6. The video streaming method according to any one of claims 1 to 4, characterized in that, The method further includes: The system receives a request to stop broadcasting from the live stream room and invokes the streaming server according to the request, so that the streaming server stops streaming the public material according to the second streaming address.
7. The video streaming method according to claim 6, characterized in that, The method further includes: The aforementioned public live stream will be deleted.
8. A video streaming device, characterized in that, The video streaming device includes: The receiving module is used to receive the broadcaster's request to start broadcasting in the live broadcast room. The broadcasting request includes the room number of the live broadcast room and the live broadcast mode selected by the broadcaster. The live broadcast mode includes public live broadcasting and private live broadcasting. The creation module is used to create at least two live streams under the room number according to the broadcast request when the broadcast mode selected by the broadcaster is non-public live stream. One of the live streams is a non-public live stream, and the other live streams are public live streams. The return module is used to, after completing the creation of the at least two live streams, return the first push address of the non-public live stream to the live room, and return the second push address of the public live stream and the download address of the public materials to the preset public live stream push server. The live room, after obtaining the first push address, will push the streamer's live video according to the first push address. The push server, after obtaining the download address, will download the public materials according to the download address, and after downloading the public materials, the push server will push the public materials according to the second push address. This also includes: If, during the process of pushing the public material to the second push address, the live stream has not ended but the public material has already been pushed, the push of the public material to the second push address will continue repeatedly.
9. A video live streaming system, characterized in that, The video live streaming system includes: The broadcasting terminal is used by broadcasters to conduct live broadcasts in the live broadcast room; The backend server receives live streaming requests from the live streaming room. The request includes the room number and the live streaming mode selected by the streamer, which can be either public or private. When the streamer selects a private live streaming mode, at least two live streams are created under the room number according to the request. One live stream is designated as a private stream, and the others are designated as public streams. After creating the at least two live streams, the server returns the first push address of the private live stream to the live streaming room and sends the second push address of the public live stream and the download address of the public materials to a pre-defined public live stream push server. Upon receiving the first push address, the live streaming room pushes the streamer's live video according to that address. The streaming server is used to download the publicly available material according to the download address after obtaining the download address, and to stream the publicly available material according to the second streaming address after the download is completed; Viewer terminal, used to allow users to enter the live broadcast room to watch videos; The backend server is also used to push the live video of the broadcaster to the content delivery network; The content delivery network is used to verify the connection request when it receives a connection request sent by a viewer's terminal; This also includes: If, during the process of pushing the public material to the second push address, the live stream has not ended but the public material has already been pushed, the push server will continue to push the public material to the second push address repeatedly.
10. The video live streaming system according to claim 9, characterized in that, The connection request includes the playback address corresponding to the non-public live stream. The playback address includes the domain name of the content delivery network, the stream name of the non-public live stream, the expiration time of the playback address, and signature information. The signature information is obtained by signing at least one parameter in the playback address using a preset signature algorithm. The at least one parameter includes the expiration time. The content delivery network is further configured to: Upon receiving a connection request from a viewer's terminal, the signature algorithm is used to sign at least one parameter in the playback address to obtain target signature information; Compare whether the target signature information is the same as the signature information in the playback address; If the target signature information is the same as the signature information in the playback address, then determine whether the sending time of the connection request exceeds the expiration time; If the connection request is sent after the expiration time, the connection request is determined to be an illegal request.
11. A computer device, characterized in that, The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
13. A computer program product comprising computer instructions, characterized in that, When executed by a processor, the computer instructions implement the steps of the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Webpage video playing method based on authority verification, server and playing terminal
CN107707984A
Multi-stream data distribution method and system based on content grading
CN111447412A
