Detection and maintenance of malicious node based on secure routing in wireless sensor networks for data storage and distributed query processing