Community detection in dynamic network is an essential topic in recent years that faces challenging tasks. In this paper, we introduce the concept of consensus community and propose a consensus community detection algorithm based on whale algorithm. The purpose of consensus community is to find knowledge from the network of previous time step and brought the knowledge to the network of successive time. Experimental results on artificial and real-world networks show that our method is more accurate and robust than some other state-of-art algorithms.