In the era of network media, the outbreak of network social emotions will lead to the tearing and out of control situation of network public opinion ecology, resulting in the occurrence of public crisis. With the development of network media technology, we can deeply understand the social mentality of public events through the analysis and management of public network behavior. Grass roots governance is the basis of social governance. Urban community governance and rural village governance belong to the category of community governance. In the city, the community is the unit cell of social governance. The large-scale Internet platform has linked people, money, materials, and information related to personal life together. It not only provides solutions for the public's life problems but also provides a new digital social governance model. The modernization of community governance at the grassroots level also means reshaping the interpersonal relationship and power structure of the community, focusing on highlighting the subjectivity of the community residents and enhancing the emotional identity of the community. This paper puts forward the analysis framework of social public psychology and behavior in the face of public events, based on the management of public emotions reflected in the network media, to improve the modernization level of community governance and the ability to deal with public events