A campus running compliance detection method based on geohash grid and hausdorff distance

The time-space similarity detection of campus running trajectories through geohash grid and improved hausdorff distance method is solved, and the problem of multiple mobile phone cheating in campus running is achieved and efficient trajectory compliance audit is achieved.

CN114638282BActive Publication Date: 2025-05-06NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210117252.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-08
Publication Date
2025-05-06
Estimated Expiration
2042-02-08

AI Technical Summary

Technical Problem

The existing trajectory similarity measurement method based on hausdorff distance failed to effectively consider the time attribute, making it difficult to identify cheating behaviors of running and punching in with multiple mobile phones during campus running.

Method used

The trajectory space-time similarity detection method based on geohash grid and improved hausdorff distance is used to smooth the motion trajectory and construct geohash grid, and trajectors with space-time similarity are selected and cheaters are determined based on the number of running steps.

Benefits of technology

Effectively identifying and excluding students who use multiple mobile phones to cheat during campus running improves the accuracy and compliance of trajectory detection and ensures the authenticity of sports data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114638282B_ABST
    Figure CN114638282B_ABST
Patent Text Reader

Abstract

A campus running compliance detection method based on geohash grid and Hausdorff distance, the invention is a campus running compliance detection technology, mainly used to solve the cheating situation of a student bringing multiple mobile phones to run and punch in. The method first smoothes the student's motion trajectory, effectively improving the accuracy of the trajectory. Then, the designed geohash grid-based and improved Hausdorff spatiotemporal compliance detection method is used to find out the spatiotemporal similar trajectories. Finally, the list of students who cheated in the campus running on that day is determined by the number of running steps.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of spatiotemporal compliance detection of a trajectory of motion data, and in particular to a cheating detection method for clocking in while running in a campus running environment. Background Art

[0002] Campus running is an activity carried out in colleges and universities to improve students' physical fitness. In order to ensure that students can improve their physical fitness and strengthen their bodies during running, and avoid the situation where one person carries multiple mobile phones to clock in for running, it is particularly important to find the spatiotemporal similar trajectories in the running data. The key to solving the problem is to detect the spatiotemporal compliance of students' movements through the motion information collected by mobile devices.

[0003] The existing studies on trajectory similarity measurement methods based on Hausdorff distance only focus on the coordinate and orientation attributes of trajectory information, lacking the addition of time attributes, and therefore are not suitable for spatiotemporal trajectory data. In addition, the application of Hausdorff requires that the data sequence is not necessary, but the trajectory data based on spatiotemporal is ordered. In view of the above problems, an improved Hausdorff similarity measurement algorithm based on spatiotemporal constraints is proposed. When calculating the minimum distance between any point P on the trajectory and the trajectory, the method of establishing a geohash grid is adopted, that is, comparing the corresponding point P' of point P in the trajectory and the points of the trajectory contained in the geohash grid created by P'. Summary of the invention

[0004] This method aims to address the current cheating situation in campus running, where one student brings multiple classmates' mobile phones to clock in for running. This method proposes a campus running compliance detection method based on geohash grid and Hausdorff distance. This method first uses a flat-modified filtering algorithm to pre-process the students' motion trajectories to deal with problems such as noise in the trajectories. Then, the spatiotemporal trajectory similarity calculation method based on the geohash grid is used to calculate the spatiotemporal trajectory similarity between the target trajectory and all other trajectories in the day's motion data set, generating a list of people with similar spatiotemporal paths. Finally, in the generated list, the final list of running violators is determined based on the number of running steps.

[0005] A campus running compliance detection method based on geohash grid and hausdorff distance of the present invention is characterized by comprising the following steps:

[0006] Step 1, obtaining the motion track information of the students on the same running route in the same time period, wherein the motion track information refers to the latitude and longitude information of all the track points on the motion track, assuming that there are P motion tracks of the students on the same running route in the same time period;

[0007] Step 2, extracting K trajectory points on each trajectory, and smoothing the latitude and longitude values ​​of each trajectory point according to the latitude and longitude values ​​of the trajectory points adjacent to it, that is, obtaining the smoothed longitude and longitude values;

