Online Monitoring and Transmission System for Lightning Detection Network

—Lightning detection data is a kind of distributed information with high real-timeliness. After the lightning events are detected by the lightning detection network, the original detection data need to be collected and concentrated rapidly and timely for unified management and processing. In this paper, an online monitoring and transmission system for lightning detection information is presented. The system consists of two major components: the remote monitoring module and the response & transmission module. File system watcher (FSW) tool and the trigger mechanism are applied to the remote monitoring module to watch the generation of lightning detection data both in file directory or database. And then the newest origin detection data can be transmitted to the detection center of the lightning detection network by the response & transmit module based on the communication network. The proposed system is developed and exemplified in Wuhan lightning detection network, China. The application results indicates that the system is reliable and reasonable in the online monitoring and transmission for lightning detection data, which can provide a strong support to the lightning detection network.


INTRODUCTION
Lightning is a kind of weather phenomena which can cause huge destruction in a very short time. In recent years, lightning disasters have brought serious threats to the people's lives and properties [1]- [2]. Nowadays, with the acceleration of urbanization, humans are more and more intensely depend on the electric power, communication and microelectronics equipment. As a result, the scope of lightning disaster is expanding and the form of it becomes more and more complex [3]. In order to reduce the loss and impact that caused by lightning disasters, significant attention has been given towards the prevention and control researches of lightning such as lightning localization [4]- [5], loss assessment [6], mechanism analysis [7], et al. All these research topics above can hardly carry out without the original detection data of lightning. Thereby, the accessing approach of lightning detection data is the basis of the lightning disaster prevention work, and also the top priority for lightning disasters research.
Generally, lightning detection data can be obtained by the lightning detection network. Lightning detection network is a kind of comprehensive lightning information acquisition and management platform that involves a series of work such as lightning detection, lightning information collection and transmission, lightning detection data collection and organization, etc. As lightning detection network plays a very important role in the lightning disasters research [8], the Meteorological Department and the Ministry of Labor of many countries have established large-scale projects of lightning detection network [9]- [10]. According to the existing projects, the lightning detection network is composed of several lightning detection stations that are distributed in the field and a detection center which is built for data management. All the detection stations and detection center are connected by the wired or wireless communication network. After the lightning events are detected, the original detection data are stored in the local hosts on detection stations which are scattered in different locations. None of these original data can be applied to the lightning localization or analysis research until they have been collected and transmitted to the detection center for the centralized storage [11]. In the previous researches, the generation of new detection data are usually monitored and responded by the operators at each station in manual ways. However, lightning detection data are always massive with high real-timeliness. In the extremely case, the density of thunderstorms could up to over 30 times per minutes. As a result, a large amount of detection data may be generated in a short period of time at multiple detection stations, which leads to the poor performance and low efficiency in the artificial monitoring and transmission method.
In order to improve the traditional data collection approach for lightning detection work, this paper tries to design and develop an online monitoring and transmission system at the detection center. This system can provide a continuous remote monitoring from the detection center to each station based on the communication network between them, and then collect all the generated data at the detection center automatically. On the basis of that, the real-time processing for the origin detection data can be achieved.

