Vehicle speed prediction method, device and computer program product
By collecting and analyzing vehicle driving parameters in real time, and combining working condition classification and LSTM model to predict vehicle speed, the existing vehicle speed prediction methods are solved in terms of accuracy and real-time accuracy, and more accurate and real-time vehicle speed prediction is achieved, providing more reliable support for the electronic control system.
Patent Information
- Application Number
- CN202411849147.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-16
AI Technical Summary
The existing vehicle speed prediction methods have shortcomings in accuracy and real-time performance, and it is difficult to meet the needs of electronic control systems such as anti-lock braking systems (ABS) and electronic stability control systems (ESC).
By collecting the driving parameters of the current cycle of the vehicle in real time, intelligently determining the working condition classification, and inputting the driving parameters and vehicle speed errors of the current cycle and the previous cycle into the corresponding vehicle speed prediction model, using the long and short-term memory network (LSTM) for iterative training to optimize the vehicle speed prediction model.
It improves the accuracy and real-time performance of vehicle speed prediction, and can provide more reliable vehicle speed information support for electronic control systems such as anti-lock braking system (ABS) and electronic stability control system (ESC).
Smart Images

Figure CN119749572A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle speed prediction, and in particular to a vehicle speed prediction method, device and computer program product. Background Art
[0002] The accuracy and effectiveness of vehicle speed prediction are important factors affecting the effectiveness of the anti-lock braking system (ABS) and the electronic stability control system (ESC). Therefore, improving the timeliness and accuracy of vehicle speed prediction is of great significance to the strategy optimization of the vehicle electronic control system. Commonly used vehicle speed prediction methods are divided into two types: data-driven and model-driven.
[0003] The data-driven speed prediction method has poor filtering and nonlinear mapping capabilities, making it difficult to achieve accurate and real-time prediction of vehicle speed. The high-precision model of the model-driven speed prediction method often has high computational complexity, which may affect the real-time prediction performance, while the simplified model may sacrifice prediction accuracy, making it difficult to ensure the accuracy and timeliness of speed prediction. Therefore, how to improve the accuracy and real-time performance of speed prediction is a technical problem that needs to be solved urgently. Summary of the invention
[0004] Based on the above technical problem, the present invention provides a vehicle speed prediction method, device and computer storage medium.
[0005] According to a first aspect of the present invention, a vehicle speed prediction method is provided, comprising: collecting a first driving parameter of a vehicle in a current cycle; determining, based on the first driving parameter, a working condition classification corresponding to the first driving parameter; inputting the first driving parameter, a second driving parameter of a previous cycle, and a vehicle speed error obtained according to the previous cycle into a vehicle speed prediction model corresponding to the working condition classification, and obtaining a predicted vehicle speed output by the vehicle speed prediction model.
[0006] In addition, according to the vehicle speed prediction method of the first aspect of the present invention, the first driving parameter includes a first vehicle speed and a first acceleration; based on the first driving parameter, the operating condition classification corresponding to the first driving parameter is determined, including: based on the first acceleration and the acceleration limit value, the operating condition classification corresponding to the first driving parameter is determined.
[0007] In addition, according to the vehicle speed prediction method of the first aspect of the present invention, the vehicle speed prediction model training method includes: obtaining historical driving parameters of the vehicle; dividing the historical driving parameters into a plurality of working condition blocks based on working condition classification; preprocessing the first historical driving parameters of each working condition block to obtain the target historical driving parameters corresponding to each working condition block; for each working condition block: initializing the weights and bias parameters of the initial vehicle speed prediction model based on the long short-term memory network LSTM; iteratively training the initialized initial vehicle speed prediction model based on the second vehicle speed of the tth cycle, the second acceleration of the tth cycle, the third vehicle speed of the t-1th cycle and the vehicle speed prediction deviation of the t-1th cycle in the target historical driving parameters; during training, updating the weights based on the back propagation algorithm; when the initial vehicle speed prediction model meets the training end condition, obtaining the vehicle speed prediction model corresponding to the working condition classification for which the training is completed.
[0008] In addition, according to the vehicle speed prediction method of the first aspect of the present invention, the first historical driving parameters of each operating condition block are preprocessed to obtain the target historical driving parameters corresponding to each operating condition block, including: performing wavelet decomposition and reconstruction on the first historical driving parameters of each operating condition block to obtain the target historical driving parameters corresponding to each operating condition block.
[0009] In addition, according to the vehicle speed prediction method of the first aspect of the present invention, the weights and bias parameters of the initial vehicle speed prediction model based on the long short-term memory network LSTM are initialized, including: based on the working condition classification, the weights and bias parameters of the initial vehicle speed prediction model based on the long short-term memory network LSTM are initialized.
[0010] In addition, according to the vehicle speed prediction method of the first aspect of the present invention, during training, weights are updated based on the back propagation algorithm, including: during the training process, a standard deviation function is defined, the gradient of the standard deviation function with respect to the weight is calculated using the back propagation algorithm and the Adam optimization algorithm, and the weight of the initial vehicle speed prediction model is updated according to the gradient.
[0011] In addition, according to the vehicle speed prediction method of the first aspect of the present invention, when the initial vehicle speed prediction model meets the training end condition, the vehicle speed prediction model corresponding to the working condition classification after training is obtained, including: determining the model evaluation function based on the predicted vehicle speed output by the initial vehicle speed prediction model and its corresponding actual vehicle speed; when the model evaluation function meets the preset condition, the initial vehicle speed prediction model meets the training end condition, and the vehicle speed prediction model corresponding to the working condition classification after training is obtained.
[0012] In addition, according to the vehicle speed prediction method of the first aspect of the present invention, the model evaluation function formula is:
[0013] in, Describe the predicted vehicle speed value at the next moment output by the model, Indicates the actual vehicle speed value at the next moment. J When the value is greater than 90%, the evaluation function meets the preset conditions.
[0014] According to another aspect of the present invention, a vehicle speed prediction device is provided, comprising: a collection module, configured to collect a first driving parameter of a vehicle in a current cycle; a classification module, configured to determine, based on the first driving parameter, a working condition classification corresponding to the first driving parameter; and a predicted vehicle speed output module, configured to input the first driving parameter, the second driving parameter of the previous cycle, and the vehicle speed error obtained according to the previous cycle into a vehicle speed prediction model corresponding to the working condition classification, and obtain the predicted vehicle speed output by the vehicle speed prediction model.
[0015] The present invention also provides a computer program product, comprising a computer program, and when the computer program is executed by a processor, any of the above-mentioned vehicle speed prediction methods is implemented.
[0016] The vehicle speed prediction method, device and computer program product provided by the present invention collect the driving parameters of the vehicle in the current cycle in real time, and intelligently determine the working condition classification based on these parameters. Subsequently, the driving parameters of the current cycle, the driving parameters of the previous cycle and the vehicle speed error calculated according to the previous cycle are input into a vehicle speed prediction model matching the working condition classification, thereby realizing accurate prediction of the vehicle speed. The method selectively selects and adjusts the vehicle speed prediction model through the working condition classification, effectively improving the accuracy and real-time performance of the prediction, and can provide more reliable vehicle speed information support for electronic control systems such as anti-lock braking systems (ABS) and electronic stability control systems (ESC). BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 This is one of the flow charts of the vehicle speed prediction method provided by the present invention.
[0019] Figure 2 This is the second flow chart of the vehicle speed prediction method provided by the present invention.
[0020] Figure 3 It is a schematic diagram of the wavelet decomposition provided by the present invention.
[0021] Figure 4It is a structural diagram of the long short-term memory network LSTM provided by the present invention.
[0022] Figure 5 This is the third flow chart of the vehicle speed prediction method provided by the present invention.
[0023] Figure 6 It is a functional block diagram of the vehicle speed prediction device provided by the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] Combine the following Figure 1-Figure 5 The vehicle speed prediction method of the present invention is described.
[0026] Figure 1 is one of the flow charts of the vehicle speed prediction method provided by the present invention, such as Figure 1 As shown, the method includes the following: Step 101: Collect the first driving parameter of the vehicle in the current cycle.
[0027] In one embodiment of the present invention, the first driving parameter refers to the relevant driving information of the vehicle in the current driving time period (i.e., the "current cycle"), and the first driving parameter may include but is not limited to vehicle speed, acceleration, driving time, steering angle, braking status, engine status, etc. By collecting the first driving parameter, the vehicle control system can monitor the driving status of the vehicle in real time and adjust the control strategy as needed to ensure the safety and stability of the vehicle. At the same time, these data can also be used for subsequent vehicle performance analysis and fault diagnosis.
[0028] Step 102: Based on the first driving parameter, determine the operating condition classification corresponding to the first driving parameter.
[0029] In one embodiment of the present invention, the operating condition classification is to classify the driving state into different categories according to the driving parameters of the vehicle. The first driving parameter is compared and matched with the standard of the operating condition classification, and according to the matching result, the first driving parameter can be classified into the corresponding operating condition category.
[0030] In one embodiment of the present invention, the first driving parameter includes a first vehicle speed and a first acceleration; Determining, based on the first driving parameter, a working condition classification corresponding to the first driving parameter, includes: The operating condition classification corresponding to the first driving parameter is determined based on the first acceleration and the acceleration limit value.
[0031] Specifically, the first vehicle speed represents the vehicle speed of the current cycle, and the first acceleration represents the acceleration of the current cycle. The acceleration limit value may be a preset one, one group or multiple groups of acceleration thresholds, which are used to divide the acceleration into different intervals. The acceleration limit value is usually determined based on empirical data, industry standards or specific application requirements. The first acceleration is compared with the acceleration limit value, and the operating condition category corresponding to the first acceleration is determined according to which interval the first acceleration falls. Exemplarily, the operating condition category may include acceleration, uniform speed, deceleration, etc. (or other classifications defined according to actual needs).
[0032] For example, the first acceleration a (m / s 2 ), according to the magnitude of acceleration, the vehicle state is divided into acceleration, deceleration and constant speed. The acceleration limit value varies according to different vehicles. The acceleration limit value selected in this scheme is 0.5m / s 2 , as follows: ①If -0.5m / s 2 <a(m / s 2 )<0.5m / s 2 , it means that the vehicle is in a constant speed state; ②If a(m / s 2 )>0.5m / s 2 , it means the vehicle is in acceleration state; ③If a(m / s 2 )<-0.5m / s 2 , it means the vehicle is in a decelerating state.
[0033] According to the above description, the working conditions are divided into three types: uniform speed, acceleration, and deceleration.
[0034] Step 103: input the first driving parameter, the second driving parameter of the previous cycle, and the vehicle speed error obtained according to the previous cycle into a vehicle speed prediction model corresponding to the working condition classification, and obtain a predicted vehicle speed output by the vehicle speed prediction model.
[0035] In one embodiment of the present invention, the second driving parameter of the previous cycle includes driving parameters such as the vehicle speed and acceleration of the previous cycle. The second driving parameter can be obtained through sensor records on the vehicle, or can be obtained through the vehicle CAN bus. The acquisition method is not limited by the present invention. The speed error obtained in the previous cycle refers to the error between the predicted value and the actual value of the vehicle speed in the previous cycle. The predicted value of the vehicle speed in the previous cycle is the predicted value of the vehicle speed output by the speed prediction model in the previous cycle. The speed prediction model is pre-trained. The actual value refers to the speed of the previous cycle, which can be obtained through the vehicle CAN bus or the wheel speed sensor, vehicle speed sensor, etc. Different working condition classifications correspond to different speed prediction models. The first driving parameter, the second driving parameter of the previous cycle, and the speed error are input into the speed prediction model corresponding to the working condition classification. The speed prediction model calculates according to the input parameters and outputs the predicted speed value. The predicted vehicle speed reflects the possible speed of the vehicle in the future. It can be used to optimize driving strategies, such as adjusting the vehicle speed in advance, avoiding sudden acceleration or deceleration, etc., so as to improve driving safety and comfort. It can also be used for the planning and scheduling of intelligent transportation systems, such as optimizing traffic signal control and predicting traffic congestion.
[0036] In summary, according to the technical solution provided by the embodiment of the present invention, the driving parameters of the vehicle in the current cycle are collected in real time, and the working condition classification is intelligently determined based on these parameters. Subsequently, the driving parameters of the current cycle, the driving parameters of the previous cycle, and the vehicle speed error calculated according to the previous cycle are input into a vehicle speed prediction model that matches the working condition classification, thereby achieving accurate prediction of the vehicle speed. This method selectively selects and adjusts the vehicle speed prediction model through working condition classification, effectively improving the accuracy and real-time performance of the prediction, and can provide more reliable vehicle speed information support for electronic control systems such as anti-lock braking systems (ABS) and electronic stability control systems (ESC).
[0037] Figure 2 This is the second flow chart of the vehicle speed prediction method provided by the present invention.
[0038] like Figure 2 As shown, according to the vehicle speed prediction method provided by the present invention, the training method of the vehicle speed prediction model specifically includes the following: Step 201: Obtain historical driving parameters of the vehicle.
[0039] In one embodiment of the present invention, obtaining the historical driving parameters of a vehicle mainly refers to obtaining a series of driving-related data information generated by the vehicle during its past driving process. These parameters can reflect the driving state, performance, etc. of the vehicle. Exemplarily, the historical driving parameters are obtained from the driving records of the vehicle, and the historical driving parameters may include parameters such as vehicle speed, acceleration, and timestamp.
[0040] Step 202: Based on the operating condition classification, the historical driving parameters are divided into a number of operating condition blocks.
[0041] In one embodiment of the present disclosure, the operating condition classification is to divide the driving state into different categories according to the driving parameters of the vehicle. Feature parameters that can reflect the driving state of the vehicle, such as vehicle speed, driving distance, maximum speed, acceleration, etc., are extracted from the historical driving parameters. The extracted feature parameters are compared with the operating condition classification, so that the historical driving parameters can be divided into several operating condition blocks, each operating condition block corresponding to a working condition classification. The operating condition block division helps the intelligent transportation system to more accurately identify and understand the driving state and behavior of the vehicle, so as to perform better traffic signal control, traffic congestion prediction and path planning, etc.
[0042] Step 203: pre-process the first historical driving parameter of each operating condition block to obtain the target historical driving parameter corresponding to each operating condition block.
[0043] In one embodiment of the present invention, the first historical driving parameter is the historical driving parameter classified into each operating condition block according to the operating condition classification. The data in each operating condition block is preprocessed, such as denoising, normalization, etc., to facilitate better model learning.
[0044] In one embodiment of the present invention, preprocessing the first historical driving parameter of each operating condition block to obtain the target historical driving parameter corresponding to each operating condition block includes: The first historical driving parameter of each operating condition block is subjected to wavelet decomposition and reconstruction to obtain the target historical driving parameter corresponding to each operating condition block.
[0045] Specifically, the first historical driving parameters of each operating condition block are subjected to wavelet decomposition and wavelet reconstruction to obtain the target historical driving parameters corresponding to each operating condition block. The purpose of this step is to reduce the burrs and noise of the first historical driving parameters. Preprocessing data by wavelet decomposition and reconstruction can effectively reduce noise and burrs, thereby improving the training effect and prediction accuracy of the model.
[0046] For example, the first historical driving parameters of different working condition blocks are preprocessed based on the wavelet denoising decomposition algorithm. The "time-frequency" window changes with the frequency, which can effectively avoid the problem caused by the fixed window. The wavelet denoising process mainly includes wavelet decomposition and data reconstruction, as shown in the attached Figure 3 In order to reduce data glitches, the data is decomposed and reconstructed by wavelet, and the number of wavelet decomposition layers is set to 3. The process can be expressed as:
[0047] In the formula, i represents the number of decomposition layers, H and L represent high-pass filtering and low-pass filtering respectively. After decomposition, the data is reconstructed by wavelet, and the process can be expressed as:
[0048] In the formula, L* and H* represent the sampling operators of low-pass filtering and high-pass filtering respectively. In order to prevent the original data from being distorted due to excessive filtering, a soft threshold function can be selected to filter out high-frequency glitches in the data.
[0049] Exemplarily, the above method is used to pre-process the first historical driving parameter, which mainly includes: vehicle speed at time t (m / s), acceleration a at time t t (m / s 2 ), vehicle speed at time t-1 (m / s), perform three-layer wavelet decomposition on the above parameters, as shown below:
[0050]
[0051]
[0052]
[0053]
[0054]
[0055] Reconstruct the decomposed parameters:
[0056]
[0057]
[0058] Among them, the low-pass filter sampling operator and the high-pass filter sampling operator can be customized according to the sample information. The parameters obtained after reconstruction are the target historical driving parameters.
[0059] Step 204: For each operating condition block, initialize the weights and bias parameters of the initial vehicle speed prediction model based on the long short-term memory network LSTM.
[0060] In one embodiment of the present invention, an initial vehicle speed prediction model based on LSTM is created for each operating condition block, and the weights and bias parameters of the initial vehicle speed prediction model based on LSTM are initialized for each operating condition block. Initializing the weights and bias parameters of the initial vehicle speed prediction model based on LSTM for each operating condition block is an important step in the process of establishing the vehicle speed prediction model, which helps to improve the prediction accuracy, enhance the generalization ability of the model and optimize the driving strategy.
[0061] In one embodiment of the present invention, initializing the weights and bias parameters of the initial vehicle speed prediction model based on the long short-term memory network LSTM includes: Based on the working condition classification, the weights and bias parameters of the initial vehicle speed prediction model based on the long short-term memory network LSTM are initialized.
[0062] Specifically, the operating conditions can be classified into three types: acceleration, constant speed, and deceleration. The weights and bias parameters of the initial vehicle speed prediction model based on the long short-term memory network LSTM are initialized according to the operating condition classification. The model parameters are initialized according to the operating condition classification so that the model can better learn and predict the target variable (vehicle speed). This method helps to improve the generalization ability and prediction accuracy of the model.
[0063] For example, the weights and bias parameters of the LSTM model are initialized. The LSTM algorithm involves three gates: forget gate, input gate, and output gate. The structure is shown in the attached figure. Figure 4 As shown in the figure, the initial weights of each door are set to a random normal distribution with a standard deviation of 1. The weight parameters are mainly concentrated between 0 and 1. According to the different working condition classifications, the input acceleration a is increased or decreased. t (m / s 2 ) weight, under uniform speed conditions, acceleration a t (m / s 2 ) is mainly concentrated between 0 and 1. If it is deceleration or acceleration, the weight ratio of the acceleration signal is increased, and the input variable acceleration a t (m / s 2 ) are concentrated between 0.3 and 1, and the initial bias values of each gate are uniformly set to 0.
[0064] In summary, by differentially initializing the weights and bias parameters of the LSTM model according to the working condition classification (acceleration, constant speed, deceleration), especially adjusting the weight of the input acceleration signal, the model can more accurately capture the characteristics of vehicle speed changes under different working conditions, thereby improving the accuracy of vehicle speed prediction and the generalization ability of the model.
[0065] Step 205: iteratively train the initialized initial vehicle speed prediction model based on the second vehicle speed of the tth cycle, the second acceleration of the tth cycle, the third vehicle speed of the t-1th cycle, and the vehicle speed prediction deviation of the t-1th cycle in the target historical driving parameters.
[0066] In one embodiment of the present invention, the second vehicle speed is the vehicle speed of the tth cycle in the target historical driving parameters, the second acceleration is the acceleration of the tth cycle in the target historical driving parameters, the third vehicle speed is the vehicle speed of the t-1th cycle in the target historical driving parameters, and the vehicle speed prediction deviation refers to the deviation between the predicted vehicle speed predicted at the end of the t-1th cycle of the target historical driving parameters and the third vehicle speed. The target historical driving parameters (including vehicle speed, acceleration, and previous prediction deviation) are used as input data to iteratively train the initial vehicle speed prediction model.
[0067] Exemplarily, the input parameters (i.e., the second vehicle speed of the t-th cycle, the second acceleration of the t-th cycle, the third vehicle speed of the t-1-th cycle, and the vehicle speed prediction deviation of the t-1-th cycle) can be expressed as a 1×4 matrix: ,in, = vehicle speed at time t (m / s), = acceleration at time t (m / s 2 ), = vehicle speed at time t-1 (m / s), = The predicted vehicle speed deviation at time t-1 (m / s) is calculated as follows: (m / s)=
[0068] The actual vehicle speed calculated by the above formula is t-1 and predicted speed The difference between the output of the LSTM neural network prediction model (i.e. the initial vehicle prediction model mentioned above) To predict the vehicle speed at the next moment (m / s).
[0069] In summary, through iterative training of historical vehicle speed, acceleration and prediction deviation, the vehicle speed prediction model of the present invention can learn and adapt to driving trends, improve prediction accuracy, enhance adaptability and robustness, and thus provide better performance and user experience in practical applications.
[0070] Step 206: During training, update the weights based on the back propagation algorithm.
[0071] In one embodiment of the present invention, during the training of the initial vehicle speed prediction model, a back propagation algorithm is used to calculate the gradient of the error between the predicted vehicle speed and the actual vehicle speed relative to the weight, and the weight and bias parameters of the model are updated according to the gradient to reduce the prediction error.
[0072] In one embodiment of the present invention, during training, the weights are updated based on a back propagation algorithm, including: During the training process, the standard deviation function is defined, and the back propagation algorithm is used to calculate the gradient of the standard deviation function with respect to the weight. According to the gradient, the Adam algorithm is used to update the weight of the initial vehicle speed prediction model.
[0073] Specifically, the standard deviation function is used to measure the difference between the model-predicted vehicle speed and the actual vehicle speed. The Adam algorithm is an adaptive learning rate optimization algorithm that combines the advantages of the momentum and RMSprop algorithms. In each iteration, the Adam algorithm adjusts the learning rate according to the first-order and second-order components of the gradient to update the weights. Here, the learning rate is a hyperparameter that controls the step size of the weight update and is adaptively adjusted in the Adam algorithm. During the training process of the initial vehicle speed prediction model, first, a standard deviation function is defined to measure the difference between the model-predicted vehicle speed and the actual vehicle speed. Secondly, the back propagation algorithm is used to calculate the gradient of the standard deviation function with respect to the model weights, and the Adam algorithm is used to dynamically update the learning rate. During the training process, the back propagation algorithm is first used to calculate the gradient of the loss function (i.e., the aforementioned standard deviation function) with respect to the model weights. The Adam algorithm is used to dynamically adjust the learning rate according to the first-order and second-order components of the gradient. After calculating the gradient and adjusting the learning rate, the weights are updated. This process will be iterated multiple times on the entire training set, and the weights will be updated according to the new learning rate and gradient at each iteration. The above gradients represent the degree of influence of each weight on the value of the standard deviation function. This process starts from the output layer and goes backwards through each layer of the network until it reaches the input layer. The above process will be iterated many times.
[0074] Through the above process, the model can gradually learn how to better extract features from the input data and make accurate vehicle speed predictions. The Adam algorithm can more effectively update the weights and improve the model's convergence speed and prediction performance.
[0075] For example, during the operation of the vehicle, the weight parameter is adjusted in real time according to the deviation of the predicted vehicle speed at the previous moment at time t (such as the aforementioned standard deviation function), and a rolling iterative prediction is performed in real time. The sampling period is 100ms, and the calculation process is as follows: ① Input gate to input vector: To extract effective information, the input gate uses the sigmoid activation function for transformation. The function expression is as follows:
[0076] The output of the input gate is:
[0077] In the formula, represents the intermediate vector weight of the input gate, represents the weight of the input variable of the input gate, represents the output deviation of the input gate, represents the input of the LSTM model (i.e., the initial vehicle speed prediction model) at time t, namely , represents the hidden state of the output layer at time t-1, that is , the default value at the initial time , then the output of the input gate of the vehicle speed prediction model is:
[0078]
[0079] ②The forget gate determines the information that the neural network model needs to discard, and will automatically transfer the knowledge acquired at time t to the next new time. Selecting the sigmoid activation function, the forget gate can be expressed as:
[0080] In the formula, represents the intermediate vector weight of the forget gate, represents the weight of the input variable of the forget gate, represents the output deviation of the forget gate, Represents the LSTM model input at time t, that is , Represents the hidden state of the output layer at time t-1, that is, the intermediate vector , then the output of the forget gate of the initial vehicle speed prediction model is as follows:
[0081] ③Intermediate state update: update the state of the intermediate variables of the model by forgetting old information and adding new information. The update process is as follows:
[0082] In the formula, Indicates the state of the intermediate variable at time t-1, the default value at the initial time , represents the state of the intermediate variable calculated at time t, represents the input information at time t, represents dot product. The intermediate state value of the vehicle speed prediction model can be expressed as:
[0083] ④ The output gate determines how the neuron state at time t affects the hidden state at the next moment. The output information of the forget gate and the input gate is combined and output and the intermediate variable hidden state is calculated. The sigmoid activation function is selected. The output and hidden state of the output layer are as follows:
[0084]
[0085] In the formula, represents the intermediate variable weight of the output gate, represents the weight of the input variable of the output gate, represents the output deviation of the output gate, Represents the LSTM model input at time t, that is , represents the hidden state of the output layer at time t-1, that is , the output of the vehicle speed prediction model And the hidden state can be expressed as:
[0086]
[0087] ④ The model feedback iteratively updates the weights. The adaptive back propagation algorithm and the Adam algorithm are combined to reversely update the weight parameters. The standard deviation function of the initial vehicle speed prediction model is:
[0088] in, = It represents the predicted vehicle speed value at the next moment output by the LSTM prediction model. = Indicates the actual vehicle speed value at the next moment read through the CAN line.
[0089] The back propagation output gate weight iteration process can be expressed as:
[0090]
[0091] The weight iteration process of the back-propagation forget gate can be expressed as:
[0092]
[0093] The weight iteration process of the back-propagation input gate can be expressed as:
[0094]
[0095] In the Adam algorithm, the initial learning rate is set to =0.5, in order to avoid the local optimum in the gradient optimization process, the learning rate of the parameters is updated in real time. If the learning rate at time t is , then the learning rate at time t+1 can be expressed as:
[0096] In the formula, and They represent the first-order component and the second-order component of the gradient learning rate at time t, respectively. Represents the hyperparameter learning rate, which is generally set to 10 -3 -10 -5 between, Represents the correction term constant, usually 10 -8 , the learning rate is updated in real time according to the above process.
[0097] Step 207: When the initial vehicle speed prediction model meets the training end condition, a vehicle speed prediction model corresponding to the working condition classification after training is obtained.
[0098] In one embodiment of the present invention, the training end condition means that during the training process of the machine learning model, some conditions need to be set to determine when to stop training. These conditions may include: reaching a preset number of iterations (epochs), that is, the model has completed a certain number of learning on the entire training set. Or, the loss function value on the validation set has not dropped significantly after multiple consecutive iterations, indicating that the model may be close to the optimal state. Or, reaching preset performance indicators, such as accuracy, recall rate, etc., and meeting specific thresholds. When the above training end conditions are met, the training process of the model is terminated. At this point, the parameters (weights and biases) of the model are fixed to form a trained vehicle speed prediction model for each working condition classification. Obtaining a trained model means that the model is ready for practical application and can be deployed on the vehicle for real-time vehicle speed prediction.
[0099] In summary, according to the technical solution provided by the embodiment of the present invention, the accuracy of vehicle speed prediction is improved by training models specifically for different working conditions. The model can adapt to different driving conditions and provide more comprehensive prediction capabilities. The real-time prediction capability of the LSTM model enables the system to respond quickly to changes in driving conditions. It can achieve accurate prediction of vehicle speed changes under different driving conditions, providing strong support for intelligent control of the vehicle.
[0100] When the initial vehicle speed prediction model meets the training end condition, the vehicle speed prediction model corresponding to the working condition classification completed by training is obtained, including: Determine a model evaluation function based on the predicted vehicle speed output by the initial vehicle speed prediction model and its corresponding actual vehicle speed; When the model evaluation function meets the preset conditions, the initial vehicle speed prediction model meets the training end conditions, and the vehicle speed prediction model corresponding to the working condition classification after the training is completed is obtained.
[0101] In one embodiment of the present invention, in machine learning, the model evaluation function is an indicator used to measure the performance of the model. This function can be calculated based on the predicted output of the model (predicted vehicle speed) and the actual label (actual vehicle speed). When the result of the model evaluation function meets the preset conditions, it is considered that the model has reached a sufficient performance level and training can be stopped. This means that the difference between the model's predicted results and the actual values is small enough, or the model's prediction accuracy is high enough. Once the model evaluation function meets the preset conditions, the initial vehicle speed prediction model is considered to be trained. At this point, the parameters of the model are fixed to form a vehicle speed prediction model that can be used in practical applications.
[0102] In summary, according to the technical solution provided by the embodiment of the present invention, during the model training process, the performance of the model is evaluated by comparing the vehicle speed predicted by the model with the actual vehicle speed. When the evaluation result reaches the preset performance standard, the model training ends and a vehicle speed prediction model that can be used for actual prediction is obtained. This process ensures that the model can provide accurate and reliable vehicle speed prediction in practical applications.
[0103] Furthermore, the model evaluation function formula is:
[0104] in, Describe the predicted vehicle speed value at the next moment output by the model, Indicates the actual vehicle speed value at the next moment. J When the value is greater than 90%, the evaluation function meets the preset conditions, which means that the predicted vehicle speed meets the accuracy requirements.
[0105] In order to describe the technical solution of the present invention in detail, refer to Figure 5 ,like Figure 5 It is a flow chart of the vehicle speed prediction method provided by the present invention.
[0106] As shown in Figure 5, the vehicle speed prediction method specifically includes the following steps.
[0107] start: Step 501: Collect real vehicle data.
[0108] Specifically, historical driving parameters of the vehicle are collected, and the historical driving parameters may include vehicle speed and acceleration, etc. Exemplarily, these data can be obtained by connecting the CAN line of the actual vehicle, and the message collection cycle is generally 100ms.
[0109] Step 502: Classification of typical working conditions.
[0110] Specifically, the vehicle state is divided into acceleration, deceleration and constant speed (three operating condition classifications) according to the magnitude of the acceleration value, and the historical driving parameters are divided into different operating condition blocks.
[0111] Step 503: Data noise reduction processing: wavelet decomposition and reconstruction.
[0112] Specifically, the wavelet decomposition algorithm is used to pre-process the characteristic data of different working condition blocks (such as vehicle speed and acceleration) (i.e., wavelet decomposition and reconstruction) to reduce the burrs and noise in the data.
[0113] Step 504: Initialize prediction model parameters: LSTM weights and biases.
[0114] Specifically, the weights and bias parameters of the LSTM model (i.e., the aforementioned initial vehicle speed prediction model based on LSTM) are initialized. The initial values of these parameters can be set to a random normal distribution with a standard deviation of 1.
[0115] Step 505: input data into the LSTM prediction model (i.e., the aforementioned initial vehicle speed prediction model based on LSTM).
[0116] Specifically, the data processed in the above step 503 is input into the initial vehicle speed prediction model based on LSTM to perform model iterative training.
[0117] Step 506: Calculate the predicted vehicle speed based on the LSTM input gate, forget gate and intermediate state.
[0118] Specifically, during the training process of the model, the predicted vehicle speed is calculated according to the input gate, forget gate and intermediate state of the initial vehicle speed prediction model based on LSTM.
[0119] Step 507: Calculate the prediction accuracy evaluation function of the model.
[0120] Specifically, a prediction accuracy evaluation function (ie, the aforementioned model evaluation function) is set, and when the prediction accuracy evaluation function meets predetermined conditions, the model training is completed.
[0121] Step 508: The Adam algorithm adaptively updates the parameter learning rate.
[0122] Specifically, during the training of the model, in each iteration, the gradient of the loss function (i.e., the aforementioned standard deviation function) with respect to each parameter is calculated, and the Adam algorithm is used to adjust the learning rate of each parameter in real time through the first-order and second-order components of the gradient.
[0123] Step 509, LSTM prediction model parameter update: weight.
[0124] Specifically, the LSTM prediction model parameters (such as weights) are updated according to the gradient and learning rate obtained in step 508.
[0125] The above process can effectively predict the speed information of commercial vehicles. Based on the predicted information, the chassis braking system can predict the vehicle status in advance during braking and starting and implement timely and effective control.
[0126] According to the instructions attached Figure 1-5 The vehicle speed prediction method of the present invention is described in detail. Data preprocessing by wavelet decomposition can eliminate data burrs, thereby improving data quality. This provides more accurate input for subsequent model training; further, the collected data is modeled using a long short-term memory network (LSTM). The LSTM model is particularly suitable for processing and predicting time series data, can capture the time dependence in vehicle speed changes, and can achieve real-time prediction of vehicle speed; further, the present invention classifies vehicle states according to acceleration, such as acceleration, constant speed, and deceleration, and this classification helps to identify the current driving conditions of the vehicle, thereby customizing prediction models for different working conditions; vehicle speed prediction models are constructed according to different working condition classifications, and this targeted modeling method can improve the accuracy of prediction because each model is optimized for driving behavior under specific conditions; further, the LSTM model performs real-time prediction based on historical data, which can effectively avoid the errors and influences of the physical model; further, the combination of the adaptive back propagation algorithm and the Adam algorithm can effectively avoid the problems of gradient explosion and optimal value.
[0127] Figure 6 It is a functional block diagram of the vehicle speed prediction device provided by the present invention.
[0128] like Figure 6 As shown, the vehicle speed prediction device 600 includes: a collection module 601, a classification module 602 and a predicted vehicle speed output module 603.
[0129] Furthermore, the collection module 601 is configured to collect the first driving parameter of the vehicle in the current cycle.
[0130] Furthermore, the classification module 602 is configured to determine a working condition classification corresponding to the first driving parameter based on the first driving parameter.
[0131] Furthermore, the predicted vehicle speed output module 603 is configured to input the first driving parameter, the second driving parameter of the previous cycle and the vehicle speed error obtained according to the previous cycle into the vehicle speed prediction model corresponding to the working condition classification, and obtain the predicted vehicle speed output by the vehicle speed prediction model.
[0132] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the vehicle speed prediction method provided by the above methods.
[0133] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0134] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A vehicle speed prediction method, characterized in that: include: Collecting the first driving parameter of the vehicle in the current cycle; Based on the first driving parameter, determining a working condition classification corresponding to the first driving parameter; The first driving parameter, the second driving parameter of the previous cycle, and the vehicle speed error obtained according to the previous cycle are input into a vehicle speed prediction model corresponding to the working condition classification to obtain a predicted vehicle speed output by the vehicle speed prediction model.
2. The vehicle speed prediction method according to claim 1, characterized in that: The first driving parameter includes a first vehicle speed and a first acceleration; Determining, based on the first driving parameter, a working condition classification corresponding to the first driving parameter, includes: The operating condition classification corresponding to the first driving parameter is determined based on the first acceleration and the acceleration limit value.
3. The vehicle speed prediction method according to claim 1, characterized in that: The training method of the vehicle speed prediction model comprises: Obtain historical driving parameters of the vehicle; Based on the operating condition classification, dividing the historical driving parameters into a plurality of operating condition blocks; Preprocessing the first historical driving parameter of each operating condition block to obtain the target historical driving parameter corresponding to each operating condition block; For each of the operating condition blocks, initializing the weights and bias parameters of the initial vehicle speed prediction model based on the long short-term memory network LSTM; Iteratively training the initialized initial vehicle speed prediction model based on the second vehicle speed of the t-th cycle, the second acceleration of the t-th cycle, the third vehicle speed of the t-1-th cycle, and the vehicle speed prediction deviation of the t-1-th cycle in the target historical driving parameters; During training, the weights are updated by a back-propagation algorithm; When the initial vehicle speed prediction model meets the training end condition, the vehicle speed prediction model corresponding to the operating condition classification after training is obtained.
4. The vehicle speed prediction method according to claim 3, characterized in that: The preprocessing of the first historical driving parameter of each operating condition block to obtain the target historical driving parameter corresponding to each operating condition block includes: The first historical driving parameter of each operating condition block is subjected to wavelet decomposition and reconstruction to obtain the target historical driving parameter corresponding to each operating condition block.
5. The vehicle speed prediction method according to claim 3, characterized in that: The weights and bias parameters of the initial vehicle speed prediction model based on the long short-term memory network LSTM are initialized, including: Based on the operating condition classification, weights and bias parameters of an initial vehicle speed prediction model based on a long short-term memory network LSTM are initialized.
6. The vehicle speed prediction method according to claim 3, characterized in that: In the training, based on the back propagation algorithm, the weights are updated, including: During the training process, a standard deviation function is defined, a back propagation algorithm is used to calculate the gradient of the standard deviation function with respect to the weight, and based on the gradient, the Adam algorithm is used to update the weight of the initial vehicle speed prediction model.
7. The vehicle speed prediction method according to claim 3, characterized in that: When the initial vehicle speed prediction model meets the training end condition, obtaining the vehicle speed prediction model corresponding to the working condition classification after training, includes: Determining a model evaluation function based on the predicted vehicle speed output by the initial vehicle speed prediction model and its corresponding actual vehicle speed; When the model evaluation function meets the preset conditions, the initial vehicle speed prediction model meets the training end conditions, and the vehicle speed prediction model corresponding to the working condition classification after training is obtained.
8. The vehicle speed prediction method according to claim 7, characterized in that: The model evaluation function formula is: in, Describe the predicted vehicle speed value at the next moment output by the model, Indicates the actual vehicle speed value at the next moment. J When the value is greater than 90%, the evaluation function meets the preset conditions.
9. A vehicle speed prediction device, characterized in that: include: A collection module is configured to collect a first driving parameter of the vehicle in a current cycle; a classification module, configured to determine, based on the first driving parameter, a working condition classification corresponding to the first driving parameter; The predicted vehicle speed output module is configured to input the first driving parameter, the second driving parameter of the previous cycle and the vehicle speed error obtained according to the previous cycle into the vehicle speed prediction model corresponding to the working condition classification, and obtain the predicted vehicle speed output by the vehicle speed prediction model.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the vehicle speed prediction method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Computer-aided method and device for probability-based speed prediction for vehicles
AT523850A4
Multi-modal vehicle speed prediction method based on driving data
CN111459995A
Vehicle speed prediction method based on Markov model optimization and working condition identification
CN113537620A
Acceleration prediction method for longitudinal dynamics of container vehicle based on deep learning
CN117172104A
Vehicle speed prediction method and device, electronic equipment and readable storage medium
CN118430224A
Cited By
Camera acquisition synchronization system based on vehicle speed information processing
CN120238617A
Camera acquisition synchronization system based on vehicle speed information processing
CN120238617B