Coal bed gas remote monitoring system
Technical Field
The invention relates to a remote monitoring system, in particular to a coal bed gas remote monitoring system.
Background
Coal bed gas is regarded as clean energy and is valued by various countries. China has abundant fossil energy, wherein coal bed gas is associated energy of coal, the storage amount is considerable, and the total resource storage amount of shallow coal bed gas is third in the world. The main component of the coal bed gas is methane, the heat value is high, and the products after full combustion are carbon dioxide and water. In the traditional coal mining operation, coal bed gas is usually directly discharged, resources are greatly wasted, and safety accidents are easy to occur, so that the economic benefit can be increased by mining the coal bed gas in advance, and the safety of coal mining can be improved. The current common method is manual inspection, which wastes huge manpower and material resources, and the inspection effect is not satisfactory. Therefore, a set of reliable and stable remote monitoring system applied to coal bed gas operation sites is necessary, the system can timely upload abnormal conditions of all scattered mining sites to a central control room, workers can timely and accurately generate hidden dangers, the problems are solved, the purpose of safety production is achieved, the situations of false alarm and missed alarm are reduced, meanwhile, the system can be guaranteed to be capable of quickly responding to the abnormal conditions, and the fault rate of the system is reduced.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide a coal bed gas remote detection system which is used for intelligently monitoring the coal bed gas exploitation field condition. The coal bed gas distribution condition is considered and combined on the spot, so that the mining well stations are mostly located in remote mountain areas, the roads are rugged, and the distribution is scattered. If the system networking depends on the traditional wired transmission video mode, the wiring is very difficult, the cost is higher, the wiring cost is reduced by adopting the wireless transmission mode, the system networking is more facilitated, but the problem of flow cost generated in the wireless transmission process needs to be considered, so the system adopts the wireless networking mode, meanwhile, in order to save the flow cost generated in the actual operation, the abnormal condition of processing the image is realized at the acquisition end, and when no abnormal condition occurs, a picture is uploaded at regular time; when an abnormal condition occurs, the image with the abnormal condition is immediately uploaded to the server to display the alarm working mode.
The invention aims to provide a coal bed gas remote detection system, which comprises:
the acquisition end is divided into hardware and software running in the ARM, so that the functions of acquiring real-time image information of an exploitation field, judging whether an abnormal condition occurs after processing, and keeping communication with the server are realized;
a networking system; and
and the server comprises server monitoring end software which is used for displaying the on-site monitoring condition in a manner understood by people after the on-site monitoring condition is sent to the monitoring end and automatically alarming for abnormal conditions.
Preferably, the hardware of the acquisition end comprises an infrared camera, a power supply module, a router, an ARM processor and a peripheral interface circuit, the infrared camera adopts a FW18J-V2 model camera, converts real-time image information of a monitoring site into an electric signal from an optical signal, the power module consists of a solar cell panel and a storage battery and realizes stable power supply, the ARM processor is an Exynos4412 chip, the peripheral interface circuit mainly comprises various interface circuits, a video decoding circuit and a communication control circuit, the interface circuit expands a network port, a usb interface, a BNC interface and a UART interface, the video decoding circuit adopts a TVP5150 chip to convert an analog signal into a digital signal so as to realize the data connection between the infrared camera and the ARM processor, the communication control circuit adopts a DM9621ANP chip as a chip and controls the transmission of Ethernet data.
Preferably, the router of the acquisition end is a quad F3425 industrial-grade router, and uses a 3G network.
Preferably, the software running in the ARM implements functions of image acquisition, anomaly detection and data communication, adopts C language, runs on a Linux system carried by the ARM, and adopts multithreading technology, including a main thread, an image acquisition processing thread, an image sending thread, a command receiving thread and a watchdog thread, wherein the main thread implements parameter and memory allocation initialization, starts the watchdog thread, sets network communication parameters, starts monitoring and waits for connection, at the moment, the image acquisition processing thread and the image sending thread are not established, the system starts normal work after the host computer connection sends a command, if the program fails to enter infinite loop or waits all the time, the program is automatically restarted, if the acquisition end is completely paralyzed, the software watchdog fails, the whole system cannot be restarted, at the moment, the hardware watchdog is required to restart the whole acquisition end, the command receiving thread is an inlet of a software system working normally, an acquisition end waits for a connection request of an upper computer at any time, after connection is established, an upper computer command is received, an image acquisition processing thread and an image sending thread are started, the command receiving thread adopts an epoll model, the image acquisition processing thread comprises initialization of a camera, allocation of an image storage memory and an image acquisition processing part, a picture acquired by the camera is transmitted into an ARM after format conversion, after algorithm processing, if an abnormal condition is found, the frame picture is compressed, whether the sending thread is idle is checked, and if the sending thread is idle, the compressed picture is pressed into a sending buffer area and the sending thread is informed to send the frame picture to a monitoring end; if the detected picture is not abnormal but reaches the timing time, the picture is compressed and whether the sending thread is idle is checked, if the sending thread is idle, the compressed picture is pressed into a sending buffer area and the sending thread is informed to send the picture to the monitoring end.
Preferably, the image sending thread and the image acquisition processing thread adopt an interlocking mechanism to ensure the accuracy of data sending.
Preferably, the networking system adopts a virtual private network technology, namely a VPN technology under a 3G technology, a wireless router with a VPN function is configured at an acquisition end, each acquisition end can be regarded as a VPN client, a monitoring end is regarded as a VPN server, the router allocates a static IP address for a client ARM to realize accurate transmission of data, 30 client segment addresses are allocated to allocate a certain tunnel IP address range, a user name and a password are set at the same time to specify the VPN server address, the static IP of the monitoring end is adopted as the server address in the system, group members are required to be added in the VPN server, a communication tunnel with the client is established after verification of the user name, the password and the tunnel IP of the client, the VPN network card is designed as a double network card, when the client sends data to the server, a VPN gateway checks a target address as the server address and then packages a datagram in a VPN, at the moment, the destination address of the data packet is the address of the server VPN external gateway, the data packet is sent to the server VPN gateway through the Internet, the data packet is detected to come from the client VPN gateway, the data packet is unpacked according to a VPN protocol and sent to a server computer, and at the moment, the data obtained by the server is similar to the data directly obtained from the client.
Preferably, the server includes:
(1) a login module: the user logs in the verification function, so that the safe operation of the system is ensured, and the non-working personnel is prevented from operating and using the system;
(2) a preview module: the display function of the well station pictures is realized, the number of well stations monitored simultaneously is selected, and a specific well station is selected and monitored;
(3) a configuration module: setting a file storage path, registering and canceling a user, and remotely controlling functions of a well station;
(4) a playback module: well station monitoring pictures are played back, so that the operators can conveniently review the previous conditions of the well station, and the monitoring work is conveniently carried out;
(5) a log module: and the storage and viewing functions of the system working log and the alarm log.
Preferably, the database storage model of the server adopts an ER conceptual model to express the relationship and the attribute of the recorded object, wherein the user information comprises a user name and a login password, and has a viewing authority for the image and a storage and viewing authority for the log; the image information comprises three parts of an image name, a storage position and an attribute, wherein the attribute is divided into three parts of an image source, acquisition time and whether the image source is abnormal or not; the log information comprises three parts of log name, type and storage position, and the type is divided into two parts of a working log and alarm information; the well station information comprises three parts of window numbers, IP addresses and equipment names, and pictures uploaded by a well station acquisition terminal are analyzed, displayed and stored by monitoring software, and meanwhile log information is recorded.
Preferably, the CDlgLogin class corresponding to the user verification dialog box of the login module inherits from the MFC dialog box class, and includes two member variables m _ usrPwd and m _ usrName of the CString character string type, and the display of the user verification dialog box is realized by the main dialog box class cameraserver dllg class of the system; the preview module comprises a Menu bar, a well station equipment tree, a preview window and a log information display window, wherein the Menu bar is a CMenu type of an MFC and comprises preview, playback, log, configuration, window number and a log information display window, a Menu bar is drawn by declaring a Menu type member function m _ Menu in a main dialog box type and calling a Menu item loading command and a display command in a main dialog box initialization function, so that the switching function among the modules is realized, a CDlgOutput type corresponding to the preview window inherits a self-base type CDialog type and comprises member variables such as a window number, a handle, a window image, a socket and the like, and each display window is an object of the CDlgOutput type, so that the switching of multiple windows is realized. The well station equipment tree mainly realizes the management of well stations, and four well stations are divided into a group and are arranged and divided according to the last two bits of the equipment IP addresses. The log information display window realizes real-time display of log information, and is convenient for workers to check the working state of the system in time; the playback module creates a new thread function SearchPic (LPVOID pParam), opens a playback dialog box by clicking an opening button of a playback menu item in a menu bar and through menu-like COMMAND messages, searches recorded image data by setting viewing time and site number, and the system works by recording the recording time, storage path, site number and storage name of the received image data in a picture _ Tb table; the log module is divided into two parts of log information and alarm information, switching between the log information and the alarm information is realized through a type selection dialog box in a Dlglog dialog box, and information meeting conditions is searched and displayed by accessing a log _ Tb table after a viewing time interval is set; the configuration module is designed into three parts of local configuration, user management and remote configuration, and corresponds to a dialogs module of the Dlgconfig class, the local configuration mainly sets basic parameters, the user management mainly comprises the registration of a new user and the deletion of the existing user information, and the remote configuration is to send a command to a site to read pictures or restart equipment.
The overall work flow of the system is as follows: the method comprises the steps that a collecting end camera collects field images of a well station, abnormal information in an image sequence is detected through an image processing program in an ARM chip of the collecting end, and when abnormal conditions such as intrusion of people or vehicles occur, the frame of image compression mark is sent to a monitoring end through a wireless network to be displayed and alarmed.
The invention has the beneficial effects that:
the invention reduces the working intensity of workers, controls the wireless flow cost brought by data transmission in the operation process of the system, only transmits abnormal scene pictures in the working process except sending real-time pictures at regular time, so that the workers do not need to manually monitor the situation of each scene for a long time to judge whether the scene is normal, and the system gives an alarm for the abnormal situation.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Drawings
Some specific embodiments of the invention will be described in detail hereinafter, by way of illustration and not limitation, with reference to the accompanying drawings. The same reference numbers in the drawings identify the same or similar elements or components. Those skilled in the art will appreciate that the drawings are not necessarily drawn to scale. The objects and features of the present invention will become more apparent in view of the following description taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a diagram illustrating a system architecture according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating acquisition side hardware architecture according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a configuration of a camera according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a power module architecture according to an embodiment of the present invention;
FIG. 5 is a flowchart of an image acquisition processing thread according to an embodiment of the present invention;
FIG. 6 is a flow diagram illustrating an image sending thread according to an embodiment of the present invention;
FIG. 7 illustrates a network communication topology according to an embodiment of the invention;
FIG. 8 is a diagram illustrating a design of a monitoring software module according to an embodiment of the present invention.
Detailed Description
Referring to fig. 1, a system architecture diagram is shown, and an object of the present invention is to provide a coal bed methane remote detection system, including:
a collection end;
a networking system; and
and (4) a server.
The design of the acquisition end is divided into a hardware design and a software design running in an ARM. The acquisition end automatically acquires real-time image information of an exploitation field, judges whether an abnormal condition occurs after processing, and has a communication function with the server.
And (3) designing hardware of a collection end:
the acquisition end mainly realizes image acquisition, processing and communication functions, a hardware architecture of the acquisition end is shown in figure 2 in order to meet the requirements of the functions, an FW18J-V2 type camera is adopted as an infrared camera, as shown in figure 3, the type camera can adapt to a severe working environment, real-time image information of a monitoring site is mainly converted into an electric signal from an optical signal, and a power supply module is composed of a solar cell panel and a storage battery as shown in figure 4, so that stable power supply can be realized.
The ARM processor is an Exynos4412 chip, has low power consumption and high performance, can meet the image processing requirement, and mainly processes the acquired images and realizes communication control; the peripheral circuits are mainly various interface circuits, video decoding circuits and communication control circuits. The interface circuit mainly expands interfaces such as a network port, a usb, a BNC, a UART and the like, and a TVP5150 chip is adopted by the video decoding circuit, so that analog signals can be converted into digital signals, and the data connection between the infrared camera and the ARM processor is realized; the communication control circuit adopts a chip which is a DM9621ANP chip and can control the transmission of Ethernet data. The chip supports IEEE802.3U100BASE-TX and IEEE802.310BASE-T standards, supports TCP/IP transmission and has the highest data operation speed of 480 Mbps.
In order to realize the networking of the coal bed gas mining site, each acquisition end needs to be provided with a router to realize the communication connection with the server. And considering the actual condition of the field communication signal intensity, the router adopted by the acquisition end is a four-channel F3425 type industrial-grade router, and a 3G network is used to realize transparent data transmission. Has the following characteristics:
1. the industrial design is adopted, the device has the characteristics of high stability and high precision, the temperature of the working environment is reversed to-35-75 ℃, and the device can be suitable for the severe environment in the field and realize stable networking.
2. The industrial-grade 32-bit CPU has the Flash capacity of 8MB and the SCRAM capacity of 64MB, and can meet the requirements of large-data-volume wireless transmission of pictures, videos and the like.
3. The bandwidth allocation mode can be set according to the network protocol type and the client, and the flow and the bandwidth setting are managed.
4. On the basis of the common VPN, PPTP servers, L2TP servers, OpenVPN servers and OpenVPN client supports are expanded and added, and various network security application deployment schemes are provided.
5. Have the metal protective housing, realize the isolation of communication assembly and other modules in scene.
Designing a program of a collection end:
the program design of the acquisition end mainly aims at realizing the functions of image acquisition, abnormality detection and data communication, adopts C language and runs on an ARM-carried Linux system. In order to realize multifunctional coordination and process various affairs in time, a multithreading technology is adopted. The system mainly comprises a main thread, an image acquisition processing thread, an image sending thread, an order receiving thread and a watchdog thread. The main thread mainly realizes parameter and memory allocation initialization, starts a watchdog thread, sets network communication parameters, starts monitoring and waits for connection. At the moment, the image acquisition processing thread and the image sending thread are not established, and the system starts to work normally after the upper computer is connected to send a command. The watchdog thread is a software watchdog implementation mode, timing dog feeding is needed during program running, and if a program fails to enter an infinite loop or waits all the time, the program is automatically restarted. If the acquisition terminal is completely paralyzed, the software watchdog is invalid and cannot restart the whole system, and at the moment, the hardware watchdog is required to restart the whole acquisition terminal. The watchdog mechanism can effectively ensure the software of the acquisition end and the stable operation of hardware. The command receiving thread is an inlet of the software system working normally, the acquisition end waits for a connection request of the upper computer at any time, receives an upper computer command after connection is established, and starts the image acquisition processing thread and the image sending thread. The command receiving thread adopts the epoll model. The image acquisition processing thread mainly comprises the parts of camera initialization, image storage memory allocation, image acquisition processing and the like, pictures acquired by the camera are transmitted into the ARM after format conversion, and after algorithm processing, if abnormal conditions are found, the frame of pictures are compressed and whether a sending thread is idle is checked, and if the sending thread is idle, the compressed pictures are pressed into a sending buffer area and the sending thread is informed to send the pictures to a monitoring end; if the detected picture is not abnormal, but the timing time is reached, the picture is compressed and whether the sending thread is idle is checked, if the sending thread is idle, the compressed picture is pressed into a sending buffer area and the sending thread is informed to send the picture to the monitoring end, and the algorithm flow is shown in fig. 5. The image sending thread realizes the function of data communication between the acquisition end and the monitoring end, and the algorithm flow is shown in fig. 6. The multithreading of the Linux platform is supported by the Pthread library, and the main operations are creation, waiting and quitting. The image sending thread and the image acquisition processing thread adopt an interlocking mechanism, so that the accuracy of data sending is ensured, and the situation that the frame of picture data is not sent completely and another frame of picture data is pressed into a sending buffer area to cover the data which is not sent can be avoided.
Networking technology: virtual private network technology is employed. Because the data to be transmitted can be safely sent to the monitoring end, and the selected 3G technology is considered, the VPN technology is selected, the cost is low, only a certain flow fee needs to be paid, and the method is divided into PPTP, L2TP and IPSec according to the tunnel technology. The purpose of system networking design is to realize centralized monitoring of 30 well stations on site, wireless data connection is required to be established between acquisition ends of 30 well stations and a monitoring end, in order to realize safe data transmission by utilizing VPN technology, a wireless router with a VPN function is configured at the acquisition ends, each acquisition end can be regarded as a VPN client, the monitoring end is used as a VPN server, the router allocates a static IP address for an ARM (advanced RISC machine) of the client to realize accurate data transmission, 30 client section addresses are allocated, a certain tunnel IP address range is allocated, a user name and a password are set at the same time, a VPN server address is designated, and the static IP of the monitoring end is used as a server address in the system. And adding group members in the VPN server, and establishing a communication tunnel with the client after verifying the user name, the password and the tunnel IP of the client. The VPN network card is designed as a dual network card, when a client sends data to a server, a VPN gateway checks that a destination address is a server address, then VPN packaging is carried out on the datagram, at the moment, the destination address of a data packet is an external gateway address of the server VPN, the data packet is sent to the server VPN gateway through the Internet, the check data packet comes from the client VPN gateway, the data packet is unpacked according to a VPN protocol and sent to a server computer, at the moment, the data obtained by the server is similar to the data directly obtained from the client, and a network topological graph is shown in figure 7.
Designing a server:
the system mainly comprises a server monitoring end software design, the field monitoring condition can be displayed in a human understanding mode after being sent to the monitoring end, the abnormal condition can be automatically alarmed, and the monitoring of the coal bed methane well station is achieved. The monitoring software module is shown in fig. 8, wherein the login module realizes a user login verification function, ensures the safe operation of the system and prevents non-working personnel from operating and using; the previewing module realizes the display function of well station pictures, selects the number of well stations monitored simultaneously and selects and monitors a specific well station; the configuration module realizes the functions of setting a file storage path, managing user registration and logout and remotely controlling a well station; the playback module is used for playing back the well station monitoring picture, so that the operators can review the previous conditions of the well station conveniently, and the monitoring work is facilitated; the log module realizes the storage and viewing functions of the system working log and the alarm log.
(1) Designing a database storage model: monitoring end software needs to realize the function of monitoring and storing 30 well station monitoring pictures for a long time, the data volume is large, meanwhile, monitoring well station information, user information, working logs, alarm information and other data are stored in the monitoring software, the data are various in types, an ER conceptual model is adopted to express the relation and the attribute of a recorded object, wherein the user information comprises a user name and a login password, the monitoring end software has viewing authority for images, and the monitoring end software has storage and viewing authority for logs; the image information comprises three parts of an image name, a storage position and an attribute, wherein the attribute is divided into three parts of an image source, acquisition time and whether the image source is abnormal or not; the log information comprises three parts of log name, type and storage position, and the type is divided into two parts of a working log and alarm information; the well station information comprises three parts of window numbers, IP addresses and equipment names, and pictures uploaded by a well station acquisition terminal are analyzed, displayed and stored by monitoring software, and meanwhile log information is recorded.
(2) Designing a login module: the system is an entrance for realizing login user verification, a CDlgLogin class corresponding to a user verification dialog box inherits from an MFC dialog box class, and two member variables m _ usrPwd and m _ usrName of a CString character string type are mainly included. The display of the user verification dialog box is realized through a main dialog box class CameraServerDlg class of the system.
(3) Designing a preview module: the system is a main interface for system operation, realizes image display and well station selection functions, and mainly comprises a menu bar, a well station equipment tree, a preview window and a log information display window. The CMenu class of which the Menu bar is the MFC mainly comprises Menu items such as preview, playback, log, configuration, window number, logout and the like, and the Menu bar is drawn by declaring a Menu class member function m _ Menu in the main dialog box class and calling a Menu item loading command and a display command in a main dialog box initialization function, so that the switching function among all modules is realized. The CDlgOutput class corresponding to the preview window inherits the self-base class CDialog class and comprises member variables such as window numbers, handles, window images and sockets, and each display window is an object of one CDlgOutput class, so that switching of multiple windows is realized. The well station equipment tree mainly realizes the management of well stations, and four well stations are divided into a group and are arranged and divided according to the last two bits of the equipment IP addresses. The log information display window realizes real-time display of log information, and workers can check the working state of the system conveniently in time.
(4) Designing a playback module: the method realizes the survey of past records, does not influence the normal work of the system monitoring thread, and creates a new thread function SearchPic (LPVOID pParam). By clicking an open button of a playback menu item in a menu bar, a playback dialog is opened through a menu-like COMMAND message, and recorded image data is searched for by setting a viewing time, a station number. The system works in such a way that the recording time, the storage path, the station number and the storage name of the received picture data are recorded in the picture _ Tb table, so that the searching efficiency is improved.
(5) Designing a log module: the method comprises the steps of dividing the log information into two parts, namely the log information and the alarm information, switching the log information and the alarm information through a type selection dialog box in a Dlglog dialog box, and searching and displaying information meeting conditions by accessing a log _ Tb table after setting a viewing time interval.
(6) Designing a configuration module: the method comprises three parts of local configuration, user management and remote configuration, and the dialog modules correspond to the Dlgconfig class. The local configuration mainly sets basic parameters, such as storage paths of pictures and logs; the user management mainly comprises the registration of a new user and the deletion of the information of the existing user; remote configuration is to send commands to the site to read pictures or restart the device. The configuration module can enable a user to realize some basic settings of the monitoring software, and data management and user information management are performed in a more intuitive mode.
The overall work flow of the system is as follows: the method comprises the steps that a collecting end camera collects field images of a well station, abnormal information in an image sequence is detected through an image processing program in an ARM chip of the collecting end, and when abnormal conditions such as intrusion of people or vehicles occur, the frame of image compression mark is sent to a monitoring end through a wireless network to be displayed and alarmed.
The working intensity of workers is reduced by the system, wireless flow cost brought by data transmission in the operation process of the system is controlled, abnormal scene pictures are only transmitted in the working process except that real-time pictures are sent at regular time, therefore, the workers do not need to manually monitor the situation of each scene for a long time to judge whether the scene is normal or not, the system gives an alarm to the abnormal situation, meanwhile, the flow control can be effectively realized by the working mode, the system is well suitable for monitoring scenes for coal bed gas exploitation, the interference of reciprocating motion of the water pump on abnormal detection is eliminated, the abnormality caused by human or vehicle intrusion can be timely and accurately detected, and meanwhile, the safety and the real-time performance of the system meet the requirements of the real-time monitoring system.
While the present invention has been described with reference to the particular illustrative embodiments, it is not to be restricted by the embodiments but only by the appended claims. It will be understood by those skilled in the art that variations and modifications of the embodiments of the present invention can be made without departing from the scope and spirit of the invention.