# A Fault Data Capture Method for Water Quality Monitoring Equipment Based on Structural Pattern Recognition

Hao Yang, Daoliang Li, Yong Liang

► To cite this version:

Hao Yang, Daoliang Li, Yong Liang. A Fault Data Capture Method for Water Quality Monitoring Equipment Based on Structural Pattern Recognition. 7th International Conference on Computer and Computing Technologies in Agriculture (CCTA), Sep 2013, Beijing, China. pp.423-433, 10.1007/978-3-642-54341-8_44. hal-01220853

HAL Id: hal-01220853

https://inria.hal.science/hal-01220853

Submitted on 27 Oct 2015

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# A Fault Data Capture Method for Water Quality Monitoring Equipment Based On Structural Pattern Recognition

Hao Yang<sup>1,2,3,4,5</sup>, Daoliang Li<sup>1,2,3,4,6,*</sup>, and Yong Liang<sup>5</sup>

<sup>1</sup>Key Laboratory of Agricultural Information Acquisition Technology, Ministry of Agriculture, Beijing 100083, P.R. China

<sup>2</sup>Beijing Engineering and Technology Research Center for Internet of Things in Agriculture, Beijing 100083, P.R. China

<sup>3</sup>China-EU Center for Information and Communication Technologies in Agriculture, China Agricultural University, Beijing 100083, P.R. China

<sup>4</sup>Beijing Engineering Center for Advanced Sensors in Agriculture, Beijing 100083, P.R. China

<sup>6</sup>College of Information and Electrical Engineering, China Agricultural University, Beijing, 100083, P.R China

<sup>5</sup>Institute of Informatics Science and Engineering, Shandong Agricultural University, Tai'an, 271018, P.R China

**Abstract.** To capture equipment fault in real time and automate fault diagnosis, a pattern recognition method, based on data eigenvector and TCP transport protocol, was proposed to capture Water Quality Monitoring equipment's fault information. Fault data eigenvector was designed after analyzing the equipment fault feature and capture strategy, structural pattern recognition strategy was confirmed and specific data frame was designed in response to the fault data eigenvector, by integrating the data frame design into the equipment's communication protocol, data related to different fault compiled into fault data frames by transmitters or communication module of equipment's different components, the remote sever captures equipment fault on transport via fault data frames according to the structural pattern recognition strategy. With 7 months of practical application in Taihu aquaculture project and research center of agricultural information technology, combining with historical fault data and contrast with artificial recognition result, the simulate experiment shows this method has higher response rate and process rate with a nice accurate.

**Keywords:** fault data capture, data eigenvector, transport layer, fault filter.

## 1. Introduction

Water quality parameters includes DO (dissolved oxygen), EC (electrical conductivity), SAL(solidity), WT (water temperature), PH and TUR (turbidity), all of these parameters affect deeply to aquaculture management and breeding decision, so collecting water quality parameters is an extremely important work to aquaculture. The Water quality monitoring equipment in the paper is made to collect water quality parameters in time and offer water quality optimization services include SMS warning,

* Corresponding author: Daoliang Li. Email: dliangl@cau.edu.cn
oxygenation and other services. Equipment have been deployed in maricultural
breeding bases and industrial aquaculture in Beijing, Tianjin, Hebei, Shandong,
Jiangsu and Guangdong. Nevertheless, equipment fault prevents farmers from
increasing more reliance on the equipment, researches must be done to develop fault
diagnosis technology and form an integrated strategy.

ANNs requires large amount of sample data for training, as its process is pure
mathematical procedure [1-13]. There are many fault detection methods applied the
support vector machine [14].

Fault detection should be an independent step in fault diagnosis process, fault
diagnosis should base on fault data captured by fault detection step, and serious
redundancy calculations exist in diagnosis process.

## 2. Data Eigenvector analysis

### 2.1 Equipment Faults Description

Equipment faults are divided into five types due to component types. Namely sensor
faults, transmitter faults, actuator faults, GPRS gateway faults and remote server
faults, see fig1.

