Automotive-oriented dynamic electronic fence generation method and readable storage medium

By collecting historical vehicle data and combining density clustering and deep learning models, a dynamic generation technique is used to solve the vehicle risk control and monitoring problem that cannot be solved by existing technologies. This achieves an upgrade from static geographical boundaries to a dynamic risk control system, improving the accuracy and real-time performance of vehicle risk control and monitoring.

CN121968019BActive Publication Date: 2026-06-26BEIJING CHEXIAO TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING CHEXIAO TECH CO LTD
Filing Date
2026-04-03
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Traditional vehicle electronic fences are static geographical boundaries, which cannot achieve intelligent discovery of risk areas, construction of multi-level fences, and dynamic adaptive adjustment of parameters, making it difficult to meet the refined, dynamic, and high-precision requirements of vehicle-mounted risk control scenarios.

Method used

By collecting historical vehicle driving trajectory data and historical alarm records, and combining density clustering algorithms and deep learning models, an initial risk area model is generated. A three-dimensional hierarchical fence structure is constructed, and a dynamic parameter adjustment model is used to calculate the fence threshold and warning sensitivity in real time. By applying a finite state machine model, a time sliding window algorithm, and behavioral intent analysis, a dynamic adjustment fence generation method and a readable storage medium are realized across the hierarchical system. This provides a method for researchers to upgrade the electronic fence generation method and the dynamic risk control system applied to vehicles, based on the patent specification and the integration of multi-source data mining and spatial hierarchical topology.

Benefits of technology

It has achieved a highly efficient vehicle risk control and monitoring system, and has integrated and formulated a dynamic and multi-level management and control system for efficient vehicle risk control and safety monitoring, thus solving the problems of accuracy and real-time performance in vehicle risk control and monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121968019B_ABST
    Figure CN121968019B_ABST
Patent Text Reader

Abstract

The application discloses a kind of dynamic electronic fence generation methods for car, this method first gathers vehicle information after denoising, excavates risk area and permanent site, generates initial risk area model with boundary coordinates and risk level;Again, administrative division, road vector data are fused, and three-dimensional hierarchical fence structure is constructed, and fence boundary is optimized by Douglas-Pork algorithm and cubic B-spline function;Then according to the real-time driving state of vehicle, the fence radius is dynamically adjusted by linear inflation algorithm, and the alarm sensitivity is controlled by classification, to generate dynamic fence configuration;Finally, based on state machine model monitoring vehicle positioning, combined with priority arbitration, hysteresis comparison mechanism handles fence switching and boundary jitter, filters redundant alarm through time sliding window and behavior intention analysis, generates warning report with context.The application realizes the dynamicization of electronic fence, multi-level management and control, improves the accuracy and adaptability of vehicle risk control monitoring, and reduces the false alarm rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle risk control and electronic fence technology, and in particular to a method for generating dynamic electronic fences for automobiles and a readable storage medium. Background Technology

[0002] With the rapid development of industries such as vehicle rental, the demand for vehicle asset risk control and security monitoring is increasing. Electronic fences, as a core technology, are widely used in scenarios such as cross-regional vehicle management, high-risk area early warning, and violation monitoring. Traditional automotive electronic fences are mostly static geographical boundaries, only allowing for the setting of fixed fence ranges and alarm thresholds. While existing technologies offer some improvements to electronic fences, such as simple radius adjustments and basic clustering for risk point identification, they lack a complete closed-loop system encompassing intelligent risk area discovery, multi-level fence construction, dynamic parameter adaptive adjustment, and precise early warning execution. This fails to address the aforementioned multi-dimensional technical challenges and cannot meet the core requirements of refined, dynamic, and highly accurate electronic fences in vehicle risk control scenarios. Summary of the Invention

[0003] To address the aforementioned problems, this invention proposes a dynamic electronic fence generation method and system for automobiles. It integrates technologies such as multi-source data mining, spatial hierarchical topology, dynamic parameter adjustment, and behavioral intent analysis to upgrade the electronic fence from a static geographical boundary to a dynamic risk control system, significantly improving the accuracy and real-time performance of vehicle risk control monitoring. Specifically, this invention discloses a dynamic electronic fence generation method for automobiles, characterized by the following steps:

[0004] Collect historical vehicle driving trajectory data, historical alarm records, and risk geographic information. After preprocessing and cleaning, combine density clustering algorithm and deep learning model to mine high-risk areas and vehicle parking points and extract features to generate an initial risk area model containing accurate boundary coordinates and risk levels.

[0005] Based on the initial risk area model, vector map data of administrative divisions and specific roads are integrated to construct a three-dimensional hierarchical fence structure. After boundary fitting and smoothing optimization, a multi-level static fence set is obtained.

[0006] Receive the multi-level static fence set and real-time vehicle driving status data, use the dynamic parameter adjustment model to calculate and correct the trigger threshold, effective radius and warning sensitivity of the multi-level static fence in real time, and output a dynamic electronic fence configuration adapted to the current vehicle behavior characteristics.

[0007] The dynamic electronic fence configuration is used to monitor the real-time location stream of vehicles and generate accurate violation warnings and trajectory tracking reports with coherent contextual information.

[0008] The process of preprocessing and cleaning, followed by combining density clustering algorithms and deep learning models to mine high-risk areas and frequently stopped vehicle locations and extract features, specifically includes:

[0009] The first GPS trajectory data is obtained by removing abnormal drift points and speed anomalies from the vehicle's original GPS trajectory based on kinematic logic.

[0010] The first GPS trajectory data is then smoothed using the Kalman filter algorithm, and the data deduplication operation is performed to obtain the second GPS trajectory data.

[0011] The DBSCAN density clustering algorithm is used to analyze the parking point data of the second GPS trajectory data to identify the vehicle's permanent location and obtain a discrete parking point set.

[0012] The Long Short-Term Memory (LSTM) network is applied to perform spatiotemporal sequence analysis on historical alarm data to extract features of potential high-risk violation areas.

[0013] In a second aspect, the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions for causing a computer to execute the above-described method for generating a dynamic electronic fence for automobiles.

[0014] This invention creates a closed-loop electronic fence management system covering the entire process from multi-source data risk mining to precise early warning execution. It breaks through the limitations of traditional static electronic fence technology, achieving dynamic, multi-level, and refined management of electronic fences, significantly improving the adaptability and accuracy of vehicle risk control monitoring. Technically, it uses a Kalman filter algorithm to denoise GPS tracks, combined with DBSCAN density clustering and an LSTM deep learning model to mine risk areas and vehicle locations from both spatiotemporal dimensions, generating an initial risk area model with accurate boundaries and reasonable classification. It establishes a three-dimensional hierarchical logical topology of administrative level, road level, and custom risk level, coupled with an R-tree variant spatial index and a "maximum weight wins" arbitration mechanism, solving the problems of single-level and conflicting strategies in traditional fences, and achieving differentiated layered management in complex geographical scenarios. It integrates the Douglas-Puk algorithm and cubic B-spline function to optimize fence boundaries, preserving geometric features while eliminating redundant points, reducing the storage and computing load on vehicle terminals, and ensuring that fence boundaries conform to irregular geographical features.

