Vehicle travel area recognition method and vehicle

CN122986194APending Publication Date: 2026-10-27GREAT WALL MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611205104.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0005]本申请提供了一种车辆行驶区域识别方法及车辆,目的在于克服现有技术在批量行驶区域识别场景中查询效率与识别精度难以兼顾的技术问题

Benefits of technology

[0016]本申请提供的技术方案,获取车辆轨迹点数据和地图数据;构建道路网络数据的多层空间索引;基于多层空间索引对轨迹点进行道路筛选,确定轨迹点的候选道路;计算每个候选道路与轨迹点之间的空间距离;选取空间距离中的最小值,作为轨迹点的道路偏离距离;基于轨迹点的道路偏离距离和环境数据,判定轨迹点所在区域是否为目标区域,并输出判定结果。本申请通过构建多层空间索引逐级筛选道路,结合统一度量基准下的坐标转换,提高了海量轨迹点与道路网络的空间距离查询效率与计算精度;同时引入环境数据进行综合判定,实现了几何与语义双重维度的目标区域精准识别,为大规模车辆轨迹的行驶区域识别提供了高效可靠的技术支撑。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122986194A_ABST
    Figure CN122986194A_ABST
Patent Text Reader

Abstract

The application discloses a vehicle driving area identification method and a vehicle, and relates to the field of intelligent driving. The method comprises the following steps: acquiring vehicle trajectory point data and map data; constructing a multi-layer spatial index of road network data; performing road screening on the trajectory points based on the multi-layer spatial index to determine candidate roads of the trajectory points; calculating the spatial distance between each candidate road and the trajectory points; selecting the minimum value in the spatial distance as the road deviation distance of the trajectory points; and determining whether the area where the trajectory points are located is a target area based on the road deviation distance of the trajectory points and environmental data, and outputting the determination result. The method can consider the query efficiency and the identification accuracy in large-scale trajectory data processing by constructing a multi-layer spatial index to perform road screening on the trajectory points and calculating the road deviation distance, and can effectively reduce the calculation cost and improve the accuracy and scene adaptability of the driving area determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent driving, and in particular to a method for identifying vehicle driving areas and a vehicle. Background Technology

[0002] Vehicle driving area recognition is an important foundational technology in fields such as intelligent driving, trajectory analysis, and traffic scene modeling. Its core lies in the spatial analysis and area determination of a large number of trajectory points generated by vehicle driving, in order to identify driving behaviors such as deviating from the standard road, entering unpaved roads or wild areas.

[0003] Currently, related technologies are mainly implemented in two ways. One relies on the application programming interfaces (APIs) provided by online map services, which use standardized functions to match trajectory points with road networks and determine regions. The other uses open-source routing engines for localized deployment, using graph data structures to perform the association calculation between trajectory points and road networks.

[0004] The above methods have been applied in vehicle trajectory analysis and road matching scenarios. However, when faced with batch nearest neighbor queries of massive trajectory points, the existing index architecture struggles to balance query efficiency and computational accuracy, a problem that is particularly prominent in driving area recognition scenarios. Summary of the Invention

[0005] This application provides a vehicle driving area identification method and a vehicle, aiming to overcome the technical problem that existing technologies cannot simultaneously achieve both query efficiency and identification accuracy in batch driving area identification scenarios.

[0006] To achieve the above objectives, this application provides the following technical solution:

[0007] A method for identifying a vehicle driving area includes:

[0008] Acquire vehicle trajectory point data and map data; the vehicle trajectory point data includes trajectory points; the map data includes road network data and environmental data;

[0009] Construct a multi-level spatial index for the road network data; the multi-level spatial index contains at least two index levels, each index level is used to filter roads step by step and the filtering accuracy increases step by step.

[0010] Based on the multi-layer spatial index, road filtering is performed on the trajectory points to determine candidate roads for the trajectory points;

[0011] Calculate the spatial distance between each candidate road and the trajectory point;

[0012] The minimum value among the spatial distances is selected as the road deviation distance of the trajectory point;

[0013] Based on the road deviation distance of the trajectory point and the environmental data, determine whether the area where the trajectory point is located is the target area, and output the determination result.

[0014] A vehicle includes: a processor, a memory, and a bus; the processor and the memory are connected via the bus.

[0015] The memory is used to store a program, and the processor is used to run the program, wherein the program is executed by the processor to perform the vehicle driving area identification method.

[0016] The technical solution provided in this application acquires vehicle trajectory point data and map data; constructs a multi-layer spatial index for road network data; filters roads based on the multi-layer spatial index to determine candidate roads for the trajectory points; calculates the spatial distance between each candidate road and the trajectory point; selects the minimum spatial distance as the road deviation distance of the trajectory point; and, based on the road deviation distance and environmental data, determines whether the area where the trajectory point is located is the target area and outputs the determination result. This application improves the efficiency and accuracy of spatial distance querying between massive trajectory points and road networks by constructing a multi-layer spatial index to filter roads step by step, combined with coordinate transformation under a unified metric benchmark. Simultaneously, by introducing environmental data for comprehensive determination, it achieves accurate identification of target areas in both geometric and semantic dimensions, providing efficient and reliable technical support for the identification of driving areas for large-scale vehicle trajectories. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a first flowchart illustrating a vehicle driving area identification method provided in an embodiment of this application;

[0019] Figure 2 This is a second flowchart illustrating a vehicle driving area identification method provided in an embodiment of this application;

[0020] Figure 3 A schematic diagram of the third process of a vehicle driving area identification method provided in an embodiment of this application;

[0021] Figure 4 A schematic diagram of the fourth process of a vehicle driving area identification method provided in an embodiment of this application;

[0022] Figure 5A fifth flowchart illustrating a vehicle driving area identification method provided in an embodiment of this application;

[0023] Figure 6 A sixth flowchart illustrating a vehicle driving area identification method provided in this application embodiment;

[0024] Figure 7 A seventh flowchart illustrating a vehicle driving area identification method provided in an embodiment of this application;

[0025] Figure 8 This is a schematic diagram of the eighth process of a vehicle driving area identification method provided in an embodiment of this application;

[0026] Figure 9 This is a schematic diagram of the architecture of a vehicle provided in an embodiment of this application. Detailed Implementation

[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0028] In this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0029] Currently, industry solutions for matching vehicle trajectories with roads mainly fall into two categories: one relies on application programming interfaces (APIs) provided by online map services to match trajectory points with road networks and determine regions by calling standardized functions; the other uses open-source routing engines for local deployment, implementing the association calculation between trajectory points and road networks based on graph data structures. However, when applied to large-scale driving area recognition scenarios, existing solutions still face technical challenges such as low efficiency of batch nearest neighbor queries, insufficient distance calculation accuracy, and a lack of dedicated functions for special scenarios, making it difficult to balance query efficiency, calculation accuracy, and cost control.

[0030] In view of this, embodiments of this application provide a vehicle driving area identification method and a vehicle. It improves query efficiency by constructing a multi-layered spatial index to progressively filter roads, ensures distance calculation accuracy through coordinate transformation under a unified metric benchmark, and achieves accurate identification of driving areas from both geometric and semantic dimensions by introducing environmental data for semantic dimension-assisted judgment. The specific implementation of the technical solution provided in this application embodiment is shown below.

[0031] like Figure 1 The diagram shown is a first flowchart of a vehicle driving area identification method provided in an embodiment of this application, including the following steps.

[0032] S101: Obtain vehicle trajectory point data and map data.

[0033] Among them, vehicle trajectory point data includes the location information of the trajectory points of the vehicle during its driving process under a unified measurement benchmark; map data includes road network data and environmental data.

[0034] In some examples, vehicle trajectory point data originates from positioning data collected by GPS sensors during vehicle operation. The trajectory points contain raw information such as longitude, latitude, and timestamps. Vehicle trajectory point data can be real-time streaming data or pre-stored historical trajectory data; this application does not limit this.

[0035] In some examples, the unified measurement benchmark is the metric plane coordinate system. Since different map service providers may use different coordinate systems (for example, one map service provider uses the GCJ-02 coordinate system, while raw GPS data typically uses the WGS-84 coordinate system), directly calculating distances under different coordinate systems would lead to inconsistent distance determination standards and significant accuracy errors. Therefore, this application uniformly transforms the original geographic coordinates of trajectory points to the same measurement benchmark to eliminate the impact of coordinate reference system differences on distance calculation accuracy.

[0036] Optionally, for the specific implementation process of obtaining vehicle trajectory point data and map data, please refer to [link / reference]. Figure 2 The steps shown are explained below.

[0037] Optionally, map data can be loaded using a province-specific preloading mechanism.

