Segment matching system, method, and computer-readable storage medium

CN122994336APending Publication Date: 2026-10-27SHANGHAI DABUZIDUO INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611127638.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0004]本发明的目的在于克服现有技术的缺陷,提供一种赛段匹配系统、方法及计算机可读存储介质,解决现有技术中现有赛段匹配系统在大规模数据下匹配效率低的问题

Benefits of technology

1、通过空间索引模块对路书的地理位置信息构建RTree空间索引,在进行赛段匹配前先以运动数据的地理包围盒为查询条件在索引中进行范围搜索,快速筛选出候选路书集合,使后续精细匹配仅需对候选路书集合中的少量路书进行计算,避免了全量路书的遍历匹配,将匹配效率提升数个数量级,支持十万级赛段规模的实时在线匹配。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122994336A_ABST
    Figure CN122994336A_ABST
Patent Text Reader

Abstract

The application relates to a race section matching system, a method and a computer readable storage medium, wherein the system comprises a client and a cloud; the client comprises a data collection module and a data transmission module; the cloud comprises a data storage module, a space index module, a data matching module and a data pushing module; the application constructs an RTree space index for geographical position information of a road book through the space index module, performs range search in the index by taking a geographical bounding box of sports data as a query condition before race section matching, quickly screens out a candidate road book set, and makes subsequent fine matching only need to calculate a small amount of road books in the candidate road book set, avoids traversal matching of full road books, improves matching efficiency by several orders of magnitude, and supports real-time online matching of a 100,000-level race section scale.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart wearable device technology, and specifically to a race segment matching system, method, and computer-readable storage medium. Background Technology

[0002] Currently, recording outdoor sports tracks (such as cycling and running) using mobile phones or other GNSS devices has become a common practice for sports enthusiasts. Sports track data usually includes information such as timestamps, latitude and longitude, altitude, and speed. Some devices can also record exercise physiological data such as heart rate, cadence, and power. By synchronizing this data to the cloud, users can be provided with services such as sports track data analysis, sharing, and training guidance.

[0003] However, with the continuous growth of the number of users and race segments, the cloud needs to achieve real-time matching of user trajectories with massive race segments under large-scale data, which places high demands on the system's processing efficiency. Existing solutions usually use a full traversal approach for matching calculation, that is, comparing each user trajectory with all race segments in the database. When the number of race segments reaches tens of thousands or even hundreds of thousands, the matching time will increase dramatically, making it difficult to meet the real-time requirements. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a race segment matching system, method and computer-readable storage medium to solve the problem of low matching efficiency of existing race segment matching systems under large-scale data.

[0005] To achieve the above objectives, the present invention provides a race segment matching system, including a client and a cloud; the client includes a data collection module and a data transmission module; wherein, The data collection module is used to collect the user's motion data and transmit it to the data transmission module; The data transmission module is used to transmit motion data and route maps to the cloud. The cloud platform includes a data storage module, a spatial indexing module, a data matching module, and a data push module; among which, The data storage module is used to store motion data and route maps; The spatial index module is used to obtain the geographic location information of at least one route book stored in the data storage module, construct a spatial index based on the geographic location information, and search in the spatial index based on the geographic location information of the motion data to obtain a set of candidate route books. The data matching module is used to match the route books in the candidate route book set with the motion data to determine the target route book that matches the motion data; The data push module is used to push the matching results of the target route book to the client.

[0006] By adopting this technical solution, a spatial index is constructed based on the geographical location information of the route book through the spatial index module. The candidate route book set is obtained by searching the spatial index based on the geographical location information of the motion data. This allows the data matching module to perform matching calculations on only a small number of route books in the candidate route book set, avoiding the traversal and matching of the entire route book. This significantly improves the matching efficiency in large-scale race segment scenarios and solves the technical problem that existing technologies cannot balance matching real-time performance and data scale.

[0007] Furthermore, the cloud platform also includes a data processing module and a data optimization module; wherein, The data processing module is used to remove abnormal data and homogenize the route book, and generate race segment data; The data optimization module is used to clean and homogenize the motion data that overlaps with the race segment data, and then send the processed motion data to the data matching module.

