One of the important issues in data processing is clustering, the purpose of which is to find similar patterns in the data. Many clustering methods differ in their approaches and similarities. The density-based spatial clustering of applications with noise (DBSCAN) clustering method is one of the most practical density-based clustering methods that can identify training samples with different shapes, and for this reason, it has many applications in different fields. Although this method has its advantages, it has some weaknesses, such as the lack of proper performance in big data, the difficulty of determining Epsilons (Eps) and the Minimum number of points (Minpts) parameters for optimal clusters, etc. To solve these problems, in this paper, a dynamic method is used to solve the problem of identifying clusters with different densities, and another method is used to increase the speed of the algorithm and reduce the computational complexity. Testing the new method on several sets of data shows that the proposed method has a high efficiency in clustering and outperforms the density-based spatial clustering of applications with noise (DBSCAN) method in terms of complexity and efficiency.