It is an important subject of sediment production machinery to study the production development process and sediment transport law of cohesive fine-grained sediment flocculation. At present, many scholars have learned how to break out of the water under pressure on the basis of theory and practice, but there are still many unsolved problems. This paper aims to study the sedimentation of sediment particles in the ocean based on a dynamic programming algorithm. In this paper, the microscopic images of flocs are analyzed and studied by using Ipp graphics software and fractal method for the motion of offshore seawater such as beaches. The traditional calculation method is relatively simple to calculate the effective density of flocs. The fractal dimension of flocculation was calculated using the box dimension calculation method of two-dimensional digital images and MATLAB software. The changing laws of effective density, porosity, diameter and fractal dimension of flocs under different sediment content and electrolyte conditions were discussed from the microscopic point of view. From a macroscopic point of view, the flocculation and recrystallization processes of fine-grained viscous powders were experimentally evaluated. If you consider that most natural water contains cations, and cations have a great influence on the flocculation and distribution of fine sediments, for this reason, this paper develops the ion concentration parameter based on the principle of Goncharov, which is suitable for the flocculation rate formula. Experiments have shown that the floc density of different cationic valences changes significantly. There is a transitional stage, called transitional settlement stage.