[0008] By adopting this technical solution, the data processing module removes abnormal data and homogenizes the route book to generate race segment data, and the data optimization module cleans and homogenizes the motion data, ensuring the data quality of the route book and motion data. This provides a standard data foundation for subsequent accurate matching, thereby improving the accuracy of matching.

[0009] Furthermore, the spatial indexing module constructs an RTree spatial index based on the geographical bounding box of the route book; The spatial indexing module uses the geographic bounding box of the motion data as the query condition to perform a range search in the RTree spatial index to obtain the candidate route book set.

[0010] By adopting this technical solution, an index is built using the geographical bounding box of the route book as the spatial key through the RTree spatial index structure, and a range search is performed using the geographical bounding box of the motion data as the query condition, thus achieving efficient spatial range query. The time complexity of the RTree index is logarithmic, which can support real-time online matching of hundreds of thousands of race segments, significantly better than the linear complexity of full traversal.

[0011] Furthermore, the data matching module employs a sequence matching algorithm to match the route books in the candidate route book set with the motion data, specifically including: Obtain multiple motion trajectory points from the motion data and multiple route book trajectory points from the candidate route book set, and construct motion trajectory point sequences and route book trajectory point sequences respectively; The distance between each point in the motion trajectory point sequence and each point in the road book trajectory point sequence is calculated using a distance matrix. When the distance is less than a preset threshold, it is marked as a matching point. The number of consecutive matching points determines whether the motion data and the route book are successfully matched.

[0012] By adopting this technical solution, the distance between each point in the sequence of movement trajectory points and the sequence of route book trajectory points is calculated using a distance matrix. The number of consecutive matching points determines whether a match is successful, thus achieving accurate matching between the trajectory and the route book. The distance matrix matching algorithm has high execution efficiency and can achieve data matching in seconds for real-time matching of tens of thousands of race segments and trajectories.

[0013] Furthermore, the data matching module is also used to perform lap matching when the motion data includes multiple laps of cycling data along the same route: Multiple starting points in the motion trajectory point sequence are selected sequentially in a step-by-step manner, and each starting point is matched with the route book trajectory point sequence to obtain multiple candidate matching segments; Calculate the matching rate for each candidate matching segment, and determine the candidate matching segments whose matching rate exceeds a preset threshold as valid matching segments; Assign a unique cycle number to each of the valid matching segments.

[0014] By adopting this technical solution, a lap matching function is provided on top of basic matching. When a user rides multiple laps on the same route, the motion data of each lap is automatically identified and assigned an independent lap number through step scanning. Users do not need to manually mark the laps, which solves the technical problem of not being able to perform fine analysis of multiple laps. Users can view the data comparison of each lap and intuitively understand the performance changes of each lap.

[0015] Furthermore, the data matching module is also used to identify the direction of motion of the motion data relative to the road book. When the identification result is a reverse direction match, adjacent reverse direction matching segments are merged.

[0016] By adopting this technical solution, by identifying the direction of motion data relative to the route book, adjacent opposite-direction matching segments are automatically merged during opposite-direction matching, supporting bidirectional matching, avoiding duplicate counting, ensuring the accuracy of matching data, and further improving the reliability of loop matching.

[0017] The present invention also provides a segment matching method, comprising: Obtain the user's exercise data and at least one route map; A spatial index is constructed based on the geographical location information of each route book; Based on the geographic location information of the motion data, a search is performed in the spatial index to obtain a set of candidate route books; Match the route books in the candidate route book set with the motion data to determine the target route book that matches the motion data; The matching results of the target route book will be pushed to the user.

[0018] Furthermore, constructing a spatial index based on the geographical location information of each of the aforementioned route books includes: The trajectory points of each of the aforementioned road books are subjected to equidistant uniform interpolation processing; Calculate the geographic bounding box for each of the aforementioned route books; Construct an RTree spatial index using the aforementioned geographic bounding boxes as spatial keys.

