Mining the community structure in the real-world networks has been a hot topic in the field of complex networks, and has emerged as a prominent research area and continues to grow with the introduction of requirements for personalized recommendation. However, most of the existing community detection algorithms are based on global information, fewer works are devoted to detecting the communities hidden in the network by using local information. To this end, in this paper, we propose two improved signed modularity functions to evaluate the community properties in complex network, and then we apply these indicators to identify the community structure by using the local information since it is difficult to obtain the global information in practice. During the dynamic expansion, each local community will absorb the neighboring node with the highest positive energy; in addition, a new local community is generated when all local communities cannot contain the neighboring node. Finally, the algorithm has been applied to unsigned networks and signed networks, respectively. The experimental results show that the division results given by our proposed algorithm are in line with the actual ones in artificial and real-life networks.