The explosive growth of Internet of Things (i.e., IoT) terminal equipment makes its topology more complex, which leads to the increasing cost of network research. Recently, the implicit community structure is widely used to improve the efficiency of research. However, most of the non-overlapping community detection algorithms have some weakness, such as the large number of community detected and the obvious scale gap between communities. To address these abovementioned problems, we design a novel non-overlapping community detection algorithm, named as Pairing, Splitting and Aggregating algorithm (i.e., PSA). Firstly, in order to improve the accuracy of community division, a new node similarity index is designed to transform the network into a large number of similar node pairs. Secondly, based on the connected branches composed of similar node pairs, the network is further divided into several similar node sets. Thirdly, to balance the scale gap of different communities, the Grasshopper Optimization Algorithm, (i.e., GOA) is introduced to combine the local attribute (i.e., conductance) and global attribute (i.e., modularity) together to aggregate similar node sets into potential (or final) communities. Finally, the experimental results show that PSA not only controls the difference among communities well, but also outperforms the other four popular algorithms in terms of two metrics. Moreover, we propose a community-based resource discovery method (or scheme), named as Community-assisted Short-distancequery Resource Discovery algorithm (i.e., CSRD) to further verify the efficiency of PSA. The results show that the resource discovery efficiency of CSRD using PSA is better compared with other algorithms.