Road longitudinal section line generation error correction method and system under acquisition speed change based on Transform model

By using a Transformer model-based approach and employing devices such as laser displacement sensors and IMUs for spatiotemporal reference alignment and feature encoding, elevation error characteristics in different speed ranges are separated, enabling automatic correction of road longitudinal profile errors. This improves detection efficiency and accuracy, and supports scientific and efficient maintenance decisions.

CN120874013APending Publication Date: 2025-10-31JIANGSU EXPRESSWAY ENG MAINTENANCE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510997024.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing road inspection technologies are inefficient, have poor repeatability, and are difficult to cover a wide range of road networks. This makes it difficult for road management departments to obtain accurate road surface smoothness parameters in a timely manner, affecting the scientific nature and timeliness of maintenance decisions.

Method used

A Transformer-based approach is adopted, which acquires data through displacement sensors, photoelectric encoders and inertial measurement units (IMUs), performs spatiotemporal reference alignment and feature encoding, combines multi-head attention mechanism and dynamic weight modeling to separate elevation error features in different speed ranges, realizes error coupling analysis, and outputs error compensation values ​​through decoder to eliminate speed interference and obtain high-precision road elevation information.

Benefits of technology

It enables automatic correction of road longitudinal profile errors under speed variations, improves detection efficiency and accuracy, enhances the adaptability and accuracy of pavement condition monitoring, and supports scientific and efficient maintenance decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120874013A_ABST
    Figure CN120874013A_ABST
Patent Text Reader

Abstract

The invention relates to a road longitudinal section line generation error correction method and system under acquisition speed change based on a Transform model. Multi-source data acquisition is realized through an independently developed road inspection system (RIS); using a Transform model to learn the relation between the speed change factor of each acquisition point and the elevation error of the longitudinal section line; and constructing a self-attention mechanism according to the position information, the standard elevation data, the measurement elevation data and the speed data, and establishing a learning model. And predicting the data without the standard value by calling the model, and outputting accurate road elevation information of each measurement point position, which is accurately removed from the influence of the speed factor. The method comprises the following steps: learning a relationship between an elevation error and an external influence factor through a self-attention mechanism of a Transform model; and automatic correction of longitudinal section line measurement errors caused by external factors such as speed can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of road traffic detection technology, and in particular to a method and system for correcting errors in the generation of road longitudinal profiles under varying acquisition speeds based on a Transformer model. Background Technology

[0002] In road maintenance and management, pavement smoothness is a core indicator for assessing road quality, directly impacting driving comfort, traffic safety, and the lifespan of infrastructure. However, current mainstream detection technologies have significant limitations: they are inefficient, lack repeatability, and struggle to achieve large-scale road network coverage. These technical deficiencies make it difficult for road management departments to obtain accurate pavement smoothness parameters in a timely manner, hindering the scientific and timely nature of maintenance decisions. To ensure safe road operation, there is an urgent need to establish an efficient, accurate, and adaptable pavement condition monitoring system. Summary of the Invention

[0003] In view of this, the purpose of this invention is to provide a method and system for correcting errors in road longitudinal profile generation under varying acquisition speeds based on the Transformer model, so as to automatically correct longitudinal profile measurement errors caused by external factors such as speed.

[0004] To achieve the above objectives, the present invention adopts the following technical solution: a method for correcting errors in road longitudinal profile generation under varying acquisition speeds based on a Transformer model, comprising the following steps:

[0005] Step S1: Acquire data using displacement sensors, photoelectric encoders, and inertial measurement units (IMUs);

[0006] Step S2: Spatiotemporal reference alignment and feature encoding. A spatial sequence is constructed using photoelectric encoder pulses and combined with inertial measurement unit (IMU) data to complete the spatiotemporal mapping alignment. The standard elevation, measured elevation, and velocity parameters are vectorized to form a fused feature sequence containing spatial position, measured values, and dynamic parameters.