<figure><img src="image_2.png" /><figcaption>Fig1. Equipment fault tree</figcaption></figure>

When combined with some high-class arithmetic like support vector machine to
solve fault capture task in every node, long training time cost is not acceptable.

### 2.2 Data Eigenvector Related to Different Equipment Faults

To an object represents a specific fault, recognition arithmetic need to judge
whether it contains fault information according data eigenvector, for each fault type,
there is a specific eigenvector and type record; these records are listed in Form 1.

<table><caption>Form1. Data type and eigenvector corresponding to different faults</caption><thead><tr><th>Recognition target</th><th>Data type</th><th>Eigenvectors</th></tr></thead><tbody><tr><td>Uncontrollable</td><td>Actuator state</td><td>Response data and executive result</td></tr><tr><td>No response</td><td>Actuator state</td><td>Response data</td></tr><tr><td>Energy Exception</td><td>M2M state</td><td>Power supply mode &amp; nominal voltage &amp; measured value</td></tr><tr><td>Low storage space</td><td>Device information</td><td>Residual capacity calculated value</td></tr><tr><td>Jennic module exception</td><td>M2M state</td><td>Jennic module reset times</td></tr><tr><td>M2M module exception</td><td>M2M state</td><td>M2M signal value and emission frequency</td></tr><tr><td>Data process error</td><td>M2M state</td><td>Conversion formula</td></tr><tr><td>Wrong clock</td><td>GPRS state</td><td>GPRS gateway clock</td></tr><tr><td>GPRS module exception</td><td>GPRS state</td><td>State code &amp; SIM card state &amp; heart beat interval</td></tr><tr><td>GPRS module exception</td><td>GPRS state</td><td>Reset times</td></tr><tr><td>Low Signal strength</td><td>GPRS state/Device state</td><td>Signal emission frequency</td></tr><tr><td>Internal error</td><td>Message from server</td><td>Error code</td></tr><tr><td>Program BUG</td><td>None</td><td>Server crash</td></tr><tr><td>Bad data integrity</td><td>Record</td><td>Actual record count divide theoretical record count &amp; sensor state</td></tr><tr><td>Bad data continuity</td><td>Record</td><td>Actual record interval time</td></tr><tr><td>Report delay</td><td>Record</td><td>Report time minus collected time</td></tr><tr><td>Report value changeless</td><td>Record</td><td>value &amp; sensor collect voltage value</td></tr><tr><td>Bad data rationality</td><td>Record</td><td>Value change rate &amp; value</td></tr></tbody></table>

# 3 Method and Capture Strategy

## 3.1 Data Transfer Process on Transport Layer

Data frame format was proposed in the following passage. Form.2 is the transmitting data frame format.

<table><caption>Form2. Transmitting Data Frame Format</caption><thead><tr><th>Length</th><th>2 bytes</th><th>1 byte</th><th>1 byte</th><th>1 byte</th><th>2 bytes</th><th>M bytes</th><th>N bytes</th><th>2 bytes</th><th>2 bytes</th></tr></thead><tbody><tr><th>Content</th><td>Start segment</td><td>Framing type</td><td>Framing length</td><td>Frame code</td><td>Control code</td><td>Address segment</td><td>Data segment</td><td>CRC check</td><td>Terminal</td></tr><tr><th>Description</th><td></td><td></td><td></td><td>Head</td><td></td><td>Eigenvector or data</td><td></td><td>Tail</td><td></td></tr></tbody></table>
<table><tr><td>frame</td></tr></table>

The eigenvector data frames and fault filter introduced in following passages are based on the data frame format and this protocol.

## 3.2 Define Eigenvector Data Frames and Frame Filter

The design of eigenvector data frame is shown in form 3 below. Eigenvector type is corresponding to the frame code; form 4 is the detail design of eigenvector data frame model.

<table><caption>Form3. Eigenvector data frame format</caption><thead><tr><th></th><th>Type</th><th>GPRS gateway clock/Report time</th><th>Eigenvector type</th><th>Eigenvector data</th></tr></thead><tbody><tr><td>Length</td><td>2 bytes</td><td>6 bytes</td><td>1 bytes</td><td>N</td></tr></tbody></table>

