Positioning and tracking warning method and system for Bluetooth signals

Through the signal attenuation compensation model and the spatiotemporal graph convolution neural network model, combined with dynamic electronic fences and behavior recognition, the problems of low positioning accuracy of Bluetooth signal and electronic fence fixation are solved, high-precision positioning, trajectory prediction and comprehensive warning are achieved, and the accuracy of behavior recognition and the spatiotemporal correlation analysis capabilities of early warning information are improved.

CN119342418BActive Publication Date: 2025-04-15BEIJING UNISECURITY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411889913.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-15
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

When using Bluetooth signals for positioning and tracking in an indoor environment, the prior art is affected by factors such as multipath effect and signal occlusion, resulting in unstable signal strength and affecting positioning accuracy. At the same time, the boundary of traditional electronic fences cannot be adjusted dynamically, which is prone to false alarms, the accuracy of behavior recognition is not high, and the warning information lacks time-space correlation analysis, so it is impossible to effectively predict the development trend of abnormal behavior.

Method used

The signal of the target Bluetooth device is received through a Bluetooth receiver, and a corrected signal characteristic parameter is generated using the signal attenuation compensation model, and a real-time position is calculated based on the spatial position coordinates. A spatiotemporal graph convolutional neural network model is constructed based on historical trajectory data, predicted trajectory data is generated, and electronic fences are dynamically generated. By comparing the prediction trajectory with the boundaries of the electronic fence, fence warning information is generated, and abnormal behavior is identified in combination with the behavior recognition model to generate comprehensive warning information.

Benefits of technology

It improves the accuracy of Bluetooth signal positioning, realizes trajectory prediction and dynamic optimization of electronic fences, improves the accuracy of behavior recognition, generates more comprehensive and accurate comprehensive warning information, and effectively reduces the interference of environmental factors on the signal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342418B_ABST
    Figure CN119342418B_ABST
Patent Text Reader

Abstract

The present invention provides a positioning, tracking and early warning method and system for Bluetooth signals, which relate to the technical field of positioning and tracking, including receiving the Bluetooth signal of a target Bluetooth device through a Bluetooth receiver, correcting the signal characteristic parameters by using a signal attenuation compensation model, calculating the real-time position of the target device through a positioning algorithm in combination with the position coordinates of the Bluetooth receiver, and storing the real-time position and the corrected signal characteristic parameters in a trajectory database; based on historical trajectory data, the present invention constructs and trains a spatiotemporal graph convolutional neural network model to predict the target trajectory, and dynamically generates an electronic fence in combination with the target activity law parameters; generates fence early warning information by comparing the predicted trajectory with the boundary of the electronic fence, extracts the target behavior characteristic vector, identifies abnormal behavior by using a behavior recognition model, and generates comprehensive early warning information in combination with the fence early warning information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of positioning and tracking technology, and in particular to a positioning and tracking early warning method and system for Bluetooth signals. Background Art

[0002] With the rapid development of Internet of Things technology, indoor positioning and tracking technology based on Bluetooth signals has been widely used in scenarios such as smart hospitals and smart factories. Existing technologies collect signal broadcast packet data of target Bluetooth devices by deploying Bluetooth receivers, calculate the device location using the signal strength attenuation model, and achieve real-time positioning and tracking of target devices. At the same time, by analyzing historical trajectory data, the activity patterns and behavior patterns of target devices can be identified, providing data support for intelligent management and early warning.

[0003] However, the existing technology still has some shortcomings. Factors such as multipath effects and signal shielding in indoor environments lead to unstable signal strength, affecting positioning accuracy. The boundaries of traditional electronic fences are fixed and cannot be dynamically adjusted according to the activity patterns of the target equipment, which can easily lead to false alarms. Existing behavior recognition methods often simply superimpose time features and spatial features, ignoring the differences between the two types of features, resulting in low behavior recognition accuracy. The warning information lacks temporal and spatial correlation analysis and cannot effectively predict the development trend of abnormal behavior.

[0004] In summary, there is an urgent need for a positioning and tracking warning method and system for Bluetooth signals, which can effectively reduce the interference of environmental factors on signal strength, improve positioning accuracy, realize dynamic optimization of trajectory prediction and electronic fences, improve the accuracy of behavior recognition, perform multi-dimensional fusion, and generate more comprehensive and accurate comprehensive warning information. The present invention can solve the problems in the prior art. Summary of the invention

[0005] The embodiments of the present invention provide a method and system for positioning, tracking and warning of Bluetooth signals, which can solve the problems in the prior art.

[0006] According to a first aspect of the embodiments of the present invention,

[0007] Provided is a positioning and tracking warning method for Bluetooth signals, comprising:

[0008] Receive the Bluetooth signal of the target Bluetooth device through a Bluetooth receiver, obtain signal broadcast packet data, generate corrected signal characteristic parameters based on the signal broadcast packet data through a signal attenuation compensation model, calculate the real-time position coordinates of the target Bluetooth device through a positioning algorithm based on the spatial position coordinates of the Bluetooth receiver and the corrected signal characteristic parameters, and form a trajectory data entry with the real-time position coordinates and the corrected signal characteristic parameters, and store them in a trajectory database;

[0009] Based on the historical trajectory data entries in the trajectory database, a spatiotemporal graph convolutional neural network model is constructed and trained, and the predicted trajectory data is generated in combination with the latest trajectory data entries; based on the historical trajectory data entries, the activity law parameters of the target Bluetooth device are calculated, the activity law parameters are analyzed to dynamically generate an electronic fence, the boundary of the electronic fence is determined, and the predicted trajectory data is compared with the boundary of the electronic fence in real time to generate fence warning information;

[0010] Based on the historical trajectory data entries in the trajectory database, the target behavior feature vector is extracted, and based on the target behavior feature vector, classification is performed through a behavior recognition model to determine the behavior recognition result, and based on a preset behavior feature library, the abnormal behavior of the target Bluetooth device is detected, and comprehensive warning information is generated in combination with the fence warning information.

[0011] In an optional embodiment,

[0012] Based on the signal broadcast packet data, generating corrected signal characteristic parameters through a signal attenuation compensation model includes:

[0013] Based on the signal broadcast packet data, extract the signal strength value and the signal quality index, calculate the median of multiple signal strength values, calculate the absolute difference between each signal strength value and the median, calculate the median of the absolute difference to obtain the degree of dispersion, compare the degree of dispersion with the dynamic threshold, eliminate abnormal signal strength values ​​that exceed the dynamic threshold range, and obtain a valid signal strength value;

[0014] Collect actual signal strength values ​​and theoretical signal strength values ​​at a preset reference point, perform a difference operation on the actual signal strength values ​​and the theoretical signal strength values ​​to obtain an intensity deviation sample, perform a normality test on the intensity deviation sample, and use a maximum likelihood estimation method to calculate a deviation mean and a deviation standard deviation of the intensity deviation sample to obtain an intensity deviation characteristic value;

[0015] Calculate the temperature influence factor according to the real-time temperature data, calculate the humidity influence factor according to the real-time humidity data, perform weighted correction on the intensity deviation characteristic value by using the temperature influence factor and the humidity influence factor to generate an environmental factor correction value;

[0016] Measuring the propagation distance between the target Bluetooth device and the Bluetooth receiver, comparing the propagation distance with a preset reference distance, and when the propagation distance is less than or equal to the preset reference distance, calculating a first attenuation coefficient based on linear attenuation, and multiplying the first attenuation coefficient by the propagation distance to obtain a path loss value; when the propagation distance is greater than the preset reference distance, calculating a second attenuation coefficient based on logarithmic attenuation, and multiplying the second attenuation coefficient by a logarithmic value of the propagation distance to obtain the path loss value;

[0017] A sliding time window is constructed at a preset reference point to record the data of changes in signal strength with distance, a relationship equation between signal strength and distance is established, the slope of the relationship equation is calculated by the least squares method to obtain a local path loss index, and an exponential smoothing method is used to update the local path loss index to a global path loss index;

[0018] Calculate a theoretical signal strength reference value according to the global path loss index and the propagation distance, and add the theoretical signal strength reference value to the environmental factor correction value to obtain a preliminary corrected signal strength value;

[0019] The preliminary corrected signal strength value is weightedly corrected by using the signal quality index to obtain a weighted corrected signal strength value, and the weighted corrected signal strength value is smoothed by using a Kalman filter method to generate a corrected signal characteristic parameter.

[0020] In an optional embodiment,

[0021] Based on the spatial position coordinates of the Bluetooth receiver and the corrected signal characteristic parameters, the real-time position coordinates of the target Bluetooth device are calculated through the positioning algorithm, including:

[0022] Acquire the spatial position coordinates of at least three Bluetooth receivers and characteristic parameters of the correction signals received by each of the three Bluetooth receivers; continuously sample the characteristic parameters of the correction signals received by each of the three Bluetooth receivers to obtain signal strength time series data; divide the signal strength time series data into multiple time windows according to preset time intervals;

[0023] In each of the time windows, wavelet transform is performed on the signal strength time series data to obtain frequency characteristics, and periodic fluctuation components in the signal are identified according to the frequency characteristics;

[0024] Extracting corresponding features of the main signal path and the reflected signal path from the periodic fluctuation component to generate a signal path feature matrix; inputting the signal path feature matrix into a preset signal path classifier to determine the signal path with the largest intensity and the smallest fluctuation as the main signal path; calculating the distance value from each Bluetooth receiver to the target Bluetooth device according to the main signal path; and constructing a nonlinear equation group based on the distance value;

[0025] Calculate the residual between the theoretical distance value and the actual distance value under the current position coordinate, calculate the gradient direction according to the residual, update the position coordinate with an adaptive step size along the gradient direction, and obtain the initial position coordinate; calculate the convergence index of the initial position coordinate, when the convergence index is greater than a preset threshold, increase the search range based on a preset search range increment, and recalculate the position coordinate; when the convergence index is less than the preset threshold, record the current position coordinate as a candidate solution;

[0026] The candidate solutions obtained in the multiple time windows are weighted averaged to obtain the real-time position coordinates of the target Bluetooth device.

[0027] In an optional embodiment,

[0028] Based on the historical trajectory data entries in the trajectory database, a spatiotemporal graph convolutional neural network model is constructed and trained, and combined with the latest trajectory data entries, the predicted trajectory data is generated, including:

[0029] Based on the historical trajectory data entries in the trajectory database, according to the preset sampling rules, the trajectory sampling points are determined, the real-time position coordinates and corresponding timestamps of the trajectory sampling points are extracted, the graph structure nodes are determined, and based on the spatiotemporal associations between adjacent graph structure nodes, the graph structure edges are determined to construct the spatiotemporal graph structure;

[0030] Calculate the spatial distance between adjacent graph structure nodes in the spatiotemporal graph structure, substitute the spatial distance into a Gaussian kernel function to obtain a spatial weight, calculate the time interval between adjacent graph structure nodes, substitute the time interval into an exponential decay function to obtain a temporal weight, and use the product of the spatial weight and the temporal weight as an edge weight;