[0007] Step S3: Dynamic weighted attention modeling. In the Transformer encoder, standard elevation is used as the query benchmark and measured elevation is used as the key-value pair to establish a self-attention dynamic association. The velocity parameter is introduced into the multi-head attention weight calculation to separate the elevation error characteristics of different velocity ranges and perform error coupling analysis in a dynamic environment.

[0008] Step S4: Error Compensation Decoding Output: For test data without standard elevation, the decoder calls the encoded features through cross-layer attention links; inputs the fusion vector of measured elevation and speed, associates it with the weight matrix generated by the encoding layer, and outputs the error compensation value through multi-layer neural network regression calculation; the compensation value is superimposed on the original measurement data, and outputs high-precision road surface elevation information after eliminating speed interference.

[0009] In a preferred embodiment: step S2 includes the following steps:

[0010] Step S21: Establish the database:

[0011] A dual-laser road longitudinal profile system was used to collect 200 sets of road data from 20 road segments with different slopes, pavement types, road materials, and damage levels. Each set contained a complete road profile constructed from 1,000 continuous sampling points. Of these, 150 sets of data were used to train the model, and the rest were used for validation.

[0012] Step S22: Spatiotemporal reference construction:

[0013] Based on the encoder pulse signal, a spatial mileage sequence is generated, and the carrier attitude data collected by the IMU is simultaneously fused to establish a spatiotemporal mapping relationship matrix, as shown in formula (1), so as to realize the spatiotemporal dimension alignment of laser displacement data, standard elevation benchmark and measured elevation data.

[0014]

[0015] Where T map For spatial mileage sequence, ω is angular velocity, v is velocity parameter, Δt is time interval, R(θ) is IMU attitude rotation matrix, and Δp is spatial displacement of encoder pulse conversion;

[0016] Step S23: Multi-source feature vectorization encoding:

[0017] The standard elevation values, measured elevation data, and velocity parameters after spatiotemporal alignment are normalized as shown in formula (2). They are then converted into 128-dimensional feature vectors through an embedding layer, forming a temporal feature sequence z that integrates spatial location, measured values, and dynamic parameters. i :

[0018]

[0019] Where μ is the characteristic mean, σ is the standard deviation, and x i This represents the original elevation / velocity value.

[0020] In a preferred embodiment: step S3 includes the following steps:

[0021] Step S31: Initialize the feature matrix:

[0022] Using the standard elevation feature vector as the query matrix Q and the measured elevation feature vector as both the key matrix K and the value matrix V, a QKV triplet input encoder layer is constructed to form a dynamic correlation infrastructure between the benchmark and the measured value.

[0023] Step S32: Velocity Modulation Attention Calculation:

[0024] In the multi-head attention mechanism, a speed parameter is introduced as a weight adjustment factor. The speed parameter is segmented and normalized. The normalized speed vector is then subjected to a Hadamard product operation with the attention weight matrix to generate a speed-aware dynamic attention distribution, as shown in formula (3).

[0025]

[0026] Where S is the normalized velocity vector, ⊙ represents the element-wise product, and d k Let T be the dimension of the key vector, and T denote the transpose.

[0027] Step S33: Multi-mode error decoupling:

[0028] By using the differentiated focusing of 8 parallel attention heads, the first 4 attention heads focus on the extraction of elevation-velocity coupling features in the low-speed range, and the last 4 attention heads analyze the dynamic error propagation law in the high-speed range: the outputs of each attention head are fused by the splicing layer to form a complete error coupling feature map. The multi-head splicing formula is shown in formula (4).