[0015] This invention, based on vehicle speed vectors, time windows, and behavioral patterns, achieves dynamic adaptive adjustment of fence parameters through a linear expansion algorithm and a hierarchical adjustment method. This allows the electronic fence to accurately adapt to the dynamic driving behavior of vehicles, solving the problems of untimely high-speed alarms and false alarms when stationary. Simultaneously, it introduces a finite state machine model, a hysteresis comparison mechanism, a time sliding window algorithm, and vehicle behavior intent analysis to achieve smooth switching across fence levels, effective filtering of boundary jitter, and redundant alarm aggregation and deduplication. This accurately identifies abnormal boundary crossing intentions and significantly reduces the warning redundancy rate. The system adopts a modular design, with smooth data interaction between modules. It supports millisecond-level hot updates of risk control rules and multi-channel push of warning information. It encapsulates evidence chain data packages containing historical trajectories and dynamic parameters, enabling traceability of alarm events and providing complete technical support for closed-loop vehicle risk control.

[0016] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

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

[0018] Figure 1 A flowchart illustrating a method for generating dynamic electronic fences for automobiles, as provided in this embodiment of the disclosure.

[0019] Figure 2 A flowchart of a risk area intelligent identification method based on multi-source data provided in this disclosure embodiment.

[0020] Figure 3 A flowchart illustrating the method for constructing a multi-level vectorized fence model provided in this embodiment of the disclosure.

[0021] Figure 4 A flowchart illustrating the dynamic adaptive adjustment method for fence parameters provided in this embodiment of the disclosure.

[0022] Figure 5 A flowchart illustrating the cross-domain coherent tracking and precise early warning execution method provided in this embodiment of the disclosure.

[0023] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. Detailed Implementation

[0024] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0025] It should be understood that the following specific examples illustrate the implementation of this disclosure, and those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. This disclosure can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0026] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.

[0027] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. The drawings only show the components related to this disclosure and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0028] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.

[0029] See Figure 1 As shown in the figure, this disclosure provides a method for generating dynamic electronic fences for automobiles, which specifically includes the following steps.

[0030] Step S1: Collect historical driving trajectory data, historical alarm records, and risk geographic information of vehicles. After preprocessing and cleaning, use density clustering algorithms (such as DBSCAN) or deep learning models to mine and extract features from high-risk areas and vehicle stop points, thereby generating an initial risk area model containing precise boundary coordinates and risk levels. Figure 2 As shown in the schematic diagram of the intelligent risk area identification process based on multi-source data, step S1 is implemented through the following steps:

[0031] Step S101: Collect multi-source data for the vehicle. Connect the vehicle's CAN bus via the onboard T-BOX or OBD device, set a fixed sampling frequency (e.g., 1Hz) to read the vehicle's historical driving trajectory data for the past three months. The data fields specifically include latitude and longitude in the WGS-84 coordinate system (e.g., E 120.153, N 30.287), UTC timestamp, and instantaneous speed. At the same time, establish a connection with the cloud-based risk control platform through an encrypted API interface to synchronously retrieve historical violation alarm records (e.g., abnormal power outages, offline timeouts) and known financial risk geographic information databases (e.g., polygon coordinate sets containing specific "second mortgage" garages or high-risk used car trading markets).

[0032] Step S102: Based on kinematic logic, abnormal drift points are removed. The Kalman filter algorithm is used to smooth and denoise the trajectory data after removing abnormal drift points, and duplicate redundant data is deduplicated to ensure data quality.

[0033] First, based on kinematic logic, abnormal drift points are eliminated. The distance and time difference between adjacent GPS sampling points are calculated. If the calculated instantaneous speed exceeds the vehicle's physical limits (for example, if the Euclidean distance between two points exceeds 500 meters within a 1-second sampling interval, it means the speed reaches 1800 km / h), then the point is determined to be a drift noise point caused by signal blockage or multipath effect and is directly eliminated.

[0034] Secondly, the Kalman filter algorithm is applied to smooth and denoise the trajectory, constructing a four-dimensional state vector containing the vehicle's latitude, longitude, and velocity components. A state transition equation is established based on the assumption of uniform motion, and the prior state at the current moment is inferred using the posterior estimate from the previous moment. GPS observation data at the current moment is introduced, and the Kalman gain is calculated using the prediction error covariance and observation noise covariance matrix. This gain serves as a dynamic weighting coefficient to balance the model predictions and sensor observations.

[0035] Specifically, when the algorithm assesses low observation noise (such as in open road sections), the calculated gain increases, and the system assigns higher weight to the observation data to correct the state. Conversely, when observation noise is high (such as when tall buildings obstruct the view), the gain decreases, and the system reduces its confidence in the observations, retaining more predictions based on kinematic laws to achieve optimal state estimation. For example, when a vehicle encounters multipath effects at tunnel entrances or near tall buildings, causing a jump in the positioning point, the algorithm recognizes the increased observation variance and automatically reduces its confidence in the current GPS noise, relying more on the inertial predictions of the motion model for position correction. This effectively smooths out small-amplitude random errors and restores the vehicle's true, smooth driving curve.

[0036] The Kalman filter algorithm is applied to smooth and denoise the trajectory: a model containing the vehicle's latitude and longitude positions is constructed. With velocity components The four-dimensional state vector Based on the assumption of uniform motion, a state transition equation is established. After 1 second: ,

[0037] , , The prior state at the current time is inferred from the posterior estimate of the previous time step, and its prediction equation is as follows: ,in Let K represent the prior state estimate at the current time (i.e., the vehicle position and velocity calculated based on the model), and F be the state transition matrix describing the uniform motion of the vehicle. This is the optimal state estimate for the previous time step k-1. The prediction equation matrix follows the uniform motion rule, using the position and velocity from the previous second to calculate the predicted position for the current second. Simultaneously, the prediction error covariance matrix is ​​calculated. ,in The covariance represents the uncertainty of the prediction result. Let $\mathbf{a}$ be the posterior error covariance of the previous time step. The process noise covariance matrix is ​​used to characterize the random disturbances within the system caused by non-uniform motion (such as rapid acceleration and sharp turns) during actual vehicle operation. Subsequently, GPS observation data at the current moment is introduced. , The observation matrix is ​​used to extract the 2D position from the 4D state. The Kalman gain is then calculated. The calculation formula is: ,in To map a four-dimensional state vector to an observation matrix in a two-dimensional observation space, The observation noise covariance matrix represents the level of measurement error caused by signal obstruction or multipath effects of the GPS sensor. As dynamic weighting coefficients, they are used in the state update equation. To correct the predicted values ​​and update the covariance matrix. This allows for optimal state estimation.

[0038] Specifically, the algorithm balances model confidence by dynamically adjusting the relationship between R and P: when the algorithm evaluates low observation noise (e.g., in open road sections where the R value is low), the calculated gain is... Increase, the system assigns observation data Higher weights are used to correct the state; conversely, when observation noise is high (such as tall buildings obstructing the view, causing an increase in the R value), the gain is increased. When the number of observations decreases, the system places less trust in the observations and retains more predictions based on kinematic laws. For example, when a vehicle encounters multipath effects at the entrance of a tunnel or near a tall building, causing a jump in the positioning point, the algorithm recognizes the increased observation variance and will automatically reduce its trust in the current GPS noise, relying more on the inertial prediction of the motion model for position correction. This effectively smooths out small-amplitude random errors and restores the vehicle's true smooth driving curve.

[0039] Finally, a data deduplication operation is performed. The trajectory data stream is traversed to identify redundant records with the same timestamp or whose coordinates completely overlap within a very short time (e.g., within 10ms). Only the first valid data record is retained, and subsequent duplicate uploaded invalid frames are removed, thereby ensuring the data purity of subsequent mining algorithms.

