Carrier dynamic yaw angle calculation method based on Transform structure
By combining a single GNSS antenna with an inertial measurement unit and a Transformer model, the area and electromagnetic interference problems of the dual GNSS antenna scheme were solved, and high-precision calculation of the carrier yaw angle was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 深圳市飞思通信技术有限公司
- Filing Date
- 2025-12-24
- Publication Date
- 2026-04-28
AI Technical Summary
In the existing technology, the dual GNSS antenna scheme occupies a large area in phased array equipment, is sensitive to electromagnetic interference, and is costly. The single GNSS antenna has drift error when calculating the heading angle.
By using a deep learning model combining a single GNSS antenna with an inertial measurement unit and a Transformer structure, and training with multi-source sensor data, temporal features are extracted and interference factors are separated to calculate the dynamic yaw angle of the carrier.
It reduces the number of hardware components and installation space, lowers equipment complexity, and improves the accuracy of yaw angle calculation, especially under complex motion conditions.
Smart Images

Figure CN121933005A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of phased array antenna communication technology, specifically to a method for calculating the dynamic yaw angle of a carrier based on a Transformer structure. Background Technology
[0002] In current industrial applications, engineers typically employ a dual GNSS antenna combined with an IMU for integrated navigation, considering both cost and operating environment. This approach uses the heading information provided by the dual GNSS antennas to assist the IMU in its calculations, improving initial alignment accuracy and heading stability. However, in phased array devices, its disadvantages compared to a single GNSS antenna are:
[0003] First, GNSS antennas need to be placed on the surface of the equipment, and the farther apart the two GNSS antennas are, the more accurate the angle will be, which takes up a large area of the equipment.
[0004] Second, the output value of this angle is easily interfered with in complex electromagnetic environments, which requires high electromagnetic shielding performance of the equipment.
[0005] Third, the cost is higher compared to a single GNSS antenna.
[0006] This invention utilizes data output from a single GNSS antenna, combined with the fitting capabilities of a deep learning model. Through training with data from various scenarios, the model acquires the ability to remove the interference of yaw force on the velocity component, thereby accurately separating the heading change component dominated by angular velocity. The model input includes raw velocity, acceleration, angular velocity, and position information collected from multiple sources of sensors. Through temporal feature extraction and nonlinear mapping relationship learning, the corrected effective yaw angle is output. Summary of the Invention
[0007] This invention addresses the problem that existing algorithms use a single GNSS antenna to obtain velocity and position to calculate the heading angle, but the "drift" during the carrier's motion leads to significant errors in the calculation.
[0008] The technical solution of this invention to solve the above-mentioned technical problems is as follows: a method for calculating the dynamic yaw angle of a carrier based on a Transformer structure, comprising the following steps:
[0009] S1. Acquire multi-source sensor data of the carrier at multiple consecutive time points. The multi-source sensor data includes velocity component information and position information provided by a single GNSS antenna, as well as angular velocity information and acceleration information provided by an inertial measurement unit.
[0010] S2. Construct a time-series feature matrix based on multi-source sensor data, and normalize the time-series feature matrix;
[0011] S3. Input the normalized temporal feature matrix into the pre-trained Transformer feature extraction network, and extract the temporal dependencies between sensor data through a multi-layer attention mechanism;
[0012] S4. Based on deep temporal dependencies, calculate the dynamic yaw angle estimate and corresponding confidence assessment value of the carrier through the regression output layer;
[0013] S5. Based on the comparison between the confidence level assessment value and the preset threshold, determine the final yaw angle output value of the carrier.
[0014] In a preferred embodiment, in S1, the velocity component information and position information of the carrier are obtained from a single GNSS antenna, wherein the velocity component information includes a northward velocity component, an eastward velocity component and an astronomical velocity component, and the position information includes accuracy, latitude and elevation data.
[0015] The inertial measurement unit (IMU) acquires the angular velocity and acceleration information of the carrier at the same continuous time points. The IMU includes a three-axis gyroscope and a three-axis accelerometer. The three-axis gyroscope outputs the angular velocity data of the carrier around the three axes of its coordinate system, and the three-axis accelerometer outputs the linear acceleration data of the carrier along the three axes. The acceleration data is combined with a filtering algorithm to eliminate sensor noise and drift error, thereby outputting the real-time pitch angle and roll angle.
[0016] All data elements are combined to form a multidimensional sensor data sequence. These data are aligned in chronological order and encapsulated into a structured sequence, with each time point corresponding to a multidimensional data vector, thus constructing a time-series dataset describing the motion state of the carrier.
[0017] In a preferred embodiment, in step S2, a first time window length is set, and the time window is slid along a continuous time axis to obtain multi-source sensor data corresponding to all sampling times within the window, ensuring that the data at each sampling time contains a complete set of sensor observations.
[0018] Normalization is performed on the sensor data at each sampling moment within the time window. The original sensor data values are mapped to a preset first numerical interval through linear transformation. The first numerical interval is usually set as a closed interval of [0,1]. The minimum value of each dimension is mapped to the lower bound of the interval, the maximum value is mapped to the upper bound of the interval, and the intermediate values are scaled according to the current ratio.
[0019] After normalizing the data at all sampling times, the normalized data within the time window are arranged in chronological order, with the data from the earliest sampling time placed at the beginning of the sequence and the data from the latest sampling time placed at the end of the sequence, forming a two-dimensional time-series feature matrix. The row dimension of the matrix corresponds to different sampling times, and the column dimension corresponds to the normalized data values from different sensors. The final constructed two-dimensional time-series feature matrix is used as a standardized data carrier.
[0020] In a preferred embodiment, in step S3, the normalized two-dimensional temporal feature matrix is input into a pre-trained Transformer feature extraction network. First, the two-dimensional temporal feature matrix is mapped to a high-dimensional space through an embedding layer to obtain a high-dimensional feature sequence. The mapped high-dimensional feature sequence is input into multiple cascaded Transformer coding layers. Each coding layer processes the feature sequence output by the previous layer once and includes two sub-units: a multi-head self-attention mechanism and a feedforward neural network. The multi-head self-attention mechanism is responsible for capturing the long-range dependencies between different time steps within the sequence, while the feedforward neural network introduces a nonlinear transformation through two fully connected layers and an activation function.
[0021] In the specific execution of the multi-head self-attention mechanism, each attention head transforms the input feature sequence into a query matrix, a key matrix, and a value matrix through an independent linear transformation layer, which can be specifically represented as:
[0022]
[0023] Among them, Q i K i V i These represent the query, key, and value matrices corresponding to the i-th attention head, respectively. Let X and X represent the trainable linear transformation weight matrices corresponding to the i-th attention head, respectively, and let X represent the input feature sequence matrix.
[0024] The attention weight distribution is calculated based on the query matrix and the key matrix. The attention weights at each time step are obtained by calculating the dot product of the query matrix and the key matrix, scaling the result, and then applying the softmax function. The specific calculation formula is as follows:
[0025]
[0026] in, This indicates the similarity between the query and the key. Represents the scaling factor, Attention iThe attention weights represent the correlation strength between features at different time steps. The value matrix is weighted and summed using the attention weight distribution to generate the output feature sequence of the attention head. The output of each time step is a weighted combination of the value vectors from all time steps. The output feature sequences of all attention heads are concatenated along the feature dimension, and a linear transformation layer maps the concatenated high-dimensional features back to the preset latent space dimension. The specific calculation formula is as follows:
[0027]
[0028] Among them, W O This represents the trainable weight matrix of the output projection layer, Concat represents the concatenation operation, and MultiHead(Q,K,V) represents the overall output of the multi-head attention function. This represents the output of the first to the hth attention heads, forming the final output of the multi-head self-attention mechanism;
[0029] After processing all Transformer coding layers, a feature fusion layer integrates the temporal features output from multiple coding layers. The feature fusion layer uses a weighted summation method to aggregate the feature representations from different depths. The specific calculation formula is as follows:
[0030]
[0031] Where, α l H represents the fusion weights of the l-th layer. fusion H represents the final feature fusion output. (l) Let L represent the output feature sequence of the l-th Transformer coding layer. Let l represent the total number of coding layers and the index of the coding layer, respectively. Shallow features contain more local details, while deep features encode global semantic patterns.
[0032] In a preferred embodiment, in step S4, the dynamic yaw angle estimate and corresponding confidence score of the carrier are calculated by the regression output layer. The time-series feature output by the feature fusion layer is used as the input to the regression output layer. This time-series feature is a two-dimensional matrix containing feature vectors of multiple time steps. The time-series feature is input to the first fully connected layer for calculation to obtain the yaw angle estimate. The first fully connected layer is parameterized by a trainable weight matrix and bias vector. By performing linear transformation and nonlinear activation on the input feature, the high-dimensional time-series feature is mapped to a low-dimensional linear output, which can be specifically expressed as follows:
[0033] z = W·x flat +b
[0034] Where W represents the trainable weight matrix of the first fully connected layer, with each row corresponding to an output dimension and each column corresponding to the dimension of the input as a feature vector, used to quantify the contribution weight of each dimension of the input features to the yaw angle estimation. flat Representing a one-dimensional feature vector, the intermediate output z of the linear transformation needs to pass through a nonlinear activation function to achieve the transformation from linear mapping to nonlinear feature extraction. The final output is the estimated dynamic yaw angle of the carrier, and the specific calculation formula is as follows:
[0035]
[0036] in, σ(·) represents the estimated dynamic yaw angle of the carrier output from the first fully connected layer, and σ(·) represents the nonlinear activation function.
[0037] The same temporal features are input in parallel to the second fully connected layer to calculate the confidence evaluation value. The output of the second fully connected layer is constrained to a preset value range of 0 to 1 by the sigmoid activation function to generate a confidence evaluation value that characterizes the reliability of the yaw angle evaluation value. A confidence evaluation value close to 1 indicates that the estimation result is highly reliable, while a confidence evaluation value close to 0 indicates that the estimation result is highly uncertain.
[0038] The yaw angle estimate and the confidence level together constitute the complete output of the regression output layer. The yaw angle estimate provides attitude information about the vehicle's heading, while the confidence level provides a quantitative indicator of the reliability of the attitude information.
[0039] In a preferred embodiment, in step S5, a first preset threshold and a second preset threshold are set, and the second preset threshold is less than the first preset threshold. When the confidence assessment value is higher than the first preset threshold, it indicates that the yaw angle estimate is directly used as the final yaw angle output value of the carrier.
[0040] When the confidence assessment value is detected to be lower than the first preset threshold but higher than the second preset threshold, the current yaw angle estimate of the surface light is uncertain. At this time, the weighted fusion value of the yaw angle estimate and the inertial navigation integral result is used as the final output. When the confidence assessment value drops below the second preset threshold, it indicates that the current sensor data quality and model estimation reliability are insufficient.
[0041] The beneficial effects of this invention are as follows: By combining a single GNSS antenna with an inertial measurement unit, this invention reduces the number of hardware components and installation space required by traditional dual GNSS antennas while ensuring measurement accuracy, thereby reducing equipment safety and structural complexity. By utilizing the multi-layer self-attention mechanism in the Transformer feature extraction network, it can capture the temporal dependencies between data from multiple sources, identify and separate velocity component changes caused by interference factors, and improve the accuracy of yaw angle calculation under complex motion conditions. Attached Figure Description
[0042] Figure 1 This is a flowchart of the present invention;
[0043] Figure 2 This is a schematic diagram showing the reduced area of the single GNSS antenna carrier according to the present invention;
[0044] Figure 3 This is a schematic diagram illustrating the velocity components required for calculating the carrier angle in this invention.
[0045] Figure 4 This is a schematic diagram illustrating the carrier velocity component variation analysis of the present invention;
[0046] Figure 5 This is a schematic diagram of the Transformer structure of the present invention;
[0047] Figure 6 This is a schematic diagram of the Transformer layer of the present invention;
[0048] Figure 7 This is a schematic diagram of the calculation process of the present invention. Detailed Implementation
[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0050] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0051] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0052] like Figure 1-7 This embodiment provides a method for calculating the dynamic yaw angle of a carrier based on a Transformer structure, including the following steps:
[0053] S1. Acquire multi-source sensor data of the carrier at multiple consecutive time points. The multi-source sensor data includes velocity component information and position information provided by a single GNSS antenna, as well as angular velocity information and acceleration information provided by an inertial measurement unit.
[0054] Furthermore, the velocity component information and position information of the carrier are obtained from a single GNSS antenna. The velocity component information includes northward velocity component, eastward velocity component and celestial velocity component. The position information includes accuracy, latitude and elevation data. The northward velocity component and eastward velocity component are used to characterize the direction and speed of the carrier's motion in the horizontal plane. The celestial velocity component is used to characterize the carrier's motion state in the vertical direction. The accuracy, latitude and elevation data are used to determine the carrier's absolute spatial coordinates.
[0055] The angular velocity and acceleration information of the carrier at the same continuous time points are obtained from the inertial measurement unit (IMU). The IMU includes a three-axis gyroscope and a three-axis accelerometer. The three-axis gyroscope outputs the angular velocity data of the carrier around the three axes of its coordinate system, and the three-axis accelerometer outputs the linear acceleration data of the carrier along the three axes. The angular velocity information is used to analyze the pitch and roll angles of the carrier. The angular velocity data is integrated to obtain the angular change of the carrier. The specific calculation formula is as follows:
[0056] θ gyro (t)=θ(t-1)+ω(t·Δt
[0057] Where, θ gyroω(t) represents the angle estimate obtained by integrating the angular velocity at the current moment, θ(t-1) represents the angle value at the previous moment, ω(t) represents the angular velocity value measured at the current moment, and Δt represents the sampling time interval. By combining the acceleration data and using a filtering algorithm to eliminate sensor noise and drift error, the real-time pitch angle and roll angle are output. The pitch angle represents the degree of tilt of the carrier around the horizontal axis, and the roll angle represents the degree of tumbling of the carrier around the vertical axis.
[0058] All data elements are combined to form a multidimensional sensor data sequence, which includes the northward velocity component, eastward velocity component, celestial velocity component, longitude, latitude, and elevation extracted from a single GNSS antenna; the three-axis angular velocity information and three-axis acceleration information extracted from the inertial measurement unit; and the real-time pitch angle and roll angle calculated based on the inertial measurement unit data. These data are aligned in chronological order and encapsulated into a structured sequence, with each time point corresponding to a multidimensional data vector, thus constructing a time-series dataset describing the motion state of the carrier.
[0059] S2. Construct a time-series feature matrix based on multi-source sensor data, and normalize the time-series feature matrix;
[0060] Furthermore, a first time window length is set, which is a preset positive integer representing the number of consecutive sampling moments. By sliding this time window on the continuous time axis, multi-source sensor data corresponding to all sampling moments within the window are obtained. These data include velocity components and position information obtained from a single GNSS antenna, as well as angular velocity, acceleration, and pitch and roll angles calculated from the inertial measurement unit, ensuring that the data at each sampling moment contains a complete set of sensor observations.
[0061] Normalization is performed on the sensor data at each sampling moment within the time window. The original sensor data values are mapped to a preset first numerical interval through linear transformation. The first numerical interval is usually set as a closed interval of [0,1]. The minimum value of each dimension is mapped to the lower bound of the interval, the maximum value is mapped to the upper bound of the interval, and the intermediate values are scaled according to the current ratio.
[0062] After normalizing the data at all sampling times, the normalized data within the time window are arranged in chronological order, with the data from the earliest sampling time placed at the beginning of the sequence and the data from the latest sampling time placed at the end of the sequence, forming a two-dimensional time-series feature matrix. The row dimension of the matrix corresponds to different sampling times, and the column dimension corresponds to the normalized data values from different sensors. The final constructed two-dimensional time-series feature matrix is used as a standardized data carrier.
[0063] S3. Input the normalized temporal feature matrix into the pre-trained Transformer feature extraction network, and extract the temporal dependencies between sensor data through a multi-layer attention mechanism;
[0064] Furthermore, the normalized two-dimensional temporal feature matrix is input into a pre-trained Transformer feature extraction network. First, the two-dimensional temporal feature matrix is mapped to a high-dimensional space through an embedding layer. This input embedding layer is parameterized by a trainable linear transformation matrix. The feature vector of each time step of the input matrix is projected from the original dimension to the preset high-dimensional latent space to obtain a high-dimensional feature sequence. The mapped high-dimensional feature sequence is input into multiple cascaded Transformer encoding layers. Each encoding layer processes the feature sequence output by the previous layer and contains two sub-units: a multi-head self-attention mechanism and a feedforward neural network. The multi-head self-attention mechanism is responsible for capturing the long-range dependencies between different time steps within the sequence, while the feedforward neural network introduces a non-linear transformation through two fully connected layers and an activation function.
[0065] In the specific execution of the multi-head self-attention mechanism, each attention head transforms the input feature sequence into a query matrix, a key matrix, and a value matrix through an independent linear transformation layer, which can be specifically represented as:
[0066]
[0067] Among them, Q i K i V i These represent the query, key, and value matrices corresponding to the i-th attention head, respectively. Let X and X represent the trainable linear transformation weight matrices corresponding to the i-th attention head, respectively. Let X represent the input feature sequence matrix, where the query matrix is used to characterize the attention query requirement at the current time step, the key matrix is used to store the key information of all time steps, and the value matrix contains the feature value content of each time step.
[0068] The attention weight distribution is calculated based on the query matrix and the key matrix. The attention weights at each time step are obtained by calculating the dot product of the query matrix and the key matrix, scaling the result, and then applying the softmax function. The specific calculation formula is as follows:
[0069]
[0070] in, This indicates the similarity between the query and the key. Represents the scaling factor, Attention iThe attention weights represent the correlation strength between features at different time steps. The value matrix is weighted and summed using the attention weight distribution to generate the output feature sequence of the attention head. The output of each time step is a weighted combination of the value vectors from all time steps. The output feature sequences of all attention heads are concatenated along the feature dimension, and a linear transformation layer maps the concatenated high-dimensional features back to the preset latent space dimension. The specific calculation formula is as follows:
[0071]
[0072] Among them, W O This represents the trainable weight matrix of the output projection layer, Concat represents the concatenation operation, and MultiHead(Q,K,V) represents the overall output of the multi-head attention function. This represents the output of the first to the hth attention heads, forming the final output of the multi-head self-attention mechanism;
[0073] After processing all Transformer coding layers, a feature fusion layer integrates the temporal features output from multiple coding layers. The feature fusion layer uses a weighted summation method to aggregate the feature representations from different depths. The specific calculation formula is as follows:
[0074]
[0075] Where, α l H represents the fusion weights of the l-th layer. fusion H represents the final feature fusion output. (l) Let L represent the output feature sequence of the l-th Transformer coding layer and l represent the total number of coding layers and the index of the coding layer, respectively. Shallow features contain more local details, while deep features encode global semantic patterns. By fusing multi-level features, the network can comprehensively utilize temporal information at different levels.
[0076] It should be noted that the training process of the Transformer feature extraction network is as follows:
[0077] First, a training dataset containing sensor data and corresponding reference yaw angle true values for multiple carrier types under various motion states is collected. The carrier types include at least ships, aircraft, and vehicle-mounted equipment. The motion states cover uniform linear motion, acceleration and deceleration motion, turning motion, and complex motion modes affected by yaw force. The reference yaw angle true values are provided by a high-precision dual GNSS antenna system or a fiber optic inertial navigation system.
[0078] After obtaining the training dataset, a composite loss function is constructed that includes a yaw angle estimation error term and a confidence calibration term. The yaw angle estimation error term uses the Huber loss function to calculate the difference between the yaw angle estimate output by the model and the reference true value. This function uses squared loss to maintain accuracy when the error is small and linear loss to reduce the impact of outliers when the error is large, thereby achieving a balance between training stability and estimation accuracy.
[0079] The confidence calibration term uses a variance regularization term, which punishes the mismatch between the confidence assessment value and the actual estimation error, forcing the confidence assessment value output by the model to truly reflect the statistical characteristics of the estimation error, and ensuring the calibration relationship that high confidence corresponds to small error and low confidence corresponds to large error.
[0080] Based on the constructed composite loss function, all trainable parameters in the network are optimized through the backpropagation algorithm, including the projection matrix of the input embedding layer, the self-attention weights and feedforward network parameters in the Transformer encoding layer, the weight coefficients of the feature fusion layer, and the fully connected weights and biases of the regression output layer.
[0081] During the optimization process, a variant of the gradient descent algorithm is used. The parameter values are adjusted according to the gradient direction of the loss function, so that the loss function value continues to decrease along the negative gradient direction. The training process continues until the model reaches a convergent state. The convergence criterion is that the loss function value on the validation set no longer decreases significantly within several consecutive training cycles or reaches the preset maximum number of training cycles.
[0082] S4. Based on deep temporal dependencies, calculate the dynamic yaw angle estimate and corresponding confidence assessment value of the carrier through the regression output layer;
[0083] Furthermore, the dynamic yaw angle estimate and corresponding confidence score of the carrier are calculated through the regression output layer. The time-series features output by the feature fusion layer are used as the input to the regression output layer. This time-series feature is a two-dimensional matrix containing feature vectors of multiple time steps. To adapt to the input requirements of the fully connected layer, the two-dimensional time-series feature matrix X is flattened into a one-dimensional feature vector x. flat Specifically, it can be expressed as:
[0084]
[0085] Where, x t (t = 1, 2, ..., T) represents the feature vector at time step t. x represents flatIn the real number space, 1 indicates that the vector is a column vector, D represents the dimension of a single time step feature vector, and T represents the number of time steps of the temporal feature. Each feature vector encodes the multi-sensor fusion information of the corresponding time stepper context.
[0086] The temporal features are input into the first fully connected layer for calculation to obtain the yaw angle estimate. The first fully connected layer is parameterized by a trainable weight matrix and bias vector. By performing linear transformation and nonlinear activation on the input features, the high-dimensional temporal features are mapped to a low-dimensional linear output, which can be specifically expressed as follows:
[0087] z = W·x flat +b
[0088] Where W represents the trainable weight matrix of the first fully connected layer, with each row corresponding to an output dimension and each column corresponding to the dimension of the input as a feature vector, used to quantify the contribution weight of each dimension of the input features to the yaw angle estimation. flat Representing a one-dimensional feature vector, the intermediate output z of the linear transformation needs to pass through a nonlinear activation function to achieve the transformation from linear mapping to nonlinear feature extraction. The final output is the estimated dynamic yaw angle of the carrier, and the specific calculation formula is as follows:
[0089]
[0090] in, σ(·) represents the estimated dynamic yaw angle of the carrier output from the first fully connected layer, and σ(·) represents the nonlinear activation function.
[0091] The same temporal features are input in parallel to the second fully connected layer to calculate the confidence evaluation value. The output of the second fully connected layer is constrained to a preset value range of 0 to 1 by the sigmoid activation function to generate a confidence evaluation value that characterizes the reliability of the yaw angle evaluation value. A confidence evaluation value close to 1 indicates that the estimation result is highly reliable, while a confidence evaluation value close to 0 indicates that the estimation result is highly uncertain.
[0092] The yaw angle estimate and the confidence level together constitute the complete output of the regression output layer. The yaw angle estimate provides attitude information about the vehicle's heading, while the confidence level provides a quantitative indicator of the reliability of the attitude information.
[0093] S5. Based on the comparison between the confidence level assessment value and the preset threshold, determine the final yaw angle output value of the carrier.
[0094] Furthermore, a first preset threshold and a second preset threshold are set. The first preset threshold is used to distinguish between medium confidence state and low confidence state, and the second preset threshold is used to distinguish between medium confidence state and low confidence state. The second preset threshold is less than the first preset threshold. When the confidence assessment value is higher than the first preset threshold, it indicates that the yaw angle estimate is directly used as the final yaw angle output value of the vehicle.
[0095] When the confidence assessment value is detected to be lower than the first preset threshold but higher than the second preset threshold, the current yaw angle estimate of the surface light is uncertain. At this time, the weighted fusion value of the yaw angle estimate and the inertial navigation integration result is used as the final output. The inertial navigation integration result is obtained by integrating the angular velocity data provided by the inertial measurement unit over time. During the fusion process, a weight positively correlated with the confidence assessment value is assigned to the yaw angle estimate, and a complementary weight is assigned to the inertial navigation integration result. When the confidence assessment value drops below the second preset threshold, it indicates that the current sensor data quality and model estimation reliability are insufficient.
[0096] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0097] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0098] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0099] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0100] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0101] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0102] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for calculating the dynamic yaw angle of a carrier based on a Transformer structure, characterized in that, Includes the following steps: S1. Acquire multi-source sensor data of the carrier at multiple consecutive time points. The multi-source sensor data includes velocity component information and position information provided by a single GNSS antenna, as well as angular velocity information and acceleration information provided by an inertial measurement unit. S2. Construct a time-series feature matrix based on multi-source sensor data, and normalize the time-series feature matrix; S3. Input the normalized temporal feature matrix into the pre-trained Transformer feature extraction network, and extract the temporal dependencies between sensor data through a multi-layer attention mechanism; S4. Based on deep temporal dependencies, calculate the dynamic yaw angle estimate and corresponding confidence assessment value of the carrier through the regression output layer; S5. Based on the comparison between the confidence level assessment value and the preset threshold, determine the final yaw angle output value of the carrier.
2. The method for calculating the dynamic yaw angle of a carrier based on a Transformer structure according to claim 1, characterized in that, In S1, the velocity component information and position information of the carrier are obtained from a single GNSS antenna. The velocity component information includes the northward velocity component, the eastward velocity component and the celestial velocity component. The position information includes accuracy, latitude and elevation data. The inertial measurement unit (IMU) acquires the angular velocity and acceleration information of the carrier at the same continuous time points. The IMU includes a three-axis gyroscope and a three-axis accelerometer. The three-axis gyroscope outputs the angular velocity data of the carrier around the three axes of its coordinate system, and the three-axis accelerometer outputs the linear acceleration data of the carrier along the three axes. The acceleration data is combined with a filtering algorithm to eliminate sensor noise and drift error, thereby outputting the real-time pitch angle and roll angle. All data elements are combined to form a multidimensional sensor data sequence. These data are aligned in chronological order and encapsulated into a structured sequence, with each time point corresponding to a multidimensional data vector, thus constructing a time-series dataset describing the motion state of the carrier.
3. The method for calculating the dynamic yaw angle of a carrier based on a Transformer structure according to claim 1, characterized in that, In S2, a first time window length is set, and the time window is slid on a continuous time axis to obtain multi-source sensor data corresponding to all sampling times within the window, ensuring that the data at each sampling time contains a complete set of sensor observations. Normalization is performed on the sensor data at each sampling moment within the time window. The original sensor data values are mapped to a preset first numerical interval through linear transformation. The first numerical interval is usually set as a closed interval of [0,1]. The minimum value of each dimension is mapped to the lower bound of the interval, the maximum value is mapped to the upper bound of the interval, and the intermediate values are scaled according to the current ratio.
4. The method for calculating the dynamic yaw angle of a carrier based on a Transformer structure according to claim 3, characterized in that, After normalizing the data at all sampling times, the normalized data within the time window are arranged in chronological order, with the data from the earliest sampling time placed at the beginning of the sequence and the data from the latest sampling time placed at the end of the sequence, forming a two-dimensional time-series feature matrix. The row dimension of the matrix corresponds to different sampling times, and the column dimension corresponds to the normalized data values from different sensors. The final constructed two-dimensional time-series feature matrix is used as a standardized data carrier.
5. The method for calculating the dynamic yaw angle of a carrier based on a Transformer structure according to claim 1, characterized in that, In step S3, the normalized two-dimensional temporal feature matrix is input into a pre-trained Transformer feature extraction network. First, the two-dimensional temporal feature matrix is mapped to a high-dimensional space through an embedding layer to obtain a high-dimensional feature sequence. The mapped high-dimensional feature sequence is input into multiple cascaded Transformer coding layers. Each coding layer processes the feature sequence output by the previous layer once and includes two sub-units: a multi-head self-attention mechanism and a feedforward neural network. The multi-head self-attention mechanism is responsible for capturing the long-range dependencies between different time steps within the sequence, while the feedforward neural network introduces a nonlinear transformation through two fully connected layers and an activation function.
6. The method for calculating the dynamic yaw angle of a carrier based on a Transformer structure according to claim 5, characterized in that, In the specific execution of the multi-head self-attention mechanism, each attention head transforms the input feature sequence into a query matrix, a key matrix, and a value matrix through an independent linear transformation layer, which can be specifically represented as: Among them, Q i K i V i These represent the query, key, and value matrices corresponding to the i-th attention head, respectively. Let X and X represent the trainable linear transformation weight matrices corresponding to the i-th attention head, respectively, and let X represent the input feature sequence matrix.
7. The method for calculating the dynamic yaw angle of a carrier based on a Transformer structure according to claim 6, characterized in that, The attention weight distribution is calculated based on the query matrix and the key matrix. The attention weights for each time step are obtained by calculating the dot product of the query matrix and the key matrix, scaling the result, and then applying the softmax function. The value matrix is then weighted and summed using the attention weight distribution to generate the output feature sequence of the attention head. The output of each time step is a weighted combination of the value vectors from all time steps. All the output feature sequences of the attention heads are concatenated along the feature dimension, and a linear transformation layer maps the concatenated high-dimensional features back to the preset latent space dimension. The specific calculation formula is as follows: Among them, W O This represents the trainable weight matrix of the output projection layer, Concat represents the concatenation operation, and MultiHead(Q,K,V) represents the overall output of the multi-head attention function. This represents the output of the first to the hth attention heads, forming the final output of the multi-head self-attention mechanism.
8. The method for calculating the dynamic yaw angle of a carrier based on a Transformer structure according to claim 5, characterized in that, After processing all Transformer coding layers, a feature fusion layer integrates the temporal features output from multiple coding layers. The feature fusion layer uses a weighted summation method to aggregate the feature representations from different depths. The specific calculation formula is as follows: Where, α l H represents the fusion weights of the l-th layer. fusion H represents the final feature fusion output. (l) Let L represent the output feature sequence of the l-th Transformer coding layer. Let l represent the total number of coding layers and the index of the coding layer, respectively. Shallow features contain more local details, while deep features encode global semantic patterns.
9. The method for calculating the dynamic yaw angle of a carrier based on a Transformer structure according to claim 1, characterized in that, In step S4, the dynamic yaw angle estimate and corresponding confidence score of the carrier are calculated through the regression output layer. The time-series features output by the feature fusion layer are used as the input to the regression output layer. These time-series features are a two-dimensional matrix containing feature vectors from multiple time steps. The time-series features are input to the first fully connected layer for calculation to obtain the yaw angle estimate. The first fully connected layer is parameterized by a trainable weight matrix and bias vector. By performing linear transformation and nonlinear activation on the input features, the high-dimensional time-series features are mapped to a low-dimensional linear output. Specifically, this can be expressed as follows: z=W·x flat +b Where W represents the trainable weight matrix of the first fully connected layer, with each row corresponding to an output dimension and each column corresponding to the dimension of the input as a feature vector, used to quantify the contribution weight of each dimension of the input features to the yaw angle estimation. flat Representing a one-dimensional feature vector, the intermediate output z of the linear transformation needs to pass through a nonlinear activation function to achieve the transformation from linear mapping to nonlinear feature extraction. The final output is the estimated dynamic yaw angle of the carrier, and the specific calculation formula is as follows: in, σ(·) represents the estimated dynamic yaw angle of the carrier output from the first fully connected layer, and σ(·) represents the nonlinear activation function. The same temporal features are input in parallel to the second fully connected layer to calculate the confidence evaluation value. The output of the second fully connected layer is constrained to a preset value range of 0 to 1 by the sigmoid activation function to generate a confidence evaluation value that characterizes the reliability of the yaw angle evaluation value. A confidence evaluation value close to 1 indicates that the estimation result is highly reliable, while a confidence evaluation value close to 0 indicates that the estimation result is highly uncertain. The yaw angle estimate and the confidence level together constitute the complete output of the regression output layer. The yaw angle estimate provides attitude information about the vehicle's heading, while the confidence level provides a quantitative indicator of the reliability of the attitude information.
10. The method for calculating the dynamic yaw angle of a carrier based on a Transformer structure according to claim 1, characterized in that, In step S5, a first preset threshold and a second preset threshold are set, and the second preset threshold is less than the first preset threshold. When the confidence assessment value is higher than the first preset threshold, it indicates that the yaw angle estimate is directly used as the final yaw angle output value of the vehicle. When the confidence assessment value is detected to be lower than the first preset threshold but higher than the second preset threshold, the current yaw angle estimate of the surface light is uncertain. At this time, the weighted fusion value of the yaw angle estimate and the inertial navigation integral result is used as the final output. When the confidence assessment value drops below the second preset threshold, it indicates that the current sensor data quality and model estimation reliability are insufficient.