WiFi probe ping-pong data restoration method based on Transformers architecture

By using a WiFi probe ping-pong data reconstruction method based on the Transformers architecture, the problem of the ping-pong effect in WiFi positioning systems is solved, achieving high-precision and robust trajectory reconstruction and improving the accuracy and efficiency of the positioning system.

CN122054072APending Publication Date: 2026-05-15SOUTHEAST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511884948.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing WiFi positioning technologies suffer from insufficient sequential context awareness, poor adaptability to complex movement patterns, and limited generalization ability when facing the ping-pong effect, resulting in decreased positioning accuracy and failing to meet the high-precision requirements in high-density WiFi probe environments.

Method used

A WiFi probe ping-pong data reconstruction method based on the Transformers architecture is adopted. By constructing input and output data expressions, data preprocessing, WiFiTransformer model and composite loss function, the sequence translation of WiFi signal sequence to real trajectory is realized.

Benefits of technology

It effectively eliminates the ping-pong effect, improves the trajectory smoothness and accuracy of the positioning system at the boundary of the WiFi probe coverage area, enhances the ability to identify and reconstruct complex movement patterns, improves the robustness and generalization ability of the model, and reduces the consumption of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122054072A_ABST
    Figure CN122054072A_ABST
Patent Text Reader

Abstract

The invention discloses a WiFi probe ping-pong data restoration method based on a Transformers architecture. The method comprises the following steps: constructing expressions of input data and output data; wiFi probe ping-pong data are collected, and data preprocessing is carried out based on dynamic coordinate system normalization of a track center; constructing a WiFi Transform model, taking the preprocessed data as input, and mapping a high-dimensional vector output by a decoder into a two-dimensional coordinate in an output layer; a loss function is designed to carry out training on the WiFi Transform model; and realizing the reduction of the WiFi probe ping-pong data based on the trained model. According to the method, the WiFi probe data is restored into the real track data as a sequence-to-sequence translation process, so that the ping-pong effect problem in a WiFi positioning system is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of wireless local area network technology, and particularly relates to a method for restoring WiFi probe ping-pong data based on the Transformers architecture. Background Technology

[0002] With the widespread adoption of Wi-Fi technology, indoor positioning systems based on Wi-Fi signals have been widely used in shopping malls, hospitals, warehouses, and other similar settings. However, existing Wi-Fi positioning technologies face a common and challenging problem – the "ping-pong effect." When a mobile device (such as a Wi-Fi tag) moves at the boundary of the coverage area of ​​multiple Wi-Fi access points (APs), due to fluctuations in signal strength and the setting of reception thresholds, the system will alternately locate the device under different APs. This results in the recorded trajectory appearing as if it is jumping back and forth between two or more AP locations, rather than the actual continuous movement trajectory of the device.

[0003] In existing technologies, the following methods are commonly used to attempt to mitigate the ping-pong effect: Signal smoothing filtering: This involves smoothing the original signal using methods such as moving average and Kalman filtering. However, these methods often over-smooth the real motion details, leading to trajectory distortion, and cannot fundamentally solve the problem of sequence context correlation.

[0004] Threshold-based handover mechanisms: These mechanisms use signal strength or time thresholds to determine whether a genuine area handover has occurred. However, such static thresholds are ill-suited to the signal fluctuation characteristics under different environments and cannot accurately identify brief pauses of devices in boundary areas.

[0005] Traditional machine learning methods, such as Hidden Markov Models (HMM) and particle filtering, can improve localization results to some extent, but their ability to model long-distance dependencies is limited and they are unable to capture contextual information in complex movement patterns.

[0006] Early deep learning methods used recurrent neural networks (RNNs) or long short-term memory networks (LSTMs) for trajectory prediction, but these models suffer from gradient vanishing / exploding problems when dealing with long sequences, and have limited parallel computing capabilities, resulting in low training efficiency.

[0007] The methods described above generally suffer from insufficient awareness of sequence context, poor adaptability to complex movement patterns, and limited generalization ability, resulting in a severe decrease in positioning accuracy in high-density WiFi probe environments, and failing to meet the requirements of modern indoor positioning systems for high accuracy and high stability. Summary of the Invention

[0008] Purpose of the Invention: The purpose of this invention is to provide a method for restoring WiFi probe ping-pong data based on the Transformers architecture. By treating the restoration of WiFi probe data to real trajectory data as a sequence-to-sequence translation process, the ping-pong effect problem in WiFi positioning systems is effectively solved.