[0031] Sliding window segmentation is performed on the graph structure nodes in the spatiotemporal graph structure, and the instantaneous velocity vector corresponding to the graph structure node is calculated in each sliding window, and the inner product of adjacent instantaneous velocity vectors is divided by the vector modulus to obtain the direction change rate, and the node whose direction change rate is greater than a preset direction change rate threshold is marked as a turning point;

[0032] The trajectory segments between the turning points are regarded as activity segments, the duration and spatial distribution of each activity segment are calculated, and the probability density distribution of the activity segment in the time dimension and the spatial dimension is calculated by the kernel density estimation method;

[0033] Performing a graph convolution operation on the spatiotemporal graph structure, constructing a weighted adjacency matrix based on edge weights and probability density distribution, calculating a normalized Laplace matrix based on the weighted adjacency matrix, recursively calculating Chebyshev polynomials of different orders, and using the product of the linear combination of the Chebyshev polynomials and the normalized Laplace matrix as a graph convolution kernel, spatially aggregating node features, and obtaining graph convolution aggregation features;

[0034] Construct an attention calculation unit, map the node features corresponding to the current moment into a query vector, map the node features of the historical moments into a key vector and a value vector, calculate the similarity between the query vector and the key vector, obtain an attention score, normalize the attention score to obtain an attention weight, and use the weighted sum of the attention weight and the value vector as the temporal attention feature; concatenate the graph convolution aggregation feature with the temporal attention feature, input the pre-trained prediction network, and generate predicted trajectory data.

[0035] In an optional embodiment,

[0036] Based on the historical trajectory data entries, the activity pattern parameters of the target Bluetooth device are calculated, and the activity pattern parameters are analyzed to dynamically generate an electronic fence. Determining the boundaries of the electronic fence includes:

[0037] Obtain historical trajectory data entries of the target Bluetooth device, calculate the time interval and position coordinate difference between adjacent trajectory points in the historical trajectory data entries, identify the stay points and the moving segments, perform density clustering on the stay points to obtain an activity area set, extract movement trajectory features for the moving segments, and construct a connection relationship between the activity area sets;

[0038] Divide a day into 24 time segments according to the hourly granularity, calculate the residence time ratio of the target Bluetooth device in each of the activity area sets in each time segment, construct a spatiotemporal activity intensity distribution matrix, perform feature decomposition on the spatiotemporal activity intensity distribution matrix through singular value decomposition to obtain activity law parameters, and construct a first-order Markov activity transfer matrix between the activity area sets based on the connection relationship;

[0039] Based on the activity law parameters, determine the set of activity areas with activity intensity higher than a preset intensity threshold in the spatiotemporal activity intensity distribution matrix as the core activity area, use a convex hull scanning algorithm to take the minimum convex polygon of the core activity area as the first boundary, calculate the transition probability between the core activity areas based on the first-order Markov activity transition matrix, construct a connection channel between the core activity areas with a transition probability greater than a preset transition probability threshold, and obtain a second boundary, wherein the width of the connection channel is linearly positively correlated with the transition probability, and merge the first boundary with the second boundary to obtain an initial electronic fence boundary;

[0040] The initial electronic fence boundary is simplified by using a curve simplification algorithm to obtain a simplified electronic fence boundary, and the simplified electronic fence boundary is smoothed by using cubic spline interpolation to obtain a final electronic fence boundary.

[0041] In an optional embodiment,

[0042] The convex hull scanning algorithm is used to take the minimum convex polygon of the core activity area as the first boundary including:

[0043] Determine the lowest point of the core activity area according to the coordinate position as the starting area, calculate the angle of other core activity areas based on the starting area, sort the core activity areas in ascending order according to the angle to obtain an ordered core activity area sequence, push the starting point to the bottom of the stack, and push the areas in the ordered core activity area sequence into the stack in sequence. For each core activity area to be pushed into the stack, determine the cross product between the two vectors formed by the two core activity areas at the top of the stack. When the cross product is a negative value, pop the core activity area at the top of the stack until the cross product is a positive value. Finally, the core activity areas retained in the stack are sequentially connected to form a first boundary.

[0044] The curve simplification algorithm includes:

[0045] Connect the starting point and the end point of the initial electronic fence boundary to form a baseline; calculate the vertical distance from each point on the initial electronic fence boundary to the baseline, obtain the point with the largest vertical distance, determine the vertex, determine the first vector based on the vertex to the starting point, determine the second vector based on the vertex to the end point, and calculate the angle between the first vector and the second vector;

[0046] When the maximum value of the vertical distance is less than the first preset threshold value determined based on the total length of the initial electronic fence boundary, and the angle is less than the second preset threshold value, the starting point and the end point of the baseline are retained; otherwise, the initial electronic fence boundary is divided into two segments according to the point corresponding to the maximum value of the vertical distance, and it is determined whether the length of the segment is less than the third preset threshold value. If it is less than the third preset threshold value, the endpoint of the segment is directly retained. If it is greater than or equal to the third preset threshold value, the corresponding segment is repeatedly processed until the maximum values ​​of the vertical distances corresponding to all segments are less than the first preset threshold value, and the corresponding angles are less than the second preset threshold value, and the endpoints of all retained segments are connected in sequence according to the order of the initial electronic fence boundary points to obtain a simplified electronic fence boundary.

[0047] In an optional embodiment,

[0048] Based on the historical trajectory data entries in the trajectory database, extracting the target behavior feature vector, classifying through the behavior recognition model based on the target behavior feature vector, determining the behavior recognition result, detecting the abnormal behavior of the target Bluetooth device based on the preset behavior feature library, and generating comprehensive warning information in combination with the fence warning information, including:

[0049] Obtain historical trajectory data entries in a trajectory database, calculate the time interval and activity duration between adjacent trajectory points in the historical trajectory data entries, extract the activity frequency in each time interval to form a time feature, and calculate the displacement distance, movement speed and trajectory turning angle between adjacent trajectory points to form a spatial feature;

[0050] A dual-channel deep neural network model including a first channel, a second channel and a classifier is constructed, wherein the first channel includes a long short-term memory network layer and a fully connected layer, and the second channel includes three convolutional layers and a fully connected layer; the time feature is input into the first channel, and the sequence correlation, periodic fluctuation law and long-term activity pattern of the time feature are extracted through the long short-term memory network layer, and the results are transmitted to the fully connected layer to obtain the time behavior representation; the spatial feature is input into the second channel, and the trajectory morphology, movement trend and regional migration characteristics of the spatial feature are extracted in turn through the three convolutional layers, and the results are transmitted to the fully connected layer to obtain the spatial behavior representation; the variance contribution rate of each dimension in the time behavior representation and the variance contribution rate of each dimension in the spatial behavior representation are calculated respectively, and the time behavior representation and the spatial behavior representation are adaptively weighted fused according to the variance contribution rate to obtain the target behavior feature vector; the target behavior feature vector is input into the classifier, and the probability distribution of different behavior categories is calculated through the softmax function, and the category with the highest probability is selected as the behavior category and the corresponding probability value is used as the confidence probability to obtain the behavior recognition result;

[0051] Read the standard behavior pattern stored in a preset behavior feature library, wherein the standard behavior pattern includes the time regularity and spatial regularity of normal behavior, match the behavior recognition result with the standard behavior pattern, calculate the time deviation value and spatial deviation value of the behavior recognition result relative to the standard behavior pattern, and determine the abnormality score according to the time deviation value and the spatial deviation value; receive fence warning information, extract the position and time information in the fence warning information, and when the abnormality score exceeds a preset abnormality threshold, combine the behavior recognition result, the abnormality score, the position information and the time information to generate a comprehensive warning information.

[0052] According to a second aspect of the embodiments of the present invention,

[0053] Provided is a positioning and tracking warning system for Bluetooth signals, including:

[0054] The first unit is used to receive the Bluetooth signal of the target Bluetooth device through the Bluetooth receiver, obtain the signal broadcast packet data, generate the corrected signal characteristic parameters based on the signal broadcast packet data through the signal attenuation compensation model, calculate the real-time position coordinates of the target Bluetooth device through the positioning algorithm based on the spatial position coordinates of the Bluetooth receiver and the corrected signal characteristic parameters, and form the real-time position coordinates and the corrected signal characteristic parameters into a trajectory data entry, and store it in a trajectory database;

[0055] The second unit is used to build and train a spatiotemporal graph convolutional neural network model based on the historical trajectory data entries in the trajectory database, and generate predicted trajectory data in combination with the latest trajectory data entries; based on the historical trajectory data entries, calculate the activity law parameters of the target Bluetooth device, analyze the activity law parameters to dynamically generate an electronic fence, determine the boundary of the electronic fence, compare the predicted trajectory data with the boundary of the electronic fence in real time, and generate fence warning information;

[0056] The third unit is used to extract the target behavior feature vector based on the historical trajectory data entries in the trajectory database, classify the target behavior feature vector through a behavior recognition model, determine the behavior recognition result, detect the abnormal behavior of the target Bluetooth device based on a preset behavior feature library, and generate comprehensive warning information in combination with the fence warning information.

[0057] According to a third aspect of the embodiments of the present invention,

[0058] An electronic device is provided, comprising:

[0059] processor;

[0060] a memory for storing processor-executable instructions;

[0061] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0062] A fourth aspect of the embodiments of the present invention is:

[0063] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.

[0064] In the embodiment of the present invention, the signal characteristic parameters are corrected through the signal attenuation compensation model to reduce the impact of environmental interference on the Bluetooth signal, thereby improving the accuracy of the real-time position coordinate calculation of the target Bluetooth device and achieving more accurate positioning and tracking; a spatiotemporal graph convolutional neural network model is constructed based on the trajectory database to predict the future trajectory of the target Bluetooth device, and real-time comparison is performed in combination with the electronic fence to provide early warning of potential cross-border behaviors. At the same time, abnormal behaviors are identified through the behavior recognition model to provide more comprehensive security protection; based on the historical trajectory data of the target Bluetooth device, an electronic fence is dynamically generated to make it more consistent with the target's activity pattern, avoid frequent false alarms, and improve the effectiveness of the warning. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 A schematic diagram of a flow chart of a method for positioning, tracking and warning of Bluetooth signals according to an embodiment of the present invention;

[0066] Figure 2 The figure is a schematic diagram of the structure of a positioning, tracking and early warning system for Bluetooth signals according to an embodiment of the present invention. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0068] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0069] Figure 1 FIG. 1 is a flow chart of a method for positioning, tracking and warning Bluetooth signals according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0070] S101. Receive the Bluetooth signal of the target Bluetooth device through the Bluetooth receiver, obtain the signal broadcast packet data, generate the corrected signal characteristic parameters based on the signal broadcast packet data through the signal attenuation compensation model, calculate the real-time position coordinates of the target Bluetooth device through the positioning algorithm based on the spatial position coordinates of the Bluetooth receiver and the corrected signal characteristic parameters, and form the track data entry with the real-time position coordinates and the corrected signal characteristic parameters, and store them in the track database;

