Signaling server, streaming media system, and media stream control method

Through the signaling server, the media flow control method is optimized, the media flow state is judged, the marks and identifications are set, the flow opening instructions are processed asynchronously, and the flow management is closed regularly. This solves the problem of low flow opening rate of the signaling server and achieves more efficient media flow control.

WO2025180126A1PCT designated stage Publication Date: 2025-09-04BOE TECHNOLOGY GROUP CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/072457
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-29
Filing Date
2025-01-15
Publication Date
2025-09-04

AI Technical Summary

Technical Problem

The success rate of existing signaling servers is low when opening media streams, and it is easy to cause the problem of repeated opening of streams leading to waste of resources and failure of opening of streams.

Method used

By judging the status of the media stream, the signaling server avoids repeated openings, uses asynchronous threads to process opening instructions, sets tags and identifications, optimizes the opening process, regularly closes the flow and manages active flow, subscribes to exception instructions and handles data, and improves the opening success rate.

Benefits of technology

It improves the success rate of media streaming, reduces resource waste, and improves the stability and flow speed of the streaming media system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025072457_04092025_PF_FP_ABST
    Figure CN2025072457_04092025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of streaming media, and discloses a signaling server, a streaming media system, and a media stream control method. The signaling server can determine, upon reception of a stream opening request from a playback terminal, whether a media stream corresponding to the stream opening request has been opened, acquire an identifier of the media stream when the media stream has been opened, and provide the identifier to the playback terminal, so that the playback terminal can acquire the media stream on the basis of the identifier. In this way, repeated stream opening can be avoided, thereby increasing the success rate of a signaling server opening a media stream.
Need to check novelty before this filing date? Find Prior Art

Description

Signaling server, streaming media system and media stream control method

[0001] This application claims priority to Chinese patent application No. 202410232904.0 filed on February 29, 2024, entitled “SIGNALING SERVER, STREAMING MEDIA SYSTEM AND MEDIA STREAM CONTROL METHOD”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present application relates to the field of streaming media technology, and in particular to a signaling server, a streaming media system, and a media stream control method. Background Art

[0003] A streaming media system is a streaming media system used to realize the playback function of media streams. The streaming media system includes structures such as a signaling server, a playback terminal, and a network camera.

[0004] A current signaling server, upon receiving a request for opening a media stream from a player, sends an opening instruction to a network camera, so that the network camera can cooperate with other structures in a streaming media system to open the media stream.

[0005] However, the success rate of the above signaling server in opening the media stream is low. Summary of the Invention

[0006] The embodiments of the present application provide a signaling server, a streaming media system, and a media stream control method. The technical solution is as follows:

[0007] According to one aspect of an embodiment of the present application, a signaling server is provided. The signaling server is used in a streaming media system. The streaming media system further includes a playback terminal and a network camera. The signaling server is used to:

[0008] After receiving a stream opening request from a player, determining whether the media stream corresponding to the stream opening request has been opened;

[0009] When the media stream has started, obtaining an identifier of the media stream;

[0010] Sending the identifier of the media stream to the playback end.

[0011] Optionally, the signaling server is further configured to:

[0012] When the media stream is not started, determining whether the media stream is in the process of starting the stream;

[0013] When the media stream is in the process of opening a stream, after a first preset period of time, performing the step of determining whether the media stream corresponding to the opening stream request has been opened;

[0014] When the media stream is not in the process of opening a stream, determining whether the media stream is in the process of closing a stream;

[0015] After determining that the media stream is in the process of shutting down, after a second preset period of time, performing the step of determining whether the media stream corresponding to the start-up request has been started;

[0016] After determining that the media stream is not in the process of shutting down the stream, a stream opening instruction is sent to the network camera to open the media stream.

[0017] Optionally, the streaming media system further includes a playback server, and the signaling server is further configured to:

[0018] After determining that the media stream is not in the process of being shut down, generating an identifier of the media stream;

[0019] The player terminal is provided with an identifier of the media stream, and the player terminal is used to send the identifier to the player server. The player server is used to push the media stream to the player terminal after acquiring the media stream based on the identifier.

[0020] Optionally, the streaming media system further includes a first server, and the signaling server is further configured to:

[0021] After determining that the media stream is not in the process of shutting down the stream, setting an open stream flag in the first server, wherein the open stream flag is used to indicate that the media stream is in the process of shutting down the stream, and the signaling server is used to determine whether the media stream is in the process of shutting down the stream based on the open stream flag;

[0022] After the media stream is opened, the opening stream mark in the first server is removed.

[0023] Optionally, the streaming media system further includes a second server, and the signaling server is further configured to:

[0024] After completing the opening of the media stream, sending the opening data of the media stream to the second server, where the opening data includes an identifier of the media stream;

[0025] When the media stream has started, the identifier of the media stream is obtained through the second server.

[0026] Optionally, the streaming media system further includes a third server and a streaming media server, and the signaling server is further configured to:

[0027] Subscribing to an active stream list in the third server, the streaming media server being configured to provide the third server with a list of active streams within a preset time period at intervals thereof, the active streams including media streams that are available and used within the preset time period;

[0028] Acquire a stream opening record within the preset duration from the second server, wherein the stream opening record records the stream opening data of the media stream opened within the preset duration;

[0029] After obtaining the active stream list, the media streams in the open stream record that are not in the active stream list are closed.

[0030] Optionally, the signaling server stores a task list of media streams, the task list recording the media streams with tasks within the preset duration, and the signaling server is further configured to:

[0031] Determine a target media stream that is in the task list and not in the active stream list;

[0032] The target media stream is opened.

[0033] Optionally, the signaling server is further configured to:

[0034] Upon receiving a shut-down instruction for a first media stream, determining whether the first media stream is in the process of opening a stream;

[0035] When the first media stream is in the process of being opened, stopping closing the first media stream based on the closing instruction;

[0036] When the first media stream is not in the process of opening a stream, determining whether the first media stream is in the process of closing a stream;

[0037] When the first media stream is in the process of being shut down, stopping shutting down the first media stream based on the shut-down instruction;

[0038] When the first media stream is not in the process of being shut down, a shut down instruction is sent to the network camera.

[0039] Optionally, the streaming media system further includes a fourth server, and the signaling server is further configured to:

[0040] When the first media stream is not in the process of being shut down, setting a shut-down flag in the fourth server, where the shut-down flag is used to indicate that the first media stream is in the process of being shut down, and the signaling server subscribes to the shut-down flag and determines whether the first media stream is in the process of being shut down based on the shut-down flag.

[0041] After the first media stream is shut down, the shut-down mark in the fourth server is removed.

[0042] Optionally, the streaming media system further includes a fifth server, a playback server, and a streaming media server, and the signaling server is further configured to:

[0043] subscribing to an abnormal instruction of the fifth server, wherein the playback server is configured to send the abnormal instruction to the fifth server when detecting an abnormality in a first media stream, wherein the first media stream is a media stream that the playback terminal instructs the playback server to obtain;

[0044] Upon receiving the abnormal instruction, querying, through the streaming media server, whether the first media stream currently exists;

[0045] When the key frame exists, a mandatory key frame instruction is sent to the network camera;

[0046] If the first media stream does not exist, the first media stream is opened.

[0047] Optionally, the streaming media system further includes a sixth server and a seventh server, and the signaling server is further configured to:

[0048] Subscribing to the processing data of the sixth server, the playback terminal, the network camera, the playback server, and the streaming media server are used to send the processing data of the media stream to the sixth server;

[0049] When receiving the processed data provided by the sixth server, the processed data is sent to the seventh server.

[0050] According to another aspect of an embodiment of the present application, a streaming media system is provided, the streaming media system comprising: a signaling server, a playback terminal, and a network camera;

