The nodes in the opportunistic network make up communities according to the relevance between them. Some of the structural characteristics of an opportunistic network can be reflected by the structure of the communities that exist in the network. Therefore, finding community from the network is of great significance for people to better study, use, and transform the network. The overlap of communities is considered to be an important feature of communities. Almost all community discovery algorithms were based on nonoverlapping communities in the past. A node in a nonoverlapping community belongs to only one community. However, there are overlapping and interrelated characteristics between communities, so it is not in line with the actual environment of the network. As a result, the previous algorithms have many shortcomings in the face of practical application scenarios, coupled with the limitation of the computing capacity of mobile devices; data transmission for low delay and the low energy consumption is difficult to meet the requirements. In the study, we formulate the problem of dividing nodes into several communities in the opportunistic social network as how to build communities dynamically according to weight distribution. Then, we propose a modified data delivery strategy based on stochastic block model and community detection (DDBSC). The simulation results show that, compared with other algorithms in the experiments, the strategy proposed in this paper exhibits good performance in terms of overhead, energy consumption, and delivery rate.