Vehicle state prediction method, electronic equipment and storage medium
By using gradient descent algorithm for iterative training in the vehicle state prediction model, the lateral stiffness parameters are updated in real time, which solves the problem that the vehicle state prediction model in the prior art cannot respond to dynamic changes in real time, and improves the vehicle's handling performance and safety.
Patent Information
- Application Number
- CN202510261720.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-06-24
AI Technical Summary
The existing vehicle status prediction model cannot respond to dynamic changes in vehicle status and driving conditions in real time, and it is difficult to meet the requirements of the autonomous driving system for real-time and adaptability.
By obtaining vehicle status data, input it into the simplified vehicle dynamic model, the gradient descent algorithm is used for iterative training of the model, and the lateral stiffness parameters are updated in real time to achieve timely update of the vehicle status prediction model.
The calculation efficiency of the vehicle state prediction model is improved, the real-time online recognition of lateral stiffness is ensured, and the vehicle's handling performance, stability and safety are enhanced.
Smart Images

Figure CN120197476A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of autonomous driving, and particularly to a vehicle state prediction method, an electronic device, and a storage medium. Background Art
[0002] In the field of autonomous driving technology, the accuracy of the vehicle state prediction model is crucial for improving the handling performance, stability, and safety of vehicles. As a key parameter in the vehicle state prediction model, the accurate identification of the cornering stiffness has a significant impact on vehicle dynamics modeling and control system design. Through accurate parameter identification, the vehicle state can be predicted more accurately, enabling the vehicle to respond in real time according to the predicted vehicle state, thereby improving the handling performance, stability, and safety of the vehicle.
[0003] However, the current vehicle state prediction model cannot respond in real time to the dynamic changes in vehicle state and driving conditions, and it is difficult to meet the requirements of real-time performance and adaptability of the autonomous driving system. For example, some online identification methods use the least squares method for cornering stiffness identification to update the cornering stiffness parameter in the vehicle state prediction model. Although this method can provide a certain degree of real-time performance, its computational efficiency is low, making it difficult to meet the high real-time requirements in autonomous driving. Summary of the Invention
[0004] Embodiments of this application provide a vehicle state prediction method, an electronic device, and a storage medium to meet the requirements of real-time performance and adaptability of autonomous driving.
[0005] In a first aspect, the present application provides a vehicle state prediction method, including: obtaining vehicle state data at a first moment, inputting the vehicle state data at the first moment into a vehicle state prediction model, and obtaining predicted state data at a second moment output by the vehicle state prediction model. The vehicle state prediction model is determined by the following method: obtaining a training sample set and an initial model, where the training sample set includes a plurality of sample data and a plurality of target data, and the plurality of sample data and the plurality of target data correspond one by one. The initial model is a vehicle dynamics model after discretization processing and approximation processing, and the parameters of the initial model include cornering stiffness; determining the initial model as an intermediate model; determining the first sample data among the plurality of sample data as the current sample data; inputting the initial data and input data corresponding to the current sample data into the intermediate model, and obtaining predicted data corresponding to the current sample data output by the intermediate model; based on the difference between the target data corresponding to the current sample data and the predicted data corresponding to the current sample data, updating the cornering stiffness of the intermediate model through a gradient descent algorithm; corresponding to determining that the predicted data meets the error condition, determining the vehicle state prediction model based on the intermediate model; corresponding to determining that the predicted data does not meet the error condition, updating the current sample data to the next sample data among the plurality of sample data, and re-updating the cornering stiffness of the intermediate model based on the input data corresponding to the updated current sample data.
[0006] That is, in the embodiments of the present application, thus, based on the simplified vehicle dynamics model, iterative training of the model is performed through the gradient descent algorithm, which can improve the computational efficiency of the model training process, thereby ensuring the real-time performance of the online identification of the cornering stiffness and realizing the timely update of the vehicle state prediction model. That is, during the vehicle driving process, the cornering stiffness parameter in the vehicle state prediction model can be updated in real time, so that the model can be adjusted in time according to the driving data of the vehicle. In a possible implementation of the above first aspect, the current sample data includes different first state data and second state data. Before inputting the initial data and input data corresponding to the current sample data into the intermediate model, the method further includes: extracting the first state data from the current sample data as the initial data corresponding to the current sample data; extracting the second state data from the current sample data as the input data corresponding to the current sample data.
[0007] In a possible implementation of the above first aspect, the data types of the initial data and the predicted data are the same. After updating the current sample data to the next sample data among the plurality of sample data, the method further includes: determining the predicted data as the initial data corresponding to the current sample data.
[0008] In a possible implementation of the above first aspect, updating the cornering stiffness of the intermediate model through the gradient descent algorithm includes: updating the cornering stiffness of the intermediate model based on the loss function through the gradient descent algorithm. The method further includes: determining the loss function based on the product of the square of the data difference and a preset fixed parameter, where the data difference is the difference between the target data and the predicted data.
[0009] In a possible implementation of the above first aspect, the predicted data is the predicted value of the driving data, the target data is the reference value of the driving data, the driving data includes at least one of speed and angular velocity. Updating the cornering stiffness of the intermediate model through the gradient descent algorithm based on the target data corresponding to the current sample data, the predicted data corresponding to the current sample data, and the loss function includes: determining the first gradient of the loss function with respect to the driving data based on the target data, the predicted data, and the loss function; determining the second gradient of the driving data with respect to the cornering stiffness; determining the third gradient of the loss function with respect to the cornering stiffness based on the first gradient and the second gradient; updating the cornering stiffness of the intermediate model through the gradient descent algorithm based on the third gradient.
[0010] In a possible implementation of the above first aspect, updating the cornering stiffness of the intermediate model through the gradient descent algorithm based on the third gradient includes: determining the current learning rate of the gradient descent algorithm; determining the momentum term of the gradient descent algorithm; determining the current weight factor of the gradient descent algorithm; updating the cornering stiffness of the intermediate model based on the first product of the current learning rate and the third gradient, and the second product of the current weight factor and the momentum term.
[0011] In a possible implementation of the above first aspect, after updating the cornering stiffness of the intermediate model, the method further includes: updating the current weight factor to the third gradient.
[0012] In a possible implementation of the above first aspect, before inputting the initial data and the input data corresponding to the current sample data into the intermediate model, the method further includes: obtaining the initial learning rate; determining the initial learning rate as the current learning rate; determining the current learning rate of the gradient descent algorithm includes: updating the current learning rate by decaying the current learning rate based on a preset decay rate.
[0013] In a possible implementation of the above first aspect, before inputting the initial data and the input data corresponding to the current sample data into the intermediate model, the method further includes: obtaining the initial error; determining the initial error as the current reference error; determining that the predicted data meets the error condition includes: determining the iterative error between the predicted data and the target data; corresponding to the iterative error being less than the current reference error, determining that the predicted data meets the error condition.
[0014] In a possible implementation of the first aspect described above, the method further includes: corresponding to determining that the predicted data does not meet the error condition, updating the current reference error to an iterative error.
[0015] In a possible implementation of the first aspect described above, after determining the iterative error based on the predicted data and the target data, the method further includes: adding the iterative error to an error set; determining a vehicle state prediction model based on an intermediate model, including: determining the intermediate model corresponding to the smallest iterative error in the error set as the vehicle state prediction model.
[0016] In a possible implementation of the first aspect described above, obtaining an initial model includes: determining a vehicle dynamics model, where the vehicle dynamics model includes parameters of the vehicle state prediction model; discretizing the vehicle dynamics model to obtain a discretized model; and approximating the discretized model to obtain an initial model.
[0017] In a possible implementation of the first aspect described above, the cornering stiffness includes at least one of the following cornering stiffnesses: front wheel cornering stiffness and rear wheel cornering stiffness.
[0018] In a possible implementation of the first aspect described above, the vehicle state data includes at least one of the following data: speed, angular velocity.
[0019] In a possible implementation of the first aspect described above, the parameters of the initial model further include at least one of the following parameters: vehicle mass, moment of inertia, distance from the vehicle center of mass to the center of the front axle, distance from the vehicle center of mass to the center of the rear axle.
[0020] In a second aspect, the present application provides an electronic device, which includes: one or more processors; one or more memories; and one or more memories store one or more programs, when the one or more programs are executed by the one or more processors, the electronic device is caused to execute the vehicle state prediction method of the first aspect and any possible implementation of the first aspect.
[0021] In a third aspect, the present application provides a computer-readable storage medium, on which instructions are stored, and when the instructions are executed on an electronic device, the electronic device is caused to execute the vehicle state prediction method of the first aspect and any possible implementation of the first aspect.
[0022] In a fourth aspect, the present application provides a computer program product, which includes: computer instructions, and when the computer instructions run on an electronic device, the electronic device is caused to execute the vehicle state prediction method of the first aspect and any possible implementation of the first aspect.
[0023] Among them, the beneficial effects of the second to fourth aspects can be referred to the beneficial effects of the first aspect and any possible implementation of the first aspect, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 According to some embodiments of the present application, a schematic flowchart of a vehicle state prediction method is shown;
[0025] Figure 2 According to some embodiments of the present application, a schematic flowchart of a method for determining an initial model is shown;
[0026] Figure 3 According to some embodiments of the present application, a schematic flowchart of a feedforward calculation method is shown;
[0027] Figure 4 According to some embodiments of the present application, a schematic flowchart of a feedback calculation method is shown;
[0028] Figure 5 According to some embodiments of the present application, a schematic structural diagram of an electronic device is shown. DETAILED DESCRIPTION
[0029] Illustrative embodiments of the present application include, but are not limited to, vehicle state prediction methods, electronic devices, and storage media.
[0030] It can be understood that the electronic devices applicable to the vehicle state prediction method provided by the embodiments of the present application include, but are not limited to, autonomous vehicles, tablet computers (Pads), computers with wireless transceiver functions, virtual reality (VR) devices, augmented reality (AR) devices, wireless devices in industrial control, wireless devices in self-driving, wireless devices in remote medical surgery, wireless devices in smart grids, wireless devices in transportation safety, wireless devices in smart cities, wireless devices in smart homes, and so on.
[0031] In some scenarios, when an autonomous vehicle is driving in real time, it needs to process a large amount of sensor data in real time and make quick responses based on this data. This requires the vehicle state prediction model in the vehicle to be updated in real time, so as to accurately reflect the actual interaction between the tire and the road surface through the updated cornering stiffness in real time, thereby accurately predicting the vehicle state, enabling the vehicle to control the vehicle for autonomous driving or assist the vehicle in driving based on the predicted vehicle state.
[0032] However, as mentioned above, the current vehicle state prediction model lacks real-time performance, resulting in the inability of the vehicle state prediction model to be updated in a timely manner according to the environment, causing the predicted vehicle state to deviate from the actual state.
[0033] Therefore, to solve the above technical problems, the present application provides a vehicle state prediction method. This method uses a discretized and approximated vehicle dynamics model as the initial model, and trains the initial model based on the gradient descent algorithm to obtain a trained vehicle state prediction model, and then predicts the vehicle state through the vehicle state prediction model. In this way, based on a simplified model and through model training using the gradient descent algorithm, the calculation efficiency can be improved, thereby ensuring the real-time performance of the online identification of the cornering stiffness and realizing the timely update of the vehicle state prediction model.
[0034] The vehicle state prediction method provided by the present application will be described in detail below with reference to the accompanying drawings. Figure 1 The flowchart of the first vehicle state prediction method provided by the present application is shown. Figure 1 The execution subject of each step in the shown process is an electronic device. For the sake of convenience of description, the execution subject of each step will not be repeatedly described hereinafter when introducing Figure 1 each step in the shown process.
[0035] According to some embodiments, the present application provides a vehicle state prediction method, including: obtaining vehicle state data at a first moment, and inputting the vehicle state data at the first moment into the vehicle state prediction model to obtain predicted state data at a second moment output by the vehicle state prediction model. Wherein, there may be a time step between the first moment and the second moment, and the second moment is a moment after the first moment. It can be understood that the present application does not limit the specific value of the time step. According to some embodiments, the vehicle state prediction method further includes the process of training to obtain the vehicle state prediction model.
[0036] As Figure 1 shown, according to some embodiments, the process of determining the vehicle state prediction model includes but is not limited to the following steps.
[0037] S101: Obtain a training sample set and an initial model.
[0038] It can be understood that the training sample set includes a plurality of sample data and a plurality of target data, and the plurality of sample data and the plurality of target data correspond one by one. Among them, the target data can be used to compare with the predicted data corresponding to the sample data. If the difference between the target data and the predicted data is smaller, it indicates that the output of the initial model during the training process is more accurate. If the difference between the target data and the predicted data is larger, it indicates that the output of the initial model during the training process is less accurate.
[0039] It can be understood that the initial model is a vehicle dynamics model after discretization processing and approximation processing, and the parameters of the initial model include cornering stiffness.
[0040] According to some embodiments, referring to Figure 2 , the initial model can be obtained through the following steps.
[0041] S201: Determine the vehicle dynamics model.
[0042] It can be understood that the parameters of the vehicle dynamics model are the same as those of the initial model or the vehicle state prediction model (i.e., the trained initial model).
[0043] According to some embodiments, the vehicle dynamics model is as follows.
[0044]
[0045] Among them, x represents the longitudinal characteristic in the vehicle coordinate system, y represents the lateral characteristic in the vehicle coordinate system; a and b respectively represent the distances from the vehicle center of mass to the centers of the front and rear axles; m is the vehicle mass, I is the moment of inertia, C f is the front wheel cornering stiffness, C r is the rear wheel cornering stiffness, δ f is the front wheel steering angle, is the vehicle body yaw angle.
[0046] It can be understood that, as an example, the above x and y can be the driving data of the vehicle in the longitudinal and lateral directions, such as longitudinal speed and lateral speed respectively.
[0047] S202: Perform discretization processing on the vehicle dynamics model to obtain a discretized model.
[0048] After determining the vehicle dynamics model, the vehicle dynamics model can be discretized to obtain a discretized model.
[0049] According to some embodiments, the discretized model is as follows.
[0050]
[0051] Among them, v x0 represents the longitudinal speed at the first moment in the vehicle coordinate system, vy0 represents the lateral velocity at the first moment in the vehicle's own coordinate system, \(v\) y1 represents the lateral velocity at the second moment in the vehicle's own coordinate system.
[0052] \(a\) and \(b\) respectively represent the distances from the vehicle's center of mass to the centers of the front and rear axles; \(m\) is the vehicle mass, \(I\) is the moment of inertia, \(C\) f is the front wheel cornering stiffness, \(C\) r is the rear wheel cornering stiffness, \(\delta\) f is the front wheel steering angle, is the vehicle body yaw angle, \(\omega_0\) is the yaw angular velocity at the first moment, and \(\omega_1\) is the yaw angular velocity at the second moment.
[0053] S203: Perform an approximation process on the discretized model to obtain an initial model.
[0054] After determining the discretized model, an approximation process can be performed on the discretized model to obtain an initial model.
[0055] For example, it can be set that \(\cos\delta\) f = 1, and substitute this value into formula (3) and formula (4) to obtain the following initial model.
[0056]
[0057] where, \(v\) x0 represents the longitudinal velocity at the first moment in the vehicle's own coordinate system, \(v\) y0 represents the lateral velocity at the first moment in the vehicle's own coordinate system, \(v\) y1 represents the lateral velocity at the second moment in the vehicle's own coordinate system.
[0058] \(a\) and \(b\) respectively represent the distances from the vehicle's center of mass to the centers of the front and rear axles; \(m\) is the vehicle mass, \(I\) is the moment of inertia, \(C\) f is the front wheel cornering stiffness, \(C\) r is the rear wheel cornering stiffness, is the vehicle body yaw angle, \(\omega_0\) is the yaw angular velocity at the first moment, and \(\omega_1\) is the yaw angular velocity at the second moment.
[0059] It can be understood that after obtaining the above initial model, the initial model can be trained according to the training sample set to obtain a trained initial model as the vehicle state prediction model. It can be understood that in the offline state, the initial model can be trained based on the offline collected sample set to update the parameters of the initial model to obtain the vehicle state prediction model. In addition, in the online state, samples can be collected in real time, and based on the real-time collected samples, the vehicle state prediction model can be trained in real time to update the parameters of the vehicle state prediction model, thereby updating the vehicle state prediction model.
[0060] It can be understood that the vehicle state prediction model in the embodiments of the present application is a trained initial model. Taking the input of the model as the data at the first moment and the output of the model as the data at the second moment as an example, the input of the model includes v x0 , v y0 , ω0, dt, and the output includes v y1 , ω1. The parameters include m, a, b, C f , C r , and I = mab. It can be understood that the first moment can represent the moment of the current sample data, the second moment can represent the moment of the predicted data corresponding to the current sample data, and the time difference between the two moments can be dt.
[0061] Through the embodiments of the present application, training the initial model obtained after discretization processing and approximation processing can reduce the computing power required for training, thereby improving the model training efficiency on the basis of ensuring the accuracy of the model.
[0062] S102: Determine the initial model as the intermediate model.
[0063] It can be understood that the initial model can obtain the vehicle state prediction model through multiple rounds of iterative training. And with each round of iteration, the initial model can be used as the intermediate model for training and update the model parameters.
[0064] S103: Determine the first sample data in the training sample set as the current sample data.
[0065] It can be understood that during the iteration process, each sample data in the training sample set can be traversed. Among them, in the first round of iteration, the first sample data can be determined as the current sample data.
[0066] S104: Input the initial data and input data corresponding to the current sample data into the intermediate model to obtain the predicted data corresponding to the current sample data output by the intermediate model.
[0067] It can be understood that after determining the current sample data, a feedforward calculation can be performed for the current sample data. Among them, the initial data and input data corresponding to the current sample data can be determined, and the initial data and input data can be input into the intermediate model to predict the predicted data corresponding to the current sample data through the intermediate model.
[0068] According to some embodiments, the initial data includes v y0 , ω0, the input data includes v x0 , dt, and the predicted data includes v y1 , ω1.
[0069] It can be understood that for each iteration, the input data can be extracted from the current sample data. Among them, the input data is v x0 , dt, which respectively represent the longitudinal speed at the current moment and the time step of the training sample set.
[0070] It can be understood that for the first iteration, the initial data can be extracted from the current sample data. For each iteration after the first iteration, the initial data can be the predicted data output by the intermediate model during the previous iteration. That is to say, the predicted data output each time can be used as the initial data for the next iteration. Among them, the initial data includes v y0 , ω0, which respectively represent the lateral speed at the current moment and the yaw angular velocity at the current moment.
[0071] S105: Update the cornering stiffness of the intermediate model through the gradient descent algorithm based on the difference between the target data corresponding to the current sample data and the predicted data corresponding to the current sample data.
[0072] It can be understood that after the feedforward calculation is completed, the feedback calculation can be performed for the current sample data. After determining the predicted data corresponding to the current sample data, the intermediate model can be trained through the gradient descent algorithm based on the difference between the predicted data and the target data, and the cornering stiffness of the intermediate model can be updated. Among them, the target data is the target data corresponding to the current sample data in the training sample set.
[0073] According to some embodiments, the cornering stiffness of the intermediate model can be updated based on the loss function through the gradient descent algorithm. In this embodiment, the method can further include the step of determining the loss function, where the loss function can be determined based on the product of the square of the data difference and a fixed parameter, and the data difference is the difference between the target data and the predicted data.
[0074] According to some embodiments, the loss function can be represented by Cost, as follows.
[0075] Cost = ∑(r1(v yr - v y1 ) 2 + r2(ω r - ω1) 2 ) (7)
[0076] Among them, v yr represents the target lateral speed in the target data, ω r represents the target yaw acceleration in the target data, v y1 represents the lateral speed at the second moment in the vehicle coordinate system, and ω1 is the yaw angular velocity at the second moment.
[0077] According to some embodiments, v y1and ω1 correspond to multiple moments, where the multiple moments are the moments after the first moment. The time difference between the first moment and the multiple moments is the time step d, and the time difference between adjacent moments among the multiple moments is the time step dt. That is, in this embodiment, the current sample data includes multiple data in the training sample set. The number of the multiple data can be a preset number, such as 10, which is not limited in the embodiments of the present application. For example, in the first round of iteration, the 1st to 10th sample data are used, and in the second round of iteration, the 11th to 20th sample data are used, and so on. And, except for the first moment corresponding to the first sample, the v data at each subsequent moment y1 and ω1 data can be obtained through feed-forward calculation. For example, the t-th moment and the (t + 1)-th moment are adjacent moments with an interval time step of dt. The predicted data v y0 , ω0 at the t-th moment output by the intermediate model, and the input data v x0 , dt extracted from the training sample set at the t-th moment are input into the intermediate model to obtain the predicted data v y1 , ω1 at the (t + 1)-th moment.
[0078] According to some embodiments, after obtaining the predicted data corresponding to the sample data, the intermediate model can be trained based on the difference between the predicted data and the target data through the gradient descent algorithm, and the cornering stiffness of the intermediate model can be updated. Wherein, the target data is the target data corresponding to the current sample data in the training sample set.
[0079] According to some embodiments, the partial derivative of the loss function can be obtained to get the gradient of the loss function, and then the cornering stiffness of the intermediate model can be updated along the negative gradient direction of the loss function. For example, updating the C f , C r , that is, updating the left-wheel cornering stiffness and the right-wheel cornering stiffness of the intermediate model.
[0080] According to some embodiments, the steps of obtaining the partial derivative based on the loss function through the backpropagation algorithm are as follows.
[0081] The first step: Obtain the first gradient of the loss function with respect to v y1 , ω1.
[0082]
[0083] The second step: Obtain the second gradient of v y1 , ω1 with respect to C f , C r .
[0084]
[0085] The third step: Based on the above first gradient and second gradient, obtain the gradient of the loss function with respect to C f , C rThe third gradient.
[0086]
[0087] It can be understood that the above formulas (10) to (13) can be substituted into formulas (8) and (9) to obtain formulas (14) and (15). It can be understood that the above formulas (14) and (15) are the partial derivatives of the loss function with respect to the cornering stiffness, where formula (14) is the partial derivative of the loss function with respect to the front wheel cornering stiffness, and formula (15) is the partial derivative of the loss function with respect to the rear wheel cornering stiffness.
[0088] It can be understood that when indicating that the gradient direction of C f is the positive direction; when is less than 0, it indicates that the gradient direction of C f is the negative direction. When indicating that the gradient direction of C r is the positive direction; when is less than 0, it indicates that the gradient direction of C r is the negative direction.
[0089] According to some embodiments, the cornering stiffness can be updated based on the learning rate, the third gradient of the previous iteration, the momentum term, and the third gradient of the current iteration. For example, based on the third gradient, the cornering stiffness of the intermediate model is updated by the gradient descent algorithm, including: determining the learning rate of the gradient descent algorithm; determining the momentum term of the gradient descent algorithm; determining the weight factor (i.e., the third gradient of the previous iteration) of the gradient descent algorithm; updating the cornering stiffness of the intermediate model based on the product of the learning rate and the third gradient, and the product of the current weight factor and the momentum term.
[0090] For example, the formula for updating the cornering stiffness using the gradient descent algorithm is as follows.
[0091]
[0092] Among them, the above formulas (16) and (17) respectively represent C f and C r subtracting the values on the right side of the equal sign.
[0093] Among them, k is the learning rate, p is the momentum term, and S f and S r are respectively the third gradients of the previous iteration.
[0094] According to some embodiments, after updating the cornering stiffness, S f and S r can be updated by the following formula, that is, the weight factor is updated to the third gradient.
[0095]
[0096] According to some embodiments, for the first round of iteration, that is, for the first sample data in the training sample set, during the process of updating the cornering stiffness using the above formulas (16) and (17), S f and S r can be respectively initialized to 0.
[0097] According to some embodiments, the above learning rate can be gradually decayed round by round as the number of iteration rounds increases. That is, for each round of iteration, the learning rate can be decayed once to update the learning rate, and the decayed learning rate is used for the next round of iteration.
[0098] For example, the formula for decaying the learning rate is as follows.
[0099]
[0100] Among them, k represents the learning rate, and u represents the decay rate.
[0101] According to some embodiments, the error between the predicted data corresponding to the current sample data and the target data corresponding to the current sample data can be calculated through an error formula. For example, the error formula can be the loss function shown in the above formula (7). As an example, r1 and r2 can be respectively taken as 0.5.
[0102] According to some embodiments, the error of the current iteration and the cornering stiffness C f and C r updated in the current iteration can be correspondingly stored. That is to say, each set of C f and C r corresponds to the error of one iteration. After n rounds of iteration, the minimum value can be taken from multiple errors, and the C f and C r corresponding to the minimum error are determined as the parameters of the vehicle state prediction model.
[0103] S106: Determine whether the predicted data meets the error condition. If yes, go to S107; if not, go to S108.
[0104] According to some embodiments, the error condition can be that the error of the current iteration is less than the error of the previous round of iteration. It can be understood that the number of iteration rounds is at least greater than one round.
[0105] It can be understood that if it is determined that the predicted data meets the error condition, it can go to S108 to complete the training of the initial model and obtain the vehicle state prediction model; or, if it is determined that the predicted data does not meet the error condition, it can go to S107 and perform the training of the intermediate model for the next round of iteration.
[0106] For example, for the first round of iteration, the initial error of the first round of iteration can be obtained and determined as the current reference error. During the second and subsequent rounds of iteration, the iteration error between the predicted data and the target data can be determined; corresponding to the iteration error being less than the current reference error, it is determined that the predicted data meets the error condition; or, corresponding to determining that the predicted data does not meet the error condition, the current reference error is updated to the current iteration error.
[0107] S107: Update the current sample data to the next sample data among the multiple sample data, and go to S104.
[0108] It can be understood that since the model iteration is achieved by traversing each sample in the training sample set, after completing one round of iteration, the next sample data of the current sample data can be used as the sample data for the next round of iteration, and then go to S104 to start the next round of iteration.
[0109] Moreover, for the next sample data, the predicted data corresponding to the current sample data can be used as the initial data for the next round of sample data. For example, the predicted data v y1 , ω1 corresponding to the current sample data can be used as the input data v y0 , ω0 for the next sample data in the next round of iteration.
[0110] S108: Determine the vehicle state prediction model based on the intermediate model.
[0111] It can be understood that corresponding to determining that the predicted data meets the error condition, the vehicle state prediction model can be determined based on the intermediate model.
[0112] According to one embodiment, the minimum error can be determined from the errors of each round of iteration, and the cornering stiffness corresponding to the minimum error is determined as the target cornering stiffness. That is, in the iteration corresponding to the minimum error, the C f and C r updated respectively by the above formulas (16) and (17) are determined as the target cornering stiffness. And the intermediate model corresponding to the target cornering stiffness is determined as the vehicle state prediction model. That is, the cornering stiffness of the trained vehicle state prediction model is the above target cornering stiffness.
[0113] According to some embodiments, the above S101 - S108 can be the training process of the parameter - fixed model, that is, the process of training the vehicle state prediction model based on the offline - collected training sample set. It can be understood that based on the vehicle state prediction model, historical data such as lateral speed, longitudinal speed, and yaw rate collected by the vehicle odometer in the previous few seconds of the current moment can be used to infer the lateral speed and yaw rate at the next moment.
[0114] According to some embodiments, after training the fixed-parameter model, the training process of the dynamic-parameter model can be carried out. That is, after obtaining the vehicle state prediction model through offline training, the vehicle state prediction model can be used as an intermediate model, and the sample data collected in real time can be used as the current sample data, and S104 - S108 can be executed again to online identify and update the cornering stiffness of the intermediate model in real time, so as to update the vehicle state prediction model. And,
[0115] Through the embodiments of the present application, by using the stochastic gradient descent algorithm for model training to obtain the vehicle state training model, the training computing power can be saved, the training efficiency can be improved, and while ensuring the prediction accuracy of the model, the training speed can also meet the requirements of real-time performance. That is to say, through the vehicle state prediction method provided by the embodiments of the present application, the vehicle state training model can be used not only in the offline vehicle development scenario, but also in the real-time prediction scenario during vehicle driving, and can be dynamically updated according to the real-time parameter changes of the vehicle and the samples collected in real time, and the update efficiency is high.
[0116] It can be understood that in the above exemplary process of the vehicle state prediction method based on Figure 1 the feedforward calculation can be performed for the current sample data by executing S104 in each round of iteration. The following further introduces an exemplary process of feedforward calculation in combination with Figure 3 Specifically, the exemplary process of feedforward calculation includes but is not limited to the following steps.
[0117] S301: Determine the initial data for the first round of iteration.
[0118] According to some embodiments, for the first round of iteration, the initial data can be extracted from the current sample data. Among them, the initial data includes v y0 , ω0, which respectively represent the lateral speed at the current moment and the yaw angular velocity at the current moment.
[0119] S302: Traverse the training sample set to determine the current sample data.
[0120] According to some embodiments, the training sample set can be understood as a batch of sample data. Each round of iteration can be based on the current sample data in a batch of sample data. After the iteration is completed, the next sample data of the current sample data can be determined as the new current sample data.
[0121] S303: Extract the input data from the current sample data.
[0122] According to some embodiments, the input data includes v x0 , dt. It can be understood that for each iteration, the input data can be extracted from the current sample data. Among them, the input data is v x0, dt represent the longitudinal velocity at the current moment and the time step of the training sample set respectively.
[0123] S304: Input the input data and the initial data into the intermediate model, obtain the predicted data and store it.
[0124] According to some embodiments, the initial model can be determined as the intermediate model before the first round of iteration. The initial model can refer to formulas (5) and (6) in the above text, which will not be elaborated here. It can be understood that the predicted data includes v y1 , ω1, which represent the lateral velocity at the prediction moment and the yaw angular velocity at the prediction moment respectively.
[0125] S305: Determine the predicted data as the initial data for the next round of iteration.
[0126] According to some embodiments, after determining the predicted data, that is, after determining v y1 , ω1, these two data can be used as the initial data for the next round of iteration respectively, v y0 , ω0. It can be understood that the prediction moment corresponding to the predicted data of the current round of iteration can be the current moment corresponding to the current sample data of the next round of iteration.
[0127] It can be understood that after executing S301 - S305, S302 - S305 can be repeatedly executed until the training termination condition is met, such as the predicted data meets the error condition; or until each sample data in the training sample set is traversed.
[0128] It can be understood that in the above - mentioned exemplary process of the vehicle state prediction method based on Figure 1 introduced, in each round of iteration, S105 can be executed to perform feedback calculation for the current sample data and update the cornering stiffness parameter of the intermediate model. The following combines Figure 4 to further introduce an exemplary process of feedback calculation. Specifically, the exemplary process of feedback calculation includes but is not limited to the following steps.
[0129] S401: Determine the weight factor for the first round of iteration.
[0130] According to some embodiments, the weight factor is initialized to 0. And the weight factor can be the third gradient of the loss function with respect to the cornering stiffness in the previous round of iteration, which is used to update the cornering stiffness subsequently.
[0131] For example, the formula for updating the weight factor can refer to formulas (18) and (19) in the above text, and the formula for updating the cornering stiffness based on the weight factor can refer to formulas (16) and (17) in the above text, which will not be elaborated here.
[0132] S402: Traverse the training sample set to determine the current sample data.
[0133] According to some embodiments, the training sample set can be understood as a batch of sample data. Each iteration can be based on the current sample data in a batch of sample data. After the iteration is completed, the next sample data of the current sample data can be determined as the new current sample data.
[0134] S403: Based on the predicted data corresponding to the current sample data and the target data corresponding to the current sample data, determine the first gradient of the loss function with respect to the driving data.
[0135] According to some embodiments, the formula for determining the first gradient can refer to formulas (8) and (9) in the above text, which will not be elaborated here.
[0136] S404: Determine the second gradient of the driving data with respect to the cornering stiffness.
[0137] According to some embodiments, the formula for determining the second gradient of the driving data with respect to the cornering stiffness can refer to formulas (10) to (13) in the above text, which will not be elaborated here.
[0138] S405: Based on the first gradient and the second gradient, determine the third gradient of the loss function with respect to the cornering stiffness.
[0139] According to some embodiments, the formula for determining the third gradient of the loss function with respect to the cornering stiffness based on the first gradient and the second gradient can refer to formulas (14) and (15) in the above text, which will not be elaborated here.
[0140] S406: Use the gradient descent algorithm to update the cornering stiffness of the intermediate model.
[0141] It can be understood that using the gradient descent algorithm means updating the cornering stiffness of the intermediate model based on the negative gradient direction of the third gradient. For example, update C f , C r , that is, update the left-wheel cornering stiffness and the right-wheel cornering stiffness of the intermediate model.
[0142] According to some embodiments, the cornering stiffness can be updated based on the learning rate, the weight factor (i.e., the third gradient of the previous iteration), the momentum term, and the third gradient of the current iteration. For example, based on the third gradient, the cornering stiffness of the intermediate model is updated by the gradient descent algorithm, including: determining the learning rate of the gradient descent algorithm; determining the momentum term of the gradient descent algorithm; determining the weight factor (i.e., the third gradient of the previous iteration) of the gradient descent algorithm; and updating the cornering stiffness of the intermediate model based on the product of the learning rate and the third gradient, and the product of the current weight factor and the momentum term. According to some embodiments, the formula for updating the cornering stiffness can refer to formulas (16) and (17) above, which will not be elaborated here.
[0143] According to some embodiments, the learning rate and the weight factor can be updated respectively, and the update formulas can be found in formulas (18), (19), and (20) above, which will not be elaborated here.
[0144] S407: Determine the error of the current iteration and store it.
[0145] According to some embodiments, the error between the predicted data corresponding to the current sample data and the target data corresponding to the current sample data can be calculated through the error formula. For example, the error formula can be the loss function shown in formula (7) above. As an example, r1 and r2 can be taken as 0.5 respectively.
[0146] It can be understood that after executing S401 - S407, S402 - S407 can be repeatedly executed until the training termination condition is met, such as the predicted data meets the error condition; or, until each sample data in the training sample set is traversed.
[0147] According to some embodiments, the errors of each iteration, and the cornering stiffness C f and C r , can be stored correspondingly. That is to say, each set of C f and C r corresponds to the error of one iteration. After n iterations, the minimum value can be taken from multiple errors, and the C f and C r corresponding to the minimum error are determined as the parameters of the vehicle state prediction model.
[0148] According to some embodiments, the update of each parameter in each iteration in the embodiments of the present application can be performed when it is determined to perform a new iteration. If there is no or no next iteration, for example, the error meets the error condition, then there is no need to update the parameters for the next round of training, such as parameters like the update rate, the weight factor, the reference error, etc.
[0149] According to some embodiments, when the number of sample data used in each iteration is 1, Figure 3 each time the feedforward calculation process shown is executed, Figure 4 the feedback calculation process shown is executed once. According to other embodiments, when the number of sample data used in each iteration is n and n > 1, Figure 3 the feedforward calculation process shown is executed n times, Figure 4 and the feedback calculation process shown is executed 1 time.
[0150] In some embodiments, the embodiments of the present application further provide a computer-readable medium, on which instructions are stored, and when the instructions are executed on an electronic device, the electronic device is caused to execute the vehicle state prediction method described in the above embodiments.
[0151] In some embodiments, the embodiments of the present application further provide an electronic device, which includes: one or more processors; one or more memories; one or more programs are stored in one or more memories, and when one or more programs are executed by one or more processors, the electronic device is caused to execute the vehicle state prediction method described in the above embodiments.
[0152] In some embodiments, the embodiments of the present application further provide a computer program product, including: computer instructions, and when the computer instructions run on an electronic device, the electronic device is caused to execute the vehicle state prediction method described in the above embodiments.
[0153] Figure 5 The structural schematic diagram of the electronic device provided by the embodiments of the present application is shown. In one embodiment, the electronic device 500 may include one or more processors 504, a system control logic 508 connected to at least one of the processors 504, a system memory 512 connected to the system control logic 508, a non-volatile memory (NVM) 516 connected to the system control logic 508, and a network interface 520 connected to the system control logic 508.
[0154] In some embodiments, the processor 504 may include one or more single-core or multi-core processors. In some embodiments, the processor 504 may include any combination of a general-purpose processor and a dedicated processor (for example, a graphics processor, an application processor, a baseband processor, etc.). The processor 504 may be configured to execute various compliant embodiments, for example, as Figure 1 and Figure 4 shown in one or more of the multiple embodiments.
[0155] In some embodiments, the system control logic 508 may include any suitable interface controller to provide any suitable interface to at least one of the processors 504 and / or any suitable device or component communicating with the system control logic 508.
[0156] In some embodiments, the system control logic 508 may include one or more memory controllers to provide an interface to the system memory 512. The system memory 512 may be used to load and store data and / or instructions. In some embodiments, the memory 512 of the electronic device 500 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).
[0157] The NVM memory 516 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, the NVM memory 516 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of a hard disk drive (HDD), a compact disc (CD) drive, and a digital versatile disc (DVD) drive.
[0158] The NVM memory 516 may include a portion of the storage resources on the device of the electronic device 500, or it may be accessible by the device but not necessarily part of the device. For example, the NVM storage 516 may be accessed via the network interface 520 over a network.
[0159] Specifically, the system memory 512 and the NVM memory 516 may respectively include: a temporary copy and a permanent copy of the instructions 524. The instructions 524 may include: instructions that, when executed by at least one of the processors 504, cause the electronic device 500 to implement the method as Figure 1 and Figure 4 shown. In some embodiments, the instructions 524, hardware, firmware, and / or its software components may additionally / alternatively be located in the system control logic 508, the network interface 520, and / or the processor 504.
[0160] The network interface 520 may include a transceiver for providing a radio interface for the electronic device 500, and thus communicating with any other suitable devices (such as a front-end module, an antenna, etc.) via one or more networks. In some embodiments, the network interface 520 may be integrated with other components of the electronic device 500. For example, the network interface 520 may be integrated with at least one of the processor 504, the system memory 512, the NVM memory 516, and a firmware device (not shown) having instructions. When at least one of the processors 504 executes the instructions, the electronic device 500 implements as Figure 1 and Figure 4 the method shown.
[0161] The network interface 520 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 520 may be a network adapter, a wireless network adapter, a telephone modem, and / or a wireless modem.
[0162] In one embodiment, at least one of the processors 504 may be packaged together with the logic of one or more controllers for the system control logic 508 to form a system-in-package (SiP). In one embodiment, at least one of the processors 504 may be integrated with the logic of one or more controllers for the system control logic 508 on the same die to form a system-on-chip (SoC).
[0163] The electronic device 500 may further include: an input / output (I / O) device 532. The I / O device 532 may include a user interface that enables a user to interact with the electronic device 500; the design of the peripheral component interface enables peripheral components to also interact with the electronic device 500. In some embodiments, the electronic device 500 further includes sensors for determining at least one of environmental conditions and location information related to the electronic device 500.
[0164] In some embodiments, the user interface may include, but is not limited to, a display (such as a liquid crystal display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (such as a still image camera and / or a video camera), a flashlight (such as a light-emitting diode flash), and a keyboard.
[0165] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.
[0166] In some embodiments, the sensors may include, but are not limited to, gyro sensors, accelerometers, proximity sensors, ambient light sensors, and positioning units. The positioning unit may also be part of or interact with the network interface 520 to communicate with components of a positioning network (e.g., Global Positioning System (GPS) satellites).
[0167] It will be appreciated that, as used herein, the term "module" may refer to or include an application-specific integrated circuit (ASIC), an electronic circuit, a processor (shared, dedicated, or grouped) that executes one or more software or firmware programs, and / or memory, combinational logic circuitry, and / or other suitable hardware components that provide the described functionality, or may be part of such hardware components.
[0168] It will be appreciated that, in the various embodiments of the present application, the processor may be a microprocessor, a digital signal processor, a microcontroller, etc., and / or any combination thereof. According to another aspect, the processor may be a single-core processor, a multi-core processor, etc., and / or any combination thereof.
[0169] The various embodiments disclosed in the present application may be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of the present application may be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0170] The program code may be applied to the input instructions to perform the various functions described in the present application and generate output information. The output information may be applied to one or more output devices in a known manner. For the purposes of the present application, a processing system includes any system having a processor such as, for example, a digital signal processing (DSP), a microcontroller, an application-specific integrated circuit (ASIC), or a microprocessor.
[0171] The program code may be implemented in a high-level procedural language or an object-oriented programming language in order to communicate with the processing system. When needed, the program code may also be implemented in assembly language or machine language. In fact, the mechanisms described in the present application are not limited to the scope of any specific programming language. In any case, the language may be a compiled language or an interpreted language.
[0172] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or via other computer-readable media. Thus, machine-readable media may include any mechanism for storing or transmitting information in a machine-readable form (e.g., for a computer), including but not limited to, floppy disks, optical disks, optical discs, CD-read-only memories (CD-ROMs), magneto-optical disks, read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic or optical cards, flash memory, or tangible machine-readable memories for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) in electrical, optical, acoustic, or other forms using the Internet. Thus, machine-readable media includes any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a machine-readable form (e.g., for a computer).
[0173] In the drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or ordering may not be required. Rather, in some embodiments, these features may be arranged in a different manner and / or order than shown in the illustrative drawings. Additionally, the inclusion of a structural or method feature in a particular figure does not imply that such a feature is required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
[0174] It should be noted that each unit / module mentioned in the device embodiments of the present application is a logical unit / module. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or can be implemented as a combination of multiple physical units / module. The physical implementation manner of these logical units / modules themselves is not the most important. The combination of the functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application. This does not mean that there are no other units / modules in the above device embodiments.
[0175] It should be noted that in the examples and descriptions of the present application, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one" does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0176] Although the present application has been illustrated and described by referring to some preferred embodiments of the present application, those of ordinary skill in the art should understand that various changes can be made in form and detail without departing from the scope of the present application.
Claims
1. A vehicle state prediction method, characterized in that: include: Acquire vehicle state data at a first moment, input the vehicle state data at the first moment into a vehicle state prediction model, and obtain predicted state data at a second moment output by the vehicle state prediction model, wherein the vehicle state prediction model is determined in the following manner: Acquire a training sample set and an initial model, wherein the training sample set includes a plurality of sample data and a plurality of target data, the plurality of sample data and the plurality of target data correspond to each other one by one, the initial model is a vehicle dynamics model after discretization and approximation processing, and the parameters of the initial model include cornering stiffness; determining the initial model as an intermediate model; Determine the first sample data among the plurality of sample data as the current sample data; Inputting initial data and input data corresponding to the current sample data into the intermediate model to obtain predicted data corresponding to the current sample data output by the intermediate model, wherein the predicted data and the target data have the same data type; Based on the difference between the target data corresponding to the current sample data and the predicted data corresponding to the current sample data, updating the cornering stiffness of the intermediate model by a gradient descent algorithm; Corresponding to determining that the prediction data satisfies the error condition, determining the vehicle state prediction model based on the intermediate model; Corresponding to determining that the predicted data does not satisfy the error condition, the current sample data is updated to the next sample data of the current sample data among the multiple sample data, and the cornering stiffness of the intermediate model is re-updated based on the initial data and input data corresponding to the updated current sample data.
2. The method according to claim 1, characterized in that: The current sample data includes different first state data and second state data. Before inputting the initial data and input data corresponding to the current sample data into the intermediate model, the method further includes: Extracting the first state data from the current sample data as initial data corresponding to the current sample data; The second state data is extracted from the current sample data as input data corresponding to the current sample data.
3. The method according to claim 2, characterized in that The data types of the initial data and the predicted data are the same, After the current sample data is updated to the next sample data of the current sample data in the plurality of sample data, the method further includes: The predicted data is determined as initial data corresponding to the current sample data.
4. The method according to claim 1, characterized in that The updating of the cornering stiffness of the intermediate model by using a gradient descent algorithm comprises: The cornering stiffness of the intermediate model is updated based on the loss function by using a gradient descent algorithm. The method further comprises: The loss function is determined based on the product of the square of a data difference and a preset fixed parameter, wherein the data difference is the difference between the target data and the predicted data.
5. The method according to claim 4, characterized in that The predicted data is a predicted value of the driving data, the target data is a reference value of the driving data, and the driving data includes at least one of a speed and an angular velocity. The updating of the cornering stiffness of the intermediate model by a gradient descent algorithm based on the target data corresponding to the current sample data, the predicted data corresponding to the current sample data, and the loss function includes: Determining a first gradient of the loss function relative to the driving data based on the target data, the predicted data, and the loss function; determining a second gradient of the ride data relative to cornering stiffness; determining a third gradient of the loss function relative to the cornering stiffness based on the first gradient and the second gradient; Based on the third gradient, the cornering stiffness of the intermediate model is updated by a gradient descent algorithm.
6. The method according to claim 1, characterized in that Before inputting the initial data and input data corresponding to the current sample data into the intermediate model, the method further includes: Get the initial error; Determining the initial error as a current reference error; The determining that the prediction data satisfies an error condition includes: determining an iterative error between the predicted data and the target data; Corresponding to the iteration error being smaller than the current reference error, it is determined that the prediction data satisfies an error condition.
7. The method according to claim 6, characterized in that Also includes: Corresponding to determining that the prediction data does not satisfy the error condition, the current reference error is updated to the iteration error.
8. The method according to claim 6, characterized in that After determining the iteration error based on the prediction data and the target data, the method further includes: adding the iteration error to an error set; The determining the vehicle state prediction model based on the intermediate model comprises: The intermediate model corresponding to the smallest iterative error in the error set is determined as the vehicle state prediction model.
9. An electronic device, characterized in that: include: one or more processors; One or more memories; the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device executes the vehicle state prediction method described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The readable storage medium stores instructions, which, when executed on an electronic device, enable the electronic device to execute the vehicle state prediction method according to any one of claims 1 to 8.