A railway video high-availability monitoring and connection system, method, processing device and storage medium based on shared collaboration
Patent Information
- Application Number
- CN202610774784.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-01
- Publication Date
- 2026-08-07
AI Technical Summary
关键节点一旦发生故障,将引发整个级联体系的中断,导致设备信令中断、用户无法访问、视频流丢失等严重后果,威胁系统整体业务连续性
1、本发明通过构建高性能分布式缓存系统、智能网关负载均衡机制及设备代理重定向服务,从根本上解决了大型分布式铁路视频监控平台在数据实时共享、系统状态感知、高可用性设计及资源利用率方面的核心技术难题,为构建高效、稳定、可弹性扩展的“全域互联、智能协同”新一代视频监控系统提供了核心架构支撑。
Smart Images

Figure CN122534196A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of railway transportation safety video surveillance technology, and in particular to a railway video high-availability monitoring cascade system, method, processing equipment, and storage medium based on sharing and collaboration. Background Technology
[0002] Currently, the construction scale of video surveillance systems is experiencing explosive growth, with the number of monitoring points increasing from the traditional thousands or tens of thousands to millions or even tens of millions. Although China's national standard GB / T 28181 provides a basic specification for cross-platform interconnection, traditional large-scale video surveillance networking systems built on this protocol still adopt a centralized, siloed architecture, which exposes many architectural defects when faced with massive device access, high-concurrency user access, and complex business processing.
[0003] First, there are bottlenecks in state awareness and business collaboration: In traditional cascaded architectures, core business modules (such as management services, storage services, and alarm services) are typically deployed independently, resulting in scattered data storage and severe information silos. This hinders efficient data sharing and awareness among multiple modules, and the synchronization of state and information between modules relies on a high-frequency polling query mechanism of the database. This approach not only leads to extremely high database load but also causes significant delays in system state awareness, typically reaching the second or even minute level, making real-time collaboration of multi-module data sharing impossible. Especially in scenarios requiring strong consistency and real-time performance, such as master-slave switching, cascaded control, and global device state synchronization, this architecture struggles to meet the stringent requirements of high-end applications like railways for business continuity and real-time response. Second, inherent limitations of the protocol mechanism restrict architectural flexibility: Limited by the national standard GB / T 28181 protocol specification, front-end devices (such as IPCs and NVRs) can only point to a preset fixed upper-level service address during registration. This "single-point static configuration" mode limits the ability of devices to achieve native load balancing and automatic fault switching at the protocol level. Meanwhile, existing equipment generally lacks redirection response processing capabilities, making dynamic routing and service migration at the signaling layer impossible, severely restricting the system architecture's elasticity and scalability. Secondly, there are cascading performance bottlenecks and single points of failure: in existing architectures, clients typically connect directly to designated gateway services and management nodes, and video stream forwarding is often handled by a few media servers. When facing large-scale concurrent registrations and video business logic requests, performance bottlenecks are easily formed. If a critical node fails, it will trigger an interruption of the entire cascading system, leading to serious consequences such as interrupted device signaling, inaccessibility for users, and loss of video streams, threatening the overall business continuity of the system. Finally, there is insufficient system scalability and low resource utilization: the tight coupling design of components in traditional architectures severely limits system scalability. Performance improvements usually rely on vertical scaling, which is costly and has physical limits, making on-demand elastic scaling impossible. During peak business periods, rapid expansion to cope with traffic surges is difficult, while during off-peak periods, downsizing to conserve resources is impossible, lacking horizontal scaling capabilities. Furthermore, traditional primary / standby switching is inefficient, with high standby resource idle rates, making it difficult to balance reliability and resource efficiency.
[0004] Therefore, the existing technical architecture is difficult to meet the requirements of video surveillance systems in the Internet of Things environment for high availability, elastic scalability and intelligent collaboration. There is an urgent need for a brand-new architectural design scheme to solve the above bottlenecks and achieve a fundamental breakthrough in the platform in terms of high performance, high availability and elastic scalability. Summary of the Invention
[0005] To address the aforementioned issues, the purpose of this invention is to provide a shared and collaborative high-availability cascaded system, method, processing equipment, and storage medium for railway video surveillance, which can meet the requirements of video surveillance systems for high availability, elastic expansion, and intelligent collaboration in an environment of the Internet of Things.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: In the first aspect, a railway video high-availability monitoring cascade system based on sharing and collaboration is provided, including a client, a gateway service cluster, a device or lower-level platform layer, a protocol access layer, a business service layer, and a distributed data sharing and perception Redis layer, wherein the gateway service cluster, the protocol access layer, and the business service layer are all formed by several national standard management service nodes to form corresponding service clusters, and the protocol access layer includes a proxy registration service cluster and at least one SIP service cluster; The client is used to send login requests or video requests to the gateway service cluster; send login requests or video requests to the proxy registration service cluster based on the virtual IP address sent by the gateway service cluster; and store login information and requests in the distributed data sharing awareness Redis layer. The gateway service cluster is used to receive the client's login request or video request through the corresponding optimal national standard management service node, and send the virtual IP address of the proxy registration service cluster to the client; The device or lower-level platform layer is used to send a registration request to the proxy registration service cluster based on the virtual IP address of the proxy registration service cluster; and to collect video streams, encode them, and send them directly to the business service layer; The proxy registration service cluster is used to provide a virtual IP address to the outside world; based on the health status and real-time load of the national standard management service nodes in each service cluster, the optimal national standard management service node of each service cluster is dynamically determined, and the health status and real-time load of the national standard management service nodes are dynamically updated to the distributed data sharing awareness Redis layer. The SIP service cluster is used to route the registration request of the device or the lower-level platform, the login request of the client, or the video request of the client to the corresponding optimal national standard management service node for registration and login services according to the load balancing algorithm, and to send the video request of the client to the service layer. The business service layer is used to verify user permissions based on video requests sent by the optimal national standard management service node of the SIP service cluster. After the permission verification is successful, the stored historical video stream or the real-time video stream obtained from the device or the lower-level platform layer is sent to the client. The distributed data sharing awareness Redis layer is used to elect the best national standard management service node of a certain SIP service cluster as the master node using Redis distributed locks, and the best national standard management service nodes of other SIP service clusters as backup nodes. When the master node fails, the backup node is promoted to the new master node.
[0007] Furthermore, the distributed data sharing awareness Redis layer includes: The state data storage module is used to build a unified state data model for each entity using Redis to store the state data of each entity. The distributed lock module is used to implement a distributed lock using the Redis SETNX and EXPIRE commands. It uses the Redis distributed lock to elect the best national standard management service node of a certain SIP service cluster as the master node, and the best national standard management service nodes of other SIP service clusters as backup nodes. The data message sensing module is used to send messages to the corresponding backup nodes through the master node as the publisher when the status of the connected device changes.
[0008] Furthermore, the implementation process of the distributed lock module is as follows: A) The optimal national standard management service node of all the SIP service clusters starts up and competes for the distributed lock representing the "master node identity"; B) Determine the contention lock result of the optimal national standard management service node of all the SIP service clusters. If the contention lock result is yes, proceed to step C); if the contention lock result is no, the optimal national standard management service node of the SIP service cluster becomes a backup node. C) The optimal national standard management service node of the SIP service cluster becomes the master node, acquires the lock and sets a duration, and resets the lock's expiration time through the Redis EXPIRE command, and periodically renews the heartbeat; D) The master node executes its business logic based on the set lock, duration, and expiration time; E) The master node is periodically renewed during operation, every t seconds, to renew the distributed lock; F) When the master node fails to renew the lock in time, Redis automatically expires the lock and the master node releases the lock; G) All standby nodes detect lock release and proceed to step B).
[0009] Furthermore, the business service layer includes: Configure a service cluster for user permission verification and unified management of configuration information; The storage service cluster is used to store historical video streams collected by the device or the lower-level platform layer; based on the configuration information of the configuration service cluster, it responds to scheduling instructions, retrieves historical video streams, and sends them to the streaming media service cluster; The streaming media service cluster is used to send scheduling instructions to the storage service cluster or obtain real-time video streams from the device or lower-level platform layer based on video requests sent by the corresponding optimal national standard management service node; to replay historical video streams and generate standard playback media streams; to send a portion of the obtained real-time video streams or standard playback media streams to the client; and to transmit the remaining real-time video streams to the storage service cluster for storage.
[0010] Furthermore, the load balancing process between the gateway service cluster and the protocol access layer is as follows: The client sends a login request to the gateway service cluster; The gateway service cluster sends the virtual IP address of the proxy registration service cluster to the client based on the login request; The client sends a login request to the proxy registration service cluster based on a virtual IP address; The proxy registration service cluster dynamically determines the optimal national standard management service node of the SIP service cluster based on the health status and real-time load of the national standard management service node in the SIP service cluster, and sends routing requests to the corresponding optimal national standard management service node. The optimal national standard management service node returns a response to the agent registration service cluster; The agent registration service cluster returns a response to the client.
[0011] Furthermore, the agent registration service cluster is also used to reconstruct SIP signaling using a back-to-back user agent mode to achieve intelligent redirection registration to the optimal national standard management service node.
[0012] Furthermore, the intelligent redirection registration process of the agent registration service cluster is as follows: Initial registration phase: The device or lower-level platform layer sends a SIP Register request to the proxy registration service cluster; The proxy registration service cluster sends a SIP service node status request to the distributed data sharing awareness Redis layer; The distributed data sharing awareness Redis layer returns the health status and real-time load of the SIP service cluster; The agent registration service cluster adopts an intelligent decision-making algorithm to dynamically determine the optimal national standard management service node of the SIP service cluster based on the health status and real-time load of the national standard management service node of the SIP service cluster. The agent registration service cluster reconstructs SIP signaling using a back-to-back user agent mode, reconstructs and forwards registration requests from the device or lower-level platform layer to the optimal national standard management service node of the SIP service cluster; The optimal national standard management service node of the SIP service cluster returns a registration success response signal to the agent registration service cluster; The agent registration service cluster will return a registration success response signal to the device or the lower-level platform layer; Normal operation phase: The device or lower-level platform layer sends a registration or heartbeat signal to the optimal national standard management service node of the SIP service cluster; The optimal national standard management service node of the SIP service cluster updates its health status and real-time load to the distributed data sharing awareness Redis layer in real time. Failover scenario: The optimal national standard management service node of the SIP service cluster sends a node failure or high load signal to the agent registration service cluster. The proxy registration service cluster sends the node status of the optimal national standard management service node of the SIP service cluster to the distributed data sharing awareness Redis layer; The device or lower-level platform layer sends the next registration or heartbeat signal to the agent registration service cluster; The proxy registration service cluster sends a national standard management service node status request from the SIP service cluster to the distributed data sharing awareness Redis layer to re-query available nodes; The distributed data sharing awareness Redis layer returns the optimal national standard management service node of the SIP service cluster; The agent registration service cluster reconstructs SIP signaling using a back-to-back user agent mode, reconstructs and forwards registration requests from the device or lower-level platform layer to the new optimal national standard management service node of the SIP service cluster; The new optimal national standard management service node returns a registration success response signal to the agent registration service cluster; The agent registration service cluster will return a registration success response signal to the device or the lower-level platform layer; Subsequent communication from the device or lower-level platform layer will be redirected to the new optimal national standard management service node of the SIP service cluster.
[0013] Secondly, a shared-collaboration-based railway video high-availability monitoring cascading system is provided, comprising: The proxy registration service cluster provides a virtual IP address to the outside world as the target address for registration or login; When logging in via client: The client sends a login request to the gateway service cluster; based on the login request, the gateway service cluster sends the virtual IP address of the proxy registration service cluster to the client; based on the virtual IP address, the client sends a login request to the proxy registration service cluster; based on the health status and real-time load of the national standard management service node in the SIP service cluster, the proxy registration service cluster dynamically decides the optimal national standard management service node in the SIP service cluster and sends a routing request to the optimal national standard management service node to perform the login service. When performing smart redirection registration for a device or a lower-level platform: Initial registration phase: The device or lower-level platform layer sends a registration request to the proxy registration service cluster; the proxy registration service cluster sends a SIP service node status request to the distributed data sharing and awareness Redis layer; the distributed data sharing and awareness Redis layer returns the health status and real-time load of the SIP service cluster; based on the health status and real-time load of the national standard management service node of the SIP service cluster, the proxy registration service cluster dynamically decides the optimal national standard management service node of the SIP service cluster; the proxy registration service cluster reconstructs the SIP signaling using a back-to-back user agent mode, reconstructs and forwards the registration request from the device or lower-level platform layer to the optimal national standard management service node of the SIP service cluster; the optimal national standard management service node of the SIP service cluster performs the registration business; During normal operation: the device or lower-level platform sends heartbeat or signaling signals to the optimal national standard management service node of the SIP service cluster; the optimal national standard management service node of the SIP service cluster updates the health status and real-time load to the distributed data sharing awareness Redis layer in real time; When a client initiates a video request: the client sends the video request to the gateway service cluster, which in turn sends the virtual IP address of the proxy registration service cluster to the client based on the video request; the client then sends the video request to the proxy registration service cluster based on the virtual IP address sent by the gateway service cluster; the proxy registration service cluster forwards the video request to the optimal national standard management service node of the SIP service cluster; the optimal national standard management service node forwards the video request to the business service layer for user permission verification; after successful permission verification, the business service layer retrieves the stored historical video stream or obtains the real-time video stream from the device or lower-level platform layer through the optimal national standard management service node and sends it to the client. The distributed data sharing awareness Redis layer uses Redis distributed locks to elect the best national standard management service node of a certain SIP service cluster as the master node, and the best national standard management service nodes of other SIP service clusters as backup nodes. When the master node fails, the backup node is quickly promoted to the new master node.
[0014] Thirdly, a processing device is provided, including computer program instructions, wherein when the computer program instructions are executed by the processing device, they are used to implement the steps corresponding to the above-mentioned railway video high-availability monitoring cascade method based on sharing and collaboration.
[0015] Fourthly, a computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions, when executed by a processor, are used to implement the steps corresponding to the above-described railway video high-availability monitoring cascade method based on sharing and collaboration.
[0016] The present invention has the following advantages due to the adoption of the above technical solutions: 1. This invention fundamentally solves the core technical challenges of large-scale distributed railway video surveillance platforms in terms of real-time data sharing, system status awareness, high availability design, and resource utilization by constructing a high-performance distributed caching system, an intelligent gateway load balancing mechanism, and a device proxy redirection service. It provides core architectural support for building a new generation of "fully interconnected and intelligently collaborative" video surveillance system that is efficient, stable, and elastically scalable.
[0017] 2. Achieving Distributed Shared Sensing and Intelligent Collaboration: Based on a distributed data bus and publish / subscribe mechanism, this invention achieves millisecond-level data synchronization and event notification between system modules, completely eliminating the "data silo" phenomenon in traditional architectures and providing a real-time data foundation for complex cross-business linkages. The entire system possesses automatic fault detection, resource contention, and business takeover capabilities, achieving fully automated operation and maintenance, significantly reducing operational complexity and manual intervention costs. The entire process of node fault detection, sovereignty mutual exclusion contention, and business takeover is fully automated, significantly reducing operational complexity.
[0018] 3. Enhanced System Availability and Elastic Scaling Capabilities: This invention completely eliminates the risk of single points of failure by designing core components such as gateways and SIP services into a stateless cluster architecture and combining dynamic load balancing and intelligent routing mechanisms. Each service in the system can independently achieve horizontal scaling, dynamically scaling resources according to business load, significantly improving the overall availability and resource utilization of the system, and meeting the concurrent processing needs during peak railway business periods.
[0019] 4. Breaking Protocol Restrictions to Achieve Camera Proxy Service Access: Without violating the GB / T 28181 protocol specification and without relying on terminal device support, this invention innovatively achieves intelligent load balancing and automatic fault transfer for device registration through an architecture-level proxy camera registration mechanism. This effectively solves the single-point dependency and disaster recovery problems in large-scale device access, significantly improves the system's business continuity in fault scenarios, and achieves high availability and elastic scalability in large-scale deployment environments.
[0020] 5. Improved System Decoupling and Maintenance: This invention communicates with a distributed data bus through standardized interfaces. The responsibilities of each system component are clear and the coupling is low. It supports independent upgrades and scaling up / down. The modular architecture greatly improves the maintainability and fault location efficiency of the system, while providing good support for subsequent functional expansion.
[0021] In summary, this invention can be widely applied in the field of railway transportation safety video surveillance technology. Attached Figure Description
[0022] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. In the drawings: Figure 1 This is a schematic diagram of the system structure provided in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the implementation process of a distributed lock module provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a load balancing process provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the intelligent redirection registration process provided in an embodiment of the present invention. Detailed Implementation
[0023] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the invention and to fully convey the scope of the invention to those skilled in the art.
[0024] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0025] Although terms such as first, second, third, etc., may be used in this document to describe multiple elements, components, regions, layers, and / or segments, these elements, components, regions, layers, and / or segments should not be limited by these terms. These terms may be used only to distinguish one element, component, region, layer, or segment from another. Unless the context clearly indicates otherwise, terms such as "first," "second," and other numerical terms used herein do not imply order or sequence. Therefore, the first element, component, region, layer, or segment discussed below may be referred to as the second element, component, region, layer, or segment without departing from the teachings of the exemplary embodiments.
[0026] Existing technical architectures are insufficient to meet the requirements of high availability, elastic scalability, and intelligent collaboration in video surveillance systems operating in an interconnected world. A novel architectural design is urgently needed to overcome these bottlenecks and achieve fundamental breakthroughs in platform performance, high availability, and elastic scalability. The railway video high-availability monitoring cascade system based on shared collaboration designed in this invention addresses key technical challenges unique to the railway industry, such as massive heterogeneous device access, high-concurrency video service processing, multi-level cascade reliability, and single point of failure, thereby achieving high availability, high reliability, and elastic scalability for railway video surveillance systems.
[0027] Example 1 like Figure 1 As shown, this embodiment provides a railway video high-availability monitoring cascade system based on sharing and collaboration, including a client, a gateway service cluster, a device or lower-level platform layer, a protocol access layer, a business service layer, and a distributed data sharing awareness Redis (Remote Dictionary Server) layer. The gateway service cluster, the protocol access layer, and the business service layer are all formed by several national standard management service nodes to form corresponding service clusters. The protocol access layer includes a proxy registration service cluster and at least one SIP (Session Initiation Protocol) service cluster.
[0028] The client is used to send login requests or video requests to the gateway service cluster; send login requests or video requests to the proxy registration service cluster based on the virtual IP address sent by the gateway service cluster; and store login information and requests in the distributed data sharing awareness Redis layer.
[0029] The gateway service cluster is used to receive login or video requests from clients through the corresponding optimal national standard management service node, and send the virtual IP address of the proxy registration service cluster to the client.
[0030] The device (e.g., camera) or lower-level platform (e.g., lower-level national standard management platform) layer is used to send registration requests to the proxy registration service cluster of the protocol access layer based on the virtual IP address of the proxy registration service cluster; and after capturing and encoding video streams, the video streams are sent directly to the business service layer based on protocols such as RTSP and GB28181.
[0031] The proxy registration service cluster provides a virtual IP address as the target address for registration or login. Based on the health status and real-time load of each national standard management service node in each service cluster, it dynamically determines the optimal national standard management service node for each service cluster and dynamically updates the health status and real-time load of each national standard management service node to the distributed data sharing awareness Redis layer. It sends registration requests from devices or lower-level platforms, as well as login requests or video requests sent by the gateway service cluster, to the SIP service cluster. It also reconstructs SIP signaling using a back-to-back user agent (B2BUA) mode to achieve intelligent redirection registration to the optimal national standard management service node.
[0032] As the system's signaling communication engine, the SIP service cluster is used to route registration requests from devices or lower-level platforms, client login requests, or client video requests to the optimal national standard management service node of the SIP service cluster based on the session initiation protocol and according to the load balancing algorithm. This enables registration and login services, as well as sending client video requests to the service layer. It provides standardized signaling transmission, session management, transaction processing, and routing forwarding for services, ensuring reliable signaling interaction and protocol compliance.
[0033] The business service layer is used to verify user permissions for video requests sent by the optimal national standard management service node based on the SIP service cluster. After the permission verification is successful, the stored historical video stream is obtained through the corresponding optimal national standard management service node or the real-time video stream is obtained from the device or the lower-level platform layer and sent to the client.
[0034] The distributed data sharing awareness Redis layer is used to store the state data of each entity using Redis; to sense data messages; and to use Redis distributed locks to elect the best national standard management service node of a certain SIP service cluster as the master node, and the best national standard management service nodes of other SIP service clusters as backup nodes. When the master node fails, the backup node is quickly promoted to the new master node, thereby ensuring uninterrupted functionality of the service cluster.
[0035] In a preferred embodiment, the distributed data sharing awareness Redis layer includes a state data storage module, a distributed lock module, and a data message awareness module.
[0036] The state data storage module uses Redis as a high-performance distributed cache to build a unified state data model for each entity (such as camera device:{id}, service node server:{ip}) to store the state data of each entity.
[0037] The distributed lock module uses Redis's SETNX (Set if Not Exist) and EXPIRE (set expiration time) commands to implement distributed locks. It uses Redis distributed locks to elect the best national standard management service node of a certain SIP service cluster as the master node, and the best national standard management service nodes of other SIP service clusters as backup nodes.
[0038] The data message awareness module is used to send messages to corresponding backup nodes when the status of connected devices changes (such as device status changes or device information changes). Each backup node acts as a subscriber, receiving notifications of device status changes in real time and triggering subsequent business logic. This paradigm shift from "passive polling" by backup nodes to "active notification" by the master node enables millisecond-level business awareness and linkage, greatly reducing latency and database pressure.
[0039] Specifically, the constructed unified state data model stores the online status, heartbeat time, load indicators, gateway, and session information of entities, "externalizing" and "centralizing" the state data that was originally scattered in the memory of each module, providing a data foundation for global real-time perception.
[0040] Specifically, the unified state data model is constructed in key-value pair format. For example, when storing camera information, the key is the national standard ID (unique), and the value is the CameraInfo entity.
[0041] Specifically, such as Figure 2 As shown, the implementation process of the distributed lock module is as follows: A) The optimal national standard management service node of all SIP service clusters starts up and competes for the distributed lock representing the "master node identity".
[0042] B) Determine the contention lock result of the optimal national standard management service node in all SIP service clusters. If the contention lock result is yes, proceed to step C); if the contention lock result is no, the optimal national standard management service node of the SIP service cluster becomes the standby node.
[0043] C) The optimal national standard management service node of the SIP service cluster becomes the master node, acquires the lock and sets a duration, and resets the lock's expiration time through Redis's EXPIRE (set expiration time) command. It also periodically renews the heartbeat to indicate that it is still alive.
[0044] D) The master node executes the master node business logic based on the set lock, duration and expiration time.
[0045] E) The master node is periodically renewed during operation, every t seconds, to renew the distributed lock.
[0046] F) When the master node fails to renew the lock in time, Redis automatically expires the lock and the master node releases the lock.
[0047] G) All standby nodes detect lock release and proceed to step B).
[0048] This process is automatically triggered without manual intervention, and it achieves automatic primary / backup election and failover in a lightweight manner without a central node, ensuring the uniqueness of global control and high availability.
[0049] In a preferred embodiment, the business service layer includes a configuration service cluster, a storage service cluster, and a streaming media service cluster.
[0050] The configuration service cluster is used for user permission verification and unified management of configuration information, including recording schedules and historical video storage.
[0051] The storage service cluster is used to store historical video streams collected by storage devices or lower-level platform layers; based on the configuration information of the configuration service cluster, it responds to scheduling instructions, retrieves historical video streams, and sends them to the streaming media service cluster.
[0052] The streaming media service cluster is used to send scheduling instructions to the storage service cluster or obtain real-time video streams from devices or lower-level platform layers based on video requests sent by the corresponding optimal national standard management service nodes; to replay historical video streams and generate standard playback media streams; to send a portion of the obtained real-time video stream or standard playback media stream to the client; to transmit the remaining real-time video stream to the storage service cluster for storage, so that subsequent users can retrieve and play back historical videos; and to implement protocol conversion and transcoding of different bitstream formats (such as PS, RTP) and encoding formats (such as H.264, H.265).
[0053] In a preferred embodiment, such as Figure 3 As shown, the load balancing process between the gateway service cluster and the protocol access layer is as follows: ①The client sends a login request to the gateway service cluster.
[0054] ② The gateway service cluster sends the virtual IP address of the proxy registration service cluster to the client based on the login request.
[0055] ③ The client sends a login request to the proxy registration service cluster based on the virtual IP address.
[0056] ④ Based on the health status and real-time load of the national standard management service node in the SIP service cluster, the agent registration service cluster dynamically decides the optimal national standard management service node in the SIP service cluster and sends routing requests to the corresponding optimal national standard management service node.
[0057] ⑤ The optimal national standard management service node returns a response to the agent registration service cluster.
[0058] ⑥ The agent registration service cluster returns a response to the client.
[0059] In a preferred embodiment, such as Figure 4 As shown, the intelligent redirection registration process at the protocol access layer is as follows: (i) Initial registration phase: (1) The device or lower-level platform sends a SIP Register request to the agent registration service cluster.
[0060] (2) The agent registration service cluster sends a SIP service node status request to the distributed data sharing awareness Redis layer.
[0061] (3) The distributed data sharing awareness Redis layer returns the health status and real-time load of the SIP service cluster.
[0062] (4) The agent registration service cluster adopts an intelligent decision-making algorithm, which dynamically determines the optimal national standard management service node of the SIP service cluster based on the health status and real-time load of the national standard management service node of the SIP service cluster.
[0063] (5) The agent registration service cluster reconstructs SIP signaling using a back-to-back user agent mode, reconstructs and forwards registration requests from devices or lower-level platform layers to the optimal national standard management service node of the SIP service cluster, ensuring that the SIP header field messages are correct and that a new registration request is initiated on behalf of the device or lower-level platform to the optimal national standard management service node of the SIP service cluster that makes the decision.
[0064] ⑹The optimal national standard management service node of the SIP service cluster returns a 200 OK (i.e., registration successful) response signal to the agent registration service cluster.
[0065] (7) The agent registration service cluster will return a 200 OK response signal to the device or lower-level platform layer.
[0066] (ii) Normal operation phase: (8) The device or lower-level platform sends heartbeat or signaling (direct communication) signals to the optimal national standard management service node of the SIP service cluster.
[0067] (9) The optimal national standard management service node of the SIP service cluster updates its health status and real-time load to the distributed data sharing awareness Redis layer in real time.
[0068] (iii) Failover scenario: (10) The optimal national standard management service node of the SIP service cluster sends a node failure or high load signal to the agent registration service cluster.
[0069] ⑪ The proxy registration service cluster sends the node status (unhealthy) of the best national standard management service node of the SIP service cluster to the distributed data sharing awareness Redis layer.
[0070] 12. The device or lower-level platform sends the next registration or heartbeat signal to the agent registration service cluster.
[0071] 13. The agent registration service cluster sends the national standard management service node status request of the SIP service cluster to the distributed data sharing awareness Redis layer to re-query available nodes.
[0072] 14. The distributed data sharing awareness Redis layer returns the optimal national standard management service node of the SIP service cluster.
[0073] 12. The agent registration service cluster reconstructs SIP signaling using a back-to-back user agent mode, reconstructs and forwards registration requests from devices or lower-level platform layers to the new optimal national standard management service node of the SIP service cluster, ensuring that the SIP header field messages are correct and that a new registration request is initiated on behalf of the device or lower-level platform to the optimal national standard management service node of the SIP service cluster that made the decision.
[0074] ⒃ The new optimal national standard management service node returns a 200 OK response signal to the agent registration service cluster.
[0075] ⒄ The agent registration service cluster will return a 200 OK response signal to the device or lower-level platform layer.
[0076] ⒅ Subsequent communication between the device or lower-level platform layer will be redirected to the new optimal national standard management service node of the SIP service cluster.
[0077] Example 2 This embodiment provides a cascaded method for high-availability railway video monitoring based on shared collaboration, including the following steps: 1) The proxy registration service cluster of the protocol access layer provides a virtual IP address as the target address for registration or login.
[0078] 2) When logging in as a client, such as Figure 3 As shown: 2.1) The client sends a login request to the gateway service cluster.
[0079] 2.2) Based on the login request, the gateway service cluster sends the virtual IP address of the proxy registration service cluster to the client.
[0080] 2.3) The client sends a login request to the proxy registration service cluster based on the virtual IP address.
[0081] 2.4) The proxy registration service cluster dynamically determines the optimal national standard management service node of the SIP service cluster based on the health status and real-time load of the national standard management service node, and sends routing requests to the optimal national standard management service node to perform login services.
[0082] 2.5) The optimal national standard management service node returns a response to the agent registration service cluster.
[0083] 2.6) The agent registration service cluster returns a response to the client.
[0084] 3) When performing intelligent redirection registration for devices or lower-level platforms, such as Figure 4 As shown: 3.1) Initial registration phase: (1) The device or lower-level platform sends a SIP Register request to the agent registration service cluster.
[0085] (2) The agent registration service cluster sends a SIP service node status request to the distributed data sharing awareness Redis layer.
[0086] (3) The distributed data sharing awareness Redis layer returns the health status and real-time load of the SIP service cluster.
[0087] (4) The agent registration service cluster adopts an intelligent decision-making algorithm, which dynamically determines the optimal national standard management service node of the SIP service cluster based on the health status and real-time load of the national standard management service node of the SIP service cluster.
[0088] (5) The agent registration service cluster reconstructs SIP signaling using a back-to-back user agent mode, reconstructs and forwards registration requests from devices or lower-level platform layers to the optimal national standard management service node of the SIP service cluster, ensuring that the SIP header field messages are correct and that a new registration request is initiated on behalf of the device or lower-level platform to the optimal national standard management service node of the SIP service cluster that makes the decision.
[0089] ⑹The optimal national standard management service node of the SIP service cluster returns a 200 OK (i.e., registration successful) response signal to the agent registration service cluster.
[0090] (7) The agent registration service cluster will return a 200 OK response signal to the device or lower-level platform layer.
[0091] 3.2) Normal operation phase: (8) The device or lower-level platform sends heartbeat or signaling (direct communication) signals to the optimal national standard management service node of the SIP service cluster.
[0092] (9) The optimal national standard management service node of the SIP service cluster updates its health status and real-time load to the distributed data sharing awareness Redis layer in real time.
[0093] 3.3) Failover scenario: (10) The optimal national standard management service node of the SIP service cluster sends a node failure or high load signal to the agent registration service cluster.
[0094] ⑪ The proxy registration service cluster sends the node status (unhealthy) of the best national standard management service node of the SIP service cluster to the distributed data sharing awareness Redis layer.
[0095] 12. The device or lower-level platform sends the next registration or heartbeat signal to the agent registration service cluster.
[0096] 13. The agent registration service cluster sends the national standard management service node status request of the SIP service cluster to the distributed data sharing awareness Redis layer to re-query available nodes.
[0097] 14. The distributed data sharing awareness Redis layer returns the optimal national standard management service node of the SIP service cluster.
[0098] 12. The agent registration service cluster reconstructs SIP signaling using a back-to-back user agent mode, reconstructs and forwards registration requests from devices or lower-level platform layers to the new optimal national standard management service node of the SIP service cluster, ensuring that the SIP header field messages are correct and that a new registration request is initiated on behalf of the device or lower-level platform to the optimal national standard management service node of the SIP service cluster that made the decision.
[0099] ⒃ The new optimal national standard management service node returns a 200 OK response signal to the agent registration service cluster.
[0100] ⒄ The agent registration service cluster will return a 200 OK response signal to the device or lower-level platform layer.
[0101] ⒅ Subsequent communication between the device or lower-level platform layer will be redirected to the new optimal national standard management service node of the SIP service cluster.
[0102] 4) When the client initiates a video request: 4.1) The client sends a video request to the gateway service cluster, and the gateway service cluster, based on the video request, sends the virtual IP address of the proxy registration service cluster to the client; 4.2) The client sends a video request to the proxy registration service cluster based on the virtual IP address sent by the gateway service cluster.
[0103] 4.3) The agent registration service cluster sends the video request to the SIP service cluster.
[0104] 4.4) Based on the Session Initiation Protocol, the SIP service cluster routes video requests to the optimal national standard management service node of the SIP service cluster according to the load balancing algorithm.
[0105] 4.5) The optimal national standard management service node sends the video request to the business service layer for user permission verification.
[0106] 4.6) After the permission verification is successful, the stored historical video stream is obtained through the optimal national standard management service node of the business service layer or the real-time video stream is obtained from the device or the lower-level platform layer and sent to the client.
[0107] 5) The Redis layer, which is aware of distributed data sharing, uses Redis distributed locks to elect the best national standard management service node of a certain SIP service cluster as the master node, and the best national standard management service node of other SIP service clusters as the backup node. When the master node fails, the backup node is quickly promoted to the new master node.
[0108] Example 3 This embodiment provides a processing device corresponding to the railway video high availability monitoring cascade method based on sharing and collaboration provided in Embodiment 2. The processing device can be applied to client processing devices, such as mobile phones, laptops, tablets, desktop computers, etc., to execute the method of Embodiment 2.
[0109] The processing device includes a processor, a memory, a communication interface, and a bus. The processor, memory, and communication interface are connected via the bus to enable communication between them. The memory stores computer programs that can run on the processing device. When the processing device runs the computer programs, it executes the railway video high-availability monitoring cascade method based on sharing and collaboration provided in Embodiment 2.
[0110] In some implementations, the memory may be high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device.
[0111] In other implementations, the processor can be any type of general-purpose processor, such as a central processing unit (CPU) or a digital signal processor (DSP), and there is no limitation here.
[0112] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0113] Those skilled in the art will understand that the structure of the above-described computing device is only a partial structure related to the present invention and does not constitute a limitation on the computing device to which the present invention is applied. A specific computing device may include more or fewer components, or combine certain components, or have different component arrangements.
[0114] Example 4 This embodiment provides a computer program product corresponding to the railway video high availability monitoring cascade method based on sharing and collaboration provided in Embodiment 2. The computer program product may include a computer-readable storage medium on which computer-readable program instructions for executing the railway video high availability monitoring cascade method based on sharing and collaboration described in Embodiment 2 are loaded.
[0115] A computer-readable storage medium can be a tangible device that holds and stores instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof.
[0116] The computer-readable storage medium provided in the above embodiments has a similar implementation principle and technical effect to the above method embodiments, and will not be described again here.
[0117] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0118] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0119] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0120] The above embodiments are only used to illustrate the present invention. The structure, connection method and manufacturing process of each component can be varied. All equivalent transformations and improvements made on the basis of the technical solution of the present invention should not be excluded from the protection scope of the present invention.
Claims
1. A railway video high-availability monitoring cascade system based on sharing and collaboration, characterized in that, It includes a client, a gateway service cluster, a device or lower-level platform layer, a protocol access layer, a business service layer, and a distributed data sharing awareness Redis layer. The gateway service cluster, the protocol access layer, and the business service layer are each formed by several national standard management service nodes to form a corresponding service cluster. The protocol access layer includes a proxy registration service cluster and at least one SIP service cluster. The client is used to send login requests or video requests to the gateway service cluster; send login requests or video requests to the proxy registration service cluster based on the virtual IP address sent by the gateway service cluster; and store login information and requests in the distributed data sharing awareness Redis layer. The gateway service cluster is used to receive the client's login request or video request through the corresponding optimal national standard management service node, and send the virtual IP address of the proxy registration service cluster to the client; The device or lower-level platform layer is used to send a registration request to the proxy registration service cluster based on the virtual IP address of the proxy registration service cluster; and to collect video streams, encode them, and send them directly to the business service layer; The proxy registration service cluster is used to provide a virtual IP address to the outside world; based on the health status and real-time load of the national standard management service nodes in each service cluster, the optimal national standard management service node of each service cluster is dynamically determined, and the health status and real-time load of the national standard management service nodes are dynamically updated to the distributed data sharing awareness Redis layer. The SIP service cluster is used to route the registration request of the device or the lower-level platform, the login request of the client, or the video request of the client to the corresponding optimal national standard management service node for registration and login services according to the load balancing algorithm, and to send the video request of the client to the service layer. The business service layer is used to verify user permissions based on video requests sent by the optimal national standard management service node of the SIP service cluster. After the permission verification is successful, the stored historical video stream or the real-time video stream obtained from the device or the lower-level platform layer is sent to the client. The distributed data sharing awareness Redis layer is used to elect the best national standard management service node of a certain SIP service cluster as the master node using Redis distributed locks, and the best national standard management service nodes of other SIP service clusters as backup nodes. When the master node fails, the backup node is promoted to the new master node.
2. The railway video high-availability monitoring cascade system based on sharing and collaboration as described in claim 1, characterized in that, The distributed data sharing awareness Redis layer includes: The state data storage module is used to build a unified state data model for each entity using Redis to store the state data of each entity. The distributed lock module is used to implement a distributed lock using the Redis SETNX and EXPIRE commands. It uses the Redis distributed lock to elect the best national standard management service node of a certain SIP service cluster as the master node, and the best national standard management service nodes of other SIP service clusters as backup nodes. The data message sensing module is used to send messages to the corresponding backup nodes through the master node as the publisher when the status of the connected device changes.
3. The railway video high-availability monitoring cascade system based on sharing and collaboration as described in claim 2, characterized in that, The implementation process of the distributed lock module is as follows: A) The optimal national standard management service node of all the SIP service clusters starts up and competes for the distributed lock representing the "master node identity"; B) Determine the contention lock result of the optimal national standard management service node of all the SIP service clusters. If the contention lock result is yes, proceed to step C); if the contention lock result is no, the optimal national standard management service node of the SIP service cluster becomes a backup node. C) The optimal national standard management service node of the SIP service cluster becomes the master node, acquires the lock and sets a duration, and resets the lock's expiration time through the Redis EXPIRE command, and periodically renews the heartbeat; D) The master node executes its business logic based on the set lock, duration, and expiration time; E) The master node is periodically renewed during operation, every t seconds, to renew the distributed lock; F) When the master node fails to renew the lock in time, Redis automatically expires the lock and the master node releases the lock; G) All standby nodes detect lock release and proceed to step B).
4. The railway video high-availability monitoring cascade system based on sharing and collaboration as described in claim 1, characterized in that, The business service layer includes: Configure a service cluster for user permission verification and unified management of configuration information; The storage service cluster is used to store historical video streams collected by the device or the lower-level platform layer; based on the configuration information of the configuration service cluster, it responds to scheduling instructions, retrieves historical video streams, and sends them to the streaming media service cluster; The streaming media service cluster is used to send scheduling instructions to the storage service cluster or obtain real-time video streams from the device or lower-level platform layer based on video requests sent by the corresponding optimal national standard management service node; to replay historical video streams and generate standard playback media streams; to send a portion of the obtained real-time video streams or standard playback media streams to the client; and to transmit the remaining real-time video streams to the storage service cluster for storage.
5. A railway video high-availability monitoring cascade system based on sharing and collaboration as described in claim 1, characterized in that, The load balancing process between the gateway service cluster and the protocol access layer is as follows: The client sends a login request to the gateway service cluster; The gateway service cluster sends the virtual IP address of the proxy registration service cluster to the client based on the login request; The client sends a login request to the proxy registration service cluster based on a virtual IP address; The proxy registration service cluster dynamically determines the optimal national standard management service node of the SIP service cluster based on the health status and real-time load of the national standard management service node in the SIP service cluster, and sends routing requests to the corresponding optimal national standard management service node. The optimal national standard management service node returns a response to the agent registration service cluster; The agent registration service cluster returns a response to the client.
6. The railway video high-availability monitoring cascade system based on sharing and collaboration as described in claim 1, characterized in that, The agent registration service cluster is also used to reconstruct SIP signaling using a back-to-back user agent mode to achieve intelligent redirection registration to the optimal national standard management service node.
7. A railway video high-availability monitoring cascade system based on sharing and collaboration as described in claim 6, characterized in that, The intelligent redirection registration process of the agent registration service cluster is as follows: Initial registration phase: The device or lower-level platform layer sends a SIP Register request to the proxy registration service cluster; The proxy registration service cluster sends a SIP service node status request to the distributed data sharing awareness Redis layer; The distributed data sharing awareness Redis layer returns the health status and real-time load of the SIP service cluster; The agent registration service cluster adopts an intelligent decision-making algorithm to dynamically determine the optimal national standard management service node of the SIP service cluster based on the health status and real-time load of the national standard management service node of the SIP service cluster. The agent registration service cluster reconstructs SIP signaling using a back-to-back user agent mode, reconstructs and forwards registration requests from the device or lower-level platform layer to the optimal national standard management service node of the SIP service cluster; The optimal national standard management service node of the SIP service cluster returns a registration success response signal to the agent registration service cluster; The agent registration service cluster will return a registration success response signal to the device or the lower-level platform layer; Normal operation phase: The device or lower-level platform layer sends a registration or heartbeat signal to the optimal national standard management service node of the SIP service cluster; The optimal national standard management service node of the SIP service cluster updates its health status and real-time load to the distributed data sharing awareness Redis layer in real time. Failover scenario: The optimal national standard management service node of the SIP service cluster sends a node failure or high load signal to the agent registration service cluster. The proxy registration service cluster sends the node status of the optimal national standard management service node of the SIP service cluster to the distributed data sharing awareness Redis layer; The device or lower-level platform layer sends the next registration or heartbeat signal to the agent registration service cluster; The proxy registration service cluster sends a national standard management service node status request from the SIP service cluster to the distributed data sharing awareness Redis layer to re-query available nodes; The distributed data sharing awareness Redis layer returns the optimal national standard management service node of the SIP service cluster; The agent registration service cluster reconstructs SIP signaling using a back-to-back user agent mode, reconstructs and forwards registration requests from the device or lower-level platform layer to the new optimal national standard management service node of the SIP service cluster; The new optimal national standard management service node returns a registration success response signal to the agent registration service cluster; The agent registration service cluster will return a registration success response signal to the device or the lower-level platform layer; Subsequent communication from the device or lower-level platform layer will be redirected to the new optimal national standard management service node of the SIP service cluster.
8. A method for cascading high-availability railway video monitoring based on shared collaboration in a railway video high-availability monitoring system, characterized in that, include: The proxy registration service cluster provides a virtual IP address to the outside world as the target address for registration or login; When logging in via client: The client sends a login request to the gateway service cluster; based on the login request, the gateway service cluster sends the virtual IP address of the proxy registration service cluster to the client; the client then sends a login request to the proxy registration service cluster based on the virtual IP address. The proxy registration service cluster dynamically determines the optimal national standard management service node in the SIP service cluster based on the health status and real-time load of the national standard management service node in the SIP service cluster, and sends routing requests to the optimal national standard management service node to perform login services. When performing smart redirection registration for a device or a lower-level platform: Initial registration phase: The device or lower-level platform layer sends a registration request to the proxy registration service cluster; the proxy registration service cluster sends a SIP service node status request to the distributed data sharing awareness Redis layer; the distributed data sharing awareness Redis layer returns the health status and real-time load of the SIP service cluster; based on the health status and real-time load of the national standard management service node of the SIP service cluster, the proxy registration service cluster dynamically decides the optimal national standard management service node of the SIP service cluster; the proxy registration service cluster reconstructs the SIP signaling using a back-to-back user agent mode, reconstructs and forwards the registration request from the device or lower-level platform layer to the optimal national standard management service node of the SIP service cluster; The optimal national standard management service node of the SIP service cluster performs the registration business. During normal operation: the device or lower-level platform sends heartbeat or signaling signals to the optimal national standard management service node of the SIP service cluster; The optimal national standard management service node of the SIP service cluster updates its health status and real-time load to the distributed data sharing awareness Redis layer in real time. When a client initiates a video request: the client sends the video request to the gateway service cluster, and the gateway service cluster, based on the video request, sends the virtual IP address of the proxy registration service cluster to the client; The client sends a video request to the proxy registration service cluster based on the virtual IP address sent by the gateway service cluster; The proxy registration service cluster sends the video request to the optimal national standard management service node of the SIP service cluster; the optimal national standard management service node sends the video request to the business service layer for user permission verification; After the permission verification is successful, the stored historical video stream is obtained through the optimal national standard management service node of the business service layer or the real-time video stream is obtained from the device or the lower-level platform layer and sent to the client. The distributed data sharing awareness Redis layer uses Redis distributed locks to elect the best national standard management service node of a certain SIP service cluster as the master node, and the best national standard management service nodes of other SIP service clusters as backup nodes. When the master node fails, the backup node is quickly promoted to the new master node.
9. A processing device, characterized in that, It includes computer program instructions, wherein when the computer program instructions are executed by the processing device, they are used to implement the steps corresponding to the railway video high availability monitoring cascade method based on sharing and collaboration as described in claim 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, are used to implement the steps corresponding to the shared and collaborative railway video high-availability monitoring cascade method of claim 8.