[0029] MultiHead=Concat(head1,...,head h W O (4)

[0030] Among them, MultiHead is a representation of multi-head attention mechanism, Concat is the "concatenation" operation in multi-head attention, and W O It is a weight matrix, head1 represents the first attention head, head h This represents the h-th attention head. Each attention head is calculated as follows:

[0031]

[0032] Among them, head i This represents the i-th attention head.

[0033] Step S34: Cross-layer feature enhancement:

[0034] In the 6-layer encoder, attention weights are passed step by step. The bottom encoder captures the small elevation changes caused by local velocity fluctuations, i.e., <1mm level. The top encoder extracts the macro ranging error caused by long-distance velocity accumulation, i.e., >5mm level. The integrity of the original measurement data features is maintained through residual connections. The cross-layer feature transfer is shown in formula (6), where F is the output of the self-attention layer, H l This is the hidden state of layer l;

[0035] H l+1 =LayerNorm(F(H l )+H l (6)

[0036] H l+1 This represents the hidden state of layer l+1; LayerNorm represents the "layer normalization" operation.

[0037] Step S35: Training the dynamic weight model

[0038] The training set data was imported into the Transformer model for model training. The mean squared error (MSE) was used to calculate the composite loss between the standard elevation value and the measured elevation value. After 500 rounds of training, as shown in formula (6), the model loss rate decreased from 0.21457 to 0.00014, achieving stable convergence.

[0039]

[0040] Where MSE represents the mean squared error, i represents the current sample number, N is the total number of samples, and y i The standard elevation value, The predicted values ​​output by the model after importing the validation set data.

[0041] In a preferred embodiment: step S4 includes the following steps:

[0042] Step S41: Multi-source feature fusion:

[0043] The measured elevation data and velocity parameters of the test set are concatenated into vectors and converted into high-dimensional fusion feature vectors through an embedding layer, while retaining the spatiotemporal location encoding information of the original data.

[0044] Step S42: Cross-level feature association:

[0045] The decoder establishes a cross-layer attention connection mechanism with the encoder. The bottom layer decoder calls the global weight matrix of the last layer of the encoder, the middle layer decoder associates the regional features of the middle layer of the encoder, and the high layer decoder fuses the local dynamic coupling features of the bottom layer of the encoder.

[0046] Step S43: Stratification Error Analysis:

[0047] A cascaded fully connected network architecture is used to analyze error components. The front end of the network extracts macro-scale error features, the middle section analyzes the meso-scale error propagation law, and the end end fits micro-fluctuation components to output high-resolution error compensation values.

[0048] Step S44: Elevation Reconstruction and Verification

[0049] The error compensation value is superimposed on the original measured data, and the physical dimensions are restored by reverse normalization to generate elevation information that eliminates speed interference. The data consistency is verified by closed-loop detection of adjacent mileage stakes. The reverse normalization is shown in formula (7).

[0050] y real =y norm ×(σ+∈)+μ (8)

[0051] Where y real For the actual elevation of the road surface, y norm is the normalized elevation value, ∈ is a small constant to prevent division by zero, and σ and μ are training set statistics.

[0052] This invention also provides a road longitudinal profile generation error correction system based on a Transformer model under varying acquisition speed. The system, which implements the aforementioned method for correcting road longitudinal profile generation errors under varying acquisition speed based on a Transformer model, includes a laser displacement sensor, a data acquisition card, an incremental rotary photoelectric encoder, an inertial measurement unit (IMU), and a host device; the laser displacement sensor...

[0053] Compared with existing technologies, this invention has the following advantages: This invention proposes a method for correcting errors in road longitudinal profile generation under varying acquisition speeds based on the Transformer model: It utilizes equipment such as laser displacement sensors, data acquisition cards, incremental rotary photoelectric encoders, and IMUs to acquire measured elevation, speed, and distance data of the road surface, and combines this with manually measured standard elevations and the location information of each measuring point to construct an original dataset containing 20 road segments and 200 sets of data; subsequently, through spatiotemporal benchmark alignment and feature encoding, the standard elevation, measured elevation, and speed parameters are vectorized, and spatial location, measured values, and dynamic parameters are fused to generate a high-dimensional feature sequence; in the Transformer model... During the training and prediction process of the r model, the encoder uses standard elevation as the query and measured elevation as the key, introduces a multi-head sub-attention mechanism, and incorporates speed information into the attention weight calculation, thereby achieving dynamic coupling of elevation error features under different speed ranges and constructing an error correction model that considers external factors such as speed. For test set data, the decoder calls the encoded features through cross-layer attention links, inputs the measured elevation and speed fusion vector into the regression network, generates predicted elevation data, and accurately corrects the abnormal deviation of the longitudinal profile caused by speed interference. Through incremental learning, new road segment data is continuously introduced to update the model. When the training samples are rich enough, the model's generalization ability and error correction effect will be further improved. Attached Figure Description

[0054] Figure 1 This is a schematic diagram of the longitudinal section under the influence of interference in a preferred embodiment of the present invention;

[0055] Figure 2 The diagram shows the prediction effect of the model according to a preferred embodiment of the present invention, wherein (a) is the longitudinal section of the input model; and (b) is the longitudinal section of the model output.

[0056] Figure 3 This is a flowchart of the Transformer error correction algorithm according to a preferred embodiment of the present invention. Detailed Implementation

[0057] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0058] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0059] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations according to this application; as used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise; furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0060] refer to Figure 1-3 The overall technical solution is as follows:

[0061] (1) Analysis of interference factors based on fused road longitudinal profile data

[0062] This example utilizes equipment such as laser displacement sensors, data acquisition cards, incremental rotary photoelectric encoders, and inertial measurement units (IMUs), combined with manually measured standard elevations and location information of each measuring point, to construct an original dataset containing 20 road segments and 200 sets of data. Through statistical and visual analysis of the measured elevation, speed, distance, and standard elevation data, the interference characteristics of external factors such as speed, road surface material, and slope on the accuracy of longitudinal profile measurements are identified, providing a basis for subsequent model feature extraction.

[0063] (2) Dataset partitioning and model training based on Transformer

[0064] This example divides the original dataset into training, validation, and test sets in a 10:5:5 ratio. First, through spatiotemporal benchmark alignment and feature encoding, standard elevation, measured elevation, and velocity parameters are vectorized, fusing spatial location, measured values, and dynamic parameters to generate a multi-dimensional feature sequence. Then, in the Transformer encoder, a multi-head sub-attention mechanism is introduced, using standard elevation as the query and measured elevation as the key / value pair. Velocity information is incorporated into the attention weight calculation, achieving dynamic coupling of elevation error features across different velocity ranges, thus completing iterative training and hyperparameter tuning of the model.

[0065] (3) Test set data input and error correction based on pre-trained model

[0066] This example utilizes a pre-trained Transformer model for inference on the test set data. The decoder invokes encoder features through cross-layer attention links, inputting the fused vector of measured elevation and velocity into the regression network to directly generate and replace the original elevation data, achieving accurate correction of longitudinal profile anomalies caused by velocity interference. Subsequently, new road segment data is continuously introduced through incremental learning to update the model. When the training samples are sufficiently rich, the model's generalization ability and error correction effect can be further improved.

[0067] Specifically, this example provides a method for correcting errors in road longitudinal profile generation under varying acquisition speeds based on the Transformer model, including the following steps:

[0068] Step S1: The hardware components of the Road Detection System (RIS) include a laser displacement sensor, a data acquisition card, an incremental rotary photoelectric encoder, an inertial measurement unit (IMU), and the main unit.

[0069] Step S2: Spatiotemporal reference alignment and feature encoding. A spatial sequence is constructed using encoder pulses and combined with IMU data to complete the spatiotemporal mapping alignment. The standard elevation, measured elevation, and velocity parameters are vectorized to form a fused feature sequence containing spatial location, measured values, and dynamic parameters.

[0070] Step S3: Dynamic weighted attention modeling. In the Transformer encoder, standard elevation is used as the query benchmark and measured elevation is used as the key-value pair to establish a self-attention dynamic association. The velocity parameter is introduced into the multi-head attention weight calculation to separate the elevation error characteristics of different velocity ranges and realize error coupling analysis in dynamic environment.