[0040] Step S103: Analyze the cleaned parking point data using the DBSCAN density clustering algorithm, setting the neighborhood radius Eps to 50 meters and the minimum number of neighbors MinPts for the core point to 20, and automatically clustering to identify the vehicle's permanent location (such as home or company); at the same time, apply a Long Short-Term Memory (LSTM) network to perform spatiotemporal sequence analysis on historical alarm data to extract features of potential high-risk violation areas.

[0041] First, the DBSCAN density clustering algorithm is used to analyze the cleaned parking spot data to identify permanent locations: the denoised parking coordinate data is input into the algorithm, the neighborhood radius parameter Eps is set to 50 meters, and the minimum number of neighbors MinPts for the core point is set to 20. The algorithm calculates the Euclidean distance between points and groups densely connected points into the same cluster. For example, if more than 20 parking records are detected within a 50-meter radius of a certain coordinate point (E 116.40, N 39.90), it is clustered into a high-density area; combined with timestamp features, if the parking time in this area is mainly distributed between 22:00 and 07:00 the next day, its semantic label is automatically defined as "home"; otherwise, if it is distributed during working hours, it is defined as "company".

[0042] Secondly, a Long Short-Term Memory (LSTM) network is applied to perform spatiotemporal sequence analysis on historical alarm data to extract latent risks. A time-series vector containing alarm type (e.g., power outage, vibration), occurrence time, and geographical location is input into the LSTM model. Historical state information is filtered through a forgetting gate, current alarm features are fused using an input gate, and hidden states are generated using an output gate. This allows key risk features to be maintained in the memory unit for a long time, accurately capturing long-distance temporal dependencies. For example, if the LSTM model detects a specific abnormal sequence pattern in an unmarked geographic grid (e.g., a suburban area) during time-series simulation—that is, triggering an "external power cut-off alarm" in the "ACC off" state, followed by consecutive "GPS signal loss" and "abnormal vibration" within a 300-second time window—the model will identify that this pattern highly matches the known "illegal equipment removal" behavior characteristics (matching degree > 90%). The system then determines that the area has an extremely high risk of violation, automatically aggregating all historical trajectory points within the area to generate a new risk polygon, and marking its attributes as potential "second-hand garages" or "illegal transaction black spots."

[0043] DBSCAN and LSTM play distinct yet complementary roles in this step. DBSCAN handles the spatial dimension, focusing on "where cars park most frequently," and outputs a structured whitelist of permanent parking locations. LSTM handles the temporal dimension, focusing on "what abnormal processes the car's behavior has undergone," and outputs dynamically discovered blacklisted risk points. The two also form a clever relay relationship in the data flow. DBSCAN's input is parking points smoothed by Kalman filtering, which has removed GPS noise to ensure that clustering results do not misinterpret signal drift as actual parking. LSTM's input includes the original alarm timing sequence, preserving the original information sensitive to anomalies and avoiding over-smoothing that erases key risk signals. Together, they constitute the initial risk area model: permanent parking locations discovered by DBSCAN are marked as low-risk, and risk points discovered by LSTM are marked as high-risk. The geospatial relationship between them is further processed through topological calculations to ensure no logical conflicts arise.

[0044] Step S104: Generate the minimum convex hull or concave hull contour based on the mined clusters, and determine the precise set of boundary coordinates; combine business rules to mark the permanent residence as a low-risk area and the blacklist overlapping area as a high-risk area, thereby generating an initial risk area model containing a sequence of polygon vertex coordinates and corresponding risk level labels.

[0045] First, a high-precision geometric boundary is constructed. For the discrete parking point set generated by clustering in the previous step, the AlphaShapes algorithm (rolling sphere method) is used to construct a non-convex polygonal contour (concave hull). The algorithm sets a virtual rolling sphere radius parameter. (Alpha value) is used to make the ball roll outside the point set. When the rolling ball simultaneously contacts two or three data points and does not contain any other points inside, these contact points constitute part of the boundary. By adjusting the size of α, we can control the "compactness" of the boundary, thereby capturing the shape features of the point cloud at different scales. Its core computational process includes four stages: Delaunay triangulation, feature radius calculation, empty circle condition screening, and boundary extraction. The choice of the α parameter determines the fineness of the boundary, and in practical applications, it needs to be optimized in combination with the physical scale of the parking lot and the point cloud density. This algorithm, together with the subsequent Douglas-Puk thinning and business rule fusion, constitutes a complete data set from the original trajectory to the structured risk area. In specific implementation, the algorithm sets a virtual rolling ball radius parameter. (Alpha value) The algorithm scrolls along the edge of the point set. When there are no other data points between two points within the radius of the scrolling ball, the line connecting these two points is considered a boundary segment. For example, for an "L"-shaped underground parking lot point set, by finely adjusting the alpha value, the algorithm can avoid directly connecting the two endpoints of the "L". Instead, it generates a closed polygon tightly enclosing the region along the actual point cloud distribution and outputs the ordered vertex coordinate sequence constituting the polygon in a clockwise or counterclockwise direction. This allows for the accurate reconstruction of the site's physical shape.

[0046] Secondly, risk classification is performed by integrating multi-dimensional business rules. Using spatial topology calculation algorithms, the generated geometric polygons are spatially matched with semantic tags and a risk geographic information database. The system calculates the overlap area (intersection) between the polygons and known areas and executes strict attribute mapping logic: if the area is marked as "family" or "company" in the time series analysis in step three, its attribute is set to "low risk / whitelist" in the model, serving as a safe parking area for vehicles to reduce false alarms; if the geographical scope of the area has any spatial overlap with "second-hand garages," "illegal car dismantling workshops," or "high-risk used car markets" in the risk control database, the system follows the "risk priority" principle and forcibly sets its attribute to "high risk / blacklist." Furthermore, unknown areas that do not match are marked as "neutral / gray list," and dynamically updated as more data accumulates.

[0047] Finally, standardized structured model data is generated. The determined boundary coordinate sequence, risk level labels, and metadata are encapsulated into a generic data object for easy cross-module transmission and storage. For example, a JSON-formatted data package is generated containing a unique region identifier (e.g., UUID: "Zone_1001_HZ"), an array of boundary vertices (e.g., `points: [{lat: 30.123, lon:120.156}, ...]`), geometric center point coordinates (for fast indexing), risk level (e.g., `risk_level: "HIGH_BLOCK"`), and an effective timestamp. To illustrate with a specific scenario, if the algorithm identifies a remote auto repair shop as a high-risk "second-level" blacklist, the system will generate the following standardized JSON object: `{ "id": "Risk_Garage_X", "geo": [[113.55, 22.12], [113.56, 22.12], [113.56, 22.13],[113.55, 22.13]], "level": "CRITICAL", "tags": ["Blacklist", "Dismantling"],"source": "LSTM_Model"}`. This data packet will serve as the foundational input for subsequently building multi-level vector fences, ensuring that static geographic information can be efficiently read and parsed by the dynamic risk control engine.

[0048] Step S2: Based on the generated initial risk area model, and combined with vector map data of administrative divisions (provinces, cities, counties) and specific roads (such as inter-provincial expressways), a three-dimensional hierarchical fence structure containing administrative, road, and custom risk levels is constructed. The boundary smoothness is optimized using a polygon fitting algorithm to obtain a multi-level static fence set that fits complex geographical features. According to... Figure 3 As shown in the schematic diagram of the construction process of the multi-level vectorized fence model, step S2 is implemented through the following steps:

