The rotating ring video monitoring system and method for real time data and warning information superposition
Technical field
The present invention relates to power & environment supervision technologies, and in particular to a kind of rotating ring video prison of real time data and warning information superposition
Control system and method.
Background technique
With the rapid development of computer networking technology and transmission technology, video monitoring is based on real-time and visually
Advantage, gradually forms complementary with power & environment supervision system, becomes a submodule of power & environment supervision system, to obtain increasingly wide
General application provides bigger convenience for the management of computer room and O&M.
The SDK that the combination of power & environment supervision system and video monitoring at this stage generally provides IP Camera (IPC) is carried out
Secondary development, to realize the upload of video interlink or computer room real time status video.But there are certain offices for such mode
It is sex-limited, for example all exist centainly to the dependence of IPC producer, the networking situation of master station, the control of IPC and management etc.
Limitation.For example, first, rely on the producer of IPC, if it is the SDK that Haikang provides, then just only have access the IPC of Haikang,
The IPC of his producer cannot then be accessed;Second, the limitation to platform, for example, Haikang SDK portable in the system of x86, still
The exploitation of arm platform is not supported;Third, control and management aspect limitation to IPC, the development interface that SDK is provided, certain functions
It does not support.
Summary of the invention
Present invention aim to address confinement problems present in existing power & environment supervision system, provide a kind of real time data
With the rotating ring video monitoring system and method for warning information superposition.
The technical scheme is that
A kind of rotating ring video monitoring system of real time data and warning information superposition, including host computer and rotating ring host;Institute
Stating rotating ring host includes rotating ring data monitoring module and video monitoring module;The host computer is for storing display rotating ring host institute
The state and warning information of monitoring device, and the equipment that configuration and setting rotating ring host are accessed;The rotating ring data monitoring
Module is used to acquire the state of access device, judges whether to generate alarm, while responding the configuration of host computer and controlling access and setting
It is standby;The video monitoring module carries out function setting to corresponding IPC according to the archives of video equipment;The host computer and rotating ring
Data monitoring module establishes communication by tcp agreement, and the host computer is the end server of tcp agreement, the rotating ring data prison
Control module is the end client of tcp agreement;The rotating ring data monitoring module and video monitoring module are established logical by tcp agreement
Letter, the rotating ring data monitoring module is the end server of tcp agreement, and the video monitoring module is the client of tcp agreement
End;Pass through http protocol communication between the host computer and video monitoring module.
Further, pass through the interaction of B interface finishing service between the host computer and rotating ring data monitoring module.
Meanwhile the present invention also provides the rotating ring video monitoring methods that a kind of real time data and warning information are superimposed, including with
Lower step:
1) the tcp communication connection between rotating ring data monitoring module and video monitoring module is established;
2) video monitoring module initiates registration request to rotating ring data monitoring module;
3) after succeeding in registration, rotating ring data monitoring module issues video equipment archives to video monitoring module, carries out video
The configuration of equipment;
4) video monitoring module receives the data packet that rotating ring data monitoring module is sent, and data packet includes real-time data signal
Packet and/or warning information data packet;It include corresponding No. code in the real-time data signal packet and warning information data packet;
5) video monitoring module carries out dissection process to data packet;
Video monitoring module parses real-time data signal packet, obtains the real time data information for needing to be superimposed;
Video monitoring module parses warning information data packet, obtains the warning information for needing to be superimposed;
6) according to No. code in data packet, video monitoring module executes corresponding business, and is uploaded to host computer;
The business includes alarm linkage video record, alarm linkage is captured and/or the important real time data superposition view of computer room
Frequently;
Alarm linkage video record includes setting osd headline channel, and then warning information is added to video pictures
On;
It includes setting osd headline channel that the alarm linkage, which is captured, and then warning information is added to and captures on picture;
The important real time data overlay video of computer room needs real time data content to be shown including the setting channel osd, and
Real time data content is superimposed upon video pictures or is captured on picture;
Video monitoring module determines video recording duration or candid photograph number according to the video recording duration parameters in warning information data packet,
The video pictures or candid photograph picture of superimposed warning information and/or real time data are taken out from IPC by ffmpeg, are passed through
Http agreement is uploaded to host computer and shows;
7) video monitoring module replys whether rotating ring data monitoring module implementing result succeeds after executing corresponding business;
8) return step 4), execute the reception and parsing of next data packet.
Further, if step 5) processing be real-time data signal packet, further include between step 5) and step 6) with
Lower step: video monitoring module first determine whether in rotating ring host-confg file the address ip of relevant IPC whether there is, if depositing
The display content in the channel osd is then being set;If it does not exist, the channel two-way osd is created to the IPC, then by the address ip of the IPC
And in the successful osd channel number write-in configuration file of creation.
Further, in step 4), rotating ring data monitoring module is at regular intervals by collected data packet with json
Format is sent to video monitoring module.
Further, in step 4), rotating ring data monitoring module every 10 seconds by the data for collecting computer room with json lattice
The data packet form of formula is sent to video monitoring module
Further, in step 4), in warning information data packet include warning information, holder preset, video recording duration and/
Or capture number.
Further, in step 6), video monitoring module execute business further include judge video archive whether update with/
Or when the school IPC.
Further, in step 6), it is specific as follows to judge whether video archive updates: if the information of video equipment is more
Change, information addition or reduce video equipment, rotating ring data monitoring module judge video archive update after notify video monitoring module,
After video monitoring module receives video archive more new business, the address ip of IPC, username and password are updated again,
And it is stored in original global variable.
It further, include the ac voltage and/or temperature and humidity sensing of computer room in step 4), in real-time data signal packet
The collection value of device.
Advantages of the present invention are as follows:
1. the method for the present invention uses ONVIF protocol integration video monitoring submodule and use in power & environment supervision internal processes
Ffmpeg takes stream and plug-flow can thus access the IPC of numerous mainstream vendors to host computer, while supporting osd function, by machine
It is shown in the important real time data of some sensors and the information superposition to video of alarm linkage in room, then alarm is joined
The video recording of dynamic triggering or the picture and computer room live video stream of candid photograph are pushed directly to host computer and check for monitoring center;Simultaneously
The functions such as function, setting holder preset point, realize rotating ring integrated video monitoring system when the support school IPC.
2. present system supports the web camera access for meeting ONVIF, RTSP standard and numerous mainstream vendors, not office
It is limited to IPC manufacturer;It supports osd function simultaneously, the color of the font size of OSD, position and font, video superposition can be set
Host computer is uploaded to after the important real time data of current warning information and computer room or base station;Alarm linkage IPC is supported to grab
Scheme, record a video and be stored in local SD and be uploaded to host computer later, and can check picture and video record by host computer;It supports
The retrieval and playback of video or picture are carried out on host computer according to the time;When supporting alarm linkage local video, IPC
It is recorded a video or is captured after going to corresponding position according to holder preset.
Detailed description of the invention
Fig. 1 is the schematic diagram of the rotating ring video monitoring system of real time data of the present invention and warning information superposition;
Fig. 2 is this hair real time data and the rotating ring video monitoring method flow chart that warning information is superimposed.
Specific embodiment
Technical solution of the present invention is clearly and completely described with reference to the accompanying drawings of the specification.
As shown in Figure 1, real time data and the rotating ring video monitoring system of warning information superposition include host computer and rotating ring master
Machine (FSU), rotating ring host include rotating ring data monitoring module (dmp) and video monitoring module (video).Host computer is for storing
The state and warning information for all devices that display rotating ring host (FSU) is monitored, while can configure and be arranged rotating ring host
(FSU) equipment accessed;Rotating ring data monitoring module is used to acquire the state of its lower all devices accessed, judges whether to produce
Raw alarm, the configuration and control for responding host computer carry out corresponding operation to access device;Video monitoring module is set according to video
Standby archives carry out the setting of OSD text to corresponding IPC, rotation, obtain the functions such as video flowing or picture.
Host computer is established tcp with dmp and is communicated, and host computer is the end server of tcp, and dmp is the end client of tcp, they
Between by B interface complete various businesses interaction.Video and dmp belong to FSU, establish asynchronous lead to by tcp between them
Letter, server end of the dmp as tcp, client end of the video as tcp carry out the interaction of business according to specification.In video
When being uploaded to host computer after video recording or candid photograph, pass through http protocol communication between host computer and video.
As shown in Fig. 2, the rotating ring video monitoring method of a kind of real time data and warning information superposition, comprising the following steps:
1) the tcp communication connection between rotating ring data monitoring module and video monitoring module is established;
2) video monitoring module initiates registration request to rotating ring data monitoring module;
3) after succeeding in registration, rotating ring data monitoring module issues video equipment archives to video monitoring module, carries out video
The configuration of equipment;
4) video monitoring module receives the data packet that rotating ring data monitoring module is sent, and data packet includes real-time data signal
Packet and/or warning information data packet;It include corresponding No. code in the real-time data signal packet and warning information data packet;
After video monitoring module receives real time data packet and/or warning information data packet, different business can be walked;
5) video monitoring module carries out dissection process to real-time data signal packet and/or warning information data packet;
Video monitoring module parses real-time data signal packet, obtains the real time data information for needing to be superimposed;
Video monitoring module parses warning information data packet, obtains the warning information for needing to be superimposed;
6) according to No. code in data packet, video monitoring module executes corresponding business, and is uploaded to host computer;Business
Including alarm linkage video record, alarm linkage is captured and/or the important real time data overlay video of computer room;
Alarm linkage video record includes setting osd headline channel, and then warning information is added on video pictures;
It includes setting osd headline channel that alarm linkage, which is captured, and then warning information is added to and captures on picture;
The important real time data overlay video business of computer room needs real time data content to be shown including the setting channel osd, and
Real time data content is superimposed upon video pictures or is captured on picture;
Video monitoring module determines video recording duration or candid photograph number according to the video recording duration parameters in warning information data packet,
The video pictures or candid photograph picture of superimposed warning information and/or real time data are taken out from IPC by ffmpeg, are passed through
Http agreement is uploaded to host computer and shows;
7) video monitoring module replys whether rotating ring data monitoring module implementing result succeeds after executing corresponding business;
8) return step 4), execute the reception and parsing of next data packet.
The interaction between dmp and video will be described in detail below.
Due to being the integrated video module in the program of FSU, really realize that rotating ring is integrated with video, it is flat based on ARM
Platform, the basis developed using ONVIF agreement and transplanting FFMPEG open source library as video module.
Firstly, establishing the tcp communication connection between dmp and video, video is registered to dmp, after succeeding in registration,
Dmp issues video equipment archives to video, and the configuration of video equipment can configure what difference issued in host computer page configuration
Video archive is just different.
Secondly, after succeeding in registration, video is recycling always etc. the data packet of dmp to be received as the end client of tcp
Message, data packet includes real-time data signal packet and/or warning information data packet, if there is data packet sends over, video into
Row parsing.Specific business is executed according to parsing No. code, which includes judging whether video archive updates, alerts linkage
Video record, alarm linkage capture, the school IPC when, the important real time data overlay video of computer room etc..
If only receiving real-time data signal packet, parsing obtains the data letter to need to be added on video from the data packet
Then in the way of checking configuration file before, it is first determined whether needing to create the channel osd, two osd are then arranged in breath
Channel needs real time data content to be shown, completes real time data and is superimposed upon on video pictures.
If receiving warning information data packet at this time, after parsing obtains warning information in the data packet, directly setting osd
Warning information is added on video pictures by headline channel, then true according to the video recording duration parameters in warning information data packet
Surely video recording duration either capture number, by ffmpeg from IPC by superimposed warning information and real time data (due to reality
When data packet be that data packet was regularly sent every 10 seconds to video, so video pictures can be superimposed always real time data, and alert
Information packet only just sends a warning message when alerting data packet) video pictures or the picture of candid photograph take
Out, host computer is uploaded to by http agreement, finally it can be seen that having Real-time Alarm information and real time data on host computer
The video file or picture of superposition.
Finally, due to using the asynchronous communication means of tcp between dmp and video, in video received data packet solution
After analysis, according to reply dmp implementing result success or not after No. code execution different business.
The business that above-mentioned judgement video archive updates is specific as follows: adding deduct if the information of video equipment is changed or added
Few video equipment, the video archive that host computer issues will be changed, and dmp judges to be notified that video after video archive updates at this time,
After video receives video archive more new business, executes the business and the address ip of IPC, username and password are carried out more again
Newly and it is stored in original global variable.
Alarm linkage business (realize warning information be superimposed on video pictures) of the emphasis explanation below based on ONVIF agreement with
And computer room real time data is superimposed on the business of video pictures.
Alarm linkage is divided into video recording and captures two kinds of forms, and first when there is alarm to occur, dmp is by warning information, holder
Preset and video recording duration capture the parameters such as number are sent to video (which specific announcement in the form of json data packet
Which camera is alert event link, and the selection of holder preset point is in host computer page configuration), video to the json data packet into
Row parsing, after the initialization for completing IPC, goes to corresponding predeterminated position according to holder preset point, is then superimposed warning information
Onto the channel osd of IPC original title, is recorded a video or captured then according to video recording duration parameters or candid photograph number.It is recording
As judging that sd card whether there is if there is no then not recording a video or capture before perhaps capturing.Since the IPC code stream come out is
264 naked stream, upload to host computer to support web page play, so using FFMPEG take stream after by 264 code stream seal
Dress is MP4 format, and then written document is saved on sd card, and then uploads to host computer.After uploading successfully, sd card is corresponded to
File is deleted, and is otherwise saved on sd card backup directory.Management for sd card, if when the insufficient space of sd card, using following
The form of ring cover.
Ac voltage or the collection value of Temperature Humidity Sensor in real-time data signal packet including computer room etc.;Computer room is important
Real time data is superimposed on the business of video, and dmp will collect the important real time data of computer room every 10 seconds with the number of json format
It is sent to video according to packet form, after parsing the business, video first determines whether the related IPC of institute on rotating ring host (FSU)
The channel osd whether has been created (according to the address ip of the IPC saved in FSU system configuration file and the token of creation, to sentence
Whether some IPC that breaks creates the channel osd.If the address ip of the IPC exists in configuration file, illustrate this IPC at this
The new channel osd has been created on platform FSU, no longer creates the channel osd at this time, the display content in the channel osd is only set.Such as
There is no the address ip of the IPC in fruit configuration file, then the channel two-way osd is created to the IPC, by the ip of the IPC after creating successfully
In address and the successful osd channel number write-in configuration file of creation, whether this IPC is wanted when running this FSU as next time
It creates power-off suddenly or artificial terminator in the foundation and reply program operation in the channel osd and runs bring fortuitous event)
Here only create the channel two-way osd, be shown in the upper left position of video pictures according to two rows, show respectively line voltage value with
The temperature and humidity value of current computer room.If the computer room has two FSU, in the upper left position all IPC of the computer room every several
Second alternately display the real time data of this two FSU monitoring computer rooms.
It is above exactly the main flow for realizing the monitoring system of rotating ring and integrated video, on video record or picture
It passes to after host computer, can be retrieved according to the time in the host computer page, download, check video recording or picture.