[0019] Furthermore, matching the route books in the candidate route book set with the motion data includes: Obtain multiple motion trajectory points from the motion data and multiple route book trajectory points from the candidate route book set; The motion trajectory point sequence is scanned segment by segment using a sliding window algorithm. Each scanned segment is matched with the route book trajectory point sequence to obtain at least one candidate matching segment. The matching rate of each candidate matching segment is calculated, and the candidate matching segment with a matching rate exceeding a preset threshold is determined as a valid matching segment. When there are multiple valid matching segments, assign lap numbers to each valid matching segment, extract the motion data corresponding to each valid matching segment, and calculate the motion parameters of each lap based on the motion data corresponding to each valid matching segment. The exercise parameters include at least one of the following: exercise time, average speed, maximum speed, average heart rate, maximum heart rate, average cadence, maximum cadence, average power, and maximum power.

[0020] Furthermore, matching each scan segment with the sequence of points in the roadbook trajectory includes: The two-pointer method is used to traverse the motion trajectory points in the scan segment and the road book trajectory points in the road book trajectory point sequence, respectively, and calculate the distance between each pair. When the distance is less than a preset matching threshold, it is marked as a matching point. The cumulative number of matching points is used to calculate the matching rate between the scanned segment and the road book.

[0021] Furthermore, it also includes: The direction of movement is identified based on the matching order between the sequence of movement trajectory points and the sequence of trajectory points in the road book; When the recognition result is a reverse direction match, the adjacent valid reverse direction match segments are merged.

[0022] The present invention also provides a computer-readable storage medium storing a segment matching program, which, when executed by a processor, implements the segment matching method.

[0023] Compared with the prior art, the present invention has the following advantages: 1. By constructing an RTree spatial index based on the geographic location information of the route book through the spatial index module, a range search is performed in the index before the segment matching is performed, using the geographic bounding box of the motion data as the query condition to quickly filter out the candidate route book set. This allows subsequent fine matching to only need to calculate a small number of route books in the candidate route book set, avoiding the traversal and matching of the entire route book, improving the matching efficiency by several orders of magnitude, and supporting real-time online matching of hundreds of thousands of segments.

[0024] 2. Building upon the basic matching algorithm, a lap matching mode is further provided. When a user performs multiple laps on the same route, the system scans the trajectory data segment by segment using a sliding window algorithm. Combined with dual-pointer distance matching, it can automatically identify the motion data for each lap without requiring the user to manually mark the laps. Each valid matching segment is assigned an independent lap number, and the motion data for each lap is recorded independently and stored in the database. Users can view and compare the data for each lap, including the time taken for each lap, average speed, maximum speed, heart rate zone, power output, and other motion parameters, to intuitively understand the performance changes for each lap during multi-lap training.

[0025] 3. Supports automatic recognition of forward and reverse cycling, automatically determining the direction of movement based on the matching order of the trajectory point sequence and the route book point sequence; when a reverse matching is detected, the algorithm automatically merges adjacent reverse looping segments to avoid duplicate counting and ensure the accuracy of the matching data. Attached Figure Description

[0026] Figure 1 This is a schematic diagram of the race segment matching method of the present invention. Detailed Implementation

[0027] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. Example

[0028] This embodiment provides a race segment matching system, including a client and a cloud platform; wherein, The client includes a data collection module and a data transmission module. The data collection module collects the user's exercise data and transmits it to the data transmission module. The exercise data specifically includes latitude, longitude, altitude, accuracy, speed, and direction data based on the GNSS system, as well as heart rate, cadence, speed, power, and temperature data from other external sensors. The data transmission module establishes communication between the client and the cloud, transmitting exercise data and route maps to the cloud.

[0029] The cloud platform includes a data storage module, a data processing module, a spatial indexing module, a data matching module, a data optimization module, a data filtering module, and a data push module.

[0030] The data storage module is used to store the motion data and route data transmitted by the data transmission module received from the cloud. The data storage module can use a combination of relational databases and non-relational databases. The metadata of the route data (such as route ID, motion type, creation time, matching threshold, etc.) is stored in the relational database, while the coordinate point sequence of the route data and the user's motion trajectory point sequence are stored in the non-relational database to support efficient geospatial queries.