<table><caption>Form4. Detail Design of Eigenvector Data Frame Model</caption><thead><tr><th>Eigenvector source</th><th>Frame code</th><th>Type code</th><th>Eigenvector type</th><th>Description</th></tr></thead><tbody><tr><td rowspan="6">GPRS gateway state</td><td rowspan="6">0x01</td><td rowspan="2">Link heartbeat:[0x01][0x00];</td><td>Device heart beat interval time</td><td>Hexadecimal value</td></tr><tr><td>Reporting cycle</td><td>Hexadecimal value</td></tr><tr><td>State heartbeat:</td><td>Acquisition cycle</td><td>Hexadecimal value</td></tr><tr><td>long connection: [0x02][0x01]</td><td>Storage cycle</td><td>Hexadecimal value</td></tr><tr><td>Short connection:[0x02][0x02]</td><td>Signal strength</td><td>Hexadecimal value</td></tr><tr><td>no connection: [0x02][0x03]</td><td>Not reported data count</td><td>Hexadecimal value</td></tr><tr><td rowspan="6">M2M state</td><td rowspan="6">0x02</td><td rowspan="2">Power on: [0x01][0x00]</td><td>Gateway voltage</td><td>Hexadecimal value</td></tr><tr><td>Energy type</td><td>0x00:battery<br>0x01:electric supply<br>0x02:solar pannel</td></tr><tr><td rowspan="2">Pause: [0x02][0x00]<br>Power off:[0x03][0x00]</td><td>Device reset time</td><td>Hexadecimal value</td></tr><tr><td>Not reported data count</td><td>Hexadecimal value</td></tr><tr><td></td><td>Device voltage</td><td>Hexadecimal value</td></tr><tr><td>Record</td><td>0x03</td><td>Channel</td><td>Channel</td><td>Hexadecimal value</td></tr></tbody></table>
<table><tbody><tr><td></td><td></td><td>count:Generated by sending device, equals the amount of channels belong to the device</td><td>number</td><td></td></tr><tr><td></td><td></td><td></td><td>channel type</td><td>DO:0x00;<br>EC:0x01;<br>WT:0x02;<br>PH:0x03;</td></tr><tr><td></td><td></td><td></td><td>channel value</td><td>Hexadecimal value</td></tr><tr><td></td><td></td><td>Power on:<br>[0x01][0x00]</td><td>Channels corresponding to control action</td><td>Hexadecimal value</td></tr><tr><td rowspan="10">Actuator state</td><td rowspan="10">0x04</td><td>Pause:<br>[0x02][0x00]</td><td rowspan="5">Control trigger</td><td>0x00:unknown</td></tr><tr><td>Power off:<br>[0x03][0x00]</td><td>0x01:timing</td></tr><tr><td></td><td>0x02:automatic</td></tr><tr><td></td><td>0x03:remote control</td></tr><tr><td></td><td>0x04:manual operation</td></tr><tr><td rowspan="5">Control type</td><td>0x05 exception protect</td></tr><tr><td>0x06:Illeagal control</td></tr><tr><td>0x07:SMS control</td></tr><tr><td>0x00:power on</td></tr><tr><td>0x01:pause</td></tr><tr><td rowspan="10">Actuator state</td><td rowspan="10">0x04</td><td>No action:<br>[0x04][0x00]</td><td>0x02:power off</td></tr><tr><td></td><td>0x03(no action)</td></tr><tr><td></td><td>0x00:poer on</td></tr><tr><td rowspan="3">State feedback type</td><td>0x01:pause</td></tr><tr><td>0x02:power off</td></tr><tr><td>0x03:running</td></tr><tr><td>State feedback channels</td><td>Hexadecimal value</td></tr><tr><td>Original channel value</td><td>Hexadecimal value</td></tr></tbody></table>