[0049] Step S201: Load multi-scale vector map data from the basic geographic information database. This includes administrative division polygon layers (Polygon) accurate to the county level and road network vector data (Polyline) containing the center lines of national and provincial highways. Subsequently, perform standardization processing using a spatial reference system to align the above static map data with the "initial risk area model" generated in the previous step, eliminating geographic deviations caused by different projection methods or reference surfaces, thereby constructing a unified geospatial base.

[0050] First, the system deeply analyzes GIS data sources and extracts geometric and attribute features: It reads vector files in Shapefile or GeoJSON format, extracts not only the geometric surface features of administrative boundaries and the line features of major roads, but also simultaneously parses the associated attribute tables to obtain metadata such as administrative division codes (Adcode), road grades (such as expressways and national highways) and speed limits, providing semantic support for subsequent hierarchical management.

[0051] Secondly, an automatic coordinate system identification and transformation mechanism based on EPSG codes is established. The system scans the projection description files (e.g., .prj) of the data source and identifies their original spatial reference identifiers (e.g., EPSG:3857 or a custom GCJ-02 definition). A transformation pipeline is constructed using the Geographic Data Abstraction Library (GDAL) or the Proj4 library to uniformly map all heterogeneous coordinates to the standard WGS-84 geodetic coordinate system (EPSG:4326). For domestically specific nonlinear densified coordinate systems (e.g., GCJ-02 or BD-09), a high-precision reverse correction algorithm or a grid correction method based on control points is used for restoration. For different reference surfaces (e.g., CGCS2000 to WGS-84 conversion), the Bursa-Wolf seven-parameter model is applied for rigorous spatial transformation. For example, if the imported "inter-provincial expressway" road network data is based on the GCJ-02 coordinate system and its key node coordinates are (E 114.505, N38.005), while the previously generated risk area model is based on the WGS-84 coordinate system, the system will automatically call the reverse correction algorithm to correct the road network node to the corresponding WGS-84 coordinates (E 114.500, N 38.003).

[0052] Finally, the transformed geometry is cleaned. After coordinate unification, the system automatically runs a topology check algorithm to repair geometric distortions that may be caused by projection transformation, such as removing self-intersections of polygons, stitching together tiny dangling nodes, and closing unclosed loops. This ensures that administrative divisions, road networks, and risk areas can be accurately superimposed on the same spatial reference, providing an unbiased and topologically correct geometric foundation for the subsequent construction of hierarchical fences.

[0053] Taking the data from the Zhejiang section of the G25 Changchun-Shenzhen Expressway (a cross-provincial expressway) as an example, the entire processing flow unfolds step by step, starting with the parsing of the raw data. The original format of this data is Shapefile, a traditional GIS format composed of multiple files, containing geometric information, attribute tables, spatial indexes, and projection descriptions. By parsing its projection description file, the system identifies that the data uses the GCJ-02 coordinate system, a unique non-linear encrypted coordinate system in China. It does not have a standard EPSG code, but the identifier "CGCS2000_GK_Zone_21" appears mixed in the attribute description. The road classification of the data is marked as a national expressway, with a speed limit of 120 kilometers per hour, and the geometric type is Polyline, containing a road centerline composed of 1250 vertices.

[0054] In the deep analysis phase, the system first extracted key attribute information, including metadata such as the road name G25 Changshen Expressway, the grade code G, and the speed limit of 120 km / h. This will provide semantic support for subsequent hierarchical management strategies. Simultaneously, the geometric vertex sequence was extracted, starting at longitude 120.153°E and latitude 30.287°N, with subsequent vertices arranged sequentially along the road's extension direction. Upon entering the coordinate system identification phase, the system scanned the .prj projection file and detected a mixed description containing both "Beijing_1954" and "GCJ-02". Considering the data's origin from domestic transportation departments, it was determined that this belonged to the GCJ-02 Mars coordinate system encrypted data, requiring special reverse correction processing.

[0055] Coordinate transformation is the core step. The system calls an iterative approximation algorithm from GCJ-02 to WGS-84 to reconstruct the coordinates of each of the 1250 vertices. Taking the starting point as an example, the input encrypted coordinates are 120.153 degrees east longitude and 30.287 degrees north latitude. After five iterations of optimization, the output WGS-84 coordinates are 120.148 degrees east longitude and 30.283 degrees north latitude, which is approximately 5 meters off from the actual location. This accuracy fully meets the requirements of vehicle risk control scenarios. The entire transformation process is performed on the entire road to ensure that the alignment features of the highway remain smooth and continuous after the coordinate transformation.

[0056] The transformed data enters the topology cleaning stage. The system automatically detected three suspended nodes, mainly concentrated at the connection between the toll plaza ramp and the mainline. Due to accuracy issues during the original data acquisition, some endpoints were not precisely connected. The system applied a 0.5-meter capture tolerance to forcibly merge endpoints within the distance threshold, eliminating disconnections. Subsequently, the processed road centerline was expanded into a buffer polygon with a certain width. This buffer will serve as the geometric basis for subsequent road-level fencing.

[0057] The final output contains information across multiple dimensions. The coordinate system is the WGS-84 international standard, and the geometry has been converted from original line features to polygon features, preserving key attributes such as road grade, speed limit, and road code. Quality labeling information has also been added, with a conversion accuracy of 4.2 meters and valid topology. This processed data layer, together with the administrative division layer and risk area layer, forms a unified geospatial foundation, providing precise alignment data support for the subsequent construction of a three-dimensional hierarchical fence structure.

[0058] Step S202: Establish a logical topology tree containing "administrative level - road level - custom risk level" and set strict hierarchical priorities and conflict arbitration mechanisms.

[0059] First, a vertically hierarchical logical topology based on spatial semantics is constructed. Breaking away from the single-dimensional limitations of traditional planar fences, fence objects are organized into a tree-like data structure with parent-child inheritance and overlay relationships. The bottom layer is set as the "Administrative Layer," seamlessly covering the entire area using high-precision administrative division polygons, primarily used for macro-level monitoring of vehicle movement across provinces and cities and regional access management. The middle layer is the "Road Network Layer," generating fixed-width strip buffers along the centerlines of highways, national roads, or main roads, forming linear channel constraints focused on monitoring specific route travel and deviation behaviors. The top layer is overlaid with the "Custom Risk Layer," which directly maps to the discrete high-risk "secondary" points, blacklisted garages, or permanent residence polygons generated in the first stage, possessing the highest spatial semantic priority. Organizing these three layers into a tree structure means that each layer is a refined supplement to the layer above. The root node represents the entire domain. The first level of child nodes represents provincial-level administrative regions, the second level represents city-level regions, and the third level represents county-level regions. County-level nodes can contain road segment nodes, and road nodes can contain risk point nodes. This design supports efficient inheritance and overriding: parent node attributes are inherited by child nodes by default, but child nodes can explicitly define strategies to override parent node attributes. The spatial index uses a variant of the R-tree, where each node stores not only its own bounding box but also hierarchical weight labels. When performing a point query, the index tree quickly descends from the root node to the leaf nodes, collecting all paths containing that point, and finally determining the effective strategy through weight comparison.