[0031] The data processing module processes the route books stored in the data storage module. After removing abnormal data, it homogenizes the points in the route books, calculates the boundary information of the route books, converts them into race segment data, and sets matching thresholds. The abnormal data removed are location information anomalies caused by GNSS system errors, including possible drifts in latitude, longitude, and altitude. The homogenization process refers to interpolating the route book trajectory points at set distance intervals to ensure that the distances between points in the route book trajectory point sequence are evenly distributed. For example, for cycling, there is an interpolation point every 16 meters, and for walking, there is an interpolation point every 4 meters.

[0032] The spatial index module loads metadata and coordinates of all online travel books from the data storage module when the service starts. After performing equidistant uniform interpolation on the trajectory points of each travel book, it calculates the geographical bounding box of the travel book (i.e., the minimum longitude, minimum latitude to maximum longitude, maximum latitude of all trajectory points in the travel book). It then uses the RTree spatial index structure to build an index with the spatial range of the bounding box as the spatial key. RTree is a balanced tree structure that can efficiently store multidimensional spatial data and support spatial range queries. When the system receives user motion data, the spatial index module first calculates the geographical bounding box of the trajectory points in the motion data. Using this bounding box as the query condition, it performs a range search in the RTree spatial index, quickly filtering out the candidate travel book set that intersects with the spatial range of the trajectory, significantly reducing the computational load of subsequent matching. The spatial index supports dynamic updates. When a new travel book is added or an existing travel book is removed, there is no need to rebuild the entire index; only the corresponding insertion or deletion operation needs to be performed on the changed travel book.

[0033] The data matching module is used to match the route books in the candidate route book set filtered by the spatial indexing module with the motion data to determine if there is any overlap. The data matching module uses the SegmentNN algorithm to match the trajectory and route book data. Specifically, in a sequence of motion trajectory points with N points, it finds the route segment that matches the sequence of route book trajectory points (M points). An N×M distance matrix is ​​created, where each element of the matrix represents the distance from the i-th point in the motion trajectory point sequence to the j-th point in the route book trajectory point sequence. When the distance is less than a preset matching threshold (2~N meters), it is marked as a matching point position. When the number of consecutively matched points in the M direction is the same as the total number of M, a single match is considered successful. The value of N ranges from 5 to 10, and the value of M is less than N.

[0034] The data optimization module is used to clean and homogenize the motion data that overlaps with the race segment data after the data matching module finds that the candidate route book and the motion data have overlapping locations. Then, the processed data is sent back to the data matching module for fine matching. The data cleaning specifically includes: when the distance between two consecutive points in the motion data exceeds 1000 meters, it is considered abnormal data and is removed; when the speed of multiple points in the motion data exceeds a set threshold, it is considered abnormal data and is removed. The homogenization process is to interpolate the cleaned motion trajectory points at set distance intervals to make the trajectory points evenly distributed, so as to improve the accuracy and efficiency of subsequent matching.

[0035] The data filtering module is used to filter user data matched by the data matching module against the matching threshold of the race segment. If the data falls within the threshold range, the user's motion data is integrated into the trajectory information, and the matching result is sent to the data push module. Specifically, after accurately matching the start and end points of the trajectory route, the motion data between the start and end points is retrieved from the user trajectory database, including speed, altitude, heart rate, cadence, and power data. The module then calculates the motion time, average speed, maximum speed, average altitude, maximum altitude, average heart rate, maximum heart rate, average cadence, maximum cadence, average power, and maximum power motion information for that segment.

[0036] The data push module is used to push matching results to users and record them in the user leaderboard. Example

[0037] This embodiment provides a segment matching method based on the segment matching system of Embodiment 1, specifically including the following steps: acquiring the user's exercise data and at least one route book; constructing a spatial index based on the geographical location information of each route book; searching in the spatial index based on the geographical location information of the exercise data to obtain a set of candidate route books; matching the route books in the candidate route book set with the exercise data to determine the target route book that matches the exercise data; and pushing the matching result of the target route book to the user.

