Task-based national standard video equipment load balancing access method and system and readable medium
Through the task-based load balancing access method based on national standard video equipment, the performance bottleneck and insufficient scalability of traditional video access routing gateways in large-scale camera access, high-concurrency video request signaling processing and single point of failure are solved. Achieving high reliability and efficient expansion of the system.
Patent Information
- Application Number
- CN202411565481.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-01-21
AI Technical Summary
Traditional video access routing gateways have problems such as performance bottlenecks, insufficient scalability and low stability in large-scale camera access, high-concurrent video request signaling processing, and single-point failure problems.
It adopts a task-based load balancing access method based on national standard video equipment and implements stateless control through components such as signaling routing gateway, stateless signaling service module, stateful signaling service module, streaming media service module and task management service module. and stateful signaling processing and load balancing.
It simplifies large-scale camera access, improves the scalability and reliability of the system, reduces the complexity of the video surveillance cloud platform, and improves the utilization of hardware resources.
Smart Images

Figure CN119342304A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a task-based national standard video equipment load balancing method, system and readable medium, belonging to the technical field of video monitoring. Background Art
[0002] With the widespread application of standard GB / T28181 in the field of video surveillance, the rapid growth of surveillance cameras in cities, transportation industry, environmental protection, etc. has formed a huge video surveillance network. More and more surveillance equipment and surveillance platform manufacturers are using GB / T28181 to solve equipment access and data sharing problems.
[0003] With the development of virtualization technology and containerization technology, the way a single device completes access and sharing has changed. In the current application environment, a single device has signaling processing, stream processing bottlenecks, and single point failure problems. The national standard video access routing gateway is divided into signaling services and streaming services. The signaling service consists of a signaling routing gateway module, a stateless signaling module, a stateful signaling module, and a device status management module. The streaming service consists of a streaming module and a task scheduling module. The signaling service is mainly responsible for processing interactive signaling with the camera and streaming service video operations on the camera. The streaming service is mainly responsible for the task management and video distribution functions of the camera's real-time video.
[0004] With the popularization of 10G networks, video services are increasingly becoming cloud-node-based and integrating remote disaster recovery technology, so that cameras can quickly access cloud nodes. Video algorithm applications have evolved from a single algorithm for a single camera video to an algorithm warehouse, and the management of video algorithms has shifted from routine analysis to task-based analysis. In this change, load-balanced video cloud node access has played a pivotal role.
[0005] The current traditional video access routing gateway faces multiple challenges: 1. Bottleneck problem of camera access. A single traditional routing gateway cannot realize the registration and heartbeat signaling of more than 1,000 national standard cameras, and cannot support high concurrent video requests. The distribution capacity of streaming media is also greatly limited, generally around 600 channels per unit. Traditional video access routing gateways cannot meet the video needs of current business scenarios, which seriously affects the business development of the algorithm warehouse and cockpit.
[0006] 2. Risk of single point failure. If the signaling service or streaming service fails, all third-party applications that rely on it will be unable to recover for a long time, making it impossible to access video resources normally. This not only seriously affects the stability of the business, but also greatly reduces the user experience. Obviously, this runs counter to the business requirements of high reliability.
[0007] 3. Insufficient scalability. Whether trying to improve its performance or increase its capacity, it faces huge difficulties. This limitation greatly restricts the possibility of cloud platform business expanding with the rapid growth of market demand.
[0008] To sum up, although the traditional video access routing gateway still occupies a certain small market scenario, the access performance bottleneck, single point failure risk and scalability problems it brings in terms of video cloud and massive access cannot be ignored. Summary of the invention
[0009] In view of the above problems, the purpose of the present invention is to provide a task-based national standard video equipment load balancing access method, system and readable medium to solve the bottleneck problems and single point failure problems of large-scale camera access and high-concurrency video request signaling processing, and to solve the problems of long waiting time for image output, network jitter, congestion and screen distortion when requesting video when there is high frequency demand for the same real-time video.
[0010] To achieve the above-mentioned purpose, the present invention proposes the following technical scheme: a task-based national standard video device load balancing access method, comprising the following steps: starting a video request task; receiving a request signaling from a camera, and determining whether the request signaling is a stateless signaling or a stateful signaling; if the request signaling is a stateless signaling, determining the category of the stateless signaling, transmitting the stateless signaling to a stateless signaling service module, processing the stateless signaling according to the category of the stateless signaling, and transmitting the processing result to the camera through a routing gateway; if the request signaling is a stateful signaling, sending the stateful signaling to a streaming media service module, starting the RTSP backend service, and providing a client connection address to a task management service module; sending streaming media service information and a video request to a stateful signaling service module, and generating a video request to be sent to the camera in combination with the client connection address; the camera provides video according to the video request; and closing the video request task.
[0011] Furthermore, the stateful signaling is a signaling that requires video data transmission; the stateless signaling is a signaling that does not require video data transmission; the categories of the stateless signaling include registration process, heartbeat process and notification, alarm process.
[0012] Furthermore, the specific method of the registration process is: the camera initiates a REGISTER registration message to the routing gateway, the routing gateway receives the request information of the camera, detects that the message type is a request message, and the request method is a REGISTER registration message; the routing gateway adds a route field to the registration message, marks the routing gateway information and forwards it to the stateless signaling service module; after receiving the registration message, the stateless signaling service module parses the camera information in the VIA field, queries the database for the camera information, and verifies the camera information; the stateless signaling service module reports the verified camera information to the device status management service module, and updates the camera information in the database; the device status management service module detects the status of the camera and marks it. If the mark is offline, the relevant information in the device status management service module is cleared, and the registration result is sent to the camera through the routing gateway.
[0013] Furthermore, the specific method of the heartbeat process is: the camera sends a heartbeat to the routing gateway, the routing gateway receives the request information of the camera, detects that the message type is a request message, and the request method is a MESSAGE heartbeat message; the routing gateway adds a route field to the heartbeat message, marks the routing gateway information and forwards it to the stateless signaling service module; after receiving the heartbeat message, the stateless signaling service module parses the DeviceID field and the heartbeat period field in the message body, and pushes it to the device status management service module; the device status management service module receives the DeviceID field and the heartbeat period field, detects whether the device has been registered, and returns the device offline status information if it has not been registered; if it has been registered but the heartbeat interval is too long, returns the device heartbeat timeout, and marks the device offline; if it has been registered, the heartbeat interval is normal, updates the heartbeat detection time, and returns the device heartbeat normal status.
[0014] Furthermore, the specific method of the notification and alarm process is: the camera sends a notification or alarm message to the routing gateway, the routing gateway receives the request information from the camera, detects the message type as a notification or alarm message, and the request method is a MESSAGE alarm or a NOTIFY notification message; the routing gateway adds a route field to the request message, marks the routing gateway information and forwards it to the stateless signaling service module; after receiving the heartbeat message, the stateless signaling service module parses the DeviceID field and the request content in the message body, and if it is an alarm message, sends it to the redis cache service, and obtains the alarm information of the camera through subscription; the route address in the request message of the stateless signaling service module sends a response message to the camera, and the camera alarm or notification push is successful.
[0015] Furthermore, the method for starting a video request task is as follows: when a real-time video request task is started, an HTTP request is initiated to a task management service module; according to the HTTP request, the RTSP address of the streaming media is read from a queue that has been opened in a cache query task queue; if the queue that has been opened includes the RTSP address of the streaming media, the real-time stream is read; if the queue that has been opened does not include the RTSP address of the streaming media, a new task is added to the cache query task queue, and a video request is sent to a stateful signaling service module through a streaming media service module; the stateful signaling service module returns a stateful signaling microservice ID to the streaming media service module, and the streaming media service module returns a stateful signaling microservice ID, an ID of a streaming media microservice and a streaming media RTSP address to the task management service module; the task management service module updates the cache query task queue information, and initiates an INVITE request to the camera through a routing gateway; the camera returns the SDP information of the camera to the streaming media service.
[0016] Furthermore, the HTTP request includes: a 20-bit national standard system camera code, the camera IP and the camera port information; the video request includes streaming media links UDP and TCP, and the TCP includes active, passive, SSRC value and port.
[0017] Furthermore, the method for closing the video request task is: when the real-time video request task is closed, a closing request is initiated to the task management service module; based on the closing request, it is determined whether it is in the cache query task queue, and if not, the task is terminated; if so, the closing request is sent to the stateful signaling service module through the streaming media service module, and an instruction to close the camera video is generated, and the streaming media service module deletes the task in the cache query task queue according to the instruction.
[0018] The present invention also discloses a task-based national standard video device load balancing access system, which adopts any of the above-mentioned task-based national standard video device load balancing access methods, including: external calling streaming media module, task management service module, database, streaming media service module, stateful signaling service module, stateless signaling service module, device state management service module and routing gateway; the external calling streaming media module is used to initiate a request to the task management service module; the task management service module is used to receive the request and determine whether the request signaling is stateless signaling or stateful signaling; the database is used to store camera information; the streaming media The service module is used to start the RTSP backend service and provide the client connection address to the task management service; the information of the streaming media service and the video request are sent to the stateful signaling service module; the stateful signaling service module is used to process the stateful signaling, return the result to the streaming media service module, and transmit it to the camera through the routing gateway; the stateless signaling service module is used to process the stateless signaling according to its category, and transmit the processing result to the camera through the routing gateway; the device status management service module is used to detect whether the device is registered and the heartbeat time interval; the routing gateway is used to send the request and processing result to the camera.
[0019] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. The computer program is executed by a processor to implement any of the above-mentioned task-based national standard video device load balancing access methods.
[0020] The technical solution of the present invention has at least the following technical effects or advantages: 1. Simplify the access problem of massive cameras: In the access solution of more than 1,000 cameras, only one video access node is needed, and the cameras only need to be configured with the same routing gateway address, port and platform ID information. The performance problem is solved through load balancing, cache processing and segmented microservices within the access nodes.
[0021] 2. Improve system scalability: When the camera access capacity is expanded, the system can easily cope with the increase or decrease of business volume by adding or reducing microservices. It supports hyper-convergence and containerized deployment. You only need to add virtualized resources to complete the expansion, without adding new streaming media devices or changing the overall architecture.
[0022] 3. Enhance system reliability: Each microservice node in the cluster is responsible for balancing or redundancy, ensuring that when a node fails, other nodes can quickly take over its tasks, thereby ensuring the continuous and stable operation of the system.
[0023] 4. Simplify the logic of the video surveillance cloud platform: The task-based streaming media access system isolates the platform from the camera equipment. The application and management of the camera video resources can be completed only through the REST interface and RTSP interface, reducing the impact of equipment failure and network failure on the video system. The concept of video resources is improved. The application of the same video resource does not need to calculate the load, and can be directly obtained and used. The management of streaming media services by the video surveillance system is simplified, reducing the complexity of integration.
[0024] 5. Improve the utilization of hardware resources: In the above design, the use of database and cache separates the stateless signaling service, reduces the pressure of signaling services such as registration, heartbeat, notification, and alarm, and the device management status service plays a buffering role in the above messages, improving the processing performance of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flow chart of a method for starting a video request task in one embodiment of the present invention; Figure 2 is a flow chart of a registration process in one embodiment of the present invention; Figure 3 is a flow chart of a heartbeat process in one embodiment of the present invention; Figure 4 is a flow chart of a notification and alarm process in one embodiment of the present invention; Figure 5 is a flow chart of a stateful information processing method in one embodiment of the present invention; Figure 6 is a flow chart of a method for closing a video request task in one embodiment of the present invention; Figure 7 It is a structural diagram of a task-based national standard video device load balancing access system in one embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is described in detail through specific embodiments. However, it should be understood that the provision of specific embodiments is only for a better understanding of the present invention, and they should not be understood as limitations of the present invention. In the description of the present invention, it should be understood that the terms used are only for the purpose of description and cannot be understood as indicating or implying relative importance.
[0027] In order to solve the bottleneck problems and single point failure problems of large-scale camera access, high concurrent video request signaling processing in the prior art, and the high frequency demand for the same channel of real-time video, the long waiting time for the image output, network jitter, congestion and screen distortion when requesting the video, etc. The present invention proposes a task-based national standard video equipment load balancing access method, system and readable medium, which mainly consists of three parts: a signaling gateway system, a video streaming gateway system and a task management system, including GB / T 28181 routing gateway service, stateless signaling service (registration, heartbeat, subscription, notification, alarm) processing, stateful signaling service, streaming media service, device status management service and task management service processing flow. It aims to improve the load balancing processing capability of heartbeat, directory, notification, alarm message and INVITE request, and the active task-based streaming mode improves the real-time video distribution capability of the same camera and shortens the time of video decoding image presentation. Thereby meeting the business needs of real-time video such as large-scale GB / T 28181 camera access and high concurrent video requests. The scheme of the present invention is described in detail by embodiments in conjunction with the accompanying drawings.
[0028] Embodiment 1 This embodiment discloses a task-based national standard video device load balancing access method, including the following steps: S1 starts the video request task.
[0029] like Figure 1 As shown, the method to start the video request task is: When the S1.1 real-time video request task is started, an HTTP (Hypertext Transfer Protocol) request is initiated to the task management service module. The HTTP request includes: a 20-bit national standard system camera code (for example: 11010100001320000001), the camera's IP and the camera's port information. The return value includes rescode and RTSP (Real Time Streaming Protocol) address, where rescode includes 0 or -1, 0 for success and -1 for failure.
[0030] S1.2 According to the HTTP request, the task management service module reads the RTSP address of the streaming media from the queue that has been opened in the cache query task queue; S1.3 If the queue that has been opened includes the RTSP address of the streaming media, read the real-time stream; S1.4 If the queue that has been opened does not include the RTSP address of the streaming media, a new task is added to the cache query task queue, and a video request is sent to the stateful signaling service module through the streaming media service module, and the request includes the streaming media link UDP (User Datagram Protocol) and TCP (Transmission Control Protocol); S1.5 The stateful signaling service module returns the stateful signaling microservice ID to the streaming media service module, and the streaming media service module returns the stateful signaling microservice ID, the streaming media microservice ID and the streaming media RTSP address to the task management service module; The S1.6 task management service module updates the information about signaling, streaming media services, and RTSP in the cache query task queue. The stateful signaling service initiates an INVITE request to the camera through the SIP routing gateway; when the camera returns to normal, the camera returns the SDP information of the camera to the streaming media service; when the camera returns a failure, it initiates a request to the camera again after an interval of 5-10 seconds.
[0031] S2 receives the request signaling from the camera and determines whether the request signaling is a stateless signaling or a stateful signaling.
[0032] The signaling interaction between the GB / T 28181 routing gateway and the camera is divided into request signaling and response signaling. Stateful signaling is the signaling that requires video data transmission, that is, INVITE signaling is a stateful request signaling; stateless signaling is the signaling that does not require video data transmission; the categories of stateless signaling include registration process, heartbeat process, notification, and alarm process, that is, non-INVITE such as REGISTER, MESSAGE, NOTIFY are stateless request signaling. 100 Trying, 200 OK, etc. are response signaling. When the GB / T 28181 routing gateway receives the non-INVITE request signaling of the camera, it randomly sends it to the stateless signaling service in a load balancing selection mode.
[0033] S3: If the request signaling is a stateless signaling, determine the category of the stateless signaling, transmit the stateless signaling to the stateless signaling service module, process it according to the category of the stateless signaling, and transmit the processing result to the camera through the routing gateway.
[0034] like Figure 2 As shown, the specific method of the registration process is: The camera initiates a REGISTER registration message to the routing gateway. The routing gateway receives the request information from the camera, detects that the message type is a request message, and the request method is REGISTER registration message.
[0035] The routing gateway adds the route field to the registration message, marks the routing gateway information and forwards it to the stateless signaling service module.
[0036] After receiving the registration message, the stateless signaling service module parses the camera information in the VIA field and queries the database for camera information, such as device ID, device password, camera address, camera port, etc. The stateless signaling service module receives the camera information in the database and verifies the camera IP address, camera port, camera ID, camera password, camera status, camera last registration time, camera registration cycle, and other information.
[0037] The stateless signaling service module reports the verified camera information to the device status management service module. If the information changes, the camera information in the database is updated.
[0038] The device status management service module detects the status of the camera according to the registration cycle and heartbeat cycle, and marks it. If it is not updated within the registration cycle, it is marked as offline. If the heartbeat is not submitted according to the specified number of times within the heartbeat cycle, it is marked as offline. When the device is marked as offline, the database is updated and the relevant information in the device status management service module is cleared.
[0039] The stateless signaling service module sends a 200 OK response to the routing gateway according to the address in the route field, and the camera is successfully registered.
[0040] When the database returns to the stateless signaling service module that the camera information is not found, the stateless signaling service module sends a 400 Bad Request response to the routing gateway according to the route field address. After the routing gateway deletes the route field, it returns a registration failure response to the camera.
[0041] like Figure 3 As shown, the specific method of the heartbeat process is: The camera sends a heartbeat message to the routing gateway, and the routing gateway receives the request information from the camera. The detection message type is a request message, and the request method is a MESSAGE heartbeat message.
[0042] The routing gateway adds the route field to the heartbeat message, marks the routing gateway information and forwards it to the stateless signaling service module.
[0043] After receiving the heartbeat message, the stateless signaling service module parses the DeviceID field and the heartbeat period field in the message body and pushes them to the device status management service module.
[0044] The device status management service module receives the DeviceID field and the heartbeat period field, and detects whether the device has been registered. If not, it returns the device offline status information; if it has been registered but the heartbeat interval is too long, it returns the device heartbeat timeout and marks the device offline; if it has been registered and the heartbeat interval is normal, it updates the heartbeat detection time and returns the device heartbeat normal status.
[0045] The device status management service module detects that the camera changes from an online state to an offline state, and changes the online state of the camera to offline.
[0046] The stateless signaling service module sends a 200 OK response to the routing gateway through the route field address for the heartbeat message. After the routing gateway deletes the route field, it sends a 200 OK response to the camera, and the camera heartbeat is successful. Based on the returned heartbeat update failure message, the stateless signaling service module sends a 400 Bad Request response to the routing gateway according to the route field address for the heartbeat update failure message. After the routing gateway deletes the route field, it returns a heartbeat failure response to the camera.
[0047] like Figure 4 As shown in the figure, the specific methods of notification and alarm process are as follows: The camera sends notification and alarm messages to the routing gateway. The routing gateway receives the request information from the camera. The detection message type is a request message, and the request method is a MESSAGE alarm or a NOTIFY notification message. The routing gateway adds the route field to the notification and alarm messages, marks the routing gateway information and forwards it to the stateless signaling service module; After receiving the heartbeat message, the stateless signaling service module parses the DeviceID field and request content in the message body. If it is an alarm message, it is sent to the redis cache service. The external device obtains the alarm information of the camera through subscription. The external device can be a mobile phone, computer, etc. The route address in the request message of the stateless signaling service module sends a 200 OK response message to the camera. After the routing gateway deletes the route address, it sends a 200 OK response to the camera, and the camera alarm or notification push is successful.
[0048] S4, if the request signaling is a stateful signaling, sends the stateful signaling to the streaming media service module, starts the RTSP backend service, and provides the client connection address to the task management service module; S5 sends the streaming media service information and the video request to the stateful signaling service module, and generates a video request to be sent to the camera in combination with the client connection address; the camera provides the video according to the video request.
[0049] The task management module interface is called externally to initiate a real-time video call from the camera. The task management service selects the streaming service with the lightest load to request the real-time video. The streaming service provides the RTSP (Real Time Streaming Protocol) address to the task management service, and adds the streaming IP, port, service ID, streaming link mode, and the video encoding format that can be received in the request, and selects the stateful signaling service module with the lightest load. Before the task is completed, the streaming service module and the stateful signaling service module cannot be switched.
[0050] The external service calls the video request interface of the task management service. The task management service module initiates a video request task to the streaming service module. The reconnection operation required for video interruption caused by network or device restart is completed by the streaming service module. After the streaming service module returns the RTSP address provided to the outside, the task management service module provides a corresponding message to the outside, and the message body contains the RTSP address. Before the task ends, the RTSP address remains unchanged.
[0051] like Figure 5 As shown, the stateful signaling processing method is as follows: After receiving the request, the streaming service module starts the RTSP backend service and provides the client connection address to the task management service. The streaming service information and video request are sent to the stateful signaling service module; the stateful signaling service module constructs an INVITE request and message body SDP based on the streaming information, addresses the routing gateway through the route field information, and sends a video request to the camera by querying the camera source address in the cache. After receiving the message, the routing gateway deletes the route field address and sends the message to the camera.
[0052] After receiving the video request, the camera parses the streaming media information, provides the video to the superior according to the request method, and generates the corresponding 200 OK response message. The message body contains the SDP information of the camera, and sends the negotiated 200 OK response message to the routing gateway. After receiving the 200 OK response message, the routing gateway sends the recorded INVTE request information to the stateful signaling service module.
[0053] The stateful signaling service module parses the response message and forwards it to the streaming service module. If the streaming service information is in UDP connection mode, the received video stream is written into the memory queue. If it is in TCP passive mode, the streaming service module initiates a TCP link to the camera and writes the received video into the memory queue.
[0054] When the task management service module receives the video shutdown task, the streaming media service detects that the externally shared video link has been disconnected, and sends a video shutdown request to the stateful signaling service. After receiving the video shutdown, the stateful signaling service searches for the session link of the video and sends a bye message with route to the routing gateway. After receiving the bye message, the routing gateway deletes the route field and sends the bye message to the camera. After receiving the BYE message, the camera shuts down the video stream. The camera replies 200 OK to the routing gateway. The routing gateway sends a 200 OK message to the stateful signaling service.
[0055] S6 closes the video request task.
[0056] like Figure 6 As shown, the method to close the video request task is: S6.1 When the real-time video request task is closed, a closing request is sent to the task management service module, and the closing request includes the camera ID; S6.2 determines whether the closing request is in the cache query task queue based on the closing request. If not, the task is terminated. If so, the closing request is sent to the stateful signaling service module through the streaming media service module to generate an instruction to close the camera video. The streaming media service module deletes the task in the cache query task queue according to the instruction.
[0057] Embodiment 2 Based on the same inventive concept, this embodiment discloses a task-based national standard video device load balancing access system, such as Figure 7 As shown, a task-based national standard video device load balancing access method using any of the above items includes: an external call streaming media module, a task management service module, a database, a streaming media service module, a stateful signaling service module, a stateless signaling service module, a device status management service module and a routing gateway.
[0058] Externally call the streaming media module to initiate a request to the task management service module; The task management service module is used to receive requests and determine whether the request signaling is stateless or stateful. The task management service module follows the REST interface specification. Video requests and video closing tasks are stored in the cache. The load balancing function of the task management service can be proxied by load balancing software such as NGINX. Database, used to store camera information; The streaming media service module is used to start the RTSP backend service and provide the client connection address to the task management service; it sends the streaming media service information and video request to the stateful signaling service module; The stateful signaling service module is used to process the stateful signaling, return the result to the streaming service module, and transmit it to the camera through the routing gateway; A stateless signaling service module is used to process the stateless signaling according to its category and transmit the processing result to the camera through the routing gateway; Device status management service module, used to detect whether the device is registered and the heartbeat time interval; Routing gateway, used to send requests to the camera and process results.
[0059] In this embodiment, the task-based national standard video equipment load balancing access system is a microservice cluster architecture system that balances the load between each node. The streaming media service module, the stateful signaling service module, and the stateless signaling service module all include several service nodes. Each service node can process related tasks independently. When a service node fails, it can be taken over by another service node. Therefore, the failure of an individual service node does not affect the overall operation of the system. It makes it easy to add new nodes to expand capacity when demand grows, and it also greatly enhances the flexibility of the system. At the same time, the video retrieval is changed from a passive request to an active video stream pull to keep alive, which can increase the signaling pressure of frequent external requests on microservices, and can also solve problems such as slow video output and freezes. In this embodiment, several service nodes refer to two or more service nodes.
[0060] In the system of this embodiment, the routing gateway is only responsible for forwarding, and the stateless signaling service and stateful signaling service implement signaling parsing and business implementation. For camera device configuration, you only need to configure the superior platform ID and the address of the routing gateway, which greatly simplifies the complexity of accessing the camera. External system calls use the REST interface, and shared streaming media are transmitted using the RTSP protocol to ensure that the external superior platform can seamlessly connect to the entire gateway cluster in a standardized and simplified manner. From the perspective of user experience, this design creates an intuitive feeling of interaction with traditional video access gateways, concealing the complexity of the underlying cluster architecture, thereby greatly improving the system's ease of use and user satisfaction.
[0061] Embodiment 3 Based on the same inventive concept, this embodiment discloses a computer-readable storage medium, on which a computer program is stored. The computer program is executed by a processor to implement any of the above-mentioned task-based national standard video device load balancing access methods.
[0062] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0063] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0064] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0065] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation of the present invention can still be modified or replaced by equivalents, and any modification or equivalent replacement that does not deviate from the spirit and scope of the present invention should be included in the protection scope of the claims of the present invention. The above content is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A task-based national standard video equipment load balancing access method, characterized in that: The following steps are involved: Start the video request task; receiving a request signaling from a camera, and determining whether the request signaling is a stateless signaling or a stateful signaling; If the request signaling is a stateless signaling, determining the category of the stateless signaling, transmitting the stateless signaling to a stateless signaling service module, processing the stateless signaling according to the category of the stateless signaling, and transmitting the processing result to the camera through a routing gateway; If the request signaling is a stateful signaling, the stateful signaling is sent to the streaming service module, the RTSP backend service is started, and the client connection address is provided to the task management service module; the streaming service information and the video request are sent to the stateful signaling service module, and a video request is generated to be sent to the camera in combination with the client connection address; The camera provides video based on the video request; Close the video request task.
2. The task-based national standard video device load balancing access method according to claim 1, characterized in that: The stateful signaling is the signaling that needs to transmit video data; the stateless signaling is the signaling that does not need to transmit video data; the categories of the stateless signaling include registration process, heartbeat process and notification, alarm process.
3. The task-based national standard video device load balancing access method as claimed in claim 2, characterized in that: The specific method of the registration process is as follows: The camera sends a REGISTER registration message to the routing gateway. The routing gateway receives the request information from the camera and detects that the message type is a request message and the request method is a REGISTER registration message. The routing gateway adds the route field to the registration message, marks the routing gateway information and forwards it to the stateless signaling service module; After receiving the registration message, the stateless signaling service module parses the camera information in the VIA field, queries the database for the camera information, and verifies the camera information; The stateless signaling service module reports the verified camera information to the device status management service module and updates the camera information in the database; The device status management service module detects the status of the camera and marks it. If the mark is offline, the relevant information in the device status management service module is cleared, and the registration result is sent to the camera through the routing gateway.
4. The task-based national standard video device load balancing access method as claimed in claim 2, characterized in that: The specific method of the heartbeat process is: The camera sends a heartbeat to the routing gateway, and the routing gateway receives the request information from the camera. The detection message type is a request message, and the request method is a MESSAGE heartbeat message. The routing gateway adds the route field to the heartbeat message, marks the routing gateway information and forwards it to the stateless signaling service module; After receiving the heartbeat message, the stateless signaling service module parses the DeviceID field and the heartbeat period field in the message body and pushes them to the device status management service module; The device status management service module receives the DeviceID field and the heartbeat period field, detects whether the device has been registered, and returns device offline status information if it has not been registered; If the device has been registered but the heartbeat interval is too long, the device heartbeat timeout is returned and the device is marked as offline. Already registered, the heartbeat interval is normal, the heartbeat detection time is updated, and the device heartbeat returns to normal status.
5. The task-based national standard video device load balancing access method as claimed in claim 2, characterized in that: The specific method of the notification and alarm process is as follows: The camera sends notification and alarm messages to the routing gateway. The routing gateway receives the request information from the camera. The detection message type is a request message, and the request method is a MESSAGE alarm or a NOTIFY notification message. The routing gateway adds the route field to the notification and alarm messages, marks the routing gateway information and forwards it to the stateless signaling service module; After receiving the heartbeat message, the stateless signaling service module parses the DeviceID field and the request content in the message body, and if it is an alarm message, sends it to the redis cache service, and obtains the alarm information of the camera through subscription; The route address in the request message of the stateless signaling service module sends a response message to the camera, and the camera alarm or notification is pushed successfully.
6. The task-based national standard video device load balancing access method according to claim 1, characterized in that: The method for starting the video request task is: When the real-time video request task is started, an HTTP request is initiated to the task management service module; According to the HTTP request, read the RTSP address of the streaming media from the queue that has been opened in the cache query task queue; If the queue that has been opened includes the RTSP address of the streaming media, read the real-time stream; If the queue that has been opened does not include the RTSP address of the streaming media, a new task is added to the cache query task queue, and a video request is sent to the stateful signaling service module through the streaming media service module; The stateful signaling service module returns the stateful signaling microservice ID to the streaming service module, and the streaming service module returns the stateful signaling microservice ID, the streaming microservice ID and the streaming RTSP address to the task management service module; The task management service module updates the cache query task queue information and initiates an INVITE request to the camera through the routing gateway; The camera returns the SDP information of the camera to the streaming service.
7. The task-based national standard video device load balancing access method according to claim 6, characterized in that: The HTTP request includes: 20-bit national standard system camera code, camera IP and camera port information; the video request includes streaming media links UDP and TCP.
8. The task-based national standard video device load balancing access method according to claim 1, characterized in that: The method for closing the video request task is: When the real-time video request task is closed, a closing request is sent to the task management service module; According to the closing request, determine whether it is in the cache query task queue, and if not, terminate the task; If so, the closing request is sent to the stateful signaling service module through the streaming media service module to generate an instruction to close the camera video, and the streaming media service module deletes the task in the cache query task queue according to the instruction.
9. A task-based national standard video equipment load balancing access system, characterized in that: The task-based national standard video device load balancing access method as described in any one of claims 1 to 8 is adopted, comprising: an external streaming media module, a task management service module, a database, a streaming media service module, a stateful signaling service module, a stateless signaling service module, a device state management service module and a routing gateway; The external calling streaming media module is used to initiate a request to the task management service module; The task management service module is used to receive the request and determine whether the request signaling is stateless signaling or stateful signaling; The database is used to store camera information; The streaming media service module is used to start the RTSP backend service and provide the client connection address to the task management service; and send the streaming media service information and video request to the stateful signaling service module; The stateful signaling service module is used to process the stateful signaling, return the result to the streaming media service module, and transmit it to the camera through the routing gateway; The stateless signaling service module is used to process the stateless signaling according to its category and transmit the processing result to the camera through the routing gateway; The device status management service module is used to detect whether the device is registered and the heartbeat time interval; The routing gateway is used to send requests and processing results to the camera.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the task-based national standard video device load balancing access method as described in any one of claims 1 to 8.