II. SYSTEM REQUIREMENTS
After a lightning event has been detected by the detection station in the lightning detection network, the original lightning information, which include the occurring time, polarity, amplitude and so on, is recorded in the lightning detection data. The lightning detection data are first stored in the local host of the detection station. There are many storage modes for the detection data. The detection information of lightning could be written into a data file and stored in the local directories, or a relational database could be established for lightning PAPER ONLINE MONITORING AND TRANSMISSION SYSTEM FOR LIGHTNING DETECTION NETWORK detection data, and the lightning information is stored as data rows in the database table, as is shown in Fig.1  After been detected, the original lightning information is separated in different detection stations with no correlation between each other, which will bring significant difficulties to the application of detection data in lightning disasters prevention works such as lightning localization. Take the Time of Arrival (TOA) method for lightning localization as instance. In a thunderstorm, one single lightning event may be detected by the antennas on more than one detection stations, thus generate several detection data for one lightning event. Detection data from at least two stations are required in the TOA method. As a result, the detection data from the distributed stations need to be collected together and stored in the database at the detection center of the lightning detection network. In this way, the lightning localization system or any other lightning analysis system can directly access the detection data from all stations in the database, which can bring great convenience to the data calculation and analysis work in the lightning prevent researches.
In order to realize the high efficiency and automation data collection and transmission for the origin detection data, the online monitoring and transmission system is designed in the detection center, as is shown in Fig.1. According to the generation and storage mode of lightning detection data, this system must be able to meet the following requirements: 1) Provide continuous online monitoring on multiple remote detection stations at the same time: As the lightning localization and analysis system always require data form multiple detection stations, and the lightning detection data may be generated at any stations and any moment in the thunderstorm, real-time online monitoring is necessary for each detection station. Meanwhile, continuous monitoring can ensure that all the generated data are exhaustively considered during the thunderstorm and without omission.
2) Make timely responses to generated data, whether they are stored in data files or data table rows: In the realtime lightning prevention work, long delay of any original detection data may affect the implementation of the realtime lightning localization and analysis. Due to the high request of the transmission efficiency, after a new detection data is generated in a detection station, the generated data need to be picked out and transported to the detection center immediately and dynamically by the online monitoring system in this paper. As the data storage mode may be different in the detection stations, the data accessing method for different storage path should be both considered in the system.

III. DESIGN AND DEVELOP OF THE ONLINE MONITORING AND TRANSMISSION SYSTEM
The online monitoring and transmission system is an integrated system which is based on remote monitoring for data file, trigger mechanism of relational database and data transmission in network environment. In order to achieve the second developing for the technologies above and provide an excellent visual interaction interface with users, the system is implemented by the .NET framework and the Oracle database management system.

A. Design of the Functions
The online monitoring and transmission system is comprised of two main functional modules based on the system requirements, and the functional structure of the system is given in Fig.2.  Remote Monitoring Module: the file directories or data tables in the detection stations are being monitored by the remote monitoring module in the online monitoring and transmission system from the side of detection center. If a new lightning event is detected by one or more detection stations, this module can make an immediate response for the generated original detection data of the lightning event in all relevant detection stations, and send a message that PAPER ONLINE MONITORING AND TRANSMISSION SYSTEM FOR LIGHTNING DETECTION NETWORK contains the data information of the generated data (IP address of detection station, filename or the raw ID in the data table, et al) to the response and transmit module.
Response and Transmission Module: the response and transmission module is first in a waiting state. When a new message from the remote monitoring module arrives, the response and transmit module accesses the generated data at the detection station according to the information (IP address, filename or row ID) in the message. And then transport the generate data to the detection center by the communication network and import the data into the center database in an active way.
Only some initialized settings (monitoring directory, transmission port and storage path settings) are needed to start the remote monitoring in the online monitoring and transmission system. Once the system modules are in the active states, new detection data in each detection station will be responded and transported to the detection center automatically without any manual operation. Thus thoroughly save the time for the manually operation in the traditional data collection approach for lightning detection work, and fulfill the requirement of data transmission efficiency in the real-time lightning prevention work.

B. Develop of the Remote Monitoring Module
The key aspect of remote monitoring module is determine whether there is a new lightning detection data is generated in the remote detection stations from the detection center. According to the storage mode of the origin detection data, the generated data could be a new data file that is created in a specified directory, or a new row in the data table of detection database. Therefore, two remote monitoring methods especially for two generated data formats are designed and developed in the remote monitoring module, respectively.

