Implementation mechanism of fast real-time stream response under GB28181 communication protocol
By introducing the vms communication module in the mv_access_control component, the message linkage between GB28181 and RTSP protocols is realized, which solves the complexity problem of fast real-time stream response under the GB28181 communication protocol, improves the stability and performance of the system, and simplifies the signal trigger linkage method.
Patent Information
- Application Number
- CN202210132225.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-14
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-02-14
AI Technical Summary
Under the GB28181 communication protocol, existing technology is difficult to achieve fast real-time streaming response, resulting in complex linkage between devices and platforms, increasing code logic complexity and hidden dangers during high concurrency.
By introducing the open source vms communication module into the mv_access_control component, message linkage and dynamic interaction between GB28181 and RTSP protocols are realized. Specific message types and component interactions are used in the process of requesting, obtaining and closing real-time streams to ensure the efficiency of message transmission. and response.
It simplifies the signal trigger linkage method, realizes efficient message transmission and response between GB28181 and RTSP protocols, reduces code complexity, improves system stability and performance, and effectively avoids hidden dangers especially in high concurrency situations.
Smart Images

Figure CN114466167B
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an implementation mechanism for fast real-time stream response under the GB28181 communication protocol. Background Art
[0002] At present, popular security equipment on the market all support the GB28181 communication protocol. When using the real-time preview interface to preview a specified camera, how to quickly link the device and platform to the RTSP triggering mechanism of the platform and client interface after being triggered by GB28181 is the key to determining the quality of the product experience. In many scenarios, developers will choose a linear processing mechanism to achieve linkage between signals, which will increase the complexity of code logic, increase the difficulty of troubleshooting, and lead to hidden risks under high-concurrency real-time stream requests. Summary of the invention
[0003] The present application provides an implementation mechanism for fast real-time stream response under the GB28181 communication protocol. Its technical purpose is to provide a concise and clear signal trigger linkage method, effectively realize the message linkage between the GB28181 communication protocol and the rtsp communication protocol, establish an efficient message transmission and response mechanism between GB28181 and rtsp, and dynamically realize the interaction of the GB28181 protocol between the server and the front-end lens.
[0004] The above technical objectives of this application are achieved through the following technical solutions:
[0005] A fast real-time stream response implementation mechanism under GB28181 communication protocol, including requesting real-time stream, obtaining real-time stream and closing real-time stream;
[0006] The process of requesting real-time streaming includes:
[0007] Step 1: The client initiates a real-time streaming request to the specified front-end device through the monitoring interface;
[0008] Step 2: The service control system determines the designated server registered by the front-end device; wherein the designated server includes the mv_access_control component and the mv_mu_stream component, and the mv_access_control component includes the vms communication module;
[0009] Step 3: The service control system sends a real-time stream request message to the mv_access_control component; the mv_access_control component determines whether there is distribution on the front-end device, and if so, returns the specified server address as the rtsp address; if not, returns an rtsp address;
[0010] Step 4: The mv_access_control component determines the load of the mv_mu_stream component and then allocates the mv_mu_stream component with the lightest load;
[0011] Step 5: The mv_access_control component returns the rtsp address to the service control system;
[0012] Step 6: The service control system returns the rtsp address to the client;
[0013] Step 7: The client sends a real-time browsing request to the mv_mu_stream component;
[0014] Step 8: The mv_mu_stream component determines whether it is being distributed and multiplexed. If not, it allocates ports and resources for receiving video streams.
[0015] Step 9: The mv_access_control component receives the SVS_MSG_TYPE_MDU_SESSION_SETUP_REQ message sent by the mv_mu_stream component, and then searches for the front-end device session information;
[0016] Step 10: The mv_access_control component sends a real-time browsing request message to the front-end device;
[0017] Step 11: After receiving the correct message returned by the front-end device, the mv_access_control component sends the SVS_MSG_TYPE_MDU_SESSION_SETUP_RESP message to the mv_mu_stream component through the vms communication module;
[0018] Step 12: The mv_mu_stream component returns the rtsp response message to the client;
[0019] Step 13: The mv_access_control component sends an ACK message to the front-end device;
[0020] The process of obtaining the real-time stream includes:
[0021] Step 14: The client is ready to receive the video stream;
[0022] Step 15: The front-end device sends the rtp stream to the mv_mu_stream component, and the mv_mu_stream component processes the rtp stream to obtain the h264 raw stream;
[0023] Step 16: The mv_mu_stream component sends the h264 raw stream to the client;
[0024] The process of closing the real-time stream includes:
[0025] Step 17: The client sends a message to mv_mu_stream component to close real-time browsing;
[0026] Step 18: After the mv_access_control component receives the SVS_MSG_TYPE_MDU_SESSION_TEARDOWN_REQ session closing message request sent by the mv_mu_stream component, the mv_access_control component stops the session;
[0027] Step 19: The mv_access_control component sends a bye message to the front-end device;
[0028] Step 20: The front-end device returns a correct message to the mv_access_control component, and the mv_access_control component sends a SVS_MSG_TYPE_MDU_SESSION_TEARDOWN_RESP message to the mv_mu_stream component;
[0029] Step 21: The mv_mu_stream component periodically reports all session stream information to the mv_access_control component, and then sends a close rtp transport stream request message SVS_MSG_TYPE_MU_SESSION_REPORT_REQ to the mv_access_control component;
[0030] Step 22: The mv_access_control component sends an http message to the business control system.
[0031] The beneficial effects of the present application are as follows: the implementation mechanism of fast real-time stream response under the GB28181 communication protocol described in the present application adds an open source vms communication module inside the mv_access_control component, making the message interaction between components more effective; the linkage is realized without blocking the interaction of the two types of messages of the GB28181 communication protocol and the RTSP communication protocol, and the sending of the GB28181 message is triggered after receiving the DESCRIBE message in the RTSP message. A concise and clear signal trigger linkage method is provided to realize on-demand stream pulling. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A flowchart of the implementation mechanism described in this application;
[0033] Figure 2 This is a schematic diagram of the test effect of this application;
[0034] Figure 3 This is a logical architecture diagram of the implementation mechanism described in this application. DETAILED DESCRIPTION
[0035] The technical solution of the present application will be described in detail below with reference to the accompanying drawings.
[0036] The implementation mechanism of fast real-time stream response under the GB28181 communication protocol described in this application includes three processes: requesting real-time stream, obtaining real-time stream and closing real-time stream. The specific implementation process is as follows: Figure 1 As shown in the figure, its logical architecture is as follows Figure 3 The following front-end devices generally refer to cameras with GB28181 communication protocol.
[0037] The process of requesting a real-time stream is from step 1 to step 15, which specifically includes:
[0038] Step 1: The client initiates a real-time streaming request to the specified front-end device through the monitoring interface.
[0039] Step 2: The service control system determines the designated server registered by the front-end device; wherein the designated server includes the mv_access_control component and the mv_mu_stream component, and the mv_access_control component includes the vms communication module.
[0040] The designated server mainly includes two components: mv_access_control and mv_mu_stream. These two components are used together to achieve fast response and processing of GB28181 devices.
[0041] The mv_access_control component mainly handles the communication with the front-end device (GB28181 communication protocol), and the mv_mu_stream component mainly handles the rtsp signaling and the processing of the rtp stream; the linkage between the rtsp signaling and the GB28181 communication protocol is realized through the third-party library of the vms communication module, such as SVS_MSG_TYPE_MDU_SESSION_SETUP_REQ, SVS_MSG_TYPE_MDU_SESSION_SETUP_RESP, SVS_MSG_TYPE_MDU_SESSION_TEARDOWN_REQ, SVS_MSG_TYPE_MDU_SESSION_TEARDOWN_RESP, etc. defined below.
[0042] The functions of the mv_access_control component include: (1) parsing the rtsp signaling requested by the client and determining whether the front-end device currently requesting the video stream is already distributing the video stream. If the stream is already being distributed, there is no need to request the video stream from the front-end device and the stream can be directly distributed from the streaming media server to the client. (2) The mv_access_control component also contains a VMS communication mechanism that can link the message processing of the mv_access_control component and the mv_mu_stream component. (3) The mv_access_control component also processes the GB28181 protocol of the front-end device and implements GB2818 protocol communication between this component and the device.
[0043] The mv_mu_stream component mainly processes the rtsp signaling and implements the reception and processing of the rtp signaling stream.
[0044] Step 3: The service control system sends a real-time stream request message to the mv_access_control component.
[0045] Step 3.1: The mv_access_control component determines whether there is distribution on the front-end device. If there is distribution, it returns the specified server address as the rtsp address. If there is no distribution, it returns an rtsp address.
[0046] Regardless of whether the front-end device distributes or not, the rtsp address must be returned. This rtsp address is assembled in the server. Only with this rtsp address can the real-time browsing request be sent to the mv_mu_stream component normally.
[0047] Step 4: The mv_access_control component determines the load of the mv_mu_stream components and then allocates the mv_mu_stream component with the lightest load.
[0048] Whether to distribute or not requires a load balancing judgment, and requests the video stream from the component with light load. The mv_mu_stream component periodically sends load information to the mv_access_control component, and the mv_access_control component makes a load balancing judgment.
[0049] Generally, when the front-end device makes a first request, a mv_mu_stream component with the lightest load is allocated to the front-end device by default. When the first request is made, the front-end device has already allocated a mv_mu_stream component (not an existing distribution task).
[0050] Step 5: The mv_access_control component returns the rtsp address to the service control system.
[0051] Step 6: The service control system returns the rtsp address to the client.
[0052] Step 7: The client sends a real-time browsing request to the mv_mu_stream component.
[0053] Step 7.1: The mv_mu_stream component determines whether it is distributing and multiplexing.
[0054] Step 8: If the mv_mu_stream component is not distributed, allocate the port and resources for receiving the video stream.
[0055] Generally, the port for receiving video streams is the Udp port; if there is distribution, there is no need to open a new port to receive the video stream. You only need to copy the video data in the memory and send it directly to the client.
[0056] Step 9: The mv_access_control component accepts the SVS_MSG_TYPE_MDU_SESSION_SETUP_REQ message sent by the mv_mu_stream component.
[0057] Step 10: The mv_access_control component searches for the front-end device session information.
[0058] The mv_access_control component receives the SVS_MSG_TYPE_MDU_SESSION_SETUP_REQ message sent from the mv_mu_stream component ( Figure 1 -9), the mv_access_control component will successfully create a session ( Figure 1-1 0), through this session to maintain communication with the mv_mu_stream component.
[0059] Step 11: The mv_access_control component sends a real-time browsing request message, namely, an INVITE message, to the front-end device.
[0060] Step 12: The mv_access_control component receives the correct message returned by the front-end device.
[0061] Step 13: Send the SVS_MSG_TYPE_MDU_SESSION_SETUP_RESP message to the mv_mu_stream component through the vms communication module of the mv_access_control component.
[0062] Step 14: The mv_mu_stream component returns an rtsp response message to the client.
[0063] Step 15: The mv_access_control component sends an ACK message to the front-end device.
[0064] The process of obtaining the real-time stream is that the front-end device sends the rtp stream to the middle station. The process includes steps 16 to 18, specifically:
[0065] Step 16: The client is ready to receive the video stream;
[0066] Step 17: The front-end device sends the rtp stream to the mv_mu_stream component, and the mv_mu_stream component processes the rtp stream to obtain the h264 raw stream;
[0067] Step 18: The mv_mu_stream component sends the h264 raw stream to the client.
[0068] The process of closing the real-time stream includes steps 19 to 27, specifically including:
[0069] Step 19: The client sends a close real-time browsing message to the mv_mu_stream component.
[0070] Step 20: After the mv_access_control component receives the SVS_MSG_TYPE_MDU_SESSION_TEARDOWN_REQ session closing message request sent by the mv_mu_stream component.
[0071] Step 21: The mv_access_control component stops the session.
[0072] Step 22: The mv_access_control component sends a bye message to the front-end device.
[0073] Step 23: The front-end device returns a correct message (ie, a 200 ok message) to the mv_access_control component.
[0074] Step 24: The mv_access_control component sends a SVS_MSG_TYPE_MDU_SESSION_TEARDOWN_RESP message to the mv_mu_stream component.
[0075] Step 25: The mv_mu_stream component periodically reports all session stream information to the mv_access_control component.
[0076] Step 26: The mv_mu_stream component sends a close rtp transport stream request message SVS_MSG_TYPE_MU_SESSION_REPORT_REQ to the mv_access_control component.
[0077] Step 27: The mv_access_control component sends an http message to the business control system.
[0078] The test effect diagram obtained based on the above real-time flow rapid response mechanism is as follows Figure 2 As shown, linkage is achieved without blocking the interaction of the two types of messages of the GB28181 communication protocol and the RTSP communication protocol. After receiving the DESCRIBE message in the RTSP message, the sending of the GB28181 message is triggered. This is achieved through function callback, as shown below:
[0079] IAccessControlManager::instance().asyncRequest(oDevMediaRequest,CBusinessManager::asyncResponse,&CBusinessManager::instance())
[0080] If the current front-end device in the resource does not send a stream, the middle station sends a request message to the front-end device to implement the sending of the GB28181 message.
[0081] The above are exemplary embodiments of the present application, and the protection scope of the present application is defined by the claims and their equivalents.
Claims
1. A mechanism for implementing fast real-time stream response under GB28181 communication protocol, characterized in that: Including requesting real-time stream, obtaining real-time stream and closing real-time stream; The process of requesting real-time streaming includes: Step 1: The client initiates a real-time streaming request to the specified front-end device through the monitoring interface; Step 2: The service control system determines the designated server registered by the front-end device; wherein the designated server includes the mv_access_control component and the mv_mu_stream component, and the mv_access_control component includes the vms communication module; Step 3: The service control system sends a real-time stream request message to the mv_access_control component; the mv_access_control component determines whether there is distribution on the front-end device, and if so, returns the specified server address as the rtsp address; if not, returns an rtsp address; Step 4: The mv_access_control component determines the load of the mv_mu_stream component and then allocates the mv_mu_stream component with the lightest load; Step 5: The mv_access_control component returns the rtsp address to the service control system; Step 6: The service control system returns the rtsp address to the client; Step 7: The client sends a real-time browsing request to the mv_mu_stream component; Step 8: The mv_mu_stream component determines whether it is being distributed and multiplexed. If not, it allocates ports and resources for receiving video streams. Step 9: The mv_access_control component receives the SVS_MSG_TYPE_MDU_SESSION_SETUP_REQ message sent by the mv_mu_stream component, and then searches for the front-end device session information; Step 10: The mv_access_control component sends a real-time browsing request message to the front-end device; Step 11: After receiving the correct message returned by the front-end device, the mv_access_control component sends the SVS_MSG_TYPE_MDU_SESSION_SETUP_RESP message to the mv_mu_stream component through the vms communication module; Step 12: The mv_mu_stream component returns the rtsp response message to the client; Step 13: The mv_access_control component sends an ACK message to the front-end device; The process of obtaining the real-time stream includes: Step 14: The client is ready to receive the video stream; Step 15: The front-end device sends the rtp stream to the mv_mu_stream component, and the mv_mu_stream component processes the rtp stream to obtain the h264 raw stream; Step 16: The mv_mu_stream component sends the h264 raw stream to the client; The process of closing the real-time stream includes: Step 17: The client sends a message to mv_mu_stream component to close real-time browsing; Step 18: After the mv_access_control component receives the SVS_MSG_TYPE_MDU_SESSION_TEARDOWN_REQ session closing message request sent by the mv_mu_stream component, the mv_access_control component stops the session; Step 19: The mv_access_control component sends a bye message to the front-end device; Step 20: The front-end device returns a correct message to the mv_access_control component, and the mv_access_control component sends a SVS_MSG_TYPE_MDU_SESSION_TEARDOWN_RESP message to the mv_mu_stream component; Step 21: The mv_mu_stream component periodically reports all session stream information to the mv_access_control component, and then sends a close rtp transport stream request message SVS_MSG_TYPE_MU_SESSION_REPORT_REQ to the mv_access_control component; Step 22: The mv_access_control component sends an http message to the business control system.
