Grid-based recommendation algorithms view users and items as abstract nodes, and the information utilised by the algorithm is hidden in the selection relationships between users and items. Although these relationships can be easily handled, much useful information is overlooked, resulting in a less accurate recommendation algorithm. The aim of this paper is to propose improvements on the standard substance diffusion algorithm, taking into account the influence of the user's rating on the recommended item, adding a moderating factor, and optimising the initial resource allocation vector and resource transfer matrix in the recommendation algorithm. An average ranking score evaluation index is introduced to quantify user satisfaction with the recommendation results. Experiments are conducted on the MovieLens training dataset, and the experimental results show that the proposed algorithm outperforms classical collaborative filtering systems and network structure based recommendation systems in terms of recommendation accuracy and hit rate.