[0071] Step S4: Error Compensation Decoding Output: For test data without standard elevation, the decoder calls the encoded features through cross-layer attention links; inputs the fusion vector of measured elevation and speed, associates it with the weight matrix generated by the encoding layer, and outputs the error compensation value through multi-layer neural network regression calculation; the compensation value is superimposed on the original measurement data, and outputs high-precision road surface elevation information after eliminating speed interference.

[0072] In this example, the specific implementation method is as follows:

[0073] The spatiotemporal reference alignment and feature encoding described in step S2 involves constructing a spatial sequence using encoder pulses and combining it with IMU data to complete the spatiotemporal mapping alignment. The standard elevation, measured elevation, and velocity parameters are vectorized to form a fused feature sequence containing spatial location, measured values, and dynamic parameters, including the following steps:

[0074] Step S21: Establish the database

[0075] A dual-laser road longitudinal profile system was used to collect 200 sets of data from 20 road segments with different slopes, pavement types, road materials, and degrees of damage. Each set contained a complete road profile constructed from 1000 consecutive sampling points. Of these, 150 sets of data were used to train the model, and the rest were used for validation.

[0076] Step S22: Spatiotemporal reference construction

[0077] Spatial mileage sequence is generated based on encoder pulse signals, and carrier attitude data collected by IMU is simultaneously fused to establish a spatiotemporal mapping matrix, as shown in Formula 1, to achieve spatiotemporal alignment of laser displacement data, standard elevation datum and measured elevation data.

[0078]

[0079] Where v is the velocity parameter, Δt is the time interval, R(θ) is the IMU attitude rotation matrix, and Δp is the spatial displacement of the encoder pulse transition.

[0080] Step S23: Multi-source feature vectorization encoding

[0081] The standard elevation values, measured elevation data and velocity parameters after spatiotemporal alignment are normalized, as shown in Formula 2, and then converted into 128-dimensional feature vectors through an embedding layer to form a temporal feature sequence that integrates spatial location, measured values ​​and dynamic parameters.

[0082]

[0083] Where μ is the characteristic mean, σ is the standard deviation, and x i Original elevation / velocity values

[0084] Step S3 involves dynamic weighted attention modeling. In the Transformer encoder, standard elevation is used as the query reference, and measured elevation is used as the key-value pair to establish a self-attention dynamic association. Velocity parameters are introduced into the multi-head attention weight calculation to separate the elevation error characteristics of different velocity ranges, thereby realizing error coupling analysis in a dynamic environment. This includes the following steps:

[0085] Step S31: Initialize the feature matrix

[0086] The standard elevation feature vector is used as the query matrix (Q), and the measured elevation feature vector is used as both the key matrix (K) and the value matrix (V) to construct a QKV triple input encoder layer, forming a dynamic correlation infrastructure between the benchmark and the measured value.

[0087] Step S32: Velocity Modulation Attention Calculation

[0088] In the multi-head attention mechanism, a velocity parameter is introduced as a weight adjustment factor. The velocity parameter is normalized in segments, and the normalized velocity vector is subjected to Hadamard product operation with the attention weight matrix to generate a velocity-aware dynamic attention distribution, as shown in Equation 3.

[0089]

[0090] Where S is the normalized velocity vector, ⊙ represents the element-wise product, and d k The dimension of the key vector.

[0091] Step S33: Multi-mode error decoupling

[0092] By employing differentiated focusing through eight parallel attention heads, the first four attention heads concentrate on extracting elevation-velocity coupling features in the low-speed range, while the latter four attention heads analyze the dynamic error propagation patterns in the high-speed range. The outputs of each attention head are fused through a splicing layer to form a complete error coupling feature map. The multi-head splicing formula is shown in Formula 4.