[0038] Specifically, the province / region to which a trajectory point belongs is determined based on its location coordinates, and only map data corresponding to that province / region is loaded. Loading is triggered on the first query, and a thread-safe lock is used to ensure multi-threaded consistency, avoiding memory waste caused by repeated loading. This province-specific pre-loading mechanism effectively optimizes memory usage and avoids loading redundant map data from unnecessary areas.

[0039] In some examples, road network data includes geometric and attribute information for various types of roads, such as paved roads like highways, arterial roads, primary roads, secondary roads, and tertiary roads, as well as other types of roads like village roads and unpaved roads. Road network data can be obtained from open-source or commercial map data; this application does not limit the source of the map data.

[0040] In some examples, environmental data includes one or more environmental attributes, which are used to help determine the environmental type of the area where the trajectory point is located. For details on the specific types of environmental attributes and how they are determined, please refer to [link to relevant documentation]. Figure 4 The steps shown are explained below.

[0041] It should be noted that the vehicle trajectory point data acquired in S101 can contain one trajectory point or multiple trajectory points. When there are multiple trajectory points, subsequent steps S103-S106 are executed separately for each trajectory point to obtain the target area determination result for each trajectory point.

[0042] S102: Construct a multi-level spatial index for road network data.

[0043] The multi-level spatial index contains at least two index levels, each used to filter roads progressively with increasing filtering precision.

[0044] In some examples, the multi-level spatial index includes a first spatial index and a second spatial index, which are different types of index architectures. The first spatial index is used for initial screening of roads (i.e., coarse screening), and the second spatial index is used for secondary screening of roads based on the initial screening (i.e., fine screening). Through the two-level index architecture of "coarse screening + fine screening", the efficiency of road screening for massive trajectory points can be significantly improved while ensuring query accuracy.

[0045] In a possible implementation, the first spatial index is a KD-tree index, and the second spatial index is an R-tree index.

[0046] A KD-tree is a k-dimensional binary tree structure used for nearest neighbor search. (Road network) ,in , Center point of the road For the first a road, For the first The center point of the road , These are the projected coordinates of the road center point under a unified measurement datum. Let n be the road geometry and n be the total number of roads.

[0047] The construction rules for a KD-tree are as follows: the root node selects the median in the 0th dimension (longitude), child nodes select the median in the 1st dimension (latitude), and subsequent dimensions are selected alternately. The time complexity of a KD-tree index is O(n log n). The time complexity of a single query is O(n). This represents the number of points in the batch query.

[0048] R-trees use minimum bounding rectangles (MBRs) to group spatial objects, making them suitable for spatial intersection queries. When building an R-tree index, the minimum bounding rectangle of a road is used as the index unit. During the query phase, a rectangular bounding box is constructed with the trajectory point as the center and a preset search radius R. The R-tree is then used to quickly query roads that intersect this bounding box, resulting in a set of candidate roads.

[0049] For example, the search radius is set to R, and the rectangular bounding box of point p is... It can be represented as:

[0050] (1).

[0051] In formula (1), (x,y) are the projected coordinates of the trajectory point, and R is the preset search radius (default 5000 meters).

[0052] For example, candidate road set Represented as:

[0053] (2).

[0054] In formula (2), R is the complete set of the road network, and MBR(r) is the minimum bounding rectangle of road r. By querying the R-tree, the number of candidate roads decreases from n to m, and m is much smaller than n.

[0055] In a possible implementation, the KD-tree index and the R-tree index work together: first, the KD-tree index is used to quickly and coarsely filter the trajectory points to obtain an initial set of roads; then, the R-tree index is used to perform a precise range query based on the initial set of roads to obtain a set of candidate roads. Compared to using the R-tree index alone for querying, the two-level combined architecture of KD-tree and R-tree can significantly reduce the number of candidate roads while ensuring query accuracy.

[0056] It should be noted that the construction of multi-layer spatial indexes can be completed offline after map data acquisition, or it can be built online in real time. The specific timing of construction can be determined based on the actual application scenario. For large-scale fixed map data, it is recommended to use the offline construction method to save online computing resources.

[0057] Optionally, for the specific implementation process of filtering roads based on multi-level spatial indexing to determine candidate roads for trajectory points, please refer to [link to relevant documentation]. Figure 3 The steps shown are explained below.

[0058] S103: Based on multi-level spatial indexing, road filtering is performed on trajectory points to determine candidate roads for the trajectory points.

[0059] Candidate roads refer to the set of roads that are spatially close to the trajectory points after being filtered through multiple layers of spatial indexing. The number of candidate roads is much smaller than the total number of roads in the road network, thus significantly reducing the computational cost of subsequent distance calculations.

[0060] Optionally, the multi-level spatial index includes a first spatial index and a second spatial index, which are different types of index architectures. The first spatial index is used for initial screening of roads, and the second spatial index is used for secondary screening of roads based on the initial screening.

[0061] Optionally, the process of filtering trajectory points based on multi-level spatial indexing to determine candidate roads for the trajectory points can be found in [reference needed]. Figure 3 The steps are shown.

[0062] It should be noted that each candidate road in the candidate road set is a line feature with a geometric shape, consisting of several continuous line segments. The specific content of the candidate road set is used in subsequent steps to calculate the spatial distance from the trajectory points to the roads.

[0063] Optionally, when the number of candidate roads is zero, the road deviation distance is assigned a preset value; the preset value is used to indicate that the area where the trajectory point is located is the target area. That is, when there are no roads within the preset range around the trajectory point, the trajectory point is in a roadless area and can be directly identified as the target area without performing subsequent distance calculation steps.

[0064] In some examples, the preset value may be set to -1, which is used to mark a special case where the track point has no candidate road, so as to be distinguished from the non-negative distance value obtained through normal calculation.

[0065] S104: Calculate the spatial distance between each candidate road and the track point.

[0066] The spatial distance refers to the shortest distance from the track point to the geometric shape of the candidate road under a unified measurement reference, with the unit of meter.

[0067] In some examples, the candidate road is a line element with a geometric shape, which is composed of several continuous line segments. Calculating the spatial distance from the track point to the candidate road means calculating the shortest distance from the track point to the geometric shape of the candidate road.

[0068] In a possible implementation, the calculation formula for the spatial distance between two projection points p1=(x1,y1) and p2=(x2,y2) is:

[0069] (3).

[0070] In formula (3), is the Euclidean distance between the two projection points.

[0071] In a possible implementation, the spatial distance from the track point to the candidate road is calculated by adopting the calculation method of the distance from a point to a line segment. For any line segment in the candidate road, its endpoints are respectively and , and the track point is .

[0072] First, calculate the vector and the vector . Specifically, , . Then the projection parameter t is calculated, and its calculation formula is:

[0073] (4).

[0074] In formula (4), || || represents the modulus of the vector ||. The value range of the projection parameter t is limited to [0, 1], which is used to determine the position of the closest point of the track point on the line segment. When t=0, the closest point is the endpoint A; when t=1, the closest point is the endpoint B; when 0<t<1, the closest point is inside the line segment.

[0075] Exemplarily, the closest point is expressed as:

[0076] (5).

[0077] In Equation (5), Q represents the point on the line segment away from the closest point.

[0078] Exemplarily, the distance from the trajectory point P to the line segment AB can be expressed as:

[0079] (6).

[0080] In Equation (6), represents the trajectory point to the line segment the distance, the geometric meaning of which is: when t=0, the closest point is A, when t=1, the closest point is B, and when 0<t<1, the closest point is inside the line segment.

[0081] For each candidate road, calculate the distance from the trajectory point to each line segment of the road respectively, and take the minimum value as the spatial distance from the trajectory point to the candidate road. For each candidate road in the candidate road set, calculate the spatial distance from the trajectory point to the candidate road respectively, to obtain a set of spatial distance values.

[0082] It should be noted that, since the original geographic coordinates of the trajectory points have been uniformly converted into position coordinates under the same measurement reference in S101, the spatial distance calculated in this step is a straight-line distance in metric units, which avoids the accuracy deviation caused by directly calculating the distance using spherical latitude and longitude coordinates.

[0083] S105: Select the minimum value among the spatial distances as the road deviation distance of the trajectory point.

[0084] The road deviation distance characterizes the degree to which the trajectory point deviates from the road network. A smaller road deviation distance indicates that the trajectory point is closer to the road; a larger road deviation distance indicates that the trajectory point is farther from the road, and the off-road attribute of the area where it is located is more significant.

[0085] Exemplarily, the set of spatial distance values obtained in the above S104 is denoted as , and the minimum value in this set of spatial distance values can be expressed as:

[0086] (7).

[0087] In Equation (7), is the -th trajectory point's distance to the nearest road.

