In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
1. Design principle
The openness and extensibility of VMS system are very suitable for using SOA (Service-oriented Architecture) approach to design.
services exist as physically independent software programs. Each service is endowed with its own unique functional context and consists of a series of capabilities related to that environment. The capability provided by the service is expressed through the service interface (service contract).
According to the reusability, arrangability, autonomy and composability of services, should use the top-down design idea when designing services. When designing the model, we can first design the top-level services, determine the top-level service boundaries, and then design the lower-level sub-services layer by layer.
In terms of service types, services should be divided into three types: entity services, task services and tool services.
VMS services involving media, metadata, system management data (users, permissions) and other entities can be classified as entity services; media sessions, task scheduling and other controller-related services can be classified as task services; network transmission, security encryption, logging and other basic services can be classified as tool services.
uses three service models: entity service, task service, and tool service to build a logical service abstraction layer, as shown in figure 1.
2. Service design of VMS
The design of using SOA for VMS should first focus on the business of video surveillance system. With video data as the core, the infrastructure of a video surveillance system is shown in figure 2:
As an open operation interface of security equipment based on Web service technical standard, ONVIF includes all the functions contained in figure 2. The idea of service design can be used as a reference for VMS design.
analyzes the services defined by ONVIF and can be classified into the following categories:
Device management service (including device IO service): it is the core service defined in ONVIF, which manages and configures equipment parameters, device status and other information. The addresses of other services can be obtained through the device management service. Media service: provides configuration query function for media device-related metadata (video source, video parameters, etc.). The relevant parameters of the video stream can be obtained by using the media service. Equipment control service: PTZ service is mainly provided in ONVIF, which is used to complete the control of capture and camera equipment. Video recording service: mainly includes video recording control and video inquiry service. Video playback service: mainly defines the query and configuration of parameters related to video playback. Access control service: the related operation of access control is defined. Video analysis service: the basic model of video analysis and related service interfaces are defined. Streaming service: define the control protocol, transmission protocol and exchange mode of video and audio media, meta-data stream.
Referring to the service model of figure 2 and ONVIF, follows the design principles and ideas introduced in section 1, taking the flow path of the video stream as the direction, and the related service boundaries and interoperability can be shown in figure 3.
In figure 3, the main service descriptions defined by the task service layer and the entity service layer are as follows: device access (discovery and registration): to realize the discovery and registration of physical devices, to achieve direct interconnection with physical devices using protocols compatible with physical devices, and is the actual operator of physical devices. Equipment management: to realize the configuration and query of equipment parameters and other system data, which is a two-way interoperable relationship with equipment access service. Media configuration: used to configure and query media-related parameters of media devices (such as cameras and DVR), and has a two-way interoperable relationship with device management services. Real-time media stream session control: realize the media session control with the media device, obtain the real-time media stream data of the media device and realize distribution. When used, the media streaming session control service invokes the media configuration and device management services to obtain the relevant parameters. Video recording: realize the function of recording according to the media stream. The video recording service can record video according to the video recording plan or randomly according to the operation of the user. at the same time, the video recording service also provides the video recording query function. The video recording service needs to call the media configuration and device management service to obtain the relevant parameters, and invoke the media streaming session control service to obtain the media stream. Real-time stream browsing: provides real-time monitoring function, and needs to call the media stream session control service to obtain real-time media stream. Video playback: the video playback service can call the video service to query the video information, and directly access the video storage medium to obtain the video data to be replayed. PTZ control: the PTZ control service invokes the device management service (through the device access service) to send PTZ instructions to the monitoring device to realize the user's PTZ control. Access control: access control calls equipment management service (through device access service) to send access control instructions to the door device to realize the user's control of the access control. Video analysis: video analysis service implements the call of real-time media stream session control service and video recording service, and collects real-time stream or video data for video analysis.
Figure 4 of shows the direction of the video stream in the service architecture and the relationship between the service and the physical device, where the thick lines with red arrows represent the video stream and the blue dotted lines represent the association with the physical device.
In figure 4 of , the device access service deals directly with the accessed physical device, using the transport exchange protocol provided by the physical device. In view of the diversity of physical device access protocols (such as SNMP,SIP,SOAP, etc.), it is suggested that different sub-access services should be defined for different access protocols, and the device access service can determine the invoked sub-access service instances according to the type of device access.
, like the device access service, the real-time media stream session control service interacts with the physical device requesting the media stream through a media session protocol supported by the physical device. Different devices may support different media session protocols (such as SIP,RTSP, etc.). It is recommended to define different sub-session control services for different media session protocols. The real-time media streaming session control service selects the called sub-session control service according to the media session protocol supported by the requesting device.
Interoperability between services in the VMS services architecture can be defined using service operation primitives, as described in section 3. 3. Service operation primitive
In VMS, video stream, video recording, device parameters, devices and so on are regarded as different logical entity objects, and the system function can be regarded as the operation of these entity objects. Referring to the CMIS services supported by CMIP (Common Management Information Protocol) used in telecom management network, we can define six abstract service operation primitives in VMS:
VM-CREATE: create related logical entity objects, such as video streams, media configuration entities, security logical entities (such as keystore), network interfaces, video files, etc. VM-CREATE: delete logical entity objects that have been created, such as video streaming, media configuration entities, and security logical entities (such as keystore). VM-GET: gets the relevant parameters and attributes of the logical entity object. VM-SET: sets the relevant parameters and properties of the logical entity object. VM-ACTION: performs an action that can be performed by a logical entity object, such as a media session, a decoding action, and so on. VM-EVENT-REPORT: the service instance sends triggered event messages during operation. 4. Implementation strategy
since martin fowler published that famous micro-service blog article, micro-service architecture has become very popular in the software industry in recent years, and there seems to be a phenomenon that the software architecture design without talking about micro-services is not high-end enough in the domestic software industry. In fact, after a careful analysis of the mode of micro-service, I personally think that micro-service is the refinement and expansion of SOA in the implementation level. When micro-services decompose services into finer granularity, it also brings more complexity to the relationship between decomposed services. Therefore, when using the service-oriented approach to implement VMS, we should also choose the appropriate scheme according to the actual scenario and scale.
4.1 how big is the service?
in the previous software architecture, device access, real-time media streaming session control service and video recording service are the core services in the deployment. Each service is recommended to be designed as a service cluster (the simplest way is to add a load balancer in front of a bunch of service instances), which can be configured and scaled according to the actual scale of the project.
4.2 how data is stored
In VMS, I divide data into control plane data and media data. Video streaming media data can be selected as an open source distributed storage system such as HDFS when the scale is large, and a separate magnetic array can be used when the scale is small.
For the data in the control plane, such as device information, media configuration information and so on, can consider using distributed collaborative systems such as ElasticSearch and etcd because it will be accessed by multiple service instances.
4.3 the implementation of service primitives
In VMS, I recommend that service primitives be defined in the form of Rest Api, so that the HTTP-based restful interface between service instances enables the interoperability of service primitives between services (such as using spring cloud as the service implementation framework).
4.4 how to select a message server
similarly, the message server is determined according to the size of the project. In small-scale scenarios, lightweight message servers (such as redis can be used), and in large-scale scenarios, message cluster services such as kafka can be considered.
4.5 how to choose streaming media middleware
RTSP,SDP,SIP,RTP/RTCP and other streaming media related protocols are involved in VMS. Fortunately, streaming middleware in all languages can be found on github. If you really want me to recommend it, among the products I have used, I think gstreamer is very good.
4.6 Video browsing based on Web
In traditional VMS, video browsing in browsers requires the help of controls written by ourselves. with the emergence of WebRTC technology, mainstream browsers have gradually supported the specification of WebRTC, so it is possible to use WebRTC to realize plug-in-free video browsing. It should be noted that the video encoding format supported by browsers is limited, and transcoding may be required on the server side. In addition, the server side of WebRTC needs to be built as the video source.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.