[0009] Technical solution: The present invention provides a method for restoring WiFi probe ping-pong data based on Transformers architecture, comprising the following steps: Step 1: Construct expressions for the input and output data; Step 2: Collect WiFi probe ping-pong data and perform data preprocessing based on dynamic coordinate system normalization of the trajectory center; Step 3: Construct the WiFiTransformer model, taking the preprocessed data as input, and mapping the high-dimensional vector output by the decoder to two-dimensional coordinates in the output layer; Step 4: Design a loss function to train the WiFiTransformer model; Step 5: Reconstruct the WiFi probe ping-pong data based on the trained model.

[0010] Further, step 1 specifically involves: constructing an input data sequence S_in = {x_1, x_2, ..., x_N} of variable length; where each element x_i is a quadruple (t_i, p_x, p_y, r_i), t_i is the timestamp of the signal being received, (p_x, p_y) are the physical space coordinates of the signal source probe, and r_i is the Received Signal Strength Indicator (RSSI); and constructing an output sequence S_out = {y_1, y_2, ..., y_M} of trajectory points aligned with the timestamp of the input signal; where each element y_j is a triple (t'_j, pos_x, pos_y), t'_j is the timestamp of the trajectory point, and (pos_x, pos_y) are the actual two-dimensional coordinates of the device at that timestamp.

[0011] Furthermore, step 2 specifically involves: adopting a dynamic coordinate system normalization strategy centered on the trajectory. First, centroid calculation is performed. For each independent training sample, i.e., a trajectory segment, the centroid (mean_x, mean_y) of all its true trajectory points (x, y) is calculated. Then, coordinate translation is performed, and the centroid coordinate is uniformly subtracted from all probe coordinates and trajectory coordinates in the sample, so that each trajectory segment is transformed into a relative coordinate system with itself as the origin.

[0012] Furthermore, step 3 specifically involves the WiFiTransformer model comprising an encoder, a decoder, and an output layer. The encoder is responsible for understanding the input WiFi signal sequence. In the input embedding layer, the input quadruple (t, p_x, p_y, r) is mapped into a high-dimensional vector through a linear layer. The timestamp t and coordinates (p_x, p_y) are normalized and embedded together with the RSSI value. A multi-head self-attention mechanism is constructed. For each signal point in the sequence, the self-attention mechanism simultaneously pays attention to all other signal points in the global scope. The decoder is responsible for generating a smooth sequence of trajectory points autoregressively. It constructs a cross-attention mechanism. When generating each trajectory point (pos_x, pos_y), the decoder reviews and queries all signal features output by the encoder. This allows the model to assign weights to all relevant historical signals when determining the current position. Based on mask self-attention, when predicting the position at time point t, it relies on the trajectory points generated before t to maintain the temporal causality of trajectory generation. The Output Layer maps the high-dimensional vector output by the decoder to two-dimensional coordinates (pos_x, pos_y).

[0013] Furthermore, step 4 specifically involves constructing a composite loss function L_total, which consists of two weighted parts: L_total = L_MSE + λ * L_velocity Where L_MSE is the mean square error loss, L_velocity is the velocity smoothness loss, and λ is a hyperparameter used to balance position accuracy and smoothness; L_MSE (mean squared error loss) is used to penalize the Euclidean distance between the predicted and true locations. It calculates the sum of squares of the differences between the predicted coordinates (pred_x, pred_y) and the true coordinates (true_x, true_y) at all timestamps, using the following formula: L_MSE = (1 / M) * Σ [ (pred_x_j - true_x_j)² + (pred_y_j - true_y_j)² ] Where M represents the total number of trajectory points in the output sequence S_out; j represents the index in the sequence, ranging from 1 to M; pred_x_j and pred_y_j represent the x-coordinate and y-coordinate predicted by the model at time step j, respectively; true_x_j and true_y_j represent the true x-coordinate and true y-coordinate at time step j, respectively; Σ represents the summation of all terms from j=1 to M; L_velocity velocity smoothness loss suppresses position jumps by penalizing unreasonable velocity abrupt changes in the predicted trajectory. It first calculates the velocity vectors between adjacent points in the predicted trajectory: v_pred_j = (pos_pred_j - pos_pred_j-1) / (t'_j - t'_j-1) Wherein, v_pred_j represents the predicted velocity vector at the j-th time step; pos_pred_j represents the predicted position coordinate vector (pred_x_j, pred_y_j) at the j-th time step; pos_pred_j-1 represents the predicted position coordinate vector at the (j-1)-th time step; t'_j and t'_j-1 represent the timestamps corresponding to the j-th and (j-1)-th trajectory points, respectively. Then, calculate the velocity vector v_true_j between adjacent points in the true trajectory, and calculate the sum of squares of the differences between the predicted velocity vector and the true velocity vector.

[0014] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method of the present invention.

[0015] The present invention also discloses a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps of the method of the present invention.

[0016] The present invention also discloses a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method of the present invention.

[0017] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: 1. This invention utilizes a specially designed Transformer architecture to accurately translate a discrete, asynchronous sequence of WiFi signal observations into a continuous, smooth sequence of physical space trajectories. It eliminates spurious position jumps caused by signal fluctuations and probe switching in WiFi probe data, restoring the device's true continuous movement trajectory. It improves the smoothness and accuracy of the positioning system's trajectory at the boundaries of WiFi probe coverage areas. It enhances the model's ability to identify and reconstruct complex movement patterns including brief stops, speed changes, and gradual turns. It fully utilizes the sparse, asynchronous, and noisy spatiotemporal context information in WiFi probe data to improve the robustness of trajectory reconstruction. Through a parallel training strategy, it improves model training efficiency and reduces computational resource consumption.

[0018] 2. High-precision trajectory reconstruction: This invention effectively eliminates the ping-pong effect by using an end-to-end sequence translation model combined with a trajectory-centered normalization strategy. The velocity smoothness loss in the composite loss function further ensures the physical authenticity of the trajectory, resulting in a significant reduction in the average RMSE (root mean square error).

[0019] 3. Strong context awareness: Transformer's global self-attention mechanism can penetrate noise and capture long-distance spatiotemporal dependencies. Even when faced with sparse and discontinuous data caused by asynchronous scanning and signal threshold filtering, the model can accurately infer the device's true motion intention in the probe boundary area and has excellent reconstruction capabilities for complex behaviors such as brief pauses and slow movements.

[0020] 4. Excellent generalization ability: Due to the use of a relative coordinate system and a high-fidelity data generation algorithm (simulating behaviors such as turning and stopping), the model learns generalized motion patterns rather than features specific to a particular scene. Therefore, the model of this invention can effectively generalize to unseen probe layouts and movement patterns.

[0021] 5. Highly efficient training and inference: Based on the inherent parallel computing capabilities of the Transformer architecture, this invention combines gradient accumulation and mixed precision training strategies to achieve a training speed far exceeding that of traditional RNN / LSTM models, while ensuring low-latency inference required for real-time localization. Attached Figure Description

[0022] Figure 1 This is a flowchart of the present invention. Detailed Implementation

[0023] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0024] This invention innovatively models the WiFi ping-pong data reconstruction problem as a spatiotemporal sequence translation task. Through a specially designed Transformer architecture, it accurately translates a discrete, asynchronous WiFi signal observation sequence into a continuous, smooth physical space trajectory sequence.