[0060] Secondly, a strict hierarchical weighting system and conflict arbitration mechanism are established. To resolve risk control strategy conflicts caused by overlapping multiple fences, the system assigns differentiated weight values ​​to each level. The risk level is set with a weight of 100 (highest priority, representing core risk control concerns), the road level with a weight of 50 (medium priority, representing dynamic driving constraints), and the administrative level with a weight of 10 (low priority, representing static geographical attributes). When a vehicle's GPS coordinates, retrieved via spatial index, fall within the overlapping area of ​​multiple fences, the arbitration engine executes the "Max-Weight-Wins" algorithm, automatically filtering out interference from low-weight fences and locking in the currently effective, single dominant fence attribute. A specific implementation example is as follows: The system constructs a composite fence model containing "Hangzhou City (administrative level, weight 10)," "G25 Changshen Expressway (road level, weight 50)," and "a hidden auto repair shop (risk level, weight 100)." Scenario 1: When a vehicle is traveling on the G25 expressway, although its coordinates are physically located within Hangzhou City, the system detects a weight of 50 > 10. Therefore, it prioritizes matching the road-level fence and executes the "route deviation monitoring" and "illegal parking" strategies, while blocking the broad rules of administrative regions. Scenario 2: If a vehicle leaves the expressway ramp and enters a disguised "hidden auto repair shop" area on the roadside, this location is spatially within the coverage area of ​​administrative, road-level buffer zones, and risk-level fences (i.e., the intersection of sets). The arbitration engine, based on the priority judgment rule (100 > 50 > 10), forcibly locks it as a "risk-level" attribute, immediately triggering the highest level "blacklist area stay alarm" and "power outage warning," thereby achieving accurate characterization and differentiated handling of vehicle status in complex nested scenarios.

[0061] Step 203: To address the issue of excessively dense original polygon vertices in administrative boundaries and road buffer zones, a combination of geometric thinning (Douglas-Peucker Algorithm) and B-spline curves is used to reduce redundant data points and optimize smoothness while preserving geometric features.

[0062] First, geometric thinning is performed. The algorithm starts from the line connecting the beginning and end of the curve and calculates the perpendicular distance from all intermediate points to this baseline. If the maximum distance is less than a set tolerance threshold, it means the entire curve is basically straight, all intermediate points are redundant, and only the beginning and end points are retained. If the maximum distance exceeds the threshold, the point with the largest distance is found as the split point, dividing the curve into two segments. The same judgment is recursively performed on each segment. This process continues until all segments meet the straightness condition. Next, a distance tolerance threshold (e.g., 5 meters) is set. A baseline is constructed by connecting the beginning and end nodes of the polygon boundary, and the perpendicular Euclidean distance from all intermediate nodes to the baseline is calculated. If the maximum distance is less than the threshold, the intermediate node is determined to be a redundant detail and is removed; if it is greater than the threshold, the key point is retained, and the boundary is segmented. The above process is recursively performed until the geometric error between all retained points is within the tolerance range.

[0063] Secondly, a smooth boundary fitting is performed. B-splines do not force the curve to pass through all control points, but rather allow the curve to be "controlled" by these points. Cubic B-splines use cubic polynomials as basis functions, and each curve segment is determined by four adjacent control points. This locality means that moving a control point only affects a few nearby curve segments, without affecting the entire curve, facilitating local adjustments. The thinned discrete keypoint sequence is used as control points, and a smooth, continuous curve is generated using a cubic B-spline function, eliminating the "sawtooth effect" caused by linear connections and ensuring a natural transition of the fence boundary at corners. A specific example is as follows: The system processes road-level fence data for a 20-kilometer-long "mountain road". The original data contains 5000 high-density GPS sampling points, with a file size of approximately 150KB. After processing using the Douglas-Puk algorithm (with a threshold of 3 meters), 200 key feature points, including sharp bend vertices, were retained, while 4800 redundant points on straight sections were removed. Subsequent B-spline smoothing generated a smooth curve that closely matches the actual curvature of the road. The final fence data packet size was reduced to 8KB (compression rate of approximately 95%), significantly reducing the storage and computational load on the vehicle terminal while ensuring the geometric accuracy of fence coverage in complex terrain. The final output is a standardized multi-level static fence set.

[0064] Step S3: Receive a multi-level static fence set and real-time vehicle driving status data (including speed, direction, and time period). Utilize a dynamic parameter adjustment model to calculate and correct the fence's trigger threshold, effective radius, and warning sensitivity in real time, thereby outputting a dynamic electronic fence configuration adapted to the current vehicle behavior characteristics. For example... Figure 4 The diagram illustrates the dynamic adaptive adjustment process of the fence parameters. Step S4 is implemented through the following steps:

[0065] Step S301: Establish a high-concurrency data receiving channel and scene perception logic to perform real-time access to multi-dimensional data and scene analysis.

[0066] First, a distributed message queue (such as Kafka) is used to subscribe in real time to MQTT protocol messages uploaded by the vehicle terminal. A streaming computing engine is then used to parse the data payload and extract key fields such as the vehicle's instantaneous speed, heading angle, UTC timestamp, and engine speed. Simultaneously, an efficient geographic retrieval mechanism is constructed using the R-tree spatial indexing algorithm: massive amounts of multi-level static fence geometry and their minimum bounding rectangles (MBRs) are preloaded into an in-memory index structure. A tiny rectangular query box is constructed centered on the vehicle's current GPS coordinates, achieving a logarithmic time complexity of [missing information]. The system quickly retrieves all candidate fence objects intersecting with the window, loading administrative, road, and risk-level static fence data covering that location within milliseconds. This effectively avoids brute-force scanning of the entire fence database, significantly reducing computational latency. Secondly, based on a pre-defined decision tree rule engine, it performs logical reasoning on multimodal data: using the retrieved static fence attributes (such as road speed limits and risk level labels) as context nodes and real-time vehicle dynamic data (such as instantaneous speed V, engine speed RPM, and current time T) as conditional branching nodes. The system traverses the decision tree path, performing a series of rigorous Boolean logic operations to accurately map complex vehicle states to specific risk control scenarios (such as "high-speed cruising mode," "nighttime stationary defense mode," or "low-speed loitering mode in risk areas"), providing a definite semantic basis for subsequent differentiated configuration of dynamic parameters. Specific implementation examples are as follows: Scenario 1: When the system detects that the instantaneous speed of a vehicle continuously exceeds 90km / h and the coordinates are located within the road-level fence buffer zone of "G4 Beijing-Hong Kong-Macau Expressway", the rule engine automatically defines the current state as the "high-speed cruising" scenario, providing a basis for subsequently expanding the electronic fence radius; Scenario 2: When the system detects that the vehicle speed is 0, the engine is off (RPM=0), the timestamp is 03:15 AM, and the location coordinates fall within the low-risk permanent residence fence marked "family", the system defines it as the "nighttime stationary defense" scenario and automatically switches to the high-sensitivity displacement monitoring mode.

[0067] Step S302: Adjust the model using dynamic parameters and optimize the key attributes of the fence in real time based on the identified scene features.