[0038] Constructing a spatial index based on the geographic location information of each route book includes: performing equidistant uniform interpolation on the trajectory points of each route book; calculating the geographic bounding box of each route book; and constructing an RTree spatial index using each geographic bounding box as the spatial key.

[0039] Matching the route books in the candidate route book set with the exercise data includes: acquiring multiple motion trajectory points in the exercise data and multiple route book trajectory points in the candidate route book set; scanning the motion trajectory point sequence segment by segment using a sliding window algorithm, matching each scanned segment with the route book trajectory point sequence to obtain at least one candidate matching segment, and calculating the matching rate of each candidate matching segment. Candidate matching segments with matching rates exceeding a preset threshold are determined as valid matching segments; when there are multiple valid matching segments, assigning lap numbers to each valid matching segment, and extracting the corresponding exercise data for each valid matching segment. Calculating the exercise parameters for each lap based on the exercise data corresponding to each valid matching segment; the exercise parameters include at least one of the following: exercise time, average speed, maximum speed, average heart rate, maximum heart rate, average cadence, maximum cadence, average power, and maximum power.

[0040] Matching each scan segment with the route book trajectory point sequence includes: using a two-pointer method to traverse the motion trajectory points in the scan segment and the route book trajectory points in the route book trajectory point sequence respectively, calculating the distance between each pair, and marking a matching point when the distance is less than a preset matching threshold; accumulating the number of matching points, and calculating the matching rate between the scan segment and the route book based on the number of matching points.

[0041] It also includes: identifying the direction of movement based on the matching order between the sequence of movement trajectory points and the sequence of route book trajectory points; and merging adjacent valid matching segments in the opposite direction when the identification result is a match in the opposite direction. Example

[0042] Based on the basic segment matching method described above, this embodiment further provides a lap matching method. When a user rides multiple laps on the same route (such as a lap race or timed training), the trajectory data contains multiple laps that repeatedly pass through the same segment. The lap matching method, based on the aforementioned basic matching method, further performs segment-by-segment scanning on each matched segment to achieve automatic identification and separation of multi-lap data.

[0043] The loop matching method specifically includes the following steps: Step 1: Trajectory homogenization preprocessing.

[0044] The user trajectory point sequence is subjected to equidistant uniform interpolation. The distance interval of the uniform interpolation is adaptively adjusted according to the type of exercise: one interpolation point every 16 meters for cycling and one interpolation point every 4 meters for walking. The purpose of uniform interpolation is to make the distance between trajectory points evenly distributed, which facilitates the accurate calculation of subsequent sliding window scanning and distance matching.

[0045] Step 2: Spatial index construction and candidate segment selection.

[0046] When the system starts, it loads the metadata and route coordinates of all online race segments. After performing equidistant uniform interpolation on the route points of each race segment, it uses the RTree spatial index to build a geographic index with the race segment bounding box (minimum longitude, minimum latitude to maximum longitude, maximum latitude) as the spatial key. During matching, it first calculates the geographic bounding box of the user's trajectory data, and uses this bounding box as the query condition to perform a range search in the RTree spatial index, quickly filtering out candidate race segments that intersect with the trajectory spatial range, greatly reducing the computational load of subsequent matching.

[0047] Step 3: Sliding window scan.

[0048] The trajectory starting points are selected sequentially in a step-by-step manner for scanning; the step length can be a distance between trajectory points or a fixed length can be set according to actual needs; starting from the first point of the trajectory, each point is used as the starting point of the scanning window to scan the trajectory in segments; specifically, multiple starting points in the motion trajectory point sequence are selected sequentially in a step-by-step manner, and each starting point is matched with the route book trajectory point sequence to obtain a candidate matching segment.

[0049] Step 4: Two-pointer distance matching.

