R-tree index-based field task to position determination method and system and storage medium
By constructing an R-tree index and combining it with buffer regions and spatial intersection judgment, the problems of high computational pressure and poor reliability in the determination of the arrival of field tasks are solved, and efficient and reliable task arrival determination is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN HOPETOP TECH CO LTD
- Filing Date
- 2026-03-30
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies suffer from high computational burden, long response delays, and poor reliability in determining the arrival of field tasks in multi-task-point scenarios, making them prone to misjudgment or omission.
An R-tree index is used to construct a method for determining the arrival of field tasks. By preprocessing data, constructing an R-tree spatial index, setting a buffer area, and making spatial intersection judgments, the computational efficiency and judgment reliability are improved.
It significantly improves computational efficiency and reliability of on-time determination in multi-task scenarios, and solves the problems of high computational pressure and false positives and false negatives in existing technologies.
Smart Images

Figure CN122309516A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of field inspection technology, specifically to a method, system, and storage medium for determining the arrival of field tasks based on R-tree indexing. Background Technology
[0002] Urban infrastructure inspection is the process of patrolling designated inspection routes and infrastructure to identify facility anomalies and safety hazards, and to address them promptly. Urban infrastructure inspection methods mainly include manual inspection and intelligent inspection.
[0003] Manual inspection primarily involves specialized personnel recording and photographing facilities and incidents at designated times and locations using qualification forms or mobile devices. Any discovered faults or potential hazards are promptly reported and addressed. Intelligent inspection, on the other hand, utilizes mobile inspection robots equipped with cameras and other sensors. These robots collect data along pre-planned routes and transmit it to a backend system for analysis via mobile storage devices or wireless networks.
[0004] Thorough inspection is a crucial indicator of inspection quality. Thorough inspection refers to the entire process where inspection personnel strictly adhere to the pre-set inspection plan, standard procedures, and technical requirements, arriving at all designated inspection points within the stipulated time, fully executing all inspection items, accurately recording on-site data, effectively identifying potential hazards, and driving closed-loop rectification. Inspection personnel must arrive at all planned inspection points (such as equipment itself, key components, and risk areas), verify their presence through methods such as location tracking, attendance confirmation, and feature recording, complete all mandatory and randomized inspection items, and record and report accurate on-site data.
[0005] If inspection personnel fail to conduct inspections according to the prescribed routes and times, and fail to detect potential hazards and faults in a timely manner, it can easily lead to major safety accidents.
[0006] Current methods for determining the arrival status of field tasks often employ a brute-force search approach of "matching trajectory points with task points one by one." When a task involves hundreds or even thousands of task points, and the number of trajectory points uploaded by field personnel is large, this generates a significant amount of spatial computation, leading to a surge in server-side computational pressure, excessive response latency, and an inability to meet real-time requirements. Field arrival status determination typically uses trajectory point matching or Bluetooth communication. However, due to potential errors in trajectory point location acquisition (such as mobile phone location drift), relying solely on simple coordinate comparisons for arrival determination can easily result in situations such as "arrived but not determined to be in place" or "not arrived but incorrectly determined to be in place," affecting the reliability of inspection results. Furthermore, the act of inspection personnel determining arrival status via Bluetooth signals at inspection points is also affected by the range and distance of Bluetooth communication, easily leading to misjudgments or omissions. Summary of the Invention
[0007] Based on the above description, the present invention provides a method, system and storage medium for determining the arrival of field tasks based on R-tree indexes, so as to improve computational efficiency and reliability of arrival determination.
[0008] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: Methods for determining the arrival of field tasks based on R-tree indexes include: Step S1: Collect and upload task trajectory data in real time and perform data preprocessing; Step S2: Extract the preprocessed task point coordinates and construct the R-tree spatial index; Step S3: Set the spatial buffer radius and calculate the coordinate range of the buffer area; Step S4: Filter out task points that may have spatial overlap and determine the task's arrival time; Step S5: Generate a detailed report of the inspection in place and synchronize the result data.
[0009] As a preferred embodiment, step S1 includes: S101. Obtain the field inspection task configuration information from the server, parse the data of N task points included in the task, extract the core attributes such as latitude and longitude coordinates, task number, and task range of each task point, and establish a task point database. S102. Field personnel collect trajectory point data during the inspection process in real time through mobile terminals, including trajectory point coordinates, collection time, equipment identification, and task association ID, and upload it asynchronously to the server via network link; S103. Convert the coordinates of the task points and trajectory points to the same spatial reference system, and preprocess the trajectory point data uploaded by the server to remove trajectory anomalies.
[0010] As a preferred approach, methods for preprocessing trajectory point data include: a) Make judgments based on the inherent geographical range and numerical validity of latitude and longitude. Usually, the coordinates of a certain region have a range [xMin, xMax, yMin, yMax]. If the horizontal and vertical coordinates are not within the range, they are directly eliminated. b) Based on the monotonicity, rationality, and validity of the timestamp, remove points with disordered timestamps: according to the business threshold, remove those with an interval <100ms or >1h; remove empty / duplicate timestamps. c) Removal of abnormal actual motion speeds of trajectory points: ① Calculate the distance d between two points on the Earth's surface using the Haversine formula:
[0011] in, and These represent the latitude and longitude differences between the two valid points, respectively. and The two points represent the latitude of the two valid points, a represents the intermediate value (between 0 and 1), R is the radius of the Earth, c is the central angle (in radians) between the two points at the center of the sphere, and d is the distance between the two points on the Earth's surface. ② Obtain the motion time interval t between two valid points; ③ Calculate the actual velocity v of two adjacent effective points:
[0012] ④ Set a speed threshold based on the business scenario. If the speed exceeds the maximum speed threshold of the business scenario, it will be judged as an anomaly and removed.
[0013] As a preferred option, step S2 includes: S201. Extract the coordinate information of N preprocessed task points, construct a spatial data object containing the unique identifier of the task point and the coordinate range, and generate index data. S202. Based on the index data, the R-tree spatial index construction algorithm is adopted to generate the R-tree index structure according to the logic of "hierarchical partitioning - node construction - boundary optimization". S202. When the patrol task changes, rebuild the R-tree index of the task.
[0014] As a preferred option, the buffer calculation method in step S3 is as follows: generate a circular buffer area with each trajectory point as the center and the buffer radius, and obtain the coordinate range of the buffer area; wherein, the coordinate range of the buffer area is the minimum bounding rectangle extending in the east-west and north-south directions of the circular buffer.
[0015] As a preferred option, step S4 specifically includes: S401. Using the minimum bounding rectangle of the trajectory point buffer area as the search condition, input it into the constructed R-tree index. Through the hierarchical traversal characteristics of the R-tree, quickly filter out the task points that may have spatial intersection with the buffer area. S402. For the selected candidate task points, use the spatial geometric intersection judgment algorithm to verify whether the task point falls within the buffer area of the trajectory point.
[0016] As a preferred option, the task point filtering method in step S401 is as follows: Assuming S is a trajectory point buffer in the R-tree structure graph, if node T is a non-leaf node, and if the rectangle corresponding to T overlaps with S, then check all entries stored in T and search for the root node of the subtree pointed to by each entry, that is, the child node of node T; if T is a leaf node, and if the rectangle corresponding to T overlaps with S, then directly check all record entries pointed to by T; the records that meet the conditions are the filtered task points that may have spatial intersection with the buffer area.
[0017] A field task arrival determination system based on R-tree indexing includes: The data preprocessing module is used to collect and upload task trajectory data in real time and perform data preprocessing. The index building module is used to build an R-tree spatial index based on the extracted and preprocessed task point coordinates; The calculation module is used to set the coordinate range of the spatial buffer radius calculation buffer area; The judgment module is used to filter task points that may have spatial overlap and to determine the arrival of the task. The report generation module is used to generate detailed reports of inspections in place and synchronize the results data.
[0018] A storage medium storing a field task arrival determination program based on an R-tree index, wherein when the field task arrival determination program based on an R-tree index is executed by a processor, the field task arrival determination program based on an R-tree index implements the steps of the field task arrival determination method based on an R-tree index.
[0019] Compared with the prior art, the technical solution of this application has the following beneficial technical effects: This application significantly improves the efficiency of on-time computation in multi-task scenarios with massive amounts of data by constructing an R-tree spatial index. It employs a dual-determination logic of "buffer radius analysis + spatial intersection judgment" to enhance the reliability of on-time determination. Dynamic maintenance of the R-tree index solves the problems of poor adaptability to dynamic task changes and cumbersome index maintenance. Attached Figure Description
[0020] Figure 1 This is a flowchart of the method in Example 1; Figure 2 This is a schematic diagram of the R-tree index structure in Example 1; Figure 3 This is a schematic diagram of task point filtering in Example 1; Figure 4 This is a schematic diagram of the buffer area in Example 1. Detailed Implementation
[0021] Reference Figure 1A method for determining the availability of field tasks based on R-tree indexes, which includes the following steps: Step S1: Collect and upload task trajectory data in real time and perform data preprocessing.
[0022] This step specifically includes: S101. Obtain the field inspection task configuration information from the server, parse the data of N task points included in the task, extract the core attributes such as latitude and longitude coordinates, task number, and task range of each task point, and establish a task point database. S102. Field personnel collect trajectory point data in real time during the patrol process using mobile terminals (phones), including trajectory point coordinates, collection time, equipment identification, task association ID, and other information, and asynchronously upload it to the server via network links (4G / 5G / Wi-Fi, etc.). S103. Convert the coordinates of the task points and trajectory points to the same spatial reference system, and preprocess the uploaded trajectory point data on the server side to remove abnormal points.
[0023] Trajectory anomalies include coordinates outside the reasonable range, disordered acquisition time, and abnormal movement speed. Methods for preprocessing trajectory point data include: a) Make judgments based on the inherent geographical range and numerical validity of latitude and longitude. Usually, the coordinates of a certain region have a range [xMin, xMax, yMin, yMax]. If the horizontal and vertical coordinates are not within the range, they are directly eliminated.
[0024] b) Based on the monotonicity, rationality, and validity of the timestamp, remove points with disordered time: According to the business threshold (e.g., mobile positioning is generally 1~30s / time), if the interval is <100ms (high-frequency repeated collection) or >1h (reconnection after positioning interruption), remove it; empty / repeated timestamps: remove directly.
[0025] c) Abnormal actual motion speed of trajectory points is removed using the following method: ① Calculate the distance d between two points on the Earth's surface using the Haversine formula:
[0026] in, and These represent the latitude and longitude differences between the two valid points, respectively. and These represent the latitudes of the two valid points, a Represents intermediate values (between 0 and 1). R It is the radius of the Earth. c It is the central angle (in radians) between two points at the center of the sphere. d It is the distance between two points on the Earth's surface.
[0027] ② Obtain the motion time interval t between two valid points; ③ Calculate the actual velocity v of two adjacent effective points:
[0028] ④ Set speed thresholds according to the business scenario (e.g., indoor positioning / pedestrian speed threshold is ≤5m / s, non-motorized vehicle speed threshold is ≤15m / s). If the speed exceeds the maximum speed threshold of the business scenario, it is judged as an abnormal point and removed.
[0029] Step S2: Extract the preprocessed task point coordinates and construct the R-tree spatial index.
[0030] This step specifically includes: S201. Extract the coordinate information of N preprocessed task points, construct a spatial data object containing the unique identifier of the task point and the coordinate range, and generate index data. S202. Based on the index data, the R-tree spatial index construction algorithm is adopted to generate the R-tree index structure according to the logic of "hierarchical partitioning - node construction - boundary optimization".
[0031] R-trees are data structures used for multidimensional spatial indexing, storing spatial objects with multidimensional coordinates and organizing data through hierarchical rectangular regions. The principle behind R-tree spatial indexing is to accelerate spatial query operations, such as range queries and nearest neighbor queries, by organizing spatial objects according to their minimum bounding rectangle (MBR).
[0032] Reference Figure 2 The root page contains the boundary range of the region where all task points are located. The branch pages subdivide the spatial regions level by level. The leaf pages correspond to the spatial range of one or more adjacent task points, forming a hierarchical spatial index tree.
[0033] When performing queries on high-dimensional objects, it is only necessary to traverse the pointers contained in a few leaf nodes (i.e., narrow down the query to a certain region) and check whether the data pointed to by these pointers meets the requirements. This hierarchical structure allows R-Tree to quickly exclude data irrelevant to the query region during the query, obtaining results without traversing all data, greatly reducing the amount of data that needs to be accessed and significantly improving query efficiency.
[0034] S202. When the inspection task changes (such as adding, deleting, or modifying task points), rebuild the R-tree index of the task to ensure real-time consistency between the index and the task point data, and avoid calculation errors caused by index failure.
[0035] Step S3: Set the spatial buffer radius and calculate the coordinate range of the buffer area.
[0036] The spatial buffer radius can be dynamically configured and determined according to the needs of field inspection operations. The buffer calculation method is as follows: generate a circular buffer area with each trajectory point as the center and the buffer radius, and obtain the coordinate range of the buffer area.
[0037] The coordinate range of the buffer area is the minimum bounding rectangle extending in the east-west and north-south directions of the circular buffer zone.
[0038] Step S4: Filter out task points that may have spatial overlap and determine the task's arrival time.
[0039] This step specifically includes: S401. Using the minimum bounding rectangle of the trajectory point buffer area as the search condition, input it into the constructed R-tree index. Through the hierarchical traversal characteristics of the R-tree, quickly filter out task points (candidate task points) that may have spatial intersection with the buffer area, eliminate a large number of non-intersecting task points, and reduce the amount of subsequent calculations. The task point filtering method is as follows: by Figure 3 Taking the R-tree structure in the figure as an example, assume that S in the figure is the trajectory point buffer.
[0040] Assuming S is a buffer of trajectory points in the R-tree structure graph, if node T is a non-leaf node (P1, P2, P3, P4), and the rectangle corresponding to T overlaps with S (P3, P4), then check all entries stored in T and search the root node of the subtree pointed to by each entry, i.e., the child nodes of node T (F, G, H, I, J). If T is a leaf node (F, G, H, I, J), and the rectangle corresponding to T overlaps with S (H), then directly check all record entries pointed to by T. The records that meet the conditions are the selected task points that may have spatial intersection with this buffer area.
[0041] S402. For the selected candidate task points, a spatial geometric intersection judgment algorithm is used to accurately verify whether the task point falls within the buffer area of the trajectory point.
[0042] like Figure 4 As shown, P is the trajectory point, K1, K2, and K3 are the subsequently selected task points, and the arrival buffer radius is r. Calculate the distance l between the trajectory point and the task point. If l ≤ r, the inspection task is determined to be in place; otherwise, the inspection task is determined to be in place.
[0043] Step S5: Generate a detailed report of the inspection in place and synchronize the result data.
[0044] The arrival determination result includes task number, task point coordinates, arrival status (in place / out of place), arrival time, and matching trajectory point information. The arrival determination result of each task point is fed back to the mobile terminal of the field personnel in real time, and is also stored in the server database for task progress tracking, personnel performance evaluation, etc.
[0045] Example 2: A field task arrival determination system based on R-tree indexing includes: The data preprocessing module is used to collect and upload task trajectory data in real time and perform data preprocessing. The index building module is used to build an R-tree spatial index based on the extracted and preprocessed task point coordinates; The calculation module is used to set the coordinate range of the spatial buffer radius calculation buffer area; The judgment module is used to filter task points that may have spatial overlap and to determine the arrival of the task. The report generation module is used to generate detailed reports of inspections in place and synchronize the results data.
[0046] Example 3: A storage medium storing a field task arrival determination program based on an R-tree index, wherein when the field task arrival determination program based on an R-tree index is executed by a processor, the field task arrival determination program based on an R-tree index implements the steps of the field task arrival determination method based on an R-tree index.
[0047] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for determining the location of field tasks based on R-tree index, characterized in that, include: S1. Real-time acquisition and uploading of task trajectory data and data preprocessing; S2. Extract the coordinates of the preprocessed task points and construct an R-tree spatial index; S3. Set the spatial buffer radius and calculate the coordinate range of the buffer area; S4. Filter out task points that may have spatial overlap and determine the task's arrival time; S5. Generate a detailed report of the inspection in place and synchronize the results data.
2. The R-tree index based field task to position determination method according to claim 1, characterized in that, Step S1 includes: S101. Obtain the field inspection task configuration information from the server, parse the data of N task points included in the task, extract the core attributes such as latitude and longitude coordinates, task number, and task range of each task point, and establish a task point database. S102. Field personnel collect trajectory point data during the inspection process in real time through mobile terminals, including trajectory point coordinates, collection time, equipment identification, and task association ID, and upload it asynchronously to the server via network link; S103. Convert the coordinates of the task points and trajectory points to the same spatial reference system, and preprocess the trajectory point data uploaded by the server to remove trajectory anomalies.
3. The R-tree index based field task position determination method according to claim 2, characterized in that, Methods for preprocessing trajectory point data include: The judgment is based on the inherent geographical range and numerical validity of latitude and longitude. The coordinates of a certain region have a range [xMin, xMax, yMin, yMax]. If the horizontal and vertical coordinates are not within the range, they are directly eliminated. Based on the monotonicity, rationality, and validity of the interval of the timestamp, points with disordered time are removed: according to the business threshold, intervals <100ms or >1h are removed; empty / duplicate timestamps are removed. Abnormal removal of actual motion speed of trajectory points: Calculate the distance d between two points on the Earth's surface using the Haversine formula: wherein, and respectively represent the latitude difference and the longitude difference of two effective points, and respectively represent the latitude of two effective points, a represents an intermediate quantity, R is the radius of the earth, c is the central angle of the two points corresponding to the center of the sphere, and d is the distance between the two points on the surface of the earth. Obtain the motion time interval t between two valid points; Calculate the actual velocity v of two adjacent valid points: Set a speed threshold based on the business scenario. If the speed exceeds the maximum speed threshold for the business scenario, it will be judged as an anomaly and removed.
4. The R-tree index based field task to position determination method of claim 1, Its characteristic is that step S2 includes: S201. Extract the coordinate information of N preprocessed task points, construct a spatial data object containing the unique identifier of the task point and the coordinate range, and generate index data. S202. Based on the index data, the R-tree spatial index construction algorithm is adopted to generate the R-tree index structure according to the logic of "hierarchical partitioning - node construction - boundary optimization". S202. When the patrol task changes, rebuild the R-tree index of the task.
5. The R-tree index based field task position determination method of claim 1, wherein: The buffer calculation method in step S3 is as follows: a circular buffer area is generated with each trajectory point as the center and the buffer radius, and the coordinate range of the buffer area is obtained; wherein, the coordinate range of the buffer area is the minimum bounding rectangle extending in the east-west and north-south directions of the circular buffer.
6. The R-tree index based field task position determination method of claim 1, wherein, Step S4 specifically includes: S401. Using the minimum bounding rectangle of the trajectory point buffer area as the search condition, input it into the constructed R-tree index. Through the hierarchical traversal characteristics of the R-tree, quickly filter out the task points that may have spatial intersection with the buffer area. S402. For the selected candidate task points, use the spatial geometric intersection judgment algorithm to verify whether the task point falls within the buffer area of the trajectory point.
7. The R-tree index based field task position determination method according to claim 6, wherein, The task point filtering method in step S401 is as follows: Assuming S is a trajectory point buffer in the R-tree structure graph, if node T is a non-leaf node, and if the rectangle corresponding to T overlaps with S, then check all entries stored in T and search for the root node of the subtree pointed to by each entry, that is, the child node of node T; if T is a leaf node, and if the rectangle corresponding to T overlaps with S, then directly check all record entries pointed to by T; the records that meet the conditions are the filtered task points that may have spatial intersection with the buffer area.
8. An R-tree index based field task to position determination system, characterized in that, include: The data preprocessing module is used to collect and upload task trajectory data in real time and perform data preprocessing. The index building module is used to build an R-tree spatial index based on the extracted and preprocessed task point coordinates; The calculation module is used to set the coordinate range of the spatial buffer radius calculation buffer area; The judgment module is used to filter task points that may have spatial overlap and to determine the arrival of the task. The report generation module is used to generate detailed reports of inspections in place and synchronize the results data.
9. A storage medium, characterized by The storage medium stores a field task arrival determination program based on R-tree index. When the R-tree index-based field task arrival determination program is executed by the processor, it implements the steps of the field task arrival determination method based on R-tree index as described in any one of claims 1 to 7.