[0008] Step 3, select any student's motion trajectory as the target trajectory, and screen out all trajectories similar to the target trajectory based on the geohash grid and Hausdorff's trajectory spatiotemporal similarity calculation method;

[0009] Step 4: Among the trajectories similar to the target trajectory, select those with the closest running steps as the list of suspected cheaters.

[0010] Furthermore, the smoothed latitude and longitude values ​​obtained in step 2 specifically include the following steps:

[0011] Step 2.1, extract K trajectory points on the pth motion trajectory;

[0012] Each motion trajectory is a set of longitude and latitude coordinates in continuous time. The pth motion trajectory is recorded as:

[0013]

[0014] t is the time of the point, and K trajectory points are divided on the trajectory p according to the acquisition time. Represents the longitude and latitude information of the k-th track point on the p-th track, where 1≤p≤P, 1≤k≤K;

[0015] Step 2.2, for the kth track point on the motion track p, set a window of length n with the track point k as the center to add the track points adjacent to the track point k, and find the median of the longitude and latitude of each track point in the window, recorded as

[0016] Step 2.3: For each point in the window, take the median The weight corresponding to each trajectory point in the calculation window is calculated based on the following method:

[0017]

[0018] represents the longitude and latitude of the i-th track point in the window on track P, w i is the weight corresponding to the i-th trajectory point in the window, n is the number of trajectory points in the window, 1≤i≤n;

[0019] Step 2.4: The latitude and longitude values ​​of each track point in the window are weighted and summed with their corresponding weights, and the processed latitude and longitude output of track point k is calculated. The calculation method is as follows:

[0020]

[0021] Step 2.5, repeat steps 2.2-2.4 to obtain the longitude and latitude values ​​of all track points on all tracks after smoothing.

[0022] Furthermore, in step 3, any student's motion trajectory is selected as the target trajectory, and all trajectories similar to the target trajectory are screened out based on the geohash grid and Hausdorff's trajectory spatiotemporal similarity calculation method. The specific steps are as follows:

[0023] Step 3.1, construct a geohash grid for the kth track point in the pth track, denoted as

[0024] The calculation method of the smallest unit of latitude division, latUnit, is:

[0025]

[0026] Among them, maxLat and minLat represent the maximum and minimum values ​​of latitude respectively, and latnumbit is the number of divisions of latitude;

[0027] The calculation method of the smallest unit of longitude division, lonUnit, is:

[0028]

[0029] Calculate the latitude and longitude of M points around sampling point k as follows:

[0030] The sampling points around sampling point k are The longitude is added or subtracted by lonUnit while the latitude remains unchanged; the upper and lower sampling points are The latitude is added or subtracted by latUnit while the longitude remains unchanged;

[0031] Then convert the latitude and longitude of M points around sampling point k into geohash values ​​to generate the geohash grid of point k, recorded as

[0032] Step 3.2, obtain the target trajectory T a With any trajectory T b The hausdorff distance

[0033] Select track T a ={a 1 ,a 2 ,…,a K} represents the target trajectory, trajectory T b = {b1 ,b 2 ,…,b K} means except the target trajectory T a Any student trajectory outside k ,b k are the trajectory points corresponding to the two trajectories at the kth moment; assuming that trajectory T a With trajectory T b The Hausdorff distance between them is d, then for any a k ∈T a , there exists b k ∈T b So that dist(a k ,grid(b k ))≤d, where grid(b k ) represents the trajectory T b The trajectory point exists at point b k The sampling points in the geohash grid formed; dist(a k ,grid(b k )) represents point a k With point b k The distance between the sampling points in the formed grid; therefore, the improved Hausdorff distance is defined as:

[0034] H(A,B)=max(h(A,B),h(B,A))

[0035] Among them, A and B represent the trajectory T a With trajectory T b ;

[0036]

[0037]

[0038] Among them, q represents the qth point in the trajectory.

[0039] Step 3.3, based on the improved Hausdorff distance proposed in step 3.2, use the sliding window method to find similar sub-trajectory segments in the window, wherein the similar sub-trajectory segments refer to two trajectories in the sliding window whose Hausdorff distance is less than a preset value d;

