Lithium-ion batteries, the core components of electric vehicles, have received unprecedented attention and undergone development in the era of huge energy demand. The traditional clustering algorithm cannot meet the requirement of the consistency of lithium battery distribution. In this study, we provide an improved K-means algorithm to meet the battery distribution needs of enterprises and combine it with reality. This model includes an early data processing model and a battery comparison method based on the new K-means algorithm. In the battery data processing model, the preprocessing process approach and actual production standards preclude problematic batteries. In the battery comparison algorithm, the number of batteries in each cluster becomes equal after the battery comparison. The algorithm can ensure the internal characteristics of lithium-ion power batteries, and, at the same time, after the matching is completed, the number of lithium batteries in each cluster is equal.