Multi-period Scheduling for Wireless Sensor Networks: A Distributed Consensus Approach