[0025] 1. Problem Modeling and Data Representation The core of this invention lies in the unique representation of input and output data to maximize the retention of key information needed to solve the ping-pong effect.

[0026] Input Sequence: A variable-length observation sequence S_in = {x_1, x_2, ..., x_N}. Each element x_i is a quadruple (t_i, p_x, p_y, r_i), representing: t_i: The timestamp when the signal was received.

[0027] (p_x, p_y): The physical spatial coordinates of the signal source probe. This design is a key innovation, as it transforms the abstract probe_id into concrete spatial information, enabling the model to directly understand the geographical origin of the signal and providing the physical basis for judging the ping-pong effect.

[0028] r_i: Received Signal Strength Indicator (RSSI). This sequence naturally reflects the asynchronous sampling characteristics caused by the different scan periods of each probe in the real world.

[0029] Output Sequence: A sequence of trajectory points S_out = {y_1, y_2, ..., y_M} aligned with the timestamps of the input signal. Each element y_j is a triple (t'_j, pos_x, pos_y), representing: t'_j: Timestamp of the trajectory point. (pos_x, pos_y): The actual two-dimensional coordinates of the device at that timestamp. Crucially, the output sequence's timestamp set {t'_j} is extracted and sorted from the unique timestamp set of the input sequence. This means the model is trained to accurately interpolate and calculate the device's true position at every valid signal observation, thus directly establishing an instantaneous mapping between signal and position.