A frame filter is designed here to filter eigenvector information from data frames with a high rate. The filter design is showed in Form 5.

<table><caption>Form5. Data filter design</caption><thead><tr><th>Process</th><th>Byte number</th><th>Mask code</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>1</td><td>0xFF</td><td>Extract the first byte, whose low three bits maybe the high three bits of the frame length.</td></tr><tr><td>2</td><td>4</td><td>0xFF</td><td>Extract the length of this frame</td></tr><tr><td>3</td><td>5</td><td>0xFF</td><td>Extract the frame code.</td></tr><tr><td>4</td><td>6</td><td>0xF0</td><td>Address type</td></tr><tr><td>4</td><td>6</td><td>0x0F</td><td>Address type</td></tr></tbody></table>
<table><tr><td>4</td><td>7</td><td>0xF0</td><td>Address type</td></tr><tr><td>4</td><td>7</td><td>0x0F</td><td>Address type</td></tr><tr><td>5</td><td>8</td><td>0xF0</td><td>Address description</td></tr><tr><td>6</td><td>9~9+M</td><td>0xF...F</td><td>Device address</td></tr><tr><td>7</td><td>9+M~11+M</td><td>0xFFFF</td><td>Data type</td></tr><tr><td>8</td><td>11+M~17+M</td><td>0xF...F</td><td>Report time/ GPRS Gateway clock</td></tr><tr><td>9</td><td>17+M~18+M</td><td>0xFF</td><td>Eigenvector type</td></tr><tr><td>10</td><td>18+M~18+M+N</td><td>0xF...F</td><td>Eigenvector value</td></tr></table>

### 3.3 A method to Capture Fault by Filtering Data Frame

Form 6 is the recognize rule. To explain the process more clearly and detail, the filtering process is shown in the following fig2. Fig3 introduces recognition strategy respectively for GPRS gateway fault, because of space limit, device fault, record fault and actuator fault recognition strategy is not introduced here.

<table><caption>Form6. Recognize rule</caption><thead><tr><td>Data type</td><td>Recognize parameter</td><td>Recognize result</td></tr></thead><tbody><tr><td>GPRS Gateway state</td><td>No GPRS connection</td><td>GPRS offline</td></tr><tr><td>GPRS Gateway state</td><td>GPRS signal strength&lt;16</td><td>Communication error: low signal strength</td></tr><tr><td>GPRS Gateway state</td><td>SIM card service stopped or Reset times in 24 hours&gt;1 or Heart beat interval time&gt;10minutes</td><td>GPRS module exception</td></tr><tr><td>GPRS Gateway state</td><td>Reporting cycle&gt; heart beat interval time</td><td>Bad data integrity</td></tr><tr><td>Device state</td><td>Device voltage&lt;5</td><td>Low device voltage</td></tr><tr><td>Device state</td><td>GPRS clock time difference&gt;5 minutes</td><td>Wrong GPRS clock</td></tr><tr><td>Device state</td><td>Device power off</td><td>Device shut down</td></tr><tr><td>Device state</td><td>Device voltage as the high byte and energy type as the low byte</td><td>&lt;0x0502, solar panel exception</td></tr><tr><td>Device state</td><td>Device voltage as the high byte and energy type as the low byte</td><td>&lt;0x0501, electric supply exception</td></tr><tr><td>Device state</td><td>Device voltage as the high byte and energy type as the low byte</td><td>&lt;0x0500, battery exception</td></tr><tr><td>Device state</td><td>Device reset time&gt;1 in 24 hours</td><td>M2M module exception</td></tr><tr><td>Device state</td><td>Signal strength&lt;50</td><td>Communication error: Low signal strength</td></tr><tr><td>Device state</td><td>Report time difference&gt;5 minutes</td><td>Report delay</td></tr><tr><td>Device state</td><td>Not reported data count&gt;200 in 24 hours</td><td>Bad data integrity</td></tr><tr><td>Record</td><td>Report data value changeless</td><td>M2M communication exception</td></tr></tbody></table>
<table><caption>Fig2. Filtering process</caption><tr><td>Record</td><td>Report data value out the threshold</td><td>Bad data rationality</td></tr><tr><td>Record</td><td>Unnormal report data value change rate</td><td>Bad data rationality</td></tr><tr><td>Record</td><td>Report time difference&gt;5minutes</td><td>Report delay</td></tr><tr><td>Record</td><td>(Data count/heart beat count)/(Heart beat interval time/data collection cycle)</td><td>&gt;1,GPRS connection fault</td></tr><tr><td>Record</td><td>(Data count/heart beat count)/(Heart beat interval time/data collection cycle)</td><td>&lt;1,Bad data integrity</td></tr><tr><td>Actuator state</td><td>Actuator state code equals [0x02 0x00] or [0x03 0x00]</td><td>Uncontrollable</td></tr><tr><td>Actuator state</td><td>Actuator state code equals [0x04 0x00]</td><td>No response</td></tr><tr><td>Actuator state</td><td>Report delay</td><td>Report time difference&gt;5minutes</td></tr></table>