[0093] MultiHead=Concat(head1,...,head h W O (4)

[0094] Each attention head is calculated as follows:

[0095]

[0096] Step S34: Cross-layer feature enhancement

[0097] In a 6-layer encoder, attention weights are passed sequentially. The bottom encoder captures the subtle elevation changes (<1mm level) caused by local velocity fluctuations, while the top encoders extract the macroscopic ranging errors (>5mm level) caused by long-distance velocity accumulation. The integrity of the original measurement data features is maintained through residual connections. The cross-layer feature transfer is shown in Equation 6, where F is the output of the self-attention layer, and H... l This is the hidden state of layer l;

[0098] H l+1 =LayerNorm(F(H l )+H l (6)

[0099] Step S35: Training the dynamic weight model

[0100] The training set data was imported into the Transformer model for model training. The mean squared error (MSE) was used to calculate the composite loss between the standard elevation value and the measured elevation value. After 500 rounds of training, as shown in Equation 6, the model loss rate decreased from 0.21457 to 0.00014, and stable convergence was achieved.

[0101]

[0102] Where y i The standard elevation value, The predicted values ​​output by the model after importing the validation set data.

[0103] In step S4, the error compensation decoding output is as follows: For test data without a standard elevation, the decoder calls the encoded features through a cross-layer attention link; the input is the fusion vector of measured elevation and speed, associated with the weight matrix generated by the encoding layer, and the error compensation value is calculated by a multi-layer neural network regression; the compensation value is superimposed on the original measurement data, and the high-precision road surface elevation information after eliminating speed interference is output, including the following steps:

[0104] Step S41: Multi-source feature fusion

[0105] The measured elevation data and velocity parameters of the test set are concatenated into vectors and converted into a high-dimensional fusion feature vector through an embedding layer, thus preserving the spatiotemporal location encoding information of the original data.

[0106] Step S42: Cross-level feature association

[0107] The decoder establishes a cross-layer attention connection mechanism with the encoder. The bottom-layer decoder calls the global weight matrix of the encoder's last layer, the middle-layer decoder associates the regional features of the encoder's middle layer, and the high-layer decoder fuses the local dynamic coupling features of the encoder's bottom layer.

[0108] Step S43: Stratification Error Analysis

[0109] A cascaded fully connected network architecture is used to analyze error components. The front end of the network extracts macro-scale error features, the middle section analyzes the meso-scale error propagation law, and the end fits micro-fluctuation components to output high-resolution error compensation values.

[0110] Step S44: Elevation Reconstruction and Verification

[0111] The error compensation value is superimposed on the original measured data, and the physical dimensions are restored by reverse normalization to generate elevation information that eliminates speed interference. The consistency of the data is verified by closed-loop detection of adjacent mileage stakes. The reverse normalization is shown in Formula 7.

[0112] y real =y norm ×(σ+∈)+μ (8)

[0113] Here, σ and μ are small constants used to prevent division by zero, and are training set statistics.

[0114] Preferably, this example relies on a self-developed road detection system, integrating multiple hardware devices such as laser displacement sensors, data acquisition cards, incremental rotary photoelectric encoders, and inertial measurement units (IMUs), and combining standard elevations measured manually with the location information of each measuring point to construct an original dataset containing 20 road segments and 200 sets of data, providing an accurate and multi-dimensional input basis for correcting road longitudinal profile velocity interference errors.

[0115] Meanwhile, this example fully considers the impact of external factors such as speed, road surface material, and slope on the accuracy of longitudinal profile measurement in the experimental design. Through statistical and visual analysis of multi-source data such as measured elevation, speed, and distance, various interference features are identified and quantified, providing rich and diverse input features for subsequent feature encoding and model training, which significantly improves the robustness and generalization ability of the model.

[0116] Specifically, this example employs spatiotemporal benchmark alignment and feature encoding techniques in the data preprocessing stage to vectorize standard elevation, measured elevation, and velocity parameters, and integrates spatial location, measured values, and dynamic parameters to generate a high-dimensional feature sequence. In terms of model construction, based on the Transformer's multi-head sub-attention mechanism, standard elevation is used as the query and measured elevation as the key / value pair, and velocity information is incorporated into the attention weight calculation to achieve dynamic coupling of elevation error features under different velocity ranges, successfully constructing an error correction model for velocity interference.

[0117] Finally, this example uses a pre-trained Transformer model to infer the test set data: the decoder calls the encoded features through cross-layer attention links, inputs the measured elevation and velocity fusion vector into the regression network, directly generates and replaces the original elevation data, and achieves accurate correction of longitudinal profile anomalies caused by velocity interference.

[0118] A case study was conducted on the use of Transformer for road longitudinal profile error correction. Five test road sections were selected from the case study as test benches for verification experiments. Manual measurements were performed, and the results were treated as "real-world ground conditions" to verify the accuracy of the proposed method.

[0119] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made within the scope of the claims of the present invention shall be covered by the present invention.

Claims

1. A method for correcting errors in road longitudinal profile generation under varying acquisition speeds based on a Transformer model, characterized in that: Includes the following steps: Step S1: Acquire data using displacement sensors, photoelectric encoders, and inertial measurement units (IMUs); Step S2: Spatiotemporal reference alignment and feature encoding. A spatial sequence is constructed using photoelectric encoder pulses and combined with inertial measurement unit (IMU) data to complete the spatiotemporal mapping alignment. The standard elevation, measured elevation, and velocity parameters are vectorized to form a fused feature sequence containing spatial position, measured values, and dynamic parameters. Step S3: Dynamic weighted attention modeling. In the Transformer encoder, standard elevation is used as the query benchmark and measured elevation is used as the key-value pair to establish a self-attention dynamic association. By incorporating velocity parameters into the multi-head attention weight calculation, the elevation error characteristics of different velocity ranges are separated, and error coupling analysis is performed under dynamic conditions. Step S4: Error Compensation Decoding Output: For test data without standard elevation, the decoder calls the encoded features through cross-layer attention links; inputs the fusion vector of measured elevation and speed, associates it with the weight matrix generated by the encoding layer, and outputs the error compensation value through multi-layer neural network regression calculation; the compensation value is superimposed on the original measurement data, and outputs high-precision road surface elevation information after eliminating speed interference.

2. The method for correcting road longitudinal profile generation errors under varying acquisition speeds based on a Transformer model, as described in claim 1, is characterized in that: Step S2 includes the following steps: Step S21: Establish the database: A dual-laser road longitudinal profile system was used to collect 200 sets of road data from 20 road segments with different slopes, pavement types, road materials, and damage levels. Each set contained a complete road profile constructed from 1,000 continuous sampling points. Of these, 150 sets of data were used to train the model, and the rest were used for validation. Step S22: Spatiotemporal reference construction: Based on the encoder pulse signal, a spatial mileage sequence is generated, and the carrier attitude data collected by the IMU is simultaneously fused to establish a spatiotemporal mapping relationship matrix, as shown in formula (1), so as to realize the spatiotemporal dimension alignment of laser displacement data, standard elevation benchmark and measured elevation data. Where T map For spatial mileage sequence, ω is angular velocity, v is velocity parameter, Δt is time interval, R(θ) is IMU attitude rotation matrix, and Δp is spatial displacement of encoder pulse conversion; Step S23: Multi-source feature vectorization encoding: The standard elevation values, measured elevation data, and velocity parameters after spatiotemporal alignment are normalized as shown in formula (2). They are then converted into 128-dimensional feature vectors through an embedding layer, forming a temporal feature sequence z that integrates spatial location, measured values, and dynamic parameters. i : Where μ is the characteristic mean, σ is the standard deviation, and x i This represents the original elevation / velocity value.

3. The method for correcting road longitudinal profile generation errors under varying acquisition speeds based on a Transformer model, as described in claim 1, is characterized in that: Step S3 includes the following steps: Step S31: Initialize the feature matrix: Using the standard elevation feature vector as the query matrix Q and the measured elevation feature vector as both the key matrix K and the value matrix V, a QKV triplet input encoder layer is constructed to form a dynamic correlation infrastructure between the benchmark and the measured value. Step S32: Velocity Modulation Attention Calculation: In the multi-head attention mechanism, a speed parameter is introduced as a weight adjustment factor. The speed parameter is segmented and normalized. The normalized speed vector is then subjected to a Hadamard product operation with the attention weight matrix to generate a speed-aware dynamic attention distribution, as shown in formula (3). Where S is the normalized velocity vector, ⊙ represents the element-wise product, and d k Let T be the dimension of the key vector, and T denote the transpose. Step S33: Multi-mode error decoupling: By using the differentiated focusing of 8 parallel attention heads, the first 4 attention heads focus on the extraction of elevation-velocity coupling features in the low-speed range, and the last 4 attention heads analyze the dynamic error propagation law in the high-speed range: the outputs of each attention head are fused by the splicing layer to form a complete error coupling feature map. The multi-head splicing formula is shown in formula (4). MultiHead=Concat(head1,...,head h )W O (4) MultiHead is a representation of multi-head self-attention mechanism; Concat is the "concatenation" operation in multi-head attention; W O It is a weight matrix; head1 represents the first attention head, head h This represents the h-th attention head. Each attention head is calculated as follows: Among them, head i This represents the i-th attention head. Step S34: Cross-layer feature enhancement: In the 6-layer encoder, attention weights are passed step by step. The bottom encoder captures the elevation micro-change features caused by local velocity fluctuations, i.e., elevation <1mm. The top encoder extracts the macro-range measurement error caused by long-distance velocity accumulation effect, i.e., elevation >5mm. The integrity of the original measurement data features is maintained through residual connection. The cross-layer feature transfer is shown in formula (6), where F is the output of the self-attention layer, H l This is the hidden state of layer l; H l+1 =LayerNorm(F(H l )+H l ) (6) H l+1 This represents the hidden state of layer l+1; LayerNorm represents the "layer normalization" operation; Step S35: Training the dynamic weight model The training set data was imported into the Transformer model for model training. The mean squared error (MSE) was used to calculate the composite loss between the standard elevation value and the measured elevation value. After 500 rounds of training, as shown in formula (6), the model loss rate decreased from 0.21457 to 0.00014, achieving stable convergence. Where MSE represents the mean squared error, i represents the current sample number, N is the total number of samples, and y i The standard elevation value, The predicted values ​​output by the model after importing the validation set data.

4. The method for correcting road longitudinal profile generation error under varying acquisition speed based on a Transformer model according to claim 1, characterized in that: Step S4 includes the following steps: Step S41: Multi-source feature fusion: The measured elevation data and velocity parameters of the test set are concatenated into vectors and converted into high-dimensional fusion feature vectors through an embedding layer, while retaining the spatiotemporal location encoding information of the original data. Step S42: Cross-level feature association: The decoder establishes a cross-layer attention connection mechanism with the encoder. The bottom layer decoder calls the global weight matrix of the last layer of the encoder, the middle layer decoder associates the regional features of the middle layer of the encoder, and the high layer decoder fuses the local dynamic coupling features of the bottom layer of the encoder. Step S43: Stratification Error Analysis: A cascaded fully connected network architecture is used to analyze error components. The front end of the network extracts macro-scale error features, the middle section analyzes the meso-scale error propagation law, and the end end fits micro-fluctuation components to output high-resolution error compensation values. Step S44: Elevation Reconstruction and Verification The error compensation value is superimposed on the original measured data, and the physical dimensions are restored by reverse normalization to generate elevation information that eliminates speed interference. The data consistency is verified by closed-loop detection of adjacent mileage stakes. The reverse normalization is shown in formula (7). y real =y norm ×(σ+∈)+μ (8) Where y real For the actual elevation of the road surface, y norm is the normalized elevation value, ∈ is a small constant to prevent division by zero, and σ and μ are training set statistics.

5. A road longitudinal profile generation error correction system based on Transformer model under varying acquisition speed, characterized in that... The method for correcting errors in road longitudinal profile generation under varying acquisition speed based on a Transformer model, as described in any one of claims 1-4, includes a laser displacement sensor, a data acquisition card, an incremental rotary photoelectric encoder, an inertial measurement unit (IMU), and a host device; wherein the laser displacement sensor...