In order to overcome the problems of long detection time, low detection efficiency and high false alarm rate, a new method based on machine learning is proposed. Data mining in e-commerce platform. The improved k-means algorithm was used to cluster the data, and the five steps of preparation, detection, location acquisition, modification and verification were used to clean up the clustering results and remove redundant data. The machine learning method is used to determine whether there are suspicious transaction fragments in the database through four steps: data pre-processing, generating reference sequence and query sequence, calculating similarity and sequence classification, and to complete abnormal fund transfer detection in e-commerce. Experimental results show that the detection time of this method is kept below 3 s, the highest false detection rate is only 11%, and the detection rate is always higher than 90%, with high detection efficiency, low false alarm rate, high detection rate.