Social recommendation algorithm can alleviate data sparsity and cold start problems in recommendation system by integrated social information. Among them, matrix-based decomposition algorithms are the most widely used and studied. Such algorithms use dot product operations to calculate the similarity between users and items, which ignores user's potential preferences, reduces algorithms' recommendation accuracy. This deficiency can be avoided by a metric learning-based social recommendation algorithm, which learns the distance between user embedding vectors and item embedding vectors instead of vector dotproduct operations. However, previous works provide no theoretical explanation for its plausibility. Moreover, most works focus on the indirect impact of social friends on user's preferences, ignoring the direct impact on user's rating preferences, which is the influence of user rating preferences. To solve these problems, this study proposes a user bias drift social recommendation algorithm based on metric learning (BDML). The main work of this paper is as follows: (1) the process of introducing metric learning in the social recommendation scenario is introduced in the form of equations, and explained the reason why metric learning can replace the click operation; (2) a new user bias is constructed to simultaneously model the impact of social relationships on user's ratings preferences and user's preferences; Experimental results on two datasets show that the BDML algorithm proposed in this study has better recommendation accuracy compared with other comparison algorithms, and will be able to guarantee the recommendation effect in a more sparse dataset.