With the rapid rise in the scope and frequency of use, the shortcomings of clustering algorithms in unsupervised learning in terms of privacy protection are gradually exposed. In order to prevent the privacy leakage problem in the process of data mining, this paper investigates the privacy budget allocation scheme of k-means algorithm based on differential privacy, proposes an optimization scheme of privacy budget allocation based on arithmetic technique, designs experiments to prove its effectiveness, and completes a demonstration system of k-means clustering algorithm optimization based on differential privacy.