Terminal device position discrimination system and method based on LSTM
Through the terminal device position discrimination system based on LSTM, combined with dynamic time regularization and multi-layer perception machines, the accuracy problem of traditional positioning technology in complex environments is solved, high-precision positioning in weak signal coverage areas is achieved, and the accuracy and stability of terminal device position discrimination is improved.
Patent Information
- Application Number
- CN202510787063.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-06-13
AI Technical Summary
The existing terminal equipment positioning technology has low positioning accuracy in dynamic and complex environments, especially in areas with weak signal coverage, and traditional methods cannot effectively process signal sequences of different sampling frequencies and variable lengths, resulting in large or failure of positioning errors.
The terminal equipment position discrimination system based on LSTM is adopted to extract signal characteristics through access to a directional antenna, perform dynamic time regularization pre-processing, combine LSTM network and CNN network to extract timing and spectrum characteristics, combine multi-layer perceptron for position regression, and dynamically expand the positioning range when the signal is weakly covered, and the COST-HATA model and maximum likelihood estimation method are used to correct the distance error, and online positioning is used indoors using weighted K nearest neighbor algorithm.
It improves positioning accuracy and stability in complex environments, can achieve high-precision positioning in weak signal coverage areas, breaks through the limitations of fixed input dimensions of traditional models, makes full use of the complementary advantages of multi-source data, and improves the precision of indoor and outdoor position discrimination.
Smart Images