[0071] Specifically, the Bluetooth receiver collects the Bluetooth signal broadcast packets sent periodically by the target Bluetooth device, and extracts the MAC address, signal strength value (RSSI), transmission power and broadcast timestamp and other data. For each collected signal broadcast packet, the signal strength value is first corrected using the environmental factor model, which includes the temperature and humidity influence coefficient, the shielding attenuation coefficient and the multipath effect coefficient. These coefficients are dynamically adjusted through the real-time environmental data to calculate the corrected signal strength value. Then, based on the corrected signal strength value, combined with the transmission power, the logarithmic distance path loss model is used to calculate the signal propagation distance to obtain the corrected signal characteristic parameters.

[0072] Next, under the condition that the fixed spatial position coordinates of multiple Bluetooth receivers are known, the corrected signal characteristic parameters collected by each receiver are substituted into the three-sided ranging positioning algorithm. Specifically, the three receiver nodes with the best signal quality are first selected to construct a positioning triangle, and the distance from the target Bluetooth device to each receiver is calculated based on the corrected signal characteristic parameters. The weighted centroid method is used to solve the nonlinear equations formed by the three receivers to obtain the real-time position coordinates of the target Bluetooth device. In order to improve the positioning accuracy, the Kalman filter algorithm is also introduced to smooth the calculated position coordinates.

[0073] Finally, the calculated real-time position coordinates, together with the corresponding corrected signal characteristic parameters (including corrected signal strength value, propagation distance, etc.), timestamp and receiver node information, are organized into trajectory data entries according to the predefined data structure format. Each trajectory data has a unique index identifier and is stored in the trajectory database in chronological order, providing a data basis for subsequent trajectory analysis and behavior recognition. At the same time, the trajectory database has also established a query mechanism based on spatiotemporal indexes, which supports multi-dimensional retrieval of trajectory data by time range, spatial area, etc.

[0074] In this embodiment, the signal characteristic parameters are corrected by the signal attenuation compensation model to improve the calculation accuracy of the real-time location coordinates of the target Bluetooth device; the corrected signal characteristic parameters are combined with the real-time location coordinates to generate complete trajectory data entries, providing reliable data for subsequent trajectory analysis; the trajectory data entries are stored in the database to achieve structured storage of the target device trajectory information, which is convenient for rapid retrieval and management.

[0075] S102. Based on the historical trajectory data entries in the trajectory database, a spatiotemporal graph convolutional neural network model is constructed and trained, and the predicted trajectory data is generated in combination with the latest trajectory data entries; based on the historical trajectory data entries, the activity law parameters of the target Bluetooth device are calculated, the activity law parameters are analyzed to dynamically generate an electronic fence, the boundary of the electronic fence is determined, and the predicted trajectory data is compared with the boundary of the electronic fence in real time to generate fence warning information;

[0076] Specifically, firstly, the historical trajectory data entries within the specified time range are read from the trajectory database, and the position coordinate sequence of each trajectory data is organized into a trajectory graph structure in chronological order. In the trajectory graph structure, the node represents the location information of the trajectory point, the edge represents the spatiotemporal relationship between adjacent trajectory points, the attributes of the node include the location coordinates and timestamp, and the attributes of the edge include the moving distance and time interval. A spatiotemporal graph convolutional neural network model is constructed, which includes a spatial graph convolution layer and a temporal convolution layer, wherein the spatial graph convolution layer is used to extract the spatial dependency features of the trajectory, and the temporal convolution layer is used to capture the temporal evolution pattern of the trajectory. By batch training the historical trajectory data, the model parameters are optimized so that it can accurately predict the future trajectory of the target device.

[0077] When the latest trajectory data entry is received, it is combined with the historical trajectory data and input into the trained spatiotemporal graph convolutional neural network model to generate the predicted trajectory data for a period of time in the future. Specifically, the model first encodes the input trajectory sequence, then extracts high-level spatiotemporal features through multi-layer spatiotemporal convolution operations, and finally generates the position coordinate sequence of the predicted trajectory points through the decoder. In order to improve the robustness of the prediction, an attention mechanism is also introduced to dynamically adjust the weights of different historical trajectory segments.

[0078] At the same time, based on the historical trajectory data entries, the activity pattern parameters of the target Bluetooth device are calculated. Specifically, it includes: counting the distribution of the device's residence points in different time periods, calculating the residence time and residence frequency; analyzing the migration probability of the device between different areas, and constructing a regional transfer matrix; extracting the device's typical activity path and activity time window. Based on these activity pattern parameters, an adaptive clustering algorithm is used to determine the core range of the high-frequency activity area, and combined with movement characteristics such as speed and direction, the boundary of the electronic fence is dynamically generated. The electronic fence boundary is dynamically adjusted with time and spatial position, including the core area boundary and the transition area boundary.

[0079] Finally, the predicted trajectory data is compared with the dynamically generated electronic fence boundary in real time. Specifically, the shortest distance between the predicted trajectory point and the electronic fence boundary is calculated, and the movement trend of the predicted trajectory is considered. When the predicted trajectory point is about to break through the electronic fence boundary, or its movement trend obviously deviates from the normal activity mode, the fence warning information is generated. The fence warning information includes the warning level, warning type, trigger time, location information and the predicted trajectory development trend.

[0080] In this embodiment, the trajectory of the target Bluetooth device is predicted with high precision by combining the training of the spatiotemporal graph convolutional neural network model with the latest trajectory data. Based on the activity pattern parameters, the electronic fence is dynamically generated in real time to flexibly adapt to the behavioral characteristics of the target device. The predicted trajectory is compared with the electronic fence boundary in real time to quickly discover abnormal behavior and generate fence warning information, thereby improving the efficiency and reliability of security management. The historical trajectory data and prediction information are combined to achieve in-depth mining of the device behavior patterns and active prevention and control.

[0081] S103. Based on the historical trajectory data entries in the trajectory database, extract the target behavior feature vector, classify it through the behavior recognition model based on the target behavior feature vector, determine the behavior recognition result, detect the abnormal behavior of the target Bluetooth device based on the preset behavior feature library, and generate comprehensive warning information in combination with the fence warning information.

[0082] Specifically, firstly, the historical trajectory data entries are read from the trajectory database, and the temporal and spatial features of the trajectory data are extracted. The temporal feature extraction includes: calculating the time interval between adjacent trajectory points to obtain the duration of the activity, counting the activity frequency in each time window, and analyzing the periodicity and regularity of the activity. The spatial feature extraction includes: calculating the displacement distance between adjacent trajectory points to obtain the movement amplitude, calculating the movement speed based on the displacement and time, calculating the trajectory turning angle based on three consecutive trajectory points, and analyzing the morphological characteristics of the trajectory.

[0083] Next, a dual-channel deep neural network is constructed as a behavior recognition model. The first channel uses a long short-term memory network layer to process temporal features. This channel can effectively capture the long-term dependencies of time series data, extract the temporal pattern features of activities, and obtain temporal behavior representation through a fully connected layer. The second channel uses three convolutional layers to process spatial features, extract the local morphological features, motion trend features, and regional migration features of the trajectory in turn, and obtain spatial behavior representation through a fully connected layer. The variance contribution rate of each dimensional feature in the temporal behavior representation and spatial behavior representation is calculated respectively, and adaptive weighted fusion is performed based on the variance contribution rate to generate the target behavior feature vector.

[0084] Input the target behavior feature vector into the classification layer of the trained behavior recognition model, and calculate the probability distribution of different behavior categories through the softmax function. Select the category with the highest probability as the recognition result, and use the corresponding probability value as the confidence probability. At the same time, read the standard behavior pattern stored in the preset behavior feature library, which contains the time and space laws of normal behavior. Match the behavior recognition result with the standard behavior pattern, calculate the deviation value of the time dimension (such as activity duration deviation, frequency deviation) and the deviation value of the spatial dimension (such as position deviation, speed deviation), and calculate the anomaly score based on these deviation values.

[0085] Finally, the fence warning information generated in the previous step is received, and the location information and time information are extracted. When the calculated anomaly score exceeds the preset anomaly threshold, the behavior recognition result, anomaly score, location information and time information are combined to generate comprehensive warning information. The comprehensive warning information also includes the predicted behavior development trend, quantitative evaluation of the degree of anomaly and the priority level of the warning, providing a decision-making basis for subsequent warning disposal. In order to improve the accuracy of the warning, a warning feedback mechanism is also established to dynamically adjust the anomaly threshold and warning rules according to the disposal results.

[0086] In this embodiment, the target behavior feature vector is combined with the behavior recognition model to achieve accurate classification and identification of the target device behavior; based on the preset behavior feature library, the abnormal behavior of the target device is quickly detected to improve monitoring efficiency and accuracy; combined with the fence warning information, more comprehensive integrated warning information is generated to provide multi-dimensional security protection; using the behavior feature library and recognition model, it supports automatic analysis and dynamic adjustment of the target device behavior, providing support for intelligent scenarios.

[0087] In an optional implementation, generating a corrected signal characteristic parameter based on the signal broadcast packet data through a signal attenuation compensation model includes:

[0088] Based on the signal broadcast packet data, extract the signal strength value and the signal quality index, calculate the median of multiple signal strength values, calculate the absolute difference between each signal strength value and the median, calculate the median of the absolute difference to obtain the degree of dispersion, compare the degree of dispersion with the dynamic threshold, eliminate abnormal signal strength values ​​that exceed the dynamic threshold range, and obtain a valid signal strength value;

[0089] Collect actual signal strength values ​​and theoretical signal strength values ​​at a preset reference point, perform a difference operation on the actual signal strength values ​​and the theoretical signal strength values ​​to obtain an intensity deviation sample, perform a normality test on the intensity deviation sample, and use a maximum likelihood estimation method to calculate a deviation mean and a deviation standard deviation of the intensity deviation sample to obtain an intensity deviation characteristic value;

[0090] Calculate the temperature influence factor according to the real-time temperature data, calculate the humidity influence factor according to the real-time humidity data, perform weighted correction on the intensity deviation characteristic value by using the temperature influence factor and the humidity influence factor to generate an environmental factor correction value;

[0091] Measuring the propagation distance between the target Bluetooth device and the Bluetooth receiver, comparing the propagation distance with a preset reference distance, and when the propagation distance is less than or equal to the preset reference distance, calculating a first attenuation coefficient based on linear attenuation, and multiplying the first attenuation coefficient by the propagation distance to obtain a path loss value; when the propagation distance is greater than the preset reference distance, calculating a second attenuation coefficient based on logarithmic attenuation, and multiplying the second attenuation coefficient by a logarithmic value of the propagation distance to obtain the path loss value;

[0092] A sliding time window is constructed at a preset reference point to record the data of changes in signal strength with distance, a relationship equation between signal strength and distance is established, the slope of the relationship equation is calculated by the least squares method to obtain a local path loss index, and an exponential smoothing method is used to update the local path loss index to a global path loss index;

[0093] Calculate a theoretical signal strength reference value according to the global path loss index and the propagation distance, and add the theoretical signal strength reference value to the environmental factor correction value to obtain a preliminary corrected signal strength value;

[0094] The preliminary corrected signal strength value is weightedly corrected by using the signal quality index to obtain a weighted corrected signal strength value, and the weighted corrected signal strength value is smoothed by using a Kalman filter method to generate a corrected signal characteristic parameter.