[0051] The playback terminal sends a stream opening request to the signaling server;

[0052] The signaling server determines whether the media stream corresponding to the stream opening request has been opened;

[0053] The signaling server obtains the identifier of the media stream when the media stream has started streaming;

[0054] The signaling server sends the identifier of the media stream to the playback terminal.

[0055] Optionally, when the media stream is not started, the signaling server determines whether the media stream is in the process of starting the stream;

[0056] When the media stream is in the process of opening a stream, the signaling server performs the step of determining whether the media stream corresponding to the opening stream request has been opened after a first preset time period;

[0057] When the media stream is not in the process of opening a stream, the signaling server determines whether the media stream is in the process of closing a stream;

[0058] After determining that the media stream is in the process of being shut down, the signaling server performs the step of determining whether the media stream corresponding to the stream opening request has been opened after a second preset time period;

[0059] After determining that the media stream is not in the process of shutting down the stream, the signaling server sends a stream start instruction to the network camera to start the stream.

[0060] Optionally, the streaming media system further includes a playback server, a streaming media server and a message server;

[0061] After determining that the media stream is not in the process of being shut down, the signaling server generates an identifier of the media stream;

[0062] The signaling server provides the identifier of the media stream to the playback terminal;

[0063] The playback terminal sends the identifier to the playback server;

[0064] After receiving the start stream instruction, the network camera sends the media stream to the streaming media server;

[0065] After receiving the media stream, the streaming media server sends a media stream message to the message server;

[0066] The playback server subscribes to the media stream message of the message server, and after obtaining the identifier of the media stream, determines whether the media stream message exists in the message server;

[0067] When the media stream message exists in the message server, the playback server obtains the media stream from the streaming server and sends the media stream to the playback terminal.

[0068] Optionally, the streaming media system further includes a first server;

[0069] When the media stream is not in the process of shutting down the stream, the signaling server sets a stream opening flag in the first server, where the stream opening flag is used to indicate that the media stream is in the process of shutting down the stream, and the signaling server is used to determine whether the media stream is in the process of shutting down the stream based on the stream opening flag;

[0070] After completing opening the media stream, the signaling server removes the opening mark in the first server.

[0071] According to another aspect of an embodiment of the present application, a media stream control method is provided, which is used in a signaling server. The signaling server is used in a streaming media system. The streaming media system also includes a playback terminal and a network camera. The method includes:

[0072] After receiving a stream opening request from a player, determining whether the media stream corresponding to the stream opening request has been opened;

[0073] When the media stream has started, obtaining an identifier of the media stream;

[0074] Sending the identifier of the media stream to the playback end.

[0075] Optionally, the method further includes:

[0076] When the media stream is not started, determining whether the media stream is in the process of starting the stream;

[0077] When the media stream is in the process of opening a stream, after a first preset period of time, performing the step of determining whether the media stream corresponding to the opening stream request has been opened;

[0078] When the media stream is not in the process of opening a stream, determining whether the media stream is in the process of closing a stream;

[0079] After determining that the media stream is in the process of shutting down, after a second preset period of time, performing the step of determining whether the media stream corresponding to the start-up request has been started;

[0080] After determining that the media stream is not in the process of shutting down the stream, a stream opening instruction is sent to the network camera to open the media stream.

[0081] According to another aspect of an embodiment of the present application, a computer storage medium is provided, in which at least one instruction, at least one program, a code set, or an instruction set is stored. The at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the media stream control method as described above.

[0082] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:

[0083] A signaling server is provided. After receiving a stream opening request from a playback terminal, the signaling server can determine whether the media stream corresponding to the stream opening request has already been opened. If the stream has already been opened, the signaling server obtains an identifier of the media stream and provides the identifier to the playback terminal so that the playback terminal can obtain the media stream based on the identifier. This can avoid the occurrence of repeated stream openings, and further improve the success rate of the signaling server in opening the media stream. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0085] FIG1 is a block diagram of a signaling server provided in an embodiment of the present application;

[0086] FIG2 is a diagram illustrating another interaction framework between a signaling server and various units provided in an embodiment of the present application;

[0087] FIG3 is a structural block diagram of the signaling server shown in FIG2 ;

[0088] FIG4 is a schematic diagram of an open-flow protection module provided in an embodiment of the present application;

[0089] FIG5 is a schematic diagram of an unattended viewing processing module in the signaling server shown in FIG3 ;

[0090] FIG6 is a schematic diagram of a flow abnormality reopening module in the signaling server shown in FIG3 ;

[0091] 7 is a schematic diagram of a monitoring module in the signaling server shown in FIG3;

[0092] FIG8 is a schematic diagram of a streaming media system provided in an embodiment of the present application;

[0093] FIG9 is a flow chart of a method for controlling a media stream provided in an embodiment of the present application.

[0094] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0095] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0096] IP Camera (IPC) is a new generation of camera that combines traditional cameras with network technology. It can transmit video images to various locations through the network, and remote viewers can watch the video images without any professional software, as long as they use a web browser or player software.

[0097] A network camera can be used in a streaming media system to play video images. The streaming media system can also include units such as a signaling server and a playback terminal. In this streaming media system, the playback terminal (such as a player or browser) can send a stream opening request to the signaling server. The signaling server sends a stream opening instruction to the network camera based on the request. The network camera can start to open the media stream requested by the playback terminal based on the stream opening instruction (the media stream can include at least one of a video stream and an audio stream). In this way, the stream opening is completed. After the stream opening is completed, the playback terminal can play the media stream provided by the network camera. Correspondingly, closing the stream means stopping the transmission of the media stream. During the stream closing process, the signaling server can notify the network camera to stop providing the media stream to achieve stream closing.

[0098] However, when the network camera receives the start-streaming instruction, the corresponding media stream may have already been started. If the network camera starts the stream again based on the start-streaming instruction, it may cause repeated start-streaming. This will not only waste resources, but also cause the number of media streams that each network camera can handle to fail, resulting in a low start-streaming success rate. In addition, repeated start-streaming may also cause media stream transmission errors.

[0099] In addition, when the network camera receives the start-stream instruction, it may be in some special situations, such as it may be in the process of starting the stream (the start-stream process may be initiated by other playback terminals), or it may be in the process of shutting down the stream. In these special situations, the start-stream may succeed or fail, resulting in a low success rate of the start-stream.

[0100] The embodiments of the present application provide a signaling server, a streaming media system, and a media stream control method, which can solve some problems existing in the above-mentioned related technologies.

[0101] FIG1 is a block diagram of a signaling server provided in an embodiment of the present application. The signaling server 10 is used in a streaming media system. The streaming media system further includes a player 20 and a network camera 30. The signaling server 10 is used to:

[0102] After receiving the stream opening request from the playback terminal 20 , it is determined whether the media stream corresponding to the stream opening request has been opened.

[0103] When the media stream has started, obtain the identifier of the media stream.

[0104] The identifier of the media stream is sent to the playback terminal 20 .

[0105] To sum up, an embodiment of the present application provides a signaling server, which, after receiving a stream opening request from a playback end, can determine whether the media stream corresponding to the stream opening request has already been opened, and if it has been opened, obtain an identifier of the media stream and provide the identifier to the playback end so that the playback end can obtain the media stream based on the identifier. This can avoid the occurrence of repeated stream openings, and thus can achieve the effect of improving the success rate of the signaling server in opening the media stream.

[0106] Optionally, the signaling server is further configured to:

[0107] When the media stream is not started, it is determined whether the media stream is in the process of starting the stream.

[0108] When the media stream is in the process of opening a stream, the step of determining whether the media stream corresponding to the opening stream request has already been opened is performed after a first preset period of time. The first preset period of time may be a period of time for waiting for the opening stream to be completed, and the length of the first preset period of time may be greater than a preset duration of the opening stream. Exemplarily, the first preset period of time may be one minute.

