Abstract:With the rapid development of mobile Internet technology, the existing APP provides a very user-friendly operation, the user can make a selection of businesses, APP default option “smart sort”, “from me recently.” These two options, the system will calculate the current position of the user and the distance between the various businesses. This is a large number of computing distance of the scene is very consumption of resources, in accordance with the current statistical data 100 W data when the delay will reach 140 ms. And with the growth of data, the performance of the server is worrying. At present, the method of calculating the space distance is to use Lucene algorithm to calculate, but the cost is relatively large, and is not conducive to the user one eye, the paper presents a method based on the three polynomial fitting trigonometric function optimization algorithm to calculate the space distance, the accuracy and speed of the distance from the two aspects of the original method. Finally, the advantages of the optimization algorithm are summarized