[0040] All similar sub-trajectory segments found in the sliding window are counted to count the number of trajectory points in the sub-trajectory, and the ratio of this number to the total number of trajectory points is used as the basis for similarity evaluation;

[0041] When the target trajectory T is obtained a and trajectory T bAfter all similar sub-trajectory segments are found, if the ratio of the length of the similar sub-trajectory segment to the length of the trajectory itself is greater than a certain threshold, it means that the two trajectories are similar; that is:

[0042]

[0043] Where m is the trajectory T a With trajectory T b The number of similar sub-trajectories, |sim j (T a ,T b )| is the length of the similar sub-trajectory in the jth sliding interval in the trajectory, and ε is the set threshold.

[0044] Furthermore, in step 3.3, the sliding window method is used to find similar sub-trajectory segments within the window. The specific process is as follows:

[0045] If the sub-track segments corresponding to the two trajectories in the sliding window are similar, the size of the sliding window is expanded by one unit, and then the similarity of the sub-track segments of the two trajectories under the new sliding window is compared; when the sub-track segments under the new sliding window are not similar, the similar sub-track segments calculated in the previous sliding window are output, and the end of the current sliding window is used as the starting point, and the length of the sliding window is set to the initial size to scan the next segment of the trajectory;

[0046] If the sub-trajectory segments in the current window are not similar and the sub-trajectory segments corresponding to the two trajectories in the previous window are also not similar, the sliding window moves forward one unit.

[0047] Furthermore, the number of steps being close in step 4 means that the difference in the number of steps of the two trajectories is less than 3% of the number of steps of the target trajectory.

[0048] Beneficial effects: This method first smoothes the student's motion trajectory, effectively improving the accuracy of the trajectory. Then, the designed geohash grid-based and improved hausdorff spatiotemporal compliance detection method is used to find similar spatiotemporal trajectories. Finally, the list of students who cheated in the campus run on that day was determined by the number of running steps, effectively solving the cheating situation of a student bringing multiple mobile phones to run and punch in. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a table of space-time similar trajectory information found in step 3.

[0050] Figure 2 It is a running trajectory graph of the target trajectory and similar trajectories. DETAILED DESCRIPTION

[0051] In order to make the technical solution and implementation steps of the present invention clearer, further detailed description is given below.

[0052] The students' exercise information after clocking in is uploaded to the database. For the day's exercise data, the improved filtering algorithm is first used to remove "dirty data" such as noise points in the trajectory to make the trajectory smoother. Then, the trajectory spatiotemporal similarity calculation method based on geohash grid and hausdorff is used to screen out a list of students with similar spatiotemporal trajectories on the day. The number of running steps is checked in the screened information to identify cheating students.

[0053] The specific steps include:

[0054] Step 1: Obtain the motion trajectory information of students on the same running route in the same time period. The motion trajectory information refers to the latitude and longitude information of all trajectory points on the motion trajectory. Suppose there are P motion trajectories of students on the same running route in the same time period.

[0055] Step 2, smoothing each motion trajectory;

[0056] K trajectory points are extracted from each trajectory, and the latitude and longitude values ​​of each trajectory point are smoothed according to the latitude and longitude values ​​of the trajectory points adjacent to it, so as to obtain the latitude and longitude values ​​of the point after smoothing; the specific steps are as follows:

[0057] Step 2.1, extract K trajectory points on the pth motion trajectory;

[0058] Each motion trajectory is a set of longitude and latitude coordinates in continuous time. The pth motion trajectory is recorded as:

[0059]

[0060] Where x represents the latitude position coordinate of the trajectory point, y represents the longitude position coordinate of the trajectory point, and t is the time of the point. K trajectory points are divided on the trajectory p according to the collection time. Represents the longitude and latitude information of the k-th track point on the p-th track, where 1≤p≤P, 1≤k≤K.

[0061] Step 2.2, for the kth track point on the motion track p, set a window of length n with the track point k as the center to add the track points adjacent to the track point k, and find the median of the longitude and latitude of each track point in the window, recorded as The median is the middle number, which is the value in the middle of a string of numbers after they are sorted.