[0109] When the media stream is not in the process of opening the stream, it is determined whether the media stream is in the process of closing the stream.

[0110] After determining that the media stream is in the process of being shut down, the step of determining whether the media stream corresponding to the stream start request has been started is performed after a second preset period of time. The second preset period of time may be a period of waiting for the completion of the stream shut down, and the length of the second preset period of time may be greater than the preset duration of the stream shut down. Exemplarily, the second preset period of time may be 1 minute.

[0111] After determining that the media stream is not in the process of being shut down, a stream opening instruction is sent to the network camera 30 to open the media stream. For example, the stream opening instruction may be a stream opening instruction based on the GB28181 standard.

[0112] In this case, the signaling server can send an opening flow instruction to the network camera to open the media stream when it determines that the media stream corresponding to the opening flow request is not in the opening flow process and is not in the closing flow process. This can avoid the opening flow failure that may be caused by repeated opening of the stream when the media stream is in the opening flow process, and avoid the opening flow failure that may be caused by opening the stream when the media stream is in the closing flow process. This can improve the success rate of the signaling server in opening the media stream.

[0113] FIG2 is a diagram illustrating an interaction framework between another signaling server and various units provided in an embodiment of the present application. Referring to FIG2 , the signaling server 10 is used in a streaming media system. The streaming media system includes: a playback terminal 20, a network camera 30, a playback server 40, a streaming media server 50, and a message server k. The signaling server 10 is further used to:

[0114] After determining that the media stream is not in the process of being shut down, an identifier of the media stream is generated.

[0115] The identification of the media stream is provided to the playback terminal 20, and the playback terminal 20 is used to send the identification to the playback server 40. The playback server 40 is used to push the media stream to the playback terminal 20 after obtaining the media stream based on the identification. Among them, the two steps of the signaling server 10 providing the identification of the media stream to the playback terminal 20 and the signaling server 10 sending the start-stream instruction to the network camera 30 are performed by the signaling server 10 through two asynchronous threads. In this way, the signaling server 10 can send the start-stream instruction to the network camera 30 without waiting for the feedback from the playback terminal 20, so as to achieve the effect of shortening the start-stream time. In an embodiment of the present application, one media stream can correspond to one identification. For a network camera, multiple media streams with different parameters (such as different resolutions or bit rates, etc.) can be provided, and each media stream can have a fixed identification. Among them, the identification of the media stream can be the stream ID of the media stream.

[0116] Furthermore, after receiving the media stream identifier, the playback terminal 20 can send the identifier to the playback server 40. Furthermore, after receiving the start-streaming instruction, the network camera 30 will send the media stream to the streaming server 50. After receiving the media stream, the streaming server 50 sends a media stream message to the message server k and stores the media stream in a local memory (e.g., a cache service within the streaming server 50). The playback server 40 subscribes to the media stream messages from the message server k and, after obtaining the media stream identifier provided by the playback terminal 20, queries the message server k for the presence of the media stream message. If the message server k does, the playback server 40 retrieves the media stream from the streaming server 50, processes the media stream, and sends it to the playback terminal 20. This completes the start-streaming of the media stream.

[0117] Optionally, the streaming media system further includes a first server F1, and the signaling server 10 is further configured to:

[0118] After determining that the media stream is not in the process of shutting down, the first server F1 sets an open stream flag, which is used to indicate that the media stream is in the process of shutting down. The signaling server 10 can determine whether the media stream is in the process of shutting down by the open stream flag.

[0119] After the media stream is opened, the opening mark in the first server F1 is removed to indicate that the media stream is not in the opening process.

[0120] This provides a method for a signaling server to determine whether a media stream is in the process of opening a stream. In this method, after determining that the media stream is not in the process of closing a stream, it indicates that the media stream is currently neither in the process of opening a stream nor in the process of closing a stream. At this time, the signaling server 10 can prepare to start the process of opening a stream. At this time, the signaling server 10 can set an opening stream flag on the first server F1 to indicate that the media stream is in the process of opening a stream. The signaling server 10 can then confirm whether the media stream is in the process of opening a stream by checking whether the opening stream flag corresponding to the media stream exists on the first server F1.

[0121] In an exemplary embodiment, the first server F1 may be a Remote Dictionary Server (Redis) server. The Remote Dictionary Server is an open-source key-value storage system, and embodiments of the present application may utilize the Remote Dictionary Server to implement data storage. Furthermore, the open stream marker may be a Redis distributed lock, which can be used to confirm whether the media stream is in the open stream process.

[0122] Optionally, the streaming media system further includes a second server F2, and the signaling server 10 is further configured to:

[0123] After the media stream is opened, the opening data of the media stream is sent to the second server F2, where the opening data includes the identifier of the media stream.

[0124] When the media stream has started, the identifier of the media stream is obtained through the second server F2.

[0125] This provides a method for the signaling server 10 to obtain the identifier of the media stream. In this method, after each media stream opening, the signaling server 10 can send the opening data including the identifier of the media stream to the second server F2. Subsequently, the signaling server 10 can obtain the identifier of the media stream from the second server F2. The opening data may also include data such as the source address of the media stream, which is not limited in this embodiment of the present application.

[0126] The second server F2 may be a server for remote dictionary services.

[0127] Optionally, the streaming media system further includes a third server F3, and the signaling server 10 is further configured to:

[0128] Subscribe to the active stream list in the third server F3. The streaming server 50 is used to provide the third server F3 with a list of active streams within a preset time period every preset time period. The active stream includes media streams that can be used and are used within the preset time period.

[0129] A stream opening record within a preset time period is obtained from the second server F2, where the stream opening record records the stream opening data of the media stream opened within the preset time period.

[0130] After obtaining the active stream list, close the media streams in the stream opening record that are not in the active stream list.

[0131] It should be noted that in the related art, when a media stream is not watched for a certain period of time, the media stream will be closed through the process of closing the stream. However, this will cause the streaming media system to frequently close and open the stream. For the same media stream, closing the stream and opening the stream will affect each other. For example, during the process of closing the stream, the signaling server may receive an instruction to open the stream. If the process of opening the stream is executed at this time, the process of closing the stream may close the media stream, thereby seriously affecting the opening stream in the streaming media system.

[0132] The embodiment of the present application provides a method for shutting down a stream through the above content. Through this method, the signaling server can periodically shut down one or more inactive streams, thereby improving the shut-down speed and reducing the frequency of shut-down of the streaming media system, thereby reducing the length of time the network camera is in the shut-down process. On this basis, the impact of the shut-down process on opening a stream can be reduced, and the speed of opening a stream can be improved. For example, this method can reduce the possibility of encountering the situation of being in the shut-down process and needing to wait when opening a stream, thereby improving the overall opening speed of the streaming media system.

[0133] Among them, active streams can refer to media streams that can be used (or called alive) and are used in the streaming media server 50 within a preset time period. The used media streams here may include pulled media streams and media streams with tasks (tasks may include recording tasks and media stream analysis tasks, etc.).

[0134] The third server F3 may be a Kafka (an open source stream processing platform) server. The Kafka server is an open source stream processing platform that can implement a high-throughput distributed publish-subscribe messaging system. The embodiments of the present application may utilize the Kafka server to implement some subscription messaging functions.

[0135] In addition, it can be seen from the above content of the embodiment of the present application that after completing each open stream, the signaling server 10 will send the open stream data including the identifier of the media stream to the second server F2, and then the open stream record within the preset time period can be obtained from the second server F2.