[0088] In some examples, the degree of deviation of the trajectory point from the road network is the core quantitative basis for subsequent off-road determination. By continuously quantifying the distance value instead of using a binarized matching result, it is possible to more finely distinguish the types of regions with different deviation degrees.

[0089] In a possible implementation, if the candidate road set for a trajectory point contains multiple candidate roads, the minimum value among the multiple spatial distance values ​​calculated in S104 is selected as the road deviation distance. The candidate road corresponding to this minimum value is the nearest road to the trajectory point.

[0090] It should be noted that the road deviation distance is a non-negative value. When the trajectory point is exactly on a road, the road deviation distance is 0; when the trajectory point is far from all roads, the road deviation distance is a large positive value.

[0091] S106: Based on the road deviation distance and environmental data of the trajectory points, determine whether the area where the trajectory points are located is the target area, and output the determination result.

[0092] The target area refers to the area that a vehicle enters after deviating from the designated road, including but not limited to unpaved roads, open fields, and off-road areas such as village roads.

[0093] In some examples, the distance of road deviation alone cannot distinguish between two different scenarios: "deviating from the main road into the wilderness" and "deviating from the main road into a village road." For instance, although unpaved roads within a village are far from the main roads, they are still essentially roads used for passage within human settlements and should not be identified as target areas. Therefore, this application introduces environmental data for semantic-dimensional auxiliary determination. Through a dual determination mechanism of "geometric deviation degree + environmental attributes," the accuracy of driving area identification is effectively improved.

[0094] Optionally, for the specific implementation process of determining whether the area where the trajectory point is located is the target area based on the road deviation distance and environmental data of the trajectory point, please refer to [link to relevant documentation]. Figure 4 The steps shown are explained below.

[0095] Optionally, the inverse geocoding information of trajectory points can be directly used to help determine whether the area where the trajectory points are located is the target area. For details on its implementation, please refer to [link to relevant documentation]. Figure 8 The steps are shown.

[0096] The processes described in S101-S106 above perform road filtering on trajectory points based on multi-layer spatial indexing. Combined with coordinate transformation under a unified metric, this improves the efficiency and accuracy of spatial distance querying between massive trajectory points and road networks. At the same time, environmental data is introduced for comprehensive judgment, achieving accurate identification of driving areas in both geometric and semantic dimensions. This provides efficient and reliable technical support for driving area identification of large-scale vehicle trajectories.

[0097] like Figure 2The diagram shown is a second flowchart of a vehicle driving area identification method provided in an embodiment of this application. This flowchart corresponds to the specific implementation of coordinate transformation and map data acquisition, and includes the following steps.

[0098] S201: Obtain the original geographic coordinates of the trajectory points.

[0099] The original geographic coordinates include the longitude and latitude information of the trajectory points, in degrees.

[0100] In some examples, the raw geographic coordinates originate from positioning data collected by the vehicle's GPS sensors. Track data from different sources may use different coordinate systems; for example, raw GPS data typically uses the WGS-84 coordinate system, while data provided by some map service providers may use the GCJ-02 coordinate system. Therefore, coordinate system identification and transformation processing is required for the raw geographic coordinates.

[0101] S202: Convert the original geographic coordinates into location coordinates under a unified measurement standard.

[0102] The unified measurement standard can be the EPSG:3857 projected coordinate system (i.e., Mercator projection), with the unit being meters.

[0103] In some examples, the specific conversion path for converting raw geographic coordinates to EPSG:3857 projected coordinates is: GCJ-02 → WGS-84 → EPSG:3857. That is, first, the coordinates in the GCJ-02 coordinate system are converted to latitude and longitude coordinates in the WGS-84 coordinate system, and then the WGS-84 latitude and longitude coordinates are converted to EPSG:3857 planar coordinates through Mercator projection.

[0104] In a possible implementation, the Mercator projection transformation formula is as follows:

[0105] (8);

[0106] (9).

[0107] In formulas (8) and (9), the latitude and longitude (lon, lat) are converted from degrees to radians: λ = lon × π / 180, φ = lat × π / 180, where λ is the longitude in radians, φ is the latitude in radians, and π is pi. The Earth's radius R_earth is 6,378,137 meters. Furthermore, ln(·) is the natural logarithm function, and tan(·) is the tangent function.

[0108] For example, the reverse conversion formula from GCJ-02 to WGS-84 is as follows:

[0109] (10)

[0110] (11).

[0111] In formula (11), arctan(·) is the arctangent function and e is the natural constant.

[0112] Through the projection transformation process shown in the above formulas (8), (9), (10) and (11), the latitude and longitude coordinates of the trajectory points are mapped to the EPSG:3857 plane coordinate system. The coordinates of all trajectory points are unified to the same measurement standard. Subsequent spatial distance calculations are all performed based on this metric plane coordinate system, thereby ensuring the accuracy and consistency of the distance calculation results.

[0113] In some examples, if the original geographic coordinates are already in the WGS-84 coordinate system, the Mercator projection transformation can be performed directly without performing the reverse transformation from GCJ-02 to WGS-84.

[0114] In a possible implementation, the map data is loaded using a province-specific preloading mechanism. Specifically, after obtaining the location coordinates of the trajectory point in S101, the province or region to which it belongs is determined based on the location coordinates, and only the map data corresponding to that province or region is loaded, rather than loading all map data.

[0115] For example, for a geographic coordinate point p, its province determination function province(p) can be expressed as:

[0116] .

[0117] In the province determination function `province(p)`, `lon(p)` represents the longitude of point `p`, and `lat(p)` represents the latitude of point `p`. Data loading is triggered on the first query, and a thread-safe lock is used to ensure multi-threaded consistency and avoid duplicate loading. Through a province-specific pre-loading mechanism, memory usage can be effectively reduced, and redundant map data from unnecessary areas can be avoided.

[0118] It should be noted that the above-mentioned province determination rules are only illustrative examples. In actual applications, map data of different provinces or regions can be loaded as needed, and this application does not limit this.

[0119] The processes shown in S201-S202 above eliminate the influence of different coordinate reference systems on the accuracy of distance calculation by uniformly converting the original geographic coordinates of the trajectory points into position coordinates in the metric plane coordinate system, ensuring the accuracy and consistency of subsequent spatial distance calculation results. At the same time, the province-based preloading mechanism loads map data on demand, effectively reducing memory usage and avoiding loading redundant map data from unnecessary areas.

[0120] like Figure 3The diagram shown is a third flowchart of a vehicle driving area identification method provided in this application embodiment. This flowchart corresponds to a specific implementation of road filtering based on multi-layer spatial index, wherein the multi-layer spatial index includes a first spatial index and a second spatial index, and includes the following steps.

[0121] S301: Use the first spatial index to perform initial road screening on the trajectory points to obtain the initial road screening of the trajectory points.

[0122] The initial screening road refers to the set of initial screening roads obtained after rapid screening using the first spatial index. The number of roads in this initial screening road set is much smaller than the total number of roads in the road network.

[0123] In a possible implementation, the first spatial index is a KD-tree index. The KD-tree index is used for initial road filtering of the trajectory points. Specifically, using the location coordinates of the trajectory points as query points, a nearest neighbor search is performed in the KD-tree to quickly filter out the roads corresponding to the center points of the roads closest to the trajectory points. The query time complexity of the KD-tree index is O(log n). Where n is the total number of roads, this method can quickly filter out a subset of candidate roads from the full road network with low computational cost. After the initial screening using a KD-tree, the number of candidate roads is reduced from the full road network to the initial screening set, significantly narrowing the search scope for subsequent precise queries.

[0124] In some examples, the KD-tree index is constructed with road center points as nodes, and these road center points are calculated from the road geometry. For each road... Its center point is ,in , These are the projected coordinates of the road center point under a unified measurement datum.

[0125] S302: Use the second spatial index to perform secondary road screening on the initially screened roads to obtain candidate roads for trajectory points.

[0126] Among them, candidate roads refer to the set of candidate roads obtained after precise querying through the second spatial index. All roads in this set of candidate roads are located within a preset range centered on the trajectory point.

[0127] In a possible implementation, the second spatial index is an R-tree index. The R-tree index is used to perform secondary road filtering on the initially screened roads, specifically by constructing a bounding box centered on the trajectory point and with a preset search radius R. Querying in R-tree Intersecting roads yield a set of candidate roads. The query time complexity of an R-tree index is O(log n). , where n is the total number of roads when the second spatial index is constructed, which can quickly complete spatial intersection queries.

