Trust management mechanism is a research hotspot in the field of wireless sensor network security in recent years. Begin with the basic concept of trust management, this paper analyzes and summarizes the existing attack models, including the attacks against network models and trust models. Then, this paper introduces the main algorithms used in trust management mechanisms, including Bayesian statistics, subjective logic, fuzzy logic, D-S evidence theory, entropy theory, cloud theory, analytic hierarchy process, fog computing and machine learning, etc., and expounds the main ideas, the research progress and existing problems. On this basis, this paper looks forward to the development trend of trust management mechanism in wireless sensor networks, summarizes the main problems existing in the current trust management mechanisms and the possible research direction in the future.