[0136] In addition, the subscription involved in the embodiments of the present application is a method of obtaining data, through which the subscriber can obtain the subscribed data in a timely manner. For example, after a component (such as a signaling server, etc.) subscribes to the subscription data in a subscription server (such as a third server), when the subscription data appears in the subscription server, the component can obtain the subscription data. Of course, the specific implementation method of the subscription can also refer to the relevant technology, and the embodiments of the present application are not limited to this.

[0137] Optionally, the signaling server 10 stores a task list of media streams, where the task list records media streams with tasks within a preset time period. The signaling server 10 is further configured to:

[0138] Determine the target media stream that is in the task list and not in the active stream list.

[0139] Open the target media stream.

[0140] Among them, the target media streams that are in the task list but not in the active stream list may be streams that are closed due to some accidents. After completing the above-mentioned periodic stream shutdown process, the signaling server 10 can reopen these target media streams. In this way, the reopening of these tasked media streams can be automatically achieved, thereby improving the stability of the streaming media system.

[0141] Optionally, the signaling server 10 is further configured to:

[0142] When receiving a shut-down instruction for the first media stream, it is determined whether the first media stream is in the process of opening the stream. The method of determining whether the first media stream is in the process of opening the stream can refer to the above embodiment, and the embodiment of the present application will not be repeated here.

[0143] When the first media stream is in the process of being streamed, the signaling server stops shutting down the first media stream based on the shut-down instruction. If the first media stream is currently in the process of being streamed, indicating that a player 20 wants to play the first media stream, the signaling server can stop the shut-down process to avoid affecting the normal playback of the first media stream by the player. The first media stream can be any media stream in the streaming media system.

[0144] When the first media stream is not in the process of opening a stream, it is determined whether the first media stream is in the process of closing a stream.

[0145] When the first media stream is in the process of being shut down, the shut down process for the first media stream based on the shut down instruction is stopped. If the first media stream is in the process of being shut down, the shut down process for the first media stream can be stopped to avoid repeated shut down and waste of resources.

[0146] When the first media stream is not in the process of being shut down, a shut down instruction is sent to the network camera. After receiving the shut down instruction, the network camera stops collecting and providing the media stream to realize shut down.

[0147] Exemplarily, the flow shut-off instruction may be a flow shut-off instruction based on the GB28181 standard.

[0148] This provides a stable way to shut down the stream, which avoids wasting resources by repeatedly shutting down the stream, and prevents the shutting down process from affecting the opening of the media stream and causing the opening of the stream to fail, thereby improving the stability of the application's streaming media system.

[0149] Optionally, the streaming media system further includes a fourth server F4, and the signaling server 10 is further configured to:

[0150] When the first media stream is not in the process of being shut down, a shut-down flag is set in the fourth server F4, where the shut-down flag is used to indicate that the first media stream is in the process of being shut down.

[0151] The signaling server 10 subscribes to the shut-down flag and is used to determine whether the first media stream is in the shut-down process based on the shut-down flag.

[0152] After the first media stream is shut down, the shut-down mark in the fourth server F4 is removed.

[0153] This provides a method for a signaling server to determine whether a media stream is in the process of shutting down. This method is similar to the method for a signaling server to determine whether a media stream is in the process of starting up a stream. That is, a flag is set in the server to indicate that the media stream is in the process of shutting down. The signaling server can subscribe to messages about the shutting down flag to learn whether the media stream is in the process of shutting down.

[0154] The fourth server F4 may be a server for remote dictionary services, and the open flow marker may be a Redis distributed lock.

[0155] Optionally, the streaming media system further includes a fifth server F5 and a playback server 40, and the signaling server is further configured to:

[0156] The playback server 40 subscribes to the abnormal instruction of the fifth server F5. When detecting an abnormality in the first media stream (such as interruption or key frame loss), it sends an abnormal instruction to the fifth server F5. The first media stream is the media stream that the playback end instructs the playback server to obtain.

[0157] When the abnormal instruction is received, the streaming media server 50 is used to query whether the first media stream currently exists.

[0158] If it exists, it indicates that the first media stream still exists, but an anomaly has occurred due to some reason. In this case, the signaling server 10 can send a forced key frame instruction to the network camera 30. After receiving the forced key frame instruction, the network camera 30 will provide a key frame to the playback server 40 via the streaming server 50. The playback server 40 can be configured to decode the received data (which can be video data and / or audio data in the media stream) after receiving the key frame to attempt to restore the first media stream. If sending the forced key frame instruction fails to restore the first media stream, the signaling server can repeatedly send the forced key frame instruction to the network camera 30. This can solve the stream anomaly problem caused by key frame loss.

[0159] If it does not exist, it indicates that the first media stream has disappeared. At this time, the signaling server can start to open the first media stream. The opening method can adopt the method provided by the above embodiment or the method adopted in the relevant technology, which is not limited by the embodiment of the present application.

[0160] The fifth server F5 may be a Kafka server.

[0161] Optionally, the streaming media system further includes a sixth server F6 and a seventh server F7, and the signaling server 10 is further configured to:

[0162] The playback device 20, network camera 30, playback server 40, and streaming media server 50 subscribe to the processing data of the sixth server F6. The playback device 20, network camera 30, playback server 40, and streaming media server 50 are configured to send the processing data of the media stream to the sixth server F6. The stream exception data may be data about the media stream generated by each unit when processing the media. This data may record the time when some exceptions occurred and information describing the exceptions.

[0163] When receiving the processed data provided by the sixth server F6, the processed data is sent to the seventh server F7.

[0164] So provide a kind of monitoring mode for media stream, in this mode, playback terminal 20, network camera 30, playback server 40, streaming media server 50 can all send detected processing data to the 6th server F6, and signaling server can subscribe to this processing data, so just can clearly determine the position where media stream is abnormal.Compared to the mode that determines the position where media stream is abnormal by log, the mode that embodiment of the present application provides can promote the determination speed of the position where media stream is abnormal.Certainly, in the mode that embodiment of the present application provides, also can obtain log, and check the abnormality of media stream based on log and above-mentioned stream abnormal data together.

[0165] In addition, the seventh server F7 may provide a query interface so that an operator can obtain the flow anomaly data stored in the seventh server F7 through the query interface.

[0166] The sixth server F6 may be a Kafka server, and the seventh server F7 may be a remote dictionary service server.

[0167] It should be noted that the first server F1, the second server F2, the fourth server F4 and the seventh server involved in the embodiment of the present application can be one server or a server cluster, and the third server F3, the fifth server F5 and the sixth server F6 can be a server or a server cluster.

[0168] FIG3 is a block diagram of the structure of the signaling server shown in FIG2 . Referring to FIG3 , the signaling server 10 may include a flow opening protection module 101, a flow closing protection module 102, an unattended viewing processing module 103, a message module 104, a flow abnormality restart module 105, and a flow monitoring module 106. The signaling server may be used to implement some of the operations implemented by the signaling server involved in the above-mentioned embodiments.

[0169] Please refer to FIG4 , which is a schematic diagram of an open-stream protection module provided in an embodiment of the present application. In the example, the open-stream protection module 101 is configured to perform the following steps after receiving an open-stream request from a playback terminal:

[0170] 1.1. Determine whether the media stream corresponding to the stream opening request has been opened. If the media stream has been opened, execute 1.2; if not, execute 1.3.

[0171] 1.2. Get the media stream identifier. 1.21. Send the media stream identifier to the player.

[0172] When the media stream has been opened, the open stream protection module 101 can obtain the identifier of the media stream and send the identifier of the media stream to the playback terminal. The playback terminal can then obtain the corresponding media stream from the playback server based on the identifier of the media stream. In this way, the media stream opened before the current moment can be directly provided to the playback terminal for use, avoiding repeated opening of the stream. This can reduce the waste of resources caused by repeated opening of the stream, and

[0173] 1.3. Determine whether the media stream is in the process of opening the stream. If it is, execute 1.1 after the first preset period of time; if not, execute 1.4.