<figure><img src="image_3.png" /><figcaption>Fig3. GPRS Gateway Fault Recognition Strategy</figcaption></figure>

<figure><img src="image_4.png" /></figure>

# 4 Simulation Experiment and Discussion

## 4.1 Simulation strategy and build simulation LAN

To verify the strategy's processing rate and accuracy, different personal computers with simulating IP addresses are regarded as the GPRS gateways to report collected data to remote server. The experiment LAN structure is shown in fig4.
<figure><img src="image_5.png" /><figcaption>Fig4. Experiment LAN Structure</figcaption></figure>

The router simulate the GPRS service, simulate remote server is another PC, simulate remote server receive the data frame via TCP/IP protocol and telnet service, then decode and filter the data frames with programs based on the fault recognition strategy in chapter 3.3. The program are written in java and based on apache mina framework.

## 4.2 Experiment result and Evaluation

1290 records of fault are found from working log of operation and maintenance team is used in the experiment. The program was divided into two executable jar file, namely Simulation Server and Simulation Gateway. Fig 5 to 6 shows simulation experiment process and result.

<figure><img src="image_6.png" /><figcaption>Fig6. Result and evaluation</figcaption></figure>

<figure><img src="image_7.png" /></figure>

The first experiment is to get the accuracy of the recognition method under different actual fault record ratio, and total records' count is fixed to 200. The experiment result is shown in fig7. The second experiment is about the accuracy under different total record count, the result is shown in fig8.

The last experiment is to test the time-cost under different fault record count, as the strategy time-cost is mainly on recognized fault records' handling, so this experiment change the fault record count and take the average fault records' handling time as the time-cost evaluation parameter, total record count is fixed to 400. The average fault records' handling time equals total handling time divides 400. The result proves the handling time is proportional to fault record count, as shown in fig .22.
<figure><img src="image_8.png" /><figcaption>Fig8. Accuracy under Different
Total Record Count</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Fig9. Average time-cost
Average time-cost(ms)</figcaption></figure>

<figure><img src="image_10.png" /></figure>

## 4.3 Application effect

The recognition strategy was applied in the Water Quality Monitoring system developed by China Agricultural University, the program has been deployed on the remote server of the system since December, 2012, by now it recognized 246586 records, and is still running on the server. Its high efficient, low time-cost and nice accuracy received praises of maintenance team.

# 5 Conclusions

The proposed pattern recognition method, based on data eigenvector and TCP transport protocol analyses the Water Quality Monitoring equipment comprehensively. The author designed the data transport protocol based on transmit rule, based on this transport protocol, the data filter is proposed. According to actual diagnosis experiment and knowledge, added threshold to the data filter, as a result, the filter is able to filter out data that beyond the threshold. A novel recognition method is proposed to handle fault data with high efficiency and low time-cost, the method is a combination of four strategies, the strategy is specifically, the method manage these strategies to cooperation more efficient.