[0095] In an optional specific implementation, first, extract the received signal strength indicator (RSSI) and signal quality indicators, such as the packet error rate (PER), from the Bluetooth broadcast data packet. Assume that five RSSI values ​​are received: -70dBm, -68dBm, -72dBm, -69dBm, -85dBm. Calculate the median of these five RSSI values ​​as -70dBm. Then calculate the absolute difference between each RSSI value and the median: 0, 2, 2, 1, 15. The median of these five absolute differences is 2, representing the degree of discreteness. Set the dynamic threshold to 5. Since 15 is greater than 5, the outlier value of -85dBm is eliminated. The remaining four RSSI values: -70dBm, -68dBm, -72dBm, -69dBm are used as valid signal strength values.

[0096] Next, at a preset reference point, such as one meter away from the Bluetooth device, collect the actual RSSI value and the theoretical RSSI value. Assume that the actual RSSI value is -65dBm and the theoretical RSSI value is -60dBm. The difference between the two is -5dBm, which is used as an intensity deviation sample. Collect RSSI samples at the reference point multiple times, for example, 100 samples, and perform a normality test on these intensity deviation samples, such as using the Shapiro-Wilk test. If the test results show that the sample conforms to the normal distribution, the maximum likelihood estimation method is used to calculate the deviation mean and deviation standard deviation. Assume that the calculated deviation mean is -4dBm and the deviation standard deviation is 2dBm. These two values ​​constitute the intensity deviation characteristic value.

[0097] Then, based on the real-time temperature and humidity data obtained by the environmental sensor, calculate the temperature influence factor and humidity influence factor. For example, assuming the temperature is 25 degrees Celsius, the corresponding temperature influence factor is 0.1 by looking up the table or using the fitting formula. The humidity is 60%, and the corresponding humidity influence factor is 0.2 by looking up the table or using the fitting formula. Multiply these two influence factors with the intensity deviation characteristic value and sum them to obtain the environmental factor correction value: (-4×0.1)+(2×0.2)=-0.4+0.4=0dBm.

[0098] Measure the propagation distance between the target Bluetooth device and the Bluetooth receiver. Assume that the measured distance is 3 meters and the preset reference distance is 2 meters. Since 3 meters is greater than 2 meters, the logarithmic attenuation model is used. Assuming the second attenuation coefficient is 4, the path loss value is 4×log(3)≈4×0.477≈1.91dBm. If the measured distance is 1 meter, which is less than the preset reference distance of 2 meters, the linear attenuation model is used. Assuming the first attenuation coefficient is 2, the path loss value is 2×1=2dBm.

[0099] At preset reference points, such as 1 meter, 2 meters, and 3 meters away from the Bluetooth device, a sliding time window is constructed to record the change data of signal strength with distance over a period of time. Assume that the collected data shows that the signal strength is inversely proportional to the square of the distance. The relationship equation is fitted using the least squares method to obtain the slope value. This slope value is the local path loss index. Then, the exponential smoothing method is used to update the local path loss index to the global path loss index. For example, the current global path loss index is 2.5, the new local path loss index is 2.2, and the smoothing factor is set to 0.1. The updated global path loss index is 2.5×(1-0.1)+2.2×0.1=2.25+0.22=2.47.

[0100] The theoretical signal strength reference value is calculated based on the global path loss index and propagation distance. For example, if the global path loss index is 2.47 and the propagation distance is 3 meters, assuming the reference distance is 1 meter and the reference signal strength is -60dBm, then the theoretical signal strength reference value is -60-10×2.47×log(3 / 1)≈-60-10×2.47×0.477≈-71.7dBm. Add the theoretical signal strength reference value to the environmental factor correction value to obtain the preliminary corrected signal strength value: -71.7+0=-71.7dBm.

[0101] The signal quality index is used to perform weighted correction on the preliminary corrected signal strength value. For example, if the signal quality index PER is 0.1 and the weight factor is 0.2, the weighted corrected signal strength value is -71.7×(1-0.2×0.1)≈-71.7×0.98≈-70.3dBm. Finally, the Kalman filter method is used to smooth the weighted corrected signal strength value to generate the final corrected signal characteristic parameters. For example, assuming that the predicted value of the Kalman filter is -70dBm and the measured value is -70.3dBm, the final corrected signal strength value after filtering is -70.2dBm.

[0102] In this embodiment, by compensating for the influence of environmental factors and path loss, the signal strength measurement error is effectively reduced and the measurement accuracy is improved; the application of Kalman filtering effectively suppresses the fluctuation of the signal strength value, making the signal characteristic parameters finally generated more stable and reliable; more accurate and stable signal characteristic parameters can significantly improve the Bluetooth-based positioning and ranging accuracy, and provide more reliable data support for various application scenarios.

[0103] In an optional implementation, based on the spatial position coordinates of the Bluetooth receiver and the corrected signal characteristic parameters, calculating the real-time position coordinates of the target Bluetooth device through a positioning algorithm includes:

[0104] Acquire the spatial position coordinates of at least three Bluetooth receivers and characteristic parameters of the correction signals received by each of the three Bluetooth receivers; continuously sample the characteristic parameters of the correction signals received by each of the three Bluetooth receivers to obtain signal strength time series data; divide the signal strength time series data into multiple time windows according to preset time intervals;

[0105] In each of the time windows, wavelet transform is performed on the signal strength time series data to obtain frequency characteristics, and periodic fluctuation components in the signal are identified according to the frequency characteristics;

[0106] Extracting corresponding features of the main signal path and the reflected signal path from the periodic fluctuation component to generate a signal path feature matrix; inputting the signal path feature matrix into a preset signal path classifier to determine the signal path with the largest intensity and the smallest fluctuation as the main signal path; calculating the distance value from each Bluetooth receiver to the target Bluetooth device according to the main signal path; and constructing a nonlinear equation group based on the distance value;

[0107] Calculate the residual between the theoretical distance value and the actual distance value under the current position coordinate, calculate the gradient direction according to the residual, update the position coordinate with an adaptive step size along the gradient direction, and obtain the initial position coordinate; calculate the convergence index of the initial position coordinate, when the convergence index is greater than a preset threshold, increase the search range based on a preset search range increment, and recalculate the position coordinate; when the convergence index is less than the preset threshold, record the current position coordinate as a candidate solution;

[0108] The candidate solutions obtained in the multiple time windows are weighted averaged to obtain the real-time position coordinates of the target Bluetooth device.

[0109] In an optional specific implementation, the location and signal parameters of the Bluetooth receiver are obtained: first, at least three Bluetooth receivers are deployed and their precise three-dimensional spatial coordinates are recorded (for example, measured using a tape measure and a level, and the coordinates are recorded in a database). Each receiver is equipped with a module capable of measuring the received signal strength (RSSI) and other signal characteristic parameters (for example, frequency offset, timestamp). To ensure the measurement accuracy, the received signal characteristic parameters are calibrated to eliminate the influence of system errors and environmental noise. For example, a Bluetooth transmitter with a known position is used for calibration to establish a mapping relationship between signal characteristic parameters and distance. Assume that the coordinates of the three Bluetooth receivers are (0, 0, 0), (5, 0, 0) and (0, 5, 0) meters respectively.

[0110] Continuous sampling and time window division: Each Bluetooth receiver continuously collects the corrected signal characteristic parameters, such as recording the RSSI value every 10 milliseconds, to form time series data. For the convenience of analysis, the continuous signal strength time series data is divided into multiple time windows according to the preset time interval (for example, 500 milliseconds). For example, a 2-second sampling data will be divided into 4 time windows, each window contains 500 RSSI sampling values.

[0111] Wavelet transform and identification of periodic fluctuation components: In each time window, the signal strength time series data is subjected to wavelet transform to decompose the signal into components of different frequencies. By analyzing the coefficients after wavelet transform, the periodic fluctuation components in the signal are identified. For example, the amplitude and frequency of the coefficients can be used to determine whether there are obvious periodic fluctuations. Assuming that in a certain time window, the wavelet transform result shows that there is a significant frequency component near 10Hz, it is considered that the frequency component corresponds to a periodic fluctuation component.

[0112] Signal path feature extraction and classification: The corresponding features of the main signal path and the reflected signal path are extracted from the identified periodic fluctuation components. For example, the signal strength, arrival time difference, frequency offset and other features of different paths can be extracted to construct a signal path feature matrix. The matrix is ​​input into a preset signal path classifier (for example, a classifier based on machine learning). According to the signal strength, fluctuation degree and other features, the signal path with the largest intensity and the smallest fluctuation is determined as the main signal path, and the direct path and the reflected path are distinguished. For example, if the main path signal strength is -50dBm with a fluctuation range of 2dBm, and the reflected path signal strength is -60dBm with a fluctuation range of 5dBm, the classifier will identify the path with greater intensity and smaller fluctuation as the main signal path.

[0113] Distance calculation: Based on the determined main signal path, the distance value from each Bluetooth receiver to the target Bluetooth device is calculated using the mapping relationship between signal strength and distance (e.g., an empirical formula or lookup table obtained through previous calibration). For example, if the main path signal strength is -55dBm, the corresponding distance is 2 meters according to the calibration results.

[0114] Nonlinear equation system construction and solution: Based on the calculated distance values ​​from each receiver to the target device, a nonlinear equation system is constructed. By iteratively solving the equation system, the position coordinates of the target device can be estimated. For example, using three distance values ​​obtained from three receivers, a nonlinear equation system with three unknowns (the three-dimensional coordinates of the target device) can be constructed.

[0115] Initial position coordinates and convergence judgment: Select an initial position coordinate as the starting point for iterative solution. Calculate the residual between the theoretical distance value (calculated based on the initial coordinates and the receiver coordinates) and the actual distance value (the distance value calculated in step 5) at the current position coordinate. Calculate the gradient direction based on the residual, and update the position coordinate along the gradient direction with an adaptive step size to obtain a new position coordinate. Calculate the convergence index of the new position coordinate (for example, the sum of squares of the residuals). If the convergence index is greater than the preset threshold, increase the search range and recalculate the position coordinates. If the convergence index is less than the preset threshold, record the current position coordinate as a candidate solution. For example, if the sum of squares of the residuals is less than 0.1, the algorithm is considered to have converged.

[0116] Weighted average and real-time location coordinates: The candidate solutions obtained from multiple time windows are weighted averaged to obtain the real-time location coordinates of the target Bluetooth device. The weights can be assigned based on the quality of the signal in each time window. For example, the window with stronger signal strength and smaller fluctuation has a larger weight. Weighted average of candidate solutions from multiple time windows can effectively reduce the impact of random errors and improve positioning accuracy. For example, the candidate solutions from four time windows are weighted averaged to obtain the final real-time location coordinates.

[0117] In this embodiment, by analyzing the periodic fluctuation component of the signal, the main signal path is identified, the impact of the multipath effect is effectively reduced, and the positioning accuracy is improved; an adaptive step size and search range adjustment strategy is adopted to enhance the robustness of the algorithm, which can converge stably even in complex environments; and by weighted averaging the candidate solutions of multiple time windows, the computational complexity is reduced and the real-time performance is improved.

