Communication Technology and Application of Seismic Precursor Network Instrument

In this paper, the communication technology of seismic precursor network instrument is introduced, including instruction format and returned information format of instrument login, status information acquisition, and current measured data acquisition. The remote monitoring alarm software is based on this technology, and also introduced that the structure of monitoring information table, abnormal alarm index, and monitoring strategy. The application of the software raises instrument running rate and observation data quality.


Introduction
Through digital seismic observation network projects, Tianjin seismic precursor network, from network to the station, distributed database to station, IP to device can monitor and control precursor observation instrument remotely.Realized gathering instrument data and realtime monitoring instrument's status and property, by which remote change the parameters and adjust the working status of instrument, and can control basic instrument calibration [1][2][3].
During seismic precursor network instrument running, always following system halted, clock error and wrong data and so on, having a bad effect on instrument running rate and data quality.
For this reason, according stipulation on geoscience observatory network in China, we compiled the software to monitor network instrument remotely and alarm by C#, to identify and solve problems in time and improve running rate and data quality of instrument [1][2][3].

Network Instrument Communication Technology
Stipulation on geoscience observatory network in China is a network communication interface enacted for precursor observation instrument.It detailed prescribes the precursor network instrument's communication interface, device information, running function, data format, communication protocol and access security control protocol, etc.It is an essential communication protocol for network precursor instrument [1][2][3].
The data communication of client and instrument is conducted by Ethernet and Socket based on TCP/IP protocol.Client sends request to instrument, realizes the control of instrument and exchange of data information.Instrument accepts and responds the instruction from client, then implements the corresponding action to complete the data information exchange with client; instrument can be regard as server [1][2][3].System.Net.Sockets namespace in C# provides related class for writing network application programs like Socket, TcpClient, and Net Work Stream and so on.
Socket class is used in management connection, to realize Berkeley sockets interface.TcpClient class is based on the Socket class, allows creating and using TCP connection.Net Work Stream class deals specifically with data stream of network form, receipts object parameter of Socket class, and operate network data access [1][2][3].

Detect Instrument Network Status
Using C# call ping command (ping -n 1 192.168.1.2) to detect connection of network, it is an easy way.
In the output stream, "(0% loss)" indicates that the network is smooth, "Ping request could not find host" indicates that ping request could not find host, "Request timed out or (100% loss)" indicates ping request timed out.

Login Instrument
Client and instrument establish connection through instruction mode, according to user name and password authenticates identity [1][2][3]

Get instrument Status Information
Instrument status information includes instrument running environment, running results, abnormalities and various controllable status information [1][2][3].Send instruction format: get /length+ID+ste /http/1.1Among them, ste: the command word to get instrument status information.
Return message format: $message length of status information data packet\n content of status information data packet\n ack\n Content of status information data packet: length, instrument clock, clock status, instrument zero, DC power supply status, AC power supply status, self-calibration switch status, zero switching status, the number of events triggered, abnormal alarm status and custom status.
The content and format of instrument status information sees Table 1.

Get Current Measured Data
The current measured data is the latest 5-minutes sample.
Send instruction format: get /length+ID+dat+5 /http/ 1.1 Among them, dat: data transfer command word.Return message format: $message length of data pack-et\n content of data packet\n ack\n

Network Instrument Monitoring Alarm Software
Client monitoring alarm software finds out instrument abnormal, sounds alarm and writes the instrument status information and current measured data into oracle 10g distributed database, by detecting instrument network status, collecting instrument status information and current measured data [4][5][6].
The work flow chart of remote monitoring alarm software sees Figure 1.

Design the Structure of Instrument Monitoring Information Table
In the oracle database, the instrument monitoring information table "Monitor" is used to store instrument status information and current measured data.

Abnormal Alarm Index
When the network instrument has the abnormal situation as following, client software will sound alarm.
Ping instrument host, if return "Ping request could not find host, Request timed out or (100% loss)", indicate that the instrument is no network.
Instrument clock and client computer clock have a difference of more than 3 minutes, then need to adjust instrument clock.
For example: On August 30, 2010, the operator on duty found that Xu Zhuangzi wyy-1 meteorological instrument was faster 4 minutes than client computer, then entered the instrument web page 192.168.1.3,manually modified the instrument clock and restarted it.Note: client computer calibrates inner clock through time server 192.168.1.4.
Instrument DC power status is 1, indicates abnormal presence, such as: DC power failure.
Instrument AC power status is 1, indicates abnormal presence, such as: AC power failure.Instrument abnormal alarm status takes a byte, the corresponding 8 bits from high to low represent power failure, clock exception, unauthorized access, event trigger, storage exception, abnormal measured data, and custom alert status.The any position is 1, indicates corresponding abnormal presence.
Using aggregate functions "max, min, sum, count", and group statement "group by", to count measured data that has been put in storage, to get max value, min value, variation amplitude and average value [8,9].
If the variation amplitude is over than threshold, that means abnormal situation.Such as well water level exceeds 1 m, well water temperature or auxiliary temperature of geomagnetic observation room exceeds 1℃, total intensity of geomagnetic relative record, vertical component or horizontal component exceeds 20 nT, air temperature exceeds 20℃, atmospheric pressure exceeds 30 hPa and so on [8,9].

Monitoring Strategy
Monitoring methods include manual mode and automatic mode.Manual monitoring may monitor network instrument at any time by click a button; automatic monitoring need to set a monitoring interval, namely, every few minutes to monitor once.
The software uses multi-threading technology, assigns a thread for each instrument, thus the execution time is foreign to the number of instrument, reducing software running time and improving software efficiency.

Conclusions
Using seismic precursor network instrument communication technology and oracle distributed database reading and writing technology, we have developed monitoring alarm software, which catches the instrument abnormal information initiatively, makes a sound to alarm, and provides the technology support for finding and solving instrument's problem, and improves the instrument's running rate and data quality effectively, and enhances the Tianjin seismic precursor network running management level [8,9].
On appraisal of national earthquake precursor network, Earthquake Administration of Tianjin Municipality obtained the first place on "System Running" and the secnd place on "Output and Application" in 2009, obtained the first place on "System Running" and the first place on "Output and Application" in 2010, obtained the second place on "System Running" and the first place on "Output and Application" in 2011, achieved excellent results, and produced good social benefits.o

Acknowledgements
This research was supported in part by methods research and application for operation and management of regional seismic precursor network in Tianjin under Grant No. XH12004 and in part by earthquake precursor monitoring network and data management platform for research based on WebGIS under Grant No. 09ZCKF-SF00700 and in part by Tianjin seismic safety foundation engineering "precursor instrument renovation project".

Figure 1 .
Figure 1.The work flow chart of remote monitoring alarm software.