[0062] Step 2.3: For each point in the window, take the median The weight corresponding to each trajectory point in the calculation window is calculated based on the following method:

[0063]

[0064] represents the longitude and latitude of the i-th track point in the window on track P, w i is the weight corresponding to the i-th trajectory point in the window, n is the number of trajectory points in the window, 1≤i≤n.

[0065] Step 2.4: The latitude and longitude values ​​of each track point in the window are weighted and summed with their corresponding weights, and the processed latitude and longitude output of track point k is calculated. The calculation method is as follows:

[0066]

[0067] Step 2.5, repeat steps 2.2-2.4 to obtain the longitude and latitude values ​​of all track points on all tracks after smoothing.

[0068] Step 3: Select any student's motion trajectory as the target trajectory T a , based on the geohash grid and hausdorff's trajectory spatiotemporal similarity calculation method, all trajectories that are similar to the target trajectory in spatiotemporal trajectory on that day are screened out. The specific steps are as follows:

[0069] Step 3.1, construct a geohash grid for the kth track point in the pth track, denoted as

[0070] The traditional geohash value uses the hash value of an area to replace all the coordinate points in the area. The size of the area is limited by the length of the code, and the position and size of the area are fixed. In order to increase the controllability of the sampling point coverage, we use the following method:

[0071] Assuming that the hash value to be calculated is 10 bits, the number of binary bits required to generate the hash value is 10*5=50 bits, so the longitude and latitude must be divided 25 times each. Taking latitude as an example, after the latitude is divided 25 times, the length obtained is the smallest unit of latitude division, latUnit.

[0072] The calculation method of the smallest unit of latitude division, latUnit, is:

[0073]

[0074] Among them, maxLat and minLat represent the maximum and minimum values ​​of latitude respectively, and latnumbit is the number of times the latitude is divided. The maximum and minimum values ​​of latitude are positive and negative 90 degrees respectively.

[0075] The calculation method of the smallest unit of longitude division, lonUnit, is:

[0076]

[0077] Calculate the latitude and longitude of M points around sampling point k as follows:

[0078] The sampling points around sampling point k are The longitude is added or subtracted by lonUnit while the latitude remains unchanged; the upper and lower sampling points are The latitude is added or subtracted by latUnit while the longitude remains unchanged.

[0079] Then convert the latitude and longitude of M points around sampling point k into geohash values ​​to generate the geohash grid of point k, recorded as In the present invention, M=8.

[0080] Step 3.2, calculate the target trajectory T a With any trajectory T b Improved Hausdorff distance

[0081] Select track T a ={a 1 ,a 2 ,…,a K} represents the target trajectory, trajectory T b = {b 1 ,b 2 ,…,b K} means except the target trajectory T a Any student trajectory outside k ,b k are the trajectory points corresponding to the two trajectories at the kth moment. Assume that trajectory T a With trajectory T b The Hausdorff distance between them is d, then for any a k ∈T a , there exists b k ∈T b So that dist(a k ,grid(b k ))≤d, where grid(b k ) represents the trajectory T b The trajectory point exists at point b k The sampling points in the geohash grid are formed. dist(a k,grid(b k )) represents point a k With point b k The distance between the sampling points in the formed grid. Therefore, the improved Hausdorff distance is defined as:

[0082] H(A,B)=max(h(A,B),h(B,A))

[0083] In this embodiment, A and B represent the trajectory T respectively. a With trajectory T b

[0084]

[0085]

[0086] Among them, q represents the qth point in the trajectory;

[0087] Step 3.3, based on the improved Hausdorff distance proposed in step 3.2, use the sliding window method to find similar sub-trajectory segments in the window, where the similar sub-trajectory segments refer to two trajectories in the sliding window whose Hausdorff distance is less than a preset value d. Count the number of trajectory points in all similar sub-trajectory segments found in the sliding window, and use the ratio of this number to the total number of trajectory points as the basis for similarity evaluation.