[0118] In an optional implementation, based on the historical trajectory data entries in the trajectory database, constructing and training a spatiotemporal graph convolutional neural network model, and combining the latest trajectory data entries to generate predicted trajectory data includes:

[0119] Based on the historical trajectory data entries in the trajectory database, according to the preset sampling rules, the trajectory sampling points are determined, the real-time position coordinates and corresponding timestamps of the trajectory sampling points are extracted, the graph structure nodes are determined, and based on the spatiotemporal associations between adjacent graph structure nodes, the graph structure edges are determined to construct the spatiotemporal graph structure;

[0120] Calculate the spatial distance between adjacent graph structure nodes in the spatiotemporal graph structure, substitute the spatial distance into a Gaussian kernel function to obtain a spatial weight, calculate the time interval between adjacent graph structure nodes, substitute the time interval into an exponential decay function to obtain a temporal weight, and use the product of the spatial weight and the temporal weight as an edge weight;

[0121] Sliding window segmentation is performed on the graph structure nodes in the spatiotemporal graph structure, and the instantaneous velocity vector corresponding to the graph structure node is calculated in each sliding window, and the inner product of adjacent instantaneous velocity vectors is divided by the vector modulus to obtain the direction change rate, and the node whose direction change rate is greater than a preset direction change rate threshold is marked as a turning point;

[0122] Taking the trajectory segments between the turning points as activity segments, calculating the duration and spatial distribution of each activity segment, and calculating the probability density distribution of the activity segment in the time dimension and the spatial dimension by using the kernel density estimation method;

[0123] Performing a graph convolution operation on the spatiotemporal graph structure, constructing a weighted adjacency matrix based on edge weights and probability density distribution, calculating a normalized Laplace matrix based on the weighted adjacency matrix, recursively calculating Chebyshev polynomials of different orders, and using the product of the linear combination of the Chebyshev polynomials and the normalized Laplace matrix as a graph convolution kernel, spatially aggregating node features, and obtaining graph convolution aggregation features;

[0124] Construct an attention calculation unit, map the node features corresponding to the current moment into a query vector, map the node features of the historical moments into a key vector and a value vector, calculate the similarity between the query vector and the key vector, obtain an attention score, normalize the attention score to obtain an attention weight, and use the weighted sum of the attention weight and the value vector as the temporal attention feature; concatenate the graph convolution aggregation feature with the temporal attention feature, input the pre-trained prediction network, and generate predicted trajectory data.

[0125] In an optional specific implementation, first, historical trajectory data is read from the trajectory database. The trajectory data usually contains a series of location coordinates with timestamps. For example, a trajectory data can be represented as: [(time 1, longitude 1, latitude 1), (time 2, longitude 2, latitude 2), ..., (time n, longitude n, latitude n)].

[0126] Next, the trajectory data is sampled according to the preset sampling rules. For example, sampling can be performed at fixed time intervals or fixed distance intervals. After sampling, a series of trajectory sampling points are obtained, each of which contains real-time position coordinates and corresponding timestamps. These sampling points will serve as nodes of the graph structure.

[0127] Then, the edges of the graph structure are constructed based on the temporal and spatial associations between adjacent sampling points. If two sampling points are adjacent in time and the spatial distance is less than a preset threshold, it is considered that there is an edge between them.

[0128] In order to quantify the strength of the association between edges, it is necessary to calculate the edge weight. First, calculate the spatial distance between adjacent nodes. For example, the spatial distance between two nodes can be calculated using the Euclidean distance. Then, substitute the spatial distance into the Gaussian kernel function to obtain the spatial weight. The value of the Gaussian kernel function decreases as the distance increases, indicating that the closer the distance, the stronger the association. At the same time, calculate the time interval between adjacent nodes, and substitute the time interval into the exponential decay function to obtain the time weight. The value of the exponential decay function decreases as the time interval increases, indicating that the shorter the time interval, the stronger the association. Finally, the product of the spatial weight and the time weight is used as the edge weight.

[0129] Next, the nodes in the graph structure are segmented into sliding windows. For example, if the sliding window size is set to 3, then three consecutive nodes are taken as a sliding window in turn. In each sliding window, the instantaneous velocity vector corresponding to each node is calculated. The instantaneous velocity vector can be obtained by calculating the ratio of the difference in position coordinates between adjacent nodes to the time interval. Then, the directional change rate of adjacent instantaneous velocity vectors is calculated. The directional change rate can be obtained by calculating the inner product of two vectors divided by the product of the vector modulus. If the directional change rate is greater than the preset threshold, the node is marked as a turning point.

[0130] The trajectory segments between turning points are regarded as activity segments. The duration and spatial distribution of each activity segment are calculated. The duration refers to the time difference between the start time and the end time of the activity segment. The spatial distribution refers to the set of longitude and latitude coordinates of all nodes in the activity segment. Then, the kernel density estimation method is used to calculate the probability density distribution of the activity segment in the time dimension and the spatial dimension.

[0131] Next, graph convolution is performed on the spatiotemporal graph structure. First, a weighted adjacency matrix is ​​constructed based on edge weights and probability density distribution. The elements of the weighted adjacency matrix represent the connection strength between nodes, which is determined by the edge weights and probability density distribution. Then, the normalized Laplace matrix is ​​calculated based on the weighted adjacency matrix. The normalized Laplace matrix is ​​a normalization process of the weighted adjacency matrix, which can avoid the scale change of node features during the graph convolution process. Next, the graph convolution kernel is obtained by recursively calculating Chebyshev polynomials of different orders and linearly combining the product of the Chebyshev polynomials and the normalized Laplace matrix. Finally, the graph convolution kernel is used to spatially aggregate the node features to obtain the graph convolution aggregation features.

[0132] Then, an attention calculation unit is constructed to capture the temporal dependencies in the trajectory data. The node features corresponding to the current moment are mapped to the query vector, and the node features at the historical moments are mapped to the key vector and the value vector. The similarity between the query vector and the key vector is calculated to obtain the attention score. The attention score is normalized to obtain the attention weight. The weighted sum of the attention weight and the value vector is used as the temporal attention feature.

[0133] Finally, the graph convolution aggregation features and the temporal attention features are concatenated and input into the pre-trained prediction network to generate the predicted trajectory data. The prediction network can be a recurrent neural network or other deep learning models.

[0134] For example, suppose there is a trajectory dataset that contains the user's travel trajectory in the past week. This method can be used to predict the user's travel trajectory in the future.

[0135] In this embodiment, by constructing a spatiotemporal graph structure, the spatiotemporal dependencies in the trajectory data are effectively captured, thereby improving the accuracy of trajectory prediction; it can process complex trajectory data containing turning points and activity segments, and has strong robustness; it can be applied to different trajectory data sets, and the model parameters can be adjusted according to actual needs, and has good scalability.

[0136] In an optional implementation, based on the historical trajectory data entries, calculating the activity pattern parameters of the target Bluetooth device, parsing the activity pattern parameters to dynamically generate an electronic fence, and determining the boundary of the electronic fence includes:

[0137] Obtain historical trajectory data entries of the target Bluetooth device, calculate the time interval and position coordinate difference between adjacent trajectory points in the historical trajectory data entries, identify the stay points and the moving segments, perform density clustering on the stay points to obtain an activity area set, extract movement trajectory features for the moving segments, and construct a connection relationship between the activity area sets;

[0138] Divide a day into 24 time segments according to the hourly granularity, calculate the residence time ratio of the target Bluetooth device in each of the activity area sets in each time segment, construct a spatiotemporal activity intensity distribution matrix, perform feature decomposition on the spatiotemporal activity intensity distribution matrix through singular value decomposition to obtain activity law parameters, and construct a first-order Markov activity transfer matrix between the activity area sets based on the connection relationship;

[0139] Based on the activity law parameters, determine the set of activity areas with activity intensity higher than a preset intensity threshold in the spatiotemporal activity intensity distribution matrix as the core activity area, use a convex hull scanning algorithm to take the minimum convex polygon of the core activity area as the first boundary, calculate the transition probability between the core activity areas based on the first-order Markov activity transition matrix, construct a connection channel between the core activity areas with a transition probability greater than a preset transition probability threshold, and obtain a second boundary, wherein the width of the connection channel is linearly positively correlated with the transition probability, and merge the first boundary with the second boundary to obtain an initial electronic fence boundary;

[0140] The initial electronic fence boundary is simplified by using a curve simplification algorithm to obtain a simplified electronic fence boundary, and the simplified electronic fence boundary is smoothed by using cubic spline interpolation to obtain a final electronic fence boundary.

[0141] The convex hull specifically refers to the smallest convex polygon (or convex polyhedron) on a plane or in space that contains a set of points. In simple terms, the convex hull can be thought of as the shape formed when a rubber band is wrapped around a point and then released; given a set of points S (containing a finite number of points), its convex hull is the smallest convex set containing S; each point is either on the boundary of the convex hull or inside the convex hull. The convex hull is convex, that is, for any two points in the convex hull, all of its points are inside or on the boundary of the convex hull.

[0142] The convex polygon specifically refers to a polygon on a plane that satisfies the following conditions: the entire polygon is located on one side of a straight line formed by extending each side of the polygon outward. In other words, the straight line segment between any two points on any side is completely located inside or on the boundary of the polygon.

[0143] In an optional specific implementation, historical trajectory data entries of the target Bluetooth device are obtained. For example, the location coordinates and timestamp information of the target Bluetooth device within a period of time can be collected through a Bluetooth receiver, and the information is stored as a trajectory data entry. Each trajectory data entry contains information such as timestamp, longitude, and latitude. For example, if trajectory data for a week is collected and recorded once every minute, there will be about 10,000 trajectory data.

[0144] Calculate the time interval and position coordinate difference between adjacent trajectory points. Traverse all trajectory data entries and calculate the time difference and distance difference between each trajectory point and the previous trajectory point. For example, if the timestamp of the ith trajectory point is ti, the longitude and latitude are (loni, lati), and the timestamp of the i-1th trajectory point is ti-1, the longitude and latitude are (loni-1, lati-1), then the time interval is ti-ti-1, and the distance difference can be calculated using the spherical distance formula.

[0145] Identify stay points and moving segments. According to the time interval and distance difference, set a threshold to distinguish stay points and moving segments. For example, if the time interval is greater than 10 minutes and the distance difference is less than 50 meters, the trajectory point is considered to be a stay point; otherwise, the trajectory point is considered to be a moving segment.

[0146] Perform density clustering on the stay points to obtain a set of activity areas. Use a density clustering algorithm, such as the DBSCAN algorithm, to cluster the stay points. Set a distance threshold and a minimum point number threshold to cluster stay points with a close distance and a large number into an activity area. For example, stay points with a distance less than 100 meters and a point number greater than 5 are clustered into an activity area, and finally multiple activity area sets are obtained. Each activity area can be represented by the coordinates of its center point and the number of stay points it contains. Assume that the clustering results in three activity areas: A, B, and C.

[0147] Extract the movement trajectory features of the movement segment and build the connection relationship between the activity area sets. Extract the features of the movement segment, such as the starting point, end point, duration, etc. According to the starting point and end point of the movement segment, build the connection relationship between the activity areas. For example, if the starting point of a movement segment is located in activity area A and the end point is located in activity area B, then establish a connection relationship from A to B.

