Under the influence of novel corona virus pneumonia epidemic prevention and control, higher requirements for behavior recognition in complex environment are put forward. The accuracy of traditional methods for sports training is not high, so a method is needed to improve the local action recognition to assist sports training. In the process of behavior recognition, if only the track is regarded as an independent individual, the information of its neighbor will be ignored. Therefore, we use KNN algorithm to get the nearest neighbor trajectory. In order to calculate the rich neighborhood information around the track, this paper calculates the complex relationship between the center track and the neighborhood track from four different angles, including absolute motion, relative motion, distance relationship and direction relationship. Then, from the four different perspectives of variance, discrete coefficient, skewness and kurtosis, this paper proposes a large interval nearest neighbor coding method. This method makes the four eigenvalues complement each other and improves the ability of describing complex and changeable behaviors. The experimental results show that the coding method proposed in this paper can be used for behavior recognition according to different transformation matrix.