After 7 months' application, program based on the proposed method performed well on Water Quality Monitoring system. Work logs and praises from maintenance team prove the method feasible and efficient.
Nevertheless, because of the shortage of eigenvector analysis and filter design, recognition misses and errors exist, the method has potential to be improved better, further research should focus on the reduction of the recognition misses and errors. Moreover, relative diagnosis algorithm is necessary to be designed.

## Acknowledgement

Financial support from state science and technology support program (2011BAD21B01). Data, diagnosis knowledge and device support from device maintenance team of Research Center of Agricultural information technology. China Agricultural University is gratefully acknowledged.

## References

[1]. Wu, K., D. Choudhury and H. Matsumoto, Wireless Power Transmission, Technology, and Applications. PROCEEDINGS OF THE IEEE, 2013. 101(6SI): p. 1271-1275.

[2]. Xiaodan, P., et al., Uplink transmission in the W-band (75-110 GHz) for hybrid optical fiber-wireless access networks. Microwave and Optical Technology Letters, 2013. 55(5): p. 1033-1036.

[3]. Lakshmanan, S. and R. Sivakumar, Proteus: Multiflow Diversity Routing for Wireless Networks with Cooperative Transmissions. IEEE TRANSACTIONS ON MOBILE COMPUTING, 2013. 12(6): p. 1146-1159.

[4]. Cheng, S.T., et al., Hierarchical Distributed Source Coding Scheme and Optimal Transmission Scheduling for Wireless Sensor Networks. WIRELESS PERSONAL COMMUNICATIONS, 2013. 70(2): p. 847-868.

[5]. Tahir, Y.H., et al., Transmission of Visual Data over Wireless Fading Channel in Real-Time Systems Based on Superposition Coding Scheme. ARABIAN JOURNAL FOR SCIENCE AND ENGINEERING, 2013. 38(6): p. 1459-1469.

[6]. Chunlai, Y., et al., Study on Wireless Energy and Data Transmission for Long-Range Missile. IEEE Transactions on Plasma Science, 2013. 41(5): p. 1370-1375.

[7]. Refaat, S.S., et al., ANN-based for detection, diagnosis the bearing fault for three phase induction motors using current signal. 2013 IEEE International Conference on Industrial Technology (ICIT 2013), 2013: p. 253-258.

[8]. Talebi, H.A. and K. Khorasani, A Neural Network-Based Multiplicative Actuator Fault Detection and Isolation of Nonlinear Systems. IEEE TRANSACTIONS ON CONTROL SYSTEMS TECHNOLOGY, 2013. 21(3): p. 842-851.

[9]. Jettanasen, C. and A. Ngaopitakkul, A novel probabilistic neural network-based algorithm for classifying internal fault in transformer windings. IEEJ TRANSACTIONS ON ELECTRICAL AND ELECTRONIC ENGINEERING, 2013. 8(2): p. 123-131.

[10]. Prieto, M.D., et al., Bearing Fault Detection by a Novel Condition-Monitoring Scheme Based on Statistical-Time Features and Neural Networks. IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, 2013. 60(8): p. 3398-3407.

[11]. Li, B., et al., Applying the fuzzy lattice neurocomputing (FLN) classifier model to gear fault diagnosis. NEURAL COMPUTING & APPLICATIONS, 2013. 22(3-4SI): p. 627-636.

[12]. Liu, H., et al., Adaptive neuro-fuzzy inference system based faulty sensor monitoring of indoor air quality in a subway station. KOREAN JOURNAL OF CHEMICAL ENGINEERING, 2013. 30(3): p. 528-539.

[13]. Hashemi, M. and M.S. Safizadeh, Design of a fuzzy model based on vibration signal analysis to auto-detect the gear faults. INDUSTRIAL LUBRICATION AND TRIBOLOGY, 2013. 65(3): p. 194-201.

[14]. Keskes, H., A. Braham and Z. Lachiri, Broken rotor bar diagnosis in induction machines through stationary wavelet packet transform and multiclass wavelet SVM. ELECTRIC POWER SYSTEMS RESEARCH, 2013. 97: p. 151-157.