[0148] Divide a day into 24 time segments based on hourly granularity.

[0149] Calculate the residence time ratio of the target Bluetooth device in each set of activity areas in each time segment, and construct a spatiotemporal activity intensity distribution matrix. Count the residence time of the target Bluetooth device in each activity area in each time segment. Then, calculate the residence time ratio of each activity area in each time segment. For example, if the target device stays in activity area A for 30 minutes, stays in activity area B for 10 minutes, and stays in activity area C for 20 minutes during the time period of 8:00-9:00, then the residence time ratios in A, B, and C during this time period are 0.5, 0.17, and 0.33, respectively. These ratio values ​​are combined into a 24x3 matrix, namely the spatiotemporal activity intensity distribution matrix.

[0150] The activity law parameters are obtained by eigendecomposing the space-time activity intensity distribution matrix through singular value decomposition. The eigenvalues ​​and eigenvectors are obtained by performing singular value decomposition on the space-time activity intensity distribution matrix. These eigenvalues ​​and eigenvectors can be used as activity law parameters.

[0151] The first-order Markov activity transition matrix between the sets of activity regions is constructed based on the connection relationship. According to the connection relationship between the activity regions, the number of transfers from one activity region to another is counted to construct the first-order Markov activity transition matrix. For example, if the number of transfers from A to B is 10 times and the number of transfers from A to C is 5 times, the transfer probability from A to B is 0.67 and the transfer probability from A to C is 0.33.

[0152] Based on the activity regularity parameters, the set of activity areas with activity intensity higher than the preset intensity threshold in the spatiotemporal activity intensity distribution matrix is ​​determined as the core activity area. An intensity threshold is set, for example, 0.4. If the proportion of the residence time of an activity area in a certain time segment is greater than the threshold, the activity area is considered to be a core activity area in the time segment.

[0153] The convex hull scanning algorithm is used to take the minimum convex polygon of the core activity area as the first boundary. For each core activity area, the convex hull scanning algorithm is used to calculate its minimum convex polygon as the first boundary.

[0154] Based on the first-order Markov activity transition matrix, the transition probability between the core activity areas is calculated, and a connection channel is constructed between the core activity areas whose transition probability is greater than a preset transition probability threshold to obtain the second boundary. The width of the connection channel is linearly positively correlated with the transition probability. A transition probability threshold is set, such as 0.5. If the transition probability between two core activity areas is greater than the threshold, a connection channel is constructed between the two areas. The width of the connection channel is proportional to the transition probability.

[0155] The first boundary and the second boundary are combined to obtain an initial electronic fence boundary.

[0156] The initial electronic fence boundary is simplified by using a curve simplification algorithm to obtain a simplified electronic fence boundary. For example, the initial electronic fence boundary is simplified by using a Douglas-Peucker algorithm.

[0157] The simplified electronic fence boundary is smoothed by cubic spline interpolation to obtain the final electronic fence boundary.

[0158] In this embodiment, an electronic fence can be dynamically generated based on the historical activity patterns of the target Bluetooth device. Compared with traditional fixed electronic fences, it is more in line with the actual activity range of the user, thereby improving the accuracy of the electronic fence and reducing false alarms and missed alarms; the boundary of the electronic fence can be automatically adjusted according to changes in the user's activity patterns, such as changes in the user's travel habits, so that the electronic fence can better adapt to changes in the user's behavior and maintain its effectiveness; the automatic generation and adjustment of the electronic fence boundaries reduces the need for manual intervention and maintenance, thereby reducing the maintenance cost of the electronic fence.

[0159] In an optional implementation, using a convex hull scanning algorithm to take the minimum convex polygon of the core active area as the first boundary includes:

[0160] Determine the lowest point of the core activity area according to the coordinate position as the starting area, calculate the angle of other core activity areas based on the starting area, sort the core activity areas in ascending order according to the angle to obtain an ordered core activity area sequence, push the starting point to the bottom of the stack, and push the areas in the ordered core activity area sequence into the stack in sequence. For each core activity area to be pushed into the stack, determine the cross product between the two vectors formed by the two core activity areas at the top of the stack. When the cross product is a negative value, pop the core activity area at the top of the stack until the cross product is a positive value. Finally, the core activity areas retained in the stack are sequentially connected to form a first boundary.

[0161] The curve simplification algorithm includes:

[0162] Connect the starting point and the end point of the initial electronic fence boundary to form a baseline; calculate the vertical distance from each point on the initial electronic fence boundary to the baseline, obtain the point with the largest vertical distance, determine the vertex, determine the first vector based on the vertex to the starting point, determine the second vector based on the vertex to the end point, and calculate the angle between the first vector and the second vector;

[0163] When the maximum value of the vertical distance is less than the first preset threshold value determined based on the total length of the initial electronic fence boundary, and the angle is less than the second preset threshold value, the starting point and the end point of the baseline are retained; otherwise, the initial electronic fence boundary is divided into two segments according to the point corresponding to the maximum value of the vertical distance, and it is determined whether the length of the segment is less than the third preset threshold value. If it is less than the third preset threshold value, the endpoint of the segment is directly retained. If it is greater than or equal to the third preset threshold value, the corresponding segment is repeatedly processed until the maximum values ​​of the vertical distances corresponding to all segments are less than the first preset threshold value, and the corresponding angles are less than the second preset threshold value, and the endpoints of all retained segments are connected in sequence according to the order of the initial electronic fence boundary points to obtain a simplified electronic fence boundary.

[0164] The stack specifically refers to a last-in-first-out data structure, which can be understood as a container that can only be inserted and deleted at one end, which is called the top of the stack. The basic characteristics of a stack include: last-in-first-out, the last element put into the stack is taken out first, similar to "stacking plates", the top plate is taken out first; operation restrictions, push is to push elements to the top of the stack, and pop is to remove the top element from the stack.

[0165] In an optional specific implementation, first, determine the minimum convex polygon boundary of the core activity area. Find the point with the smallest ordinate value in all core activity areas and use it as the starting point. If there are multiple points with the same ordinate value, select the point with the smallest abscissa value as the starting point. Based on the starting point, calculate the angle between other core activity area points and the line connecting the starting point and the horizontal right direction. Then, sort all core activity area points in ascending order according to these angles to obtain an ordered sequence of core activity area points.

[0166] Next, initialize an empty stack and push the starting point to the bottom of the stack. Then, push the points in the ordered sequence of core activity area points into the stack one by one. For each point to be pushed into the stack, determine the directional relationship between the two vectors formed by the two points at the top of the stack. If the two vectors are in a clockwise direction, pop the point at the top of the stack out of the stack. Repeat this process until the two vectors are in a counterclockwise direction or only the starting point is left in the stack. Finally, the points retained in the stack are connected in order to form the minimum convex polygon boundary of the core activity area, that is, the first boundary.

[0167] For example, suppose there are 5 core activity area points A(1,1), B(2,3), C(4,2), D(3,0), E(5,4). Then point D is the starting point. Calculate the angle between the line connecting other points and point D and the horizontal right direction, and sort them in ascending order to obtain D, C, B, E, A. Push D into the stack. Then push C into the stack, and then push B into the stack. At this time, it is judged that the three points D, C, and B are in a counterclockwise direction, and B is retained. Push E into the stack, and judge the three points C, B, and E. The vectors CB and BE are in a clockwise direction, and B is popped out of the stack. Judge whether C and E are counterclockwise. If so, E is retained. Push A into the stack, and judge whether E and A are counterclockwise. If so, A is retained. Finally, D, C, E, and A are retained in the stack and connected in sequence to form the first boundary.

[0168] Then, simplify the boundary of the electronic fence. Connect the starting point and the end point of the initial electronic fence boundary to form a baseline. Calculate the vertical distance from each point on the initial electronic fence boundary to this baseline, and find the point with the largest vertical distance, which is recorded as the vertex.

[0169] A first vector is determined based on a line from the vertex to the starting point, a second vector is determined based on a line from the vertex to the end point, and an angle between the first vector and the second vector is calculated.

[0170] If the maximum vertical distance is less than a preset first threshold (e.g., 5% of the total length of the initial geo-fence boundary), and the angle is less than a preset second threshold (e.g., 135 degrees), the start and end points of the baseline are retained to complete the simplification of the boundary segment.

[0171] Otherwise, the initial electronic fence boundary is divided into two segments by the point with the largest vertical distance. Determine whether the length of each segment is less than the third threshold value set in advance (for example, 1% of the total length of the initial electronic fence boundary). If it is less than the third threshold value, the endpoint of the segment is directly retained. If it is greater than or equal to the third threshold value, the above process is repeated for the segment until the maximum vertical distance of all segments is less than the first threshold value and the angle is less than the second threshold value. Finally, all the retained endpoints are connected in sequence according to the order of the initial electronic fence boundary points to obtain a simplified electronic fence boundary.

[0172] In this embodiment, the minimum convex polygon boundary is determined by the convex hull scanning algorithm, which can more accurately delineate the scope of the core activity area and avoid missing important activity areas; the curve simplification algorithm can remove redundant points in the electronic fence boundary and simplify the boundary shape, thereby reducing storage and computing costs and improving system efficiency; the simplified electronic fence boundary is easier to manage and maintain, and can be more effectively applied to various scenarios, such as geographic fencing, area monitoring, etc.

[0173] In an optional implementation, based on the historical trajectory data entries in the trajectory database, extracting the target behavior feature vector, based on the target behavior feature vector, classifying through the behavior recognition model, determining the behavior recognition result, based on the preset behavior feature library, detecting the abnormal behavior of the target Bluetooth device, and generating comprehensive warning information in combination with the fence warning information include:

[0174] Obtain historical trajectory data entries in a trajectory database, calculate the time interval and activity duration between adjacent trajectory points in the historical trajectory data entries, extract the activity frequency in each time interval to form a time feature, and calculate the displacement distance, movement speed and trajectory turning angle between adjacent trajectory points to form a spatial feature;

[0175] A dual-channel deep neural network model including a first channel, a second channel and a classifier is constructed, wherein the first channel includes a long short-term memory network layer and a fully connected layer, and the second channel includes three convolutional layers and a fully connected layer; the time feature is input into the first channel, and the sequence correlation, periodic fluctuation law and long-term activity pattern of the time feature are extracted through the long short-term memory network layer, and the results are transmitted to the fully connected layer to obtain the time behavior representation; the spatial feature is input into the second channel, and the trajectory morphology, movement trend and regional migration characteristics of the spatial feature are extracted in turn through the three convolutional layers, and the results are transmitted to the fully connected layer to obtain the spatial behavior representation; the variance contribution rate of each dimension in the time behavior representation and the variance contribution rate of each dimension in the spatial behavior representation are calculated respectively, and the time behavior representation and the spatial behavior representation are adaptively weighted fused according to the variance contribution rate to obtain the target behavior feature vector; the target behavior feature vector is input into the classifier, and the probability distribution of different behavior categories is calculated through the softmax function, and the category with the highest probability is selected as the behavior category and the corresponding probability value is used as the confidence probability to obtain the behavior recognition result;