[0068] First, the radius of the warning buffer zone of the fence is dynamically adjusted based on the velocity vector. The system introduces a linear expansion algorithm to establish a positive correlation function between the buffer width and the instantaneous speed of the vehicle. The calculation logic is set as follows: ,in The static reference radius (e.g., 15 meters) is based on GPS positioning accuracy. The vehicle's current speed. This represents the average latency time for data transmission and processing (e.g., 2 seconds). For safety redundancy, when a vehicle is traveling at high speed, the algorithm automatically expands the virtual trigger boundary of the fence to compensate for spatial errors caused by communication delays or positioning lags, preventing the vehicle from leaving the controlled area before the alarm command is issued. When the vehicle is stationary, the boundary is contracted to its physical limit to improve the perception of minute displacements. Specific implementation examples are as follows: The static baseline radius is set to 15 meters. Scenario 1: When a vehicle is traveling at 108 km / h (30 m / s) on a highway, the system calculates a potential displacement of 60 meters due to a 2-second delay. Combined with the redundancy factor, the system automatically expands the fence's warning buffer radius temporarily to 80 meters. At this time, if the vehicle approaches the fence's physical boundary within 80 meters, an "imminent boundary crossing" warning is triggered in advance. Scenario 2: When a vehicle is stationary in a parking lot (speed 0), the dynamic increment is reset to zero, and the fence radius automatically resets to 15 meters. If the vehicle is illegally towed, an "abnormal movement" alarm is triggered immediately if the displacement exceeds 15 meters. Secondly, the system dynamically adjusts the alarm trigger sensitivity threshold based on time windows and behavioral patterns: the system achieves graded sensitivity control by adjusting the "judgment time window" and "point count". During high-risk periods or abnormal behavior patterns determined by the system, a "zero-tolerance" strategy is adopted to shorten the judgment time; during normal periods, a "false alarm prevention" strategy is adopted to increase the smoothing filtering time. A specific example is as follows: Scenario 1: The system identifies the current time as 02:00-05:00 AM as a "high-risk nighttime period," and the vehicle is in a protected state. In this case, the system adjusts the alarm trigger threshold to "high sensitivity mode," meaning that if two location points outside the fence are received consecutively within 3 seconds, a violation alarm is immediately reported, ensuring a millisecond-level response to theft. Scenario 2: During the morning rush hour from 08:00 to 09:00, considering that the urban canyon effect may cause GPS multipath drift, the system automatically switches to "anti-interference mode" and adjusts the threshold to require more than 10 boundary crossings to be detected continuously within 30 seconds to confirm a real violation, thereby effectively filtering false alarms caused by signal jitter.

[0069] Step S303: Package the corrected trigger threshold, effective radius and sensitivity parameters into a dynamic geofence configuration package and update it to the monitoring engine in real time to complete the conversion from static geofence to dynamic risk control strategy.

[0070] First, parameter serialization and encapsulation are performed. The dynamic radius value, alarm judgment time window length, and consecutive anomaly threshold calculated in the second step are collected and associated with the corresponding fence unique identifier (ID), serialized into a lightweight standard data transmission format (such as JSON or Protocol Buffers). Simultaneously, a high-precision timestamp version number is added to this configuration package to ensure that the monitoring engine strictly adheres to the timing logic when processing concurrent data, preventing old policies from overriding new ones.

[0071] Secondly, the execution strategy is delivered and updated in real time. Utilizing a low-latency message middleware or the publish / subscribe mechanism of an in-memory database (such as Redis), the generated dynamic configuration package is instantly pushed to the core risk control monitoring engine. The monitoring engine adopts a stateless design; upon receiving a new configuration instruction, it can complete the hot replacement of risk control rules in memory within milliseconds without restarting the service, ensuring that when the next frame of vehicle location data arrives, the system can immediately make compliance judgments based on the latest dynamic standards. A specific example is as follows: A vehicle decelerates from "highway cruising" and enters a "service area" to rest. The system calculates new policy parameters based on the current state and generates a configuration package in the following JSON format: { "target_vin": "Vehicle_X", "fence_id": "ServiceArea_Zone_B", "dynamic_radius": 20, "sensitivity": { "time_window": 5, "min_points": 3}, "timestamp":1678890123000}. This configuration package is immediately written to the Redis cache. When the vehicle uploads a new GPS location the next second, the monitoring engine reads the latest configuration and instantly switches from the previously lenient "high-speed mode" (80-meter radius, 30-second fault tolerance) to the strict "stationary mode" (20-meter radius, 5-second fault tolerance), thus achieving a seamless transition of risk control strategies with vehicle behavior.

[0072] Step S4: The system uses dynamic electronic fence configuration to monitor the real-time vehicle location stream. State machine logic is used to process vehicle switching events between different fence levels (e.g., crossing provincial boundaries), filtering redundant and repetitive alarms and identifying abnormal boundary crossing intentions. Ultimately, it generates accurate violation warnings and trajectory tracking reports with coherent contextual information. Figure 5 As shown in the diagram illustrating cross-domain coherent tracking and precise early warning execution, step S4 is implemented through the following steps:

[0073] Step S401: Establish a real-time data processing pipeline, connecting the dynamically adjusted electronic fence configuration and the real-time vehicle positioning data stream. Construct a finite state machine (FSM) model, defining three core logical states of the vehicle relative to the fence: "Safe Residence (State_Safe)," "Edge Warning (State_Warning)," and "Illegal Exit (State_Alert)." Use the ray casting algorithm to calculate the point-to-surface relationship between the vehicle coordinates and the geometric boundaries of the multi-level fence in real time, driving the state machine to perform real-time state transitions.

[0074] First, a geometric relationship calculation is performed, mapping the vehicle's current latitude and longitude coordinates onto a two-dimensional plane. A virtual ray is emitted from this point in the positive X-axis direction, and the total number of intersections between this ray and all boundary segments of the fence polygon is counted. Based on the "odd inside, even outside" principle in topology, if the total number of intersections is odd, the vehicle is determined to be inside the fence; if it is even, it is determined to be outside. Simultaneously, using the formula for the shortest distance from a point to a line segment, the vertical Euclidean distance from the vehicle's current position to the nearest fence boundary is calculated for more precise determination of critical states.

[0075] Secondly, the driving state machine flows, updating the FSM state in real time based on the geometric calculation results. If the point is determined to be inside the fence and the distance to the boundary is greater than the dynamic warning radius, the state machine maintains "safe dwell"; if the point is inside the fence but the distance is less than the dynamic warning radius, the state transitions to "edge warning"; if the point is determined to be outside the fence, it is immediately forced to switch to "illegal boundary crossing". A specific implementation is as follows: The system monitors a vehicle located within the "Hangzhou City Administrative Fence", and the current dynamic warning radius is set to 50 meters. Scenario 1: The vehicle is located in the city center (E 120.15, N 30.28), the number of intersection points calculated by the ray method is 1 (odd number), and the distance to the nearest boundary is 5 kilometers, so the state machine is locked in "safe dwell". Scenario 2: The vehicle drives towards the city boundary. When the coordinates reach 30 meters inside the boundary, although it is still inside the fence, the distance is less than the 50-meter threshold, the state machine automatically flows to the "edge warning" state, and the system immediately starts high-frequency position reporting. Scenario 3: The vehicle continues to drive and crosses the boundary line. The number of intersection points calculated by the ray method becomes 2 (an even number). The state machine instantly switches to the "illegal boundary crossing" state and activates the alarm logic.

[0076] Step S402: For vehicle movement between administrative, road, and custom risk level fences, a hierarchical switching logic is designed. When a vehicle triggers multiple fence conditions simultaneously, the strategy for the higher-risk fence is executed first. Simultaneously, a hysteresis mechanism is introduced to handle boundary critical points, setting the entry threshold slightly higher than the exit threshold to effectively eliminate frequent state jumps (i.e., the "ping-pong effect") caused by minor GPS fluctuations when the vehicle is driving at the fence edge.