[0128] By combining KD-tree and R-tree in a two-stage filtering process, the number of candidate roads is reduced from the total number of roads (n) to m, where m is much smaller than n. For a single-point query, the time complexity of KD-tree filtering is O(log n), the time complexity of R-tree secondary filtering is O(log n), and the number of candidate roads for a single point is m. For a batch query of k points, the total time complexity is analyzed as follows: province grouping is O(k), coordinate conversion is O(k), R-tree filtering is O(k log n), distance calculation is O(k×m), and result merging is O(k), for a total complexity of O(k(log n + m)). Compared to the time complexity of querying all roads point by point (O(k×n), the efficiency improvement is significant in large-scale trajectory point query scenarios.

[0129] It's important to note that the preset search radius R can be adjusted based on the specific application scenario. A value that is too large will increase the number of candidate roads and the computational load, while a value that is too small may result in missing roads that are far from the trajectory point. Generally speaking, a default preset search radius R of 5000 meters can cover the needs of most driving area recognition scenarios.

[0130] The process shown in S301-S302 above uses a two-level combined index architecture of KD-tree and R-tree. First, KD-tree is used for fast coarse screening, and then R-tree is used to perform precise range query based on the coarse screening results. This reduces the number of candidate roads from n to m, greatly narrows the calculation range of subsequent distance calculation, and significantly improves the road screening efficiency in scenarios with massive trajectory points.

[0131] like Figure 4 The diagram shown is a fourth flowchart of a vehicle driving area identification method provided in an embodiment of this application. This flowchart corresponds to the specific implementation of target area determination and includes the following steps.

[0132] S401: Determine the distance judgment result of the trajectory point based on the road deviation distance and the preset distance threshold.

[0133] The distance determination result is either off the road or not off the road.

[0134] In some examples, the road deviation distance of the trajectory point is compared with a preset distance threshold. When the road deviation distance is greater than the preset distance threshold, the distance determination result is determined to be a deviation from the road; when the road deviation distance is less than or equal to the preset distance threshold, the distance determination result is determined to be no deviation from the road. The preset distance threshold can be set according to the actual application scenario, for example, it can be set to 5 meters, 10 meters, or 20 meters, etc., and this application does not limit it in this way.

[0135] It should be noted that the distance determination result is a preliminary judgment based on geometric dimensions. When the distance determination result is "off-road," it indicates that the trajectory point is spatially far from the road, possibly indicating off-road behavior; when the distance determination result is "not off-road," it indicates that the trajectory point is spatially close to the road, and no off-road behavior is expected. However, the distance determination result is only a geometric dimension judgment and needs to be combined with environmental data for a comprehensive assessment to avoid misjudgment.

[0136] S402: Determine the environmental assessment result of the trajectory points based on the environmental data.

[0137] Among them, the environmental determination result is used to characterize the environmental type of the area where the trajectory point is located.

[0138] Optionally, the environmental data includes one or more environmental attributes. For details on the specific process of determining the environmental assessment results of trajectory points based on the environmental data, please refer to [link to relevant documentation]. Figure 5 The steps shown are explained below.

[0139] In some examples, the environmental assessment result is used to characterize the environmental type of the area where the trajectory point is located, such as whether it is a built-up area, a village area, or a paved area. When the environmental assessment result is a non-built-up area, it indicates that the area does not have the characteristics of an urban built-up environment. Combined with the distance assessment result, it can be further determined whether it is the target area.

[0140] S403: Based on the distance determination result and the environment determination result, determine whether the area where the trajectory point is located is the target area.

[0141] The distance determination result reflects the geometric deviation between the trajectory point and the road network, while the environmental determination result reflects the semantic attributes of the area where the trajectory point is located. Together, they constitute a dual-dimensional determination based on geometry and semantics. When the distance determination result indicates deviation from the road, it means that the trajectory point has deviated from the road network geometrically, exhibiting spatial characteristics of off-road behavior. When the environmental determination result indicates a non-built area, it means that the area where the trajectory point is located does not possess urban built-up environment characteristics and belongs to a non-human-inhabited area or a non-standardized construction area. Only when both of the above conditions are met simultaneously is the area where the trajectory point is located determined to be the target area. If the distance determination result indicates no deviation from the road, it means that the trajectory point is relatively close to the road, and regardless of the environmental determination result, it does not constitute off-road behavior. If the environmental determination result indicates a non-built area, it means that the area belongs to a built-up area, village area, or town area. Even if the trajectory point is far from the road, it should be primarily attributed to driving on village roads or activities in town fringe areas, rather than off-road behavior. Through the above dual-condition joint determination mechanism, misjudgments caused by single-dimensional determination can be effectively avoided.

[0142] Optionally, the process of determining whether the area where the trajectory point is located is the target area based on the distance determination result and the environment determination result can be as follows: when the distance determination result is that the trajectory point is deviating from the road and the environment determination result is that the area is not a built-up area, the area where the trajectory point is located is determined to be the target area.

[0143] In a possible implementation, a region is identified as a target area only when both the distance determination result and the environmental determination result simultaneously meet the above conditions; otherwise, it is identified as a non-target area. By combining the determination of geometric deviation and environmental attributes from two dimensions, misjudgments caused by single-dimensional determination can be effectively avoided. For example, based solely on a large road deviation distance, unpaved roads within a village may be misjudged as target areas. However, by introducing information such as Point of Interest (POI) type and building distribution from the environmental data, the area can be accurately identified as a village area rather than a target area.

[0144] It should be noted that if the distance determination result is "not deviating from the road," the area will not be considered a target area regardless of the environmental determination result; similarly, if the environmental determination result is not "not a non-built area," the area will not be considered a target area regardless of the distance determination result. In other words, a distance determination result indicating deviating from the road and an environmental determination result indicating "not a built area" are necessary conditions for the area to be considered a target area.

[0145] The processes described in S401-S403 above obtain a distance determination result by comparing the road deviation distance with a preset distance threshold, and obtain an environmental determination result by combining environmental data. Finally, the target area is determined based on the combined distance determination result and environmental determination result. This achieves a dual-dimensional joint determination of geometric deviation degree and environmental attributes, effectively avoiding misjudgment caused by a single geometric dimension determination (such as misjudging unpaved roads inside villages as target areas), and significantly improving the accuracy and robustness of driving area identification.

[0146] like Figure 5 The diagram shown illustrates the fifth step of a vehicle driving area identification method provided in this application embodiment. This step corresponds to a specific implementation method for determining environmental judgment results based on environmental data. The environmental data includes one or more environmental attributes. Determining environmental judgment results based on the environmental data includes: determining sub-judgment results corresponding to at least one environmental attribute based on at least one environmental attribute, and then determining the environmental judgment result of the trajectory point based on at least one sub-judgment result. Specifically, Figure 5 The process shown includes the following steps.

[0147] S501: Based on at least one environmental attribute, determine the sub-determination result corresponding to at least one environmental attribute.

[0148] Environmental attributes are the specific components of environmental data. Different environmental attributes characterize the environmental features of the area where the trajectory point is located from different dimensions: the type of point of interest reflects the semantic attributes of the area (e.g., whether it is a village area), the building distribution reflects the construction density of the area (e.g., whether it is a cluster of buildings), the paved road information reflects the road coverage of the area (e.g., whether it is a paved area), and the reverse geocoding information reflects the administrative division attributes of the area (e.g., whether it is a town area). By comprehensively utilizing multiple environmental attributes, the environmental characteristics of the area where the trajectory point is located can be comprehensively characterized from multiple dimensions. Sub-determination results refer to the judgment conclusions obtained after independently judging a single environmental attribute. For example, the sub-determination result corresponding to the point of interest type is a village area or a non-village area, and the sub-determination result corresponding to the building distribution is a cluster of buildings or a non-clustered building area, etc.

[0149] Optionally, at least one environmental attribute includes one or more of the following: point of interest type, building distribution, paved road information, and reverse geocoding information. The sub-determination result is determined as follows: based on the location coordinates of the trajectory points and the distribution information of the environmental attributes within a preset range, the sub-determination result corresponding to each environmental attribute is determined. Specifically, the implementation process of determining the sub-determination result corresponding to each environmental attribute based on the location coordinates of the trajectory points and the distribution information of the environmental attributes within a preset range can be found in [link to documentation]. Figure 6 The steps shown are explained below.

[0150] S502: Determine the environmental determination result of the trajectory point based on at least one sub-determination result.

[0151] The environmental determination result is a conclusion on the environmental type obtained by comprehensively judging one or more sub-determination results. In this application, the environmental determination result is used to characterize whether the area where the trajectory point is located is a non-built-up area. A non-built-up area refers to an area that does not have the characteristics of an urban built-up environment. The specific determination conditions are: the sub-determination result corresponding to the point of interest type is a non-village area, the sub-determination result corresponding to the paved road information is a non-paved area, the sub-determination result corresponding to the building distribution is a non-clustered building area, and the sub-determination result corresponding to the reverse geocoding information is a non-urban area.

[0152] Optionally, the process of determining the environmental determination result of the trajectory point based on at least one sub-determination result can be as follows: when the sub-determination result corresponding to the point of interest type is a non-village area, the sub-determination result corresponding to the paved road information is a non-paved area, the sub-determination result corresponding to the building distribution is a non-clustered building area, and the sub-determination result corresponding to the reverse geocoding information is a non-urban area, the environmental determination result of the trajectory point is determined to be a non-built area.

[0153] In some examples, a non-built area refers to an area that lacks the characteristics of a built-up urban environment. When the point of interest type of the area where the trajectory point is located does not exhibit village characteristics, the building density does not meet the building cluster standard, there are no paved roads, and the reverse geocoding address keywords do not contain the town type, the area can be identified as a non-built area. In this case, if the distance determination result is "off-road," then the area where the trajectory point is located is determined to be the target area.

[0154] It should be noted that the environmental determination result is determined to be a non-built area only when the sub-determination results corresponding to the above four environmental attributes simultaneously meet specific conditions. If any one of the sub-determination results does not meet the conditions (for example, the sub-determination result corresponding to the point of interest type is a village area, or the sub-determination result corresponding to the building distribution is a cluster of buildings area), then the environmental determination result is not a non-built area, and the area where the trajectory point is located will not be determined as the target area.

[0155] Optionally, after determining the environmental assessment result of the trajectory point in S502, this embodiment of the application also provides a refined application method for the environmental assessment result. Specifically, the environmental assessment result in S502 is based on four sub-assessment results: comprehensive assessment of point of interest type, paved road information, building distribution, and reverse geocoding information. It determines whether the area where the trajectory point is located is a non-built-up area. This is a macro-assessment of the environmental type.

[0156] Therefore, based on S502, this application embodiment also proposes S503. S503 further combines address keywords and road distance information from the reverse geocoding information to perform joint determination for the specific type of village area, so as to output a more refined multi-dimensional determination result. Through independent village determination conditions and road determination conditions, S503 can accurately distinguish between village areas and non-village areas, providing a more accurate environmental attribute basis for the off-road comprehensive determination in S403, thereby further improving the accuracy of driving area identification.

[0157] S503: Perform joint village and road determination on trajectory points and output multi-dimensional determination results.

[0158] Among them, the joint determination of village and road refers to combining reverse geocoding information and road distance to comprehensively determine from multiple dimensions whether the area where the trajectory point is located is a village area and whether the trajectory point is located on a road, and outputs a complete determination result tuple.

[0159] In a possible implementation, for trajectory points First, reverse geocoding is performed to obtain reverse geocoding information. This reverse geocoding information includes address descriptions at the provincial, municipal, district, township, and village levels.

[0160] Then, extract the address keywords (p) from the reverse geocoding information. When the address keywords match the preset village keyword set... When there is an intersection, the region is determined to have village semantic features. A pre-defined set of village keywords is used. The characters are: {“village”, “hamlet”, “fortress”, “township”, “brigade”}.

[0161] Simultaneously, based on the point-of-interest (POI) data in the map data, it is determined whether there are POIs belonging to the Village Types set. The Village Types set consists of {"village", "hamlet", "farm"}. When a POI belongs to this set, it indicates that the area possesses the semantic features of village POIs.

[0162] The criteria for determining a village can be recorded as follows: Specifically, when the address keyword satisfies the village feature and the point of interest type also satisfies the village feature, the area where the trajectory point p is located is determined to be a village area. POIs is the point of interest dataset in the map data, poi represents a point of interest, and ∃ is an existence quantifier.

[0163] In a possible implementation, road determination is based on the distance value from the trajectory point to the nearest road. .

[0164] For example, The calculation formula is: , This is a road dataset.

[0165] For example, a preset road distance threshold The default value is 5 meters.

[0166] The road determination criteria can be recorded as follows: .when Less than the preset road distance threshold If the trajectory point is on the road, it is determined that the trajectory point is located on the road; otherwise, it is determined that the trajectory point is not located on the road.

[0167] Finally, the output tuple for the joint determination of village roads is:

[0168] (12).

[0169] In formula (12), Indicates whether it is a village area. Indicate whether it is located on a road. This represents the distance from the trajectory point to the nearest road. This result tuple can be used for refined analysis of off-road behavior. For example, when the trajectory point is far from the road but located within a village area, it indicates driving on village roads rather than off-road behavior, thus effectively improving the accuracy of off-road identification.

[0170] The process shown in S501-S503 above determines the corresponding sub-judgment result from at least one environmental attribute, and then comprehensively determines the environmental judgment result based on at least one sub-judgment result. This realizes the determination of the environmental type of the area where the trajectory point is located from multi-dimensional environmental features (including point of interest type, building distribution, paved road information, reverse geocoding information, etc.), providing a semantic dimension judgment basis for off-road recognition and further improving the "geometric + semantic" dual judgment mechanism.

[0171] like Figure 6 The diagram shown is a sixth flowchart of a vehicle driving area identification method provided in this application embodiment. This flowchart corresponds to the specific implementation of various environmental attribute corresponding sub-determination results, including the following steps.

[0172] S601: Based on the location coordinates of the trajectory points, count the number of various interest points within a preset range. When the number of interest points belonging to the preset village type is greater than the preset number threshold, determine the sub-judgment result corresponding to the interest point type as a village area; otherwise, determine the sub-judgment result corresponding to the interest point type as a non-village area.

[0173] The point of interest (POI) data comes from the POI layer in the map data.

[0174] In some examples, the point-of-interest (POI) layers in the map data include various types of POI information such as restaurants, shopping, residences, villages, and farms. Preset village types include, but are not limited to, types related to rural settlements such as "village," "hamlet," "hamlet," "fortress," "township," "brigade," and "farm." The preset number threshold can be set according to the actual application scenario, for example, it can be set to 3 or 5.

[0175] In a possible implementation, the number of points of interest (POIs) of various types is counted within a preset range, centered on the location coordinates of the trajectory points. When the number of POIs belonging to a preset village type within the preset range exceeds a preset threshold, it indicates that the area has significant village characteristics, and the sub-determination result corresponding to the POI type is determined to be a village area; otherwise, it indicates that the area does not have significant village characteristics, and the sub-determination result corresponding to the POI type is determined to be a non-village area.

[0176] S602: Based on the location coordinates of the trajectory points, count the number of buildings within a preset range. When the number of buildings is greater than the preset building number threshold, determine the sub-judgment result corresponding to the building distribution as a clustered building area; otherwise, determine the sub-judgment result corresponding to the building distribution as a non-clustered building area.

[0177] Among them, clustered building areas refer to areas where the number of buildings per unit area reaches a preset threshold, indicating that the area has formed a certain scale of human settlement or built environment, while non-clustered building areas refer to areas where the number of buildings per unit area does not reach the preset threshold.

[0178] In some examples, building data is derived from building layers in map data. The preset building quantity threshold can be set according to the actual application scenario, for example, to 10 or 20 buildings.

[0179] In a possible implementation, the number of buildings is counted within a preset range, centered on the location coordinates of the trajectory point. When the number of buildings exceeds a preset building number threshold, it indicates that the building density in the area is high, and a certain built environment has been formed. The sub-judgment result corresponding to the building distribution is determined to be a clustered building area. Otherwise, it indicates that the building density in the area is low, and the sub-judgment result corresponding to the building distribution is determined to be a non-clustered building area.

[0180] S603: Based on the location coordinates of the trajectory points, determine whether there is a paved road within a preset range. If there is a paved road within the preset range, determine the sub-judgment result corresponding to the paved road information as a paved area; otherwise, determine the sub-judgment result corresponding to the paved road information as an unpaved area.

[0181] Paved roads refer to road types with hardened surfaces.

[0182] In some examples, paved roads include road types with paved surfaces such as highways, arterial roads, primary roads, secondary roads, and tertiary roads.

[0183] In a possible implementation, the system uses the location coordinates of the trajectory point as the center and queries within a preset range to determine if a paved road exists. If a paved road exists within the preset range, it indicates that the area is covered by paved roads, and the sub-determination result corresponding to the paved road information is determined to be a paved area. Otherwise, it indicates that the area is not covered by paved roads, and the sub-determination result corresponding to the paved road information is determined to be an unpaved area.

[0184] It should be noted that paved road information and unpaved road information are important bases for off-road determination. In target area identification scenarios, unpaved areas are usually strongly associated with off-road behavior: when there are no paved roads in the area where the trajectory point is located, it indicates that the area is not covered by the standard road network, and the vehicle entering the area may be engaging in off-road behavior.

[0185] S604: Obtain the address keywords in the reverse geocoding information. If the address keywords belong to the preset town type, determine the sub-determination result corresponding to the reverse geocoding information as a town area; otherwise, determine the sub-determination result corresponding to the reverse geocoding information as a non-town area.

[0186] Reverse geocoding refers to the process of converting geographic coordinates (i.e., latitude and longitude coordinates) into corresponding address description information.

[0187] In some examples, reverse geocoding information can be obtained from online map services to obtain address information at the provincial, municipal, district, township, and village levels. It should be noted that in this application, reverse geocoding information is only used as one source of environmental data to assist in determining the region type. The core solution of this application is still based on multi-layered spatial indexing and geometric distance calculation of local map data, and does not rely on online map services for road matching and off-road determination.

[0188] In a possible implementation, address keywords are extracted from the reverse geocoding information. When the address keywords belong to a preset town type (such as "city", "district", "street", "town", etc.), it indicates that the area where the trajectory point is located belongs to a town area, and the sub-determination result corresponding to the reverse geocoding information is determined to be a town area. Otherwise, it indicates that the area where the trajectory point is located does not belong to a town area, and the sub-determination result corresponding to the reverse geocoding information is determined to be a non-town area.

[0189] It should be noted that there is no fixed execution order among S601 to S604, and one or more of them can be executed according to actual needs. In a possible implementation, only S601 and S602 can be executed, that is, the sub-determination result can be determined based solely on the two environmental attributes of point of interest type and building distribution. In another possible implementation, the determination of all four environmental attributes from S601 to S604 can be executed simultaneously to obtain a more comprehensive environmental determination result. In practical applications, the required environmental attribute determination steps can be flexibly selected according to computing resources and accuracy requirements, and this application does not limit this.

[0190] The processes shown in S601-S604 above independently determine environmental attributes such as point of interest type, building distribution, paved road information, and reverse geocoding information, and comprehensively determine the environmental determination result based on the results of each sub-determination. This can comprehensively depict the environmental characteristics of the area where the trajectory point is located from multiple dimensions such as village features, building density, road paving conditions, and administrative division type, improving the accuracy and reliability of environmental determination and providing a more accurate semantic determination basis for driving area identification.

[0191] The processes described in S601-S604 above use a single trajectory point as the processing unit and determine the corresponding sub-judgment results through various environmental attributes, providing a refined basis for environmental judgment of trajectory points. The environmental attribute judgment and driving area recognition methods described in the above steps are mainly aimed at point-by-point analysis scenarios of discrete trajectory points.

[0192] In some examples, driving area identification requires not only point-by-point determination of discrete trajectory points but also overall analysis of user-specified continuous geographical areas. For instance, in applications such as road condition analysis, traffic scene modeling, and regional off-road risk assessment, it is necessary to comprehensively statistically analyze the geographical features within a polygonal region, including the number of points of interest, building density, and paved road coverage, to assess the off-road attributes and road coverage characteristics of the region at the regional level. To this end, this application also provides a feature statistical method for polygonal regions as a supplement and extension to the aforementioned point-by-point off-road determination.

[0193] Optionally, for the specific implementation process of polygon region feature statistics, please refer to [link / reference]. Figure 7 The steps shown are explained below.

[0194] like Figure 7 The diagram shown is a seventh flowchart of a vehicle driving area identification method provided in this application embodiment. This flowchart corresponds to the specific implementation of polygon area feature statistics and includes the following steps.

[0195] S701: Obtain the polygonal region input by the user.

[0196] The polygonal region is used to specify the geographical area to be statistically analyzed, and is formed by connecting several vertex coordinates sequentially. The polygonal region can be an area selected by the user on the map, or it can be a predefined geofence area; this application does not limit this.

[0197] In some examples, polygonal regions The boundary is represented as: , where lon and lat represent the longitude and latitude coordinates of each vertex, respectively.

[0198] Generally speaking, a polygonal region has at least 3 vertices, and the first and last vertices do not overlap to form a closed region.

[0199] S702: Resolves a polygonal region into a geographic polygonal object.

[0200] The polygonal region is formed by connecting a series of user-inputted vertex coordinates in sequence. The number of vertices must be at least three, and the first and last vertices must not overlap to form a closed region. Parsing refers to the process of converting the user-inputted vertex coordinate sequence into a geographic polygonal object with geometric semantics. During this conversion, the vertices are connected sequentially according to the input order to form a closed ring boundary, and the polygonal object is constructed based on this boundary. The parsed geographic polygonal object contains geometric attributes such as boundary, interior, and area, and supports geometric operations such as spatial intersection detection, centroid calculation, and area calculation.

[0201] It is important to note that the vertex coordinates input by the user are in latitude and longitude coordinates, and their coordinate reference system is consistent with the original geographic coordinates of the trajectory points in step S101. When the vertex coordinates input by the user are inconsistent with the coordinate reference system of the map data, the corresponding coordinate transformation is performed before parsing to unify them to the same coordinate reference system as the map data, so as to ensure the accuracy of subsequent spatial intersection queries.

[0202] In one possible implementation, the user-input polygon boundary is parsed into a Polygon object from the Shapely library. Shapely is an open-source library for geospatial geometry operations, supporting polygon construction, spatial intersection determination, centroid calculation, and other operations. The parsed geographic polygon object is used for subsequent spatial intersection queries and statistical analysis.

[0203] In some examples, the parsed polygon object can be represented as:

[0204] (13).

[0205] In formula (13), Polygon(·) represents the polygon constructor, and the input parameter is a list of vertex coordinates arranged in the input order.

[0206] S703: Determine the centroid of the polygonal region and determine the province it belongs to based on the centroid.

[0207] The centroid is the geometric center of the polygonal region, used to represent the spatial location of the polygonal region.

[0208] For example, the centroid of a polygonal region can be denoted as... .

[0209] In some examples, the province to which the polygonal region belongs is determined based on the latitude and longitude coordinates of its centroid, according to the province determination function in the provincial preloading mechanism. For example, the province determination formula could be: Once the province is determined, only the map data corresponding to that province is loaded for subsequent spatial statistical queries.

[0210] S704: Count the number of points of interest within a polygonal region.

[0211] Points of interest (POIs) are point-like geographic features in map data that have specific geographic coordinates and attribute labels, including but not limited to types such as restaurants, shopping centers, residences, villages, farms, and public facilities. POI data originates from the POI layer in the map data, and each POI contains its geometric location (longitude and latitude) and attribute information (type, name, category code, etc.).

[0212] In some examples, the geometric location of a point of interest (POI) is represented in space as a point, i.e., a zero-dimensional geometric object with explicit latitude and longitude coordinates. The POI type is mapped to a category field in the attribute information, used to determine the semantic category to which the POI belongs. Spatial intersection statistics are based on the topological relationship between the point and the polygon: when the geometric location of the POI is on or inside the boundary of the polygon region, the POI is determined to intersect with the polygon region; otherwise, it is determined not to intersect.

[0213] In a possible implementation, all points of interest in the map data are traversed, and it is determined whether the geometric location of each point of interest intersects with a polygonal region. If they intersect, the point of interest is counted as a point of interest within the polygonal region.

[0214] For example, the formula for calculating the number of points of interest within a polygonal region is:

[0215] (14).

[0216] In formula (14), POIs is the dataset of points of interest in the map data, and poi.geometry is the geometric shape of the points of interest. The mathematical meaning of formula (14) is: traverse all points of interest in the POIs set, filter out the points of interest that have spatial intersection with the polygonal region, form a subset of points of interest, and then count the number of elements in the subset.

[0217] In a possible implementation, all points of interest in the map data are traversed, and a spatial intersection determination function (such as the `intersects` method in the Shapely library) is called to determine whether the geometric position of each point of interest intersects with the polygonal region. If they intersect, the point of interest is counted as a point of interest within the polygonal region.

[0218] It should be noted that the statistical results of points of interest can be further subdivided by type. In a possible implementation, when it is necessary to count the number of points of interest of a specific type, a type filtering condition can be added during the traversal process to count only the number of points of interest belonging to a preset type. For example, if it is necessary to count the number of village-type points of interest within a polygonal area, then based on the intersection judgment, it is further checked whether the type field of the points of interest belongs to a preset village type set.

[0219] S705: Count the number of buildings within a polygonal area.

[0220] The building data originates from the building layer in the map data and is used to represent human-made structures in geographic space. Each building feature in the building data is stored in geometric form as a polygon or a point. When a building is stored as a polygon feature, its geometry is a polygon, representing the actual outline of the building on the ground; when a building is stored as a point feature, its geometric location is the center point of the building. The building data includes the building's geometric shape information and attribute information (such as building type, number of floors, and floor area).

[0221] In a possible implementation, all buildings in the map data are traversed, and it is determined whether the geometry of each building intersects with a polygonal region. If they intersect, the building is counted in the number of buildings within the polygonal region.

[0222] For example, the formula for calculating the number of buildings within a polygonal area is:

[0223] (15).

[0224] In formula (15), Buildings is the building dataset in the map data, and b.geometry is the geometric shape of the building. The mathematical meaning of formula (15) is: traverse all building elements in the Buildings set, filter out building elements that have spatial intersection with the polygon area, form a building subset, and then count the number of elements in the subset.

[0225] In a possible implementation, all building elements in the map data are traversed, and a spatial intersection detection function (such as the `intersects` method in the Shapely library) is called to determine whether the geometry of each building element intersects with the polygonal region. If they intersect, the building is counted in the number of buildings within the polygonal region.

[0226] S706: Determine whether there is a paved road within the polygonal area.

[0227] The paved road data originates from the road layer in the map data. Each paved road is stored in geometric form as a line or polyline, containing geometric shape information and attribute information (such as road grade, road name, pavement type, etc.). Paved roads are distinguished from unpaved roads (such as dirt roads, gravel roads, unpaved rural roads, etc.) by the road grade field or pavement type field in the road attribute information.

[0228] In a possible implementation, each road in the paved road dataset is traversed, and it is determined whether the geometry of the road intersects with a polygonal region. If at least one paved road intersects with a polygonal region, then a paved road is determined to exist within the polygonal region; otherwise, no paved road is determined to exist. The criterion for determining the existence of a paved road is as follows:

[0229] (16).

[0230] In formula (16), ∃ is an existential quantifier. For the paved road dataset, r.geometry is the geometry of road r. The mathematical meaning of formula (16) is: in the paved road dataset Roads_paved, if there exists at least one road r whose geometry r.geometry has a spatial intersection relationship with the polygon region Poly (i.e., the intersection is not empty), then it is determined that there is a paved road in the polygon region. If true; otherwise, it is determined that there is no paved road. (False).

[0231] It should be noted that the determination of the existence of paved roads differs in logic from the sub-determination result corresponding to paved road information in S603, but the determination criteria are the same. S603 is for a single trajectory point, querying whether a paved road exists within a preset range centered on the trajectory point, and the output result is a paved area or an unpaved area. S706 is for a polygonal area, querying whether a paved road exists within the entire polygonal area, and the output result is yes or no. Both use the spatial intersection relationship between the geometry of the paved road and the target area (search range or polygonal area) as the determination criterion, but the application scenarios and output formats are different: the former serves the determination of the environmental attributes of trajectory points, while the latter serves the statistical analysis of features at the region level.

[0232] The processes shown in S701-S706 above, by parsing the polygonal region into a geographic polygonal object and performing a spatial intersection query, can quickly count the number of points of interest, the number of buildings, and the existence of paved roads within the polygonal region. This provides regional-level statistical features for driving area identification and can be used for regional attribute analysis in application scenarios such as road condition assessment and traffic scene modeling.

[0233] like Figure 8 The diagram shown is the eighth flowchart of a vehicle driving area identification method provided in this application embodiment. This flowchart corresponds to the specific implementation of reverse geocoding-assisted off-road determination. Reverse geocoding-assisted determination serves as a semantic dimension supplement to the aforementioned comprehensive determination of driving areas. By converting the geographic coordinates of trajectory points into address description information and extracting semantic features from them, it assists in determining whether the area where the trajectory point is located belongs to a specific area type such as a village or town, thereby further improving the accuracy of driving area determination. The steps are as follows.

[0234] S801: Obtain the inverse geocoding information of the trajectory points.

[0235] Reverse geocoding refers to the process of converting geographic coordinates (i.e., latitude and longitude coordinates) into corresponding address description information. Reverse geocoding information includes address descriptions at the provincial, municipal, district, township, and village levels, as well as auxiliary information such as the point of interest type and administrative division code corresponding to the address.

[0236] In a possible implementation, obtaining the reverse geocoding information of trajectory points can be achieved by calling a reverse geocoding service interface. Specifically, a query request containing the latitude and longitude coordinates of the trajectory points is sent to the reverse geocoding service, and the address description information returned by the reverse geocoding service is received. The reverse geocoding service can be an application programming interface provided by an online map service, or it can be a locally deployed reverse geocoding engine; this application does not limit this.

[0237] In some examples, the acquisition of reverse geocoding information may also include a caching mechanism for reverse geocoding information. When the geographical locations of multiple trajectory points are relatively close, the acquired reverse geocoding information can be reused directly to reduce the number of repeated queries and decrease dependence on external services.

[0238] It should be noted that in this application, reverse geocoding information is only used as an auxiliary source of environmental data to determine the semantic type of the area where the trajectory point is located. The core solution of this application is still based on the multi-layer spatial index and geometric distance calculation of local map data, rather than relying on online map services for road matching and off-road determination.

[0239] S802: Determine the regional semantic type of the area where the trajectory point is located based on the address keywords in the reverse geocoding information.

[0240] Address keywords refer to semantically meaningful words extracted from address descriptions in reverse geocoding information. Address keywords can include administrative division names (such as "Hebei Province" or "Chengdu City"), settlement names (such as "Lijiazhuang" or "Zhaojiatun"), and geographic entity names (such as "Daxinganling" or "Poyang Lake"). Regional semantic types are used to characterize the functional attributes and human activity characteristics of the area where the trajectory point is located, such as whether it belongs to a village area, town area, industrial area, or natural area.

[0241] In a possible implementation, address keywords are extracted from reverse geocoding information, and these extracted address keywords are matched with a preset set of semantic keywords to determine the regional semantic type of the area where the trajectory point is located. The preset set of semantic keywords includes village keyword sets, town keyword sets, and natural geographic keyword sets, etc.

[0242] In some examples, address keywords can be extracted by parsing address elements (such as names corresponding to levels like "province," "city," "district," "township," and "village") in reverse geocoding information, and using the address names at each level as keywords. For example, if the name at the "township" level in the address information returned by reverse geocoding is "Xinglong Town," then both "Xinglong" and "town" can be used as address keywords.

[0243] In a possible implementation, the logic for determining the semantic type of a region is as follows: when the address keyword belongs to a preset set of village keywords, the semantic type of the region is determined to be village type; when the address keyword belongs to a preset set of town keywords, the semantic type of the region is determined to be town type; when the address keyword does not belong to any preset type, the semantic type of the region is determined to be unknown type.

[0244] In possible implementations, address keyword matching can employ either exact matching or fuzzy matching. Exact matching requires the address keyword to be exactly the same as the preset keyword, while fuzzy matching allows for a certain edit distance or semantic similarity between the address keyword and the preset keyword. This application does not limit the matching method and allows for flexible selection based on the actual application scenario.

[0245] S803: Based on the region semantic type, assist in determining whether the region where the trajectory point is located is the target region.

[0246] In this context, "auxiliary determination" refers to the use of the regional semantic type as the semantic dimension for off-road determination. Together with the distance determination results in S401-S403, it constitutes a dual determination mechanism of geometry and semantics. When the regional semantic type is "village," it indicates that the area where the trajectory point is located belongs to a human settlement. Even if the trajectory point is far from the road, it should be prioritized as driving on village roads rather than off-road behavior. When the regional semantic type is "town," it indicates that the area where the trajectory point is located belongs to a built-up urban area. Even if the trajectory point is far from the road, it should be prioritized as an activity within the town rather than off-road behavior. When the regional semantic type is "unknown," the regional semantic dimension does not provide additional determination criteria, and the off-road determination is mainly determined by the distance determination results of the geometric dimension.

[0247] In some examples, the auxiliary role of region semantic type in off-road determination is reflected in the adjustment of determination conditions. When the region semantic type is village or town, the area where the trajectory point is located should not be directly determined as the target area, even if it is geometrically far from the road. Specifically, in the comprehensive determination of S403, in addition to the distance determination result being off-road, the region semantic type must not be village or town to be finally determined as the target area.

[0248] In a possible implementation, the specific method for auxiliary determination is as follows: when the distance determination result is off-road and the region semantic type is neither village nor town, the region where the trajectory point is located is determined to be the target region; otherwise, it is determined to be a non-target region. The above auxiliary determination logic can be implemented in the following way: first, obtain the inverse geocoding information of the trajectory point to determine the region semantic type, and then use the region semantic type as a supplementary basis for the environmental determination result, and make a comprehensive determination with the distance determination result.

[0249] It should be noted that the reverse geocoding-assisted determination described in S801-S803 can be performed before the off-road determination step in S403, or in parallel with S401-S402. When the region semantic type is determined to be a village type or a town type, off-road determination can be excluded in advance in the comprehensive determination in S403 to reduce the computational overhead of subsequent unnecessary environmental attribute determination.

[0250] The processes described in S801-S803 above obtain the inverse geocoding information of the trajectory points and extract address keywords to determine the regional semantic type of the area where the trajectory points are located. Based on the regional semantic type, the target area is determined with the assistance of semantic dimension. This provides a semantic dimension for the identification of driving areas, avoids misjudging village areas or town areas as target areas, and further improves the accuracy of driving area determination.

[0251] like Figure 9 The diagram shown is a schematic representation of a vehicle architecture according to an embodiment of this application. The vehicle includes a processor 901, a memory 902, and a bus 903. The processor 901 and the memory 902 are connected via the bus 903. The memory 902 is used to store programs, and the processor 901 is used to run the programs. When the programs run, they execute the vehicle driving area identification method provided in this application, including the following steps:

[0252] Acquire vehicle trajectory point data and map data; the vehicle trajectory point data includes trajectory points; the map data includes road network data and environmental data;

[0253] Construct a multi-level spatial index for the road network data; the multi-level spatial index contains at least two index levels, each index level is used to filter roads step by step and the filtering accuracy increases step by step.

[0254] Based on the multi-layer spatial index, road filtering is performed on the trajectory points to determine candidate roads for the trajectory points;

[0255] Calculate the spatial distance between each candidate road and the trajectory point;

[0256] The minimum value among the spatial distances is selected as the road deviation distance of the trajectory point;

[0257] Based on the road deviation distance of the trajectory point and the environmental data, determine whether the area where the trajectory point is located is the target area, and output the determination result.

[0258] Optionally, the multi-level spatial index includes a first spatial index and a second spatial index;

[0259] Based on the multi-layer spatial index, road filtering is performed on the trajectory points to determine candidate roads for the trajectory points, including:

[0260] The first spatial index is used to perform preliminary road screening on the trajectory points to obtain the preliminary road screening of the trajectory points;

[0261] The second spatial index is used to perform secondary road screening on the initially screened roads to obtain candidate roads for the trajectory points.

[0262] Optionally, based on the road deviation distance of the trajectory point and the environmental data, determining whether the area where the trajectory point is located is the target area includes:

[0263] The distance determination result of the trajectory point is determined based on the road deviation distance and the preset distance threshold; the distance determination result is either deviating from the road or not deviating from the road.

[0264] Based on the environmental data, determine the environmental assessment result of the trajectory point;

[0265] Based on the distance determination result and the environment determination result, determine whether the area where the trajectory point is located is the target area.

[0266] Optionally, the environmental data includes one or more environmental attributes;

[0267] Based on the environmental data, the environmental determination result of the trajectory point is determined, including:

[0268] Based on at least one of the environmental attributes, determine the sub-determination result corresponding to at least one of the environmental attributes;

[0269] The environmental determination result of the trajectory point is determined based on at least one of the sub-determination results.

[0270] Optionally, the sub-determination result is determined in the following way:

[0271] Based on the position coordinates of the trajectory points and the distribution information of the environmental attributes within a preset range, the sub-judgment results corresponding to each environmental attribute are determined.

[0272] Optionally, at least one of the environmental attributes includes one or more of the following: point of interest type, building distribution, paved road information, and reverse geocoding information;

[0273] Based on at least one of the sub-determination results, the environmental determination result of the trajectory point is determined, including:

[0274] When the sub-determination result corresponding to the point of interest type is a non-village area, the sub-determination result corresponding to the paved road information is a non-paved area, the sub-determination result corresponding to the building distribution is a non-clustered building area, and the sub-determination result corresponding to the reverse geocoding information is a non-urban area, the environmental determination result of the trajectory point is determined to be a non-built area.

[0275] Optionally, determining whether the area where the trajectory point is located is the target area based on the distance determination result and the environment determination result includes:

[0276] When the distance determination result is that the location deviates from the road and the environment determination result is that the area where the trajectory point is located is determined to be the target area.

[0277] Optionally, the method further includes:

[0278] When the number of candidate roads is zero, the road deviation distance is assigned a preset value; the preset value is used to indicate that the area where the trajectory point is located is the target area.

[0279] Optionally, the method further includes:

[0280] Obtain the inverse geocoding information of the trajectory points;

[0281] Based on the address keywords in the reverse geocoding information, determine the regional semantic type of the area where the trajectory point is located;

[0282] Based on the semantic type of the region, it is helpful to determine whether the region where the trajectory point is located is the target region.

[0283] In summary, this application improves the efficiency and accuracy of spatial distance querying between massive trajectory points and road networks by constructing a multi-layered spatial index to filter roads step by step and combining coordinate transformation under a unified metric benchmark. At the same time, it introduces environmental data for comprehensive judgment, realizing accurate identification of driving areas in both geometric and semantic dimensions, and providing efficient and reliable technical support for driving area identification of large-scale vehicle trajectories.

[0284] While several specific implementation details are included in the foregoing discussion, these should not be construed as limiting the scope of this application. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0285] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A method for identifying vehicle driving areas, characterized in that, include: Acquire vehicle trajectory point data and map data; the vehicle trajectory point data includes trajectory points; the map data includes road network data and environmental data; Construct a multi-level spatial index for the road network data; the multi-level spatial index contains at least two index levels, each index level is used to filter roads step by step and the filtering accuracy increases step by step. Based on the multi-layer spatial index, road filtering is performed on the trajectory points to determine candidate roads for the trajectory points; Calculate the spatial distance between each candidate road and the trajectory point; The minimum value among the spatial distances is selected as the road deviation distance of the trajectory point; Based on the road deviation distance of the trajectory point and the environmental data, determine whether the area where the trajectory point is located is the target area, and output the determination result.

