In recent years, wireless sensor networks have attracted extensive attention. They are distributed to real life to collect valuable raw perceptual data. Because of its high density, wireless sensor networks are vulnerable to failures and malicious attacks. Similarly, sensor readings are inaccurate and unreliable, making wireless sensor networks vulnerable to outliers.