Community detection is an important task in complex network analysis. The existing community detection methods mostly focus on utilizing the simple network structure, while the methods of integrating network topology and node attributes are also mainly aimed at the traditional community structure, which fails to detect the bipartite structure, mixed structure, etc. However, the degree of each node in the network will affect the composition of the links in the network, as well as the distribution of the community structure. This paper proposes a method called DPSB_PG for attributed networks community detection based on the stochastic block model. Unlike other generative models for attributed networks, in this method, the generation of node links and node attributes both followes the Poisson distribution, and considers the probability between communities based on the stochastic block model. Moreover, the idea of degree corrected is integrated in the process of generating node links. Finally, in order to obtain the community membership of nodes, the expectation-maximization algorithm is used to infer the parameters of the model. The experimental results on the real networks show that the DPSB_PG inherits the advantages of the stochastic block model and can detect the general community structure in networks. Since the introduction of the idea of degree corrected, this model has a good data fitting ability. Overall, the performance of this model is superior to other existing state-of-the-art community detection algorithms for both attributed networks and non-attributed networks.