[0174] The method for the open-stream protection module 101 to determine whether the media stream is being opened can refer to the above-mentioned embodiment. For example, when the signaling server starts to open the stream, it can indicate that the media stream is being opened by setting a Redis distributed lock in the server of the remote dictionary service. Then, the open-stream protection module 101 can confirm whether it is in the open-stream state by confirming whether there is a Redis distributed lock in the server of the remote dictionary service.

[0175] 1.4. Determine whether the media stream is in the process of being shut down. After determining that the media stream is in the process of being shut down, execute 1.1 after a second preset period of time. After determining that the media stream is not in the process of being shut down, start the process of opening the stream.

[0176] The subsequent signaling server can start streaming through an asynchronous thread. For example, the message module 104 can send a streaming instruction to the network camera to invite the network camera to push the stream to the streaming server. After determining that the media stream is not in the process of shutting down the stream, the signaling server can generate a media stream identifier and provide the media stream identifier to the playback terminal. After receiving the media stream identifier, the playback terminal can send the identifier to the playback server. In addition, after receiving the streaming instruction, the network camera will send the media stream to the streaming server. After receiving the media stream, the streaming server sends a media stream message to the message server and stores the media stream in a local memory (such as a cache service). The playback server subscribes to the media stream message of the message server and, after obtaining the media stream identifier provided by the playback terminal, queries the message server for whether the media stream message exists. If the message server has the media stream message, the playback server obtains the media stream from the streaming server and sends the processed media stream to the playback terminal. This completes the streaming of the media stream.

[0177] The playback server can process the media stream, such as decoding and encoding, to transform it into the stream specified by the player. It can also convert the media stream's protocol and bit rate, or analyze the media stream. The player and the playback server can connect via the Web Real-Time Communication (WebRTC) protocol.

[0178] By opening the stream in the above way, when multiple threads open the same media stream, they enter the stream opening program in a queued manner, and the media stream opened first can be reused by subsequent threads, avoiding the problem of repeated stream opening by multiple threads.

[0179] It should be noted that the streaming process in the relevant technology is as follows: the playback end calls the background interface to start the stream, and after receiving the stream, the background program uses SIP signaling to call the network camera to start the stream. Then the background program waits for the network camera to push the media stream to the streaming media server, obtains the stream pull address provided by the streaming media server and gives it to the playback end. The playback end then gives the stream address to the playback server. The playback server pulls the stream from the streaming media server through this stream pull address, and then the playback server pushes the media stream to the playback end for playback. The entire link of the stream opening is serial, and the link is long, which is prone to various problems and is much more difficult to troubleshoot. All these disadvantages will affect the user experience of the system.

[0180] In the process of opening the stream provided by the embodiment of the present application, the entire link of opening the stream is adjusted. After the playback end sends the opening stream instruction to the signaling server, the signaling server directly generates a media stream identifier for the playback end. The playback end sends the identifier to the playback server. The playback server waits for the media stream message in the message server. After receiving the media stream message corresponding to the media stream identifier, it can start pulling the stream from the streaming media server. The entire opening stream link becomes shorter, and the playback speed will also increase accordingly. In addition, since the playback server will process the media stream normally only when a key frame is detected, the signaling server can send a forced key frame instruction to the network camera during each opening of the stream when the playback server is pulling the stream, so as to increase the picture playback speed when opening the stream and avoid key frame anomalies in the first frame.

[0181] Optionally, the open-flow protection module 101 is further configured to:

[0182] After determining that the media stream is not in the process of shutting down the stream, an open stream flag is set in the first server, where the open stream flag is used to indicate that the media stream is in the process of shutting down the stream.

[0183] The open stream flag is used to determine whether the media stream is in the open stream process.

[0184] After the media stream is opened, the opening mark in the first server is removed.

[0185] The first server may be a remote dictionary service server. In embodiments of the present application, the remote dictionary service may be used to implement data storage. Additionally, the open stream marker may be a Redis distributed lock, which may be used to confirm whether the media stream is in the open stream process.

[0186] Optionally, the current protection module 102 is configured to:

[0187] When receiving a shut-down instruction for the first media stream, it is determined whether the first media stream is in the process of opening the stream. The method of determining whether the first media stream is in the process of opening the stream can refer to the above embodiment, and the embodiment of the present application will not be repeated here.

[0188] While the first media stream is in the process of being streamed, the signaling server stops shutting down the first media stream based on the shut-down instruction. If the first media stream is currently in the process of being streamed, indicating that a player wants to play the first media stream, the signaling server can stop the shut-down process to avoid affecting the player's normal playback of the first media stream. The first media stream can be any media stream in the streaming media system.

[0189] When the first media stream is not in the process of opening a stream, it is determined whether the first media stream is in the process of closing a stream.

[0190] When the first media stream is in the process of being shut down, stopping the first media stream based on the shut down instruction.

[0191] When the first media stream is not in the process of being shut down, a shut down instruction is sent to the network camera.

[0192] Optionally, the current protection module 102 is further configured to:

[0193] When the first media stream is not in the process of being shut down, a shut-down flag is set in the fourth server. The shut-down flag is used to indicate that the first media stream is in the process of being shut down. The signaling server subscribes to the shut-down flag and is used to determine whether the first media stream is in the process of being shut down based on the shut-down flag.

[0194] After the first media stream is shut down, the shut-down mark in the fourth server is removed.

[0195] Optionally, as shown in FIG5 , FIG5 is a schematic diagram of an unattended viewing processing module in the signaling server shown in FIG3 , wherein the unattended viewing processing module 103 is configured as follows:

[0196] 2.1. Subscribe to the active stream list in the third server. The streaming media server is used to provide the third server with a list of active streams within a preset time period every preset time period. The active streams include media streams that can be used and are used within the preset time period.

[0197] 2.2. Obtain a stream opening record within a preset time period from the second server, where the stream opening record records the stream opening data of the media stream opened within the preset time period.

[0198] 2.3. After obtaining the active stream list, close the media streams in the stream opening record that are not in the active stream list.

[0199] Optionally, the signaling server stores a task list of media streams, which records media streams with tasks within a preset time period. The unattended viewing processing module 103 is further configured to:

[0200] 2.4. Determine the target media stream that is in the task list and not in the active stream list.

[0201] 2.5. Open the target media stream.

[0202] Alternatively, please refer to FIG6 , which is a schematic diagram of a flow abnormality restart module in the signaling server shown in FIG3 , wherein the flow abnormality restart module 105 is configured as follows:

[0203] 3.1. Subscribe to the abnormal instruction of the fifth server. The playback server is used to send an abnormal instruction to the fifth server when detecting an abnormality in the first media stream. The first media stream is the media stream that the playback terminal instructs the playback server to obtain.

[0204] 3.2. When an abnormal instruction is received, query the streaming media server whether the first media stream currently exists. If it exists, execute 3.3; if not, execute 3.4.

[0205] When receiving an abnormal instruction provided by the fifth server based on subscription, the abnormal stream restart module 105 may query the streaming media server whether the first media stream currently exists.

[0206] 3.3. Send a forced key frame command to the network camera.

[0207] If the first media stream exists, indicating that the first media stream has experienced an anomaly due to some reason, the stream anomaly restart module 105 can send a forced keyframe instruction to the network camera. Upon receiving the forced keyframe instruction, the network camera will provide keyframes to the playback server via the streaming media server. Upon receiving the keyframes, the playback server can begin decoding the received data to attempt to restore the first media stream. If the forced keyframe instruction fails to restore the first media stream, the signaling server can repeat the forced keyframe instruction to the network camera. This can resolve stream anomalies caused by keyframe loss.

[0208] 3.4. Start opening the first media stream.