[0030] 2. Data Preprocessing and Coordinate System Normalization To eliminate absolute positional bias between samples and enable the model to focus on learning relative motion patterns, this invention employs a trajectory-centered dynamic coordinate system normalization strategy: Centroid calculation: For each independent training sample (i.e. a trajectory segment), calculate the geometric center (centroid) (mean_x, mean_y) of all its true trajectory points (x, y).

[0031] Coordinate translation: Subtract the centroid coordinate from all probe coordinates and trajectory coordinates in the sample.

[0032] This operation transforms each trajectory segment into a relative coordinate system with itself as the origin. This frees the model from dependence on absolute geographical location, greatly enhancing its generalization ability across different regions and probe deployments. All subsequent calculations are performed within this relative coordinate system.

[0033] 3. Model Architecture Design The WiFiTransformer model used in this invention has a core innovation in utilizing the self-attention mechanism of Transformer to address the sparsity, asynchronicity, and spatiotemporal dependence of WiFi signals.

[0034] Encoder: Responsible for understanding the input WiFi signal sequence.

[0035] Input embedding layer: The input quadruple (t, p_x, p_y, r) is mapped to a high-dimensional vector through a linear layer. The timestamp t and coordinates (p_x, p_y) are normalized and embedded together with the RSSI value.

[0036] Multi-Head Self-Attention: This is key to addressing the ping-pong effect. For each signal point in the sequence, the self-attention mechanism can simultaneously focus on all other signal points globally. For example, when a signal point indicates that a device is moving close to probe A, and the following signal point indicates that a device suddenly jumps to probe B, the self-attention mechanism can review earlier signal history and find that the device had been moving smoothly towards probe A. Based on this global context, the model can determine that the jump to probe B is an anomalous ping-pong effect, thereby suppressing this noise in the internal representation and enhancing the representation of the mainstream trend.

[0037] Decoder: Responsible for generating a smooth sequence of trajectory points autoregressively.

[0038] Cross-Attention: When generating each trajectory point (pos_x, pos_y), the decoder reviews and queries all signal features from the encoder output. This allows the model to dynamically assign weights to all relevant historical signals when determining the current position. For example, even if the latest signal comes from a distant probe B (which might be a ping-pong signal), if the signal sequence from probe A is more temporally and spatially coherent in the global context of the encoder output, cross-attention will assign higher weights to the features relevant to probe A, thus generating a continuous and smooth trajectory point closer to A.

[0039] Masked Self-Attention: ensures that when predicting the position at time point t, it can only rely on trajectory points generated before t, thus maintaining the temporal causality of trajectory generation.

[0040] Output Layer: A simple linear layer that maps the high-dimensional vector output by the decoder to two-dimensional coordinates (pos_x, pos_y).

[0041] 4. Loss Function Design To ensure that the generated trajectory achieves optimal accuracy in both position and kinematic rationality, this invention proposes a compound loss function, L_total, which consists of two weighted components: L_total = L_MSE + λ * L_velocity 1. Mean Squared Error Loss (MSE Loss, L_MSE): Definition: This is the primary loss term, used to penalize the Euclidean distance between the predicted and true locations. It calculates the sum of squares of the differences between the predicted coordinates (pred_x, pred_y) and the true coordinates (true_x, true_y) across all timestamps.

[0042] Formula: L_MSE = (1 / M) * Σ [ (pred_x_j - true_x_j)² + (pred_y_j - true_y_j)² ] Purpose: This loss function directly optimizes the model's localization accuracy, ensuring that each generated point is as close as possible to the actual location. This is the foundation of trajectory reconstruction tasks.

[0043] 2. Velocity Smoothness Loss (L_velocity): Definition: This is one of the innovative aspects of this invention, used to ensure the physical realism of the trajectory. It suppresses position jumps by penalizing unreasonable velocity abrupt changes in the predicted trajectory.

[0044] Calculate the velocity vector between adjacent points in the predicted trajectory: v_pred_j = (pos_pred_j - pos_pred_j-1) / (t'_j - t'_j-1). Calculate the velocity vector between adjacent points in the true trajectory: v_true_j.

[0045] L_velocity calculates the sum of squares of the differences between the predicted velocity vector and the actual velocity vector.

