Efficient riding motion track cleaning and optimizing algorithm
By employing multi-dimensional anomaly identification and correction, trajectory point filtering and smoothing, combined with multi-positioning module switching and trajectory recovery technology, the problem of incomplete cycling trajectory data has been solved, achieving high-precision and high-completeness cycling trajectory recording.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI QIMING SOFTWARE CO LTD
- Filing Date
- 2026-02-02
- Publication Date
- 2026-05-12
AI Technical Summary
Existing cycling trajectory processing algorithms suffer from problems such as incomplete anomaly identification, crude correction methods, low trajectory accuracy, poor positioning continuity, and inability to effectively recover from trajectory interruptions. These issues result in incomplete cycling trajectory data, failing to meet users' needs for high accuracy and completeness.
The algorithm for cleaning and optimizing cycling tracks employs multi-dimensional abnormal data identification and correction, trajectory point simplification and key feature point retention, intelligent switching of multiple positioning modules, and trajectory interruption recovery. It includes steps such as abnormal data judgment, trajectory point screening, smoothing processing, and trajectory data recovery, combined with the moving average algorithm and RecordID technology.
It achieves efficient cleaning and optimization of cycling trajectory data, improving the accuracy, completeness and continuity of the trajectory data, and is suitable for smart terminals and applications in various cycling scenarios.
Smart Images