[0209] Optionally, please refer to FIG. 7 , which is a schematic diagram of a flow monitoring module in the signaling server shown in FIG. 3 , where the flow monitoring module 106 is configured as follows:

[0210] The processing data of the sixth server is subscribed to, and the playback terminal, the network camera, the playback server, and the streaming media server are used to send the processing data of the media stream to the sixth server.

[0211] When the processed data provided by the sixth server is received, the processed data is sent to the seventh server.

[0212] Among them, the streaming media module 106 can record the processing status of each node based on the processing data obtained from the sixth server. These nodes may include receiving the start-stream request sent by the playback end, sending the start-stream instruction to the network camera, receiving the response of the network camera, the streaming media server receiving the push stream from the network camera, the streaming media server ready to pull the stream, the streaming media server or the playback server detecting a media stream abnormality, the playback server receiving the media stream identifier, the playback server encountering an abnormality in pulling the stream, the playback server successfully pulling the stream, and closing the stream.

[0213] The streaming module 106 may include the Session Initialization Protocol (SIP) in the signaling server. SIP is an Internet-based IP voice session control protocol that is flexible, easy to implement, and easily scalable. The streaming module 106 can record information about each of the aforementioned nodes using the SIP protocol. This allows for monitoring of the entire lifecycle of the media stream, facilitating monitoring and troubleshooting of stream-related issues.

[0214] In addition, the signaling server may further include a flow monitoring unit, which may be configured to obtain data received by the seventh server from the seventh server. The flow monitoring unit may provide the data to an operator's terminal so that the operator can monitor the media flow.

[0215] Please refer to Table 1 below:

[0216] Table 1

[0217] Table 1 records some parameters when the signaling server provided in the embodiment of the present application implements the open stream, and compares them with some parameters when the related technology A (a related technology) implements the open stream. Among them, the first screen opens in seconds, which is the delay from the time when the user at the playback end triggers the open stream request to request a media stream that has not been opened to the time when the playback end starts playing. The end-to-end delay can be the delay from the time when the user at the playback end triggers the open stream request to request a media stream that has been opened to the time when the playback end starts playing. The performance description column records some parameters of two media streams, such as one media stream has a resolution of 1080p, a transmission rate of 4Mbps (megabits per second), and a format of H.264 or H.265, and the other media stream has a resolution of 720p, a transmission rate of 2Mbps (megabits per second), and a format of H.264 or H.265.

[0218] As can be seen from Table 1, the signaling server of this application can achieve an end-to-end delay of less than or equal to 2 seconds (the end-to-end delay is greater than the first screen opening second because the media stream of the end-to-end delay is in H.265 format, which involves encoding and decoding time), while the related technology A requires a delay of less than or equal to 3 seconds. The signaling server of this application can achieve a first screen opening second of less than or equal to 1 second, while the first screen opening second of related technology A is less than or equal to 3 seconds. In this way, the effect of reducing some delays in the process of opening the stream is achieved.

[0219] In a specific embodiment, the streaming media system can be used for a certain area to be monitored (such as an industrial park, hospital, shopping mall, school, public road, park, etc.), that is, the streaming media system can be a monitoring system. In this scenario, the streaming media system can include multiple network cameras, which can be deployed at various locations in the area to be monitored, for collecting images of various locations in the area to be monitored. In addition, the streaming media system can also include multiple playback terminals, which can be players or browsers in terminals used by relevant personnel (such as security personnel) to observe the area to be monitored. During the application of this system, there may be multiple playback terminals requesting the same media stream. For example, person A can request the media stream x1 provided by the network camera deployed at monitoring point 1 in the browser of computer A in the monitoring room, and person B can also request the media stream x1 provided by the network camera deployed at monitoring point 1 in the browser of computer B in the monitoring room. From the above content, it can be seen that the open stream protection module 101 provided in the embodiment of the present application can handle such situations in sequence, improve the success rate of open stream, and avoid repeated open streams.

[0220] In addition, in this scenario, there may be a situation where person A turns off the playback window of the media stream x1 provided by the network camera deployed at monitoring point 1 in the browser of computer A in the monitoring room, and person B turns off the playback window of the media stream x1 provided by the network camera deployed at monitoring point 1 in the browser of computer B in the monitoring room. From the above content, it can be seen that the unmanned viewing processing module 103 provided in the embodiment of the present application can also handle such processes involving shutting down the flow in a preset manner, so as to greatly reduce the number of times the flow is shut down and reduce the impact of shutting down the flow on opening the flow.

[0221] In summary, the embodiment of the present application uses some of the above-mentioned methods to enable the signaling server to optimize the opening of the stream to improve the speed of opening the stream and the success rate of opening the stream. In addition, the speed of closing the stream and the success rate of closing the stream can also be improved. In addition, the speed of handling abnormal situations can be improved, and some stream abnormality problems can be handled automatically. In summary, the embodiment of the present application provides a signaling server. After receiving the opening request of the stream from the playback end, the signaling server can determine whether the media stream corresponding to the opening request has been opened, and if it has been opened, obtain the identifier of the media stream and provide the identifier to the playback end so that the playback end can obtain the media stream based on the identifier. In this way, the occurrence of repeated opening of the stream can be avoided, and the effect of improving the success rate of the signaling server in opening the media stream can be achieved.

[0222] The following is a system embodiment of the present application, in which the signaling server can be the signaling server provided in the above embodiment. For details not disclosed in the system embodiment of the present application, please refer to other embodiments of the present application.

[0223] FIG8 is a schematic diagram of a streaming media system provided in an embodiment of the present application. The streaming media system 100 includes: a signaling server 10 , a playback terminal 20 , and a network camera 30 .

[0224] The playback terminal 20 sends a stream start request to the signaling server 10 .

[0225] The signaling server 10 determines whether the media stream corresponding to the start-stream request has been started.

[0226] When the media stream has started, the signaling server 10 obtains the identifier of the media stream.

[0227] The signaling server 10 sends the identifier of the media stream to the playback terminal 20 .

[0228] When the media stream is not started, the signaling server 10 determines whether the media stream is in the process of starting the stream.

[0229] When the media stream is in the process of being opened, the signaling server 10 performs the step of determining whether the media stream corresponding to the opening request has been opened after a first preset period of time.

[0230] When the media stream is not in the process of opening the stream, the signaling server 10 determines whether the media stream is in the process of closing the stream.

[0231] After determining that the media stream is in the process of being shut down, the signaling server 10 performs the step of determining whether the media stream corresponding to the start-up request has been started after a second preset period of time.

[0232] After determining that the media stream is not in the process of being shut down, the signaling server 10 sends a stream start instruction to the network camera 30 to start the media stream.

[0233] To sum up, the embodiment of the present application provides a streaming media system, in which the signaling server can determine whether the media stream corresponding to the stream opening request has already been opened after receiving the stream opening request from the playback end, and obtain the identifier of the media stream if it has been opened, and provide the identifier to the playback end so that the playback end can obtain the media stream based on the identifier, thereby avoiding the occurrence of repeated stream opening, and further achieving the effect of improving the success rate of the signaling server in opening the media stream.

[0234] Optionally, the streaming media system further includes a playback server 40, a streaming media server 50 and a message server k.

[0235] After determining that the media stream is not in the process of being shut down, the signaling server 10 generates an identifier of the media stream.

[0236] The signaling server 10 provides the player 20 with an identifier of the media stream.

[0237] The playback terminal 20 sends an identifier to the playback server 40 .

[0238] After receiving the start streaming instruction, the network camera 30 sends the media stream to the streaming server 50 .

[0239] After receiving the media stream, the streaming server 50 sends a media stream message to the message server k.

[0240] The playback server 40 subscribes to the media stream message of the message server k, and after obtaining the identifier of the media stream, determines whether the media stream message exists in the message server k.