[0046] Purpose: This loss function acts as a kinematic regularization term, caring not only about "where" but also "how to get there." When the model attempts to generate a sudden positional jump (i.e., produce a very large instantaneous velocity) in response to a ping-pong signal, L_velocity incurs a significant penalty, forcing the model to generate a more kinematically coherent and smoother trajectory. λ is a hyperparameter used to balance positional accuracy and smoothness.

[0047] 5. High-fidelity training data generation algorithm To enable the model to learn the complexities of the real world, this invention employs a unique data generation algorithm based on physics and behavioral simulation, whose non-general characteristics are reflected in: Trajectory simulation including stationary behavior: The simulated object is brought into a random stop state lasting 2-8 seconds with a preset probability (PROB_TO_STOP). This allows the model to learn to distinguish between real stationary behavior and signal loss, which is key to reconstructing complex trajectories.

[0048] Motion model with steering constraints: When moving towards the target point, the model's steering angle is limited to a reasonable range (e.g., 60 degrees) and a small random perturbation is added. This avoids unrealistic instantaneous sharp turns and generates smoother turning trajectories that are more consistent with human or vehicle behavior.

[0049] Asynchronous probe scan simulation: Each probe is assigned an independent scan period (SCAN_MEAN, SCAN_VAR) that fluctuates around the mean. This directly reproduces the real physical processes that lead to data sparsity and irregularity at the data source.

[0050] Threshold-based signal filtering: This simulates the behavior of real devices, discarding weak signals below a certain strength (RSSI_THRESHOLD). This increases the discontinuity of the input sequence, placing higher demands on the robustness of the model. Example

[0051] This embodiment uses the following steps to generate and preprocess training data: Probe layout simulation: Randomly generate 3-5 WiFi probe positions, ensuring that the distance between adjacent probes is within 10-20 meters, to simulate a real indoor environment.

[0052] Trajectory generation: Simulate the movement of the device within 120 seconds with a time step of 0.5 seconds. The device speed varies randomly within the range of 0.8-2.0 m / s. Simulate short-term dwell behavior (probability 2%, dwell time 2-8 seconds). Introduce path loss model and signal noise (standard deviation 2.0 dBm). Dataset partitioning: 1000 samples in the training set, 100 samples in the validation set, and 100 samples in the test set; Normalization: Calculate the mean (-58.7) and standard deviation (8.3) of the RSSI for the entire training set, calculate the mean (60.2) and standard deviation (35.1) of the timestamps, and calculate the mean (0.0) and standard deviation (12.4) of the coordinates.

[0053] Z-score normalization is applied: x' = (x - μ) / σ; 2. Model Implementation Details Model parameter configuration: d_model = 256 (feature dimension), nhead = 8 (number of attention heads). num_encoder_layers = 6 (number of encoder layers), num_decoder_layers = 6 (number of decoder layers), dim_feedforward = 1024 (dimension of feedforward network), dropout = 0.15 (dropout rate).

[0054] Training configuration: Batch size: 128 (on GPU), base learning rate: 0.0001, maximum learning rate: 0.001, warm-up period: 10 epochs, total training epochs: 500, gradient clipping threshold: 0.5, gradient accumulation steps: 2.

[0055] 3. Training and Assessment Process Training phase: AdamW optimizer used, weight decay 0.01; loss function: mean squared error (MSE); checkpoints saved every 5 epochs; early stopping mechanism: if the loss does not improve after 50 consecutive epochs, the training phase ends. Evaluation phase: Calculate RMSE (Root Mean Square Error) on the test set; visualize the predicted trajectory and compare it with the actual trajectory; calculate the minimum, maximum, average, and median errors; Example results: Test set mean RMSE: 1.23 m; best sample RMSE: 0.47 m; worst sample RMSE: 2.85 m; median RMSE: 1.12 m.

Claims

1. A method for restoring WiFi probe ping-pong data based on Transformers architecture, characterized in that, Includes the following steps: Step 1: Construct expressions for the input and output data; Step 2: Collect WiFi probe ping-pong data and perform data preprocessing based on dynamic coordinate system normalization of the trajectory center; Step 3: Construct the WiFiTransformer model, taking the preprocessed data as input, and mapping the high-dimensional vector output by the decoder to two-dimensional coordinates in the output layer; Step 4: Design a loss function to train the WiFiTransformer model; Step 5: Reconstruct the WiFi probe ping-pong data based on the trained model.

