Disclosure of Invention
The invention aims to solve the problem of limitation in the conventional dynamic loop monitoring system and provides a dynamic loop video monitoring method for superposing real-time data and alarm information.
The technical scheme of the invention is as follows:
a dynamic loop video monitoring system with real-time data and alarm information superposed comprises an upper computer and a dynamic loop host computer; the dynamic ring host comprises a dynamic ring data monitoring module and a video monitoring module; the upper computer is used for storing and displaying the state and the alarm information of the equipment monitored by the movable ring host, and configuring and setting the equipment accessed by the movable ring host; the dynamic loop data monitoring module is used for acquiring the state of the access equipment, judging whether an alarm is generated or not, responding to the configuration of the upper computer and controlling the access equipment; the video monitoring module performs function setting on the corresponding IPC according to the file of the video equipment; the upper computer and the dynamic ring data monitoring module establish communication through a tcp protocol, the upper computer is a server end of the tcp protocol, and the dynamic ring data monitoring module is a client end of the tcp protocol; the dynamic ring data monitoring module and the video monitoring module establish communication through a tcp protocol, the dynamic ring data monitoring module is a server end of the tcp protocol, and the video monitoring module is a client end of the tcp protocol; and the upper computer is communicated with the video monitoring module through an http protocol.
Furthermore, the upper computer and the moving ring data monitoring module complete service interaction through an interface B.
Meanwhile, the invention also provides a dynamic loop video monitoring method for superposing real-time data and alarm information, which comprises the following steps:
1) establishing tcp communication connection between the dynamic ring data monitoring module and the video monitoring module;
2) the video monitoring module initiates a registration request to the dynamic ring data monitoring module;
3) after the registration is successful, the dynamic ring data monitoring module issues a video equipment file to the video monitoring module to configure the video equipment;
4) the video monitoring module receives a data packet sent by the dynamic ring data monitoring module, wherein the data packet comprises a real-time data packet and/or an alarm information data packet; the real-time data packet and the alarm information data packet both comprise corresponding code numbers;
5) the video monitoring module analyzes and processes the data packet;
the video monitoring module analyzes the real-time data packet to acquire real-time data information to be superposed;
the video monitoring module analyzes the alarm information data packet to acquire alarm information to be superposed;
6) according to the code number in the data packet, the video monitoring module executes corresponding service and uploads the service to an upper computer;
the service comprises alarm linkage video recording, alarm linkage snapshot and/or important real-time data superposition video of a machine room;
the alarm linkage video recording comprises setting an osd title channel and then overlaying alarm information on a video picture;
the alarm linkage snapshot comprises setting an osd title channel and then overlaying alarm information to a snapshot picture;
the important real-time data superposition video of the computer room comprises real-time data contents which need to be displayed by setting an osd channel, and the real-time data contents are superposed on a video picture or a snapshot picture;
the video monitoring module determines the video recording duration or the number of the candid shots according to the video recording duration parameter in the alarm information data packet, takes out the video pictures or the candid shots which are overlapped with the alarm information and/or the real-time data from the IPC through ffmpeg, and uploads the video pictures or the candid shots to the upper computer through an http protocol and displays the video pictures or the candid shots;
7) the video monitoring module replies whether the execution result of the dynamic ring data monitoring module is successful after executing the corresponding service;
8) returning to the step 4), receiving and analyzing the next data packet.
Further, if the real-time data packet processed in step 5) is a real-time data packet, the following steps are further included between step 5) and step 6): the video monitoring module firstly judges whether ip addresses of all associated IPCs in the configuration file of the mobile ring host exist or not, and if yes, display contents of an osd channel are set; if not, two osd channels are created for the IPC, and then the ip address of the IPC and the osd channel number successfully created are written into a configuration file.
Further, in step 4), the dynamic loop data monitoring module sends the acquired data packets to the video monitoring module in a json format at regular intervals.
Further, in step 4), the dynamic loop data monitoring module sends the data collected to the machine room to the video monitoring module in a json format data packet mode every 10 seconds
Further, in the step 4), the alarm information data packet includes alarm information, a cradle head preset point, a video recording time and/or a snapshot number.
Further, in step 6), the service executed by the video monitoring module further includes determining whether the video archive is updated and/or IPC timing is performed.
Further, in step 6), it is determined whether the video file is updated as follows: if the information of the video equipment is changed, the information is added or reduced, the dynamic loop data monitoring module judges that the video file is updated and informs the video monitoring module, and after the video monitoring module receives the video file updating service, the video monitoring module updates the IP address, the user name and the password of the IPC again and stores the IP address, the user name and the password in the original global variable.
Further, in the step 4), the real-time data packet includes an alternating voltage value of the machine room and/or an acquisition value of the temperature and humidity sensor.
The invention has the advantages that:
1. the method adopts an ONVIF protocol integrated video monitoring sub-module and an ffmpeg to fetch and push the stream to an upper computer in a moving-loop monitoring internal program, so that IPCs of a plurality of mainstream manufacturers can be accessed, OSD functions are supported, important real-time data of sensors in a machine room and alarm linkage information are superposed on a video to be displayed, and then a video or a snap picture triggered by alarm linkage and a real-time video stream of the machine room are directly pushed to the upper computer for a monitoring center to view; meanwhile, IPC timing function, cloud deck preset point setting and other functions are supported, and the moving-loop video integrated monitoring system is realized.
2. The system supports the network camera access which accords with ONVIF and RTSP standards and a plurality of mainstream manufacturers, and is not limited to IPC manufacturers; meanwhile, the OSD function is supported, the font size, position and color of the OSD can be set, and the video is uploaded to an upper computer after the current warning information and important real-time data of a machine room or a base station are superposed; the method supports alarm linkage IPC to capture pictures and videos, stores the pictures and videos in a local SD, uploads the pictures and videos to an upper computer, and can check the pictures and the videos through the upper computer; the retrieval and playback of the video or the picture are supported on the upper computer according to the time; when the alarm linkage local video is supported, the IPC carries out video recording or snapshot after the IPC is transferred to the corresponding position according to the cradle head preset point.
Detailed Description
The technical scheme of the invention is clearly and completely described in the following with the accompanying drawings of the specification.
As shown in fig. 1, the dynamic loop video monitoring system with superimposed real-time data and alarm information includes an upper computer and a dynamic loop host (FSU), where the dynamic loop host includes a dynamic loop data monitoring module (dmp) and a video monitoring module (video). The upper computer is used for storing and displaying states and alarm information of all equipment monitored by the movable ring host (FSU), and meanwhile, equipment accessed by the movable ring host (FSU) can be configured and set; the dynamic loop data monitoring module is used for acquiring the states of all devices connected below the dynamic loop data monitoring module, judging whether an alarm is generated or not, responding to the configuration of the upper computer and controlling the corresponding operation on the access devices; the video monitoring module performs functions of OSD character setting, rotation, video stream or picture acquisition and the like on the corresponding IPC according to the file of the video equipment.
The upper computer establishes tcp communication with the dmp, the upper computer is a server end of the tcp, the dmp is a client end of the tcp, and interaction of various services is completed through a B interface. The video and the dmp belong to the FSU, asynchronous communication is established between the video and the dmp through the tcp, the dmp is used as a server end of the tcp, the video is used as a client end of the tcp, and service interaction is carried out according to the protocol. And when the video is recorded or is uploaded to the upper computer after snapshot, the upper computer and the video are communicated through an http protocol.
As shown in fig. 2, a method for monitoring a moving-loop video by overlapping real-time data and alarm information includes the following steps:
1) establishing tcp communication connection between the dynamic ring data monitoring module and the video monitoring module;
2) the video monitoring module initiates a registration request to the dynamic ring data monitoring module;
3) after the registration is successful, the dynamic ring data monitoring module issues a video equipment file to the video monitoring module to configure the video equipment;
4) the video monitoring module receives a data packet sent by the dynamic ring data monitoring module, wherein the data packet comprises a real-time data packet and/or an alarm information data packet; the real-time data packet and the alarm information data packet both comprise corresponding code numbers; after receiving the real-time data packet and/or the alarm information data packet, the video monitoring module can go through different services;
5) the video monitoring module analyzes and processes the real-time data packet and/or the alarm information data packet;
the video monitoring module analyzes the real-time data packet to acquire real-time data information to be superposed;
the video monitoring module analyzes the alarm information data packet to acquire alarm information to be superposed;
6) according to the code number in the data packet, the video monitoring module executes corresponding service and uploads the service to an upper computer; the service comprises alarm linkage video recording, alarm linkage snapshot and/or important real-time data superposition video of the machine room;
the alarm linkage video recording comprises the steps of setting an osd title channel and then overlaying alarm information on a video picture;
the alarm linkage snapshot comprises setting an osd title channel and then overlaying alarm information on a snapshot picture;
the important real-time data superposition video service of the computer room comprises the real-time data content which needs to be displayed by setting an osd channel, and the real-time data content is superposed on a video picture or a snapshot picture;
the video monitoring module determines the video recording duration or the number of the candid shots according to the video recording duration parameter in the alarm information data packet, takes out the video pictures or the candid shots which are overlapped with the alarm information and/or the real-time data from the IPC through ffmpeg, and uploads the video pictures or the candid shots to the upper computer through an http protocol and displays the video pictures or the candid shots;
7) the video monitoring module replies whether the execution result of the dynamic ring data monitoring module is successful after executing the corresponding service;
8) returning to the step 4), receiving and analyzing the next data packet.
The interaction between dmp and video will be described in detail below.
Because the video module is integrated in the program of the FSU, the integration of the dynamic loop and the video is really realized, and an ONVIF protocol and a transplanted FFMPEG open source library are adopted as the basis for developing the video module based on an ARM platform.
Firstly, tcp communication connection between the dmp and the video is established, the video registers to the dmp, and after the registration is successful, the dmp issues a video equipment file to the video, the configuration of the video equipment can be configured on the upper computer page, and the configuration of the video files issued differently is different.
Secondly, after the registration is successful, the video serving as the client end of the tcp waits for receiving the data packet message of the dmp in a circulating manner, wherein the data packet comprises a real-time data packet and/or an alarm information data packet, and if a data packet is sent, the video analyzes the data packet. And executing specific services according to the analyzed code number, wherein the services comprise judging whether the video file is updated or not, alarm linkage video recording, alarm linkage snapshot, IPC time correction, important real-time data superposition video of a machine room and the like.
If only a real-time data packet is received, analyzing and acquiring data information to be overlaid on the video from the data packet, then firstly judging whether an osd channel needs to be created or not according to the mode of viewing the configuration file in the prior art, then setting real-time data contents to be displayed by two osd channels, and completing the overlaying of the real-time data on a video picture.
If an alarm information data packet is received at the moment, after the alarm information is analyzed and obtained from the data packet, an osd header channel is directly set, the alarm information is superposed on a video picture, then the video time length or the number of candid shots is determined according to the video time length parameter in the alarm information data packet, the video picture or the candid shot picture on which the alarm information and the real-time data are superposed is taken out from an IPC through ffmpeg (because the real-time data packet is sent to a video at regular intervals of 10 seconds, the real-time data can be superposed on the video picture all the time, and the alarm information data packet is sent only when the alarm occurs), and the video picture or the candid shot picture is uploaded to an upper computer through an http protocol, and finally the video file or the picture with the superposition of the real-time alarm information and the real-time data can be seen on the.
Finally, because the dmp and the video adopt the tcp asynchronous communication mode, after the video receives the data packet and analyzes the data packet, the dmp execution result is replied to be successful or not according to the code number after different services are executed.
The service for judging the update of the video file is specifically as follows: if the information of the video equipment is changed or the video equipment is added or reduced, the video file sent by the upper computer is changed, at the moment, the dmp judges that the video file is updated and then informs the video, and after the video receives the video file updating service, the service is executed to update the ip address, the user name and the password of the IPC again and store the ip address, the user name and the password in the original global variable.
The following focuses on the alarm linkage service (realizing that alarm information is superimposed on a video picture) based on the ONVIF protocol and the service that real-time data of a machine room is superimposed on a video picture.
The alarm linkage is divided into two forms of video recording and snapshot, when an alarm occurs, the dmp sends parameters such as alarm information, a cradle head preset point, video recording duration or snapshot number and the like to the video (specifically which alarm event is linked with which camera, the selection of the cradle head preset point is configured on the page of the upper computer) in the form of a json data packet, the video analyzes the json data packet, after the initialization of the IPC is completed, the video is rotated to a corresponding preset position according to the preset point, then the alarm information is superposed on an osd channel of the original IPC title, and then the video recording or the snapshot is carried out according to the video recording duration parameter or the snapshot number. Judging whether the sd card exists before video recording or snapshot, and if not, not carrying out video recording or snapshot. Because the code stream from the IPC is a 264 bare stream and is uploaded to an upper computer to support playing on a web page, the code stream from the 264 is packaged into an MP4 format after being fetched by using FFMPEG, and then the file is written and stored on an sd card and then uploaded to the upper computer. And after the uploading is successful, deleting the file corresponding to the sd card, otherwise, storing the file in an sd card backup directory. For the management of the sd card, if the space of the sd card is insufficient, a circular coverage mode is adopted.
The real-time data packet comprises an alternating voltage value of a machine room or an acquisition value of a temperature and humidity sensor and the like; the important real-time data of the computer room are superposed on the service of the video, the important real-time data collected by the computer room are sent to the video by the dmp in a json-format data packet form every 10 seconds, after the service is analyzed, the video firstly judges whether all related IPCs on a mobile ring host (FSU) have established osd channels (whether a certain IPC establishes an osd channel or not according to the IP address and the created token of the IPC stored in the FSU system configuration file, if the IP address of the IPC in the configuration file exists, the IPC establishes a new osd channel on the FSU, at the moment, the osd channel is not established, only the display content of the osd channel is set, if the IP address of the IPC does not exist in the configuration file, two osd channels are established for the IPC, after the establishment is successful, the IP address of the IPC and the successfully established osd channel number are written into the configuration file, and the IPC is taken as the next time when the IPC needs to establish the osd channel according to the emergency response to the sudden interruption of the power supply or the emergency of the FSU operation of the computer according to the Accident caused by sequential operation) only two osd channels are created, and the mains voltage value and the temperature and humidity value of the current machine room are respectively displayed at the position of the upper left of the video picture according to two lines. If the machine room has two FSUs, the real-time data of the two FSUs monitoring the machine room are alternately displayed every few seconds at all IPC upper-left positions of the machine room.
The above is the main flow of the monitoring system for realizing integration of the dynamic ring and the video, and after the video or the picture is uploaded to the upper computer, the page of the upper computer can be searched, downloaded and checked according to time.