[0050] For each scan segment, a two-pointer method is used to traverse both the motion trajectory points and the route book trajectory points in the scan segment, calculating the spherical distance between each pair of points. The outer loop traverses the route book point sequence, and the inner loop traverses the trajectory point sequence, calculating the distance between each trajectory point and a route book point. When the distance is less than a matching threshold, it is marked as a matching point, and its position is recorded. The matching threshold is adaptively adjusted according to the type of exercise: a 64-meter threshold is used for cycling distances greater than 5000 meters, and a 32-meter threshold is used for distances between 300 and 5000 meters; a 32-meter threshold is used for walking distances greater than 1000 meters, and an 8-meter threshold is used for distances less than 1000 meters.

[0051] Step 5: Match rate calculation.

[0052] The proportion of hits to the total number of comparisons is the matching rate of the scanned segment; each complete scan yields a candidate matching segment, and its start position, end position, and matching rate are recorded.

[0053] Step Six: Iterate through the loop.

[0054] After completing one round of scanning, the trajectory starting point slides forward by one step length to enter the next round of scanning. Steps three to five are repeated until the entire trajectory is scanned. All candidate matching segments are sorted from high to low according to the matching rate.

[0055] Step 7: Assigning numbers around the loop.

[0056] Candidate matching segments with a matching rate higher than a set threshold (e.g., 80%) are identified as valid loop segments, and each valid loop segment is assigned an incremental loop number (loop 1, loop 2, etc.); multiple valid loop segments identified in the same trajectory are numbered sequentially according to time order.

[0057] Step 8: Direction identification and reverse direction merging.

[0058] The direction of movement is determined by the matching order of the trajectory point sequence and the route book point sequence; when the matching order of the trajectory points is consistent with the storage order of the route book points, it is determined to be a positive direction match; when the matching order of the trajectory points is opposite to the storage order of the route book points, it is determined to be a negative direction match; when a negative direction match is detected, adjacent reverse looping segments are merged to avoid duplicate counting.

[0059] Step 9: Precise start and end point calibration.

[0060] For each valid loop segment, the start and end points of the loop are accurately located in its corresponding original trajectory points using a nearest neighbor search algorithm. The start and end times are then calibrated using timestamp data to ensure the accuracy of the calculation of motion duration and distance.

[0061] Step 10: Motion data extraction and persistence.

[0062] For each valid lap segment, after accurately matching the start and end points of the trajectory route, the motion data between the start and end points is retrieved from the trajectory database, including speed, altitude, heart rate, cadence, and power data. The motion time, average speed, maximum speed, average altitude, maximum altitude, average heart rate, maximum heart rate, average cadence, maximum cadence, average power, and maximum power motion information for that lap are calculated. The matching results for each lap are stored in the database separately, with each record containing the lap number, start time, end time, and various motion parameters, supporting subsequent lap-by-lap queries and comparative analysis. Example

[0063] This embodiment provides a computer-readable storage medium storing a race segment matching program, which, when executed by a processor, implements a race segment matching method as described in Embodiment 2 or Embodiment 3. The present invention has been described in detail above with reference to the accompanying drawings and embodiments. Those skilled in the art can make various modifications to the present invention based on the above description. Therefore, certain details in the embodiments should not be construed as limiting the present invention, and the scope of protection of the present invention shall be defined by the appended claims.

Claims

1. A race segment matching system, characterized in that, Includes a client and a cloud; the client includes a data collection module and a data transmission module; wherein, The data collection module is used to collect the user's motion data and transmit it to the data transmission module; The data transmission module is used to transmit motion data and route maps to the cloud. The cloud platform includes a data storage module, a spatial indexing module, a data matching module, and a data push module; among which, The data storage module is used to store motion data and route maps; The spatial index module is used to obtain the geographic location information of at least one route book stored in the data storage module, construct a spatial index based on the geographic location information, and search in the spatial index based on the geographic location information of the motion data to obtain a set of candidate route books. The data matching module is used to match the route books in the candidate route book set with the motion data to determine the target route book that matches the motion data; The data push module is used to push the matching results of the target route book to the client.

2. The race segment matching system according to claim 1, characterized in that, The cloud platform also includes a data processing module and a data optimization module; wherein... The data processing module is used to remove abnormal data and homogenize the route book, and generate race segment data; The data optimization module is used to clean and homogenize the motion data that overlaps with the race segment data, and then send the processed motion data to the data matching module.

