| Wireless Sensor Networks (WSNs) consist of a large number of nodes which are distributed over a large geographical area, and these nodes are usually limited by energy, storage, calculation and communication bandwidth. Taking into consideration of the harsh and unattended environment which is unreliable and unstable that Wireless sensor networks mostly work, therefore, anomaly detection is important in this case.To solve the problems presented above, this paper mainly focuses on the design of anomaly detection algorithm and network topology management. The framework of the paper is described as follows:Firstly, we summarize the development of the event detection algorithms in wireless sensor network and introduce some classic event detection algorithms. In this paper, an event detection model based on hypercube and a spatiotemporal correlation is proposed to differentiate normal and abnormal events in WSNs. In the training phase, a normal reference model is built by inline event detection algorithm which was based on KNN hypercube. In the detection phase, the sample data is mapped into a hypercube. If there exist more than k samples in that hypercube, the data is considered to be normal. Otherwise, it is abnormal. In the update phase, the normal model is updated by two CAU and FTWU strategies to adapt to the change over time. The both strategies can effectively distinguish the anomalies and events on basis of guaranteeing the performance of the detection algorithm, as well as reduce the computational complexity and communication load between nodes, and balance the limit of energy, bandwidth and computing power in WSNs. Experiment results indicate that CAU and FTWU algorithms can not only achieve better detection accuracy and low false alarm rate, but also reduce the communication data effectively.Secondly, based on the surveillance project of coal-bed methane field in Zhangzi County, Changzhi City, Shanxi Province, we design a Wireless Network Management System (WLNMS) which is capable of monitoring the running status and data transmission path of the wireless networks in complex scenes. Traditionally, the transmission path in wireless networks is not visible. In order to visualize the process of monitoring and managing the whole wireless network, as well as control the security management and parameter setting, our system is made up of receiving the working state information, detecting the third-party equipment by sending detecting information and reporting the real-time anomaly status in WSNs. In addition, the proposed algorithms are tested in our system to verify its effectiveness.Then, we make the conclusions of this paper and the emphasis of our future work. |