[0088] Specifically, if the sub-track segments corresponding to the two trajectories in the sliding window are similar, the size of the sliding window is expanded by one unit, and then the similarity of the sub-track segments of the two trajectories under the new sliding window is compared. When the sub-track segments under the new sliding window are not similar, the similar sub-track segments calculated in the previous sliding window are output, and the end of the current sliding window is used as the starting point, and the length of the sliding window is set to the initial size to scan the next segment of the trajectory.

[0089] If the sub-trajectory segments in the current window are not similar and the sub-trajectory segments corresponding to the two trajectories in the previous window are also not similar, the sliding window moves forward one unit.

[0090] When the target trajectory T is obtained a and trajectory T b After finding all similar sub-trajectory segments, if the ratio of the length of the similar sub-trajectory segment to the length of the trajectory itself is greater than a certain threshold, it means that the two trajectories are similar. That is:

[0091]

[0092] Where m is the trajectory T a With trajectory T bThe number of similar sub-trajectories, |sim i (T a ,T b )| is the length of the similar sub-trajectory in the i-th sliding interval in the trajectory, and ε is the set threshold. The length of the trajectory is defined as the number of sampling points in the trajectory.

[0093] Step 4, among the trajectories similar to the target trajectory, select those with closer running steps as the list of suspected cheaters, where closer steps means that the difference in the steps of the two trajectories is less than 3% of the steps of the target trajectory.

[0094] like Figure 1 As shown in , the three runners started at the same time, finished at similar times, and chose the same running route. The running trajectories formed in the end are extremely consistent, as shown in Figure 2 As shown by the thin solid line, Figure 2 The target trajectory and two similar trajectories are combined into one trajectory. Figure 2 The thick dotted line in the figure is the prescribed running route.

[0095] In the actual test scenario, a runner was running with two mobile devices, while another student was running side by side. The final test results also showed that the trajectories of these three students had a high degree of spatiotemporal similarity, and they were suspected of cheating in their grades. In this case, the administrator can review the compliance of the trajectory by viewing the students' exercise details. The number of steps taken by the two cheating students was very close, while the number of steps taken by the student running beside them was quite different. The consistency of the number of steps is an important basis for judging the spatiotemporal compliance of the trajectory during the review process.

Claims

1. A campus running compliance detection method based on geohash grid and hausdorff distance, characterized in that: The steps include: Step 1, obtaining the motion track information of the students on the same running route in the same time period, wherein the motion track information refers to the latitude and longitude information of all the track points on the motion track, assuming that there are P motion tracks of the students on the same running route in the same time period; Step 2, extracting K trajectory points on each trajectory, and smoothing the latitude and longitude values ​​of each trajectory point according to the latitude and longitude values ​​of the trajectory points adjacent to it, that is, obtaining the smoothed longitude and longitude values; Step 3: Select any student's motion trajectory as the target trajectory, and screen out all trajectories similar to the target trajectory based on the geohash grid and Hausdorff's trajectory spatiotemporal similarity calculation method; the specific steps are as follows: Step 3.1, construct a geohash grid for the kth track point in the pth track, denoted as The calculation method of the smallest unit of latitude division, latUnit, is: Among them, MaxLat and Minlat represent the maximum latitude and the minimum latitude respectively, and latnumbit is the number of divisions of latitude; The calculation method of the smallest unit of longitude division, lonUnit, is: Calculate the latitude and longitude of M points around sampling point k as follows: The sampling points around sampling point k are The longitude is added or subtracted by lonUnit while the latitude remains unchanged; the upper and lower sampling points are The latitude is added or subtracted by latUnit while the longitude remains unchanged; Then convert the longitude and latitude of M points around sampling point k into geohash values ​​to generate the geohash grid of point k, recorded as Step 3.2, obtain the target trajectory T a With any trajectory T b The hausdorff distance; Select track T a ={a 1 ,a 2 ,…,a K } represents the target trajectory, trajectory T b = {b 1 ,b 2 ,…,b K } means except the target trajectory T a Any student trajectory outside k ,b k are the trajectory points corresponding to the two trajectories at the kth moment; assuming that trajectory T a With trajectory T b The Hausdorff distance between them is d, then for any a k ∈T a , there exists b k ∈T b So that dist(a k ,grid(b k ))≤d, where grid(b k ) represents the trajectory T b The trajectory point exists at point b k The sampling points in the geohash grid formed; dist(a k ,grid(b k )) represents point a k With point b k The distance between the sampling points in the formed grid; therefore, the improved Hausdorff distance is defined as: H(A,B)=max(h(A,B),h(B,A)) Among them, A and B represent the trajectory T a With trajectory T b ; h(A,B)=max aq (dist(a q ,grid(b q ))) h(B,A)=max bk (dist(b k ,grid(a k ))) Among them, q represents the qth point in the trajectory; Step 3.3, based on the improved Hausdorff distance proposed in step 3.2, use the sliding window method to find similar sub-trajectory segments in the window, wherein the similar sub-trajectory segments refer to two trajectories in the sliding window whose Hausdorff distance is less than a preset value d; All similar sub-trajectory segments found in the sliding window are counted to count the number of trajectory points in the sub-trajectory, and the ratio of this number to the total number of trajectory points is used as the basis for similarity evaluation; When the target trajectory T is obtained a and trajectory T b After all similar sub-trajectory segments are found, if the ratio of the length of the similar sub-trajectory segment to the length of the trajectory itself is greater than a certain threshold, it means that the two trajectories are similar; that is: Where m is the trajectory T a With trajectory T b The number of similar sub-trajectories, |sim j (T a ,T b )| is the length of the similar sub-trajectory in the jth sliding interval in the trajectory, and ε is the set threshold; Step 4: Among the trajectories similar to the target trajectory, select those with the closest running steps as the list of suspected cheaters.