1) Remote monioring for data file
The remote monitoring for data file can be accomplished by using the FSW tool in the .NET framework. FSW is able to listen to the file system change notifications for a specified directory, and raise event when the file in the directory changes. Several properties need to be set when we create a new FSW tool, as is shown in the Table I.  The monitoring path of FSW could be any accessible directory on the local host or a remote computer in the network environment. As in lightning detection network, all the detection stations are connected with the detection center by the communication network. An online FSW for the directory in any remote detection center can be created by the setting the value of Path as follows: [Path]= "\\ [IP]\\ [Directory]" Where [IP] is the IP address of the local host on the detection station, [Directory] is the directory path in the remote computer that needs to be monitored online.
FSW tool provides different events for different types of changes in file. For example, the Changed Event occurs when the attributes of file in the directory that is being watched changes. These attributes include the size of file, last write and access time of the file, et al, which can be regulated by the NotifyFilter property. Developer can add an event handler for each type of event, and specify the response process for the event in the method of event handler. As a new data file will be created for the new detected lightning event in the detection station, the event handler for Created Event is applied to the development for remote monitoring module. In the detection center of the lightning detection network, the remote monitoring module can monitor the specified directory on a remote detection station by creating a new FSW. Once there is new data file is generated in the directory, a new Created Event of FSW will be raised, and the response and transmission operation for the generated data can be completed within a short time by the event handler.
2) Remote monitoring for data table The remote monitoring for data table is actual a remote database management and control method for lightning detection information. In this study, Oracle 10g is selected as the database management system of the lightning detection network, and the trigger mechanism is introduced in the implementation of the remote monitoring for data table.
Trigger is a special kind of stored procedure in the database management system, which is mostly used for maintaining the integrity of the information on the database. The procedure of trigger mechanism is not started by a program or the operator in manual way, but automatically triggered by the events on a particular table or view in the database. These events could be divided into two categories: the data manipulation language (DML) events and the data definition language (DDL). The former include Insert, Delete and Update statements on rows in a data

C. Develop of the Response and Transmission Module
After a new generated original detection data has been detected, the response and transmission module will receive a data information message from the remote PAPER ONLINE MONITORING AND TRANSMISSION SYSTEM FOR LIGHTNING DETECTION NETWORK monitoring module. The primary objective of the response and transmission module is to achieve the online transmission for the new detection data according the information in this message. Based on the TCP/IP protocol and database link tool, the response and transmission components both for data file and data table are designed and developed.

1) Response and Transmission for data file
As the response and transmission operation for a generated data is completed by the event handler of the FSW tool, the response and transmission module for data file can be designed in the method body of event handler, which will be executed instantly after a new Created Event is raised, as is shown in Fig.3.  In the event handler of FSW, the file transfers between the detection stations and detection center can be implemented by the socket class provided by .NET framework. Socket class is kind of Application Programming Interface for data transmission based on the Client/Server(C/S) structure. In the lightning detection network, the connections between the detection stations (Clients) and the detection center (Server) can be established as following: Listening on the Server: After sockets are created both on the detection station and detection center, make the socket on the detection center listen for the request from the client on a specific port.
Request from the Clients: The sockets on the detection stations can send connection requests to the server by using the Connect method in the Socket API.
Connection Confirmation: The socket on the detection accepts the requests from the clients by using the Accept method in the Socket API, and then the connections are confirmed.
Once a connection is established, the transmission for data file between the detection station and detection center can be accomplished by adopting the Sendfile and Recvfile method that provided by the Socket API. When the transmission is completed, the sockets between the client and server sides can be disconnected by the Closesocket method, and then the generated original detection data in the file can be imported into the center database on the detection center for scientific management.
Based on the multi-thread technology, the online monitoring and transmission system also realizes the parallel transmission for generated data file. The response and transmission procedures of each data file are performed by an independent thread. In this way, multiple generated data can be responded and transported to the detection center simultaneously. 2

) Response and Transmission for data table
The response procedure for data table is actual the rowbased online replication between the detection database and center database, which can be implemented by the SQL statement in the [Response Statement] of the trigger.
As the trigger is created in the detection database, it does not have the Insert privilege to add a new row to data table on the center database of the detection center. Therefore, a database link between two Oracle databases need to be created based on the following statement:

IV. CASE STUDY AND RESULTS
For case study, the online monitoring and transmission system was tested both on a simulate network and the lightning detection network of Wuhan, China.

