Vehicle Dynamics Modeling and Vehicle State Prediction Methods, Systems, Devices, and Media
By using recurrent neural networks and TBPTT methods in vehicle dynamics modeling, the problems of low prediction accuracy and high computing cost in the prior art are solved, and higher data processing flexibility and accuracy are achieved.
Patent Information
- Application Number
- CN202310518804.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-09
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2043-05-09
AI Technical Summary
When the existing vehicle dynamics modeling methods use available data of the current moment or limited fixed time length for prediction, they cannot effectively utilize earlier available data information, resulting in low prediction accuracy; at the same time, due to repeated processing of input data, there is redundant calculation, which increases the calculation cost.
By passing hidden state encoding along time on the entire section of driving data, a recurrent neural network is used to model the vehicle dynamics, and the model is trained using the truncated propagation along time (TBPTT) method to achieve higher data processing flexibility and prediction accuracy.
Improves the accuracy and simulation frame rate of vehicle dynamics modeling, reduces calculation complexity and cost, and avoids repeated redundant calculations.
Smart Images

Figure CN116484742B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of vehicle modeling, and particularly to a vehicle dynamics modeling and vehicle state prediction method, system, device and medium. Background Art
[0002] In the field of autonomous driving, in order to debug and verify various related technologies at a relatively low cost, such as perception technology, decision control technology, communication technology, etc., simulation tests need to be carried out on a vehicle simulation platform. One of the key technologies is the modeling and simulation of vehicle dynamics. The accuracy of modeling and simulation directly affects the reliability of test results, and the time cost and material cost of modeling and simulation will also affect the R & D cycle and cost budget.
[0003] The vehicle dynamics model aims to accurately predict the partial motion state observation of the vehicle at a future moment (referred to as the partial future state observation) based on the current vehicle motion state and control input. Using an appropriate model to restore the as complete as possible motion state of the vehicle at the current moment according to the kinematic observation data and control quantity data of the vehicle at the current and past moments (referred to as available observation data and available control quantity data respectively, collectively referred to as available data) is the key to accurately predicting the partial future state observation.
[0004] The prior art usually uses the available data at the current moment or the available data of a limited fixed time length as the input data for a single prediction and inputs it into the model to predict the partial future state observation. Since modeling using the available data at the current moment or the available data of a limited fixed time length cannot utilize the information of earlier available data, the prediction accuracy is lost. In addition, since a fixed time length of available data needs to be input and processed when predicting the partial future state observation at a certain moment, and a fixed time length of available data also needs to be input and processed when predicting the partial future state observation at the next moment of that moment, most of the input data for the two consecutive moments is overlapping. The input data for the latter moment discards the earliest frame of data compared to the previous moment and adds a new frame of data. This means that there is reusable information in the process of processing the input data during the two predictions. The method of independently processing the input data separately fails to utilize the reusable information, resulting in repeated redundant calculations, and increasing the computational cost during model modeling and simulation. Summary of the Invention
[0005] The embodiments of the present application provide a vehicle dynamics modeling and vehicle state prediction method, system, device and medium. By transmitting the hidden state encoding along time on the entire driving data, the hidden encoding estimation of the vehicle motion state at any moment can be obtained with relatively low computational complexity and used to estimate the motion state at the next moment, so as to improve the vehicle dynamics accuracy and simulation frame rate.
[0006] To solve the above technical problems, in a first aspect, an embodiment of the present application provides a vehicle dynamics modeling and vehicle state prediction method, including the following steps: First, obtain modeling data; the modeling data includes a kinematic observation data sequence and a control quantity data sequence of the vehicle to be modeled; Then, divide the modeling data into training data and test data; Next, based on the training data, train the parameters of the recurrent neural network to obtain a vehicle dynamics model; and based on the test data, test the vehicle dynamics model to obtain a final vehicle dynamics model; Then, store the final vehicle dynamics model in the dynamics prediction device to obtain a dynamics prediction model; Finally, input the partial observation data of the vehicle state, the control quantity data, and the hidden encoding of the previous moment at the current moment into the dynamics prediction model to predict the partial observation data of the future vehicle state; where the hidden encoding of the previous moment is obtained by storing the hidden encoding output at the current time step after the dynamics prediction device completes the prediction of each time step.
[0007] In some exemplary embodiments, inputting the partial observation data of the vehicle state, the control quantity data, and the hidden encoding of the previous moment of the vehicle into the dynamics prediction model to predict the partial observation data of the future vehicle state includes: at the start of a partial observation prediction task of the vehicle state, generate a hidden encoding of all zeros and store it in the dynamics prediction device; in the online partial observation prediction task of the vehicle state, for each time step, input the current partial observation data of the vehicle state, the control quantity data, and the hidden encoding of the previous moment into the dynamics model, and the dynamics model outputs the partial observation of the future vehicle state and a new hidden encoding.
[0008] In some exemplary embodiments, the kinematic observation data sequence of the vehicle to be modeled is obtained by sampling at a fixed time interval; the kinematic observation data of the vehicle to be modeled includes the position data, speed data, azimuth angle data, and azimuth angular velocity data of the vehicle.
[0009] In some exemplary embodiments, the control quantity data sequence is obtained by sampling at a fixed time interval; the control quantity data includes the power control quantity, braking control quantity, and steering wheel control quantity of the vehicle to be modeled.
[0010] In some exemplary embodiments, divide the modeling data into training data and test data based on the proportion of the data length in the modeling data to the total length.
[0011] In some exemplary embodiments, based on training data, the parameters of a recurrent neural network are trained to obtain a vehicle dynamics model, including: initializing the recurrent neural network as an initial dynamics model; using the initial dynamics model to process the input data and the hidden encoding at the previous moment in the training data and output the dynamics prediction at the future moment as output data; calculating the loss value between the output data and the target data in the training data using a loss function; calculating the partial derivatives of the parameters in the initial dynamics model with respect to the loss value using the TBPTT method, and iteratively optimizing the parameters in the initial dynamics model based on a gradient-based optimization algorithm to obtain the vehicle dynamics model.
[0012] In some exemplary embodiments, based on test data, the vehicle dynamics model is tested to obtain a final vehicle dynamics model, including: calculating a prediction accuracy metric of the vehicle dynamics model based on the test data; determining whether the prediction accuracy metric is better than the optimization result in the iterative optimization process; if so, recording the vehicle dynamics model at the current moment as the current optimal model and recording the prediction accuracy of the test data at the current moment as the optimal accuracy; if not, continuing the iterative optimization process; wherein the iterative optimization process is a process of iteratively optimizing the parameters in the initial dynamics model.
[0013] In a second aspect, an embodiment of the present application further provides a vehicle dynamics modeling and vehicle state prediction system, including: a data set module, a vehicle dynamics model construction module, and a dynamics prediction module connected in sequence; the data set module is used to obtain modeling data; the modeling data includes a kinematic observation data sequence and a control quantity data sequence of a vehicle to be modeled; the modeling data is divided into training data and test data; the vehicle dynamics model construction module is used to train the parameters of a recurrent neural network according to the training data to obtain a vehicle dynamics model; and test the vehicle dynamics model based on the test data to obtain a final vehicle dynamics model; the dynamics prediction module is used to store the final vehicle dynamics model in a dynamics prediction device to obtain a dynamics prediction model; input the partially observed data of the vehicle state, the control quantity data, and the hidden encoding at the previous moment at the current moment into the dynamics prediction model to predict the partially observed data of the vehicle state in the future; wherein the hidden encoding at the previous moment is obtained by storing the hidden encoding output at the current time step after the dynamics prediction device completes the prediction at each time step.
[0014] In addition, the present application further provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned vehicle dynamics modeling and vehicle state prediction method.
[0015] In addition, the present application also provides a computer-readable storage medium storing a computer program, which when executed by a processor implements the above-mentioned vehicle dynamics modeling and vehicle state prediction method.
[0016] The technical solution provided by the embodiment of the present application has at least the following advantages:
[0017] The embodiment of the present application provides a vehicle dynamics modeling and vehicle state prediction method, system, device and medium. The method includes the following steps: First, obtain modeling data; the modeling data includes a kinematic observation data sequence and a control quantity data sequence of the vehicle to be modeled; Then, divide the modeling data into training data and test data; Next, based on the training data, train the parameters of the recurrent neural network to obtain a vehicle dynamics model; and based on the test data, test the vehicle dynamics model to obtain a final vehicle dynamics model; Then, store the final vehicle dynamics model in the dynamics prediction device to obtain a dynamics prediction model; Finally, input the partial observation data of the vehicle state, the control quantity data at the current moment, and the hidden encoding at the previous moment into the dynamics prediction model to predict the partial observation data of the future vehicle state; wherein, the hidden encoding at the previous moment is stored by the dynamics prediction device after completing the prediction of each time step for the hidden encoding output at the current time step.
[0018] The vehicle dynamics modeling and vehicle state prediction method provided by the present application runs a vehicle dynamics model including a recurrent neural network on a dynamics prediction device. The vehicle dynamics model takes the partial observation of the vehicle, the control quantity at the current prediction moment, and the hidden encoding at the previous moment as inputs at any moment to predict the partial observation of the future state and input the hidden encoding at the current moment.
[0019] In addition, the present application also uses the Truncated Backpropagation Through Time (TBPTT) method to continuously train the dynamics model including the recurrent neural network, and outputs the model with the lowest verification error after being verified by the test data as the modeling result. Since the TBPTT method is used to train the recurrent neural network as the core component of dynamics modeling, on the one hand, the vehicle dynamics modeling and vehicle state prediction method provided by the present application allows the use of available data of any time length as input to predict the partial observation of the future state, so it has higher data processing flexibility and prediction accuracy. On the other hand, the present application will output a fixed-length hidden encoding as the input for the next prediction while completing the prediction processing of the current time step, thus avoiding reprocessing the historical available data, so the average calculation amount of single-step prediction is reduced and the prediction frame rate is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] One or more embodiments are exemplarily illustrated by the pictures in the corresponding drawings. These exemplary illustrations do not constitute a limitation on the embodiments. Unless otherwise stated, the figures in the drawings do not constitute a scale limitation.
[0021] Figure 1 It is a schematic flowchart of a vehicle dynamics modeling and vehicle state prediction method provided by an embodiment of the present application;
[0022] Figure 2 It is a schematic structural diagram of a vehicle dynamics modeling and vehicle state prediction system provided by an embodiment of the present application;
[0023] Figure 3 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0024] As can be seen from the background art, existing vehicle dynamics modeling methods have problems such as low prediction accuracy, a large number of repetitive redundant calculations, and high modeling costs and calculation costs.
[0025] For existing data-driven vehicle dynamics modeling methods, first, obtain the sample historical state information, sample control parameter sequence, and labeled vehicle state information corresponding to each sample moment of the target vehicle; for each sample moment, input the sample historical state information and sample control parameter sequence into the vehicle dynamics model to determine the sample prediction state information; use the sample prediction state information and labeled vehicle state information to determine the current loss value; based on the current loss value, adjust the model parameters of the vehicle dynamics model until the vehicle dynamics model reaches a preset convergence state, and obtain a pre-established vehicle dynamics model to realize the construction of the vehicle dynamics model of the vehicle.
[0026] The prior art uses the available data at the current moment or the available data of a limited fixed time length as the input data for a single prediction and inputs it into some models for predicting the partially observed future state. Since modeling using the available data at the current moment or a limited fixed time length of available data cannot utilize the information of earlier available data, the prediction accuracy is lost. Secondly, when predicting the partially observed future state at a certain moment and when predicting the partially observed future state at the next moment of that moment, there is reusable information in the process of processing the input data during the two predictions. The method of independently processing the input data separately fails to utilize the reusable information, resulting in repetitive redundant calculations and increasing the calculation costs during model modeling and simulation.
[0027] To solve the above technical problems, an embodiment of the present application provides a vehicle dynamics modeling and vehicle state prediction method, including the following steps: First, obtain modeling data; the modeling data includes a kinematic observation data sequence and a control quantity data sequence of the vehicle to be modeled; then, divide the modeling data into training data and test data; next, based on the training data, train the parameters of the recurrent neural network to obtain a vehicle dynamics model; and based on the test data, test the vehicle dynamics model to obtain a final vehicle dynamics model; then, store the final vehicle dynamics model in the dynamics prediction device to obtain a dynamics prediction model; finally, input the partially observed data of the vehicle state, the control quantity data, and the hidden encoding of the previous moment at the current moment into the dynamics prediction model to predict the partially observed data of the future vehicle state; wherein, the hidden encoding of the previous moment is obtained by storing the hidden encoding output at the current time step after the dynamics prediction device completes the prediction of each time step. An embodiment of the present application provides a vehicle dynamics modeling and vehicle state prediction method, which obtains an estimation of the hidden encoding of the vehicle motion state at any moment with a relatively low computational complexity by transmitting the hidden state encoding along time on the entire driving data and uses it to estimate the motion state of the next moment, so as to improve the vehicle dynamics accuracy and simulation frame rate.
[0028] The following will elaborate on each embodiment of the present application in conjunction with the accompanying drawings. However, those of ordinary skill in the art can understand that in each embodiment of the present application, many technical details are proposed for the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions required to be protected by the present application can still be implemented.
[0029] Refer to Figure 1 , an embodiment of the present application provides a vehicle dynamics modeling and vehicle state prediction method, including the following steps:
[0030] Step S1, obtain modeling data; the modeling data includes a kinematic observation data sequence and a control quantity data sequence of the vehicle to be modeled.
[0031] Step S2, divide the modeling data into training data and test data.
[0032] Step S3, based on the training data, train the parameters of the recurrent neural network to obtain a vehicle dynamics model; and based on the test data, test the vehicle dynamics model to obtain a final vehicle dynamics model.
[0033] Step S4, store the final vehicle dynamics model in the dynamics prediction device to obtain a dynamics prediction model.
[0034] Step S5: Input the partial observed data of the vehicle state, control quantity data at the current moment, and the hidden encoding at the previous moment into the dynamic prediction model to predict the partial observed data of the future vehicle state. Among them, the hidden encoding at the previous moment is obtained by storing the hidden encoding output at the current time step after the dynamic prediction device completes the prediction for each time step.
[0035] Specifically, in step S3, the truncated backpropagation through time (TBPTT) method is used to train the recurrent neural network and is used to model vehicle dynamics. The vehicle dynamics modeling and vehicle state prediction method provided in this application mainly includes a model training part and a dynamic prediction part. Among them, the model training part is implemented by a model training device. By taking the training data set and validation data set containing the sequence of partial observed data of the vehicle state and control data as input, the parameters of the recurrent neural network are iteratively optimized using the TBPTT algorithm and the gradient-based optimization algorithm. And during the iterative optimization process, validation is performed on the validation set and the model parameters with the optimal validation performance are output according to the validation results as the output of the device. This output is the vehicle dynamics model. The dynamic prediction part is implemented by the dynamic prediction device. Specifically, the final vehicle dynamics model obtained by model training is stored in the dynamic prediction device to obtain the dynamic prediction model. Finally, the dynamic prediction model is used to predict the partial observed data of the future vehicle state.
[0036] Among them, the model training part uses the kinematic observation data sequence and the corresponding vehicle control quantity data sequence collected by the sensor for the vehicle to be modeled as the training data, and calculates the loss value between the output of the non-converged model and the target data according to the loss function. Using the dynamic prediction device in the dynamic prediction part, the TBPTT method is run to calculate the partial derivative of the loss value with respect to the parameters in the model, and the parameters in the model are iteratively optimized in combination with the gradient-based optimization algorithm. After several rounds of iterative optimization, the prediction accuracy index of the validation set of the model is calculated using the validation set. If the prediction accuracy index of the validation set of the latest model is better than the earlier optimal result during the iterative optimization process, record the model at this time as the current optimal model, and record the prediction accuracy of the validation set at this time as the optimal accuracy. If the optimization process reaches the convergence condition or the total number of rounds reaches the preset maximum value, the optimal model is used as the vehicle dynamics model of the vehicle to be modeled.
[0037] Among them, the dynamic prediction device in the dynamic prediction part loads the optimal model output by the dynamic prediction part as the vehicle dynamic model for predicting the partially observable future state of the vehicle. When performing state prediction, the partially observable state data of the vehicle at the current moment, the control quantity data, and the hidden encoding output at the previous moment are used as the current input. The dynamic prediction device processes them using the vehicle dynamic model and outputs the partially observable future state and the hidden encoding at the current moment. By cyclically inputting the partially observable state data and control quantity data of the vehicle at a new moment, the partially observable future state at the corresponding moment can be continuously obtained.
[0038] In some embodiments, in step S5, the partially observable state data of the vehicle at the current moment, the control quantity data, and the hidden encoding at the previous moment are input into the dynamic prediction model to predict the partially observable future state data of the vehicle, including:
[0039] Step S501: At the start of a partially observable vehicle state prediction task, generate a hidden encoding of all zeros and store it in the dynamic prediction device.
[0040] Step S502: In the online prediction task of the partially observable vehicle state, for each time step, input the current partially observable state data of the vehicle, the control quantity data, and the hidden encoding at the previous moment into the dynamic model. The dynamic model outputs the partially observable future state of the vehicle and a new hidden encoding.
[0041] The method and device for constructing the vehicle dynamic model proposed in this application need to use the dynamic observation data and control data sequence of the vehicle as the modeling data. The parameters of the recurrent neural network are optimized on the training data by using the TBPTT method to obtain the vehicle dynamic model, and the model with the optimal performance is obtained as the output on the test data (also called verification data).
[0042] In some embodiments, the kinematic observation data sequence of the vehicle to be modeled in step S1 is obtained by sampling at a fixed time interval; the kinematic observation data of the vehicle to be modeled includes the position data, speed data, azimuth angle data, and azimuth angular velocity data of the vehicle.
[0043] In some embodiments, the control quantity data sequence in step S1 is obtained by sampling at a fixed time interval; the control quantity data includes the power control quantity, braking control quantity, and steering wheel control quantity of the vehicle to be modeled.
[0044] In some embodiments, in step S2, based on the proportion of the data length in the modeling data to the total length, the modeling data is divided into training data and test data.
[0045] Specifically, the collected modeling data is divided into two parts according to the data length, one with a total length of 4 / 5 and the other with a total length of 1 / 5. Among them, the part with a ratio of 4 / 5 is used as training data (training set), and the part with 1 / 5 is used as test data (test set).
[0046] In some embodiments, in step S3, based on the training data, the parameters of the recurrent neural network are trained to obtain a vehicle dynamics model, including:
[0047] Step S301: Initialize the recurrent neural network as the initial dynamics model.
[0048] Step S302: Use the initial dynamics model to process the input data and the hidden encoding at the previous moment in the training data and output the dynamics prediction at the future moment as the output data.
[0049] Step S303: Use the loss function to calculate the loss value between the output data and the target data in the training data.
[0050] Step S304: Use the TBPTT method to calculate the partial derivative of the parameters in the initial dynamics model with respect to the loss value, and iteratively optimize the parameters in the initial dynamics model based on the gradient-based optimization algorithm to obtain the vehicle dynamics model.
[0051] This application uses the TBPTT method to train a recurrent neural network for vehicle dynamics modeling, aiming to process longer or even all available data at a relatively lower computational cost, thereby improving the prediction accuracy while reducing costs, so as to establish a more accurate and lower computational vehicle dynamics model. The modeling method designed in this application obtains the estimation of the hidden encoding (abbreviated as hidden encoding) of the vehicle motion state at any moment with a lower computational complexity by transmitting the hidden state encoding along the time on the entire driving data and uses it to estimate the motion state at the next moment. Using the method described in this application can achieve high vehicle dynamics accuracy on the one hand, and on the other hand, the computational resource requirements for training and simulation are relatively low, and a higher simulation frame rate can be achieved.
[0052] In some embodiments, after step S3 trains the parameters of the recurrent neural network based on the training data to obtain a vehicle dynamics model, the vehicle dynamics model is tested based on the test data to obtain the final vehicle dynamics model.
[0053] Specifically, testing the vehicle dynamics model based on the test data to obtain the final vehicle dynamics model includes:
[0054] Step S311: Calculate the prediction accuracy index of the vehicle dynamics model based on the test data.
[0055] Step S312: Determine whether the prediction accuracy index is better than the optimization result in the iterative optimization process. If so, record the vehicle dynamics model at the current moment as the current optimal model, and record the prediction accuracy of the test data at the current moment as the optimal accuracy. If not, continue with the iterative optimization process. The iterative optimization process is a process of iteratively optimizing the parameters in the initial dynamics model.
[0056] Specifically, when training the parameters of the recurrent neural network based on the training data in step S3, first, a recurrent neural network needs to be initialized as the dynamics model. The un-converged dynamics model is used to process the input data in the training set and the hidden encoding at the previous moment and output the dynamic prediction at the future moment as the output data. The loss function is used to calculate the loss value between the output data and the target data in the training set. The TBPTT method is used to calculate the partial derivative of the parameters in the model with respect to the loss value, and the parameters in the model are iteratively optimized in combination with the gradient-based optimization algorithm.
[0057] Among them, the observed data and control data at a certain moment in the dataset are used as the input data, and the observed data at the next moment of the current moment is used as the target data.
[0058] During the training process, when the un-converged model processes the data for the first time, it will use all-zero hidden encoding as part of the input and output a hidden encoding, which will be stored by the model training device for use in the next processing.
[0059] The loss function is generally a metric function defined in the space where the output data is located, and the loss value refers to the result after processing the output data and the target data through the loss function. For example, the squared error function can be used as the loss function, and in this case, the loss value is defined as the sum of the squares of the differences between the output data and the target data.
[0060] The main content of the TBPTT algorithm is as follows: After calculating the loss value for the output data and target data of the recurrent neural network, the chain rule for partial derivatives of composite functions can be used to find the partial derivative of the loss value with respect to the parameters of the recurrent neural network, which is called the direct partial derivative. At the same time, the chain rule for partial derivatives of composite functions can be used to find the partial derivative of the loss value with respect to the hidden encoding, which is called the first hidden encoding partial derivative. Since this hidden encoding is the output value of the model at the previous moment, the chain rule for partial derivatives of composite functions can continue to be used to find the partial derivative of the loss value with respect to the model parameters at the previous moment, which is called the first iteration partial derivative. The process of solving the first hidden encoding partial derivative and the first iteration partial derivative is collectively called the first backpropagation process. Further repeat the steps in the first forward propagation process to solve the second hidden encoding partial derivative and the second iteration partial derivative, which is called the second backpropagation process. Repeat this several times until the total number of steps reaches the pre-selected total number of truncation step lengths and stop repeating. Since the models at the above several moments and the current moment of the recurrent neural network share the same parameters, according to the superposition principle of partial derivatives of composite functions, the overall partial derivative is obtained by summing up all the truncation step length total iteration partial derivatives and direct partial derivatives above.
[0061] Among them, the gradient-based optimization algorithm uses the overall partial derivative as the optimization gradient of the recurrent neural network parameters for optimization. Including but not limited to gradient descent method, stochastic gradient descent method, adaptive moment estimation gradient descent method, etc. By executing the gradient-based optimization algorithm, the un-converged model parameters will continuously change.
[0062] Repeatedly executing the TBPTT steps and the gradient-based optimization algorithm on the un-converged model will obtain the un-converged model parameters arranged according to the number of optimization times. Specify the training iteration interval number. Whenever the TBPTT steps and the gradient optimization steps are repeated to reach the training iteration interval number, execute a validation set verification step once, and obtain the model performance evaluation on the validation set and record the corresponding model parameters. Repeat the TBPTT steps and the gradient optimization steps until the total number of times reaches the total number of training iterations and then stop. According to the recorded series of model performance evaluations, select the model parameters of the best one as the result of the first method. At the same time, the model training device packages the model parameters into a model parameter file as the output.
[0063] Among them, performing the verification step on the unconverged model in the verification set includes, first, taking the first data sequence in the verification set as the verification sequence. Taking the state partial observation data, control data, and a hidden encoding of all zeros at the first time step of the verification sequence as the input of the unconverged model, the model outputs the state partial observation prediction data at the second time step and the hidden encoding output at the first time step. Then, taking the state partial observation prediction data at the second time step, the control data at the second time step in the verification sequence, and the hidden encoding output at the first time step as the input, the model outputs the state partial observation prediction data at the third time step and the hidden encoding output at the second time step. Repeat the above steps until the total length of the verification sequence is reached. Take the root mean square error of the state partial observation prediction data at each time step in the repeating process and the state partial observation prediction data of the verification sequence in turn as the root mean square error of this verification sequence. Finally, repeat the above verification steps for the remaining data sequences in the verification set to obtain the root mean square error of each verification sequence in the entire verification set, and take the average of all root mean square errors to obtain the overall average root mean square error of the verification set as the model performance on the verification set. The model training device records the model performance on this verification set and the model parameters that are unconverged at this time for comparison with the model performance obtained from subsequent verifications to obtain the model parameters with the optimal model performance on the verification set.
[0064] Generally speaking, the model training device takes the training data machine and verification data set including sequences of vehicle state partial observation data and control data as the input, uses the TBPTT algorithm and the gradient-based optimization algorithm to iteratively optimize the parameters of the recurrent neural network, and performs verification on the verification set during the iterative optimization process and outputs the model parameters with the optimal verification performance according to the verification results as the output of the device, and this output is the dynamic model of the vehicle.
[0065] In a second aspect, the vehicle state partial observation prediction method and the dynamic prediction device in the present application need to use the vehicle dynamic model output by the model training part as the dynamic model to predict the future vehicle state partial observation data. By continuously combining the existing vehicle state partial observation data and control data of the vehicle with the hidden encoding output most recently and inputting them into the vehicle dynamic model, the vehicle dynamic model will continuously predict the future vehicle state partial observation data.
[0066] Specifically, first, the vehicle dynamics model output in the model training part is stored in the dynamics prediction device. Then, a completely zero hidden encoding is generated and stored in the device at the start of a vehicle state partial observation prediction task. In the vehicle state partial observation online prediction task, for each time step, the current vehicle state partial observation and control data are input into the device and combined with the last stored hidden encoding as input data to be input into the dynamics model. The dynamics model outputs the future vehicle state partial observation and hidden encoding. After completing the prediction for each time step, the device stores the hidden encoding output at the current time step as the last stored hidden encoding.
[0067] Specifically, the dynamics prediction device can complete the vehicle state partial observation offline open-loop prediction task, that is, the task of predicting the vehicle partial state observation at the remaining time steps except the initial time step by only specifying the initial vehicle partial state observation and the complete control data sequence. In the offline open-loop prediction task, the predicted future vehicle state partial observation output at each moment can be stored and used as the vehicle state partial observation input at the next moment. Combining with the vehicle open-loop control data sequence, the offline open-loop dynamics state observation prediction can be completed. Compared with the vehicle state partial observation online prediction task, the characteristic of the offline open-loop task is that only the vehicle partial state observation at the first time step is specified, and the input of the subsequent vehicle dynamics model is the latest vehicle partial state observation stored by the dynamics prediction device itself at the past moment, without the need to input the actual measurement value of the vehicle partial state observation every time.
[0068] Generally speaking, the dynamics prediction device is used to store the vehicle dynamics model output by the model training device in the device, construct a completely zero hidden encoding at the start of the task, and use the current partial state observation data and control data of the vehicle in each step of the prediction task, combined with the last stored hidden encoding as the input of the vehicle dynamics. The vehicle dynamics outputs the future vehicle partial observation prediction data and the hidden encoding at the current moment. The device stores the hidden encoding at the current moment as the last stored hidden encoding and uses it as the partial model input at the next moment.
[0069] A vehicle dynamics model containing a recurrent neural network runs on the vehicle dynamics prediction device described in this application. This dynamics model takes the vehicle partial observation, control quantity at the current prediction moment, and the hidden encoding at the previous moment as inputs at any moment, predicts the future state partial observation, and inputs the hidden encoding at the current moment. In addition, in order to obtain the vehicle dynamics model containing a recurrent neural network, it is necessary to collect the dynamics observation data sequence and vehicle control quantity data sequence of the target vehicle as modeling data. This application uses the TBPTT method to continuously train the dynamics model containing a recurrent neural network, and outputs the model with the lowest verification error after being verified by the test data as the modeling result.
[0070] For the vehicle dynamics modeling and vehicle state prediction method provided in this application, the mean square error of the full trajectory of the model trained on the simulated vehicle data set on the test set is 5.84 m. The number of model parameters and floating-point computations used in the method proposed in this application are 18.8 MB and 1.8e7 Flops respectively, and the computation time is 224 μs. For comparison, on the same data set and the same computing device, the error of the reproduced existing solution is 17.36 m, the number of model residues and floating-point computations are 1.2 GB and 1.1e9 Flops respectively, and the computation time is 1707 μs; where, MB is megabyte, Flops is the number of floating-point operations, and GB is gigabyte.
[0071] See Figure 2 , an embodiment of this application also provides a vehicle dynamics modeling and vehicle state prediction system, including: a data set module 101, a vehicle dynamics model construction module 102, and a dynamics prediction module 103 connected in sequence; the data set module 101 is used to obtain modeling data; the modeling data includes the kinematic observation data sequence and the control quantity data sequence of the vehicle to be modeled; the modeling data is divided into training data and test data; the vehicle dynamics model construction module 102 is used to train the parameters of the recurrent neural network according to the training data to obtain a vehicle dynamics model; and based on the test data, test the vehicle dynamics model to obtain a final vehicle dynamics model; the dynamics prediction module 103 is used to store the final vehicle dynamics model in the dynamics prediction device to obtain a dynamics prediction model; input the partial observation data of the vehicle state, the control quantity data, and the hidden encoding of the previous moment at the current moment into the dynamics prediction model to predict the partial observation data of the future vehicle state; where, the hidden encoding of the previous moment is obtained by storing the hidden encoding output at the current time step after the dynamics prediction device completes the prediction of each time step.
[0072] See Figure 3 , another embodiment of this application provides an electronic device, including: at least one processor 110; and a memory 111 communicatively connected to the at least one processor; where, the memory 111 stores instructions executable by the at least one processor 110, and the instructions are executed by the at least one processor 110 so that the at least one processor 110 can execute any of the above method embodiments.
[0073] Among them, the memory 111 and the processor 110 are connected in a bus manner. The bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors 110 and the memory 111 together. The bus may also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, etc., which are well known in the art, and thus will not be further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or multiple elements, such as multiple receivers and transmitters, and provides a unit for communicating with various other devices on the transmission medium. The data processed by the processor 110 is transmitted on the wireless medium through the antenna. Further, the antenna also receives data and transmits the data to the processor 110.
[0074] The processor 110 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. The memory 111 can be used to store the data used by the processor 110 when executing operations.
[0075] Another embodiment of the present application relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the method embodiments described above are implemented.
[0076] That is, those skilled in the art can understand that all or part of the steps in implementing the above method embodiments can be completed by instructing relevant hardware through a program. The program is stored in a storage medium, including several instructions for causing a device (which may be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the above methods of the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0077] With the above technical solutions, the embodiments of the present application provide a vehicle dynamics modeling and vehicle state prediction method, system, device, and medium. The method includes the following steps: First, obtain modeling data; the modeling data includes a kinematic observation data sequence and a control quantity data sequence of the vehicle to be modeled; then, divide the modeling data into training data and test data; next, based on the training data, train the parameters of the recurrent neural network to obtain a vehicle dynamics model; and based on the test data, test the vehicle dynamics model to obtain a final vehicle dynamics model; then, store the final vehicle dynamics model in the dynamics prediction device to obtain a dynamics prediction model; finally, input the partial observation data of the vehicle state, the control quantity data, and the hidden encoding of the previous moment at the current moment into the dynamics prediction model to predict the partial observation data of the future vehicle state; where the hidden encoding of the previous moment is obtained by storing the hidden encoding output at the current time step after the dynamics prediction device completes the prediction for each time step.
[0078] The vehicle dynamics modeling and vehicle state prediction method provided by the present application runs a vehicle dynamics model containing a recurrent neural network on the dynamics prediction device. The vehicle dynamics model takes the partial observation of the vehicle, the control quantity, and the hidden encoding of the previous moment at any moment as inputs, predicts the partial observation of the future state, and inputs the hidden encoding of the current moment. The present application also uses the TBPTT method to continuously train the dynamics model containing the recurrent neural network, and outputs the model with the lowest verification error after being verified by the test data as the modeling result. Since the recurrent neural network is trained by the TBPTT method as the core component of dynamics modeling, on the one hand, the vehicle dynamics modeling and vehicle state prediction method provided by the present application allows the use of available data of any time length as inputs to predict the partial observation of the future state, so it has higher data processing flexibility and prediction accuracy. On the other hand, while completing the prediction processing of the current time step, the present application outputs a fixed-length hidden encoding as the input for the next prediction, thus avoiding reprocessing the historical available data, reducing the average computational amount of single-step prediction, and improving the prediction frame rate.
[0079] Those of ordinary skill in the art can understand that the above embodiments are specific embodiments for implementing the present application, and in practical applications, various changes can be made in form and details without departing from the spirit and scope of the present application. Any person skilled in the art can make their own changes and modifications within the spirit and scope of the present application. Therefore, the protection scope of the present application should be subject to the scope defined by the claims.
Claims
1. A vehicle dynamics modeling and vehicle state prediction method, characterized in that, it includes: Obtain modeling data; the modeling data includes a kinematic observation data sequence and a control quantity data sequence of the vehicle to be modeled; Divide the modeling data into training data and test data; Based on the training data, train the parameters of the recurrent neural network to obtain a vehicle dynamics model; and based on the test data, test the vehicle dynamics model to obtain the final vehicle dynamics model; Store the final vehicle dynamics model in the dynamics prediction device to obtain a dynamics prediction model; Input the partially observed data of the vehicle state, the control quantity data, and the hidden encoding of the previous moment at the current moment into the dynamics prediction model to predict the partially observed data of the future vehicle state; wherein, the hidden encoding of the previous moment is stored by the dynamics prediction device after completing the prediction of each time step for the hidden encoding output at the current time step.
2. The vehicle dynamics modeling and vehicle state prediction method according to claim 1, characterized in that, The input of the partially observed data of the vehicle state, the control quantity data, and the hidden encoding of the previous moment of the vehicle into the dynamics prediction model to predict the partially observed data of the future vehicle state includes: At the start of a partially observed vehicle state prediction task, generate a all-zero hidden encoding and store it in the dynamics prediction device; In the online prediction task of the partially observed vehicle state, for each time step, input the current partially observed data of the vehicle state, the control quantity data, and the hidden encoding of the previous moment into the dynamics model, and the dynamics model outputs the partially observed data of the future vehicle state and a new hidden encoding.
3. The vehicle dynamics modeling and vehicle state prediction method according to claim 1, characterized in that, The kinematic observation data sequence of the vehicle to be modeled is obtained by sampling at a fixed time interval; The kinematic observation data of the vehicle to be modeled includes the position data, speed data, azimuth angle data, and azimuth angular velocity data of the vehicle.
4. The vehicle dynamics modeling and vehicle state prediction method according to claim 1, characterized in that, The control quantity data sequence is obtained by sampling at a fixed time interval; The control quantity data includes the power control quantity, braking control quantity, and steering wheel control quantity of the vehicle to be modeled.
5. The vehicle dynamics modeling and vehicle state prediction method according to claim 1, characterized in that, Based on the proportion of the data length in the modeling data to the total length, divide the modeling data into training data and test data.
6. The vehicle dynamics modeling and vehicle state prediction method according to claim 1, characterized in that, Based on the training data, training the parameters of the recurrent neural network to obtain a vehicle dynamics model includes: Initialize the recurrent neural network as the initial dynamics model; Use the initial dynamics model to input the input data and the hidden encoding of the previous moment in the training data and output the dynamics prediction of the future moment as the output data; Calculate the loss value between the output data and the target data in the training data using a loss function; Use the TBPTT method to calculate the partial derivatives of the parameters in the initial dynamics model with respect to the loss value, and iteratively optimize the parameters in the initial dynamics model based on a gradient-based optimization algorithm to obtain a vehicle dynamics model.
7. The vehicle dynamics modeling and vehicle state prediction method according to claim 6, characterized in that testing the vehicle dynamics model based on the test data to obtain a final vehicle dynamics model, including: calculating a prediction accuracy index of the vehicle dynamics model based on the test data; judging whether the prediction accuracy index is better than the optimization result in the iterative optimization process; if so, record the vehicle dynamics model at the current moment as the current optimal model, and record the prediction accuracy of the test data at the current moment as the optimal accuracy; if not, continue the iterative optimization process; wherein the iterative optimization process is a process of iteratively optimizing the parameters in the initial dynamics model.
8. A vehicle dynamics modeling and vehicle state prediction system, characterized in that comprising: a data set module, a vehicle dynamics model construction module, and a dynamics prediction module connected in sequence; the data set module is used to obtain modeling data; the modeling data includes a kinematic observation data sequence and a control quantity data sequence of a vehicle to be modeled; the modeling data is divided into training data and test data; the vehicle dynamics model construction module is used to train the parameters of a recurrent neural network according to the training data to obtain a vehicle dynamics model; and test the vehicle dynamics model based on the test data to obtain a final vehicle dynamics model; the dynamics prediction module is used to store the final vehicle dynamics model into a dynamics prediction device to obtain a dynamics prediction model; input the partially observed data of the vehicle state, the control quantity data, and the hidden encoding of the previous moment at the current moment into the dynamics prediction model to predict the partially observed data of the future vehicle state; wherein the hidden encoding of the previous moment is stored by the dynamics prediction device after completing the prediction of each time step for the hidden encoding output at the current time step.
9. An electronic device, characterized in that comprising: at least one processor; and, a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the vehicle dynamics modeling and vehicle state prediction method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the vehicle dynamics modeling and vehicle state prediction method according to any one of claims 1 to 7.
Citation Information
Patent Citations
A simulation system vehicle dynamics model speed prediction method based on LSTM
CN109783843A
Method and device for constructing vehicle kinetic model and method and device for predicting vehicle state information
CN112464577A