2. According to claim 1, a campus running compliance detection method based on geohash grid and hausdorff distance is characterized in that: The smoothed latitude and longitude values ​​obtained in step 2 specifically include the following steps: Step 2.1, extract K trajectory points on the pth motion trajectory; Each motion trajectory is a set of longitude and latitude coordinates in continuous time. The pth motion trajectory is recorded as: t is the time of the point, and K trajectory points are divided on the trajectory p according to the acquisition time. Represents the longitude and latitude information of the k-th track point on the p-th track, where 1≤p≤P, 1≤k≤K; Step 2.2, for the kth track point on the motion track p, set a window of length n with the track point k as the center to add the track points adjacent to the track point k, and find the median of the longitude and latitude of each track point in the window, recorded as Step 2.3: For each point in the window, use the median The weight corresponding to each trajectory point in the calculation window is calculated based on the following method: represents the longitude and latitude of the i-th track point in the window on track P, w i is the weight corresponding to the i-th trajectory point in the window, n is the number of trajectory points in the window, 1≤i≤n; Step 2.4: The latitude and longitude values ​​of each track point in the window are weighted and summed with their corresponding weights, and the processed latitude and longitude output of track point k is calculated. The calculation method is as follows: Step 2.5, repeat steps 2.2-2.4 to obtain the longitude and latitude values ​​of all track points on all tracks after smoothing.

3. According to claim 1, a campus running compliance detection method based on geohash grid and hausdorff distance is characterized in that: In step 3.3, the sliding window method is used to find similar sub-trajectory segments within the window. The specific process is as follows: If the sub-track segments corresponding to the two trajectories in the sliding window are similar, the size of the sliding window is expanded by one unit, and then the similarity of the sub-track segments of the two trajectories under the new sliding window is compared; when the sub-track segments under the new sliding window are not similar, the similar sub-track segments calculated in the previous sliding window are output, and the end of the current sliding window is used as the starting point, and the length of the sliding window is set to the initial size to scan the next segment of the trajectory; If the sub-trajectory segments in the current window are not similar and the sub-trajectory segments corresponding to the two trajectories in the previous window are also not similar, the sliding window moves forward one unit.

4. According to claim 1, a campus running compliance detection method based on geohash grid and hausdorff distance is characterized in that: The step number mentioned in step 4 is close, which means that the difference in the step number of the two trajectories is less than 3% of the step number of the target trajectory.