2. The method according to claim 1, characterized in that, The multi-level spatial index includes a first spatial index and a second spatial index; Based on the multi-layer spatial index, road filtering is performed on the trajectory points to determine candidate roads for the trajectory points, including: The first spatial index is used to perform preliminary road screening on the trajectory points to obtain the preliminary road screening of the trajectory points; The second spatial index is used to perform secondary road screening on the initially screened roads to obtain candidate roads for the trajectory points.

3. The method according to claim 1, characterized in that, Based on the road deviation distance of the trajectory point and the environmental data, determining whether the area where the trajectory point is located is the target area includes: The distance determination result of the trajectory point is determined based on the road deviation distance and the preset distance threshold; the distance determination result is either deviating from the road or not deviating from the road. Based on the environmental data, determine the environmental assessment result of the trajectory point; Based on the distance determination result and the environment determination result, determine whether the area where the trajectory point is located is the target area.

4. The method according to claim 3, characterized in that, The environmental data includes one or more environmental attributes; Based on the environmental data, the environmental determination result of the trajectory point is determined, including: Based on at least one of the environmental attributes, determine the sub-determination result corresponding to at least one of the environmental attributes; The environmental determination result of the trajectory point is determined based on at least one of the sub-determination results.

5. The method according to claim 4, characterized in that, The sub-determination result is determined in the following way: Based on the position coordinates of the trajectory points and the distribution information of the environmental attributes within a preset range, the sub-judgment results corresponding to each environmental attribute are determined.

