With reference to any one of the first aspect and the foregoing possible implementations, in another possible implementation, when the mobile device determines the location change rate value of the mobile device based on the obtained N groups of environment record information, the distance may be calculated in a plurality of distance calculation manners. For example, when the mobile device determines the location change rate value of the mobile device based on the obtained N groups of environment record information, the distance between the location points of the mobile device that are corresponding to the N groups of environment record information may be calculated by calculating a Euclidean distance, a standardized Euclidean distance, a Manhattan distance, or a Chebyshev distance or by using another distance-based calculation method. Certainly, there may be other distance calculation methods, which are not listed herein. This is not specifically limited in this application.
With reference any one of to the first aspect and the foregoing possible implementations, in another possible implementation, the value of N may be determined based on an actual requirement and may be set to a fixed value. Alternatively, the value of N may be set to an initial value based on an actual requirement. In a positioning process of the mobile device, the value of N is adaptively adjusted based on the location change rate value of the mobile device. For example, when the location change rate value of the mobile device increases, the value of N decreases accordingly; or when the location change rate value of the mobile device decreases, the value of N increases accordingly. Certainly, a correspondence between the location change rate value of the mobile device and N may be set based on an actual requirement. This is not specifically limited in this application.