[0077] First, priority-based hierarchical arbitration is performed. A fence priority mapping table is maintained in memory (e.g., Risk Level Priority=100>Road Level Priority=50>Administrative Level Priority=10). When the spatial indexing algorithm finds that a vehicle's current coordinates fall within the polygon range of multiple fences simultaneously, the system iterates through the priority attributes of all matched fences, forcibly locking the highest priority fence as the current master fence, and executing the corresponding risk control strategy (such as speed limit threshold or alarm rules) for that fence, ignoring the configuration of lower priority fences, thereby resolving strategy conflicts. Second, a hysteresis mechanism is applied to eliminate boundary jitter. The Schmidt trigger principle is introduced, setting asymmetric state switching thresholds on both the inner and outer sides of the fence's geometric boundary. Specifically, the "entry determination threshold" is set to cross the boundary line inwards. Meters, set the "leaving judgment threshold" to be beyond the boundary line. Meters. The state machine will only update its state when the vehicle's displacement completely exceeds the aforementioned threshold range; otherwise, it will retain the previous state, thus filtering out false state transitions caused by GPS positioning errors (typically 5-15 meters). A specific implementation example is as follows: The system monitors vehicle activity at the edge of a "high-risk used car market" (risk level). A hysteresis threshold parameter is set. Scenario 1: A vehicle enters the area. Although the GPS coordinates have crossed the physical boundary line (0 meters from the boundary), the system does not trigger an "entry alarm" until the vehicle continues deeper and is more than 20 meters inside the boundary line. Only then does the state machine officially switch to "In-Fence". Scenario 2: The vehicle then stops near the boundary line. Due to signal drift, the positioning point repeatedly jumps between inside and outside the boundary line (with an amplitude of about 10 meters). Since the vehicle has not moved more than 20 meters outside the boundary line (i.e., has not reached the departure threshold), the system determines that the vehicle is still in the "In-Fence" state, effectively suppressing the "entry-departure-entry" ping-pong effect alarm and ensuring the stability of risk control judgment.

[0078] Step S403: After the state machine outputs the initial alarm signal, a time-sliding window algorithm is applied for secondary filtering. If the same type of alarm is generated continuously within a short window period (e.g., 60 seconds), the system automatically aggregates them into a single event and removes redundant noise. In addition, the vehicle's current heading angle and velocity vector are combined to analyze its movement trend; if the vehicle touches the boundary but its heading points inward, it is determined to be a false trigger; if the heading clearly points outward and continues to accelerate, it is identified as a genuine abnormal boundary crossing intention.

[0079] First, alarm aggregation and deduplication are performed using a time-sliding window algorithm. An alarm event queue is maintained in memory for each vehicle object. When a new alarm signal is triggered by the state machine, the system checks the time difference between the signal's timestamp and the most recent alarm of the same type in the queue. If the time difference is less than a preset aggregation window threshold (e.g., 60 seconds), the signal is considered a redundant event, and the alarm count and last occurrence time are only updated in the background without pushing a new message to the risk control center. If the time difference is greater than the threshold, it is considered a new independent event, a new alarm record is generated, and the window is reset. Second, vehicle intent is analyzed based on heading angle and velocity vector. The vehicle's current instantaneous velocity vector and heading angle are obtained, and the geometric angle between them and the tangent or normal of the fence boundary is calculated. If a vehicle's coordinates touch the fence boundary, but its heading angle points inward (i.e., the angle with the outward boundary normal is greater than 90 degrees), and its velocity vector shows a deceleration trend, the system determines it as a "false edge touch" or "normal U-turn" and automatically suppresses the alarm. Conversely, if the heading angle clearly points outward (angle less than 90 degrees) and is accompanied by continuous acceleration, it is identified as a genuine "forced breach" or "abnormal boundary crossing" intent, and the alarm level is immediately escalated. A specific example is as follows: The system monitors a vehicle located at the edge of a "rental garage" fence. Scenario 1: Due to GPS signal drift, the vehicle triggers five "boundary crossing alarms" within 30 seconds. The system uses a 60-second sliding window mechanism to aggregate these five signals into one "frequent boundary crossing alert," avoiding bombarding risk control personnel with text messages. Scenario 2: The vehicle is traveling at 15 km / h at the fence boundary, and its heading angle shows it is making a "U-turn" to return to the garage. Although the GPS point briefly crosses the boundary line, the intent analysis algorithm determines that it has no escape tendency and automatically filters out this alarm. Scenario 3: A vehicle suddenly accelerates to 80 km / h, its heading angle perpendicular to the fence boundary, pointing towards the nearest highway exit. The system determines that it has a clear intention to escape, immediately triggering the highest-level "boundary escape" alarm and locking onto the vehicle for tracking. The fourth step is the generation of a coherent context and the execution of the warning: Once the violation intent is confirmed, the system immediately generates a structured warning message. This message not only includes snapshot data at the time of the alarm but also automatically links trajectory segments from a period prior to the alarm (e.g., the previous 5 minutes) and the dynamic fence parameters at the time of triggering, forming a chain of evidence with a coherent context. Finally, the warning information is packaged with subsequent high-frequency tracking trajectories and pushed to the risk control center in real time, completing the closed-loop processing.

[0080] Step S404: Once the intent to violate the rules is confirmed, the system immediately initiates the evidence chain construction process, generates a structured early warning message containing spatiotemporal context, and completes closed-loop processing through a multi-channel distribution mechanism.

[0081] First, historical trajectory backtracking and evidence encapsulation are performed. When the state machine outputs a confirmed violation signal, the trigger automatically calls the query interface of a time-series database (such as InfluxDB) to retrieve all historical trajectory point data within a preset time window (such as 5 minutes) before the alarm trigger time. Simultaneously, a snapshot of the currently effective dynamic fence parameters (including dynamic radius, sensitivity threshold, and judgment rule ID) is captured and merged with real-time vehicle status data (location, speed, heading), encapsulating it into an immutable evidence package to ensure complete traceability of the alarm event. Second, multi-channel precise push and handling are executed. The generated structured message is routed to the core business system of the risk control center via a message queue (such as RabbitMQ), triggering an advanced pop-up alarm on the web interface. Simultaneously, the communication gateway interface is called to notify offline asset preservation personnel via SMS or App push. Furthermore, the system simultaneously activates a "high-frequency tracking mode," automatically increasing the location reporting frequency of the vehicle terminal from the usual 30 seconds / time to 5 seconds / time through a command, updating the vehicle's escape route in real time. The specific implementation is as follows: The system monitors a "rent-to-own" vehicle attempting to leave the "Guangdong Provincial Administrative Fence". Scenario 1: After lingering at the boundary, the vehicle suddenly accelerates and crosses the boundary. The system immediately generates an alarm message with the ID "Alert_20231001_001", which includes: the alarm time (14:30:05), the vehicle's current coordinates (E 113.5, N 22.8), a sequence of 50 trajectory points within the past 300 seconds (clearly showing its path from the city center to the highway exit), and the dynamic parameters at the time of triggering (the fence radius expands to 100 meters). Scenario 2: Within 100 milliseconds, a red warning box pops up on the risk control center's large screen, and the trajectory is automatically replayed on the map; simultaneously, the vehicle tracking specialist responsible for the area receives a text message containing a link to the vehicle's real-time location. The system then locks onto the vehicle, refreshing its location every 5 seconds to assist the specialist in intercepting it.

[0082] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.

[0083] A computer device according to embodiments of the present disclosure includes a memory and a processor. The memory is used to store non-transitory computer-readable instructions. Specifically, the memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc.

[0084] The processor may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the computer device to perform desired functions. In one embodiment of this disclosure, the processor is used to execute computer-readable instructions stored in the memory, causing the computer device to perform all or part of the steps of the learning outcome prediction method based on learning behavior data mining of the foregoing embodiments of this disclosure.