6. The method according to claim 4, characterized in that, At least one of the aforementioned environmental attributes includes one or more of the following: point of interest type, building distribution, paved road information, and reverse geocoding information; Based on at least one of the sub-determination results, the environmental determination result of the trajectory point is determined, including: When the sub-determination result corresponding to the point of interest type is a non-village area, the sub-determination result corresponding to the paved road information is a non-paved area, the sub-determination result corresponding to the building distribution is a non-clustered building area, and the sub-determination result corresponding to the reverse geocoding information is a non-urban area, the environmental determination result of the trajectory point is determined to be a non-built area.

7. The method according to claim 3, characterized in that, Based on the distance determination result and the environment determination result, determining whether the area where the trajectory point is located is the target area includes: When the distance determination result is that the location deviates from the road and the environment determination result is that the area where the trajectory point is located is determined to be the target area.

8. The method according to claim 1, characterized in that, The method further includes: When the number of candidate roads is zero, the road deviation distance is assigned a preset value; the preset value is used to indicate that the area where the trajectory point is located is the target area.

9. The method according to claim 1, characterized in that, The method further includes: Obtain the inverse geocoding information of the trajectory points; Based on the address keywords in the reverse geocoding information, determine the regional semantic type of the area where the trajectory point is located; Based on the semantic type of the region, it is helpful to determine whether the region where the trajectory point is located is the target region.

10. A vehicle, characterized in that, include: Processor, memory, and bus; The processor and the memory are connected via the bus; The memory is used to store a program, and the processor is used to run the program, wherein the program is executed by the processor to perform the vehicle driving area identification method according to any one of claims 1-9.