[0176] Read the standard behavior pattern stored in a preset behavior feature library, wherein the standard behavior pattern includes the time regularity and spatial regularity of normal behavior, match the behavior recognition result with the standard behavior pattern, calculate the time deviation value and spatial deviation value of the behavior recognition result relative to the standard behavior pattern, and determine the abnormality score according to the time deviation value and the spatial deviation value; receive fence warning information, extract the position and time information in the fence warning information, and when the abnormality score exceeds a preset abnormality threshold, combine the behavior recognition result, the abnormality score, the position information and the time information to generate a comprehensive warning information.

[0177] First, obtain the historical trajectory data entries from the trajectory database. Each trajectory data entry contains a series of trajectory points arranged in chronological order, and each trajectory point records the location coordinates of the target Bluetooth device at a specific time. For example, a trajectory data entry can be represented as: {(time 1, longitude 1, latitude 1), (time 2, longitude 2, latitude 2), (time 3, longitude 3, latitude 3)...}.

[0178] Next, the time interval and activity duration between adjacent track points in the historical track data entry are calculated. For example, for the above track data entry, the first time interval is time 2-time 1, the second time interval is time 3-time 2, and so on. The activity duration refers to the length of time the target Bluetooth device is active in each time interval.

[0179] Then, the activity frequency in each time interval is extracted to form a time feature. The activity frequency refers to the number of times the target Bluetooth device changes state in each time interval, such as position change, speed change, etc. Assuming that the position of the target Bluetooth device changes twice in the first time interval, the activity frequency of this time interval is 2. The activity frequencies of all time intervals are combined to form a time feature vector. For example, assuming there are three time intervals, and their activity frequencies are 2, 1, and 3 respectively, then the time feature vector is [2, 1, 3].

[0180] At the same time, the displacement distance, movement speed and trajectory turning angle between adjacent trajectory points are calculated to form spatial features. The displacement distance refers to the straight-line distance between two adjacent trajectory points. The movement speed refers to the average moving speed of the target Bluetooth device in each time interval. The trajectory turning angle refers to the angle between two line segments formed by three adjacent trajectory points. The displacement distance, movement speed and trajectory turning angle of all time intervals are combined to form a spatial feature vector. For example, suppose there are three time intervals, their displacement distances are 10 meters, 5 meters, and 15 meters, their movement speeds are 2 meters / second, 1 meter / second, and 3 meters / second, and their trajectory turning angles are 30 degrees, 60 degrees, and 90 degrees, respectively. The spatial feature vector is [10, 5, 15, 2, 1, 3, 30, 60, 90].

[0181] A two-channel deep neural network model is constructed for behavior recognition. The model contains the first channel and the second channel, which process temporal features and spatial features respectively. The first channel contains a long short-term memory network layer and a fully connected layer. The temporal feature vector is input to the first channel. The long short-term memory network layer can capture long-term dependencies and periodic patterns in the time series. For example, the target Bluetooth device is active in a certain area every morning. The fully connected layer converts the output of the long short-term memory network layer into a temporal behavior representation. The second channel contains three convolutional layers and one fully connected layer. The spatial feature vector is input to the second channel. The convolutional layer can extract local patterns and global features in the spatial features. For example, the target Bluetooth device often moves between certain specific areas. The fully connected layer converts the output of the convolutional layer into a spatial behavior representation.

[0182] The variance contribution rate of each dimension in the temporal behavior representation and the spatial behavior representation is calculated respectively. The variance contribution rate reflects the contribution of each dimension to the overall behavior representation. The temporal behavior representation and the spatial behavior representation are adaptively weighted and fused according to the variance contribution rate to obtain the target behavior feature vector. For example, if the variance contribution rate of a dimension in the temporal behavior representation is high, a greater weight is given to the dimension.

[0183] The target behavior feature vector is input into the classifier, which uses the softmax function to calculate the probability distribution of different behavior categories, selects the category with the highest probability as the behavior recognition result, and uses the corresponding probability value as the confidence probability. For example, if the probability distribution output by the classifier is [0.1, 0.8, 0.1], the behavior recognition result is the second category, and the confidence probability is 0.8.

[0184] Read the standard behavior patterns stored in the preset behavior feature library. The standard behavior patterns describe the temporal and spatial regularities of different behavior categories. For example, "being active in the office area from 8 to 9 a.m. every day" can be used as a standard behavior pattern. Match the behavior recognition result with the standard behavior pattern, and calculate the time deviation value and space deviation value of the behavior recognition result relative to the standard behavior pattern. For example, if the behavior recognition result is "being active in the office area from 7 to 8 a.m.", the time deviation value is 1 hour. Determine the anomaly score based on the time deviation value and the space deviation value. The larger the deviation value, the higher the anomaly score.

[0185] Receive fence warning information and extract the location and time information. When the anomaly score exceeds the preset anomaly threshold, combine the behavior recognition result, anomaly score, location information and time information to generate a comprehensive warning message. For example, if the anomaly score exceeds the threshold, a warning message is generated: "The target Bluetooth device appears in the office area during non-working hours, anomaly score 0.9, location: office area, time: 2 am".

[0186] In this embodiment, by combining time features and spatial features and using a deep learning model for behavior recognition, the abnormal behavior of the target Bluetooth device can be identified more accurately; the comprehensive warning information includes behavior recognition results, anomaly scores, location information and time information, which can help users better understand the nature and severity of the abnormal behavior; by adaptively weighted fusion of time behavior representation and spatial behavior representation, the system can better adapt to different scenarios and different types of abnormal behaviors.

[0187] Figure 2 FIG. 1 is a schematic diagram of a structure of a positioning and tracking warning system for Bluetooth signals according to an embodiment of the present invention. Figure 2 As shown, the system comprises:

[0188] The first unit is used to receive the Bluetooth signal of the target Bluetooth device through the Bluetooth receiver, obtain the signal broadcast packet data, generate the corrected signal characteristic parameters based on the signal broadcast packet data through the signal attenuation compensation model, calculate the real-time position coordinates of the target Bluetooth device through the positioning algorithm based on the spatial position coordinates of the Bluetooth receiver and the corrected signal characteristic parameters, and form the real-time position coordinates and the corrected signal characteristic parameters into a trajectory data entry, and store it in a trajectory database;

[0189] The second unit is used to build and train a spatiotemporal graph convolutional neural network model based on the historical trajectory data entries in the trajectory database, and generate predicted trajectory data in combination with the latest trajectory data entries; based on the historical trajectory data entries, calculate the activity law parameters of the target Bluetooth device, analyze the activity law parameters to dynamically generate an electronic fence, determine the boundary of the electronic fence, compare the predicted trajectory data with the boundary of the electronic fence in real time, and generate fence warning information;

[0190] The third unit is used to extract the target behavior feature vector based on the historical trajectory data entries in the trajectory database, classify the target behavior feature vector through a behavior recognition model, determine the behavior recognition result, detect the abnormal behavior of the target Bluetooth device based on a preset behavior feature library, and generate comprehensive warning information in combination with the fence warning information.

[0191] According to a third aspect of the embodiments of the present invention,

[0192] An electronic device is provided, comprising:

[0193] processor;

[0194] a memory for storing processor-executable instructions;

[0195] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0196] According to a fourth aspect of the embodiments of the present invention,

[0197] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.

[0198] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.

[0199] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for positioning, tracking and warning of Bluetooth signals, characterized in that: include: Receive the Bluetooth signal of the target Bluetooth device through a Bluetooth receiver, obtain signal broadcast packet data, generate corrected signal characteristic parameters based on the signal broadcast packet data through a signal attenuation compensation model, calculate the real-time position coordinates of the target Bluetooth device through a positioning algorithm based on the spatial position coordinates of the Bluetooth receiver and the corrected signal characteristic parameters, and form a trajectory data entry with the real-time position coordinates and the corrected signal characteristic parameters, and store them in a trajectory database; Based on the historical trajectory data entries in the trajectory database, a spatiotemporal graph convolutional neural network model is constructed and trained, and the predicted trajectory data is generated in combination with the latest trajectory data entries; based on the historical trajectory data entries, the activity law parameters of the target Bluetooth device are calculated, the activity law parameters are analyzed to dynamically generate an electronic fence, the boundary of the electronic fence is determined, and the predicted trajectory data is compared with the boundary of the electronic fence in real time to generate fence warning information; Obtain historical trajectory data entries of the target Bluetooth device, calculate the time interval and position coordinate difference between adjacent trajectory points in the historical trajectory data entries, identify the stay points and the moving segments, perform density clustering on the stay points to obtain an activity area set, extract movement trajectory features for the moving segments, and construct a connection relationship between the activity area sets; Divide a day into 24 time segments according to the hourly granularity, calculate the residence time ratio of the target Bluetooth device in each of the activity area sets in each time segment, construct a spatiotemporal activity intensity distribution matrix, perform feature decomposition on the spatiotemporal activity intensity distribution matrix through singular value decomposition to obtain activity law parameters, and construct a first-order Markov activity transfer matrix between the activity area sets based on the connection relationship; Based on the activity law parameters, determine the set of activity areas with activity intensity higher than a preset intensity threshold in the spatiotemporal activity intensity distribution matrix as the core activity area, use a convex hull scanning algorithm to take the minimum convex polygon of the core activity area as the first boundary, calculate the transition probability between the core activity areas based on the first-order Markov activity transition matrix, construct a connection channel between the core activity areas with a transition probability greater than a preset transition probability threshold, and obtain a second boundary, wherein the width of the connection channel is linearly positively correlated with the transition probability, and merge the first boundary with the second boundary to obtain an initial electronic fence boundary; The initial electronic fence boundary is simplified by using a curve simplification algorithm to obtain a simplified electronic fence boundary, and the simplified electronic fence boundary is smoothed by using cubic spline interpolation to obtain a final electronic fence boundary; Based on the historical trajectory data entries in the trajectory database, the target behavior feature vector is extracted, and based on the target behavior feature vector, classification is performed through a behavior recognition model to determine the behavior recognition result, and based on a preset behavior feature library, the abnormal behavior of the target Bluetooth device is detected, and comprehensive warning information is generated in combination with the fence warning information.