[0241] When there is a media stream message in the message server k, the playback server 40 obtains the media stream from the streaming server 50 and sends the media stream to the playback terminal 20 .

[0242] Optionally, the streaming media system 100 further includes a first server F1.

[0243] When the media stream is not in the process of shutting down, the signaling server 10 sets an open stream flag in the first server F1. The open stream flag is used to indicate that the media stream is in the process of opening the stream. The signaling server 10 is used to determine whether the media stream is in the process of opening the stream through the open stream flag.

[0244] After completing opening the media stream, the signaling server 10 removes the opening mark in the first server F1.

[0245] Optionally, the streaming media system 100 further includes a second server F2.

[0246] After completing the opening of the media stream, the signaling server 10 sends the opening data of the media stream to the second server F2, where the opening data includes the identifier of the media stream.

[0247] When the media stream has started, the signaling server 10 obtains the identifier of the media stream through the second server F2.

[0248] Optionally, the streaming media system 100 further includes a third server F3 and a streaming media server 50 .

[0249] The signaling server 10 subscribes to the active flow list in the third server F3.

[0250] The streaming server 50 provides the third server F3 with a list of active streams within a preset time period at intervals. The active streams include media streams that can be used and are being used within the preset time period.

[0251] The stream opening record within the preset time period is obtained from the second server F2, where the stream opening record records the stream opening data of the media stream opened within the preset time period.

[0252] After obtaining the active stream list, the signaling server 10 closes the media streams in the stream opening record that are not in the active stream list.

[0253] Optionally, the signaling server 10 stores a task list of media streams, and the task list records the media streams with tasks within a preset time period.

[0254] The signaling server 10 determines a target media stream that is in the task list and is not in the active stream list.

[0255] The signaling server 10 opens the target media stream.

[0256] Optionally, when receiving a shut-down instruction for the first media stream, the signaling server 10 determines whether the first media stream is in the process of opening the stream.

[0257] When the first media stream is in the process of opening the stream, the signaling server 10 stops closing the first media stream based on the closing instruction.

[0258] When the first media stream is not in the process of opening a stream, the signaling server 10 determines whether the first media stream is in the process of closing a stream.

[0259] When the first media stream is in the process of being shut down, the signaling server 10 stops shutting down the first media stream based on the shut-down instruction.

[0260] When the first media stream is not in the process of being shut down, the signaling server 10 sends a shut down instruction to the network camera 30 .

[0261] Optionally, the streaming media system 100 further includes a fourth server F4.

[0262] When the first media stream is not in the process of being shut down, the signaling server 10 sets a shut-down flag in the fourth server F4. The shut-down flag is used to indicate that the first media stream is in the process of being shut down. The signaling server 10 subscribes to the shut-down flag and uses the shut-down flag to determine whether the first media stream is in the process of being shut down.

[0263] After completing shutting down the first media stream, the signaling server 10 removes the shut-down flag in the fourth server F4.

[0264] Optionally, the streaming media system further includes a fifth server F5 , a playback server 40 and a streaming media server 50 .

[0265] The signaling server 10 subscribes to the abnormal instruction of the fifth server.

[0266] When the playback server 40 detects an abnormality in the first media stream, it sends an abnormality instruction to the fifth server F5. The first media stream is the media stream that the playback terminal 20 instructs the playback server 40 to obtain.

[0267] When receiving the abnormal instruction, the signaling server 10 queries the streaming media server 50 whether the first media stream currently exists.

[0268] When present, the signaling server 10 sends a mandatory key frame instruction to the network camera 30 .

[0269] If the first media stream does not exist, the signaling server 10 starts to open the first media stream.

[0270] Optionally, the streaming media system 100 further includes a sixth server F6 and a seventh server F7.

[0271] The signaling server 10 subscribes to the processing data of the sixth server F6, and the playback terminal 20, the network camera 30, the playback server 40, and the streaming media server 50 are used to send the processing data of the media stream to the sixth server.

[0272] When receiving the processing data provided by the sixth server F6, the signaling server 10 sends the processing data to the seventh server F7.

[0273] In an exemplary embodiment, the network camera 10 and the signaling server 10 can interact through the SIP protocol, the playback terminal 20 and the signaling server 10 can interact through the Hypertext Transfer Protocol (HTTP), and the playback terminal 20 and the playback server 40 can interact through the web real-time communication protocol.

[0274] To sum up, the embodiment of the present application provides a streaming media system, in which the signaling server can determine whether the media stream corresponding to the stream opening request has already been opened after receiving the stream opening request from the playback end, and obtain the identifier of the media stream if it has been opened, and provide the identifier to the playback end so that the playback end can obtain the media stream based on the identifier, thereby avoiding the occurrence of repeated stream opening, and further achieving the effect of improving the success rate of the signaling server in opening the media stream.

[0275] FIG9 is a flow chart of a method for controlling a media stream provided in an embodiment of the present application. The method can be applied to a signaling server and may include the following steps:

[0276] Step 901: After receiving a stream start request from a player, determine whether the media stream corresponding to the stream start request has been started. If the media stream has been started, execute step 902; if the media stream has not been started, execute step 904.

[0277] Step 902: Obtain the identifier of the media stream. Execute step 903.

[0278] Step 903: Send the media stream identifier to the playback end.

[0279] To sum up, the embodiment of the present application provides a media stream control method. After receiving a stream opening request from the playback end, it can determine whether the media stream corresponding to the stream opening request has already been opened, and if it has been opened, obtain the identifier of the media stream and provide the identifier to the playback end so that the playback end can obtain the media stream based on the identifier. This can avoid the occurrence of repeated stream opening, and thus can achieve the effect of improving the success rate of the signaling server in opening the media stream.

[0280] Optionally, referring to FIG9 , the method further includes:

[0281] Step 904: Determine whether the media stream is in the process of opening the stream. If the media stream is in the process of opening the stream, after the first preset period of time, execute step 901; if the media stream is not in the process of opening the stream, execute step 905.

[0282] Step 905: Determine whether the media stream is in the process of being shut down. After determining that the media stream is in the process of being shut down, execute step 901 after a second preset period of time; after determining that the media stream is not in the process of being shut down, execute step 906.

[0283] Step 906: Send a stream start instruction to the network camera to start the media stream.

[0284] To sum up, the embodiment of the present application provides a media stream control method. After receiving a stream opening request from the playback end, when it is determined that the media stream corresponding to the stream opening request is not in the stream opening process and is not in the stream closing process, a stream opening instruction can be sent to the network camera to open the media stream. In this way, the stream opening failure that may be caused by repeated stream opening when the media stream is in the stream opening process can be avoided, and the stream opening failure that may be caused by opening the stream when the media stream is in the stream closing process can be avoided. In this way, the success rate of the signaling server in opening the media stream can be improved.

[0285] In addition, an embodiment of the present application also provides a non-volatile computer storage medium, which stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the media stream control method as described above.

[0286] In this application, the term "and / or" simply describes an association between related objects, indicating that three possible relationships exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the related objects are in an "or" relationship.

[0287] In this application, the term "at least one of A and B" simply describes an association relationship between associated objects, indicating that three possible relationships exist. For example, "at least one of A and B" can mean: A exists alone, A and B exist simultaneously, and B exists alone. Similarly, "at least one of A, B, and C" means that seven possible relationships exist, indicating: A exists alone, B exists alone, C exists alone, A and B exist simultaneously, A and C exist simultaneously, C and B exist simultaneously, and A, B, and C exist simultaneously. Similarly, "at least one of A, B, C, and D" means that fifteen possible relationships exist, indicating: A exists alone, B exists alone, C exists alone, D exists alone, A and B exist simultaneously, A and C exist simultaneously, A and D exist simultaneously, C and B exist simultaneously, D and B exist simultaneously, C and D exist simultaneously, C and D exist simultaneously, A, B, and C exist simultaneously, A, B, and D exist simultaneously, A, C, and D exist simultaneously, B, C, and D exist simultaneously, and A, B, C, and D exist simultaneously.