A. Case Study 1
The case study was first carried out on three computers in the Local Area Network (LAN) as a virtual lightning detection network. These three computers with same hardware and software configuration were defined as Computer A, B and C. The online monitoring and transmission system and an Oracle database were installed and established on the Computer A, which served as the local host of the detection center. Then, an online monitoring for data file was created in order to monitor the generation of detection data in a directory on Computer B, which was considered as a detection stations in virtual lightning detection network. Fig.4 shows the interface of the remote monitoring module for data file.  As shown in Fig.4, the operator in Computer A can edit the IP address, network port and the monitoring path of the monitor for data file by using the input auxiliary tools on the interface. Up to 4 (this number can be further extended) online monitors can be created to monitor 4 different directories on one or more detection stations at the same time. When a new data file was created in the monitoring path, the response and transmission work for generated file would be automatically completed by the response and transmission component in the background. Relevant information of the response and transmission procedure would be also listed in the information window.
In order to validate the applicability of the online monitoring and transmission system for data file, ten data files that had the same storage format with the original detection data file were created in the monitoring directory on Computer B, the detail information of each data file are given in Table II. After the data files had been created, the response and transmission status in the information window is demonstrated in Fig.5. Figure 5. the response and transmission results for data file In Fig.5, there are ten response reports in the information window, which indicates that every data files that were created in the monitoring path had been successfully transmitted. Because of the low latency in the LAN, the generated data had been imported into the database in Computer A almost at the same time with the data generation.
On the other hand, an Oracle instance served as the detection database was established in Computer C at the same time. And the online monitoring and transmission for data table was also simulated between Computer A and C. The interface of the remote monitoring module for data table is given in Fig.6. Figure 6. The interface of the remote monitoring module for data table As shown in Fig.6, the system was monitoring a data table on the database in the Computer C. The connection parameters of database and the name of monitoring table were both determined in the visual interaction interface. Similar to the former test, ten rows were inserted into the monitoring table on the detection database, and the response results were shown in Fig.7.  Fig.8, it is obviously that all the generated rows had been responded and added to a specified data table on the center database by the system. In summary, the application results in case study I can prove that the monitoring and transmission system can provide simultaneous monitoring for the generated data both in data file or data table on remote detection stations.

B. Case Study 2
The proposed system in this paper was also applied to the actual lightning detection network in Wuhan, China. This lightning detection network is composed by a detection center located in the campus of Huazhong University of Science and Technology and eight detection stations which are distributed in the urban district and surrounding towns of Wuhan city. The detail information of every detection station is given in Tab III.  Table  Jiangxia  Data file   Dongxihu  Data Table  Huanggang Data Table   Xinzhou Data Table  Xiaogan Data Table   Huangpi Data Table  Hanchuan Data file Based on the private communication network between detection center and detection stations, the online monitoring for new lightning detection data on each stations were established by the online monitoring and transmission system that was installed on the detection center. In order to compare the actual performances of our system with the traditional data collection approach for lightning detection work, we conducted a thunderstorm simulation experiment in March 2014. In this experiment, 60256 pieces of lightning detection data were generated in the detection stations within 4 hours. Two data table were created to receive the lightning detection data that were collected by the proposed system and traditional approach, respectively. The performances of these two methods in the data collection and concentration work for lightning detection network can be illustrated by recording the number of rows in two data tables. The statistical results of the experiment are listed in Table IV. As shown in Table IV, each generated lightning detection data had been successfully inserted into the data table on the detection center by the system in this paper, the transmission work for over 90 percent of generated data were finished in 10 seconds after the lightning occurred. On the other hand, 1532 pieces of lightning detection data were lost during the data collection process of traditional approach, and only 26.23 percent of generated data had been transferred to the detection center in 10 seconds. The application results show that the system proposed in this paper can provide more efficient and effective remote monitoring and transmission for lightning detection data than the traditional ways, which could greatly improve the quality of the data collection and concentration work in lightning detection network.

V. CONCLUDTIONS
This paper proposes an online monitoring and transmission system which can provide remote monitoring and online transmission for the lightning detection data. According to the requirements of system, the remote monitoring module and response and transmission module are designed and developed based on the .NET framework and Oracle 10g. Some of the core concepts and methods such as the FSW tool, trigger mechanism and Socket API are also outlined in details. The system proposed in this paper is successfully applied to the lightning detection network in City of Wuhan, China. The results demonstrate the potential applicability of the online monitoring and transmission system to real-time collection and concentration for the lightning detection data, which is able to achieve a powerful support to the prevention researches for lightning hazards.