Figure CN120302237A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of position discrimination, and specifically to a terminal device position discrimination system and method based on LSTM. Background Art
[0002] In the context of the rapid development of the Internet of Things and intelligent terminals, precise terminal device position discrimination technology has become a key requirement in fields such as security monitoring, intelligent transportation, and emergency rescue. Currently, the mainstream terminal device position discrimination methods mainly include outdoor positioning technology based on satellite positioning systems and indoor positioning technology based on Wi-Fi fingerprints, Bluetooth beacons, and cellular networks. However, these technologies have many limitations in practical applications.
[0003] Traditional positioning technologies are sensitive to environmental changes. For example, the movement of objects in the indoor environment and weather changes in the outdoor scene will significantly affect the signal quality, resulting in an increase in positioning errors and making it difficult to meet the stable positioning requirements in dynamic and complex environments. Existing methods mostly use fixed-dimensional feature extraction and simple matching algorithms, which cannot effectively process signal sequences with different sampling frequencies and variable lengths, and are difficult to fully extract the temporal and spatial features in the signals. In areas with weak signal coverage, traditional methods cannot obtain sufficient positioning information due to insufficient signal strength and a small number of effective base stations, often resulting in positioning failures or excessive errors. Summary of the Invention
[0004] The purpose of the present invention is to provide a terminal device position discrimination system and method based on LSTM to solve the problems proposed in the prior art.
[0005] To achieve the above purpose, the present invention provides the following technical solutions: In the first aspect, the present application provides a terminal device position discrimination method based on LSTM, including the following steps: Connect to a directional antenna, extract signal features, perform dynamic time warping preprocessing, and obtain an RSSI sequence; Construct an LSTM network. The input layer receives the RSSI sequence. The LSTM layer uses a bidirectional LSTM. Add a one-dimensional convolutional layer after the LSTM layer to extract local temporal features and integrate the attention mechanism. Use the LSTM network for indoor and outdoor position classification, obtain a spectrogram and input it into the CNN network to extract spectrogram features, splice them with the local temporal features, and input them into a multi-layer perceptron for final position regression to output the terminal device position; When the RSSI signal strength collected by the directional antenna is lower than a preset threshold, dynamically expand the positioning range centered on the terminal device position according to the signal strength; When the terminal device is outdoors, all detected base station information within the extended positioning range is extracted, and the main serving base station is screened to construct a base station coordinate set; the path loss is calculated using the COST-HATA model, and combined with the RSSI sequence, the distances from the terminal device to each base station are inversely deduced; the maximum likelihood estimation method is used to solve the position coordinates of the terminal device, and the signal fluctuation period is introduced to correct the distance error. When the terminal device is indoors, an indoor signal fingerprint library is constructed, dynamic time warping matching is performed, and the weighted K-nearest neighbor algorithm is used for online positioning to obtain the corrected position of the terminal device. Based on the corrected position of the terminal device, when the continuous positioning error is greater than the threshold, the directional antenna angle is automatically adjusted, and the signal search process is restarted.
[0006] Combined with the first aspect, in the first implementation manner of the first aspect of this application, the access directional antenna extracts signal features and performs dynamic time warping preprocessing to obtain the RSSI sequence, including: Initialize the directional antenna, start the mobile phone signal detection function, enter the search mode, for each detected signal source, extract signal features, including physical layer features, network layer features, and signal strength features; establish a time series sampling for each signal source to obtain the RSSI sequence of each signal source. Perform Z-score normalization on the RSSI sequence of each signal source, and select the RSSI sequence of the signal source with the highest signal-to-noise ratio as the reference template; for each RSSI sequence to be aligned, use the dynamic time warping algorithm to calculate the optimal alignment path for feature enhancement.
[0007] Combined with the first aspect, in the second implementation manner of the first aspect of this application, the construction of the LSTM network, the input layer receives the RSSI sequence, the LSTM layer uses bidirectional LSTM, and a one-dimensional convolutional layer is added after the LSTM layer to extract local temporal features, integrating the attention mechanism, including: At the input layer, input tensor dimensions, add mask marks to the positions filled with zeros in the preprocessing, and receive the RSSI sequence; the LSTM layer uses bidirectional LSTM, set the number of hidden units and the initial bias of the forget gate, the forward LSTM captures past temporal information, the backward LSTM captures future temporal information, and the outputs of the forward and backward LSTMs are concatenated in the feature dimension for regularization; set the number of convolutional kernels, the size of the convolutional kernels, and the stride of the one-dimensional convolutional layer, the padding method is same, and the activation function is LeakyReLU; integrate the attention mechanism, which is specifically implemented as multi-head self-attention, perform linear transformations on queries, keys, and values, calculate attention weights, and perform residual connection and layer normalization.
[0008] Combined with the first aspect, in the third implementation manner of the first aspect of the present application, for indoor and outdoor location classification using an LSTM network, obtaining a spectrogram and inputting it into a CNN network, extracting spectrogram features, concatenating with local temporal features, and inputting into a multi-layer perceptron for final location regression to output the location of the terminal device, it includes: Input the preprocessed RSSI sequence into the trained LSTM network, extract the feature vector output by the attention mechanism, output the probability distributions of indoor and outdoor through a softmax classifier. When the probability distribution of indoor is greater than 50%, it is determined to be indoor, otherwise it is determined to be outdoor; perform confidence evaluation; perform time consistency check to verify signal features; Start the spectrum analyzer to extract the spectrogram; in the CNN network, input the spectrogram, set the loss function as the contrast loss, perform triplet sampling and data augmentation; extract the feature vector output by the global average pooling layer, perform feature dimensionality reduction and feature normalization to obtain the spectrogram features; concatenate the local temporal features with the spectrogram features, perform weighted fusion to obtain the fused features; input the fused features into the multi-layer perceptron, construct the first hidden layer and the second hidden layer, and the fused features are directly connected to the second hidden layer; in the output layer, for the indoor scenario, it is a three-dimensional vector, specifically the coordinates of x, y, and z, and for the outdoor scenario, it is a two-dimensional vector, specifically the longitude and latitude, and the activation function is selected as tanh; perform location regression optimization to output the location of the terminal device.
[0009] Combined with the first aspect, in the fourth implementation manner of the first aspect of the present application, when the RSSI signal strength collected by the directional antenna is lower than the preset threshold, the positioning range is dynamically expanded centered on the location of the terminal device, including: In the outdoor scenario, reverse calculate the maximum communication distance based on the COST-HATA path loss model to obtain the expansion radius; in the indoor scenario, centered on the building where the terminal device is located, expand according to the floor height and wall penetration loss, specifically including horizontal expansion and vertical expansion; adjust the parameters of the directional antenna to strengthen the signal; based on the electronic map data, exclude the unreachable areas, and perform DBSCAN clustering on all signal sources within the expanded area; output a circular area centered on the longitude and latitude in the indoor scenario, and output a rectangular area in the building coordinate system in the outdoor scenario.
[0010] Combined with the first aspect, in the fifth implementation manner of the first aspect of the present application, when the terminal device is outdoors, extract all detected base station information within the expanded positioning range, and screen the main serving base stations to construct a base station coordinate set, including: Sort all detected base stations in descending order of received reference signal power, and preferentially select the candidate base station with the strongest signal. The 5G base station has the highest priority. Ensure that the candidate base stations are spatially distributed in a scattered manner. Calculate the azimuth difference between candidate base stations, and eliminate the base stations with an angle difference less than the set threshold from the selected base stations, and retain at least w base stations, where w is a positive integer set by the user. When the number of 5G base stations is insufficient, supplement 4G base stations. Query the operator's public location database through the cell ID and tracking area code to obtain the longitude and latitude coordinates of the base station. Convert the longitude and latitude coordinates of the base station to the local Cartesian coordinate system to construct a base station coordinate set.
[0011] Combined with the first aspect, in the sixth implementation manner of the first aspect of this application, the method for calculating the path loss using the COST-HATA model and inversely inferring the distance from the terminal device to each base station in combination with the RSSI sequence includes: Determine the frequency range applicable to the COST-HATA model. According to the building density and distribution characteristics, divide the environmental types into dense urban areas, general urban areas, suburban areas, and rural areas. Set the base station antenna height and mobile station antenna height, and configure the frequency correction factor according to the environmental type. Match the terminal device location with the electronic map and automatically determine the environmental type according to the building density. Calculate the basic path loss according to the signal frequency, base station height, and distance. For different environmental types and antenna heights, apply the correction formula based on the frequency correction factor to adjust the basic path loss. When the signal frequency exceeds the default range, linearly adjust the basic path loss. Use the sliding window averaging method to smooth the RSSI sequence. Calculate the theoretical received power according to the base station transmission power, base station antenna gain, and terminal antenna gain. Inversely infer the distance from the terminal device to each base station through the relationship between the RSSI value and the theoretical received power in the RSSI sequence.
[0012] Combined with the first aspect, in the seventh implementation manner of the first aspect of this application, the method for solving the terminal device position coordinates using the maximum likelihood estimation method and introducing the signal fluctuation period to correct the distance error includes: Express the distance from the terminal device to each base station as the sum of the true distance and the measurement error. The measurement error is assumed to follow a Gaussian distribution with a zero mean, and the variance is related to the signal strength fluctuation. Based on the distance and the Gaussian distribution, construct a likelihood function, which represents the probability of observing the current distance given the terminal device position. Convert the likelihood function to a log-likelihood function. Perform Fourier transform on the RSSI sequence, convert it to the frequency domain, identify the main peaks in the spectrum, and determine the dominant frequency of signal fluctuations; calculate the dominant period of signal fluctuations as an environmental characteristic parameter, and extract the maximum value, minimum value, and change rate of signal strength within the dominant period; establish a mapping relationship between the signal fluctuation period and the measurement error; divide the signal fluctuation period into short periods, medium periods, and long periods, and apply different error correction strategies for different period ranges; calculate a correction coefficient based on the signal fluctuation period and the signal strength change rate, where the correction coefficient is inversely proportional to the length of the signal fluctuation period and directly proportional to the signal strength change rate; correct the distance from the inferred terminal device to each base station based on the correction coefficient, and the corrected distance is equal to the original distance multiplied by the correction coefficient.
[0013] Combined with the first aspect, in the eighth implementation manner of the first aspect of the present application, when the terminal device is indoors, an indoor signal fingerprint database is constructed, dynamic time warping matching is performed, and the weighted K-nearest neighbor algorithm is used for online positioning to obtain the corrected position of the terminal device, including: Divide the indoor area into regular grids and set the grid spacing; perform multi-signal source collection, construct a time series, perform feature extraction and preprocessing, and construct an indoor signal fingerprint database; The terminal device collects a signal sequence in real time, with the collection duration being the same as that of the fingerprint database, and constructs an online signal sequence; calculate the DTW distance between the online signal sequence and each reference point signal sequence in the fingerprint database, where the DTW distance measures the similarity between two time series; while calculating the DTW distance, record the optimal alignment path; Select the value of K according to the environmental complexity, and screen the K reference points with the smallest DTW distance as neighbors; calculate the weights based on the reciprocal of the DTW distance, with the closer distance having a greater weight; perform a weighted average on the coordinates of the K neighbors to obtain the corrected position of the terminal device.
[0014] In a second aspect, the present application provides a terminal device position discrimination system based on LSTM, including: A signal collection module: including a signal feature extraction unit and an RSSI sequence generation unit; wherein, the signal feature extraction unit accesses a directional antenna to extract signal features, and the RSSI sequence generation unit performs dynamic time warping preprocessing to obtain an RSSI sequence; Terminal device location acquisition module: It includes: an LSTM network construction unit, a location classification unit, and a terminal device location acquisition unit; among them, the LSTM network construction unit constructs an LSTM network, the input layer receives the RSSI sequence, the LSTM layer uses bidirectional LSTM, a one-dimensional convolutional layer is added after the LSTM layer to extract local temporal features and integrate the attention mechanism; the location classification unit uses the LSTM network for indoor and outdoor location classification, and the terminal device location acquisition unit acquires the spectrogram and inputs it into the CNN network to extract the spectrogram features, splices them with the local temporal features, and inputs them into a multi-layer perceptron for final location regression to output the terminal device location; Positioning range extension module: It includes: a positioning range extension unit; among them, when the RSSI signal strength collected by the directional antenna is lower than the preset threshold, the positioning range extension unit dynamically extends the positioning range centered on the terminal device location according to the signal strength; Outdoor location correction module: It includes: a base station coordinate set construction unit, a distance inverse deduction unit, and a distance error correction unit; among them, when the terminal device is outdoors, the base station coordinate set construction unit extracts all detected base station information within the extended positioning range and filters the main serving base station to construct a base station coordinate set; the distance inverse deduction unit uses the COST-HATA model to calculate the path loss, combines it with the RSSI sequence, and inversely deduces the distance from the terminal device to each base station; the distance error correction unit uses the maximum likelihood estimation method to solve the terminal device position coordinates and introduces the signal fluctuation period to correct the distance error; Indoor location correction module: It includes: a fingerprint database construction unit and a terminal device location correction unit; among them, when the terminal device is indoors, the fingerprint database construction unit constructs an indoor signal fingerprint database, and the terminal device location correction unit performs dynamic time warping matching and uses the weighted K-nearest neighbor algorithm for online positioning to obtain the corrected terminal device location; Correction execution module: It includes: an antenna angle adjustment unit and a signal search process restart unit; among them, based on the corrected terminal device location, when the continuous positioning error is greater than the threshold, the antenna angle adjustment unit automatically adjusts the directional antenna angle, and the signal search process restart unit restarts the signal search process.
[0015] Compared with the prior art, the beneficial effects of the present invention are: 1. Through the gating mechanism of the LSTM neural network, the present invention can dynamically capture the long-term and short-term temporal dependencies of the RSSI sequence, and combined with the dynamic time warping preprocessing technology, it realizes the unified feature encoding of sequences with different sampling frequencies and variable lengths, breaks through the limitation of the fixed input dimension of the traditional model, and significantly improves the accuracy of signal feature extraction.
[0016] 2. The present invention constructs an LSTM network structure including a temporal feature enhancement layer, integrates an attention mechanism, automatically weights the signal strength features of key time points, and suppresses environmental noise interference. At the same time, the temporal features extracted by LSTM are deeply fused with the spectral map spatial features extracted by CNN, and position regression is achieved through a multi-layer perceptron, giving full play to the complementary advantages of multi-source data and improving the accuracy of indoor and outdoor position discrimination.
[0017] 3. The present invention designs a dynamic range expansion and sub-scenario positioning strategy for weak signal coverage scenarios. When the signal strength is insufficient, the system automatically expands the positioning range centered on the terminal position, and according to the differences between indoor and outdoor scenarios, respectively adopts optimized algorithms for base station trilateration positioning and Wi-Fi fingerprint matching, and combines signal propagation models and historical data for error correction to ensure high-precision positioning in complex environments. Brief Description of the Drawings
[0018] Figure 1 is a schematic diagram of the steps of a method for discriminating the position of a terminal device based on LSTM according to the present invention; Figure 2 is a system structure diagram of a system for discriminating the position of a terminal device based on LSTM according to the present invention. Detailed Embodiments
[0019] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0020] Embodiment: As Figure 1 - Figure 2 shown, the present invention provides a technical solution, As Figure 1 shown in the schematic diagram of the steps of a method for discriminating the position of a terminal device based on LSTM, the present application provides a method for discriminating the position of a terminal device based on LSTM, including the following steps: Step S100: Access a directional antenna, extract signal features, and perform dynamic time warping preprocessing to obtain an RSSI sequence; Specifically, initialize the directional antenna, start the mobile phone signal detection function, enter the search mode, extract signal features for each detected signal source, including physical layer features, network layer features, and signal strength features; establish a time series sampling for each signal source to obtain the RSSI sequence of each signal source; Perform Z-score normalization on the RSSI sequences of each signal source, and select the RSSI sequence of the signal source with the highest signal-to-noise ratio as the reference template; for each RSSI sequence to be aligned, use the dynamic time warping algorithm to calculate the optimal alignment path for feature enhancement.
[0021] Step S200: Construct an LSTM network. The input layer receives the RSSI sequence. The LSTM layer uses bidirectional LSTM. Add a one-dimensional convolutional layer after the LSTM layer to extract local temporal features and integrate the attention mechanism; use the LSTM network for indoor and outdoor location classification, obtain the spectrogram and input it into the CNN network to extract the spectrogram features, splice them with the local temporal features, and input them into a multi-layer perceptron for final location regression to output the location of the terminal device. Specifically, at the input layer, input the tensor dimension, add mask tags to the positions filled with zeros during preprocessing, and receive the RSSI sequence; the LSTM layer uses bidirectional LSTM, set the number of hidden units and the initial bias of the forget gate. The forward LSTM captures past temporal information, and the backward LSTM captures future temporal information. Concatenate the outputs of the forward and backward LSTMs in the feature dimension for regularization; set the number of convolutional kernels, the size of the convolutional kernels, and the stride of the one-dimensional convolutional layer, with the padding method being same and the activation function being LeakyReLU; integrate the attention mechanism, specifically implemented as multi-head self-attention, perform linear transformations on the query, key, and value, calculate the attention weights, and perform residual connection and layer normalization.
[0022] Furthermore, input the preprocessed RSSI sequence into the trained LSTM network, extract the feature vector output by the attention mechanism, and output the probability distributions of indoor and outdoor through a softmax classifier. When the probability distribution of indoor is greater than 50%, it is determined to be indoor, otherwise it is determined to be outdoor; perform confidence evaluation; perform time consistency check to verify the signal features. Start the spectrum analyzer to extract the spectrogram; in the CNN network, input the spectrogram, set the loss function as the contrastive loss, perform triplet sampling and data augmentation; extract the feature vector output by the global average pooling layer, perform feature dimensionality reduction and feature normalization to obtain the spectrogram features; splice the local temporal features with the spectrogram features and perform weighted fusion to obtain the fused features; input the fused features into the multi-layer perceptron, construct the first hidden layer and the second hidden layer, and directly connect the fused features to the second hidden layer; in the output layer, for the indoor scene, it is a three-dimensional vector, specifically the coordinates of x, y, and z, and for the outdoor scene, it is a two-dimensional vector, specifically the longitude and latitude. Select the tanh activation function; perform location regression optimization to output the location of the terminal device.
[0023] In a specific embodiment, in the LSTM network, the tensor dimensions of the input layer are: [batch_size = 64, time_steps = 100, features = 5]. The masking mechanism is as follows: boolean masks are added to the positions filled with zeros during preprocessing (such as sequences shorter than 100 steps) to prevent the model from learning invalid values. The number of hidden units in the bidirectional LSTM layer is 128, and the initial bias of the forget gate is set to -1.0 to enhance gradient stability. The forward and backward LSTM outputs are concatenated in the feature dimension (the dimension becomes 128×2 = 256), and 20% Dropout regularization is applied. For the one-dimensional convolutional layer, the number of convolutional kernels is set to 64, with a size of 7×1 (capturing local features of 7 consecutive time steps), a stride of 1, and padding of same to maintain the sequence length. The activation function is LeakyReLU (α = 0.1) to alleviate the vanishing gradient problem.
[0024] The multi-head self-attention mechanism is introduced, with the number of heads set to 8 and the dimension of each head being 64. Queries (Q), keys (K), and values (V) are mapped through independent weight matrices. Weight calculation is performed using scaled dot-product attention. Residual connections and layer normalization are carried out to avoid gradient decay and improve training stability. When the RSSI sequence inside the mall is input, the indoor probability output by the model is 98.2%; in the outdoor parking lot scenario, the outdoor probability is 97.5%.
[0025] In the CNN network, the input dimension of the spectrogram is: [64×128×3] (RGB three channels, power density mapped to color values). Data augmentation is performed, including randomly rotating by ±15°, scaling by 0.9 - 1.1 times, and adjusting brightness by ±20% to improve the generalization ability of the model.
[0026] In the network structure, Convolution Block 1: 64 3×3 convolutional kernels, stride 2, output 32×64×64, activation function ReLU. Convolution Block 2: 128 3×3 convolutional kernels, stride 2, output 16×32×128, activation function ReLU. A 256-dimensional feature vector is output, and after dimensionality reduction, it is compressed to 128 dimensions through PCA.
[0027] For indoor spectrograms: The peaks of Wi-Fi signals in the high-frequency bands (2.4 GHz / 5 GHz) are obvious, and the features extracted by CNN include the hotspot distribution pattern. For outdoor spectrograms: Cellular signals in the low-frequency bands (800 MHz / 1800 MHz) are dominant, and the features reflect the distribution characteristics of macro base stations.
[0028] Feature fusion is carried out. The LSTM temporal features are 128-dimensional (output of the attention mechanism), and the CNN spectral features are 128-dimensional (after dimensionality reduction). The dimension after concatenation is 256-dimensional.
[0029] The first hidden layer of the multi-layer perceptron has 256 neurons with the Swish activation function. The second hidden layer has 128 neurons with the ReLU activation function, receiving fused features and residual connections. In the output layer, for indoor, the 3D coordinates (x, y, z) are normalized to [-1, 1] by tanh, and mapped to the actual building coordinate system (error ≤ 3 meters). For outdoor, the 2D longitude and latitude are mapped to [-1, 1] by tanh, and the error is ≤ 5 meters after inverse normalization. The optimizer is AdamW (learning rate 0.001, weight decay 0.0001), and it converges after 200 epochs of training. For a test point in a store, the predicted coordinates are (12.5m, 8.2m, 3rd floor), and the actual coordinates are (12.1m, 8.5m, 3rd floor), with a horizontal error of 0.4 meters and the floor is correct. For a test point in the parking lot, the predicted longitude and latitude are (30.1234°, 120.5678°), and the actual value is (30.1230°, 120.5682°), with an error of 3.8 meters.
[0030] Step S300: When the RSSI signal strength collected by the directional antenna is lower than the preset threshold, the positioning range is dynamically expanded centered on the position of the terminal device according to the signal strength; Specifically, in the outdoor scenario, the maximum communication distance is calculated backward based on the COST-HATA path loss model to obtain the expansion radius; in the indoor scenario, centered on the building where the terminal device is located, it is expanded according to the floor height and wall penetration loss, specifically including horizontal expansion and vertical expansion; the parameters of the directional antenna are adjusted to strengthen the signal; based on the electronic map data, inaccessible areas are excluded, and DBSCAN clustering is performed on all signal sources within the expanded area; a circular area centered on the longitude and latitude is output in the indoor scenario, and a rectangular area in the building coordinate system is output in the outdoor scenario.
[0031] In a specific embodiment, the outdoor weak coverage area is an urban canyon, with a distance of 30 meters between two high-rise buildings, both with a height of 150 meters, and the average RSSI is -95dBm, lower than the preset threshold of -90dBm. The indoor weak coverage area is the B2 floor of the underground parking lot, without windows, with a wall thickness of 50cm, and the average RSSI is -100dBm. The initial LSTM positioning is (30.1230°, 120.5670°), with a confidence level of 0.55 (low confidence level). The initial LSTM positioning is at a certain coordinate (5.2m, 8.7m) on the first floor of the shopping mall, but the signal characteristics indicate that it may span floors (RSSI fluctuation > 15dB).
[0032] In the outdoor scenario, the maximum communication distance is calculated based on the COST-HATA model. The calculated distance is 280 meters. Then, the extended radius is taken as the smaller value between the lowest preset distance of 500 meters and 2 * 280 meters, which is 500 meters. The gain is increased from 25 dBi to 30 dBi, the scanning step angle is reduced from 5° to 2°, and the scanning time is extended to 60 seconds. The high-rise areas on both sides of the canyon are excluded, and the roads and open spaces are retained. After DBSCAN clustering, 5 base stations are retained, and the azimuth angles are distributed at 120°, 180°, 240°, 300°, and 360°, with a uniform coverage range. A circular area with a radius of 500 meters centered on the initial coordinates contains 3 effective base stations (RSRP > -95 dBm).
[0033] In the indoor scenario, horizontal expansion: radius 50 meters, vertical expansion: expand 2 floors upward (from the 1st floor to the 3rd floor) and 2 floors downward (from the 1st floor to the B1 floor), with a total coverage of 5 floors (from the B2 floor to the 3rd floor). The trigger condition is: detecting 3 Wi-Fi signals with the same SSID and an intensity difference of 18 dB, which is determined to be likely to cross floors. Switch to the 2.4 GHz frequency band, increase the gain to 33 dBi, and focus on scanning the directions of the ceiling and the elevator shaft. Based on the shopping mall electronic map, the areas inaccessible by walls and the elevator shaft are excluded, and the corridors, shops, and stairwells are retained. After DBSCAN clustering, 4 Wi-Fi hotspot clusters are identified, corresponding to the 1st floor lobby, 2nd floor restaurant, B1 parking lot, and B2 equipment room respectively. The expanded area is: a rectangular area in the shopping mall building coordinate system (x ∈ [-50m, 50m], y ∈ [-50m, 50m], z ∈ [-10m, 15m]), covering 5 floors of space.
[0034] For the outdoor scenario, before expansion: only 1 base station is detected, and the positioning error is 48 meters. After expansion: 3 base stations are obtained, and the triangulation positioning error is reduced to 5.2 meters. For the indoor scenario, before expansion: relying on the fingerprint database of the 1st floor, the positioning error is 12 meters (actually located on the B1 floor). After expansion: fusing the fingerprints of the B1 floor, the WKNN matching error is 1.8 meters, and the floor is correctly identified.
[0035] Step S400: When the terminal device is outdoors, extract all detected base station information within the extended positioning range, screen the primary service base stations to construct a base station coordinate set; calculate the path loss using the COST-HATA model, and combine the RSSI sequence to reverse-infer the distances from the terminal device to each base station; use the maximum likelihood estimation method to solve the position coordinates of the terminal device, and introduce the signal fluctuation period to correct the distance error; Specifically, sort all detected base stations according to the received power of reference signals from high to low, and preferentially select the candidate base station with the strongest signal. The 5G base station has the highest priority. Ensure that the candidate base stations are spatially dispersed, calculate the azimuth difference between the candidate base stations, and eliminate the base stations with an angle difference less than the set threshold from the selected base stations, and at least retain w base stations, where w is a positive integer set by the user. When the number of 5G base stations is insufficient, supplement 4G base stations. Query the operator's public location database through the cell ID and tracking area code to obtain the longitude and latitude coordinates of the base station; convert the longitude and latitude coordinates of the base station into the local Cartesian coordinate system to construct a base station coordinate set.
[0036] Furthermore, determine the frequency range applicable to the COST-HATA model. According to the building density and distribution characteristics, classify the environmental types into dense urban areas, general urban areas, suburbs, and rural areas; set the base station antenna height and mobile station antenna height, and configure the frequency correction factor according to the environmental type; match the terminal device location with the electronic map and automatically determine the environmental type according to the building density; calculate the basic path loss according to the signal frequency, base station height, and distance; for different environmental types and antenna heights, apply the correction formula based on the frequency correction factor to adjust the basic path loss; when the signal frequency exceeds the default range, linearly adjust the basic path loss. Use the sliding window averaging method to smooth-filter the RSSI sequence; calculate the theoretical received power according to the base station transmission power, base station antenna gain, and terminal antenna gain; invert the distance from the terminal device to each base station through the relationship between the RSSI value and the theoretical received power in the RSSI sequence.
[0037] Furthermore, represent the distance from the terminal device to each base station as the sum of the true distance and the measurement error; assume that the measurement error follows a Gaussian distribution with zero mean, and the variance is related to the signal strength fluctuation; based on the distance and the Gaussian distribution, construct a likelihood function, which represents the probability of observing the current distance given the terminal device location; convert the likelihood function into a log-likelihood function. Perform a Fourier transform on the RSSI sequence to convert it to the frequency domain, identify the main peaks in the spectrum, and determine the dominant frequency of the signal fluctuation; calculate the dominant period of the signal fluctuation as an environmental characteristic parameter, and extract the maximum value, minimum value, and change rate of the signal strength within the dominant period; establish a mapping relationship between the signal fluctuation period and the measurement error; divide the signal fluctuation period into short periods, medium periods, and long periods, and apply different error correction strategies in different period ranges; calculate the correction coefficient according to the signal fluctuation period and the signal strength change rate, where the correction coefficient is inversely proportional to the signal fluctuation period length and directly proportional to the signal strength change rate; correct the inverted distance from the terminal device to each base station based on the correction coefficient, and the corrected distance is equal to the original distance multiplied by the correction coefficient.
[0038] In a specific embodiment, arranged in descending order of RSRP: 5G base station A (RSRP = -85 dBm), 5G base station B (-88 dBm), LTE base station C (-90 dBm), 5G base station D (-92 dBm), LTE base station E (-95 dBm), LTE base station F (-98 dBm), GSM base station G (-102 dBm), LTE base station H (-105 dBm). Preferentially retain 5G base stations: Select the first 3 5G base stations (A, B, D), and the RSRP of all is > -92 dBm.
[0039] Perform azimuth detection. For base stations A (azimuth 45°), B (135°), D (270°), the angular differences are 90°, 135°, 180° respectively, all of which are greater than the threshold of 30°, meeting the dispersion requirement. Finally, 3 base stations are retained, and the quantity meets the minimum requirement for trilateration (w = 3).
[0040] Query the operator database to obtain the longitude and latitude, and convert them to the local Cartesian coordinate system.
[0041] Perform distance back-calculation using the COST-HATA model. The environment type is a dense urban area (C = 3 dB), the base station antenna height = 40 meters (updated value in the database, not the default 30 meters), and the mobile station height = 1.5 meters. The frequency range is: the frequency of 5G base stations is 3500 MHz, which exceeds the default 2000 MHz of the model and requires linear extension correction. Taking base station A as an example, the basic path loss is calculated as , where . Perform frequency extension correction, .
[0042] The transmitting power of the base station is 43 dBm, the antenna gain is 18 dBi, and the terminal gain is 3 dBi. Then the theoretical received power is 64 - L. Given the measured RSSI = -85 dBm, we get: d is approximately 150 meters.
[0043] Perform Fourier transform on the RSSI sequence (100 sampling points) of base station A, and identify the dominant frequency as 0.5 Hz (period 2 seconds), belonging to the medium period (1 - 5 seconds). The signal strength change rate within the period: the maximum value is -80 dBm, the minimum value is -90 dBm, and the change rate = 5 dB / second. Calculate the error correction coefficient, and the corrected distance is 187.5 meters.
[0044] Establish a log-likelihood function and iteratively solve to obtain the terminal coordinates: (x = 92 m, y = 88 m), which are converted to longitude and latitude as (30.1238°, 120.5679°).
[0045] Step S500: When the terminal device is indoors, build an indoor signal fingerprint library, perform dynamic time warping matching, and use the weighted K-nearest neighbor algorithm for online positioning to obtain the corrected position of the terminal device. Specifically, divide the indoor area into regular grids and set the grid spacing; perform multi-signal source collection, construct time series, perform feature extraction and preprocessing, and build an indoor signal fingerprint library. The terminal device collects signal sequences in real time, with the collection duration being the same as that of the fingerprint library, and constructs an online signal sequence; calculate the DTW distance between the online signal sequence and the signal sequences of each reference point in the fingerprint library. The DTW distance measures the similarity of two time series; while calculating the DTW distance, record the optimal alignment path. Select the value of K according to the environmental complexity, and screen the K reference points with the smallest DTW distance as neighbors; calculate the weights based on the reciprocal of the DTW distance, and the closer the distance, the greater the weight; perform weighted averaging on the coordinates of the K neighbors to obtain the corrected position of the terminal device.
[0046] In a specific embodiment, the grid spacing is 1.5 m × 1.5 m, and about 2,200 reference points are deployed in total. The collection device is a smartphone (supporting Wi-Fi and Bluetooth), staying at each reference point for 10 seconds, and collecting signals at 100 ms intervals. The signal sources are 15 stable Wi-Fi access points (signal strength > -85 dBm) and 5 Bluetooth beacons. Each time series contains 100 sampling points (10 s × 10 Hz), and statistical features such as mean, standard deviation, skewness, and kurtosis are extracted. Construct a feature vector for each access point: [MAC address, RSSI mean, RSSI standard deviation, signal fluctuation frequency].
[0047] The fingerprint features of reference point P1(5.0 m, 3.0 m) are as follows: AP1 (MAC: 12:34): RSSI mean = -75 dBm, standard deviation = 3 dB, fluctuation frequency = 0.2 Hz. AP2 (MAC: 56:78): RSSI mean = -82 dBm, standard deviation = 5 dB, fluctuation frequency = 0.1 Hz.
[0048] Calculate the DTW distance between point Q and reference point P1 in the fingerprint library: Sequence length: Both are 100 points.
[0049] Local cost function: Euclidean distance |Q_i - P1_j|.
[0050] Cumulative cost matrix: C[100×100], using Sakoe-Chiba band constraint (bandwidth = 5).
[0051] Optimal path: Record the path with the minimum cumulative cost, and the path curvature = 1.2 (indicating the stretching degree of the time axis).
[0052] Final DTW distance: D(Q, P1) = 18.5 dB.
[0053] Calculate the DTW distances between point Q and all reference points in the fingerprint database. Some of the results are as follows: D(Q, P1) = 18.5 dB, D(Q, P2) = 22.3 dB, D(Q, P3) = 15.7 dB, D(Q, P4) = 28.9 dB, D(Q, P5) = 19.8 dB.
[0054] Set K = 5 according to the environmental complexity. The 5 reference points with the smallest DTW distances are {P3, P1, P5, P2, P6}. Calculate the weights based on the reciprocals of the DTW distances: W3 = 1 / 15.7 = 0.064, W1 = 1 / 18.5 = 0.054, W5 = 1 / 19.8 = 0.051, W2 = 1 / 22.3 = 0.045, W6 = 1 / 24.1 = 0.041. Normalize the weights: W3 = 0.286, W1 = 0.240, W5 = 0.227, W2 = 0.201, W6 = 0.183.
[0055] The coordinates of the reference points are: P3(7.5 m, 4.0 m), P1(5.0 m, 3.0 m), P5(8.0 m, 5.5 m), P2(6.5 m, 2.5 m), P6(9.0 m, 4.5 m). The weighted calculation is: x = 7.5×0.286 + 5.0×0.240 + 8.0×0.227 + 6.5×0.201 + 9.0×0.183 ≈ 7.32 m. y = 4.0×0.286 + 3.0×0.240 + 5.5×0.227 + 2.5×0.201 + 4.5×0.183 ≈ 4.05 m.
[0056] The final positioning result is: Coordinates of point Q = (7.32 m, 4.05 m).
[0057] Step S600: Based on the corrected position of the terminal device, when the continuous positioning error is greater than the threshold, automatically adjust the orientation antenna angle and restart the signal search process.
[0058] As Figure 2 As shown in the system structure diagram of a terminal device location discrimination system based on LSTM, the present application provides a terminal device location discrimination system based on LSTM, including: Signal acquisition module: including: a signal feature extraction unit and an RSSI sequence generation unit; among them, the signal feature extraction unit accesses the directional antenna to extract signal features, and the RSSI sequence generation unit performs dynamic time warping preprocessing to obtain the RSSI sequence; Terminal device location acquisition module: It includes: an LSTM network construction unit, a location classification unit, and a terminal device location acquisition unit; among them, the LSTM network construction unit constructs an LSTM network, the input layer receives the RSSI sequence, the LSTM layer uses bidirectional LSTM, and a one-dimensional convolutional layer is added after the LSTM layer to extract local temporal features and integrate the attention mechanism; the location classification unit uses the LSTM network for indoor and outdoor location classification, and the terminal device location acquisition unit acquires the spectrogram and inputs it into the CNN network, extracts the spectrogram features, splices them with the local temporal features, inputs them into a multi-layer perceptron for final location regression, and outputs the terminal device location; Location range expansion module: It includes: a location range expansion unit; among them, when the RSSI signal strength collected by the directional antenna is lower than the preset threshold, the location range expansion unit dynamically expands the location range centered on the terminal device location according to the signal strength; Outdoor location correction module: It includes: a base station coordinate set construction unit, a distance back-calculation unit, and a distance error correction unit; among them, when the terminal device is outdoors, the base station coordinate set construction unit extracts all detected base station information within the expanded location range and filters the main serving base station to construct a base station coordinate set; the distance back-calculation unit uses the COST-HATA model to calculate the path loss, combines it with the RSSI sequence, and back-calculates the distance from the terminal device to each base station; the distance error correction unit uses the maximum likelihood estimation method to solve the location coordinates of the terminal device and introduces the signal fluctuation period to correct the distance error; Indoor location correction module: It includes: a fingerprint database construction unit and a terminal device location correction unit; among them, when the terminal device is indoors, the fingerprint database construction unit constructs an indoor signal fingerprint database, and the terminal device location correction unit performs dynamic time warping matching and uses the weighted K-nearest neighbor algorithm for online location to obtain the corrected terminal device location; Correction execution module: It includes: an antenna angle adjustment unit and a signal search process restart unit; among them, based on the corrected terminal device location, when the continuous location error is greater than the threshold, the antenna angle adjustment unit automatically adjusts the angle of the directional antenna, and the signal search process restart unit restarts the signal search process.
[0059] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present invention. Any reference signs in the claims should not be regarded as limiting the claims involved.
Claims
1. A method for determining the location of a terminal device based on LSTM, characterized in that, It includes the following steps: Connect to a directional antenna, extract signal features, perform dynamic time warping preprocessing, and obtain an RSSI sequence; Construct an LSTM network. The input layer receives the RSSI sequence. The LSTM layer uses bidirectional LSTM. Add a one-dimensional convolutional layer after the LSTM layer to extract local temporal features and integrate the attention mechanism. Use the LSTM network for indoor and outdoor location classification, obtain a spectrogram and input it into the CNN network to extract spectrogram features, splice them with the local temporal features, and input them into a multi-layer perceptron for final location regression to output the location of the terminal device; When the RSSI signal strength collected by the directional antenna is lower than the preset threshold, dynamically expand the positioning range centered on the location of the terminal device; When the terminal device is outdoors, extract all detected base station information within the expanded positioning range, screen the main serving base station to construct a base station coordinate set; use the COST-HATA model to calculate the path loss, and combine it with the RSSI sequence to inversely infer the distance from the terminal device to each base station; Use the maximum likelihood estimation method to solve the location coordinates of the terminal device, and introduce the signal fluctuation period to correct the distance error; When the terminal device is indoors, construct an indoor signal fingerprint library, perform dynamic time warping matching, and use the weighted K-nearest neighbor algorithm for online positioning to obtain the corrected location of the terminal device; Based on the corrected location of the terminal device, when the continuous positioning error is greater than the threshold, automatically adjust the angle of the directional antenna and restart the signal search process.
2. The method for determining the position of a terminal device based on LSTM according to claim 1, wherein The connection to the directional antenna, extraction of signal features, and performance of dynamic time warping preprocessing to obtain an RSSI sequence include: Initialize the directional antenna, start the mobile phone signal detection function, enter the search mode, for each detected signal source, extract signal features including physical layer features, network layer features, and signal strength features; establish a time series sampling for each signal source to obtain the RSSI sequence of each signal source; Perform Z-score normalization on the RSSI sequence of each signal source, and select the RSSI sequence of the signal source with the highest signal-to-noise ratio as the reference template; for each RSSI sequence to be aligned, use the dynamic time warping algorithm to calculate the optimal alignment path for feature enhancement.
3. A method for determining the position of a terminal device based on LSTM according to claim 1, wherein The construction of the LSTM network, where the input layer receives the RSSI sequence, the LSTM layer uses bidirectional LSTM, and a one-dimensional convolutional layer is added after the LSTM layer to extract local temporal features and integrate the attention mechanism, includes: Input the tensor dimension in the input layer, add mask markers to the positions filled with zeros in the preprocessing, and receive the RSSI sequence; the LSTM layer uses bidirectional LSTM, set the number of hidden units and the initial bias of the forget gate, the forward LSTM captures past temporal information, the backward LSTM captures future temporal information, splice the outputs of the forward and backward LSTMs in the feature dimension for regularization; set the number of convolutional kernels, the size of the convolutional kernel, and the stride of the one-dimensional convolutional layer, the padding method is same, and the activation function is LeakyReLU; integrate the attention mechanism, which is specifically implemented as multi-head self-attention, perform linear transformation of queries, keys, and values, calculate the attention weights, and perform residual connection and layer normalization.
4. A method for determining the location of a terminal device based on LSTM according to claim 1, wherein, The indoor and outdoor location classification using an LSTM network, obtaining a spectrogram and inputting it into a CNN network, extracting spectrogram features, concatenating them with local temporal features, and inputting them into a multi-layer perceptron for final location regression to output the location of the terminal device, includes: Input the preprocessed RSSI sequence into the trained LSTM network, extract the feature vector output by the attention mechanism, and output the probability distributions of indoor and outdoor through a softmax classifier. When the probability distribution of indoor is greater than 50%, it is determined as indoor, otherwise it is determined as outdoor; conduct confidence evaluation; conduct time consistency check to verify signal features. Start the spectrum analyzer to extract the spectrogram; in the CNN network, input the spectrogram, set the loss function as contrastive loss, conduct triplet sampling and data augmentation; extract the feature vector output by the global average pooling layer, conduct feature dimensionality reduction and feature normalization to obtain the spectrogram features; concatenate the local temporal features and the spectrogram features, conduct weighted fusion to obtain the fused features; input the fused features into the multi-layer perceptron, construct the first hidden layer and the second hidden layer, and directly connect the fused features to the second hidden layer; in the output layer, for the indoor scenario, it is a three-dimensional vector, specifically the coordinates of x, y, and z, and for the outdoor scenario, it is a two-dimensional vector, specifically the longitude and latitude. Select the tanh activation function; conduct location regression optimization to output the location of the terminal device.
5. A method for determining the position of a terminal device based on LSTM according to claim 1, characterized in that, When the RSSI signal strength collected by the directional antenna is lower than the preset threshold, the positioning range is dynamically expanded centered on the location of the terminal device, including: In the outdoor scenario, calculate the maximum communication distance based on the COST-HATA path loss model in reverse to obtain the expansion radius; in the indoor scenario, centered on the building where the terminal device is located, expand according to the floor height and wall penetration loss, specifically including horizontal expansion and vertical expansion; adjust the parameters of the directional antenna to strengthen the signal; based on the electronic map data, exclude inaccessible areas and conduct DBSCAN clustering on all signal sources within the expanded area; output a circular area centered on the longitude and latitude in the indoor scenario and a rectangular area in the building coordinate system in the outdoor scenario.
6. The method for determining the position of a terminal device based on LSTM according to claim 1, characterized in that, When the terminal device is outdoors, extract all detected base station information within the expanded positioning range, and screen the primary serving base station to construct a base station coordinate set, including: Sort all detected base stations according to the reference signal received power from high to low, and preferentially select the candidate base station with the strongest signal. 5G base stations have the highest priority; ensure that the candidate base stations are spatially distributed in a scattered manner, calculate the azimuth difference between the candidate base stations, and exclude the base stations with an angle difference less than the set threshold from the selected base stations, and retain at least w base stations, where w is a positive integer set by the user; when the number of 5G base stations is insufficient, supplement 4G base stations. Query the operator's public positioning database through the cell ID and tracking area code to obtain the longitude and latitude coordinates of the base station; convert the longitude and latitude coordinates of the base station into the local Cartesian coordinate system to construct a base station coordinate set.
7. A method for determining the location of a terminal device based on LSTM according to claim 1, characterized in that, Calculate the path loss using the COST-HATA model, and combine it with the RSSI sequence to inversely deduce the distance from the terminal device to each base station, including: Determine the frequency range applicable to the COST-HATA model. According to the building density and distribution characteristics, classify the environmental types into dense urban areas, general urban areas, suburban areas, and rural areas; set the base station antenna height and the mobile station antenna height, and configure the frequency correction factor according to the said environmental type; match the terminal device location with the electronic map, and automatically determine the environmental type according to the building density; calculate the basic path loss based on the signal frequency, base station height, and distance; for different environmental types and antenna heights, apply the correction formula based on the said frequency correction factor to adjust the basic path loss; when the signal frequency exceeds the default range, perform a linear adjustment on the basic path loss; Use the sliding window averaging method to smooth-filter the RSSI sequence; calculate the theoretical received power according to the base station transmit power, base station antenna gain, and terminal antenna gain; reverse-infer the distance from the terminal device to each base station through the relationship between the RSSI value and the theoretical received power in the RSSI sequence.
8. A method for determining the location of a terminal device based on LSTM according to claim 1, wherein, The method of using the maximum likelihood estimation method to solve the terminal device location coordinates and introducing the signal fluctuation period to correct the distance error includes: Express the distance from the terminal device to each base station as the sum of the true distance and the measurement error; assume that the measurement error follows a Gaussian distribution with zero mean, and the variance is related to the signal strength fluctuation; based on the distance and the Gaussian distribution, construct a likelihood function, which represents the probability of observing the current distance given the terminal device location; convert the likelihood function into a log-likelihood function; Perform a Fourier transform on the RSSI sequence, convert it to the frequency domain, identify the main peaks in the spectrum, and determine the dominant frequency of the signal fluctuation; calculate the dominant period of the signal fluctuation as an environmental characteristic parameter, and extract the maximum value, minimum value, and change rate of the signal strength within the dominant period; establish a mapping relationship between the signal fluctuation period and the measurement error; divide the signal fluctuation period into short periods, medium periods, and long periods, and apply different error correction strategies for different period ranges; calculate the correction coefficient according to the signal fluctuation period and the signal strength change rate, and the correction coefficient is inversely proportional to the signal fluctuation period length and directly proportional to the signal strength change rate; correct the distance from the reverse-inferred terminal device to each base station based on the correction coefficient, and the corrected distance is equal to the original distance multiplied by the correction coefficient.
9. A method for determining the location of a terminal device based on LSTM according to claim 1, wherein When the terminal device is indoors, construct an indoor signal fingerprint database, perform dynamic time warping matching, and use the weighted K-nearest neighbor algorithm for online positioning to obtain the corrected terminal device location, including: Divide the indoor area into regular grids and set the grid spacing; perform multi-signal source collection, construct a time series, perform feature extraction and preprocessing, and construct an indoor signal fingerprint database; The terminal device real-time collects a signal sequence, and the collection duration is the same as that of the fingerprint database to construct an online signal sequence; calculate the DTW distance between the online signal sequence and the signal sequence of each reference point in the fingerprint database, and the DTW distance measures the similarity between two time series; while calculating the DTW distance, record the optimal alignment path; Select the value of K according to the environmental complexity, and screen the K reference points with the smallest DTW distance as neighbors; calculate the weights based on the reciprocal of the DTW distance, and the closer the distance, the greater the weight; perform weighted averaging on the coordinates of the K neighbors to obtain the corrected position of the terminal device.
10. A terminal device location discrimination system based on LSTM, using a terminal device location discrimination method according to any one of claims 1-9, comprising: Signal acquisition module: comprising: a signal feature extraction unit and an RSSI sequence generation unit; wherein, the signal feature extraction unit accesses a directional antenna to extract signal features, and the RSSI sequence generation unit performs dynamic time warping preprocessing to obtain an RSSI sequence; Terminal device location acquisition module: comprising: an LSTM network construction unit, a location classification unit, and a terminal device location acquisition unit; wherein, the LSTM network construction unit constructs an LSTM network, the input layer receives the RSSI sequence, the LSTM layer uses bidirectional LSTM, and a one-dimensional convolutional layer is added after the LSTM layer to extract local temporal features and integrate the attention mechanism; the location classification unit uses the LSTM network to classify indoor and outdoor locations, and the terminal device location acquisition unit acquires the spectrogram and inputs it into the CNN network to extract spectrogram features, splices them with the local temporal features, and inputs them into a multi-layer perceptron for final position regression to output the position of the terminal device; Positioning range expansion module: comprising: a positioning range expansion unit; wherein, when the RSSI signal strength collected by the directional antenna is lower than a preset threshold, the positioning range expansion unit dynamically expands the positioning range centered on the position of the terminal device according to the signal strength; Outdoor position correction module: comprising: a base station coordinate set construction unit, a distance back-projection unit, and a distance error correction unit; wherein, when the terminal device is outdoors, the base station coordinate set construction unit extracts all detected base station information within the expanded positioning range and screens the main serving base station to construct a base station coordinate set; the distance back-projection unit calculates the path loss using the COST-HATA model and combines it with the RSSI sequence to back-project the distance from the terminal device to each base station; the distance error correction unit uses the maximum likelihood estimation method to solve the position coordinates of the terminal device and introduces a signal fluctuation period to correct the distance error; Indoor position correction module: comprising: a fingerprint database construction unit and a terminal device position correction unit; wherein, when the terminal device is indoors, the fingerprint database construction unit constructs an indoor signal fingerprint database, and the terminal device position correction unit performs dynamic time warping matching and uses the weighted K-nearest neighbor algorithm for online positioning to obtain the corrected position of the terminal device; Correction execution module: comprising: an antenna angle adjustment unit and a signal search process restart unit; wherein, based on the corrected position of the terminal device, when the continuous positioning error is greater than the threshold, the antenna angle adjustment unit automatically adjusts the angle of the directional antenna, and the signal search process restart unit restarts the signal search process.
Citation Information
Patent Citations
Indoor and outdoor seamless positioning system and method for intelligent mobile phone and mobile terminal
CN106255065A
Indoor terminal positioning method and related device
CN110493715A
Ultra-wideband indoor positioning method based on multi-mode diffusion model
CN119907098A
Power generation linkage system and method through ammonia heating for ammonia fuel propulsion ships
KR102750332B1