3. The race segment matching system according to claim 1, characterized in that, The spatial indexing module constructs an RTree spatial index based on the geographical bounding box of the route book; The spatial indexing module uses the geographic bounding box of the motion data as the query condition to perform a range search in the RTree spatial index to obtain the candidate route book set.

4. The race segment matching system according to claim 1, characterized in that, The data matching module uses a sequence matching algorithm to match the route books in the candidate route book set with the motion data, specifically including: Obtain multiple motion trajectory points from the motion data and multiple route book trajectory points from the candidate route book set, and construct motion trajectory point sequences and route book trajectory point sequences respectively; The distance between each point in the motion trajectory point sequence and each point in the road book trajectory point sequence is calculated using a distance matrix. When the distance is less than a preset threshold, it is marked as a matching point. The number of consecutive matching points determines whether the motion data and the route book are successfully matched.

5. The race segment matching system according to claim 4, characterized in that, The data matching module is also used to perform lap matching when the motion data includes multiple laps of cycling data along the same route: Multiple starting points in the motion trajectory point sequence are selected sequentially in a step-by-step manner, and each starting point is matched with the route book trajectory point sequence to obtain multiple candidate matching segments; Calculate the matching rate for each candidate matching segment, and determine the candidate matching segments whose matching rate exceeds a preset threshold as valid matching segments; Assign a unique cycle number to each of the valid matching segments.

6. The race segment matching system according to claim 5, characterized in that, The data matching module is also used to identify the direction of motion of the motion data relative to the road book. When the identification result is a reverse direction match, the adjacent reverse direction matching segments are merged.

7. A segment matching method based on the segment matching system according to any one of claims 1-6, characterized in that, include: Obtain the user's exercise data and at least one route map; A spatial index is constructed based on the geographical location information of each route book; Based on the geographic location information of the motion data, a search is performed in the spatial index to obtain a set of candidate route books; Match the route books in the candidate route book set with the motion data to determine the target route book that matches the motion data; The matching results of the target route book will be pushed to the user.

8. The segment matching method according to claim 7, characterized in that, The spatial index is constructed based on the geographical location information of each of the aforementioned route books, including: The trajectory points of each of the aforementioned road books are subjected to equidistant uniform interpolation processing; Calculate the geographic bounding box for each of the aforementioned route books; Construct an RTree spatial index using the aforementioned geographic bounding boxes as spatial keys.

9. The segment matching method according to claim 7, characterized in that, Matching the route books and motion data in the candidate route book set includes: Obtain multiple motion trajectory points from the motion data and multiple route book trajectory points from the candidate route book set; The motion trajectory point sequence is scanned segment by segment using a sliding window algorithm. Each scanned segment is matched with the route book trajectory point sequence to obtain at least one candidate matching segment. The matching rate of each candidate matching segment is calculated, and the candidate matching segment with a matching rate exceeding a preset threshold is determined as a valid matching segment. When there are multiple valid matching segments, assign lap numbers to each valid matching segment, extract the motion data corresponding to each valid matching segment, and calculate the motion parameters of each lap based on the motion data corresponding to each valid matching segment. The exercise parameters include at least one of the following: exercise time, average speed, maximum speed, average heart rate, maximum heart rate, average cadence, maximum cadence, average power, and maximum power.

10. The race segment matching method according to claim 9, characterized in that, Matching each scan segment with the sequence of points in the roadbook trajectory includes: The two-pointer method is used to traverse the motion trajectory points in the scan segment and the road book trajectory points in the road book trajectory point sequence, respectively, and calculate the distance between each pair. When the distance is less than a preset matching threshold, it is marked as a matching point. The cumulative number of matching points is used to calculate the matching rate between the scanned segment and the road book.

11. The segment matching method according to claim 9, characterized in that, Also includes: The direction of movement is identified based on the matching order between the sequence of movement trajectory points and the sequence of trajectory points in the road book; When the recognition result is a reverse direction match, the adjacent valid reverse direction match segments are merged.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a segment matching program, which, when executed by a processor, implements the segment matching method as described in any one of claims 7-11.