[0288] In this application, the terms "first", "second", "third" and "fourth" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The term "plurality" refers to two or more, unless otherwise expressly limited.

[0289] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.

[0290] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another streaming media system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0291] 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 multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0292] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0293] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A signaling server, characterized in that: The signaling server is used in a streaming media system, which also includes a player and a network camera. The signaling server is used to: After receiving a stream opening request from a player, determining whether the media stream corresponding to the stream opening request has been opened; When the media stream has started, obtaining an identifier of the media stream; Sending the identifier of the media stream to the playback end.

2. The method according to claim 1, characterized in that The signaling server is further configured to: When the media stream is not started, determining whether the media stream is in the process of starting the stream; When it is determined that the media stream is in the process of opening a stream, the step of determining whether the media stream corresponding to the opening stream request has been opened is performed after a first preset period of time; When it is determined that the media stream is not in the process of opening a stream, determining whether the media stream is in the process of closing a stream; After determining that the media stream is in the process of shutting down, after a second preset period of time, performing the step of determining whether the media stream corresponding to the start-up request has been started; After determining that the media stream is not in the process of shutting down the stream, a stream opening instruction is sent to the network camera to open the media stream.

3. The signaling server according to claim 2, wherein: The streaming media system further includes a playback server, and the signaling server is further configured to: After determining that the media stream is not in the process of being shut down, generating an identifier of the media stream; The player terminal is provided with an identifier of the media stream, and the player terminal is used to send the identifier to the player server. The player server is used to push the media stream to the player terminal after acquiring the media stream based on the identifier.

4. The signaling server according to claim 2, wherein: The streaming media system further includes a first server, and the signaling server is further configured to: After determining that the media stream is not in the process of shutting down the stream, setting an open stream flag in the first server, wherein the open stream flag is used to indicate that the media stream is in the process of shutting down the stream, and the signaling server is used to determine whether the media stream is in the process of shutting down the stream based on the open stream flag; After the media stream is opened, the opening stream mark in the first server is removed.

5. The signaling server according to claim 2, wherein: The streaming media system further includes a second server, and the signaling server is further configured to: After completing the opening of the media stream, sending the opening data of the media stream to the second server, where the opening data includes an identifier of the media stream; When the media stream has started, the identifier of the media stream is obtained through the second server.

6. The signaling server according to claim 5, characterized in that The streaming media system further includes a third server and a streaming media server, and the signaling server is further configured to: Subscribing to an active stream list in the third server, the streaming media server being configured to provide the third server with a list of active streams within a preset time period at intervals thereof, the active streams including media streams that are available and used within the preset time period; Acquire a stream opening record within the preset duration from the second server, wherein the stream opening record records the stream opening data of the media stream opened within the preset duration; After obtaining the active stream list, the media streams in the open stream record that are not in the active stream list are closed.

7. The signaling server according to claim 6, characterized in that The signaling server stores a task list of media streams, wherein the task list records the media streams with tasks within the preset time period, and the signaling server is further configured to: Determine a target media stream that is in the task list and not in the active stream list; The target media stream is opened.

8. The signaling server according to claim 2, wherein: The signaling server is further configured to: Upon receiving a shut-down instruction for a first media stream, determining whether the first media stream is in the process of opening a stream; When the first media stream is in the process of being opened, stopping closing the first media stream based on the closing instruction; When the first media stream is not in the process of opening a stream, determining whether the first media stream is in the process of closing a stream; When the first media stream is in the process of being shut down, stopping shutting down the first media stream based on the shut-down instruction; When the first media stream is not in the process of being shut down, a shut down instruction is sent to the network camera.

9. The signaling server according to any one of claims 2 to 8, characterized in that: The streaming media system further includes a fourth server, and the signaling server is further configured to: When the first media stream is not in the process of being shut down, setting a shut-down flag in the fourth server, where the shut-down flag is used to indicate that the first media stream is in the process of being shut down, and the signaling server subscribes to the shut-down flag and determines whether the first media stream is in the process of being shut down based on the shut-down flag. After the first media stream is shut down, the shut-down mark in the fourth server is removed.

10. The signaling server according to any one of claims 2 to 8, characterized in that: The streaming media system further includes a fifth server, a playback server, and a streaming media server, and the signaling server is further configured to: subscribing to an abnormal instruction of the fifth server, wherein the playback server is configured to send the abnormal instruction to the fifth server when detecting an abnormality in a first media stream, wherein the first media stream is a media stream that the playback terminal instructs the playback server to obtain; Upon receiving the abnormal instruction, querying, through the streaming media server, whether the first media stream currently exists; When the key frame exists, a mandatory key frame instruction is sent to the network camera; If the first media stream does not exist, the first media stream is started to be opened.

11. The signaling server according to any one of claims 2 to 8, characterized in that: The streaming media system further includes a sixth server and a seventh server, and the signaling server is further configured to: Subscribing to the processing data of the sixth server, the playback terminal, the network camera, the playback server, and the streaming media server are used to send the processing data of the media stream to the sixth server; When receiving the processed data provided by the sixth server, the processed data is sent to the seventh server.

12. A streaming media system, characterized in that: The streaming media system includes: a signaling server, a playback terminal and a network camera; The playback terminal sends a stream opening request to the signaling server; The signaling server determines whether the media stream corresponding to the stream opening request has been opened; The signaling server obtains the identifier of the media stream when the media stream has started streaming; The signaling server sends the identifier of the media stream to the playback terminal.

13. The streaming media system according to claim 12, wherein: The signaling server determines, when the media stream is not being streamed, whether the media stream is in a process of being streamed; When the media stream is in the process of opening a stream, the signaling server performs the step of determining whether the media stream corresponding to the opening stream request has been opened after a first preset time period; When the media stream is not in the process of opening a stream, the signaling server determines whether the media stream is in the process of closing a stream; After determining that the media stream is in the process of being shut down, the signaling server performs the step of determining whether the media stream corresponding to the stream opening request has been opened after a second preset time period; After determining that the media stream is not in the process of shutting down the stream, the signaling server sends a stream opening instruction to the network camera to open the media stream.

14. A media stream control method, characterized in that: Used in a signaling server, the signaling server is used in a streaming media system, the streaming media system also includes: a playback terminal and a network camera, the method includes: After receiving a stream opening request from a player, determining whether the media stream corresponding to the stream opening request has been opened; When the media stream has started, obtaining an identifier of the media stream; Sending the identifier of the media stream to the playback end.

15. The method according to claim 14, characterized in that The method further comprises: When the media stream is not started, determining whether the media stream is in the process of starting the stream; When the media stream is in the process of opening a stream, after a first preset period of time, performing the step of determining whether the media stream corresponding to the opening stream request has been opened; When the media stream is not in the process of opening a stream, determining whether the media stream is in the process of closing a stream; After determining that the media stream is in the process of shutting down, after a second preset period of time, performing the step of determining whether the media stream corresponding to the start-up request has been started; After determining that the media stream is not in the process of shutting down the stream, a stream opening instruction is sent to the network camera to open the media stream.

Citation Information

Patent Citations

  • Method, device and terminal for playing multimedia contents

    CN104410914A

  • Real-time communication method in internet of things, and related equipment

    CN108418779A

  • Video stream calling method and device, electronic equipment and storage medium

    CN116112709A

  • Video stream processing method and device, edge computing equipment and storage medium

    CN116389430A

  • Signaling server, streaming media system and media stream control method

    CN118118624A