Figure CN122019977A_ABST
Abstract
Description
Technical Field
[0001] This invention provides an efficient algorithm for cleaning and optimizing cycling motion trajectories, belonging to the field of motion trajectory data processing technology. Background Technology
[0002] With the popularization of outdoor sports, cycling has become a favorite form of exercise, leading to the development of various cycling apps. Accurate recording and analysis of cycling tracks are core functions of these apps. During cycling, the positioning module is susceptible to environmental obstructions and signal interference, causing anomalies such as drift and speeding in the raw positioning data. Simultaneously, data collected by sensors, such as cadence and power, can also be inaccurate due to device vibration and signal transmission problems. Furthermore, cycling apps may unexpectedly exit due to device malfunctions or system anomalies, interrupting track recording. If track recovery is not possible, the cycling track data will be incomplete.
[0003] Existing cycling trajectory processing algorithms mostly perform simple filtering for single anomaly types, resulting in incomplete anomaly identification and crude correction methods. Furthermore, trajectory point filtering lacks targeted retention of cycling feature points, easily leading to the loss of key motion data. At the same time, traditional algorithms do not consider the switching and adaptation of multiple positioning modules, resulting in poor positioning continuity, insufficient accuracy in trajectory smoothing, and a lack of a robust trajectory interruption recovery mechanism. This leads to significant deviations between the processed cycling trajectory and the actual cycling path, low data integrity, and an inability to provide users with accurate cycling trajectory analysis and motion data statistics, failing to meet users' needs for high-precision and complete cycling trajectory recording.
[0004] To address the aforementioned issues, this invention proposes a highly efficient algorithm for cleaning and optimizing cycling tracks. This algorithm enables accurate identification and correction of multi-dimensional abnormal data, balances track point simplification with key feature point retention, improves track smoothness, and simultaneously achieves intelligent switching between multiple positioning modules and stitching recovery after track interruption. This effectively enhances the accuracy, completeness, and continuity of cycling track data. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide an efficient algorithm for cleaning and optimizing cycling trajectory data. This algorithm solves the problems of incomplete anomaly identification, low trajectory accuracy, poor positioning continuity, and inability to effectively recover trajectory interruptions in existing cycling trajectory processing algorithms, thereby achieving efficient cleaning, optimization, and complete recording of cycling trajectory data.
[0006] To address the aforementioned problems, the present invention proposes a technical solution: an efficient algorithm for cleaning and optimizing cycling trajectories, comprising the following steps: S1. Raw data acquisition: The positioning module acquires raw positioning data during the cycling process at a frequency of 1 second / time. The raw positioning data includes latitude and longitude, speed, altitude, and timestamp. At the same time, the sensor acquires cadence and power data. S2. Abnormal data identification: Based on a preset abnormal threshold, determine whether the original positioning data is abnormal. The abnormality includes drift abnormality and overspeed abnormality. The judgment condition for drift abnormality is that the distance difference between two adjacent positioning points is greater than 1000m, and the judgment condition for overspeed abnormality is that the positioning point speed is greater than 19.444445m / s. S3. Abnormal Data Correction: For identified drift anomaly data, replace the current anomaly point coordinates with the coordinates of the previous valid positioning point; for identified overspeed anomaly data, correct the current point speed to 0.9 times the historical maximum speed. S4. Track point optimization and filtering: Valid track points are filtered at 3-second intervals, and feature points during the cycling process are forcibly retained. These feature points include the maximum speed point, maximum cadence point, maximum power point, highest altitude point, and lowest altitude point. S5. Trajectory Smoothing: The selected valid trajectory points are smoothed using a moving average algorithm to obtain the optimized cycling trajectory. S6. Track data recovery steps: When the cycling application is restarted after an abnormal exit, the unique identifier RecordID of the cycling record is read from the local database. The corresponding track point data, sensor data and cycling status data are obtained through RecordID, and the interrupted track is stitched together to restore it.
[0007] Furthermore, in step S1, the positioning module includes an Amap positioning module and a system positioning module. A 13-second switching countdown is set between the two positioning modules. When one positioning module fails to acquire valid positioning data within 13 seconds, it automatically switches to the other positioning module for positioning.
[0008] Furthermore, the abnormal data identification in step S2 also includes the identification of abnormal altitude data. The judgment condition for abnormal altitude data is that the altitude difference between two adjacent positioning points is greater than 5m. When the altitude data exceeds the threshold three times in a row, the altitude data is determined to be valid and no further correction is made.
[0009] Furthermore, the specific process of trajectory point optimization and filtering in step S4 is as follows: extract the trajectory point sequence from the original positioning data and sort it according to the timestamp; initialize the trajectory point filtering counter, starting from the first trajectory point, and retain one trajectory point every 3 seconds; traverse the trajectory point sequence, identify feature points and force retention, and if the feature point is the same as the trajectory point filtered by time interval, only one is retained.
[0010] Furthermore, in step S5, the window size of the moving average algorithm is 3 trajectory points, and the average latitude and longitude of the trajectory points within the window is calculated as the optimized coordinates of the center trajectory point of the window.
[0011] Furthermore, during the trajectory data recovery step in step S5, if the interval between the current time and the cycling interruption time exceeds 8 hours, a confirmation pop-up window for continuing cycling will appear; when the user selects to continue cycling, the continuous timestamp ContinueTime will be updated to the current time, and the newly collected trajectory data will be stitched together with the historical trajectory data.
[0012] Furthermore, it also includes a trajectory data format conversion step: converting the proprietary format coordinates output by the Gaode positioning module into standard GPS format coordinates and storing them uniformly in a local database.
[0013] Furthermore, in step S1, the sensor includes an A001 cadence power meter. The A001 cadence power meter is calibrated before data acquisition. The calibration parameters include the device weight and the centering AD value. The normal range of the centering AD value is 4096±100.
[0014] Furthermore, it also includes a trajectory data reporting step: binding the optimized cycling trajectory data and exercise data with device information, and uploading it to the server via the network. The device information includes the device SN number and firmware version number.
[0015] Due to the adoption of the above technical solution, the beneficial effects of the efficient cycling trajectory cleaning and optimization algorithm of the present invention are as follows: 1. Comprehensive anomaly detection: It enables multi-dimensional identification of drift anomalies, overspeed anomalies, and altitude data anomalies, and sets continuous detection and judgment rules for altitude anomaly data to avoid misjudgments caused by sudden terrain changes and improve the accuracy of anomaly detection. 2. Targeted anomaly correction: Different correction methods are used for different types of anomaly data. Drift anomalies are replaced with the coordinates of the previous valid point, and speeding anomalies are proportionally corrected based on the historical maximum speed to ensure that the corrected data is reasonable and in line with the actual riding conditions. 3. Intelligent trajectory filtering: The trajectory points are simplified at 3-second intervals, while cycling feature points are forcibly retained. This reduces the amount of data and improves processing efficiency while avoiding the loss of key motion data, thus balancing trajectory simplification and data integrity. 4. Strong positioning continuity: A 13-second intelligent switching mechanism between the Gaode positioning module and the system positioning module is set up to effectively solve the problem of positioning interruption caused by signal blockage and interference from a single positioning module, and ensure the continuity of raw positioning data collection. 5. Track recovery completeness: Based on RecordID, accurate data retrieval is achieved after track interruption. An 8-hour time threshold is set and a user confirmation pop-up is added to realize intelligent track splicing and recovery, improving the user experience. 6. Data Standardization and Accuracy: A coordinate format conversion step is added to unify the data format of different positioning modules. At the same time, the cadence power meter is calibrated to ensure the accuracy of sensor data acquisition and provide a reliable data foundation for trajectory processing. 7. Data traceability: The optimized cycling data is bound to the equipment information and uploaded to the server to realize cloud storage of cycling data and traceability of equipment information, which facilitates users to view and analyze the data later.
[0016] The algorithm of this invention has clear steps and high processing efficiency. It can effectively solve the problems of data anomalies, positioning interruptions, and trajectory interruptions during the cycling trajectory collection process, significantly improving the accuracy, continuity, and integrity of cycling trajectory. It is applicable to various cycling-related smart terminals and applications and has high practical application value. Attached Figure Description
[0017] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of an efficient cycling trajectory cleaning and optimization algorithm according to the present invention. Detailed Implementation
[0018] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Example 1: Urban Commuting Cycling (Smartphone Application) This embodiment is applied to a smartphone cycling APP, which is suitable for short-distance cycling scenarios in urban commuting. The smartphone is equipped with Android 14 system and has a built-in system positioning module (GPS + Beidou dual mode). The APP integrates Gaode positioning module, connects to an external Bluetooth A001 cadence power meter, and the local database of the phone is a lightweight SQLite database, which supports 4G / 5G wireless communication to upload data to the cloud server.
[0020] The specific implementation steps of this algorithm are as follows: S1, Raw Data Acquisition First, pair your smartphone with the A001 cadence and power meter via Bluetooth, enter the calibration interface, input the weight of your commuter bicycle (12kg), and check the alignment AD value to be 4120, which is within the normal range of 4096±100. Calibration is then complete. Initialize the positioning module, using the system positioning module as the initial data acquisition module. Set a 13-second countdown for switching, and collect raw positioning data (latitude, longitude, speed, altitude, and timestamp) at a frequency of 1 second. If the system positioning module fails to acquire valid positioning data within 13 seconds in areas obstructed by tall buildings, it automatically switches to the Gaode positioning module. Simultaneously, the calibrated A001 cadence and power meter synchronously collects cadence and power data at a rate of 1 second. All raw data is stored in real-time in the phone's local SQLite database.
[0021] S2, Abnormal Data Identification Real-time location data is read from the local database and sorted by timestamp. Anomalies are judged point by point: a difference in distance between adjacent location points exceeding 1000m is judged as a drift anomaly; a speed exceeding 19.444445m / s is judged as an overspeed anomaly; a difference in altitude between adjacent points exceeding 5m is initially judged as an altitude anomaly. If the altitude exceeds the threshold three times consecutively when passing through pedestrian overpasses / underpasses during urban commuting, the altitude data is judged as valid and the anomaly mark is removed.
[0022] S3, Abnormal Data Correction When drift anomalies occur during urban commuting due to obstruction by tall buildings, the coordinates of the previous valid positioning point are retrieved to replace the coordinates of the anomaly point. If an overspeeding anomaly occurs due to sudden acceleration (such as sprinting at an intersection), the maximum speed in the commuting cycling history of 15 m / s is extracted, and the speed of the overspeeding point is corrected to 15 × 0.9 = 13.5 m / s. Non-consecutive elevation anomalies are temporarily marked for subsequent smoothing processing.
[0023] S4, Track Point Optimization Filtering Extract valid trajectory point sequences from the local database and sort them in ascending order by timestamp. Initialize a counter to filter trajectory points at 3-second intervals. Identify and force the retention of maximum speed points, maximum power points, and highest / lowest altitude points (such as the highest point of an overpass and the lowest point of an underpass) during the commuting process. If a feature point is repeated with a point filtered at a 3-second interval, only one will be retained, thus reducing the amount of data while retaining key commuting trajectory features.
[0024] S5, Trajectory Smoothing Processing The filtered trajectory points are processed using a moving average algorithm with a window size of 3. The average latitude and longitude of the three trajectory points in each window are calculated as the optimized coordinates of the trajectory point at the center of the window. The first and last trajectory points retain their original coordinates, thus eliminating the jagged edges of the trajectory caused by slight turns on urban roads and positioning jitter.
[0025] S6. Trajectory Data Format Conversion The GCJ-02 format coordinates collected by the Gaode positioning module are converted into standard WGS-84 GPS format coordinates. The original data of the system positioning module is in WGS-84 format and does not need to be converted. After all the standardized coordinates are associated with the corresponding motion data, they are re-stored into the local database.
[0026] S7, Trajectory Data Recovery If the app crashes due to low battery during the commute, the user can restart the app after charging. The system will automatically read the RecordID of the current ride, retrieve the trajectory, sensor, and riding status data from the local database, and calculate the time interval between the current time and the interruption. If the interval is 20 minutes (not exceeding 8 hours), the newly collected data will be seamlessly stitched together with the historical data according to the timestamp. If the interval exceeds 8 hours (e.g., the user is going home from get off work and will continue riding the next day), a confirmation pop-up will appear. If the user chooses to continue, the ContinueTime will be updated and the data will be stitched together. If the user chooses to abandon, a new RecordID will be created.
[0027] S8, Trajectory Data Reporting After a user completes their commute, the app binds the optimized trajectory data, cadence / power data, and mobile device information (SN number, Android system version, app firmware version) to the cloud server via the 4G network. The server stores the data according to RecordID and device SN number. Users can view analysis data such as commute trajectory, average speed, and energy consumption through the app.
[0028] Example 2: Outdoor Road Cycling (Application of Professional Cycling Computer) This embodiment is applied to a professional cycling computer, suitable for long-distance outdoor road cycling scenarios. The computer features dual-mode Beidou / GPS positioning, a built-in Gaode positioning module and its own system positioning module, an integrated A001 cadence power meter, and a large-capacity flash memory database. It supports data upload via Bluetooth 5.0 and WiFi, making it suitable for the characteristics of long-distance, high-speed road cycling scenarios with stable positioning signals.
[0029] S1, Raw Data Acquisition After powering on, the cycling computer automatically calibrates the integrated A001 cadence and power meter. With the road bike weight of 8.5kg input, the AD value for centering is detected at 4050, which is within the normal range. Using the Gaode positioning module as the initial module, a 13-second countdown switches, collecting positioning data every second. In unobstructed outdoor scenarios, the Gaode positioning module remains effective without switching. The integrated sensor simultaneously collects cadence and power data, storing it in real-time in a flash memory database, supporting offline storage of over 100 hours of raw data.
[0030] S2, Abnormal Data Identification The positioning signal is stable when cycling on outdoor roads, and drifting anomalies are rare. It mainly identifies speeding anomalies (such as downhill sprints) and altitude anomalies (such as when crossing mountains). An anomaly is initially identified when the altitude difference between adjacent areas exceeds 5m. If an altitude increase is detected three times in a row (such as on a climbing section), it is considered a valid shape change and the anomaly mark is removed.
[0031] S3, Abnormal Data Correction If speeding anomalies occur on the downhill section, extract the historical maximum speed of 18 m / s from road cycling and correct the speeding point speed to 16.2 m / s; a small number of single-point altitude anomalies caused by airflow are temporarily marked and will be smoothed later; continuous altitude anomalies on the uphill section are directly used as valid data.
[0032] S4, Track Point Optimization Filtering The system filters trajectory points at 3-second intervals, significantly reducing the amount of data required for long-distance cycling. It also forcibly retains key feature points such as the highest altitude point on uphill sections, the maximum speed point on downhill sections, and the maximum power point on flat sections, ensuring the integrity of road cycling data.
[0033] S5, Trajectory Smoothing Processing The 3-point moving average algorithm processes the filtered trajectory points to eliminate positioning deviations caused by slight body vibrations during road riding, making the trajectory conform to the actual road route and improving trajectory accuracy.
[0034] S6-S8, Subsequent Processing After completing coordinate format conversion and track recovery (such as recovery after the cycling computer unexpectedly shuts down), when the user finishes riding and returns indoors, the cycling computer automatically connects to WiFi, binds the optimized data with the cycling computer device information (SN number, firmware version), and uploads it in batches to the cloud server. Users can view professional data such as track analysis, elevation profile, and power curve of long-distance road riding on their computers.
[0035] Example 3: Mountain Bike Cross-Country Riding (Smart Helmet Application) This embodiment is applied to a smart cycling helmet, which is suitable for mountain off-road cycling scenarios. The helmet has a built-in micro positioning module (Gaode + system dual mode), an external waterproof A001 cadence power meter, and a local database that is a micro embedded database. It supports low-power Bluetooth upload and is adapted to the characteristics of mountain off-road cycling scenarios, such as many positioning signal blockages, large altitude changes, and the need for waterproof and shockproof devices.
[0036] S1, Raw Data Acquisition After the helmet is powered on, it is paired and calibrated with a waterproof A001 cadence power meter via low-power Bluetooth. The weight of the mountain bike is input as 15kg, and the AD value for centering is detected as 4180, which is within the normal range. The positioning module is initialized, and a 13-second countdown is used for switching. In mountainous forest / valley areas where the system positioning module is obstructed, it is prone to inaccuracy. If no valid data is obtained within 13 seconds, it will automatically switch to the Gaode positioning module to ensure continuous positioning. The sensor collects data once per second and stores it in real time in the embedded database. The low-power design is adapted to the helmet's battery life requirements.
[0037] S2, Abnormal Data Identification In mountain off-road scenarios, the altitude changes drastically. The focus is on identifying altitude anomalies (adjacent differences exceeding 5m). If an altitude decrease (such as on a downhill section) or increase (such as on a climbing section) is detected three times in a row, it is considered valid shape data. At the same time, drift anomalies caused by signal obstruction (adjacent distances exceeding 1000m) are also identified. Speeding anomalies are extremely rare due to the limitations of mountain road conditions.
[0038] S3, Abnormal Data Correction For drift anomalies caused by signal obstruction, the coordinates of the previous valid point are used to replace them; single-point elevation anomalies (such as sensor misjudgments caused by bumps) are temporarily marked, while continuous elevation anomalies are directly used as valid data to ensure the terrain authenticity of mountain tracks.
[0039] S4, Track Point Optimization Filtering The trajectory points are filtered at 3-second intervals to force the retention of key feature points of mountain biking: highest altitude (mountain top), lowest altitude (valley), maximum cadence (climbing), and maximum power (sprinting), so as to avoid the loss of key trajectory data in complex mountain terrain.
[0040] S5, Trajectory Smoothing Processing The 3-point moving average algorithm processes trajectory points, eliminating positioning jitter caused by mountain bumps, while retaining key trajectory features such as sharp turns and steep slopes of mountain routes, balancing smoothness and terrain realism.
[0041] S6-S8, Subsequent Processing If the helmet shuts down abnormally due to a collision, it will automatically read the RecordID to restore the trajectory after restarting. Offline trajectory restoration is supported when there is no network in mountainous scenarios. Once the user returns to an area with a signal, the data will be transmitted to the mobile phone via Bluetooth Low Energy, and then uploaded to the server by the mobile phone. The uploaded data includes helmet device information and professional data on mountain biking, allowing users to analyze indicators such as the difficulty and energy consumption of off-road routes.
[0042] Example 4: Indoor / Outdoor Hybrid Cycling (On-board Terminal Application) This embodiment is applied to the on-board terminal of a smart cycling trainer, which is suitable for mixed scenarios of indoor cycling trainer training and outdoor short-distance cycling. The on-board terminal integrates the Gaode positioning module and the system positioning module, and seamlessly connects with the A001 cadence power meter that comes with the cycling trainer. The local database is a cloud-edge collaborative database, which supports trajectory simulation when there is no positioning signal indoors and the fusion processing of outdoor positioning data.
[0043] S1, Raw Data Acquisition After the vehicle terminal is powered on, it automatically calibrates the A001 cadence and power meter. The weight of the training bicycle is 10kg. The AD value of the centering is detected to be 4090, which is within the normal range. During indoor cycling, the positioning module automatically goes into sleep mode. The sensor collects cadence and power data once per second. The terminal simulates indoor cycling trajectory data and stores it in the database. During outdoor cycling, the terminal automatically wakes up the positioning module. The countdown switches every 13 seconds. The positioning data is collected once per second. The sensor collects data synchronously. Indoor and outdoor data are stored separately according to timestamps.
[0044] S2, Abnormal Data Identification In the indoor phase, there is no positioning data; only the validity of sensor data is checked. In the outdoor phase (such as short-distance cycling around the community), drift anomalies and altitude anomalies are identified. Because the outdoor short distance is short, speeding anomalies rarely occur. If the altitude exceeds the threshold three times in a row, it is determined to be valid data caused by changes in the community terrain (such as slopes).
[0045] S3, Abnormal Data Correction In the outdoor phase, drift anomalies are replaced with the coordinates of the previous valid point. Altitude anomalies are temporarily marked. If there are no anomalies in indoor sensor data, the process proceeds directly to the next step.
[0046] S4, Track Point Optimization Filtering Indoor data is filtered at 3-second intervals to retain the maximum power and maximum cadence characteristic points of indoor training; outdoor data is filtered at 3-second intervals to retain the highest / lowest altitude points of outdoor cycling. Indoor and outdoor characteristic points are marked separately to avoid data confusion.
[0047] S5, Trajectory Smoothing Processing The outdoor trajectory is processed using a 3-point moving average algorithm to eliminate positioning errors caused by building obstruction in residential areas; the indoor simulated trajectory is smoothed and optimized based on the cycling platform power data to ensure that the indoor trajectory data is in the same format as the outdoor data.
[0048] S6, Trajectory Data Recovery If an abnormal exit occurs during a mixed ride due to a terminal disconnection, the RecordID is read after reconnection to distinguish between indoor and outdoor data for recovery. If the interruption occurs during the indoor / outdoor switching phase, the system automatically identifies the data type and seamlessly stitches the indoor simulated track with the actual outdoor track.
[0049] S7, Trajectory Data Format Conversion Outdoor Gaode positioning module data is converted to standard GPS format, and indoor simulated tracks are directly in standard GPS format. All data formats are unified and then stored in the cloud-edge collaborative database.
[0050] S8, Trajectory Data Reporting After completing the hybrid ride, the onboard terminal binds the optimized indoor and outdoor trajectory data, sensor data, and terminal device information (SN number, firmware version) to the cloud server via WiFi. The server then performs integrated analysis of indoor training data and outdoor cycling data to provide users with a comprehensive sports report on the hybrid ride.
[0051] In summary, the algorithm of this invention has clear steps and high processing efficiency, which can effectively solve problems such as data anomalies, positioning interruptions, and trajectory interruptions during the cycling trajectory collection process. It significantly improves the accuracy, continuity, and completeness of cycling trajectory, and is applicable to various cycling-related smart terminals and applications, thus having high practical application value.
[0052] The present invention and its embodiments have been described above. This description is not restrictive. In short, if a person skilled in the art is inspired by this description and designs a similar structure and embodiment without departing from the spirit of the present invention, such design should fall within the protection scope of the present invention.
Claims
1. An efficient algorithm for cleaning and optimizing cycling trajectories, comprising the following steps: S1. Raw data acquisition: The positioning module acquires raw positioning data during the cycling process at a frequency of 1 second / time. The raw positioning data includes latitude and longitude, speed, altitude, and timestamp. At the same time, the sensor acquires cadence and power data. S2. Abnormal data identification: Based on a preset abnormal threshold, determine whether the original positioning data is abnormal. The abnormality includes drift abnormality and overspeed abnormality. The judgment condition for drift abnormality is that the distance difference between two adjacent positioning points is greater than 1000m, and the judgment condition for overspeed abnormality is that the positioning point speed is greater than 19.444445m / s. S3. Abnormal Data Correction: For identified drift anomaly data, replace the current anomaly point coordinates with the coordinates of the previous valid positioning point; for identified overspeed anomaly data, correct the current point speed to 0.9 times the historical maximum speed. S4. Track point optimization and filtering: Valid track points are filtered at 3-second intervals, and feature points during the cycling process are forcibly retained. These feature points include the maximum speed point, maximum cadence point, maximum power point, highest altitude point, and lowest altitude point. S5. Trajectory Smoothing: The selected valid trajectory points are smoothed using a moving average algorithm to obtain the optimized cycling trajectory. S6. Track data recovery steps: When the cycling application is restarted after an abnormal exit, the unique identifier RecordID of the cycling record is read from the local database. The corresponding track point data, sensor data and cycling status data are obtained through RecordID, and the interrupted track is stitched together to restore it.
2. The efficient cycling trajectory cleaning and optimization algorithm according to claim 1, characterized in that: The positioning module in step S1 includes an Amap positioning module and a system positioning module. A 13-second switching countdown is set between the two positioning modules. If one positioning module fails to obtain valid positioning data within 13 seconds, it will automatically switch to the other positioning module for positioning.
3. The efficient cycling trajectory cleaning and optimization algorithm according to claim 1, characterized in that: The abnormal data identification in step S2 also includes the abnormal identification of altitude data. The judgment condition for abnormal altitude data is that the altitude difference between two adjacent positioning points is greater than 5m. When the altitude data exceeds the threshold three times in a row, the altitude data is determined to be valid and no further correction is made.
4. The efficient cycling trajectory cleaning and optimization algorithm according to claim 1, characterized in that: The specific process of trajectory point optimization and filtering in step S4 is as follows: extract the trajectory point sequence from the original positioning data and sort it according to the timestamp; initialize the trajectory point filtering counter, starting from the first trajectory point, and retain one trajectory point every 3 seconds; traverse the trajectory point sequence, identify feature points and force retention, and if the feature point is the same as the trajectory point filtered by time interval, only one is retained.
5. The efficient cycling trajectory cleaning and optimization algorithm according to claim 1, characterized in that: In step S5, the window size of the moving average algorithm is 3 trajectory points, and the average latitude and longitude of the trajectory points within the window is calculated as the optimized coordinates of the center trajectory point of the window.
6. The efficient cycling trajectory cleaning and optimization algorithm according to claim 1, characterized in that: In step S5, during the trajectory data recovery step, if the interval between the current time and the time the ride was interrupted exceeds 8 hours, a confirmation pop-up window for continuing the ride will appear. When the user selects to continue the ride, the continuous timestamp ContinueTime will be updated to the current time, and the newly collected trajectory data will be stitched together with the historical trajectory data.
7. The efficient cycling trajectory cleaning and optimization algorithm according to claim 1, characterized in that: It also includes a trajectory data format conversion step: converting the proprietary format coordinates output by the Gaode positioning module into standard GPS format coordinates and storing them uniformly in the local database.
8. The efficient cycling trajectory cleaning and optimization algorithm according to claim 1, characterized in that: In step S1, the sensor includes an A001 cadence power meter. The A001 cadence power meter is calibrated before data acquisition. The calibration parameters include the device weight and the centering AD value. The normal range of the centering AD value is 4096±100.
9. The efficient cycling trajectory cleaning and optimization algorithm according to claim 1, characterized in that: It also includes a trajectory data reporting step: binding the optimized cycling trajectory data and exercise data with device information and uploading it to the server via the network. The device information includes the device SN number and firmware version number.