2. The method according to claim 1, characterized in that Based on the signal broadcast packet data, generating corrected signal characteristic parameters through a signal attenuation compensation model includes: Based on the signal broadcast packet data, extract the signal strength value and the signal quality index, calculate the median of multiple signal strength values, calculate the absolute difference between each signal strength value and the median, calculate the median of the absolute difference to obtain the degree of dispersion, compare the degree of dispersion with the dynamic threshold, eliminate abnormal signal strength values ​​that exceed the dynamic threshold range, and obtain a valid signal strength value; Collect actual signal strength values ​​and theoretical signal strength values ​​at a preset reference point, perform a difference operation on the actual signal strength values ​​and the theoretical signal strength values ​​to obtain an intensity deviation sample, perform a normality test on the intensity deviation sample, and use a maximum likelihood estimation method to calculate a deviation mean and a deviation standard deviation of the intensity deviation sample to obtain an intensity deviation characteristic value; Calculate the temperature influence factor according to the real-time temperature data, calculate the humidity influence factor according to the real-time humidity data, perform weighted correction on the intensity deviation characteristic value by using the temperature influence factor and the humidity influence factor to generate an environmental factor correction value; Measuring the propagation distance between the target Bluetooth device and the Bluetooth receiver, comparing the propagation distance with a preset reference distance, and when the propagation distance is less than or equal to the preset reference distance, calculating a first attenuation coefficient based on linear attenuation, and multiplying the first attenuation coefficient by the propagation distance to obtain a path loss value; when the propagation distance is greater than the preset reference distance, calculating a second attenuation coefficient based on logarithmic attenuation, and multiplying the second attenuation coefficient by a logarithmic value of the propagation distance to obtain the path loss value; A sliding time window is constructed at a preset reference point to record the data of changes in signal strength with distance, a relationship equation between signal strength and distance is established, the slope of the relationship equation is calculated by the least squares method to obtain a local path loss index, and an exponential smoothing method is used to update the local path loss index to a global path loss index; Calculate a theoretical signal strength reference value according to the global path loss index and the propagation distance, and add the theoretical signal strength reference value to the environmental factor correction value to obtain a preliminary corrected signal strength value; The preliminary corrected signal strength value is weightedly corrected by using the signal quality index to obtain a weighted corrected signal strength value, and the weighted corrected signal strength value is smoothed by using a Kalman filter method to generate a corrected signal characteristic parameter.

3. The method according to claim 1, characterized in that Based on the spatial position coordinates of the Bluetooth receiver and the corrected signal characteristic parameters, the real-time position coordinates of the target Bluetooth device are calculated through the positioning algorithm, including: Acquire the spatial position coordinates of at least three Bluetooth receivers and characteristic parameters of the correction signals received by each of the three Bluetooth receivers; continuously sample the characteristic parameters of the correction signals received by each of the three Bluetooth receivers to obtain signal strength time series data; divide the signal strength time series data into multiple time windows according to preset time intervals; In each of the time windows, wavelet transform is performed on the signal strength time series data to obtain frequency characteristics, and periodic fluctuation components in the signal are identified according to the frequency characteristics; Extracting corresponding features of the main signal path and the reflected signal path from the periodic fluctuation component to generate a signal path feature matrix; inputting the signal path feature matrix into a preset signal path classifier to determine the signal path with the largest intensity and the smallest fluctuation as the main signal path; calculating the distance value from each Bluetooth receiver to the target Bluetooth device according to the main signal path; and constructing a nonlinear equation group based on the distance value; Calculate the residual between the theoretical distance value and the actual distance value under the current position coordinate, calculate the gradient direction according to the residual, update the position coordinate with an adaptive step size along the gradient direction, and obtain the initial position coordinate; calculate the convergence index of the initial position coordinate, when the convergence index is greater than a preset threshold, increase the search range based on a preset search range increment, and recalculate the position coordinate; when the convergence index is less than the preset threshold, record the current position coordinate as a candidate solution; The candidate solutions obtained in the multiple time windows are weighted averaged to obtain the real-time position coordinates of the target Bluetooth device.

4. The method according to claim 1, characterized in that: Based on the historical trajectory data entries in the trajectory database, a spatiotemporal graph convolutional neural network model is constructed and trained, and combined with the latest trajectory data entries, the predicted trajectory data is generated, including: Based on the historical trajectory data entries in the trajectory database, according to the preset sampling rules, the trajectory sampling points are determined, the real-time position coordinates and corresponding timestamps of the trajectory sampling points are extracted, the graph structure nodes are determined, and based on the spatiotemporal associations between adjacent graph structure nodes, the graph structure edges are determined to construct the spatiotemporal graph structure; Calculate the spatial distance between adjacent graph structure nodes in the spatiotemporal graph structure, substitute the spatial distance into a Gaussian kernel function to obtain a spatial weight, calculate the time interval between adjacent graph structure nodes, substitute the time interval into an exponential decay function to obtain a temporal weight, and use the product of the spatial weight and the temporal weight as an edge weight; Sliding window segmentation is performed on the graph structure nodes in the spatiotemporal graph structure, and the instantaneous velocity vector corresponding to the graph structure node is calculated in each sliding window, and the inner product of adjacent instantaneous velocity vectors is divided by the vector modulus to obtain the direction change rate, and the node whose direction change rate is greater than a preset direction change rate threshold is marked as a turning point; The trajectory segments between the turning points are regarded as activity segments, the duration and spatial distribution of each activity segment are calculated, and the probability density distribution of the activity segment in the time dimension and the spatial dimension is calculated by the kernel density estimation method; Performing a graph convolution operation on the spatiotemporal graph structure, constructing a weighted adjacency matrix based on edge weights and probability density distribution, calculating a normalized Laplace matrix based on the weighted adjacency matrix, recursively calculating Chebyshev polynomials of different orders, and using the product of the linear combination of the Chebyshev polynomials and the normalized Laplace matrix as a graph convolution kernel, spatially aggregating node features, and obtaining graph convolution aggregation features; Construct an attention calculation unit, map the node features corresponding to the current moment into a query vector, map the node features of the historical moments into a key vector and a value vector, calculate the similarity between the query vector and the key vector, obtain an attention score, normalize the attention score to obtain an attention weight, and use the weighted sum of the attention weight and the value vector as the temporal attention feature; concatenate the graph convolution aggregation feature with the temporal attention feature, input the pre-trained prediction network, and generate predicted trajectory data.

5. The method according to claim 1, characterized in that The convex hull scanning algorithm is used to take the minimum convex polygon of the core activity area as the first boundary including: Determine the lowest point of the core activity area according to the coordinate position as the starting area, calculate the angle of other core activity areas based on the starting area, sort the core activity areas in ascending order according to the angle to obtain an ordered core activity area sequence, push the starting area to the bottom of the stack, and push the areas in the ordered core activity area sequence into the stack in sequence, for each core activity area to be pushed into the stack, determine the cross product between the two vectors formed by the two core activity areas at the top of the stack, and when the cross product is a negative value, pop the core activity area at the top of the stack until the cross product is a positive value, and finally the core activity areas retained in the stack are sequentially connected to form a first boundary; The curve simplification algorithm includes: Connect the starting point and the end point of the initial electronic fence boundary to form a baseline; calculate the vertical distance from each point on the initial electronic fence boundary to the baseline, obtain the point with the largest vertical distance, determine the vertex, determine the first vector based on the vertex to the starting point, determine the second vector based on the vertex to the end point, and calculate the angle between the first vector and the second vector; When the maximum value of the vertical distance is less than the first preset threshold value determined based on the total length of the initial electronic fence boundary, and the angle is less than the second preset threshold value, the starting point and the end point of the baseline are retained; otherwise, the initial electronic fence boundary is divided into two segments according to the point corresponding to the maximum value of the vertical distance, and it is determined whether the length of the segment is less than the third preset threshold value. If it is less than the third preset threshold value, the endpoint of the segment is directly retained. If it is greater than or equal to the third preset threshold value, the corresponding segment is repeatedly processed until the maximum values ​​of the vertical distances corresponding to all segments are less than the first preset threshold value, and the corresponding angles are less than the second preset threshold value, and the endpoints of all retained segments are connected in sequence according to the order of the initial electronic fence boundary points to obtain a simplified electronic fence boundary.

6. The method according to claim 1, characterized in that Based on the historical trajectory data entries in the trajectory database, extracting the target behavior feature vector, classifying through the behavior recognition model based on the target behavior feature vector, determining the behavior recognition result, detecting the abnormal behavior of the target Bluetooth device based on the preset behavior feature library, and generating comprehensive warning information in combination with the fence warning information, including: Obtain historical trajectory data entries in a trajectory database, calculate the time interval and activity duration between adjacent trajectory points in the historical trajectory data entries, extract the activity frequency in each time interval to form a time feature, and calculate the displacement distance, movement speed and trajectory turning angle between adjacent trajectory points to form a spatial feature; A dual-channel deep neural network model including a first channel, a second channel and a classifier is constructed, wherein the first channel includes a long short-term memory network layer and a fully connected layer, and the second channel includes three convolutional layers and a fully connected layer; the time feature is input into the first channel, and the sequence correlation, periodic fluctuation law and long-term activity pattern of the time feature are extracted through the long short-term memory network layer, and the results are transmitted to the fully connected layer to obtain the time behavior representation; the spatial feature is input into the second channel, and the trajectory morphology, movement trend and regional migration characteristics of the spatial feature are extracted in turn through the three convolutional layers, and the results are transmitted to the fully connected layer to obtain the spatial behavior representation; the variance contribution rate of each dimension in the time behavior representation and the variance contribution rate of each dimension in the spatial behavior representation are calculated respectively, and the time behavior representation and the spatial behavior representation are adaptively weighted fused according to the variance contribution rate to obtain the target behavior feature vector; the target behavior feature vector is input into the classifier, and the probability distribution of different behavior categories is calculated through the softmax function, and the category with the highest probability is selected as the behavior category and the corresponding probability value is used as the confidence probability to obtain the behavior recognition result; Read the standard behavior pattern stored in a preset behavior feature library, wherein the standard behavior pattern includes the time regularity and spatial regularity of normal behavior, match the behavior recognition result with the standard behavior pattern, calculate the time deviation value and spatial deviation value of the behavior recognition result relative to the standard behavior pattern, and determine the abnormality score according to the time deviation value and the spatial deviation value; receive fence warning information, extract the position and time information in the fence warning information, and when the abnormality score exceeds a preset abnormality threshold, combine the behavior recognition result, the abnormality score, the position information and the time information to generate a comprehensive warning information.

7. A positioning and tracking warning system for Bluetooth signals, used to implement the method according to any one of claims 1 to 6, characterized in that: include: The first unit is used to receive the Bluetooth signal of the target Bluetooth device through the Bluetooth receiver, obtain the signal broadcast packet data, generate the corrected signal characteristic parameters based on the signal broadcast packet data through the signal attenuation compensation model, calculate the real-time position coordinates of the target Bluetooth device through the positioning algorithm based on the spatial position coordinates of the Bluetooth receiver and the corrected signal characteristic parameters, and form the real-time position coordinates and the corrected signal characteristic parameters into a trajectory data entry, and store it in a trajectory database; The second unit is used to build and train a spatiotemporal graph convolutional neural network model based on the historical trajectory data entries in the trajectory database, and generate predicted trajectory data in combination with the latest trajectory data entries; based on the historical trajectory data entries, calculate the activity law parameters of the target Bluetooth device, analyze the activity law parameters to dynamically generate an electronic fence, determine the boundary of the electronic fence, compare the predicted trajectory data with the boundary of the electronic fence in real time, and generate fence warning information; The third unit is used to extract the target behavior feature vector based on the historical trajectory data entries in the trajectory database, classify the target behavior feature vector through a behavior recognition model, determine the behavior recognition result, detect the abnormal behavior of the target Bluetooth device based on a preset behavior feature library, and generate comprehensive warning information in combination with the fence warning information.

8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • An indoor positioning method and system based on Bluetooth

    CN109936837A

  • Aircraft dynamic geographic information fence dividing method based on airspace gridding

    CN118506619A