[0085] like Figure 6 This is a schematic diagram of a computer device provided for an embodiment of the present disclosure. It illustrates a structural schematic diagram suitable for implementing the computer device in the embodiments of the present disclosure. Figure 6 The computer device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0086] like Figure 6 As shown, a computer device may include a processor (such as a central processing unit, graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) or programs loaded from storage devices into random access memory (RAM). The RAM also stores various programs and data required for the operation of the computer device. The processor, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0087] Typically, the following devices can be connected to the I / O interface: input devices, such as sensors or visual information acquisition devices; output devices, such as displays; storage devices, such as magnetic tapes or hard drives; and communication devices. Communication devices allow the computer device to communicate wirelessly or wiredly with other devices (such as edge computing devices) to exchange data. Although a computer device with various devices is illustrated, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0088] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processor, all or part of the steps of the learning outcome prediction method based on learning behavior data mining according to embodiments of this disclosure are performed.

[0089] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.

Claims

1. A method for generating dynamic electronic fences for automobiles, characterized in that, Includes the following steps: Collect historical vehicle driving trajectory data, historical alarm records, and risk geographic information. After preprocessing and cleaning, combine density clustering algorithm and deep learning model to mine high-risk areas and vehicle parking points and extract features to generate an initial risk area model containing accurate boundary coordinates and risk levels. Based on the initial risk area model, vector map data of administrative divisions and specific roads are integrated to construct a three-dimensional hierarchical fence structure. After boundary fitting and smoothing optimization, a multi-level static fence set is obtained. Receive the multi-level static fence set and real-time vehicle driving status data, use the dynamic parameter adjustment model to calculate and correct the trigger threshold, effective radius and warning sensitivity of the multi-level static fence in real time, and output a dynamic electronic fence configuration adapted to the current vehicle behavior characteristics. The dynamic electronic fence configuration is used to monitor the real-time location stream of vehicles and generate accurate violation warnings and trajectory tracking reports with coherent contextual information. The process of preprocessing and cleaning, followed by combining density clustering algorithms and deep learning models to mine high-risk areas and frequently stopped vehicle locations and extract features, specifically includes: The first GPS trajectory data is obtained by removing abnormal drift points and speed anomalies from the vehicle's original GPS trajectory based on kinematic logic. The first GPS trajectory data is then smoothed using the Kalman filter algorithm, and the data deduplication operation is performed to obtain the second GPS trajectory data. The DBSCAN density clustering algorithm is used to analyze the parking point data of the second GPS trajectory data to identify the vehicle's permanent location and obtain a discrete parking point set. Long Short-Term Memory (LSTM) network is applied to perform spatiotemporal sequence analysis on historical alarm data to extract features of potential high-risk violation areas; The construction of the three-dimensional hierarchical fence structure specifically includes: Construct a hierarchical fence with a vertically layered logical topology of administrative level, road level, and custom risk level, and build the hierarchical fence into a tree-like data structure with parent-child inheritance and overlay relationship; Bind bounding boxes and hierarchical weight labels to each node of the tree-like data structure and implement spatial indexing using an R-tree variant; Different weight values ​​are assigned to fences of different levels, and a hierarchy priority and conflict arbitration mechanism is established based on the maximum weight winner algorithm.

2. The method according to claim 1, characterized in that, Kalman gain of the Kalman filter algorithm The calculation formula is ;in, To map a four-dimensional state vector to an observation matrix in a two-dimensional observation space, The observation noise covariance matrix represents the level of measurement error caused by signal blockage or multipath effects of the GPS sensor. The covariance represents the uncertainty of the prediction result.

3. The method according to claim 2, characterized in that, The generation of the initial risk region model, which includes precise boundary coordinates and risk levels, specifically includes: For the discrete parking point set, generate a minimum convex hull or concave hull contour, determine the precise boundary coordinate set, and generate a geometric polygon; Using a spatial topology calculation algorithm, the generated geometric polygons are spatially matched with semantic tags and a risk geographic information database; The matched spatial data is encapsulated into a general data object, thereby obtaining the initial risk area model.

4. The method according to claim 3, characterized in that, The multi-level static fence set obtained after boundary fitting and smoothing optimization specifically includes: Set a distance tolerance threshold, and use a geometric thinning algorithm to perform geometric thinning on the boundary curve of the hierarchical fence, recursively retaining discrete key points and removing redundant nodes. The discrete key points obtained by thinning are used as control points. A cubic B-spline function is used to smoothly fit the layered fence boundary to generate a continuous and smooth fence boundary curve, and output a standardized multi-level static fence set.

5. The method according to claim 1, characterized in that, The process of using a dynamic parameter adjustment model to calculate and correct the trigger threshold, effective radius, and early warning sensitivity of the multi-level static fence in real time specifically includes: A linear expansion algorithm is introduced to establish a positive correlation function between the buffer width and the instantaneous speed of the vehicle, and the radius of the fence warning buffer is dynamically adjusted based on the vehicle speed vector; By adjusting the judgment time window and the number of consecutive abnormal points, and combining the vehicle's time window and behavior pattern, the sensitivity threshold for triggering the fence alarm is dynamically adjusted.

6. The method according to claim 5, characterized in that, The dynamic electronic fence configuration that adapts to the current vehicle behavior characteristics specifically includes: By associating the buffer radius, alarm judgment time window, and sensitivity threshold with the corresponding unique identifier of the multi-level static fence, a parameter sequence is obtained; The parameter sequence is converted into a lightweight standard data transmission format and a high-precision timestamp version number is added to obtain a dynamic configuration package; By using a low-latency message middleware or in-memory database to push dynamic configuration packages to the risk control monitoring engine, millisecond-level hot updates of risk control rules are achieved based on the stateless design of the monitoring engine.

7. The method according to claim 1, characterized in that... The application of the dynamic electronic fence configuration to monitor the real-time location stream of vehicles and generate accurate violation warnings and trajectory tracking reports with coherent contextual information further includes: The system utilizes state machine logic to process vehicle switching events between different levels of fences, filters redundant and repetitive alarms, identifies abnormal boundary crossing intentions, and generates accurate violation warnings and trajectory tracking reports with coherent contextual information. Specifically, the use of state machine logic to handle vehicle switching events between different fence levels includes: Maintain a dynamic electronic fence priority mapping table. When the vehicle coordinates fall within the range of multiple dynamic electronic fences at the same time, traverse the priority mapping table and lock the dynamic electronic fence with the highest priority as the master fence, and execute the corresponding risk control strategy. By introducing the Schmitt trigger principle, asymmetric entry and exit state switching thresholds are set on both sides of the fence boundary. The state machine state is updated only when the vehicle displacement exceeds the threshold zone, thus filtering out false state transitions.

8. The method according to claim 7, characterized in that The filtering of redundant and repetitive alarms and identification of abnormal boundary crossing intentions, generating accurate violation warnings and trajectory tracking reports with coherent contextual information, specifically includes: Maintain an alarm event queue for each vehicle object, and use a time sliding window algorithm to compare the time difference between a new alarm and alarms of the same type in the queue to complete alarm aggregation and deduplication. Obtain the vehicle's instantaneous velocity vector and heading angle, calculate the geometric angle between it and the tangent or normal of the fence boundary, analyze the vehicle's intention to cross the boundary in combination with the speed change trend, and determine whether to suppress the alarm or upgrade the alarm level. After confirming the intent to violate the rules, the system associates the pre-alarm trajectory fragments with dynamic fence parameters to generate a structured early warning message with spatiotemporal context, packages the early warning information with the high-frequency tracking trajectory, and pushes it to the risk control center.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method for generating a dynamic electronic fence for automobiles as described in any one of claims 1-8.