2. The WiFi probe ping-pong data reconstruction method based on Transformers architecture according to claim 1, characterized in that, Step 1 specifically involves: constructing an input data sequence S_in = {x_1, x_2, ..., x_N} of variable length; where each element x_i is a quadruple (t_i, p_x, p_y, r_i), where t_i is the timestamp of the received signal, (p_x, p_y) are the physical space coordinates of the signal source probe, and r_i is the Received Signal Strength Indicator (RSSI); and constructing an output sequence S_out = {y_1, y_2, ..., y_M} of trajectory points aligned with the timestamps of the input signal; where each element y_j is a triple (t'_j, pos_x, pos_y), where t'_j is the timestamp of the trajectory point, and (pos_x, pos_y) are the actual two-dimensional coordinates of the device at that timestamp.

3. The WiFi probe ping-pong data reconstruction method based on Transformers architecture according to claim 1, characterized in that, Step 2 specifically involves: adopting a dynamic coordinate system normalization strategy centered on the trajectory. First, centroid calculation is performed. For each independent training sample, i.e., a trajectory segment, the centroid (mean_x, mean_y) of all its true trajectory points (x, y) is calculated. Then, coordinate translation is performed, and the centroid coordinate is subtracted from all probe coordinates and trajectory coordinates in the sample, so that each trajectory segment is transformed into a relative coordinate system with itself as the origin.

4. The WiFi probe ping-pong data reconstruction method based on Transformers architecture according to claim 1, characterized in that, Step 3 specifically involves the WiFiTransformer model, which includes an encoder, a decoder, and an output layer. The encoder is responsible for understanding the input WiFi signal sequence. In the input embedding layer, the input quadruple (t, p_x, p_y, r) is mapped into a high-dimensional vector through a linear layer. The timestamp t and coordinates (p_x, p_y) are normalized and embedded together with the RSSI value. A multi-head self-attention mechanism is constructed. For each signal point in the sequence, the self-attention mechanism simultaneously pays attention to all other signal points in the global scope. The decoder is responsible for generating a smooth sequence of trajectory points in an autoregressive manner and constructing a cross-attention mechanism. When generating each trajectory point (pos_x, pos_y), the decoder reviews and queries all signal features output by the encoder, enabling the model to assign weights to all relevant historical signals when determining the current position. Based on masked self-attention, when predicting the position at time point t, it relies on the trajectory points generated before t to maintain the temporal causality of trajectory generation; The Output Layer maps the high-dimensional vector output by the decoder to two-dimensional coordinates (pos_x, pos_y).

5. The WiFi probe ping-pong data reconstruction method based on Transformers architecture according to claim 1, characterized in that, Step 4 specifically involves constructing a composite loss function L_total, which consists of two weighted parts: L_total = L_MSE + λ * L_velocity Where L_MSE is the mean square error loss, L_velocity is the velocity smoothness loss, and λ is a hyperparameter used to balance position accuracy and smoothness; L_MSE (mean squared error loss) is used to penalize the Euclidean distance between the predicted and true locations. It calculates the sum of squares of the differences between the predicted coordinates (pred_x, pred_y) and the true coordinates (true_x, true_y) at all timestamps, using the following formula: L_MSE = (1 / M) * Σ [ (pred_x_j - true_x_j)² + (pred_y_j - true_y_j)² ] Where M represents the total number of trajectory points in the output sequence S_out; j represents the index in the sequence, ranging from 1 to M; pred_x_j and pred_y_j represent the x-coordinate and y-coordinate predicted by the model at time step j, respectively; true_x_j and true_y_j represent the true x-coordinate and true y-coordinate at time step j, respectively; Σ represents the summation of all terms from j=1 to M; L_velocity velocity smoothness loss suppresses position jumps by penalizing unreasonable velocity abrupt changes in the predicted trajectory. It first calculates the velocity vectors between adjacent points in the predicted trajectory: v_pred_j = (pos_pred_j - pos_pred_j-1) / (t'_j - t'_j-1) Wherein, v_pred_j represents the predicted velocity vector at the j-th time step; pos_pred_j represents the predicted position coordinate vector (pred_x_j, pred_y_j) at the j-th time step; pos_pred_j-1 represents the predicted position coordinate vector at the (j-1)-th time step; t'_j and t'_j-1 represent the timestamps corresponding to the j-th and (j-1)-th trajectory points, respectively. Then, calculate the velocity vector v_true_j between adjacent points in the true trajectory, and calculate the sum of squares of the differences between the predicted velocity vector and the true velocity vector.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method of claim 1.

7. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method of claim 1.

8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method of claim 1.